From a8351909430626599bc4ebd020a2e59f75e7386a Mon Sep 17 00:00:00 2001 From: 17097231932 <17097231932@163.com> Date: Sat, 28 Jan 2023 19:08:34 +0800 Subject: [PATCH 01/11] switch to pnpm --- package-lock.json | 22020 -------------------------------------------- pnpm-lock.yaml | 5488 +++++++++++ 2 files changed, 5488 insertions(+), 22020 deletions(-) delete mode 100644 package-lock.json create mode 100644 pnpm-lock.yaml diff --git a/package-lock.json b/package-lock.json deleted file mode 100644 index 18b7784d..00000000 --- a/package-lock.json +++ /dev/null @@ -1,22020 +0,0 @@ -{ - "name": "gpu.js", - "version": "2.16.0", - "lockfileVersion": 2, - "requires": true, - "packages": { - "": { - "name": "gpu.js", - "version": "2.16.0", - "license": "MIT", - "dependencies": { - "acorn": "^7.1.1", - "gl": "^5.0.3", - "gl-wiretap": "^0.6.2", - "gpu-mock.js": "^1.3.0", - "webgpu": "^0.1.16" - }, - "devDependencies": { - "benchmark": "^2.1.4", - "browser-sync": "^2.26.7", - "browserify": "^17.0.0", - "c8": "^7.12.0", - "gulp": "^4.0.0", - "gulp-concat": "^2.6.0", - "gulp-header": "^1.7.1", - "gulp-jsbeautifier": "^2.1.0", - "gulp-rename": "^1.2.2", - "gulp-replace": "^1.0.0", - "gulp-strip-comments": "^2.4.5", - "gulp-uglify-es": "^3.0.0", - "merge-stream": "^1.0.1", - "qunit": "^2.9.1", - "read-dir-deep": "^7.0.1", - "sinon": "^7.3.2", - "vinyl-buffer": "^1.0.0", - "vinyl-source-stream": "^2.0.0" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/@bcoe/v8-coverage": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", - "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", - "dev": true - }, - "node_modules/@gar/promisify": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/@gar/promisify/-/promisify-1.1.3.tgz", - "integrity": "sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw==" - }, - "node_modules/@istanbuljs/schema": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", - "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz", - "integrity": "sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A==", - "dev": true, - "dependencies": { - "@jridgewell/set-array": "^1.0.1", - "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.9" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@jridgewell/resolve-uri": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz", - "integrity": "sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==", - "dev": true, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@jridgewell/set-array": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", - "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", - "dev": true, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@jridgewell/source-map": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.2.tgz", - "integrity": "sha512-m7O9o2uR8k2ObDysZYzdfhb08VuEml5oWGiosa1VdaPZ/A6QyPkAJuwN0Q1lhULOf6B7MtQmHENS743hWtCrgw==", - "dev": true, - "dependencies": { - "@jridgewell/gen-mapping": "^0.3.0", - "@jridgewell/trace-mapping": "^0.3.9" - } - }, - "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.4.14", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", - "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==", - "dev": true - }, - "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.17", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.17.tgz", - "integrity": "sha512-MCNzAp77qzKca9+W/+I0+sEpaUnZoeasnghNeVc41VZCEKaCH73Vq3BZZ/SzWIgrqE4H4ceI+p+b6C0mHf9T4g==", - "dev": true, - "dependencies": { - "@jridgewell/resolve-uri": "3.1.0", - "@jridgewell/sourcemap-codec": "1.4.14" - } - }, - "node_modules/@nodelib/fs.scandir": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.1.tgz", - "integrity": "sha512-NT/skIZjgotDSiXs0WqYhgcuBKhUMgfekCmCGtkUAiLqZdOnrdjmZr9wRl3ll64J9NF79uZ4fk16Dx0yMc/Xbg==", - "dev": true, - "dependencies": { - "@nodelib/fs.stat": "2.0.1", - "run-parallel": "^1.1.9" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.stat": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.1.tgz", - "integrity": "sha512-+RqhBlLn6YRBGOIoVYthsG0J9dfpO79eJyN7BYBkZJtfqrBwf2KK+rD/M/yjZR6WBmIhAgOV7S60eCgaSWtbFw==", - "dev": true, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.walk": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.2.tgz", - "integrity": "sha512-J/DR3+W12uCzAJkw7niXDcqcKBg6+5G5Q/ZpThpGNzAUz70eOR6RV4XnnSN01qHZiVl0eavoxJsBypQoKsV2QQ==", - "dev": true, - "dependencies": { - "@nodelib/fs.scandir": "2.1.1", - "fastq": "^1.6.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@npmcli/fs": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-2.1.0.tgz", - "integrity": "sha512-DmfBvNXGaetMxj9LTp8NAN9vEidXURrf5ZTslQzEAi/6GbW+4yjaLFQc6Tue5cpZ9Frlk4OBo/Snf1Bh/S7qTQ==", - "dependencies": { - "@gar/promisify": "^1.1.3", - "semver": "^7.3.5" - }, - "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" - } - }, - "node_modules/@npmcli/fs/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@npmcli/fs/node_modules/semver": { - "version": "7.3.7", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", - "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@npmcli/move-file": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@npmcli/move-file/-/move-file-2.0.0.tgz", - "integrity": "sha512-UR6D5f4KEGWJV6BGPH3Qb2EtgH+t+1XQ1Tt85c7qicN6cezzuHPdZwwAxqZr4JLtnQu0LZsTza/5gmNmSl8XLg==", - "deprecated": "This functionality has been moved to @npmcli/fs", - "dependencies": { - "mkdirp": "^1.0.4", - "rimraf": "^3.0.2" - }, - "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" - } - }, - "node_modules/@npmcli/move-file/node_modules/mkdirp": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", - "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", - "bin": { - "mkdirp": "bin/cmd.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@sinonjs/commons": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.4.0.tgz", - "integrity": "sha512-9jHK3YF/8HtJ9wCAbG+j8cD0i0+ATS9A7gXFqS36TblLPNy6rEEc+SB0imo91eCboGaBYGV/MT1/br/J+EE7Tw==", - "dev": true, - "dependencies": { - "type-detect": "4.0.8" - } - }, - "node_modules/@sinonjs/formatio": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/@sinonjs/formatio/-/formatio-3.2.1.tgz", - "integrity": "sha512-tsHvOB24rvyvV2+zKMmPkZ7dXX6LSLKZ7aOtXY6Edklp0uRcgGpOsQTTGTcWViFyx4uhWc6GV8QdnALbIbIdeQ==", - "dev": true, - "dependencies": { - "@sinonjs/commons": "^1", - "@sinonjs/samsam": "^3.1.0" - } - }, - "node_modules/@sinonjs/samsam": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-3.3.2.tgz", - "integrity": "sha512-ILO/rR8LfAb60Y1Yfp9vxfYAASK43NFC2mLzpvLUbCQY/Qu8YwReboseu8aheCEkyElZF2L2T9mHcR2bgdvZyA==", - "dev": true, - "dependencies": { - "@sinonjs/commons": "^1.0.2", - "array-from": "^2.1.1", - "lodash": "^4.17.11" - } - }, - "node_modules/@sinonjs/text-encoding": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/@sinonjs/text-encoding/-/text-encoding-0.7.1.tgz", - "integrity": "sha512-+iTbntw2IZPb/anVDbypzfQa+ay64MW0Zo8aJ8gZPWMMK6/OubMVb6lUPMagqjOPnmtauXnFCACVl3O7ogjeqQ==", - "dev": true - }, - "node_modules/@socket.io/component-emitter": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@socket.io/component-emitter/-/component-emitter-3.1.0.tgz", - "integrity": "sha512-+9jVqKhRSpsc591z5vX+X5Yyw+he/HCB4iQ/RYxw35CEPaY1gnsNE43nf9n9AaYjAQrTiI/mOwKUKdUs9vf7Xg==", - "dev": true - }, - "node_modules/@tootallnate/once": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", - "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==", - "engines": { - "node": ">= 10" - } - }, - "node_modules/@types/cookie": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/@types/cookie/-/cookie-0.4.1.tgz", - "integrity": "sha512-XW/Aa8APYr6jSVVA1y/DEIZX0/GMKLEVekNG727R8cs56ahETkRAy/3DR7+fJyh7oUgGwNQaRfXCun0+KbWY7Q==", - "dev": true - }, - "node_modules/@types/cors": { - "version": "2.8.12", - "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.12.tgz", - "integrity": "sha512-vt+kDhq/M2ayberEtJcIN/hxXy1Pk+59g2FV/ZQceeaTyCtCucjL2Q7FXlFjtWn4n15KCr1NE2lNNFhp0lEThw==", - "dev": true - }, - "node_modules/@types/events": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz", - "integrity": "sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g==", - "dev": true - }, - "node_modules/@types/glob": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.1.1.tgz", - "integrity": "sha512-1Bh06cbWJUHMC97acuD6UMG29nMt0Aqz1vF3guLfG+kHHJhy3AyohZFFxYk2f7Q1SQIrNwvncxAE0N/9s70F2w==", - "dev": true, - "dependencies": { - "@types/events": "*", - "@types/minimatch": "*", - "@types/node": "*" - } - }, - "node_modules/@types/istanbul-lib-coverage": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz", - "integrity": "sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g==", - "dev": true - }, - "node_modules/@types/minimatch": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz", - "integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==", - "dev": true - }, - "node_modules/@types/node": { - "version": "12.6.8", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.6.8.tgz", - "integrity": "sha512-aX+gFgA5GHcDi89KG5keey2zf0WfZk/HAQotEamsK2kbey+8yGKcson0hbK8E+v0NArlCJQCqMP161YhV6ZXLg==", - "dev": true - }, - "node_modules/abbrev": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", - "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" - }, - "node_modules/accepts": { - "version": "1.3.7", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", - "integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==", - "dev": true, - "dependencies": { - "mime-types": "~2.1.24", - "negotiator": "0.6.2" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/acorn": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.1.1.tgz", - "integrity": "sha512-add7dgA5ppRPxCFJoAGfMDi7PIBXq1RtGo7BhbLaxwrXPOmw8gq48Y9ozT01hUKy9byMjlR20EJhu5zlkErEkg==", - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/acorn-node": { - "version": "1.8.2", - "resolved": "https://registry.npmjs.org/acorn-node/-/acorn-node-1.8.2.tgz", - "integrity": "sha512-8mt+fslDufLYntIoPAaIMUe/lrbrehIiwmR3t2k9LljIzoigEPF27eLk2hy8zSGzmR/ogr7zbRKINMo1u0yh5A==", - "dev": true, - "dependencies": { - "acorn": "^7.0.0", - "acorn-walk": "^7.0.0", - "xtend": "^4.0.2" - } - }, - "node_modules/acorn-node/node_modules/acorn-walk": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-7.1.1.tgz", - "integrity": "sha512-wdlPY2tm/9XBr7QkKlq0WQVgiuGTX6YWPyRyBviSoScBuLfTVQhvwg6wJ369GJ/1nPfTLMfnrFIfjqVg6d+jQQ==", - "dev": true, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/agent-base": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", - "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", - "dependencies": { - "debug": "4" - }, - "engines": { - "node": ">= 6.0.0" - } - }, - "node_modules/agent-base/node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/agent-base/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - }, - "node_modules/agentkeepalive": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.2.1.tgz", - "integrity": "sha512-Zn4cw2NEqd+9fiSVWMscnjyQ1a8Yfoc5oBajLeo5w+YBHgDUcEBY2hS4YpTz6iN5f/2zQiktcuM6tS8x1p9dpA==", - "dependencies": { - "debug": "^4.1.0", - "depd": "^1.1.2", - "humanize-ms": "^1.2.1" - }, - "engines": { - "node": ">= 8.0.0" - } - }, - "node_modules/agentkeepalive/node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/agentkeepalive/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - }, - "node_modules/aggregate-error": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", - "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", - "dependencies": { - "clean-stack": "^2.0.0", - "indent-string": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "peer": true, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/ansi-colors": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-1.1.0.tgz", - "integrity": "sha512-SFKX67auSNoVR38N3L+nvsPjOE0bybKTYbkf5tRvushrAPQ9V75huw0ZxBkKVeRU9kqH3d6HA4xTckbwZ4ixmA==", - "dev": true, - "dependencies": { - "ansi-wrap": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ansi-cyan": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/ansi-cyan/-/ansi-cyan-0.1.1.tgz", - "integrity": "sha1-U4rlKK+JgvKK4w2G8vF0VtJgmHM=", - "dev": true, - "dependencies": { - "ansi-wrap": "0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ansi-gray": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/ansi-gray/-/ansi-gray-0.1.1.tgz", - "integrity": "sha1-KWLPVOyXksSFEKPetSRDaGHvclE=", - "dev": true, - "dependencies": { - "ansi-wrap": "0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ansi-red": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/ansi-red/-/ansi-red-0.1.1.tgz", - "integrity": "sha1-jGOPnRCAgAo1PJwoyKgcpHBdlGw=", - "dev": true, - "dependencies": { - "ansi-wrap": "0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ansi-wrap": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/ansi-wrap/-/ansi-wrap-0.1.0.tgz", - "integrity": "sha1-qCJQ3bABXponyoLoLqYDu/pF768=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/anymatch": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", - "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", - "dev": true, - "dependencies": { - "micromatch": "^3.1.4", - "normalize-path": "^2.1.1" - } - }, - "node_modules/anymatch/node_modules/normalize-path": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", - "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", - "dev": true, - "dependencies": { - "remove-trailing-separator": "^1.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/append-buffer": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/append-buffer/-/append-buffer-1.0.2.tgz", - "integrity": "sha1-2CIM9GYIFSXv6lBhTz3mUU36WPE=", - "dev": true, - "dependencies": { - "buffer-equal": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/aproba": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz", - "integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==" - }, - "node_modules/archy": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", - "integrity": "sha1-+cjBN1fMHde8N5rHeyxipcKGjEA=", - "dev": true - }, - "node_modules/are-we-there-yet": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-3.0.0.tgz", - "integrity": "sha512-0GWpv50YSOcLXaN6/FAKY3vfRbllXWV2xvfA/oKJF8pzFhWXPV+yjhJXDBbjscDYowv7Yw1A3uigpzn5iEGTyw==", - "dependencies": { - "delegates": "^1.0.0", - "readable-stream": "^3.6.0" - }, - "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16" - } - }, - "node_modules/are-we-there-yet/node_modules/readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/are-we-there-yet/node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/are-we-there-yet/node_modules/string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dependencies": { - "safe-buffer": "~5.2.0" - } - }, - "node_modules/arr-diff": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", - "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/arr-filter": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/arr-filter/-/arr-filter-1.1.2.tgz", - "integrity": "sha1-Q/3d0JHo7xGqTEXZzcGOLf8XEe4=", - "dev": true, - "dependencies": { - "make-iterator": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/arr-flatten": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", - "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/arr-map": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/arr-map/-/arr-map-2.0.2.tgz", - "integrity": "sha1-Onc0X/wc814qkYJWAfnljy4kysQ=", - "dev": true, - "dependencies": { - "make-iterator": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/arr-union": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", - "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/array-each": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/array-each/-/array-each-1.0.1.tgz", - "integrity": "sha1-p5SvDAWrF1KEbudTofIRoFugxE8=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/array-from": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/array-from/-/array-from-2.1.1.tgz", - "integrity": "sha1-z+nYwmYoudxa7MYqn12PHzUsEZU=", - "dev": true - }, - "node_modules/array-initial": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/array-initial/-/array-initial-1.1.0.tgz", - "integrity": "sha1-L6dLJnOTccOUe9enrcc74zSz15U=", - "dev": true, - "dependencies": { - "array-slice": "^1.0.0", - "is-number": "^4.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/array-initial/node_modules/is-number": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", - "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/array-last": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/array-last/-/array-last-1.3.0.tgz", - "integrity": "sha512-eOCut5rXlI6aCOS7Z7kCplKRKyiFQ6dHFBem4PwlwKeNFk2/XxTrhRh5T9PyaEWGy/NHTZWbY+nsZlNFJu9rYg==", - "dev": true, - "dependencies": { - "is-number": "^4.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/array-last/node_modules/is-number": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", - "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/array-slice": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/array-slice/-/array-slice-1.1.0.tgz", - "integrity": "sha512-B1qMD3RBP7O8o0H2KbrXDyB0IccejMF15+87Lvlor12ONPRHP6gTjXMNkt/d3ZuOGbAe66hFmaCfECI24Ufp6w==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/array-sort": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/array-sort/-/array-sort-1.0.0.tgz", - "integrity": "sha512-ihLeJkonmdiAsD7vpgN3CRcx2J2S0TiYW+IS/5zHBI7mKUq3ySvBdzzBfD236ubDBQFiiyG3SWCPc+msQ9KoYg==", - "dev": true, - "dependencies": { - "default-compare": "^1.0.0", - "get-value": "^2.0.6", - "kind-of": "^5.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/array-sort/node_modules/kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/array-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/array-unique": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", - "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/asn1": { - "version": "0.2.6", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz", - "integrity": "sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==", - "peer": true, - "dependencies": { - "safer-buffer": "~2.1.0" - } - }, - "node_modules/asn1.js": { - "version": "4.10.1", - "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.10.1.tgz", - "integrity": "sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw==", - "dev": true, - "dependencies": { - "bn.js": "^4.0.0", - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0" - } - }, - "node_modules/assert": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/assert/-/assert-1.5.0.tgz", - "integrity": "sha512-EDsgawzwoun2CZkCgtxJbv392v4nbk9XDD06zI+kQYoBM/3RBWLlEyJARDOmhAAosBjWACEkKL6S+lIZtcAubA==", - "dev": true, - "dependencies": { - "object-assign": "^4.1.1", - "util": "0.10.3" - } - }, - "node_modules/assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==", - "peer": true, - "engines": { - "node": ">=0.8" - } - }, - "node_modules/assert/node_modules/inherits": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", - "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=", - "dev": true - }, - "node_modules/assert/node_modules/util": { - "version": "0.10.3", - "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", - "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=", - "dev": true, - "dependencies": { - "inherits": "2.0.1" - } - }, - "node_modules/assign-symbols": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", - "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/async": { - "version": "2.6.4", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.4.tgz", - "integrity": "sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA==", - "dev": true, - "dependencies": { - "lodash": "^4.17.14" - } - }, - "node_modules/async-done": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/async-done/-/async-done-1.3.2.tgz", - "integrity": "sha512-uYkTP8dw2og1tu1nmza1n1CMW0qb8gWWlwqMmLb7MhBVs4BXrFziT6HXUd+/RlRA/i4H9AkofYloUbs1fwMqlw==", - "dev": true, - "dependencies": { - "end-of-stream": "^1.1.0", - "once": "^1.3.2", - "process-nextick-args": "^2.0.0", - "stream-exhaust": "^1.0.1" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/async-each": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.3.tgz", - "integrity": "sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ==", - "dev": true - }, - "node_modules/async-each-series": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/async-each-series/-/async-each-series-0.1.1.tgz", - "integrity": "sha512-p4jj6Fws4Iy2m0iCmI2am2ZNZCgbdgE+P8F/8csmn2vx7ixXrO2zGcuNsD46X5uZSVecmkEy/M06X2vG8KD6dQ==", - "dev": true, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/async-settle": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/async-settle/-/async-settle-1.0.0.tgz", - "integrity": "sha1-HQqRS7Aldb7IqPOnTlCA9yssDGs=", - "dev": true, - "dependencies": { - "async-done": "^1.2.2" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", - "peer": true - }, - "node_modules/atob": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", - "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", - "dev": true, - "bin": { - "atob": "bin/atob.js" - }, - "engines": { - "node": ">= 4.5.0" - } - }, - "node_modules/available-typed-arrays": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", - "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/aws-sign2": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA==", - "peer": true, - "engines": { - "node": "*" - } - }, - "node_modules/aws4": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.11.0.tgz", - "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==", - "peer": true - }, - "node_modules/axios": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", - "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", - "dev": true, - "dependencies": { - "follow-redirects": "^1.14.0" - } - }, - "node_modules/bach": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/bach/-/bach-1.2.0.tgz", - "integrity": "sha1-Szzpa/JxNPeaG0FKUcFONMO9mIA=", - "dev": true, - "dependencies": { - "arr-filter": "^1.1.1", - "arr-flatten": "^1.0.1", - "arr-map": "^2.0.0", - "array-each": "^1.0.0", - "array-initial": "^1.0.0", - "array-last": "^1.1.1", - "async-done": "^1.2.2", - "async-settle": "^1.0.0", - "now-and-later": "^2.0.0" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" - }, - "node_modules/base": { - "version": "0.11.2", - "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", - "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", - "dev": true, - "dependencies": { - "cache-base": "^1.0.1", - "class-utils": "^0.3.5", - "component-emitter": "^1.2.1", - "define-property": "^1.0.0", - "isobject": "^3.0.1", - "mixin-deep": "^1.2.0", - "pascalcase": "^0.1.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/base/node_modules/define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "dependencies": { - "is-descriptor": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/base/node_modules/is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "dependencies": { - "kind-of": "^6.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/base/node_modules/is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "dependencies": { - "kind-of": "^6.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/base/node_modules/is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "dependencies": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/base64-js": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.0.tgz", - "integrity": "sha512-ccav/yGvoa80BQDljCxsmmQ3Xvx60/UpBIij5QN21W3wBi/hhIC9OoO+KLpu9IJTS9j4DRVJ3aDDF9cMSoa2lw==", - "dev": true - }, - "node_modules/base64id": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/base64id/-/base64id-2.0.0.tgz", - "integrity": "sha512-lGe34o6EHj9y3Kts9R4ZYs/Gr+6N7MCaMlIFA3F1R2O5/m7K06AxfSeO5530PEERE6/WyEg3lsuyw4GHlPZHog==", - "dev": true, - "engines": { - "node": "^4.5.0 || >= 5.9" - } - }, - "node_modules/batch": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/batch/-/batch-0.6.1.tgz", - "integrity": "sha1-3DQxT05nkxgJP8dgJyUl+UvyXBY=", - "dev": true - }, - "node_modules/bcrypt-pbkdf": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", - "integrity": "sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w==", - "peer": true, - "dependencies": { - "tweetnacl": "^0.14.3" - } - }, - "node_modules/benchmark": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/benchmark/-/benchmark-2.1.4.tgz", - "integrity": "sha1-CfPeMckWQl1JjMLuVloOvzwqVik=", - "dev": true, - "dependencies": { - "lodash": "^4.17.4", - "platform": "^1.3.3" - } - }, - "node_modules/binary-extensions": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz", - "integrity": "sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/binaryextensions": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/binaryextensions/-/binaryextensions-2.1.2.tgz", - "integrity": "sha512-xVNN69YGDghOqCCtA6FI7avYrr02mTJjOgB0/f1VPD3pJC8QEvjTKWc4epDx8AqxxA75NI0QpVM2gPJXUbE4Tg==", - "dev": true, - "engines": { - "node": ">=0.8" - } - }, - "node_modules/bindings": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", - "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", - "dependencies": { - "file-uri-to-path": "1.0.0" - } - }, - "node_modules/bit-twiddle": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/bit-twiddle/-/bit-twiddle-1.0.2.tgz", - "integrity": "sha512-B9UhK0DKFZhoTFcfvAzhqsjStvGJp9vYWf3+6SNTtdSQnvIgfkHbgHrg/e4+TH71N2GDu8tpmCVoyfrL1d7ntA==" - }, - "node_modules/bl": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/bl/-/bl-1.2.3.tgz", - "integrity": "sha512-pvcNpa0UU69UT341rO6AYy4FVAIkUHuZXRIWbq+zHnsVcRzDDjIAhGuuYoi0d//cwIwtt4pkpKycWEfjdV+vww==", - "dev": true, - "dependencies": { - "readable-stream": "^2.3.5", - "safe-buffer": "^5.1.1" - } - }, - "node_modules/bl/node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "node_modules/bl/node_modules/readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/bl/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, - "node_modules/bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", - "dev": true - }, - "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/braces": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", - "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", - "dev": true, - "dependencies": { - "arr-flatten": "^1.1.0", - "array-unique": "^0.3.2", - "extend-shallow": "^2.0.1", - "fill-range": "^4.0.0", - "isobject": "^3.0.1", - "repeat-element": "^1.1.2", - "snapdragon": "^0.8.1", - "snapdragon-node": "^2.0.1", - "split-string": "^3.0.2", - "to-regex": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/braces/node_modules/extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "dependencies": { - "is-extendable": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/brorand": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", - "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=", - "dev": true - }, - "node_modules/browser-pack": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/browser-pack/-/browser-pack-6.1.0.tgz", - "integrity": "sha512-erYug8XoqzU3IfcU8fUgyHqyOXqIE4tUTTQ+7mqUjQlvnXkOO6OlT9c/ZoJVHYoAaqGxr09CN53G7XIsO4KtWA==", - "dev": true, - "dependencies": { - "combine-source-map": "~0.8.0", - "defined": "^1.0.0", - "JSONStream": "^1.0.3", - "safe-buffer": "^5.1.1", - "through2": "^2.0.0", - "umd": "^3.0.0" - }, - "bin": { - "browser-pack": "bin/cmd.js" - } - }, - "node_modules/browser-pack/node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "node_modules/browser-pack/node_modules/readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/browser-pack/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, - "node_modules/browser-pack/node_modules/through2": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", - "dev": true, - "dependencies": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" - } - }, - "node_modules/browser-resolve": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/browser-resolve/-/browser-resolve-2.0.0.tgz", - "integrity": "sha512-7sWsQlYL2rGLy2IWm8WL8DCTJvYLc/qlOnsakDac87SOoCd16WLsaAMdCiAqsTNHIe+SXfaqyxyo6THoWqs8WQ==", - "dev": true, - "dependencies": { - "resolve": "^1.17.0" - } - }, - "node_modules/browser-sync": { - "version": "2.27.10", - "resolved": "https://registry.npmjs.org/browser-sync/-/browser-sync-2.27.10.tgz", - "integrity": "sha512-xKm+6KJmJu6RuMWWbFkKwOCSqQOxYe3nOrFkKI5Tr/ZzjPxyU3pFShKK3tWnazBo/3lYQzN7fzjixG8fwJh1Xw==", - "dev": true, - "dependencies": { - "browser-sync-client": "^2.27.10", - "browser-sync-ui": "^2.27.10", - "bs-recipes": "1.3.4", - "bs-snippet-injector": "^2.0.1", - "chokidar": "^3.5.1", - "connect": "3.6.6", - "connect-history-api-fallback": "^1", - "dev-ip": "^1.0.1", - "easy-extender": "^2.3.4", - "eazy-logger": "3.1.0", - "etag": "^1.8.1", - "fresh": "^0.5.2", - "fs-extra": "3.0.1", - "http-proxy": "^1.18.1", - "immutable": "^3", - "localtunnel": "^2.0.1", - "micromatch": "^4.0.2", - "opn": "5.3.0", - "portscanner": "2.2.0", - "qs": "6.2.3", - "raw-body": "^2.3.2", - "resp-modifier": "6.0.2", - "rx": "4.1.0", - "send": "0.16.2", - "serve-index": "1.9.1", - "serve-static": "1.13.2", - "server-destroy": "1.0.1", - "socket.io": "^4.4.1", - "ua-parser-js": "1.0.2", - "yargs": "^17.3.1" - }, - "bin": { - "browser-sync": "dist/bin.js" - }, - "engines": { - "node": ">= 8.0.0" - } - }, - "node_modules/browser-sync-client": { - "version": "2.27.10", - "resolved": "https://registry.npmjs.org/browser-sync-client/-/browser-sync-client-2.27.10.tgz", - "integrity": "sha512-KCFKA1YDj6cNul0VsA28apohtBsdk5Wv8T82ClOZPZMZWxPj4Ny5AUbrj9UlAb/k6pdxE5HABrWDhP9+cjt4HQ==", - "dev": true, - "dependencies": { - "etag": "1.8.1", - "fresh": "0.5.2", - "mitt": "^1.1.3", - "rxjs": "^5.5.6", - "typescript": "^4.6.2" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/browser-sync-ui": { - "version": "2.27.10", - "resolved": "https://registry.npmjs.org/browser-sync-ui/-/browser-sync-ui-2.27.10.tgz", - "integrity": "sha512-elbJILq4Uo6OQv6gsvS3Y9vRAJlWu+h8j0JDkF0X/ua+3S6SVbbiWnZc8sNOFlG7yvVGIwBED3eaYQ0iBo1Dtw==", - "dev": true, - "dependencies": { - "async-each-series": "0.1.1", - "connect-history-api-fallback": "^1", - "immutable": "^3", - "server-destroy": "1.0.1", - "socket.io-client": "^4.4.1", - "stream-throttle": "^0.1.3" - } - }, - "node_modules/browser-sync/node_modules/anymatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", - "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", - "dev": true, - "dependencies": { - "normalize-path": "^3.0.0", - "picomatch": "^2.0.4" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/browser-sync/node_modules/binary-extensions": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", - "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/browser-sync/node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, - "dependencies": { - "fill-range": "^7.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/browser-sync/node_modules/chokidar": { - "version": "3.5.3", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", - "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", - "dev": true, - "funding": [ - { - "type": "individual", - "url": "https://paulmillr.com/funding/" - } - ], - "dependencies": { - "anymatch": "~3.1.2", - "braces": "~3.0.2", - "glob-parent": "~5.1.2", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.6.0" - }, - "engines": { - "node": ">= 8.10.0" - }, - "optionalDependencies": { - "fsevents": "~2.3.2" - } - }, - "node_modules/browser-sync/node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, - "dependencies": { - "to-regex-range": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/browser-sync/node_modules/fsevents": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", - "dev": true, - "hasInstallScript": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, - "node_modules/browser-sync/node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, - "dependencies": { - "is-glob": "^4.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/browser-sync/node_modules/is-binary-path": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", - "dev": true, - "dependencies": { - "binary-extensions": "^2.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/browser-sync/node_modules/is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true, - "engines": { - "node": ">=0.12.0" - } - }, - "node_modules/browser-sync/node_modules/micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", - "dev": true, - "dependencies": { - "braces": "^3.0.2", - "picomatch": "^2.3.1" - }, - "engines": { - "node": ">=8.6" - } - }, - "node_modules/browser-sync/node_modules/qs": { - "version": "6.2.3", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.2.3.tgz", - "integrity": "sha1-HPyyXBCpsrSDBT/zn138kjOQjP4=", - "dev": true, - "engines": { - "node": ">=0.6" - } - }, - "node_modules/browser-sync/node_modules/readdirp": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", - "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", - "dev": true, - "dependencies": { - "picomatch": "^2.2.1" - }, - "engines": { - "node": ">=8.10.0" - } - }, - "node_modules/browser-sync/node_modules/to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "dependencies": { - "is-number": "^7.0.0" - }, - "engines": { - "node": ">=8.0" - } - }, - "node_modules/browserify": { - "version": "17.0.0", - "resolved": "https://registry.npmjs.org/browserify/-/browserify-17.0.0.tgz", - "integrity": "sha512-SaHqzhku9v/j6XsQMRxPyBrSP3gnwmE27gLJYZgMT2GeK3J0+0toN+MnuNYDfHwVGQfLiMZ7KSNSIXHemy905w==", - "dev": true, - "dependencies": { - "assert": "^1.4.0", - "browser-pack": "^6.0.1", - "browser-resolve": "^2.0.0", - "browserify-zlib": "~0.2.0", - "buffer": "~5.2.1", - "cached-path-relative": "^1.0.0", - "concat-stream": "^1.6.0", - "console-browserify": "^1.1.0", - "constants-browserify": "~1.0.0", - "crypto-browserify": "^3.0.0", - "defined": "^1.0.0", - "deps-sort": "^2.0.1", - "domain-browser": "^1.2.0", - "duplexer2": "~0.1.2", - "events": "^3.0.0", - "glob": "^7.1.0", - "has": "^1.0.0", - "htmlescape": "^1.1.0", - "https-browserify": "^1.0.0", - "inherits": "~2.0.1", - "insert-module-globals": "^7.2.1", - "JSONStream": "^1.0.3", - "labeled-stream-splicer": "^2.0.0", - "mkdirp-classic": "^0.5.2", - "module-deps": "^6.2.3", - "os-browserify": "~0.3.0", - "parents": "^1.0.1", - "path-browserify": "^1.0.0", - "process": "~0.11.0", - "punycode": "^1.3.2", - "querystring-es3": "~0.2.0", - "read-only-stream": "^2.0.0", - "readable-stream": "^2.0.2", - "resolve": "^1.1.4", - "shasum-object": "^1.0.0", - "shell-quote": "^1.6.1", - "stream-browserify": "^3.0.0", - "stream-http": "^3.0.0", - "string_decoder": "^1.1.1", - "subarg": "^1.0.0", - "syntax-error": "^1.1.1", - "through2": "^2.0.0", - "timers-browserify": "^1.0.1", - "tty-browserify": "0.0.1", - "url": "~0.11.0", - "util": "~0.12.0", - "vm-browserify": "^1.0.0", - "xtend": "^4.0.0" - }, - "bin": { - "browserify": "bin/cmd.js" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/browserify-aes": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", - "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", - "dev": true, - "dependencies": { - "buffer-xor": "^1.0.3", - "cipher-base": "^1.0.0", - "create-hash": "^1.1.0", - "evp_bytestokey": "^1.0.3", - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "node_modules/browserify-cipher": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz", - "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==", - "dev": true, - "dependencies": { - "browserify-aes": "^1.0.4", - "browserify-des": "^1.0.0", - "evp_bytestokey": "^1.0.0" - } - }, - "node_modules/browserify-des": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.2.tgz", - "integrity": "sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==", - "dev": true, - "dependencies": { - "cipher-base": "^1.0.1", - "des.js": "^1.0.0", - "inherits": "^2.0.1", - "safe-buffer": "^5.1.2" - } - }, - "node_modules/browserify-rsa": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", - "integrity": "sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ=", - "dev": true, - "dependencies": { - "bn.js": "^4.1.0", - "randombytes": "^2.0.1" - } - }, - "node_modules/browserify-sign": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.0.4.tgz", - "integrity": "sha1-qk62jl17ZYuqa/alfmMMvXqT0pg=", - "dev": true, - "dependencies": { - "bn.js": "^4.1.1", - "browserify-rsa": "^4.0.0", - "create-hash": "^1.1.0", - "create-hmac": "^1.1.2", - "elliptic": "^6.0.0", - "inherits": "^2.0.1", - "parse-asn1": "^5.0.0" - } - }, - "node_modules/browserify-zlib": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz", - "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==", - "dev": true, - "dependencies": { - "pako": "~1.0.5" - } - }, - "node_modules/browserify/node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "node_modules/browserify/node_modules/punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", - "dev": true - }, - "node_modules/browserify/node_modules/readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/browserify/node_modules/readable-stream/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, - "node_modules/browserify/node_modules/string_decoder": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.2.0.tgz", - "integrity": "sha512-6YqyX6ZWEYguAxgZzHGL7SsCeGx3V2TtOTqZz1xSTSWnqsbWwbptafNyvf/ACquZUXV3DANr5BDIwNYe1mN42w==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, - "node_modules/browserify/node_modules/through2": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", - "dev": true, - "dependencies": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" - } - }, - "node_modules/bs-recipes": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/bs-recipes/-/bs-recipes-1.3.4.tgz", - "integrity": "sha1-DS1NSKcYyMBEdp/cT4lZLci2lYU=", - "dev": true - }, - "node_modules/bs-snippet-injector": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/bs-snippet-injector/-/bs-snippet-injector-2.0.1.tgz", - "integrity": "sha1-YbU5PxH1JVntEgaTEANDtu2wTdU=", - "dev": true - }, - "node_modules/buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.2.1.tgz", - "integrity": "sha512-c+Ko0loDaFfuPWiL02ls9Xd3GO3cPVmUobQ6t3rXNUk304u6hGq+8N/kFi+QEIKhzK3uwolVhLzszmfLmMLnqg==", - "dev": true, - "dependencies": { - "base64-js": "^1.0.2", - "ieee754": "^1.1.4" - } - }, - "node_modules/buffer-equal": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/buffer-equal/-/buffer-equal-1.0.0.tgz", - "integrity": "sha1-WWFrSYME1Var1GaWayLu2j7KX74=", - "dev": true, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/buffer-from": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", - "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", - "dev": true - }, - "node_modules/buffer-xor": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", - "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=", - "dev": true - }, - "node_modules/builtin-status-codes": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", - "integrity": "sha512-HpGFw18DgFWlncDfjTa2rcQ4W88O1mC8e8yZ2AvQY5KDaktSTwo+KRf6nHK6FRI5FyRyb/5T6+TSxfP7QyGsmQ==", - "dev": true - }, - "node_modules/bytes": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz", - "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==", - "dev": true, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/c8": { - "version": "7.12.0", - "resolved": "https://registry.npmjs.org/c8/-/c8-7.12.0.tgz", - "integrity": "sha512-CtgQrHOkyxr5koX1wEUmN/5cfDa2ckbHRA4Gy5LAL0zaCFtVWJS5++n+w4/sr2GWGerBxgTjpKeDclk/Qk6W/A==", - "dev": true, - "dependencies": { - "@bcoe/v8-coverage": "^0.2.3", - "@istanbuljs/schema": "^0.1.3", - "find-up": "^5.0.0", - "foreground-child": "^2.0.0", - "istanbul-lib-coverage": "^3.2.0", - "istanbul-lib-report": "^3.0.0", - "istanbul-reports": "^3.1.4", - "rimraf": "^3.0.2", - "test-exclude": "^6.0.0", - "v8-to-istanbul": "^9.0.0", - "yargs": "^16.2.0", - "yargs-parser": "^20.2.9" - }, - "bin": { - "c8": "bin/c8.js" - }, - "engines": { - "node": ">=10.12.0" - } - }, - "node_modules/c8/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/c8/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/c8/node_modules/cliui": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", - "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", - "dev": true, - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^7.0.0" - } - }, - "node_modules/c8/node_modules/find-up": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", - "dev": true, - "dependencies": { - "locate-path": "^6.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/c8/node_modules/get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "dev": true, - "engines": { - "node": "6.* || 8.* || >= 10.*" - } - }, - "node_modules/c8/node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/c8/node_modules/path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/c8/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/c8/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/c8/node_modules/wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, - "node_modules/c8/node_modules/y18n": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", - "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", - "dev": true, - "engines": { - "node": ">=10" - } - }, - "node_modules/c8/node_modules/yargs": { - "version": "16.2.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", - "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", - "dev": true, - "dependencies": { - "cliui": "^7.0.2", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.0", - "y18n": "^5.0.5", - "yargs-parser": "^20.2.2" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/cacache": { - "version": "16.1.1", - "resolved": "https://registry.npmjs.org/cacache/-/cacache-16.1.1.tgz", - "integrity": "sha512-VDKN+LHyCQXaaYZ7rA/qtkURU+/yYhviUdvqEv2LT6QPZU8jpyzEkEVAcKlKLt5dJ5BRp11ym8lo3NKLluEPLg==", - "dependencies": { - "@npmcli/fs": "^2.1.0", - "@npmcli/move-file": "^2.0.0", - "chownr": "^2.0.0", - "fs-minipass": "^2.1.0", - "glob": "^8.0.1", - "infer-owner": "^1.0.4", - "lru-cache": "^7.7.1", - "minipass": "^3.1.6", - "minipass-collect": "^1.0.2", - "minipass-flush": "^1.0.5", - "minipass-pipeline": "^1.2.4", - "mkdirp": "^1.0.4", - "p-map": "^4.0.0", - "promise-inflight": "^1.0.1", - "rimraf": "^3.0.2", - "ssri": "^9.0.0", - "tar": "^6.1.11", - "unique-filename": "^1.1.1" - }, - "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" - } - }, - "node_modules/cacache/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/cacache/node_modules/glob": { - "version": "8.0.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-8.0.3.tgz", - "integrity": "sha512-ull455NHSHI/Y1FqGaaYFaLGkNMMJbavMrEGFXG/PGrg6y7sutWHUHrz6gy6WEBH6akM1M414dWKCNs+IhKdiQ==", - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^5.0.1", - "once": "^1.3.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/cacache/node_modules/lru-cache": { - "version": "7.12.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.12.0.tgz", - "integrity": "sha512-OIP3DwzRZDfLg9B9VP/huWBlpvbkmbfiBy8xmsXp4RPmE4A3MhwNozc5ZJ3fWnSg8fDcdlE/neRTPG2ycEKliw==", - "engines": { - "node": ">=12" - } - }, - "node_modules/cacache/node_modules/minimatch": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.0.tgz", - "integrity": "sha512-9TPBGGak4nHfGZsPBohm9AWg6NoT7QTCehS3BIJABslyZbzxfV78QM2Y6+i741OPZIafFAaiiEMh5OyIrJPgtg==", - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/cacache/node_modules/mkdirp": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", - "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", - "bin": { - "mkdirp": "bin/cmd.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/cache-base": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", - "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", - "dev": true, - "dependencies": { - "collection-visit": "^1.0.0", - "component-emitter": "^1.2.1", - "get-value": "^2.0.6", - "has-value": "^1.0.0", - "isobject": "^3.0.1", - "set-value": "^2.0.0", - "to-object-path": "^0.3.0", - "union-value": "^1.0.0", - "unset-value": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/cached-path-relative": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/cached-path-relative/-/cached-path-relative-1.1.0.tgz", - "integrity": "sha512-WF0LihfemtesFcJgO7xfOoOcnWzY/QHR4qeDqV44jPU3HTI54+LnfXK3SA27AVVGCdZFgjjFFaqUA9Jx7dMJZA==", - "dev": true - }, - "node_modules/call-bind": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", - "dev": true, - "dependencies": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/camelcase": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", - "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/caseless": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==", - "peer": true - }, - "node_modules/chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "dev": true, - "dependencies": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/chokidar": { - "version": "2.1.8", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.8.tgz", - "integrity": "sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg==", - "deprecated": "Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies", - "dev": true, - "dependencies": { - "anymatch": "^2.0.0", - "async-each": "^1.0.1", - "braces": "^2.3.2", - "glob-parent": "^3.1.0", - "inherits": "^2.0.3", - "is-binary-path": "^1.0.0", - "is-glob": "^4.0.0", - "normalize-path": "^3.0.0", - "path-is-absolute": "^1.0.0", - "readdirp": "^2.2.1", - "upath": "^1.1.1" - }, - "optionalDependencies": { - "fsevents": "^1.2.7" - } - }, - "node_modules/chownr": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", - "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", - "engines": { - "node": ">=10" - } - }, - "node_modules/cipher-base": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", - "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", - "dev": true, - "dependencies": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "node_modules/class-utils": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", - "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", - "dev": true, - "dependencies": { - "arr-union": "^3.1.0", - "define-property": "^0.2.5", - "isobject": "^3.0.0", - "static-extend": "^0.1.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/class-utils/node_modules/define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "dependencies": { - "is-descriptor": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/clean-stack": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", - "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", - "engines": { - "node": ">=6" - } - }, - "node_modules/cliui": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", - "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", - "dev": true, - "dependencies": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wrap-ansi": "^2.0.0" - } - }, - "node_modules/clone": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz", - "integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18=", - "dev": true, - "engines": { - "node": ">=0.8" - } - }, - "node_modules/clone-buffer": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/clone-buffer/-/clone-buffer-1.0.0.tgz", - "integrity": "sha1-4+JbIHrE5wGvch4staFnksrD3Fg=", - "dev": true, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/clone-stats": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/clone-stats/-/clone-stats-1.0.0.tgz", - "integrity": "sha1-s3gt/4u1R04Yuba/D9/ngvh3doA=", - "dev": true - }, - "node_modules/cloneable-readable": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/cloneable-readable/-/cloneable-readable-1.1.3.tgz", - "integrity": "sha512-2EF8zTQOxYq70Y4XKtorQupqF0m49MBz2/yf5Bj+MHjvpG3Hy7sImifnqD6UA+TKYxeSV+u6qqQPawN5UvnpKQ==", - "dev": true, - "dependencies": { - "inherits": "^2.0.1", - "process-nextick-args": "^2.0.0", - "readable-stream": "^2.3.5" - } - }, - "node_modules/cloneable-readable/node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "node_modules/cloneable-readable/node_modules/readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/cloneable-readable/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, - "node_modules/code-point-at": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/collection-map": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/collection-map/-/collection-map-1.0.0.tgz", - "integrity": "sha1-rqDwb40mx4DCt1SUOFVEsiVa8Yw=", - "dev": true, - "dependencies": { - "arr-map": "^2.0.2", - "for-own": "^1.0.0", - "make-iterator": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/collection-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", - "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", - "dev": true, - "dependencies": { - "map-visit": "^1.0.0", - "object-visit": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/color-support": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", - "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", - "bin": { - "color-support": "bin.js" - } - }, - "node_modules/combine-source-map": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/combine-source-map/-/combine-source-map-0.8.0.tgz", - "integrity": "sha1-pY0N8ELBhvz4IqjoAV9UUNLXmos=", - "dev": true, - "dependencies": { - "convert-source-map": "~1.1.0", - "inline-source-map": "~0.6.0", - "lodash.memoize": "~3.0.3", - "source-map": "~0.5.3" - } - }, - "node_modules/combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "peer": true, - "dependencies": { - "delayed-stream": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/commander": { - "version": "2.20.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz", - "integrity": "sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==", - "dev": true - }, - "node_modules/component-emitter": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", - "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=", - "dev": true - }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" - }, - "node_modules/concat-stream": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", - "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", - "dev": true, - "engines": [ - "node >= 0.8" - ], - "dependencies": { - "buffer-from": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^2.2.2", - "typedarray": "^0.0.6" - } - }, - "node_modules/concat-stream/node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "node_modules/concat-stream/node_modules/readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/concat-stream/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, - "node_modules/concat-with-sourcemaps": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/concat-with-sourcemaps/-/concat-with-sourcemaps-1.1.0.tgz", - "integrity": "sha512-4gEjHJFT9e+2W/77h/DS5SGUgwDaOwprX8L/gl5+3ixnzkVJJsZWDSelmN3Oilw3LNDZjZV0yqH1hLG3k6nghg==", - "dev": true, - "dependencies": { - "source-map": "^0.6.1" - } - }, - "node_modules/concat-with-sourcemaps/node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/config-chain": { - "version": "1.1.12", - "resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.12.tgz", - "integrity": "sha512-a1eOIcu8+7lUInge4Rpf/n4Krkf3Dd9lqhljRzII1/Zno/kRtUWnznPO3jOKBmTEktkt3fkxisUcivoj0ebzoA==", - "dev": true, - "dependencies": { - "ini": "^1.3.4", - "proto-list": "~1.2.1" - } - }, - "node_modules/connect": { - "version": "3.6.6", - "resolved": "https://registry.npmjs.org/connect/-/connect-3.6.6.tgz", - "integrity": "sha1-Ce/2xVr3I24TcTWnJXSFi2eG9SQ=", - "dev": true, - "dependencies": { - "debug": "2.6.9", - "finalhandler": "1.1.0", - "parseurl": "~1.3.2", - "utils-merge": "1.0.1" - }, - "engines": { - "node": ">= 0.10.0" - } - }, - "node_modules/connect-history-api-fallback": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/connect-history-api-fallback/-/connect-history-api-fallback-1.6.0.tgz", - "integrity": "sha512-e54B99q/OUoH64zYYRf3HBP5z24G38h5D3qXu23JGRoigpX5Ss4r9ZnDk3g0Z8uQC2x2lPaJ+UlWBc1ZWBWdLg==", - "dev": true, - "engines": { - "node": ">=0.8" - } - }, - "node_modules/connect/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/console-browserify": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.1.0.tgz", - "integrity": "sha1-8CQcRXMKn8YyOyBtvzjtx0HQuxA=", - "dev": true, - "dependencies": { - "date-now": "^0.1.4" - } - }, - "node_modules/console-control-strings": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", - "integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==" - }, - "node_modules/constants-browserify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz", - "integrity": "sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U=", - "dev": true - }, - "node_modules/convert-source-map": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.1.3.tgz", - "integrity": "sha1-SCnId+n+SbMWHzvzZziI4gRpmGA=", - "dev": true - }, - "node_modules/cookie": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.2.tgz", - "integrity": "sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==", - "dev": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/copy-descriptor": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", - "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/copy-props": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/copy-props/-/copy-props-2.0.5.tgz", - "integrity": "sha512-XBlx8HSqrT0ObQwmSzM7WE5k8FxTV75h1DX1Z3n6NhQ/UYYAvInWYmG06vFt7hQZArE2fuO62aihiWIVQwh1sw==", - "dev": true, - "dependencies": { - "each-props": "^1.3.2", - "is-plain-object": "^5.0.0" - } - }, - "node_modules/copy-props/node_modules/is-plain-object": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", - "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" - }, - "node_modules/cors": { - "version": "2.8.5", - "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", - "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", - "dev": true, - "dependencies": { - "object-assign": "^4", - "vary": "^1" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/create-ecdh": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.3.tgz", - "integrity": "sha512-GbEHQPMOswGpKXM9kCWVrremUcBmjteUaQ01T9rkKCPDXfUHX0IoP9LpHYo2NPFampa4e+/pFDc3jQdxrxQLaw==", - "dev": true, - "dependencies": { - "bn.js": "^4.1.0", - "elliptic": "^6.0.0" - } - }, - "node_modules/create-hash": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", - "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", - "dev": true, - "dependencies": { - "cipher-base": "^1.0.1", - "inherits": "^2.0.1", - "md5.js": "^1.3.4", - "ripemd160": "^2.0.1", - "sha.js": "^2.4.0" - } - }, - "node_modules/create-hmac": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", - "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", - "dev": true, - "dependencies": { - "cipher-base": "^1.0.3", - "create-hash": "^1.1.0", - "inherits": "^2.0.1", - "ripemd160": "^2.0.0", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" - } - }, - "node_modules/cross-spawn": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.1.tgz", - "integrity": "sha512-u7v4o84SwFpD32Z8IIcPZ6z1/ie24O6RU3RbtL5Y316l3KuHVPx9ItBgWQ6VlfAFnRnTtMUrsQ9MUUTuEZjogg==", - "dev": true, - "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/cross-spawn/node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/crypto-browserify": { - "version": "3.12.0", - "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", - "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", - "dev": true, - "dependencies": { - "browserify-cipher": "^1.0.0", - "browserify-sign": "^4.0.0", - "create-ecdh": "^4.0.0", - "create-hash": "^1.1.0", - "create-hmac": "^1.1.0", - "diffie-hellman": "^5.0.0", - "inherits": "^2.0.1", - "pbkdf2": "^3.0.3", - "public-encrypt": "^4.0.0", - "randombytes": "^2.0.0", - "randomfill": "^1.0.3" - }, - "engines": { - "node": "*" - } - }, - "node_modules/d": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz", - "integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==", - "dev": true, - "dependencies": { - "es5-ext": "^0.10.50", - "type": "^1.0.1" - } - }, - "node_modules/dash-ast": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/dash-ast/-/dash-ast-1.0.0.tgz", - "integrity": "sha512-Vy4dx7gquTeMcQR/hDkYLGUnwVil6vk4FOOct+djUnHOUWt+zJPJAaRIXaAFkPXtJjvlY7o3rfRu0/3hpnwoUA==", - "dev": true - }, - "node_modules/dashdash": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g==", - "peer": true, - "dependencies": { - "assert-plus": "^1.0.0" - }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/date-now": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz", - "integrity": "sha1-6vQ5/U1ISK105cx9vvIAZyueNFs=", - "dev": true - }, - "node_modules/debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", - "dev": true, - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/debug/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "node_modules/decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/decode-uri-component": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", - "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", - "dev": true, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/decomment": { - "version": "0.9.2", - "resolved": "https://registry.npmjs.org/decomment/-/decomment-0.9.2.tgz", - "integrity": "sha512-sblyUmOJZxiL7oJ2ogJS6jtl/67+CTOW87SrYE/96u3PhDYikYoLCdLzcnceToiQejOLlqNnLCkaxx/+nE/ehg==", - "dev": true, - "dependencies": { - "esprima": "4.0.1" - }, - "engines": { - "node": ">=6.4", - "npm": ">=2.15" - } - }, - "node_modules/decompress-response": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", - "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", - "dependencies": { - "mimic-response": "^3.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/deep-extend": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", - "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/default-compare": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/default-compare/-/default-compare-1.0.0.tgz", - "integrity": "sha512-QWfXlM0EkAbqOCbD/6HjdwT19j7WCkMyiRhWilc4H9/5h/RzTF9gv5LYh1+CmDV5d1rki6KAWLtQale0xt20eQ==", - "dev": true, - "dependencies": { - "kind-of": "^5.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/default-compare/node_modules/kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/default-resolution": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/default-resolution/-/default-resolution-2.0.0.tgz", - "integrity": "sha1-vLgrqnKtebQmp2cy8aga1t8m1oQ=", - "dev": true, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/define-properties": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", - "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", - "dev": true, - "dependencies": { - "object-keys": "^1.0.12" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/define-property": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", - "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", - "dev": true, - "dependencies": { - "is-descriptor": "^1.0.2", - "isobject": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/define-property/node_modules/is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "dependencies": { - "kind-of": "^6.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/define-property/node_modules/is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "dependencies": { - "kind-of": "^6.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/define-property/node_modules/is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "dependencies": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/defined": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz", - "integrity": "sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM=", - "dev": true - }, - "node_modules/delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", - "peer": true, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/delegates": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", - "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==" - }, - "node_modules/depd": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", - "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/deps-sort": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/deps-sort/-/deps-sort-2.0.1.tgz", - "integrity": "sha512-1orqXQr5po+3KI6kQb9A4jnXT1PBwggGl2d7Sq2xsnOeI9GPcE/tGcF9UiSZtZBM7MukY4cAh7MemS6tZYipfw==", - "dev": true, - "dependencies": { - "JSONStream": "^1.0.3", - "shasum-object": "^1.0.0", - "subarg": "^1.0.0", - "through2": "^2.0.0" - }, - "bin": { - "deps-sort": "bin/cmd.js" - } - }, - "node_modules/deps-sort/node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", - "dev": true - }, - "node_modules/deps-sort/node_modules/readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/deps-sort/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, - "node_modules/deps-sort/node_modules/through2": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", - "dev": true, - "dependencies": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" - } - }, - "node_modules/des.js": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.0.tgz", - "integrity": "sha1-wHTS4qpqipoH29YfmhXCzYPsjsw=", - "dev": true, - "dependencies": { - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0" - } - }, - "node_modules/destroy": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", - "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=", - "dev": true - }, - "node_modules/detect-file": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz", - "integrity": "sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/detect-libc": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.1.tgz", - "integrity": "sha512-463v3ZeIrcWtdgIg6vI6XUncguvr2TnGl4SzDXinkt9mSLpBJKXT3mW6xT3VQdDN11+WVs29pgvivTc4Lp8v+w==", - "engines": { - "node": ">=8" - } - }, - "node_modules/detective": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/detective/-/detective-5.2.1.tgz", - "integrity": "sha512-v9XE1zRnz1wRtgurGu0Bs8uHKFSTdteYZNbIPFVhUZ39L/S79ppMpdmVOZAnoz1jfEFodc48n6MX483Xo3t1yw==", - "dev": true, - "dependencies": { - "acorn-node": "^1.8.2", - "defined": "^1.0.0", - "minimist": "^1.2.6" - }, - "bin": { - "detective": "bin/detective.js" - }, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/dev-ip": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/dev-ip/-/dev-ip-1.0.1.tgz", - "integrity": "sha1-p2o+0YVb56ASu4rBbLgPPADcKPA=", - "dev": true, - "bin": { - "dev-ip": "lib/dev-ip.js" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/diff": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", - "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", - "dev": true, - "engines": { - "node": ">=0.3.1" - } - }, - "node_modules/diffie-hellman": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", - "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", - "dev": true, - "dependencies": { - "bn.js": "^4.1.0", - "miller-rabin": "^4.0.0", - "randombytes": "^2.0.0" - } - }, - "node_modules/dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", - "dev": true, - "dependencies": { - "path-type": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/dir-glob/node_modules/path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/dlv": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/dlv/-/dlv-1.1.3.tgz", - "integrity": "sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==", - "dev": true - }, - "node_modules/domain-browser": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz", - "integrity": "sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA==", - "dev": true, - "engines": { - "node": ">=0.4", - "npm": ">=1.2" - } - }, - "node_modules/duplexer2": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz", - "integrity": "sha512-asLFVfWWtJ90ZyOUHMqk7/S2w2guQKxUI2itj3d92ADHhxUSbCMGi1f1cBcJ7xM1To+pE/Khbwo1yuNbMEPKeA==", - "dev": true, - "dependencies": { - "readable-stream": "^2.0.2" - } - }, - "node_modules/duplexer2/node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", - "dev": true - }, - "node_modules/duplexer2/node_modules/readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/duplexer2/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, - "node_modules/duplexify": { - "version": "3.7.1", - "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz", - "integrity": "sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g==", - "dev": true, - "dependencies": { - "end-of-stream": "^1.0.0", - "inherits": "^2.0.1", - "readable-stream": "^2.0.0", - "stream-shift": "^1.0.0" - } - }, - "node_modules/duplexify/node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "node_modules/duplexify/node_modules/readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/duplexify/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, - "node_modules/each-props": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/each-props/-/each-props-1.3.2.tgz", - "integrity": "sha512-vV0Hem3zAGkJAyU7JSjixeU66rwdynTAa1vofCrSA5fEln+m67Az9CcnkVD776/fsN/UjIWmBDoNRS6t6G9RfA==", - "dev": true, - "dependencies": { - "is-plain-object": "^2.0.1", - "object.defaults": "^1.1.0" - } - }, - "node_modules/easy-extender": { - "version": "2.3.4", - "resolved": "https://registry.npmjs.org/easy-extender/-/easy-extender-2.3.4.tgz", - "integrity": "sha512-8cAwm6md1YTiPpOvDULYJL4ZS6WfM5/cTeVVh4JsvyYZAoqlRVUpHL9Gr5Fy7HA6xcSZicUia3DeAgO3Us8E+Q==", - "dev": true, - "dependencies": { - "lodash": "^4.17.10" - }, - "engines": { - "node": ">= 4.0.0" - } - }, - "node_modules/eazy-logger": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/eazy-logger/-/eazy-logger-3.1.0.tgz", - "integrity": "sha512-/snsn2JqBtUSSstEl4R0RKjkisGHAhvYj89i7r3ytNUKW12y178KDZwXLXIgwDqLW6E/VRMT9qfld7wvFae8bQ==", - "dev": true, - "dependencies": { - "tfunk": "^4.0.0" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/ecc-jsbn": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", - "integrity": "sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw==", - "peer": true, - "dependencies": { - "jsbn": "~0.1.0", - "safer-buffer": "^2.1.0" - } - }, - "node_modules/editions": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/editions/-/editions-1.3.4.tgz", - "integrity": "sha512-gzao+mxnYDzIysXKMQi/+M1mjy/rjestjg6OPoYTtI+3Izp23oiGZitsl9lPDPiTGXbcSIk1iJWhliSaglxnUg==", - "dev": true, - "engines": { - "node": ">=0.8" - } - }, - "node_modules/editorconfig": { - "version": "0.15.3", - "resolved": "https://registry.npmjs.org/editorconfig/-/editorconfig-0.15.3.tgz", - "integrity": "sha512-M9wIMFx96vq0R4F+gRpY3o2exzb8hEj/n9S8unZtHSvYjibBp/iMufSzvmOcV/laG0ZtuTVGtiJggPOSW2r93g==", - "dev": true, - "dependencies": { - "commander": "^2.19.0", - "lru-cache": "^4.1.5", - "semver": "^5.6.0", - "sigmund": "^1.0.1" - }, - "bin": { - "editorconfig": "bin/editorconfig" - } - }, - "node_modules/editorconfig/node_modules/semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true, - "bin": { - "semver": "bin/semver" - } - }, - "node_modules/ee-first": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", - "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=", - "dev": true - }, - "node_modules/elliptic": { - "version": "6.5.4", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", - "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", - "dev": true, - "dependencies": { - "bn.js": "^4.11.9", - "brorand": "^1.1.0", - "hash.js": "^1.0.0", - "hmac-drbg": "^1.0.1", - "inherits": "^2.0.4", - "minimalistic-assert": "^1.0.1", - "minimalistic-crypto-utils": "^1.0.1" - } - }, - "node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" - }, - "node_modules/encodeurl": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=", - "dev": true, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/encoding": { - "version": "0.1.13", - "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz", - "integrity": "sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==", - "optional": true, - "dependencies": { - "iconv-lite": "^0.6.2" - } - }, - "node_modules/encoding/node_modules/iconv-lite": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", - "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", - "optional": true, - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/end-of-stream": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", - "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", - "dependencies": { - "once": "^1.4.0" - } - }, - "node_modules/engine.io": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-6.2.0.tgz", - "integrity": "sha512-4KzwW3F3bk+KlzSOY57fj/Jx6LyRQ1nbcyIadehl+AnXjKT7gDO0ORdRi/84ixvMKTym6ZKuxvbzN62HDDU1Lg==", - "dev": true, - "dependencies": { - "@types/cookie": "^0.4.1", - "@types/cors": "^2.8.12", - "@types/node": ">=10.0.0", - "accepts": "~1.3.4", - "base64id": "2.0.0", - "cookie": "~0.4.1", - "cors": "~2.8.5", - "debug": "~4.3.1", - "engine.io-parser": "~5.0.3", - "ws": "~8.2.3" - }, - "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/engine.io-client": { - "version": "6.2.3", - "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-6.2.3.tgz", - "integrity": "sha512-aXPtgF1JS3RuuKcpSrBtimSjYvrbhKW9froICH4s0F3XQWLxsKNxqzG39nnvQZQnva4CMvUK63T7shevxRyYHw==", - "dev": true, - "dependencies": { - "@socket.io/component-emitter": "~3.1.0", - "debug": "~4.3.1", - "engine.io-parser": "~5.0.3", - "ws": "~8.2.3", - "xmlhttprequest-ssl": "~2.0.0" - } - }, - "node_modules/engine.io-parser": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.0.4.tgz", - "integrity": "sha512-+nVFp+5z1E3HcToEnO7ZIj3g+3k9389DvWtvJZz0T6/eOCPIyyxehFcedoYrZQrp0LgQbD9pPXhpMBKMd5QURg==", - "dev": true, - "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/env-paths": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", - "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", - "engines": { - "node": ">=6" - } - }, - "node_modules/err-code": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/err-code/-/err-code-2.0.3.tgz", - "integrity": "sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==" - }, - "node_modules/error-ex": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", - "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", - "dev": true, - "dependencies": { - "is-arrayish": "^0.2.1" - } - }, - "node_modules/es5-ext": { - "version": "0.10.50", - "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.50.tgz", - "integrity": "sha512-KMzZTPBkeQV/JcSQhI5/z6d9VWJ3EnQ194USTUwIYZ2ZbpN8+SGXQKt1h68EX44+qt+Fzr8DO17vnxrw7c3agw==", - "dev": true, - "dependencies": { - "es6-iterator": "~2.0.3", - "es6-symbol": "~3.1.1", - "next-tick": "^1.0.0" - } - }, - "node_modules/es6-iterator": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", - "integrity": "sha1-p96IkUGgWpSwhUQDstCg+/qY87c=", - "dev": true, - "dependencies": { - "d": "1", - "es5-ext": "^0.10.35", - "es6-symbol": "^3.1.1" - } - }, - "node_modules/es6-symbol": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.1.tgz", - "integrity": "sha1-vwDvT9q2uhtG7Le2KbTH7VcVzHc=", - "dev": true, - "dependencies": { - "d": "1", - "es5-ext": "~0.10.14" - } - }, - "node_modules/es6-weak-map": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.3.tgz", - "integrity": "sha512-p5um32HOTO1kP+w7PRnB+5lQ43Z6muuMuIMffvDN8ZB4GcnjLBV6zGStpbASIMk4DCAvEaamhe2zhyCb/QXXsA==", - "dev": true, - "dependencies": { - "d": "1", - "es5-ext": "^0.10.46", - "es6-iterator": "^2.0.3", - "es6-symbol": "^3.1.1" - } - }, - "node_modules/escalade": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", - "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/escape-html": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", - "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=", - "dev": true - }, - "node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true, - "bin": { - "esparse": "bin/esparse.js", - "esvalidate": "bin/esvalidate.js" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/etag": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", - "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=", - "dev": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/eventemitter3": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", - "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==", - "dev": true - }, - "node_modules/events": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", - "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", - "dev": true, - "engines": { - "node": ">=0.8.x" - } - }, - "node_modules/evp_bytestokey": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", - "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", - "dev": true, - "dependencies": { - "md5.js": "^1.3.4", - "safe-buffer": "^5.1.1" - } - }, - "node_modules/expand-brackets": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", - "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", - "dev": true, - "dependencies": { - "debug": "^2.3.3", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "posix-character-classes": "^0.1.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/expand-brackets/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/expand-brackets/node_modules/define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "dependencies": { - "is-descriptor": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/expand-brackets/node_modules/extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "dependencies": { - "is-extendable": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/expand-template": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz", - "integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==", - "engines": { - "node": ">=6" - } - }, - "node_modules/expand-tilde": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz", - "integrity": "sha1-l+gBqgUt8CRU3kawK/YhZCzchQI=", - "dev": true, - "dependencies": { - "homedir-polyfill": "^1.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" - }, - "node_modules/extend-shallow": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", - "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", - "dev": true, - "dependencies": { - "assign-symbols": "^1.0.0", - "is-extendable": "^1.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/extend-shallow/node_modules/is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "dev": true, - "dependencies": { - "is-plain-object": "^2.0.4" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/extglob": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", - "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", - "dev": true, - "dependencies": { - "array-unique": "^0.3.2", - "define-property": "^1.0.0", - "expand-brackets": "^2.1.4", - "extend-shallow": "^2.0.1", - "fragment-cache": "^0.2.1", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/extglob/node_modules/define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "dependencies": { - "is-descriptor": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/extglob/node_modules/extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "dependencies": { - "is-extendable": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/extglob/node_modules/is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "dependencies": { - "kind-of": "^6.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/extglob/node_modules/is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "dependencies": { - "kind-of": "^6.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/extglob/node_modules/is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "dependencies": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/extsprintf": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g==", - "engines": [ - "node >=0.6.0" - ], - "peer": true - }, - "node_modules/fancy-log": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/fancy-log/-/fancy-log-1.3.3.tgz", - "integrity": "sha512-k9oEhlyc0FrVh25qYuSELjr8oxsCoc4/LEZfg2iJJrfEk/tZL9bCoJE47gqAvI2m/AUjluCS4+3I0eTx8n3AEw==", - "dev": true, - "dependencies": { - "ansi-gray": "^0.1.1", - "color-support": "^1.1.3", - "parse-node-version": "^1.0.0", - "time-stamp": "^1.0.0" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "peer": true - }, - "node_modules/fast-glob": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.0.4.tgz", - "integrity": "sha512-wkIbV6qg37xTJwqSsdnIphL1e+LaGz4AIQqr00mIubMaEhv1/HEmJ0uuCGZRNRUkZZmOB5mJKO0ZUTVq+SxMQg==", - "dev": true, - "dependencies": { - "@nodelib/fs.stat": "^2.0.1", - "@nodelib/fs.walk": "^1.2.1", - "glob-parent": "^5.0.0", - "is-glob": "^4.0.1", - "merge2": "^1.2.3", - "micromatch": "^4.0.2" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/fast-glob/node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, - "dependencies": { - "fill-range": "^7.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/fast-glob/node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, - "dependencies": { - "to-regex-range": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/fast-glob/node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, - "dependencies": { - "is-glob": "^4.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/fast-glob/node_modules/is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true, - "engines": { - "node": ">=0.12.0" - } - }, - "node_modules/fast-glob/node_modules/micromatch": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz", - "integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==", - "dev": true, - "dependencies": { - "braces": "^3.0.1", - "picomatch": "^2.0.5" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/fast-glob/node_modules/to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "dependencies": { - "is-number": "^7.0.0" - }, - "engines": { - "node": ">=8.0" - } - }, - "node_modules/fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "peer": true - }, - "node_modules/fast-safe-stringify": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz", - "integrity": "sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==", - "dev": true - }, - "node_modules/fastq": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.6.0.tgz", - "integrity": "sha512-jmxqQ3Z/nXoeyDmWAzF9kH1aGZSis6e/SbfPmJpUnyZ0ogr6iscHQaml4wsEepEWSdtmpy+eVXmCRIMpxaXqOA==", - "dev": true, - "dependencies": { - "reusify": "^1.0.0" - } - }, - "node_modules/file-uri-to-path": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", - "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==" - }, - "node_modules/fill-range": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", - "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", - "dev": true, - "dependencies": { - "extend-shallow": "^2.0.1", - "is-number": "^3.0.0", - "repeat-string": "^1.6.1", - "to-regex-range": "^2.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/fill-range/node_modules/extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "dependencies": { - "is-extendable": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/finalhandler": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.0.tgz", - "integrity": "sha1-zgtoVbRYU+eRsvzGgARtiCU91/U=", - "dev": true, - "dependencies": { - "debug": "2.6.9", - "encodeurl": "~1.0.1", - "escape-html": "~1.0.3", - "on-finished": "~2.3.0", - "parseurl": "~1.3.2", - "statuses": "~1.3.1", - "unpipe": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/finalhandler/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/find-up": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", - "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", - "dev": true, - "dependencies": { - "path-exists": "^2.0.0", - "pinkie-promise": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/findup-sync": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-3.0.0.tgz", - "integrity": "sha512-YbffarhcicEhOrm4CtrwdKBdCuz576RLdhJDsIfvNtxUuhdRet1qZcsMjqbePtAseKdAnDyM/IyXbu7PRPRLYg==", - "dev": true, - "dependencies": { - "detect-file": "^1.0.0", - "is-glob": "^4.0.0", - "micromatch": "^3.0.4", - "resolve-dir": "^1.0.1" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/fined": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/fined/-/fined-1.2.0.tgz", - "integrity": "sha512-ZYDqPLGxDkDhDZBjZBb+oD1+j0rA4E0pXY50eplAAOPg2N/gUBSSk5IM1/QhPfyVo19lJ+CvXpqfvk+b2p/8Ng==", - "dev": true, - "dependencies": { - "expand-tilde": "^2.0.2", - "is-plain-object": "^2.0.3", - "object.defaults": "^1.1.0", - "object.pick": "^1.2.0", - "parse-filepath": "^1.0.1" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/flagged-respawn": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/flagged-respawn/-/flagged-respawn-1.0.1.tgz", - "integrity": "sha512-lNaHNVymajmk0OJMBn8fVUAU1BtDeKIqKoVhk4xAALB57aALg6b4W0MfJ/cUE0g9YBXy5XhSlPIpYIJ7HaY/3Q==", - "dev": true, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/flush-write-stream": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.1.1.tgz", - "integrity": "sha512-3Z4XhFZ3992uIq0XOqb9AreonueSYphE6oYbpt5+3u06JWklbsPkNv3ZKkP9Bz/r+1MWCaMoSQ28P85+1Yc77w==", - "dev": true, - "dependencies": { - "inherits": "^2.0.3", - "readable-stream": "^2.3.6" - } - }, - "node_modules/flush-write-stream/node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "node_modules/flush-write-stream/node_modules/readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/flush-write-stream/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, - "node_modules/follow-redirects": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", - "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==", - "dev": true, - "funding": [ - { - "type": "individual", - "url": "https://github.com/sponsors/RubenVerborgh" - } - ], - "engines": { - "node": ">=4.0" - }, - "peerDependenciesMeta": { - "debug": { - "optional": true - } - } - }, - "node_modules/for-each": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", - "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", - "dev": true, - "dependencies": { - "is-callable": "^1.1.3" - } - }, - "node_modules/for-in": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", - "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/for-own": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/for-own/-/for-own-1.0.0.tgz", - "integrity": "sha1-xjMy9BXO3EsE2/5wz4NklMU8tEs=", - "dev": true, - "dependencies": { - "for-in": "^1.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/foreground-child": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz", - "integrity": "sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==", - "dev": true, - "dependencies": { - "cross-spawn": "^7.0.0", - "signal-exit": "^3.0.2" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/forever-agent": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw==", - "peer": true, - "engines": { - "node": "*" - } - }, - "node_modules/form-data": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", - "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", - "peer": true, - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", - "mime-types": "^2.1.12" - }, - "engines": { - "node": ">= 0.12" - } - }, - "node_modules/fragment-cache": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", - "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", - "dev": true, - "dependencies": { - "map-cache": "^0.2.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/fresh": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", - "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=", - "dev": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/fs-constants": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", - "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==" - }, - "node_modules/fs-extra": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-3.0.1.tgz", - "integrity": "sha1-N5TzeMWLNC6n27sjCVEJxLO2IpE=", - "dev": true, - "dependencies": { - "graceful-fs": "^4.1.2", - "jsonfile": "^3.0.0", - "universalify": "^0.1.0" - } - }, - "node_modules/fs-minipass": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", - "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", - "dependencies": { - "minipass": "^3.0.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/fs-mkdirp-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs-mkdirp-stream/-/fs-mkdirp-stream-1.0.0.tgz", - "integrity": "sha1-C3gV/DIBxqaeFNuYzgmMFpNSWes=", - "dev": true, - "dependencies": { - "graceful-fs": "^4.1.11", - "through2": "^2.0.3" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/fs-mkdirp-stream/node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "node_modules/fs-mkdirp-stream/node_modules/readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/fs-mkdirp-stream/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, - "node_modules/fs-mkdirp-stream/node_modules/through2": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", - "dev": true, - "dependencies": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" - } - }, - "node_modules/fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" - }, - "node_modules/fsevents": { - "version": "1.2.12", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.12.tgz", - "integrity": "sha512-Ggd/Ktt7E7I8pxZRbGIs7vwqAPscSESMrCSkx2FtWeqmheJgCo2R74fTsZFCifr0VTPwqRpPv17+6b8Zp7th0Q==", - "bundleDependencies": [ - "node-pre-gyp" - ], - "deprecated": "fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.", - "dev": true, - "hasInstallScript": true, - "optional": true, - "os": [ - "darwin" - ], - "dependencies": { - "bindings": "^1.5.0", - "nan": "^2.12.1", - "node-pre-gyp": "*" - }, - "engines": { - "node": ">= 4.0" - } - }, - "node_modules/fsevents/node_modules/abbrev": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", - "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", - "dev": true, - "inBundle": true, - "license": "ISC", - "optional": true - }, - "node_modules/fsevents/node_modules/ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/fsevents/node_modules/aproba": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", - "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", - "dev": true, - "inBundle": true, - "license": "ISC", - "optional": true - }, - "node_modules/fsevents/node_modules/are-we-there-yet": { - "version": "1.1.5", - "dev": true, - "inBundle": true, - "license": "ISC", - "optional": true, - "dependencies": { - "delegates": "^1.0.0", - "readable-stream": "^2.0.6" - } - }, - "node_modules/fsevents/node_modules/balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true - }, - "node_modules/fsevents/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/fsevents/node_modules/chownr": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", - "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", - "dev": true, - "inBundle": true, - "license": "ISC", - "optional": true - }, - "node_modules/fsevents/node_modules/code-point-at": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/fsevents/node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true - }, - "node_modules/fsevents/node_modules/console-control-strings": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", - "integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==", - "dev": true, - "inBundle": true, - "license": "ISC", - "optional": true - }, - "node_modules/fsevents/node_modules/core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true - }, - "node_modules/fsevents/node_modules/debug": { - "version": "3.2.6", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true, - "dependencies": { - "ms": "^2.1.1" - } - }, - "node_modules/fsevents/node_modules/deep-extend": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", - "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true, - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/fsevents/node_modules/delegates": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", - "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true - }, - "node_modules/fsevents/node_modules/detect-libc": { - "version": "1.0.3", - "dev": true, - "inBundle": true, - "license": "Apache-2.0", - "optional": true, - "bin": { - "detect-libc": "bin/detect-libc.js" - }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/fsevents/node_modules/fs-minipass": { - "version": "1.2.7", - "dev": true, - "inBundle": true, - "license": "ISC", - "optional": true, - "dependencies": { - "minipass": "^2.6.0" - } - }, - "node_modules/fsevents/node_modules/fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true, - "inBundle": true, - "license": "ISC", - "optional": true - }, - "node_modules/fsevents/node_modules/gauge": { - "version": "2.7.4", - "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", - "integrity": "sha512-14x4kjc6lkD3ltw589k0NrPD6cCNTD6CWoVUNpB85+DrtONoZn+Rug6xZU5RvSC4+TZPxA5AnBibQYAvZn41Hg==", - "dev": true, - "inBundle": true, - "license": "ISC", - "optional": true, - "dependencies": { - "aproba": "^1.0.3", - "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.0", - "object-assign": "^4.1.0", - "signal-exit": "^3.0.0", - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wide-align": "^1.1.0" - } - }, - "node_modules/fsevents/node_modules/glob": { - "version": "7.1.6", - "dev": true, - "inBundle": true, - "license": "ISC", - "optional": true, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/fsevents/node_modules/has-unicode": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", - "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==", - "dev": true, - "inBundle": true, - "license": "ISC", - "optional": true - }, - "node_modules/fsevents/node_modules/iconv-lite": { - "version": "0.4.24", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true, - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/fsevents/node_modules/ignore-walk": { - "version": "3.0.3", - "dev": true, - "inBundle": true, - "license": "ISC", - "optional": true, - "dependencies": { - "minimatch": "^3.0.4" - } - }, - "node_modules/fsevents/node_modules/inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, - "inBundle": true, - "license": "ISC", - "optional": true, - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "node_modules/fsevents/node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true, - "inBundle": true, - "license": "ISC", - "optional": true - }, - "node_modules/fsevents/node_modules/ini": { - "version": "1.3.5", - "dev": true, - "inBundle": true, - "license": "ISC", - "optional": true, - "engines": { - "node": "*" - } - }, - "node_modules/fsevents/node_modules/is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true, - "dependencies": { - "number-is-nan": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/fsevents/node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true - }, - "node_modules/fsevents/node_modules/minimatch": { - "version": "3.0.4", - "dev": true, - "inBundle": true, - "license": "ISC", - "optional": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/fsevents/node_modules/minimist": { - "version": "1.2.5", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true - }, - "node_modules/fsevents/node_modules/minipass": { - "version": "2.9.0", - "dev": true, - "inBundle": true, - "license": "ISC", - "optional": true, - "dependencies": { - "safe-buffer": "^5.1.2", - "yallist": "^3.0.0" - } - }, - "node_modules/fsevents/node_modules/minizlib": { - "version": "1.3.3", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true, - "dependencies": { - "minipass": "^2.9.0" - } - }, - "node_modules/fsevents/node_modules/mkdirp": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.3.tgz", - "integrity": "sha512-P+2gwrFqx8lhew375MQHHeTlY8AuOJSrGf0R5ddkEndUkmwpgUob/vQuBD1V22/Cw1/lJr4x+EjllSezBThzBg==", - "deprecated": "Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true, - "dependencies": { - "minimist": "^1.2.5" - }, - "bin": { - "mkdirp": "bin/cmd.js" - } - }, - "node_modules/fsevents/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true - }, - "node_modules/fsevents/node_modules/needle": { - "version": "2.3.3", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true, - "dependencies": { - "debug": "^3.2.6", - "iconv-lite": "^0.4.4", - "sax": "^1.2.4" - }, - "bin": { - "needle": "bin/needle" - }, - "engines": { - "node": ">= 4.4.x" - } - }, - "node_modules/fsevents/node_modules/node-pre-gyp": { - "version": "0.14.0", - "dev": true, - "inBundle": true, - "license": "BSD-3-Clause", - "optional": true, - "dependencies": { - "detect-libc": "^1.0.2", - "mkdirp": "^0.5.1", - "needle": "^2.2.1", - "nopt": "^4.0.1", - "npm-packlist": "^1.1.6", - "npmlog": "^4.0.2", - "rc": "^1.2.7", - "rimraf": "^2.6.1", - "semver": "^5.3.0", - "tar": "^4.4.2" - }, - "bin": { - "node-pre-gyp": "bin/node-pre-gyp" - } - }, - "node_modules/fsevents/node_modules/nopt": { - "version": "4.0.3", - "dev": true, - "inBundle": true, - "license": "ISC", - "optional": true, - "dependencies": { - "abbrev": "1", - "osenv": "^0.1.4" - }, - "bin": { - "nopt": "bin/nopt.js" - } - }, - "node_modules/fsevents/node_modules/npm-bundled": { - "version": "1.1.1", - "dev": true, - "inBundle": true, - "license": "ISC", - "optional": true, - "dependencies": { - "npm-normalize-package-bin": "^1.0.1" - } - }, - "node_modules/fsevents/node_modules/npm-normalize-package-bin": { - "version": "1.0.1", - "dev": true, - "inBundle": true, - "license": "ISC", - "optional": true - }, - "node_modules/fsevents/node_modules/npm-packlist": { - "version": "1.4.8", - "dev": true, - "inBundle": true, - "license": "ISC", - "optional": true, - "dependencies": { - "ignore-walk": "^3.0.1", - "npm-bundled": "^1.0.1", - "npm-normalize-package-bin": "^1.0.1" - } - }, - "node_modules/fsevents/node_modules/npmlog": { - "version": "4.1.2", - "dev": true, - "inBundle": true, - "license": "ISC", - "optional": true, - "dependencies": { - "are-we-there-yet": "~1.1.2", - "console-control-strings": "~1.1.0", - "gauge": "~2.7.3", - "set-blocking": "~2.0.0" - } - }, - "node_modules/fsevents/node_modules/number-is-nan": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/fsevents/node_modules/object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/fsevents/node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, - "inBundle": true, - "license": "ISC", - "optional": true, - "dependencies": { - "wrappy": "1" - } - }, - "node_modules/fsevents/node_modules/os-homedir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", - "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/fsevents/node_modules/os-tmpdir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/fsevents/node_modules/osenv": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz", - "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", - "dev": true, - "inBundle": true, - "license": "ISC", - "optional": true, - "dependencies": { - "os-homedir": "^1.0.0", - "os-tmpdir": "^1.0.0" - } - }, - "node_modules/fsevents/node_modules/path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/fsevents/node_modules/process-nextick-args": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true - }, - "node_modules/fsevents/node_modules/rc": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", - "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", - "dev": true, - "inBundle": true, - "license": "(BSD-2-Clause OR MIT OR Apache-2.0)", - "optional": true, - "dependencies": { - "deep-extend": "^0.6.0", - "ini": "~1.3.0", - "minimist": "^1.2.0", - "strip-json-comments": "~2.0.1" - }, - "bin": { - "rc": "cli.js" - } - }, - "node_modules/fsevents/node_modules/readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/fsevents/node_modules/rimraf": { - "version": "2.7.1", - "dev": true, - "inBundle": true, - "license": "ISC", - "optional": true, - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - } - }, - "node_modules/fsevents/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true - }, - "node_modules/fsevents/node_modules/safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true - }, - "node_modules/fsevents/node_modules/sax": { - "version": "1.2.4", - "dev": true, - "inBundle": true, - "license": "ISC", - "optional": true - }, - "node_modules/fsevents/node_modules/semver": { - "version": "5.7.1", - "dev": true, - "inBundle": true, - "license": "ISC", - "optional": true, - "bin": { - "semver": "bin/semver" - } - }, - "node_modules/fsevents/node_modules/set-blocking": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", - "dev": true, - "inBundle": true, - "license": "ISC", - "optional": true - }, - "node_modules/fsevents/node_modules/signal-exit": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", - "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", - "dev": true, - "inBundle": true, - "license": "ISC", - "optional": true - }, - "node_modules/fsevents/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true, - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, - "node_modules/fsevents/node_modules/string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true, - "dependencies": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/fsevents/node_modules/strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true, - "dependencies": { - "ansi-regex": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/fsevents/node_modules/strip-json-comments": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/fsevents/node_modules/tar": { - "version": "4.4.13", - "dev": true, - "inBundle": true, - "license": "ISC", - "optional": true, - "dependencies": { - "chownr": "^1.1.1", - "fs-minipass": "^1.2.5", - "minipass": "^2.8.6", - "minizlib": "^1.2.1", - "mkdirp": "^0.5.0", - "safe-buffer": "^5.1.2", - "yallist": "^3.0.3" - }, - "engines": { - "node": ">=4.5" - } - }, - "node_modules/fsevents/node_modules/util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true - }, - "node_modules/fsevents/node_modules/wide-align": { - "version": "1.1.3", - "dev": true, - "inBundle": true, - "license": "ISC", - "optional": true, - "dependencies": { - "string-width": "^1.0.2 || 2" - } - }, - "node_modules/fsevents/node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true, - "inBundle": true, - "license": "ISC", - "optional": true - }, - "node_modules/fsevents/node_modules/yallist": { - "version": "3.1.1", - "dev": true, - "inBundle": true, - "license": "ISC", - "optional": true - }, - "node_modules/function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true - }, - "node_modules/gauge": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/gauge/-/gauge-4.0.4.tgz", - "integrity": "sha512-f9m+BEN5jkg6a0fZjleidjN51VE1X+mPFQ2DJ0uv1V39oCLCbsGe6yjbBnp7eK7z/+GAon99a3nHuqbuuthyPg==", - "dependencies": { - "aproba": "^1.0.3 || ^2.0.0", - "color-support": "^1.1.3", - "console-control-strings": "^1.1.0", - "has-unicode": "^2.0.1", - "signal-exit": "^3.0.7", - "string-width": "^4.2.3", - "strip-ansi": "^6.0.1", - "wide-align": "^1.1.5" - }, - "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" - } - }, - "node_modules/gauge/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "engines": { - "node": ">=8" - } - }, - "node_modules/gauge/node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "engines": { - "node": ">=8" - } - }, - "node_modules/gauge/node_modules/signal-exit": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", - "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" - }, - "node_modules/gauge/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/gauge/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/get-assigned-identifiers": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/get-assigned-identifiers/-/get-assigned-identifiers-1.2.0.tgz", - "integrity": "sha512-mBBwmeGTrxEMO4pMaaf/uUEFHnYtwr8FTe8Y/mer4rcV/bye0qGm6pw1bGZFGStxC5O76c5ZAVBGnqHmOaJpdQ==", - "dev": true - }, - "node_modules/get-caller-file": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", - "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==", - "dev": true - }, - "node_modules/get-intrinsic": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.3.tgz", - "integrity": "sha512-QJVz1Tj7MS099PevUG5jvnt9tSkXN8K14dxQlikJuPt4uD9hHAHjLyLBiLR5zELelBdD9QNRAXZzsJx0WaDL9A==", - "dev": true, - "dependencies": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/get-value": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", - "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/getpass": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng==", - "peer": true, - "dependencies": { - "assert-plus": "^1.0.0" - } - }, - "node_modules/github-from-package": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", - "integrity": "sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==" - }, - "node_modules/gl": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/gl/-/gl-5.0.3.tgz", - "integrity": "sha512-toWmb3Rgli5Wl9ygjZeglFBVLDYMOomy+rXlVZVDCoIRV+6mQE5nY4NgQgokYIc5oQzc1pvWY9lQJ0hGn61ZUg==", - "hasInstallScript": true, - "dependencies": { - "bindings": "^1.5.0", - "bit-twiddle": "^1.0.2", - "glsl-tokenizer": "^2.1.5", - "nan": "^2.16.0", - "node-abi": "^3.22.0", - "node-gyp": "^9.0.0", - "prebuild-install": "^7.1.1" - }, - "engines": { - "node": ">=12.0.0" - } - }, - "node_modules/gl-wiretap": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/gl-wiretap/-/gl-wiretap-0.6.2.tgz", - "integrity": "sha512-fxy1XGiPkfzK+T3XKDbY7yaqMBmozCGvAFyTwaZA3imeZH83w7Hr3r3bYlMRWIyzMI/lDUvUMM/92LE2OwqFyQ==" - }, - "node_modules/glob": { - "version": "7.1.4", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", - "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - } - }, - "node_modules/glob-parent": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", - "integrity": "sha512-E8Ak/2+dZY6fnzlR7+ueWvhsH1SjHr4jjss4YS/h4py44jY9MhK/VFdaZJAWDz6BbL21KeteKxFSFpq8OS5gVA==", - "dev": true, - "dependencies": { - "is-glob": "^3.1.0", - "path-dirname": "^1.0.0" - } - }, - "node_modules/glob-parent/node_modules/is-glob": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", - "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", - "dev": true, - "dependencies": { - "is-extglob": "^2.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/glob-stream": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/glob-stream/-/glob-stream-6.1.0.tgz", - "integrity": "sha512-uMbLGAP3S2aDOHUDfdoYcdIePUCfysbAd0IAoWVZbeGU/oNQ8asHVSshLDJUPWxfzj8zsCG7/XeHPHTtow0nsw==", - "dev": true, - "dependencies": { - "extend": "^3.0.0", - "glob": "^7.1.1", - "glob-parent": "^3.1.0", - "is-negated-glob": "^1.0.0", - "ordered-read-streams": "^1.0.0", - "pumpify": "^1.3.5", - "readable-stream": "^2.1.5", - "remove-trailing-separator": "^1.0.1", - "to-absolute-glob": "^2.0.0", - "unique-stream": "^2.0.2" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/glob-stream/node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "node_modules/glob-stream/node_modules/readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/glob-stream/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, - "node_modules/glob-watcher": { - "version": "5.0.5", - "resolved": "https://registry.npmjs.org/glob-watcher/-/glob-watcher-5.0.5.tgz", - "integrity": "sha512-zOZgGGEHPklZNjZQaZ9f41i7F2YwE+tS5ZHrDhbBCk3stwahn5vQxnFmBJZHoYdusR6R1bLSXeGUy/BhctwKzw==", - "dev": true, - "dependencies": { - "anymatch": "^2.0.0", - "async-done": "^1.2.0", - "chokidar": "^2.0.0", - "is-negated-glob": "^1.0.0", - "just-debounce": "^1.0.0", - "normalize-path": "^3.0.0", - "object.defaults": "^1.1.0" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/global-modules": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-1.0.0.tgz", - "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==", - "dev": true, - "dependencies": { - "global-prefix": "^1.0.1", - "is-windows": "^1.0.1", - "resolve-dir": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/global-prefix": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-1.0.2.tgz", - "integrity": "sha1-2/dDxsFJklk8ZVVoy2btMsASLr4=", - "dev": true, - "dependencies": { - "expand-tilde": "^2.0.2", - "homedir-polyfill": "^1.0.1", - "ini": "^1.3.4", - "is-windows": "^1.0.1", - "which": "^1.2.14" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/globalyzer": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/globalyzer/-/globalyzer-0.1.0.tgz", - "integrity": "sha512-40oNTM9UfG6aBmuKxk/giHn5nQ8RVz/SS4Ir6zgzOv9/qC3kKZ9v4etGTcJbEl/NyVQH7FGU7d+X1egr57Md2Q==", - "dev": true - }, - "node_modules/globby": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/globby/-/globby-10.0.1.tgz", - "integrity": "sha512-sSs4inE1FB2YQiymcmTv6NWENryABjUNPeWhOvmn4SjtKybglsyPZxFB3U1/+L1bYi0rNZDqCLlHyLYDl1Pq5A==", - "dev": true, - "dependencies": { - "@types/glob": "^7.1.1", - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.0.3", - "glob": "^7.1.3", - "ignore": "^5.1.1", - "merge2": "^1.2.3", - "slash": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/globrex": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/globrex/-/globrex-0.1.2.tgz", - "integrity": "sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==", - "dev": true - }, - "node_modules/glogg": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/glogg/-/glogg-1.0.2.tgz", - "integrity": "sha512-5mwUoSuBk44Y4EshyiqcH95ZntbDdTQqA3QYSrxmzj28Ai0vXBGMH1ApSANH14j2sIRtqCEyg6PfsuP7ElOEDA==", - "dev": true, - "dependencies": { - "sparkles": "^1.0.0" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/glsl-tokenizer": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/glsl-tokenizer/-/glsl-tokenizer-2.1.5.tgz", - "integrity": "sha512-XSZEJ/i4dmz3Pmbnpsy3cKh7cotvFlBiZnDOwnj/05EwNp2XrhQ4XKJxT7/pDt4kp4YcpRSKz8eTV7S+mwV6MA==", - "dependencies": { - "through2": "^0.6.3" - } - }, - "node_modules/gopd": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", - "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", - "dev": true, - "dependencies": { - "get-intrinsic": "^1.1.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/gpu-mock.js": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/gpu-mock.js/-/gpu-mock.js-1.3.1.tgz", - "integrity": "sha512-+lbp8rQ0p1nTa6Gk6HoLiw4yM6JTpql82U+nCF3sZbX4FJWP9PzzF1018dW8K+pbmqRmhLHbn6Bjc6i6tgUpbA==", - "peerDependencies": { - "gpu.js": "^2.10.3" - } - }, - "node_modules/gpu.js": { - "version": "2.15.2", - "resolved": "https://registry.npmjs.org/gpu.js/-/gpu.js-2.15.2.tgz", - "integrity": "sha512-tgTRoWEE0X2PE3OgTNub9OwadXND2K7qwOW/VwhIiedY/mbiT93jJIrgWAKBgdhQR0JmyN4ObkSu0/vjSpbuiQ==", - "peer": true, - "dependencies": { - "acorn": "^7.1.1", - "gl": "^4.5.2", - "gl-wiretap": "^0.6.2", - "gpu-mock.js": "^1.3.0", - "webgpu": "^0.1.16" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/gpu.js/node_modules/aproba": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", - "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", - "peer": true - }, - "node_modules/gpu.js/node_modules/are-we-there-yet": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.7.tgz", - "integrity": "sha512-nxwy40TuMiUGqMyRHgCSWZ9FM4VAoRP4xUYSTv5ImRog+h9yISPbVH7H8fASCIzYn9wlEv4zvFL7uKDMCFQm3g==", - "peer": true, - "dependencies": { - "delegates": "^1.0.0", - "readable-stream": "^2.0.6" - } - }, - "node_modules/gpu.js/node_modules/decompress-response": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-4.2.1.tgz", - "integrity": "sha512-jOSne2qbyE+/r8G1VU+G/82LBs2Fs4LAsTiLSHOCOMZQl2OKZ6i8i4IyHemTe+/yIXOtTcRQMzPcgyhoFlqPkw==", - "peer": true, - "dependencies": { - "mimic-response": "^2.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/gpu.js/node_modules/detect-libc": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", - "integrity": "sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg==", - "peer": true, - "bin": { - "detect-libc": "bin/detect-libc.js" - }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/gpu.js/node_modules/gauge": { - "version": "2.7.4", - "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", - "integrity": "sha512-14x4kjc6lkD3ltw589k0NrPD6cCNTD6CWoVUNpB85+DrtONoZn+Rug6xZU5RvSC4+TZPxA5AnBibQYAvZn41Hg==", - "peer": true, - "dependencies": { - "aproba": "^1.0.3", - "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.0", - "object-assign": "^4.1.0", - "signal-exit": "^3.0.0", - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wide-align": "^1.1.0" - } - }, - "node_modules/gpu.js/node_modules/gl": { - "version": "4.9.2", - "resolved": "https://registry.npmjs.org/gl/-/gl-4.9.2.tgz", - "integrity": "sha512-lLYaicQxsRPxOnKWX9pIGmtKRuw0epvI089yl9uBvemYxR9xE01eRuXJgje1U0/06Df7bdOmmcW87IPOsu52Ow==", - "hasInstallScript": true, - "peer": true, - "dependencies": { - "bindings": "^1.5.0", - "bit-twiddle": "^1.0.2", - "glsl-tokenizer": "^2.0.2", - "nan": "^2.15.0", - "node-abi": "^2.30.1", - "node-gyp": "^7.1.2", - "prebuild-install": "^5.3.6" - }, - "engines": { - "node": ">=12.0.0" - } - }, - "node_modules/gpu.js/node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", - "peer": true - }, - "node_modules/gpu.js/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "peer": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/gpu.js/node_modules/mimic-response": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-2.1.0.tgz", - "integrity": "sha512-wXqjST+SLt7R009ySCglWBCFpjUygmCIfD790/kVbiGmUgfYGuB14PiTd5DwVxSV4NcYHjzMkoj5LjQZwTQLEA==", - "peer": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/gpu.js/node_modules/node-abi": { - "version": "2.30.1", - "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-2.30.1.tgz", - "integrity": "sha512-/2D0wOQPgaUWzVSVgRMx+trKJRC2UG4SUc4oCJoXx9Uxjtp0Vy3/kt7zcbxHF8+Z/pK3UloLWzBISg72brfy1w==", - "peer": true, - "dependencies": { - "semver": "^5.4.1" - } - }, - "node_modules/gpu.js/node_modules/node-gyp": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-7.1.2.tgz", - "integrity": "sha512-CbpcIo7C3eMu3dL1c3d0xw449fHIGALIJsRP4DDPHpyiW8vcriNY7ubh9TE4zEKfSxscY7PjeFnshE7h75ynjQ==", - "peer": true, - "dependencies": { - "env-paths": "^2.2.0", - "glob": "^7.1.4", - "graceful-fs": "^4.2.3", - "nopt": "^5.0.0", - "npmlog": "^4.1.2", - "request": "^2.88.2", - "rimraf": "^3.0.2", - "semver": "^7.3.2", - "tar": "^6.0.2", - "which": "^2.0.2" - }, - "bin": { - "node-gyp": "bin/node-gyp.js" - }, - "engines": { - "node": ">= 10.12.0" - } - }, - "node_modules/gpu.js/node_modules/node-gyp/node_modules/semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", - "peer": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/gpu.js/node_modules/npmlog": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", - "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", - "peer": true, - "dependencies": { - "are-we-there-yet": "~1.1.2", - "console-control-strings": "~1.1.0", - "gauge": "~2.7.3", - "set-blocking": "~2.0.0" - } - }, - "node_modules/gpu.js/node_modules/prebuild-install": { - "version": "5.3.6", - "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-5.3.6.tgz", - "integrity": "sha512-s8Aai8++QQGi4sSbs/M1Qku62PFK49Jm1CbgXklGz4nmHveDq0wzJkg7Na5QbnO1uNH8K7iqx2EQ/mV0MZEmOg==", - "peer": true, - "dependencies": { - "detect-libc": "^1.0.3", - "expand-template": "^2.0.3", - "github-from-package": "0.0.0", - "minimist": "^1.2.3", - "mkdirp-classic": "^0.5.3", - "napi-build-utils": "^1.0.1", - "node-abi": "^2.7.0", - "noop-logger": "^0.1.1", - "npmlog": "^4.0.1", - "pump": "^3.0.0", - "rc": "^1.2.7", - "simple-get": "^3.0.3", - "tar-fs": "^2.0.0", - "tunnel-agent": "^0.6.0", - "which-pm-runs": "^1.0.0" - }, - "bin": { - "prebuild-install": "bin.js" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/gpu.js/node_modules/pump": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", - "peer": true, - "dependencies": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - }, - "node_modules/gpu.js/node_modules/readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "peer": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/gpu.js/node_modules/semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "peer": true, - "bin": { - "semver": "bin/semver" - } - }, - "node_modules/gpu.js/node_modules/simple-get": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-3.1.1.tgz", - "integrity": "sha512-CQ5LTKGfCpvE1K0n2us+kuMPbk/q0EKl82s4aheV9oXjFEz6W/Y7oQFVJuU6QG77hRT4Ghb5RURteF5vnWjupA==", - "peer": true, - "dependencies": { - "decompress-response": "^4.2.0", - "once": "^1.3.1", - "simple-concat": "^1.0.0" - } - }, - "node_modules/gpu.js/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "peer": true, - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, - "node_modules/gpu.js/node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "peer": true, - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/graceful-fs": { - "version": "4.2.10", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", - "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==" - }, - "node_modules/gulp": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/gulp/-/gulp-4.0.2.tgz", - "integrity": "sha512-dvEs27SCZt2ibF29xYgmnwwCYZxdxhQ/+LFWlbAW8y7jt68L/65402Lz3+CKy0Ov4rOs+NERmDq7YlZaDqUIfA==", - "dev": true, - "dependencies": { - "glob-watcher": "^5.0.3", - "gulp-cli": "^2.2.0", - "undertaker": "^1.2.1", - "vinyl-fs": "^3.0.0" - }, - "bin": { - "gulp": "bin/gulp.js" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/gulp-concat": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/gulp-concat/-/gulp-concat-2.6.1.tgz", - "integrity": "sha1-Yz0WyV2IUEYorQJmVmPO5aR5M1M=", - "dev": true, - "dependencies": { - "concat-with-sourcemaps": "^1.0.0", - "through2": "^2.0.0", - "vinyl": "^2.0.0" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/gulp-concat/node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "node_modules/gulp-concat/node_modules/readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/gulp-concat/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, - "node_modules/gulp-concat/node_modules/through2": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", - "dev": true, - "dependencies": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" - } - }, - "node_modules/gulp-header": { - "version": "1.8.12", - "resolved": "https://registry.npmjs.org/gulp-header/-/gulp-header-1.8.12.tgz", - "integrity": "sha512-lh9HLdb53sC7XIZOYzTXM4lFuXElv3EVkSDhsd7DoJBj7hm+Ni7D3qYbb+Rr8DuM8nRanBvkVO9d7askreXGnQ==", - "deprecated": "Removed event-stream from gulp-header", - "dev": true, - "dependencies": { - "concat-with-sourcemaps": "*", - "lodash.template": "^4.4.0", - "through2": "^2.0.0" - } - }, - "node_modules/gulp-header/node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "node_modules/gulp-header/node_modules/readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/gulp-header/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, - "node_modules/gulp-header/node_modules/through2": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", - "dev": true, - "dependencies": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" - } - }, - "node_modules/gulp-jsbeautifier": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/gulp-jsbeautifier/-/gulp-jsbeautifier-2.1.2.tgz", - "integrity": "sha512-tZUk4c11zF8xzCCTOEmktxGitv/H2vpAcflZNVU8nxL+G5XxQyLJUJVUKylz7/dax+FXb3YwQYByaJ+yxmo8iw==", - "dev": true, - "dependencies": { - "chalk": "^1.1.3", - "fancy-log": "^1.3.2", - "js-beautify": "^1.7.5", - "lodash": "^4.17.4", - "plugin-error": "^0.1.2", - "rc": "^1.2.2", - "through2": "^2.0.3" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/gulp-jsbeautifier/node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "node_modules/gulp-jsbeautifier/node_modules/readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/gulp-jsbeautifier/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, - "node_modules/gulp-jsbeautifier/node_modules/through2": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", - "dev": true, - "dependencies": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" - } - }, - "node_modules/gulp-rename": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/gulp-rename/-/gulp-rename-1.4.0.tgz", - "integrity": "sha512-swzbIGb/arEoFK89tPY58vg3Ok1bw+d35PfUNwWqdo7KM4jkmuGA78JiDNqR+JeZFaeeHnRg9N7aihX3YPmsyg==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/gulp-replace": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/gulp-replace/-/gulp-replace-1.0.0.tgz", - "integrity": "sha512-lgdmrFSI1SdhNMXZQbrC75MOl1UjYWlOWNbNRnz+F/KHmgxt3l6XstBoAYIdadwETFyG/6i+vWUSCawdC3pqOw==", - "dev": true, - "dependencies": { - "istextorbinary": "2.2.1", - "readable-stream": "^2.0.1", - "replacestream": "^4.0.0" - }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/gulp-replace/node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "node_modules/gulp-replace/node_modules/readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/gulp-replace/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, - "node_modules/gulp-strip-comments": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/gulp-strip-comments/-/gulp-strip-comments-2.5.2.tgz", - "integrity": "sha512-lb1bW7rsPWDD8f4ZPSguDvmCdjKmjr5HR4yZb9ros3sLl5AfW7oUj8KzY9/VRisT7dG8dL7hVHzNpQEVxfwZGQ==", - "dev": true, - "dependencies": { - "decomment": "^0.9.0", - "plugin-error": "^0.1.2", - "through2": "^2.0.3" - } - }, - "node_modules/gulp-strip-comments/node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "node_modules/gulp-strip-comments/node_modules/readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/gulp-strip-comments/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, - "node_modules/gulp-strip-comments/node_modules/through2": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", - "dev": true, - "dependencies": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" - } - }, - "node_modules/gulp-uglify-es": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/gulp-uglify-es/-/gulp-uglify-es-3.0.0.tgz", - "integrity": "sha512-dQ3czMFFojNgCajcrYl0oa98+YayaQ8kXRdaacpZRZ3iw2sdVURfdt8y8Ki1ogZGQqw8BUawnB7V6NkanxqnDg==", - "dev": true, - "dependencies": { - "o-stream": "^0.3.0", - "plugin-error": "^1.0.1", - "terser": "^5.7.1", - "vinyl": "^2.2.1", - "vinyl-sourcemaps-apply": "^0.2.1" - } - }, - "node_modules/gulp-uglify-es/node_modules/plugin-error": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/plugin-error/-/plugin-error-1.0.1.tgz", - "integrity": "sha512-L1zP0dk7vGweZME2i+EeakvUNqSrdiI3F91TwEoYiGrAfUXmVv6fJIq4g82PAXxNsWOp0J7ZqQy/3Szz0ajTxA==", - "dev": true, - "dependencies": { - "ansi-colors": "^1.0.1", - "arr-diff": "^4.0.0", - "arr-union": "^3.1.0", - "extend-shallow": "^3.0.2" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/gulp/node_modules/gulp-cli": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/gulp-cli/-/gulp-cli-2.2.0.tgz", - "integrity": "sha512-rGs3bVYHdyJpLqR0TUBnlcZ1O5O++Zs4bA0ajm+zr3WFCfiSLjGwoCBqFs18wzN+ZxahT9DkOK5nDf26iDsWjA==", - "dev": true, - "dependencies": { - "ansi-colors": "^1.0.1", - "archy": "^1.0.0", - "array-sort": "^1.0.0", - "color-support": "^1.1.3", - "concat-stream": "^1.6.0", - "copy-props": "^2.0.1", - "fancy-log": "^1.3.2", - "gulplog": "^1.0.0", - "interpret": "^1.1.0", - "isobject": "^3.0.1", - "liftoff": "^3.1.0", - "matchdep": "^2.0.0", - "mute-stdout": "^1.0.0", - "pretty-hrtime": "^1.0.0", - "replace-homedir": "^1.0.0", - "semver-greatest-satisfied-range": "^1.1.0", - "v8flags": "^3.0.1", - "yargs": "^7.1.0" - }, - "bin": { - "gulp": "bin/gulp.js" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/gulp/node_modules/yargs": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-7.1.0.tgz", - "integrity": "sha1-a6MY6xaWFyf10oT46gA+jWFU0Mg=", - "dev": true, - "dependencies": { - "camelcase": "^3.0.0", - "cliui": "^3.2.0", - "decamelize": "^1.1.1", - "get-caller-file": "^1.0.1", - "os-locale": "^1.4.0", - "read-pkg-up": "^1.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^1.0.1", - "set-blocking": "^2.0.0", - "string-width": "^1.0.2", - "which-module": "^1.0.0", - "y18n": "^3.2.1", - "yargs-parser": "^5.0.0" - } - }, - "node_modules/gulp/node_modules/yargs-parser": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-5.0.1.tgz", - "integrity": "sha512-wpav5XYiddjXxirPoCTUPbqM0PXvJ9hiBMvuJgInvo4/lAOTZzUprArw17q2O1P2+GHhbBr18/iQwjL5Z9BqfA==", - "dev": true, - "dependencies": { - "camelcase": "^3.0.0", - "object.assign": "^4.1.0" - } - }, - "node_modules/gulplog": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/gulplog/-/gulplog-1.0.0.tgz", - "integrity": "sha1-4oxNRdBey77YGDY86PnFkmIp/+U=", - "dev": true, - "dependencies": { - "glogg": "^1.0.0" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/har-schema": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha512-Oqluz6zhGX8cyRaTQlFMPw80bSJVG2x/cFb8ZPhUILGgHka9SsokCCOQgpveePerqidZOrT14ipqfJb7ILcW5Q==", - "peer": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/har-validator": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", - "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", - "deprecated": "this library is no longer supported", - "peer": true, - "dependencies": { - "ajv": "^6.12.3", - "har-schema": "^2.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dev": true, - "dependencies": { - "function-bind": "^1.1.1" - }, - "engines": { - "node": ">= 0.4.0" - } - }, - "node_modules/has-ansi": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", - "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", - "dev": true, - "dependencies": { - "ansi-regex": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-tostringtag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", - "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", - "dev": true, - "dependencies": { - "has-symbols": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-unicode": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", - "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==" - }, - "node_modules/has-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", - "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", - "dev": true, - "dependencies": { - "get-value": "^2.0.6", - "has-values": "^1.0.0", - "isobject": "^3.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/has-values": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", - "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", - "dev": true, - "dependencies": { - "is-number": "^3.0.0", - "kind-of": "^4.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/has-values/node_modules/kind-of": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", - "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", - "dev": true, - "dependencies": { - "is-buffer": "^1.1.5" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/hash-base": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz", - "integrity": "sha1-X8hoaEfs1zSZQDMZprCj8/auSRg=", - "dev": true, - "dependencies": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/hash.js": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", - "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", - "dev": true, - "dependencies": { - "inherits": "^2.0.3", - "minimalistic-assert": "^1.0.1" - } - }, - "node_modules/hmac-drbg": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", - "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", - "dev": true, - "dependencies": { - "hash.js": "^1.0.3", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.1" - } - }, - "node_modules/homedir-polyfill": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz", - "integrity": "sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==", - "dev": true, - "dependencies": { - "parse-passwd": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/hosted-git-info": { - "version": "2.8.9", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", - "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", - "dev": true - }, - "node_modules/html-escaper": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", - "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", - "dev": true - }, - "node_modules/htmlescape": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/htmlescape/-/htmlescape-1.1.1.tgz", - "integrity": "sha1-OgPtwiFLyjtmQko+eVk0lQnLA1E=", - "dev": true, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/http-cache-semantics": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz", - "integrity": "sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==" - }, - "node_modules/http-errors": { - "version": "1.7.3", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.3.tgz", - "integrity": "sha512-ZTTX0MWrsQ2ZAhA1cejAwDLycFsd7I7nVtnkT3Ol0aqodaKW+0CTZDQ1uBv5whptCnc8e8HeRRJxRs0kmm/Qfw==", - "dev": true, - "dependencies": { - "depd": "~1.1.2", - "inherits": "2.0.4", - "setprototypeof": "1.1.1", - "statuses": ">= 1.5.0 < 2", - "toidentifier": "1.0.0" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/http-errors/node_modules/statuses": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", - "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=", - "dev": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/http-proxy": { - "version": "1.18.1", - "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.1.tgz", - "integrity": "sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==", - "dev": true, - "dependencies": { - "eventemitter3": "^4.0.0", - "follow-redirects": "^1.0.0", - "requires-port": "^1.0.0" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/http-proxy-agent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz", - "integrity": "sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==", - "dependencies": { - "@tootallnate/once": "2", - "agent-base": "6", - "debug": "4" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/http-proxy-agent/node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/http-proxy-agent/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - }, - "node_modules/http-signature": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "integrity": "sha512-CAbnr6Rz4CYQkLYUtSNXxQPUH2gK8f3iWexVlsnMeD+GjlsQ0Xsy1cOX+mN3dtxYomRy21CiOzU8Uhw6OwncEQ==", - "peer": true, - "dependencies": { - "assert-plus": "^1.0.0", - "jsprim": "^1.2.2", - "sshpk": "^1.7.0" - }, - "engines": { - "node": ">=0.8", - "npm": ">=1.3.7" - } - }, - "node_modules/https-browserify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz", - "integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=", - "dev": true - }, - "node_modules/https-proxy-agent": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", - "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", - "dependencies": { - "agent-base": "6", - "debug": "4" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/https-proxy-agent/node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/https-proxy-agent/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - }, - "node_modules/humanize-ms": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz", - "integrity": "sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==", - "dependencies": { - "ms": "^2.0.0" - } - }, - "node_modules/iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "dev": true, - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ieee754": { - "version": "1.1.13", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz", - "integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==" - }, - "node_modules/ignore": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.2.tgz", - "integrity": "sha512-vdqWBp7MyzdmHkkRWV5nY+PfGRbYbahfuvsBCh277tq+w9zyNi7h5CYJCK0kmzti9kU+O/cB7sE8HvKv6aXAKQ==", - "dev": true, - "engines": { - "node": ">= 4" - } - }, - "node_modules/immutable": { - "version": "3.8.2", - "resolved": "https://registry.npmjs.org/immutable/-/immutable-3.8.2.tgz", - "integrity": "sha512-15gZoQ38eYjEjxkorfbcgBKBL6R7T459OuK+CpcWt7O3KF4uPCx2tD0uFETlUDIyo+1789crbMhTvQBSR5yBMg==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", - "engines": { - "node": ">=0.8.19" - } - }, - "node_modules/indent-string": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", - "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", - "engines": { - "node": ">=8" - } - }, - "node_modules/infer-owner": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/infer-owner/-/infer-owner-1.0.4.tgz", - "integrity": "sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A==" - }, - "node_modules/inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" - }, - "node_modules/ini": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", - "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" - }, - "node_modules/inline-source-map": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/inline-source-map/-/inline-source-map-0.6.2.tgz", - "integrity": "sha1-+Tk0ccGKedFyT4Y/o4tYY3Ct4qU=", - "dev": true, - "dependencies": { - "source-map": "~0.5.3" - } - }, - "node_modules/insert-module-globals": { - "version": "7.2.1", - "resolved": "https://registry.npmjs.org/insert-module-globals/-/insert-module-globals-7.2.1.tgz", - "integrity": "sha512-ufS5Qq9RZN+Bu899eA9QCAYThY+gGW7oRkmb0vC93Vlyu/CFGcH0OYPEjVkDXA5FEbTt1+VWzdoOD3Ny9N+8tg==", - "dev": true, - "dependencies": { - "acorn-node": "^1.5.2", - "combine-source-map": "^0.8.0", - "concat-stream": "^1.6.1", - "is-buffer": "^1.1.0", - "JSONStream": "^1.0.3", - "path-is-absolute": "^1.0.1", - "process": "~0.11.0", - "through2": "^2.0.0", - "undeclared-identifiers": "^1.1.2", - "xtend": "^4.0.0" - }, - "bin": { - "insert-module-globals": "bin/cmd.js" - } - }, - "node_modules/insert-module-globals/node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", - "dev": true - }, - "node_modules/insert-module-globals/node_modules/readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/insert-module-globals/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, - "node_modules/insert-module-globals/node_modules/through2": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", - "dev": true, - "dependencies": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" - } - }, - "node_modules/interpret": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.2.0.tgz", - "integrity": "sha512-mT34yGKMNceBQUoVn7iCDKDntA7SC6gycMAWzGx1z/CMCTV7b2AAtXlo3nRyHZ1FelRkQbQjprHSYGwzLtkVbw==", - "dev": true, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/invert-kv": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", - "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ip": { - "version": "1.1.8", - "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.8.tgz", - "integrity": "sha512-PuExPYUiu6qMBQb4l06ecm6T6ujzhmh+MeJcW9wa89PoAz5pvd4zPgN5WJV104mb6S2T1AwNIAaB70JNrLQWhg==" - }, - "node_modules/is-absolute": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-1.0.0.tgz", - "integrity": "sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA==", - "dev": true, - "dependencies": { - "is-relative": "^1.0.0", - "is-windows": "^1.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", - "dev": true, - "dependencies": { - "kind-of": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-accessor-descriptor/node_modules/kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "dependencies": { - "is-buffer": "^1.1.5" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-arguments": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz", - "integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-arrayish": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", - "dev": true - }, - "node_modules/is-binary-path": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", - "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", - "dev": true, - "dependencies": { - "binary-extensions": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", - "dev": true - }, - "node_modules/is-callable": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", - "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-core-module": { - "version": "2.11.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.11.0.tgz", - "integrity": "sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw==", - "dev": true, - "dependencies": { - "has": "^1.0.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", - "dev": true, - "dependencies": { - "kind-of": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-data-descriptor/node_modules/kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "dependencies": { - "is-buffer": "^1.1.5" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "dev": true, - "dependencies": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-descriptor/node_modules/kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", - "dependencies": { - "number-is-nan": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-generator-function": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.10.tgz", - "integrity": "sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==", - "dev": true, - "dependencies": { - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-glob": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", - "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", - "dev": true, - "dependencies": { - "is-extglob": "^2.1.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-lambda": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-lambda/-/is-lambda-1.0.1.tgz", - "integrity": "sha512-z7CMFGNrENq5iFB9Bqo64Xk6Y9sg+epq1myIcdHaGnbMTYOxvzsEtdYqQUylB7LxfkvgrrjP32T6Ywciio9UIQ==" - }, - "node_modules/is-negated-glob": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-negated-glob/-/is-negated-glob-1.0.0.tgz", - "integrity": "sha1-aRC8pdqMleeEtXUbl2z1oQ/uNtI=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "dev": true, - "dependencies": { - "kind-of": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-number-like": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/is-number-like/-/is-number-like-1.0.8.tgz", - "integrity": "sha512-6rZi3ezCyFcn5L71ywzz2bS5b2Igl1En3eTlZlvKjpz1n3IZLAYMbKYAIQgFmEu0GENg92ziU/faEOA/aixjbA==", - "dev": true, - "dependencies": { - "lodash.isfinite": "^3.3.2" - } - }, - "node_modules/is-number/node_modules/kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "dependencies": { - "is-buffer": "^1.1.5" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-path-cwd": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-2.2.0.tgz", - "integrity": "sha512-w942bTcih8fdJPJmQHFzkS76NEP8Kzzvmw92cXsazb8intwLqPibPPdXf4ANdKV3rYMuuQYGIWtvz9JilB3NFQ==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/is-path-in-cwd": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-3.0.0.tgz", - "integrity": "sha512-QGuLYLNfpHI/xLQ8ctyeD9mMCf2eBqrtxYWKQxlExrD0l3wBSDcplKYfV55lnTDB4MDvh9SRDt/VnDwVn0dYOw==", - "dev": true, - "dependencies": { - "is-path-inside": "^3.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/is-path-inside": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.1.tgz", - "integrity": "sha512-CKstxrctq1kUesU6WhtZDbYKzzYBuRH0UYInAVrkc/EYdB9ltbfE0gOoayG9nhohG6447sOOVGhHqsdmBvkbNg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/is-plain-object": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", - "dev": true, - "dependencies": { - "isobject": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-relative": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-relative/-/is-relative-1.0.0.tgz", - "integrity": "sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA==", - "dev": true, - "dependencies": { - "is-unc-path": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-typed-array": { - "version": "1.1.10", - "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.10.tgz", - "integrity": "sha512-PJqgEHiWZvMpaFZ3uTc8kHPM4+4ADTlDniuQL7cU/UDA0Ql7F70yGfHph3cLNe+c9toaigv+DFzTJKhc2CtO6A==", - "dev": true, - "dependencies": { - "available-typed-arrays": "^1.0.5", - "call-bind": "^1.0.2", - "for-each": "^0.3.3", - "gopd": "^1.0.1", - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==", - "peer": true - }, - "node_modules/is-unc-path": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-unc-path/-/is-unc-path-1.0.0.tgz", - "integrity": "sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ==", - "dev": true, - "dependencies": { - "unc-path-regex": "^0.1.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-utf8": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", - "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", - "dev": true - }, - "node_modules/is-valid-glob": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-valid-glob/-/is-valid-glob-1.0.0.tgz", - "integrity": "sha1-Kb8+/3Ab4tTTFdusw5vDn+j2Aao=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-windows": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", - "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-wsl": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-1.1.0.tgz", - "integrity": "sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" - }, - "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" - }, - "node_modules/isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/isstream": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==", - "peer": true - }, - "node_modules/istanbul-lib-coverage": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz", - "integrity": "sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/istanbul-lib-report": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", - "integrity": "sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==", - "dev": true, - "dependencies": { - "istanbul-lib-coverage": "^3.0.0", - "make-dir": "^3.0.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/istanbul-lib-report/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/istanbul-lib-report/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/istanbul-reports": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.5.tgz", - "integrity": "sha512-nUsEMa9pBt/NOHqbcbeJEgqIlY/K7rVWUX6Lql2orY5e9roQOthbR3vtY4zzf2orPELg80fnxxk9zUyPlgwD1w==", - "dev": true, - "dependencies": { - "html-escaper": "^2.0.0", - "istanbul-lib-report": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/istextorbinary": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/istextorbinary/-/istextorbinary-2.2.1.tgz", - "integrity": "sha512-TS+hoFl8Z5FAFMK38nhBkdLt44CclNRgDHWeMgsV8ko3nDlr/9UI2Sf839sW7enijf8oKsZYXRvM8g0it9Zmcw==", - "dev": true, - "dependencies": { - "binaryextensions": "2", - "editions": "^1.3.3", - "textextensions": "2" - }, - "engines": { - "node": ">=0.12" - } - }, - "node_modules/js-beautify": { - "version": "1.10.3", - "resolved": "https://registry.npmjs.org/js-beautify/-/js-beautify-1.10.3.tgz", - "integrity": "sha512-wfk/IAWobz1TfApSdivH5PJ0miIHgDoYb1ugSqHcODPmaYu46rYe5FVuIEkhjg8IQiv6rDNPyhsqbsohI/C2vQ==", - "dev": true, - "dependencies": { - "config-chain": "^1.1.12", - "editorconfig": "^0.15.3", - "glob": "^7.1.3", - "mkdirp": "~0.5.1", - "nopt": "~4.0.1" - }, - "bin": { - "css-beautify": "js/bin/css-beautify.js", - "html-beautify": "js/bin/html-beautify.js", - "js-beautify": "js/bin/js-beautify.js" - } - }, - "node_modules/js-beautify/node_modules/nopt": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.3.tgz", - "integrity": "sha512-CvaGwVMztSMJLOeXPrez7fyfObdZqNUK1cPAEzLHrTybIua9pMdmmPR5YwtfNftIOMv3DPUhFaxsZMNTQO20Kg==", - "dev": true, - "dependencies": { - "abbrev": "1", - "osenv": "^0.1.4" - }, - "bin": { - "nopt": "bin/nopt.js" - } - }, - "node_modules/jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==", - "peer": true - }, - "node_modules/json-schema": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", - "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==", - "peer": true - }, - "node_modules/json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "peer": true - }, - "node_modules/json-stable-stringify-without-jsonify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", - "dev": true - }, - "node_modules/json-stringify-safe": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==", - "peer": true - }, - "node_modules/jsonfile": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-3.0.1.tgz", - "integrity": "sha1-pezG9l9T9mLEQVx2daAzHQmS7GY=", - "dev": true, - "optionalDependencies": { - "graceful-fs": "^4.1.6" - } - }, - "node_modules/jsonparse": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", - "integrity": "sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=", - "dev": true, - "engines": [ - "node >= 0.2.0" - ] - }, - "node_modules/JSONStream": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz", - "integrity": "sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==", - "dev": true, - "dependencies": { - "jsonparse": "^1.2.0", - "through": ">=2.2.7 <3" - }, - "bin": { - "JSONStream": "bin.js" - }, - "engines": { - "node": "*" - } - }, - "node_modules/jsprim": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.2.tgz", - "integrity": "sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw==", - "peer": true, - "dependencies": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.4.0", - "verror": "1.10.0" - }, - "engines": { - "node": ">=0.6.0" - } - }, - "node_modules/just-debounce": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/just-debounce/-/just-debounce-1.0.0.tgz", - "integrity": "sha1-h/zPrv/AtozRnVX2cilD+SnqNeo=", - "dev": true - }, - "node_modules/just-extend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-4.0.2.tgz", - "integrity": "sha512-FrLwOgm+iXrPV+5zDU6Jqu4gCRXbWEQg2O3SKONsWE4w7AXFRkryS53bpWdaL9cNol+AmR3AEYz6kn+o0fCPnw==", - "dev": true - }, - "node_modules/kind-of": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", - "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/labeled-stream-splicer": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/labeled-stream-splicer/-/labeled-stream-splicer-2.0.2.tgz", - "integrity": "sha512-Ca4LSXFFZUjPScRaqOcFxneA0VpKZr4MMYCljyQr4LIewTLb3Y0IUTIsnBBsVubIeEfxeSZpSjSsRM8APEQaAw==", - "dev": true, - "dependencies": { - "inherits": "^2.0.1", - "stream-splicer": "^2.0.0" - } - }, - "node_modules/last-run": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/last-run/-/last-run-1.1.1.tgz", - "integrity": "sha1-RblpQsF7HHnHchmCWbqUO+v4yls=", - "dev": true, - "dependencies": { - "default-resolution": "^2.0.0", - "es6-weak-map": "^2.0.1" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/lazystream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/lazystream/-/lazystream-1.0.0.tgz", - "integrity": "sha1-9plf4PggOS9hOWvolGJAe7dxaOQ=", - "dev": true, - "dependencies": { - "readable-stream": "^2.0.5" - }, - "engines": { - "node": ">= 0.6.3" - } - }, - "node_modules/lazystream/node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "node_modules/lazystream/node_modules/readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/lazystream/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, - "node_modules/lcid": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", - "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", - "dev": true, - "dependencies": { - "invert-kv": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/lead": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/lead/-/lead-1.0.0.tgz", - "integrity": "sha1-bxT5mje+Op3XhPVJVpDlkDRm7kI=", - "dev": true, - "dependencies": { - "flush-write-stream": "^1.0.2" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/liftoff": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/liftoff/-/liftoff-3.1.0.tgz", - "integrity": "sha512-DlIPlJUkCV0Ips2zf2pJP0unEoT1kwYhiiPUGF3s/jtxTCjziNLoiVVh+jqWOWeFi6mmwQ5fNxvAUyPad4Dfog==", - "dev": true, - "dependencies": { - "extend": "^3.0.0", - "findup-sync": "^3.0.0", - "fined": "^1.0.1", - "flagged-respawn": "^1.0.0", - "is-plain-object": "^2.0.4", - "object.map": "^1.0.0", - "rechoir": "^0.6.2", - "resolve": "^1.1.7" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/limiter": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/limiter/-/limiter-1.1.5.tgz", - "integrity": "sha512-FWWMIEOxz3GwUI4Ts/IvgVy6LPvoMPgjMdQ185nN6psJyBJ4yOpzqm695/h5umdLJg2vW3GR5iG11MAkR2AzJA==", - "dev": true - }, - "node_modules/load-json-file": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", - "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", - "dev": true, - "dependencies": { - "graceful-fs": "^4.1.2", - "parse-json": "^2.2.0", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0", - "strip-bom": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/localtunnel": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/localtunnel/-/localtunnel-2.0.2.tgz", - "integrity": "sha512-n418Cn5ynvJd7m/N1d9WVJISLJF/ellZnfsLnx8WBWGzxv/ntNcFkJ1o6se5quUhCplfLGBNL5tYHiq5WF3Nug==", - "dev": true, - "dependencies": { - "axios": "0.21.4", - "debug": "4.3.2", - "openurl": "1.1.1", - "yargs": "17.1.1" - }, - "bin": { - "lt": "bin/lt.js" - }, - "engines": { - "node": ">=8.3.0" - } - }, - "node_modules/localtunnel/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/localtunnel/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/localtunnel/node_modules/cliui": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", - "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", - "dev": true, - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^7.0.0" - } - }, - "node_modules/localtunnel/node_modules/get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "dev": true, - "engines": { - "node": "6.* || 8.* || >= 10.*" - } - }, - "node_modules/localtunnel/node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/localtunnel/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/localtunnel/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/localtunnel/node_modules/wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, - "node_modules/localtunnel/node_modules/y18n": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", - "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", - "dev": true, - "engines": { - "node": ">=10" - } - }, - "node_modules/localtunnel/node_modules/yargs": { - "version": "17.1.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.1.1.tgz", - "integrity": "sha512-c2k48R0PwKIqKhPMWjeiF6y2xY/gPMUlro0sgxqXpbOIohWiLNXWslsootttv7E1e73QPAMQSg5FeySbVcpsPQ==", - "dev": true, - "dependencies": { - "cliui": "^7.0.2", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.0", - "y18n": "^5.0.5", - "yargs-parser": "^20.2.2" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/locate-path": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", - "dev": true, - "dependencies": { - "p-locate": "^5.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true - }, - "node_modules/lodash._reinterpolate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz", - "integrity": "sha1-DM8tiRZq8Ds2Y8eWU4t1rG4RTZ0=", - "dev": true - }, - "node_modules/lodash.isfinite": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/lodash.isfinite/-/lodash.isfinite-3.3.2.tgz", - "integrity": "sha512-7FGG40uhC8Mm633uKW1r58aElFlBlxCrg9JfSi3P6aYiWmfiWF0PgMd86ZUsxE5GwWPdHoS2+48bwTh2VPkIQA==", - "dev": true - }, - "node_modules/lodash.memoize": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-3.0.4.tgz", - "integrity": "sha1-LcvSwofLwKVcxCMovQxzYVDVPj8=", - "dev": true - }, - "node_modules/lodash.template": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.template/-/lodash.template-4.5.0.tgz", - "integrity": "sha512-84vYFxIkmidUiFxidA/KjjH9pAycqW+h980j7Fuz5qxRtO9pgB7MDFTdys1N7A5mcucRiDyEq4fusljItR1T/A==", - "dev": true, - "dependencies": { - "lodash._reinterpolate": "^3.0.0", - "lodash.templatesettings": "^4.0.0" - } - }, - "node_modules/lodash.templatesettings": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-4.2.0.tgz", - "integrity": "sha512-stgLz+i3Aa9mZgnjr/O+v9ruKZsPsndy7qPZOchbqk2cnTU1ZaldKK+v7m54WoKIyxiuMZTKT2H81F8BeAc3ZQ==", - "dev": true, - "dependencies": { - "lodash._reinterpolate": "^3.0.0" - } - }, - "node_modules/lolex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/lolex/-/lolex-4.1.0.tgz", - "integrity": "sha512-BYxIEXiVq5lGIXeVHnsFzqa1TxN5acnKnPCdlZSpzm8viNEOhiigupA4vTQ9HEFQ6nLTQ9wQOgBknJgzUYQ9Aw==", - "dev": true - }, - "node_modules/lru-cache": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", - "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", - "dev": true, - "dependencies": { - "pseudomap": "^1.0.2", - "yallist": "^2.1.2" - } - }, - "node_modules/lru-cache/node_modules/yallist": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", - "dev": true - }, - "node_modules/make-dir": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", - "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", - "dev": true, - "dependencies": { - "semver": "^6.0.0" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/make-dir/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - } - }, - "node_modules/make-fetch-happen": { - "version": "10.1.8", - "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-10.1.8.tgz", - "integrity": "sha512-0ASJbG12Au6+N5I84W+8FhGS6iM8MyzvZady+zaQAu+6IOaESFzCLLD0AR1sAFF3Jufi8bxm586ABN6hWd3k7g==", - "dependencies": { - "agentkeepalive": "^4.2.1", - "cacache": "^16.1.0", - "http-cache-semantics": "^4.1.0", - "http-proxy-agent": "^5.0.0", - "https-proxy-agent": "^5.0.0", - "is-lambda": "^1.0.1", - "lru-cache": "^7.7.1", - "minipass": "^3.1.6", - "minipass-collect": "^1.0.2", - "minipass-fetch": "^2.0.3", - "minipass-flush": "^1.0.5", - "minipass-pipeline": "^1.2.4", - "negotiator": "^0.6.3", - "promise-retry": "^2.0.1", - "socks-proxy-agent": "^7.0.0", - "ssri": "^9.0.0" - }, - "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" - } - }, - "node_modules/make-fetch-happen/node_modules/lru-cache": { - "version": "7.12.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.12.0.tgz", - "integrity": "sha512-OIP3DwzRZDfLg9B9VP/huWBlpvbkmbfiBy8xmsXp4RPmE4A3MhwNozc5ZJ3fWnSg8fDcdlE/neRTPG2ycEKliw==", - "engines": { - "node": ">=12" - } - }, - "node_modules/make-fetch-happen/node_modules/negotiator": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", - "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/make-iterator": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/make-iterator/-/make-iterator-1.0.1.tgz", - "integrity": "sha512-pxiuXh0iVEq7VM7KMIhs5gxsfxCux2URptUQaXo4iZZJxBAzTPOLE2BumO5dbfVYq/hBJFBR/a1mFDmOx5AGmw==", - "dev": true, - "dependencies": { - "kind-of": "^6.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/map-cache": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", - "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/map-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", - "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", - "dev": true, - "dependencies": { - "object-visit": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/matchdep": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/matchdep/-/matchdep-2.0.0.tgz", - "integrity": "sha1-xvNINKDY28OzfCfui7yyfHd1WC4=", - "dev": true, - "dependencies": { - "findup-sync": "^2.0.0", - "micromatch": "^3.0.4", - "resolve": "^1.4.0", - "stack-trace": "0.0.10" - }, - "engines": { - "node": ">= 0.10.0" - } - }, - "node_modules/matchdep/node_modules/findup-sync": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-2.0.0.tgz", - "integrity": "sha1-kyaxSIwi0aYIhlCoaQGy2akKLLw=", - "dev": true, - "dependencies": { - "detect-file": "^1.0.0", - "is-glob": "^3.1.0", - "micromatch": "^3.0.4", - "resolve-dir": "^1.0.1" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/matchdep/node_modules/is-glob": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", - "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", - "dev": true, - "dependencies": { - "is-extglob": "^2.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/md5.js": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", - "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", - "dev": true, - "dependencies": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1", - "safe-buffer": "^5.1.2" - } - }, - "node_modules/merge-stream": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-1.0.1.tgz", - "integrity": "sha1-QEEgLVCKNCugAXQAjfDCUbjBNeE=", - "dev": true, - "dependencies": { - "readable-stream": "^2.0.1" - } - }, - "node_modules/merge-stream/node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "node_modules/merge-stream/node_modules/readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/merge-stream/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, - "node_modules/merge2": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.2.3.tgz", - "integrity": "sha512-gdUU1Fwj5ep4kplwcmftruWofEFt6lfpkkr3h860CXbAB9c3hGb55EOL2ali0Td5oebvW0E1+3Sr+Ur7XfKpRA==", - "dev": true, - "engines": { - "node": ">= 4.5.0" - } - }, - "node_modules/micromatch": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", - "dev": true, - "dependencies": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "braces": "^2.3.1", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "extglob": "^2.0.4", - "fragment-cache": "^0.2.1", - "kind-of": "^6.0.2", - "nanomatch": "^1.2.9", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/miller-rabin": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", - "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", - "dev": true, - "dependencies": { - "bn.js": "^4.0.0", - "brorand": "^1.0.1" - }, - "bin": { - "miller-rabin": "bin/miller-rabin" - } - }, - "node_modules/mime": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.4.1.tgz", - "integrity": "sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ==", - "dev": true, - "bin": { - "mime": "cli.js" - } - }, - "node_modules/mime-db": { - "version": "1.40.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.40.0.tgz", - "integrity": "sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime-types": { - "version": "2.1.24", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.24.tgz", - "integrity": "sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ==", - "dependencies": { - "mime-db": "1.40.0" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mimic-response": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", - "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/minimalistic-assert": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", - "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", - "dev": true - }, - "node_modules/minimalistic-crypto-utils": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", - "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=", - "dev": true - }, - "node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/minimist": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.7.tgz", - "integrity": "sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/minipass": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.4.tgz", - "integrity": "sha512-I9WPbWHCGu8W+6k1ZiGpPu0GkoKBeorkfKNuAFBNS1HNFJvke82sxvI5bzcCNpWPorkOO5QQ+zomzzwRxejXiw==", - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/minipass-collect": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/minipass-collect/-/minipass-collect-1.0.2.tgz", - "integrity": "sha512-6T6lH0H8OG9kITm/Jm6tdooIbogG9e0tLgpY6mphXSm/A9u8Nq1ryBG+Qspiub9LjWlBPsPS3tWQ/Botq4FdxA==", - "dependencies": { - "minipass": "^3.0.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/minipass-fetch": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-2.1.0.tgz", - "integrity": "sha512-H9U4UVBGXEyyWJnqYDCLp1PwD8XIkJ4akNHp1aGVI+2Ym7wQMlxDKi4IB4JbmyU+pl9pEs/cVrK6cOuvmbK4Sg==", - "dependencies": { - "minipass": "^3.1.6", - "minipass-sized": "^1.0.3", - "minizlib": "^2.1.2" - }, - "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" - }, - "optionalDependencies": { - "encoding": "^0.1.13" - } - }, - "node_modules/minipass-flush": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/minipass-flush/-/minipass-flush-1.0.5.tgz", - "integrity": "sha512-JmQSYYpPUqX5Jyn1mXaRwOda1uQ8HP5KAT/oDSLCzt1BYRhQU0/hDtsB1ufZfEEzMZ9aAVmsBw8+FWsIXlClWw==", - "dependencies": { - "minipass": "^3.0.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/minipass-pipeline": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/minipass-pipeline/-/minipass-pipeline-1.2.4.tgz", - "integrity": "sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A==", - "dependencies": { - "minipass": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/minipass-sized": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/minipass-sized/-/minipass-sized-1.0.3.tgz", - "integrity": "sha512-MbkQQ2CTiBMlA2Dm/5cY+9SWFEN8pzzOXi6rlM5Xxq0Yqbda5ZQy9sU75a673FE9ZK0Zsbr6Y5iP6u9nktfg2g==", - "dependencies": { - "minipass": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/minizlib": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", - "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", - "dependencies": { - "minipass": "^3.0.0", - "yallist": "^4.0.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/mitt": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/mitt/-/mitt-1.2.0.tgz", - "integrity": "sha512-r6lj77KlwqLhIUku9UWYes7KJtsczvolZkzp8hbaDPPaE24OmWl5s539Mytlj22siEQKosZ26qCBgda2PKwoJw==", - "dev": true - }, - "node_modules/mixin-deep": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", - "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", - "dev": true, - "dependencies": { - "for-in": "^1.0.2", - "is-extendable": "^1.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/mixin-deep/node_modules/is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "dev": true, - "dependencies": { - "is-plain-object": "^2.0.4" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/mkdirp": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.3.tgz", - "integrity": "sha512-P+2gwrFqx8lhew375MQHHeTlY8AuOJSrGf0R5ddkEndUkmwpgUob/vQuBD1V22/Cw1/lJr4x+EjllSezBThzBg==", - "deprecated": "Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)", - "dev": true, - "dependencies": { - "minimist": "^1.2.5" - }, - "bin": { - "mkdirp": "bin/cmd.js" - } - }, - "node_modules/mkdirp-classic": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz", - "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==" - }, - "node_modules/module-deps": { - "version": "6.2.3", - "resolved": "https://registry.npmjs.org/module-deps/-/module-deps-6.2.3.tgz", - "integrity": "sha512-fg7OZaQBcL4/L+AK5f4iVqf9OMbCclXfy/znXRxTVhJSeW5AIlS9AwheYwDaXM3lVW7OBeaeUEY3gbaC6cLlSA==", - "dev": true, - "dependencies": { - "browser-resolve": "^2.0.0", - "cached-path-relative": "^1.0.2", - "concat-stream": "~1.6.0", - "defined": "^1.0.0", - "detective": "^5.2.0", - "duplexer2": "^0.1.2", - "inherits": "^2.0.1", - "JSONStream": "^1.0.3", - "parents": "^1.0.0", - "readable-stream": "^2.0.2", - "resolve": "^1.4.0", - "stream-combiner2": "^1.1.1", - "subarg": "^1.0.0", - "through2": "^2.0.0", - "xtend": "^4.0.0" - }, - "bin": { - "module-deps": "bin/cmd.js" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/module-deps/node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", - "dev": true - }, - "node_modules/module-deps/node_modules/readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/module-deps/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, - "node_modules/module-deps/node_modules/through2": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", - "dev": true, - "dependencies": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" - } - }, - "node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" - }, - "node_modules/mute-stdout": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/mute-stdout/-/mute-stdout-1.0.1.tgz", - "integrity": "sha512-kDcwXR4PS7caBpuRYYBUz9iVixUk3anO3f5OYFiIPwK/20vCzKCHyKoulbiDY1S53zD2bxUpxN/IJ+TnXjfvxg==", - "dev": true, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/nan": { - "version": "2.17.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.17.0.tgz", - "integrity": "sha512-2ZTgtl0nJsO0KQCjEpxcIr5D+Yv90plTitZt9JBfQvVJDS5seMl3FOvsh3+9CoYWXf/1l5OaZzzF6nDm4cagaQ==" - }, - "node_modules/nanomatch": { - "version": "1.2.13", - "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", - "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", - "dev": true, - "dependencies": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "fragment-cache": "^0.2.1", - "is-windows": "^1.0.2", - "kind-of": "^6.0.2", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/napi-build-utils": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz", - "integrity": "sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg==" - }, - "node_modules/negotiator": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", - "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==", - "dev": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/next-tick": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz", - "integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=", - "dev": true - }, - "node_modules/nise": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/nise/-/nise-1.5.0.tgz", - "integrity": "sha512-Z3sfYEkLFzFmL8KY6xnSJLRxwQwYBjOXi/24lb62ZnZiGA0JUzGGTI6TBIgfCSMIDl9Jlu8SRmHNACLTemDHww==", - "dev": true, - "dependencies": { - "@sinonjs/formatio": "^3.1.0", - "@sinonjs/text-encoding": "^0.7.1", - "just-extend": "^4.0.2", - "lolex": "^4.1.0", - "path-to-regexp": "^1.7.0" - } - }, - "node_modules/node-abi": { - "version": "3.22.0", - "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.22.0.tgz", - "integrity": "sha512-u4uAs/4Zzmp/jjsD9cyFYDXeISfUWaAVWshPmDZOFOv4Xl4SbzTXm53I04C2uRueYJ+0t5PEtLH/owbn2Npf/w==", - "dependencies": { - "semver": "^7.3.5" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/node-abi/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/node-abi/node_modules/semver": { - "version": "7.3.7", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", - "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/node-gyp": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-9.0.0.tgz", - "integrity": "sha512-Ma6p4s+XCTPxCuAMrOA/IJRmVy16R8Sdhtwl4PrCr7IBlj4cPawF0vg/l7nOT1jPbuNS7lIRJpBSvVsXwEZuzw==", - "dependencies": { - "env-paths": "^2.2.0", - "glob": "^7.1.4", - "graceful-fs": "^4.2.6", - "make-fetch-happen": "^10.0.3", - "nopt": "^5.0.0", - "npmlog": "^6.0.0", - "rimraf": "^3.0.2", - "semver": "^7.3.5", - "tar": "^6.1.2", - "which": "^2.0.2" - }, - "bin": { - "node-gyp": "bin/node-gyp.js" - }, - "engines": { - "node": "^12.22 || ^14.13 || >=16" - } - }, - "node_modules/node-gyp/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/node-gyp/node_modules/semver": { - "version": "7.3.7", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", - "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/node-gyp/node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/node-watch": { - "version": "0.7.3", - "resolved": "https://registry.npmjs.org/node-watch/-/node-watch-0.7.3.tgz", - "integrity": "sha512-3l4E8uMPY1HdMMryPRUAl+oIHtXtyiTlIiESNSVSNxcPfzAFzeTbXFQkZfAwBbo0B1qMSG8nUABx+Gd+YrbKrQ==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/noop-logger": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/noop-logger/-/noop-logger-0.1.1.tgz", - "integrity": "sha512-6kM8CLXvuW5crTxsAtva2YLrRrDaiTIkIePWs9moLHqbFWT94WpNFjwS/5dfLfECg5i/lkmw3aoqVidxt23TEQ==", - "peer": true - }, - "node_modules/nopt": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", - "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", - "dependencies": { - "abbrev": "1" - }, - "bin": { - "nopt": "bin/nopt.js" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/normalize-package-data": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", - "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", - "dev": true, - "dependencies": { - "hosted-git-info": "^2.1.4", - "resolve": "^1.10.0", - "semver": "2 || 3 || 4 || 5", - "validate-npm-package-license": "^3.0.1" - } - }, - "node_modules/normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/now-and-later": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/now-and-later/-/now-and-later-2.0.1.tgz", - "integrity": "sha512-KGvQ0cB70AQfg107Xvs/Fbu+dGmZoTRJp2TaPwcwQm3/7PteUyN2BCgk8KBMPGBUXZdVwyWS8fDCGFygBm19UQ==", - "dev": true, - "dependencies": { - "once": "^1.3.2" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/npmlog": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-6.0.2.tgz", - "integrity": "sha512-/vBvz5Jfr9dT/aFWd0FIRf+T/Q2WBsLENygUaFUqstqsycmZAP/t5BvFJTK0viFmSUxiUKTUplWy5vt+rvKIxg==", - "dependencies": { - "are-we-there-yet": "^3.0.0", - "console-control-strings": "^1.1.0", - "gauge": "^4.0.3", - "set-blocking": "^2.0.0" - }, - "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" - } - }, - "node_modules/number-is-nan": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/o-stream": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/o-stream/-/o-stream-0.3.0.tgz", - "integrity": "sha512-gbzl6qCJZ609x/M2t25HqCYQagFzWYCtQ84jcuObGr+V8D1Am4EVubkF4J+XFs6ukfiv96vNeiBb8FrbbMZYiQ==", - "dev": true - }, - "node_modules/oauth-sign": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", - "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", - "peer": true, - "engines": { - "node": "*" - } - }, - "node_modules/object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object-copy": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", - "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", - "dev": true, - "dependencies": { - "copy-descriptor": "^0.1.0", - "define-property": "^0.2.5", - "kind-of": "^3.0.3" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object-copy/node_modules/define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "dependencies": { - "is-descriptor": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object-copy/node_modules/kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "dependencies": { - "is-buffer": "^1.1.5" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object-keys": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", - "dev": true, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/object-visit": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", - "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", - "dev": true, - "dependencies": { - "isobject": "^3.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object.assign": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", - "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", - "dev": true, - "dependencies": { - "define-properties": "^1.1.2", - "function-bind": "^1.1.1", - "has-symbols": "^1.0.0", - "object-keys": "^1.0.11" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/object.defaults": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/object.defaults/-/object.defaults-1.1.0.tgz", - "integrity": "sha1-On+GgzS0B96gbaFtiNXNKeQ1/s8=", - "dev": true, - "dependencies": { - "array-each": "^1.0.1", - "array-slice": "^1.0.0", - "for-own": "^1.0.0", - "isobject": "^3.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object.map": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/object.map/-/object.map-1.0.1.tgz", - "integrity": "sha1-z4Plncj8wK1fQlDh94s7gb2AHTc=", - "dev": true, - "dependencies": { - "for-own": "^1.0.0", - "make-iterator": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object.pick": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", - "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", - "dev": true, - "dependencies": { - "isobject": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object.reduce": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/object.reduce/-/object.reduce-1.0.1.tgz", - "integrity": "sha1-b+NI8qx/oPlcpiEiZZkJaCW7A60=", - "dev": true, - "dependencies": { - "for-own": "^1.0.0", - "make-iterator": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/on-finished": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", - "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", - "dev": true, - "dependencies": { - "ee-first": "1.1.1" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dependencies": { - "wrappy": "1" - } - }, - "node_modules/openurl": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/openurl/-/openurl-1.1.1.tgz", - "integrity": "sha512-d/gTkTb1i1GKz5k3XE3XFV/PxQ1k45zDqGP2OA7YhgsaLoqm6qRvARAZOFer1fcXritWlGBRCu/UgeS4HAnXAA==", - "dev": true - }, - "node_modules/opn": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/opn/-/opn-5.3.0.tgz", - "integrity": "sha512-bYJHo/LOmoTd+pfiYhfZDnf9zekVJrY+cnS2a5F2x+w5ppvTqObojTP7WiFG+kVZs9Inw+qQ/lw7TroWwhdd2g==", - "dev": true, - "dependencies": { - "is-wsl": "^1.1.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/ordered-read-streams": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/ordered-read-streams/-/ordered-read-streams-1.0.1.tgz", - "integrity": "sha1-d8DLN8QVJdZBZtmQ/61+xqDhNj4=", - "dev": true, - "dependencies": { - "readable-stream": "^2.0.1" - } - }, - "node_modules/ordered-read-streams/node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "node_modules/ordered-read-streams/node_modules/readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/ordered-read-streams/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, - "node_modules/os-browserify": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", - "integrity": "sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc=", - "dev": true - }, - "node_modules/os-homedir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", - "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/os-locale": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", - "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", - "dev": true, - "dependencies": { - "lcid": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/os-tmpdir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/osenv": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz", - "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", - "dev": true, - "dependencies": { - "os-homedir": "^1.0.0", - "os-tmpdir": "^1.0.0" - } - }, - "node_modules/p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, - "dependencies": { - "yocto-queue": "^0.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-locate": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", - "dev": true, - "dependencies": { - "p-limit": "^3.0.2" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-map": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", - "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", - "dependencies": { - "aggregate-error": "^3.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/pako": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.10.tgz", - "integrity": "sha512-0DTvPVU3ed8+HNXOu5Bs+o//Mbdj9VNQMUOe9oKCwh8l0GNwpTDMKCWbRjgtD291AWnkAgkqA/LOnQS8AmS1tw==", - "dev": true - }, - "node_modules/parents": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parents/-/parents-1.0.1.tgz", - "integrity": "sha512-mXKF3xkoUt5td2DoxpLmtOmZvko9VfFpwRwkKDHSNvgmpLAeBo18YDhcPbBzJq+QLCHMbGOfzia2cX4U+0v9Mg==", - "dev": true, - "dependencies": { - "path-platform": "~0.11.15" - } - }, - "node_modules/parse-asn1": { - "version": "5.1.4", - "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.4.tgz", - "integrity": "sha512-Qs5duJcuvNExRfFZ99HDD3z4mAi3r9Wl/FOjEOijlxwCZs7E7mW2vjTpgQ4J8LpTF8x5v+1Vn5UQFejmWT11aw==", - "dev": true, - "dependencies": { - "asn1.js": "^4.0.0", - "browserify-aes": "^1.0.0", - "create-hash": "^1.1.0", - "evp_bytestokey": "^1.0.0", - "pbkdf2": "^3.0.3", - "safe-buffer": "^5.1.1" - } - }, - "node_modules/parse-filepath": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/parse-filepath/-/parse-filepath-1.0.2.tgz", - "integrity": "sha1-pjISf1Oq89FYdvWHLz/6x2PWyJE=", - "dev": true, - "dependencies": { - "is-absolute": "^1.0.0", - "map-cache": "^0.2.0", - "path-root": "^0.1.1" - }, - "engines": { - "node": ">=0.8" - } - }, - "node_modules/parse-json": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", - "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", - "dev": true, - "dependencies": { - "error-ex": "^1.2.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/parse-node-version": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parse-node-version/-/parse-node-version-1.0.1.tgz", - "integrity": "sha512-3YHlOa/JgH6Mnpr05jP9eDG254US9ek25LyIxZlDItp2iJtwyaXQb57lBYLdT3MowkUFYEV2XXNAYIPlESvJlA==", - "dev": true, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/parse-passwd": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", - "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/parseurl": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", - "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", - "dev": true, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/pascalcase": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", - "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/path-browserify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", - "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==", - "dev": true - }, - "node_modules/path-dirname": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", - "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=", - "dev": true - }, - "node_modules/path-exists": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", - "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", - "dev": true, - "dependencies": { - "pinkie-promise": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/path-parse": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", - "dev": true - }, - "node_modules/path-platform": { - "version": "0.11.15", - "resolved": "https://registry.npmjs.org/path-platform/-/path-platform-0.11.15.tgz", - "integrity": "sha512-Y30dB6rab1A/nfEKsZxmr01nUotHX0c/ZiIAsCTatEe1CmS5Pm5He7fZ195bPT7RdquoaL8lLxFCMQi/bS7IJg==", - "dev": true, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/path-root": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/path-root/-/path-root-0.1.1.tgz", - "integrity": "sha1-mkpoFMrBwM1zNgqV8yCDyOpHRbc=", - "dev": true, - "dependencies": { - "path-root-regex": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/path-root-regex": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/path-root-regex/-/path-root-regex-0.1.2.tgz", - "integrity": "sha1-v8zcjfWxLcUsi0PsONGNcsBLqW0=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/path-sort2": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/path-sort2/-/path-sort2-1.0.0.tgz", - "integrity": "sha512-OwUzmr3+avyEANhpUkUv+nlwAM/sCX5y9Ylok8fj3OK3SmLclq7jyEoqSL5qi+5bJAOskWGZPtdtjnoRGy5lxA==", - "dev": true - }, - "node_modules/path-to-regexp": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.7.0.tgz", - "integrity": "sha1-Wf3g9DW62suhA6hOnTvGTpa5k30=", - "dev": true, - "dependencies": { - "isarray": "0.0.1" - } - }, - "node_modules/path-type": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", - "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", - "dev": true, - "dependencies": { - "graceful-fs": "^4.1.2", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/pbkdf2": { - "version": "3.0.17", - "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.17.tgz", - "integrity": "sha512-U/il5MsrZp7mGg3mSQfn742na2T+1/vHDCG5/iTI3X9MKUuYUZVLQhyRsg06mCgDBTd57TxzgZt7P+fYfjRLtA==", - "dev": true, - "dependencies": { - "create-hash": "^1.1.2", - "create-hmac": "^1.1.4", - "ripemd160": "^2.0.1", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" - }, - "engines": { - "node": ">=0.12" - } - }, - "node_modules/performance-now": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==", - "peer": true - }, - "node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true, - "engines": { - "node": ">=8.6" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, - "node_modules/pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/pinkie": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", - "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/pinkie-promise": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", - "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", - "dev": true, - "dependencies": { - "pinkie": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/platform": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/platform/-/platform-1.3.5.tgz", - "integrity": "sha512-TuvHS8AOIZNAlE77WUDiR4rySV/VMptyMfcfeoMgs4P8apaZM3JrnbzBiixKUv+XR6i+BXrQh8WAnjaSPFO65Q==", - "dev": true - }, - "node_modules/plugin-error": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/plugin-error/-/plugin-error-0.1.2.tgz", - "integrity": "sha1-O5uzM1zPAPQl4HQ34ZJ2ln2kes4=", - "dev": true, - "dependencies": { - "ansi-cyan": "^0.1.1", - "ansi-red": "^0.1.1", - "arr-diff": "^1.0.1", - "arr-union": "^2.0.1", - "extend-shallow": "^1.1.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/plugin-error/node_modules/arr-diff": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-1.1.0.tgz", - "integrity": "sha1-aHwydYFjWI/vfeezb6vklesaOZo=", - "dev": true, - "dependencies": { - "arr-flatten": "^1.0.1", - "array-slice": "^0.2.3" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/plugin-error/node_modules/arr-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-2.1.0.tgz", - "integrity": "sha1-IPnqtexw9cfSFbEHexw5Fh0pLH0=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/plugin-error/node_modules/array-slice": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/array-slice/-/array-slice-0.2.3.tgz", - "integrity": "sha1-3Tz7gO15c6dRF82sabC5nshhhvU=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/plugin-error/node_modules/extend-shallow": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-1.1.4.tgz", - "integrity": "sha1-Gda/lN/AnXa6cR85uHLSH/TdkHE=", - "dev": true, - "dependencies": { - "kind-of": "^1.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/plugin-error/node_modules/kind-of": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-1.1.0.tgz", - "integrity": "sha1-FAo9LUGjbS78+pN3tiwk+ElaXEQ=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/portscanner": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/portscanner/-/portscanner-2.2.0.tgz", - "integrity": "sha512-IFroCz/59Lqa2uBvzK3bKDbDDIEaAY8XJ1jFxcLWTqosrsc32//P4VuSB2vZXoHiHqOmx8B5L5hnKOxL/7FlPw==", - "dev": true, - "dependencies": { - "async": "^2.6.0", - "is-number-like": "^1.0.3" - }, - "engines": { - "node": ">=0.4", - "npm": ">=1.0.0" - } - }, - "node_modules/posix-character-classes": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", - "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/prebuild-install": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.1.tgz", - "integrity": "sha512-jAXscXWMcCK8GgCoHOfIr0ODh5ai8mj63L2nWrjuAgXE6tDyYGnx4/8o/rCgU+B4JSyZBKbeZqzhtwtC3ovxjw==", - "dependencies": { - "detect-libc": "^2.0.0", - "expand-template": "^2.0.3", - "github-from-package": "0.0.0", - "minimist": "^1.2.3", - "mkdirp-classic": "^0.5.3", - "napi-build-utils": "^1.0.1", - "node-abi": "^3.3.0", - "pump": "^3.0.0", - "rc": "^1.2.7", - "simple-get": "^4.0.0", - "tar-fs": "^2.0.0", - "tunnel-agent": "^0.6.0" - }, - "bin": { - "prebuild-install": "bin.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/prebuild-install/node_modules/pump": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", - "dependencies": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - }, - "node_modules/pretty-hrtime": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz", - "integrity": "sha1-t+PqQkNaTJsnWdmeDyAesZWALuE=", - "dev": true, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/process": { - "version": "0.11.10", - "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", - "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=", - "dev": true, - "engines": { - "node": ">= 0.6.0" - } - }, - "node_modules/process-nextick-args": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" - }, - "node_modules/promise-inflight": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", - "integrity": "sha512-6zWPyEOFaQBJYcGMHBKTKJ3u6TBsnMFOIZSa6ce1e/ZrrsOlnHRHbabMjLiBYKp+n44X9eUI6VUPaukCXHuG4g==" - }, - "node_modules/promise-retry": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/promise-retry/-/promise-retry-2.0.1.tgz", - "integrity": "sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g==", - "dependencies": { - "err-code": "^2.0.2", - "retry": "^0.12.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/proto-list": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz", - "integrity": "sha1-IS1b/hMYMGpCD2QCuOJv85ZHqEk=", - "dev": true - }, - "node_modules/pseudomap": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", - "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", - "dev": true - }, - "node_modules/psl": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", - "integrity": "sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==", - "peer": true - }, - "node_modules/public-encrypt": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz", - "integrity": "sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==", - "dev": true, - "dependencies": { - "bn.js": "^4.1.0", - "browserify-rsa": "^4.0.0", - "create-hash": "^1.1.0", - "parse-asn1": "^5.0.0", - "randombytes": "^2.0.1", - "safe-buffer": "^5.1.2" - } - }, - "node_modules/pump": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", - "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", - "dev": true, - "dependencies": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - }, - "node_modules/pumpify": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/pumpify/-/pumpify-1.5.1.tgz", - "integrity": "sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ==", - "dev": true, - "dependencies": { - "duplexify": "^3.6.0", - "inherits": "^2.0.3", - "pump": "^2.0.0" - } - }, - "node_modules/punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", - "peer": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/qs": { - "version": "6.5.3", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.3.tgz", - "integrity": "sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==", - "peer": true, - "engines": { - "node": ">=0.6" - } - }, - "node_modules/querystring": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", - "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=", - "deprecated": "The querystring API is considered Legacy. new code should use the URLSearchParams API instead.", - "dev": true, - "engines": { - "node": ">=0.4.x" - } - }, - "node_modules/querystring-es3": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz", - "integrity": "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=", - "dev": true, - "engines": { - "node": ">=0.4.x" - } - }, - "node_modules/qunit": { - "version": "2.19.3", - "resolved": "https://registry.npmjs.org/qunit/-/qunit-2.19.3.tgz", - "integrity": "sha512-vEnspSZ37u2oR01OA/IZ1Td5V7BvQYFECdKPv86JaBplDNa5IHg0v7jFSPoP5L5o78Dbi8sl7/ATtpRDAKlSdw==", - "dev": true, - "dependencies": { - "commander": "7.2.0", - "node-watch": "0.7.3", - "tiny-glob": "0.2.9" - }, - "bin": { - "qunit": "bin/qunit.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/qunit/node_modules/commander": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", - "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", - "dev": true, - "engines": { - "node": ">= 10" - } - }, - "node_modules/randombytes": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", - "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", - "dev": true, - "dependencies": { - "safe-buffer": "^5.1.0" - } - }, - "node_modules/randomfill": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", - "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", - "dev": true, - "dependencies": { - "randombytes": "^2.0.5", - "safe-buffer": "^5.1.0" - } - }, - "node_modules/range-parser": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", - "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", - "dev": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/raw-body": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.1.tgz", - "integrity": "sha512-9WmIKF6mkvA0SLmA2Knm9+qj89e+j1zqgyn8aXGd7+nAduPoqgI9lO57SAZNn/Byzo5P7JhXTyg9PzaJbH73bA==", - "dev": true, - "dependencies": { - "bytes": "3.1.0", - "http-errors": "1.7.3", - "iconv-lite": "0.4.24", - "unpipe": "1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/rc": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", - "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", - "dependencies": { - "deep-extend": "^0.6.0", - "ini": "~1.3.0", - "minimist": "^1.2.0", - "strip-json-comments": "~2.0.1" - }, - "bin": { - "rc": "cli.js" - } - }, - "node_modules/read-dir-deep": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/read-dir-deep/-/read-dir-deep-7.0.1.tgz", - "integrity": "sha512-w99fvgqJm3cJ5Vb7b3oGKRDnm/m11q7w5LQ9uBCXe+repIEf1rFtkXLlPAxNrSwlp4skyPyvKd4DNNiIuc0geg==", - "dev": true, - "dependencies": { - "globby": "^10.0.1", - "is-path-cwd": "^2.2.0", - "is-path-in-cwd": "^3.0.0", - "path-sort2": "^1.0.0", - "slash": "^3.0.0" - }, - "engines": { - "node": ">=8.9.0" - } - }, - "node_modules/read-only-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/read-only-stream/-/read-only-stream-2.0.0.tgz", - "integrity": "sha1-JyT9aoET1zdkrCiNQ4YnDB2/F/A=", - "dev": true, - "dependencies": { - "readable-stream": "^2.0.2" - } - }, - "node_modules/read-only-stream/node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "node_modules/read-only-stream/node_modules/readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/read-only-stream/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, - "node_modules/read-pkg": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", - "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", - "dev": true, - "dependencies": { - "load-json-file": "^1.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/read-pkg-up": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", - "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", - "dev": true, - "dependencies": { - "find-up": "^1.0.0", - "read-pkg": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/readable-stream": { - "version": "1.0.34", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", - "integrity": "sha512-ok1qVCJuRkNmvebYikljxJA/UEsKwLl2nI1OmaqAu4/UE+h0wKCHok4XkL/gvi39OacXvw59RJUOFUkDib2rHg==", - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "0.0.1", - "string_decoder": "~0.10.x" - } - }, - "node_modules/readdirp": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", - "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", - "dev": true, - "dependencies": { - "graceful-fs": "^4.1.11", - "micromatch": "^3.1.10", - "readable-stream": "^2.0.2" - }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/readdirp/node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "node_modules/readdirp/node_modules/readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/readdirp/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, - "node_modules/rechoir": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", - "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", - "dev": true, - "dependencies": { - "resolve": "^1.1.6" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/regex-not": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", - "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", - "dev": true, - "dependencies": { - "extend-shallow": "^3.0.2", - "safe-regex": "^1.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/remove-bom-buffer": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/remove-bom-buffer/-/remove-bom-buffer-3.0.0.tgz", - "integrity": "sha512-8v2rWhaakv18qcvNeli2mZ/TMTL2nEyAKRvzo1WtnZBl15SHyEhrCu2/xKlJyUFKHiHgfXIyuY6g2dObJJycXQ==", - "dev": true, - "dependencies": { - "is-buffer": "^1.1.5", - "is-utf8": "^0.2.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/remove-bom-stream": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/remove-bom-stream/-/remove-bom-stream-1.2.0.tgz", - "integrity": "sha1-BfGlk/FuQuH7kOv1nejlaVJflSM=", - "dev": true, - "dependencies": { - "remove-bom-buffer": "^3.0.0", - "safe-buffer": "^5.1.0", - "through2": "^2.0.3" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/remove-bom-stream/node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "node_modules/remove-bom-stream/node_modules/readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/remove-bom-stream/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, - "node_modules/remove-bom-stream/node_modules/through2": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", - "dev": true, - "dependencies": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" - } - }, - "node_modules/remove-trailing-separator": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", - "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", - "dev": true - }, - "node_modules/repeat-element": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", - "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/repeat-string": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", - "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", - "dev": true, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/replace-ext": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.0.tgz", - "integrity": "sha1-3mMSg3P8v3w8z6TeWkgMRaZ5WOs=", - "dev": true, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/replace-homedir": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/replace-homedir/-/replace-homedir-1.0.0.tgz", - "integrity": "sha1-6H9tUTuSjd6AgmDBK+f+xv9ueYw=", - "dev": true, - "dependencies": { - "homedir-polyfill": "^1.0.1", - "is-absolute": "^1.0.0", - "remove-trailing-separator": "^1.1.0" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/replacestream": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/replacestream/-/replacestream-4.0.3.tgz", - "integrity": "sha512-AC0FiLS352pBBiZhd4VXB1Ab/lh0lEgpP+GGvZqbQh8a5cmXVoTe5EX/YeTFArnp4SRGTHh1qCHu9lGs1qG8sA==", - "dev": true, - "dependencies": { - "escape-string-regexp": "^1.0.3", - "object-assign": "^4.0.1", - "readable-stream": "^2.0.2" - } - }, - "node_modules/replacestream/node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "node_modules/replacestream/node_modules/readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/replacestream/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, - "node_modules/request": { - "version": "2.88.2", - "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", - "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", - "deprecated": "request has been deprecated, see https://github.com/request/request/issues/3142", - "peer": true, - "dependencies": { - "aws-sign2": "~0.7.0", - "aws4": "^1.8.0", - "caseless": "~0.12.0", - "combined-stream": "~1.0.6", - "extend": "~3.0.2", - "forever-agent": "~0.6.1", - "form-data": "~2.3.2", - "har-validator": "~5.1.3", - "http-signature": "~1.2.0", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.19", - "oauth-sign": "~0.9.0", - "performance-now": "^2.1.0", - "qs": "~6.5.2", - "safe-buffer": "^5.1.2", - "tough-cookie": "~2.5.0", - "tunnel-agent": "^0.6.0", - "uuid": "^3.3.2" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/require-main-filename": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", - "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", - "dev": true - }, - "node_modules/requires-port": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", - "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", - "dev": true - }, - "node_modules/resolve": { - "version": "1.22.1", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz", - "integrity": "sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==", - "dev": true, - "dependencies": { - "is-core-module": "^2.9.0", - "path-parse": "^1.0.7", - "supports-preserve-symlinks-flag": "^1.0.0" - }, - "bin": { - "resolve": "bin/resolve" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/resolve-dir": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/resolve-dir/-/resolve-dir-1.0.1.tgz", - "integrity": "sha1-eaQGRMNivoLybv/nOcm7U4IEb0M=", - "dev": true, - "dependencies": { - "expand-tilde": "^2.0.0", - "global-modules": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/resolve-options": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/resolve-options/-/resolve-options-1.1.0.tgz", - "integrity": "sha1-MrueOcBtZzONyTeMDW1gdFZq0TE=", - "dev": true, - "dependencies": { - "value-or-function": "^3.0.0" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/resolve-url": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", - "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", - "deprecated": "https://github.com/lydell/resolve-url#deprecated", - "dev": true - }, - "node_modules/resp-modifier": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/resp-modifier/-/resp-modifier-6.0.2.tgz", - "integrity": "sha1-sSTeXE+6/LpUH0j/pzlw9KpFa08=", - "dev": true, - "dependencies": { - "debug": "^2.2.0", - "minimatch": "^3.0.2" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/resp-modifier/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/ret": { - "version": "0.1.15", - "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", - "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", - "dev": true, - "engines": { - "node": ">=0.12" - } - }, - "node_modules/retry": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", - "integrity": "sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==", - "engines": { - "node": ">= 4" - } - }, - "node_modules/reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "dev": true, - "engines": { - "iojs": ">=1.0.0", - "node": ">=0.10.0" - } - }, - "node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/ripemd160": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", - "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", - "dev": true, - "dependencies": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1" - } - }, - "node_modules/run-parallel": { - "version": "1.1.9", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.1.9.tgz", - "integrity": "sha512-DEqnSRTDw/Tc3FXf49zedI638Z9onwUotBMiUFKmrO2sdFKIbXamXGQ3Axd4qgphxKB4kw/qP1w5kTxnfU1B9Q==", - "dev": true - }, - "node_modules/rx": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/rx/-/rx-4.1.0.tgz", - "integrity": "sha1-pfE/957zt0D+MKqAP7CfmIBdR4I=", - "dev": true - }, - "node_modules/rxjs": { - "version": "5.5.12", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-5.5.12.tgz", - "integrity": "sha512-xx2itnL5sBbqeeiVgNPVuQQ1nC8Jp2WfNJhXWHmElW9YmrpS9UVnNzhP3EH3HFqexO5Tlp8GhYY+WEcqcVMvGw==", - "dev": true, - "dependencies": { - "symbol-observable": "1.0.1" - }, - "engines": { - "npm": ">=2.0.0" - } - }, - "node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "node_modules/safe-regex": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", - "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", - "dev": true, - "dependencies": { - "ret": "~0.1.10" - } - }, - "node_modules/safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" - }, - "node_modules/semver": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz", - "integrity": "sha1-myzl094C0XxgEq0yaqa00M9U+U8=", - "dev": true, - "bin": { - "semver": "bin/semver" - } - }, - "node_modules/semver-greatest-satisfied-range": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/semver-greatest-satisfied-range/-/semver-greatest-satisfied-range-1.1.0.tgz", - "integrity": "sha1-E+jCZYq5aRywzXEJMkAoDTb3els=", - "dev": true, - "dependencies": { - "sver-compat": "^1.5.0" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/send": { - "version": "0.16.2", - "resolved": "https://registry.npmjs.org/send/-/send-0.16.2.tgz", - "integrity": "sha512-E64YFPUssFHEFBvpbbjr44NCLtI1AohxQ8ZSiJjQLskAdKuriYEP6VyGEsRDH8ScozGpkaX1BGvhanqCwkcEZw==", - "dev": true, - "dependencies": { - "debug": "2.6.9", - "depd": "~1.1.2", - "destroy": "~1.0.4", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "fresh": "0.5.2", - "http-errors": "~1.6.2", - "mime": "1.4.1", - "ms": "2.0.0", - "on-finished": "~2.3.0", - "range-parser": "~1.2.0", - "statuses": "~1.4.0" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/send/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/send/node_modules/http-errors": { - "version": "1.6.3", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", - "integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=", - "dev": true, - "dependencies": { - "depd": "~1.1.2", - "inherits": "2.0.3", - "setprototypeof": "1.1.0", - "statuses": ">= 1.4.0 < 2" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/send/node_modules/inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", - "dev": true - }, - "node_modules/send/node_modules/setprototypeof": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", - "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==", - "dev": true - }, - "node_modules/send/node_modules/statuses": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz", - "integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew==", - "dev": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/serve-index": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/serve-index/-/serve-index-1.9.1.tgz", - "integrity": "sha1-03aNabHn2C5c4FD/9bRTvqEqkjk=", - "dev": true, - "dependencies": { - "accepts": "~1.3.4", - "batch": "0.6.1", - "debug": "2.6.9", - "escape-html": "~1.0.3", - "http-errors": "~1.6.2", - "mime-types": "~2.1.17", - "parseurl": "~1.3.2" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/serve-index/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/serve-index/node_modules/http-errors": { - "version": "1.6.3", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", - "integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=", - "dev": true, - "dependencies": { - "depd": "~1.1.2", - "inherits": "2.0.3", - "setprototypeof": "1.1.0", - "statuses": ">= 1.4.0 < 2" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/serve-index/node_modules/inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", - "dev": true - }, - "node_modules/serve-index/node_modules/setprototypeof": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", - "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==", - "dev": true - }, - "node_modules/serve-index/node_modules/statuses": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", - "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=", - "dev": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/serve-static": { - "version": "1.13.2", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.13.2.tgz", - "integrity": "sha512-p/tdJrO4U387R9oMjb1oj7qSMaMfmOyd4j9hOFoxZe2baQszgHcSWjuya/CiT5kgZZKRudHNOA0pYXOl8rQ5nw==", - "dev": true, - "dependencies": { - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "parseurl": "~1.3.2", - "send": "0.16.2" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/server-destroy": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/server-destroy/-/server-destroy-1.0.1.tgz", - "integrity": "sha512-rb+9B5YBIEzYcD6x2VKidaa+cqYBJQKnU4oe4E3ANwRRN56yk/ua1YCJT1n21NTS8w6CcOclAKNP3PhdCXKYtQ==", - "dev": true - }, - "node_modules/set-blocking": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" - }, - "node_modules/set-value": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", - "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", - "dev": true, - "dependencies": { - "extend-shallow": "^2.0.1", - "is-extendable": "^0.1.1", - "is-plain-object": "^2.0.3", - "split-string": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/set-value/node_modules/extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "dependencies": { - "is-extendable": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/setprototypeof": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", - "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==", - "dev": true - }, - "node_modules/sha.js": { - "version": "2.4.11", - "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", - "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", - "dev": true, - "dependencies": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - }, - "bin": { - "sha.js": "bin.js" - } - }, - "node_modules/shasum-object": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shasum-object/-/shasum-object-1.0.0.tgz", - "integrity": "sha512-Iqo5rp/3xVi6M4YheapzZhhGPVs0yZwHj7wvwQ1B9z8H6zk+FEnI7y3Teq7qwnekfEhu8WmG2z0z4iWZaxLWVg==", - "dev": true, - "dependencies": { - "fast-safe-stringify": "^2.0.7" - } - }, - "node_modules/shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "dependencies": { - "shebang-regex": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/shell-quote": { - "version": "1.7.3", - "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.7.3.tgz", - "integrity": "sha512-Vpfqwm4EnqGdlsBFNmHhxhElJYrdfcxPThu+ryKS5J8L/fhAwLazFZtq+S+TWZ9ANj2piSQLGj6NQg+lKPmxrw==", - "dev": true - }, - "node_modules/sigmund": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.1.tgz", - "integrity": "sha1-P/IfGYytIXX587eBhT/ZTQ0ZtZA=", - "dev": true - }, - "node_modules/signal-exit": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", - "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=" - }, - "node_modules/simple-concat": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.0.tgz", - "integrity": "sha1-c0TLuLbib7J9ZrL8hvn21Zl1IcY=" - }, - "node_modules/simple-get": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-4.0.1.tgz", - "integrity": "sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "decompress-response": "^6.0.0", - "once": "^1.3.1", - "simple-concat": "^1.0.0" - } - }, - "node_modules/sinon": { - "version": "7.3.2", - "resolved": "https://registry.npmjs.org/sinon/-/sinon-7.3.2.tgz", - "integrity": "sha512-thErC1z64BeyGiPvF8aoSg0LEnptSaWE7YhdWWbWXgelOyThent7uKOnnEh9zBxDbKixtr5dEko+ws1sZMuFMA==", - "dev": true, - "dependencies": { - "@sinonjs/commons": "^1.4.0", - "@sinonjs/formatio": "^3.2.1", - "@sinonjs/samsam": "^3.3.1", - "diff": "^3.5.0", - "lolex": "^4.0.1", - "nise": "^1.4.10", - "supports-color": "^5.5.0" - } - }, - "node_modules/sinon/node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/smart-buffer": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", - "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==", - "engines": { - "node": ">= 6.0.0", - "npm": ">= 3.0.0" - } - }, - "node_modules/snapdragon": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", - "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", - "dev": true, - "dependencies": { - "base": "^0.11.1", - "debug": "^2.2.0", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "map-cache": "^0.2.2", - "source-map": "^0.5.6", - "source-map-resolve": "^0.5.0", - "use": "^3.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/snapdragon-node": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", - "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", - "dev": true, - "dependencies": { - "define-property": "^1.0.0", - "isobject": "^3.0.0", - "snapdragon-util": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/snapdragon-node/node_modules/define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "dependencies": { - "is-descriptor": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/snapdragon-node/node_modules/is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "dependencies": { - "kind-of": "^6.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/snapdragon-node/node_modules/is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "dependencies": { - "kind-of": "^6.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/snapdragon-node/node_modules/is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "dependencies": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/snapdragon-util": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", - "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", - "dev": true, - "dependencies": { - "kind-of": "^3.2.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/snapdragon-util/node_modules/kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "dependencies": { - "is-buffer": "^1.1.5" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/snapdragon/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/snapdragon/node_modules/define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "dependencies": { - "is-descriptor": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/snapdragon/node_modules/extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "dependencies": { - "is-extendable": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/socket.io": { - "version": "4.5.3", - "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-4.5.3.tgz", - "integrity": "sha512-zdpnnKU+H6mOp7nYRXH4GNv1ux6HL6+lHL8g7Ds7Lj8CkdK1jJK/dlwsKDculbyOHifcJ0Pr/yeXnZQ5GeFrcg==", - "dev": true, - "dependencies": { - "accepts": "~1.3.4", - "base64id": "~2.0.0", - "debug": "~4.3.2", - "engine.io": "~6.2.0", - "socket.io-adapter": "~2.4.0", - "socket.io-parser": "~4.2.0" - }, - "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/socket.io-adapter": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-2.4.0.tgz", - "integrity": "sha512-W4N+o69rkMEGVuk2D/cvca3uYsvGlMwsySWV447y99gUPghxq42BxqLNMndb+a1mm/5/7NeXVQS7RLa2XyXvYg==", - "dev": true - }, - "node_modules/socket.io-client": { - "version": "4.5.3", - "resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-4.5.3.tgz", - "integrity": "sha512-I/hqDYpQ6JKwtJOf5ikM+Qz+YujZPMEl6qBLhxiP0nX+TfXKhW4KZZG8lamrD6Y5ngjmYHreESVasVCgi5Kl3A==", - "dev": true, - "dependencies": { - "@socket.io/component-emitter": "~3.1.0", - "debug": "~4.3.2", - "engine.io-client": "~6.2.3", - "socket.io-parser": "~4.2.0" - }, - "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/socket.io-parser": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.2.1.tgz", - "integrity": "sha512-V4GrkLy+HeF1F/en3SpUaM+7XxYXpuMUWLGde1kSSh5nQMN4hLrbPIkD+otwh6q9R6NOQBN4AMaOZ2zVjui82g==", - "dev": true, - "dependencies": { - "@socket.io/component-emitter": "~3.1.0", - "debug": "~4.3.1" - }, - "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/socks": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/socks/-/socks-2.6.2.tgz", - "integrity": "sha512-zDZhHhZRY9PxRruRMR7kMhnf3I8hDs4S3f9RecfnGxvcBHQcKcIH/oUcEWffsfl1XxdYlA7nnlGbbTvPz9D8gA==", - "dependencies": { - "ip": "^1.1.5", - "smart-buffer": "^4.2.0" - }, - "engines": { - "node": ">= 10.13.0", - "npm": ">= 3.0.0" - } - }, - "node_modules/socks-proxy-agent": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-7.0.0.tgz", - "integrity": "sha512-Fgl0YPZ902wEsAyiQ+idGd1A7rSFx/ayC1CQVMw5P+EQx2V0SgpGtf6OKFhVjPflPUl9YMmEOnmfjCdMUsygww==", - "dependencies": { - "agent-base": "^6.0.2", - "debug": "^4.3.3", - "socks": "^2.6.2" - }, - "engines": { - "node": ">= 10" - } - }, - "node_modules/socks-proxy-agent/node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/socks-proxy-agent/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - }, - "node_modules/source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/source-map-resolve": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.2.tgz", - "integrity": "sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA==", - "deprecated": "See https://github.com/lydell/source-map-resolve#deprecated", - "dev": true, - "dependencies": { - "atob": "^2.1.1", - "decode-uri-component": "^0.2.0", - "resolve-url": "^0.2.1", - "source-map-url": "^0.4.0", - "urix": "^0.1.0" - } - }, - "node_modules/source-map-support": { - "version": "0.5.21", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", - "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", - "dev": true, - "dependencies": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - } - }, - "node_modules/source-map-support/node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/source-map-url": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", - "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=", - "deprecated": "See https://github.com/lydell/source-map-url#deprecated", - "dev": true - }, - "node_modules/sparkles": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/sparkles/-/sparkles-1.0.1.tgz", - "integrity": "sha512-dSO0DDYUahUt/0/pD/Is3VIm5TGJjludZ0HVymmhYF6eNA53PVLhnUk0znSYbH8IYBuJdCE+1luR22jNLMaQdw==", - "dev": true, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/spdx-correct": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz", - "integrity": "sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==", - "dev": true, - "dependencies": { - "spdx-expression-parse": "^3.0.0", - "spdx-license-ids": "^3.0.0" - } - }, - "node_modules/spdx-exceptions": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz", - "integrity": "sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA==", - "dev": true - }, - "node_modules/spdx-expression-parse": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", - "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", - "dev": true, - "dependencies": { - "spdx-exceptions": "^2.1.0", - "spdx-license-ids": "^3.0.0" - } - }, - "node_modules/spdx-license-ids": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz", - "integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q==", - "dev": true - }, - "node_modules/split-string": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", - "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", - "dev": true, - "dependencies": { - "extend-shallow": "^3.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/sshpk": { - "version": "1.17.0", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.17.0.tgz", - "integrity": "sha512-/9HIEs1ZXGhSPE8X6Ccm7Nam1z8KcoCqPdI7ecm1N33EzAetWahvQWVqLZtaZQ+IDKX4IyA2o0gBzqIMkAagHQ==", - "peer": true, - "dependencies": { - "asn1": "~0.2.3", - "assert-plus": "^1.0.0", - "bcrypt-pbkdf": "^1.0.0", - "dashdash": "^1.12.0", - "ecc-jsbn": "~0.1.1", - "getpass": "^0.1.1", - "jsbn": "~0.1.0", - "safer-buffer": "^2.0.2", - "tweetnacl": "~0.14.0" - }, - "bin": { - "sshpk-conv": "bin/sshpk-conv", - "sshpk-sign": "bin/sshpk-sign", - "sshpk-verify": "bin/sshpk-verify" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ssri": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/ssri/-/ssri-9.0.1.tgz", - "integrity": "sha512-o57Wcn66jMQvfHG1FlYbWeZWW/dHZhJXjpIcTfXldXEk5nz5lStPo3mK0OJQfGR3RbZUlbISexbljkJzuEj/8Q==", - "dependencies": { - "minipass": "^3.1.1" - }, - "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" - } - }, - "node_modules/stack-trace": { - "version": "0.0.10", - "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz", - "integrity": "sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA=", - "dev": true, - "engines": { - "node": "*" - } - }, - "node_modules/static-extend": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", - "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", - "dev": true, - "dependencies": { - "define-property": "^0.2.5", - "object-copy": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/static-extend/node_modules/define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "dependencies": { - "is-descriptor": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/statuses": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.3.1.tgz", - "integrity": "sha1-+vUbnrdKrvOzrPStX2Gr8ky3uT4=", - "dev": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/stream-browserify": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-3.0.0.tgz", - "integrity": "sha512-H73RAHsVBapbim0tU2JwwOiXUj+fikfiaoYAKHF3VJfA0pe2BCzkhAHBlLG6REzE+2WNZcxOXjK7lkso+9euLA==", - "dev": true, - "dependencies": { - "inherits": "~2.0.4", - "readable-stream": "^3.5.0" - } - }, - "node_modules/stream-browserify/node_modules/readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "dev": true, - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/stream-browserify/node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/stream-browserify/node_modules/string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.2.0" - } - }, - "node_modules/stream-combiner2": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/stream-combiner2/-/stream-combiner2-1.1.1.tgz", - "integrity": "sha512-3PnJbYgS56AeWgtKF5jtJRT6uFJe56Z0Hc5Ngg/6sI6rIt8iiMBTa9cvdyFfpMQjaVHr8dusbNeFGIIonxOvKw==", - "dev": true, - "dependencies": { - "duplexer2": "~0.1.0", - "readable-stream": "^2.0.2" - } - }, - "node_modules/stream-combiner2/node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", - "dev": true - }, - "node_modules/stream-combiner2/node_modules/readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/stream-combiner2/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, - "node_modules/stream-exhaust": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/stream-exhaust/-/stream-exhaust-1.0.2.tgz", - "integrity": "sha512-b/qaq/GlBK5xaq1yrK9/zFcyRSTNxmcZwFLGSTG0mXgZl/4Z6GgiyYOXOvY7N3eEvFRAG1bkDRz5EPGSvPYQlw==", - "dev": true - }, - "node_modules/stream-http": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-3.2.0.tgz", - "integrity": "sha512-Oq1bLqisTyK3TSCXpPbT4sdeYNdmyZJv1LxpEm2vu1ZhK89kSE5YXwZc3cWk0MagGaKriBh9mCFbVGtO+vY29A==", - "dev": true, - "dependencies": { - "builtin-status-codes": "^3.0.0", - "inherits": "^2.0.4", - "readable-stream": "^3.6.0", - "xtend": "^4.0.2" - } - }, - "node_modules/stream-http/node_modules/readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "dev": true, - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/stream-http/node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/stream-http/node_modules/string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.2.0" - } - }, - "node_modules/stream-shift": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.0.tgz", - "integrity": "sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI=", - "dev": true - }, - "node_modules/stream-splicer": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/stream-splicer/-/stream-splicer-2.0.1.tgz", - "integrity": "sha512-Xizh4/NPuYSyAXyT7g8IvdJ9HJpxIGL9PjyhtywCZvvP0OPIdqyrr4dMikeuvY8xahpdKEBlBTySe583totajg==", - "dev": true, - "dependencies": { - "inherits": "^2.0.1", - "readable-stream": "^2.0.2" - } - }, - "node_modules/stream-splicer/node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "node_modules/stream-splicer/node_modules/readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/stream-splicer/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, - "node_modules/stream-throttle": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/stream-throttle/-/stream-throttle-0.1.3.tgz", - "integrity": "sha512-889+B9vN9dq7/vLbGyuHeZ6/ctf5sNuGWsDy89uNxkFTAgzy0eK7+w5fL3KLNRTkLle7EgZGvHUphZW0Q26MnQ==", - "dev": true, - "dependencies": { - "commander": "^2.2.0", - "limiter": "^1.0.5" - }, - "bin": { - "throttleproxy": "bin/throttleproxy.js" - }, - "engines": { - "node": ">= 0.10.0" - } - }, - "node_modules/string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==" - }, - "node_modules/string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", - "dependencies": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "dependencies": { - "ansi-regex": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/strip-bom": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", - "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", - "dev": true, - "dependencies": { - "is-utf8": "^0.2.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/strip-json-comments": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/subarg": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/subarg/-/subarg-1.0.0.tgz", - "integrity": "sha512-RIrIdRY0X1xojthNcVtgT9sjpOGagEUKpZdgBUi054OEPFo282yg+zE+t1Rj3+RqKq2xStL7uUHhY+AjbC4BXg==", - "dev": true, - "dependencies": { - "minimist": "^1.1.0" - } - }, - "node_modules/supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", - "dev": true, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/supports-preserve-symlinks-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", - "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/sver-compat": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/sver-compat/-/sver-compat-1.5.0.tgz", - "integrity": "sha1-PPh9/rTQe0o/FIJ7wYaz/QxkXNg=", - "dev": true, - "dependencies": { - "es6-iterator": "^2.0.1", - "es6-symbol": "^3.1.1" - } - }, - "node_modules/symbol-observable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.0.1.tgz", - "integrity": "sha512-Kb3PrPYz4HanVF1LVGuAdW6LoVgIwjUYJGzFe7NDrBLCN4lsV/5J0MFurV+ygS4bRVwrCEt2c7MQ1R2a72oJDw==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/syntax-error": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/syntax-error/-/syntax-error-1.4.0.tgz", - "integrity": "sha512-YPPlu67mdnHGTup2A8ff7BC2Pjq0e0Yp/IyTFN03zWO0RcK07uLcbi7C2KpGR2FvWbaB0+bfE27a+sBKebSo7w==", - "dev": true, - "dependencies": { - "acorn-node": "^1.2.0" - } - }, - "node_modules/tar": { - "version": "6.1.12", - "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.12.tgz", - "integrity": "sha512-jU4TdemS31uABHd+Lt5WEYJuzn+TJTCBLljvIAHZOz6M9Os5pJ4dD+vRFLxPa/n3T0iEFzpi+0x1UfuDZYbRMw==", - "dependencies": { - "chownr": "^2.0.0", - "fs-minipass": "^2.0.0", - "minipass": "^3.0.0", - "minizlib": "^2.1.1", - "mkdirp": "^1.0.3", - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/tar-fs": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz", - "integrity": "sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==", - "dependencies": { - "chownr": "^1.1.1", - "mkdirp-classic": "^0.5.2", - "pump": "^3.0.0", - "tar-stream": "^2.1.4" - } - }, - "node_modules/tar-fs/node_modules/chownr": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", - "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==" - }, - "node_modules/tar-fs/node_modules/pump": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", - "dependencies": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - }, - "node_modules/tar-stream": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", - "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", - "dependencies": { - "bl": "^4.0.3", - "end-of-stream": "^1.4.1", - "fs-constants": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^3.1.1" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/tar-stream/node_modules/base64-js": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", - "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/tar-stream/node_modules/bl": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", - "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", - "dependencies": { - "buffer": "^5.5.0", - "inherits": "^2.0.4", - "readable-stream": "^3.4.0" - } - }, - "node_modules/tar-stream/node_modules/buffer": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", - "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.1.13" - } - }, - "node_modules/tar-stream/node_modules/readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/tar-stream/node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/tar-stream/node_modules/string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dependencies": { - "safe-buffer": "~5.2.0" - } - }, - "node_modules/tar/node_modules/mkdirp": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", - "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", - "bin": { - "mkdirp": "bin/cmd.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/terser": { - "version": "5.15.1", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.15.1.tgz", - "integrity": "sha512-K1faMUvpm/FBxjBXud0LWVAGxmvoPbZbfTCYbSgaaYQaIXI3/TdI7a7ZGA73Zrou6Q8Zmz3oeUTsp/dj+ag2Xw==", - "dev": true, - "dependencies": { - "@jridgewell/source-map": "^0.3.2", - "acorn": "^8.5.0", - "commander": "^2.20.0", - "source-map-support": "~0.5.20" - }, - "bin": { - "terser": "bin/terser" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/terser/node_modules/acorn": { - "version": "8.8.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.1.tgz", - "integrity": "sha512-7zFpHzhnqYKrkYdUjF1HI1bzd0VygEGX8lFk4k5zVMqHEoES+P+7TKI+EvLO9WVMJ8eekdO0aDEK044xTXwPPA==", - "dev": true, - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/test-exclude": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", - "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", - "dev": true, - "dependencies": { - "@istanbuljs/schema": "^0.1.2", - "glob": "^7.1.4", - "minimatch": "^3.0.4" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/textextensions": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/textextensions/-/textextensions-2.4.0.tgz", - "integrity": "sha512-qftQXnX1DzpSV8EddtHIT0eDDEiBF8ywhFYR2lI9xrGtxqKN+CvLXhACeCIGbCpQfxxERbrkZEFb8cZcDKbVZA==", - "dev": true, - "engines": { - "node": ">=0.8" - } - }, - "node_modules/tfunk": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/tfunk/-/tfunk-4.0.0.tgz", - "integrity": "sha512-eJQ0dGfDIzWNiFNYFVjJ+Ezl/GmwHaFTBTjrtqNPW0S7cuVDBrZrmzUz6VkMeCR4DZFqhd4YtLwsw3i2wYHswQ==", - "dev": true, - "dependencies": { - "chalk": "^1.1.3", - "dlv": "^1.1.3" - } - }, - "node_modules/through": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", - "dev": true - }, - "node_modules/through2": { - "version": "0.6.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-0.6.5.tgz", - "integrity": "sha512-RkK/CCESdTKQZHdmKICijdKKsCRVHs5KsLZ6pACAmF/1GPUQhonHSXWNERctxEp7RmvjdNbZTL5z9V7nSCXKcg==", - "dependencies": { - "readable-stream": ">=1.0.33-1 <1.1.0-0", - "xtend": ">=4.0.0 <4.1.0-0" - } - }, - "node_modules/through2-filter": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/through2-filter/-/through2-filter-3.0.0.tgz", - "integrity": "sha512-jaRjI2WxN3W1V8/FMZ9HKIBXixtiqs3SQSX4/YGIiP3gL6djW48VoZq9tDqeCWs3MT8YY5wb/zli8VW8snY1CA==", - "dev": true, - "dependencies": { - "through2": "~2.0.0", - "xtend": "~4.0.0" - } - }, - "node_modules/through2-filter/node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "node_modules/through2-filter/node_modules/readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/through2-filter/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, - "node_modules/through2-filter/node_modules/through2": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", - "dev": true, - "dependencies": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" - } - }, - "node_modules/time-stamp": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/time-stamp/-/time-stamp-1.1.0.tgz", - "integrity": "sha1-dkpaEa9QVhkhsTPztE5hhofg9cM=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/timers-browserify": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-1.4.2.tgz", - "integrity": "sha1-ycWLV1voQHN1y14kYtrO50NZ9B0=", - "dev": true, - "dependencies": { - "process": "~0.11.0" - }, - "engines": { - "node": ">=0.6.0" - } - }, - "node_modules/tiny-glob": { - "version": "0.2.9", - "resolved": "https://registry.npmjs.org/tiny-glob/-/tiny-glob-0.2.9.tgz", - "integrity": "sha512-g/55ssRPUjShh+xkfx9UPDXqhckHEsHr4Vd9zX55oSdGZc/MD0m3sferOkwWtp98bv+kcVfEHtRJgBVJzelrzg==", - "dev": true, - "dependencies": { - "globalyzer": "0.1.0", - "globrex": "^0.1.2" - } - }, - "node_modules/to-absolute-glob": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/to-absolute-glob/-/to-absolute-glob-2.0.2.tgz", - "integrity": "sha1-GGX0PZ50sIItufFFt4z/fQ98hJs=", - "dev": true, - "dependencies": { - "is-absolute": "^1.0.0", - "is-negated-glob": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/to-object-path": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", - "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", - "dev": true, - "dependencies": { - "kind-of": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/to-object-path/node_modules/kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "dependencies": { - "is-buffer": "^1.1.5" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/to-regex": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", - "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", - "dev": true, - "dependencies": { - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "regex-not": "^1.0.2", - "safe-regex": "^1.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/to-regex-range": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", - "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", - "dev": true, - "dependencies": { - "is-number": "^3.0.0", - "repeat-string": "^1.6.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/to-through": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/to-through/-/to-through-2.0.0.tgz", - "integrity": "sha1-/JKtq6ByZHvAtn1rA2ZKoZUJOvY=", - "dev": true, - "dependencies": { - "through2": "^2.0.3" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/to-through/node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "node_modules/to-through/node_modules/readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/to-through/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, - "node_modules/to-through/node_modules/through2": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", - "dev": true, - "dependencies": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" - } - }, - "node_modules/toidentifier": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", - "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==", - "dev": true, - "engines": { - "node": ">=0.6" - } - }, - "node_modules/tough-cookie": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", - "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", - "peer": true, - "dependencies": { - "psl": "^1.1.28", - "punycode": "^2.1.1" - }, - "engines": { - "node": ">=0.8" - } - }, - "node_modules/tty-browserify": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.1.tgz", - "integrity": "sha512-C3TaO7K81YvjCgQH9Q1S3R3P3BtN3RIM8n+OvX4il1K1zgE8ZhI0op7kClgkxtutIE8hQrcrHBXvIheqKUUCxw==", - "dev": true - }, - "node_modules/tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", - "dependencies": { - "safe-buffer": "^5.0.1" - }, - "engines": { - "node": "*" - } - }, - "node_modules/tweetnacl": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==", - "peer": true - }, - "node_modules/type": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/type/-/type-1.0.1.tgz", - "integrity": "sha512-MAM5dBMJCJNKs9E7JXo4CXRAansRfG0nlJxW7Wf6GZzSOvH31zClSaHdIMWLehe/EGMBkqeC55rrkaOr5Oo7Nw==", - "dev": true - }, - "node_modules/type-detect": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", - "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/typedarray": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", - "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", - "dev": true - }, - "node_modules/typescript": { - "version": "4.9.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.3.tgz", - "integrity": "sha512-CIfGzTelbKNEnLpLdGFgdyKhG23CKdKgQPOBc+OUNrkJ2vr+KSzsSV5kq5iWhEQbok+quxgGzrAtGWCyU7tHnA==", - "dev": true, - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=4.2.0" - } - }, - "node_modules/ua-parser-js": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-1.0.2.tgz", - "integrity": "sha512-00y/AXhx0/SsnI51fTc0rLRmafiGOM4/O+ny10Ps7f+j/b8p/ZY11ytMgznXkOVo4GQ+KwQG5UQLkLGirsACRg==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/ua-parser-js" - }, - { - "type": "paypal", - "url": "https://paypal.me/faisalman" - } - ], - "engines": { - "node": "*" - } - }, - "node_modules/umd": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/umd/-/umd-3.0.3.tgz", - "integrity": "sha512-4IcGSufhFshvLNcMCV80UnQVlZ5pMOC8mvNPForqwA4+lzYQuetTESLDQkeLmihq8bRcnpbQa48Wb8Lh16/xow==", - "dev": true, - "bin": { - "umd": "bin/cli.js" - } - }, - "node_modules/unc-path-regex": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/unc-path-regex/-/unc-path-regex-0.1.2.tgz", - "integrity": "sha1-5z3T17DXxe2G+6xrCufYxqadUPo=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/undeclared-identifiers": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/undeclared-identifiers/-/undeclared-identifiers-1.1.3.tgz", - "integrity": "sha512-pJOW4nxjlmfwKApE4zvxLScM/njmwj/DiUBv7EabwE4O8kRUy+HIwxQtZLBPll/jx1LJyBcqNfB3/cpv9EZwOw==", - "dev": true, - "dependencies": { - "acorn-node": "^1.3.0", - "dash-ast": "^1.0.0", - "get-assigned-identifiers": "^1.2.0", - "simple-concat": "^1.0.0", - "xtend": "^4.0.1" - }, - "bin": { - "undeclared-identifiers": "bin.js" - } - }, - "node_modules/undertaker": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/undertaker/-/undertaker-1.2.1.tgz", - "integrity": "sha512-71WxIzDkgYk9ZS+spIB8iZXchFhAdEo2YU8xYqBYJ39DIUIqziK78ftm26eecoIY49X0J2MLhG4hr18Yp6/CMA==", - "dev": true, - "dependencies": { - "arr-flatten": "^1.0.1", - "arr-map": "^2.0.0", - "bach": "^1.0.0", - "collection-map": "^1.0.0", - "es6-weak-map": "^2.0.1", - "last-run": "^1.1.0", - "object.defaults": "^1.0.0", - "object.reduce": "^1.0.0", - "undertaker-registry": "^1.0.0" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/undertaker-registry": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/undertaker-registry/-/undertaker-registry-1.0.1.tgz", - "integrity": "sha1-XkvaMI5KiirlhPm5pDWaSZglzFA=", - "dev": true, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/union-value": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", - "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", - "dev": true, - "dependencies": { - "arr-union": "^3.1.0", - "get-value": "^2.0.6", - "is-extendable": "^0.1.1", - "set-value": "^2.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/unique-filename": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz", - "integrity": "sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ==", - "dependencies": { - "unique-slug": "^2.0.0" - } - }, - "node_modules/unique-slug": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.2.tgz", - "integrity": "sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w==", - "dependencies": { - "imurmurhash": "^0.1.4" - } - }, - "node_modules/unique-stream": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/unique-stream/-/unique-stream-2.3.1.tgz", - "integrity": "sha512-2nY4TnBE70yoxHkDli7DMazpWiP7xMdCYqU2nBRO0UB+ZpEkGsSija7MvmvnZFUeC+mrgiUfcHSr3LmRFIg4+A==", - "dev": true, - "dependencies": { - "json-stable-stringify-without-jsonify": "^1.0.1", - "through2-filter": "^3.0.0" - } - }, - "node_modules/universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", - "dev": true, - "engines": { - "node": ">= 4.0.0" - } - }, - "node_modules/unpipe": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", - "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=", - "dev": true, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/unset-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", - "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", - "dev": true, - "dependencies": { - "has-value": "^0.3.1", - "isobject": "^3.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/unset-value/node_modules/has-value": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", - "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", - "dev": true, - "dependencies": { - "get-value": "^2.0.3", - "has-values": "^0.1.4", - "isobject": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/unset-value/node_modules/has-value/node_modules/isobject": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", - "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", - "dev": true, - "dependencies": { - "isarray": "1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/unset-value/node_modules/has-values": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", - "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/unset-value/node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "node_modules/upath": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/upath/-/upath-1.2.0.tgz", - "integrity": "sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg==", - "dev": true, - "engines": { - "node": ">=4", - "yarn": "*" - } - }, - "node_modules/uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "peer": true, - "dependencies": { - "punycode": "^2.1.0" - } - }, - "node_modules/urix": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", - "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", - "deprecated": "Please see https://github.com/lydell/urix#deprecated", - "dev": true - }, - "node_modules/url": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", - "integrity": "sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=", - "dev": true, - "dependencies": { - "punycode": "1.3.2", - "querystring": "0.2.0" - } - }, - "node_modules/url/node_modules/punycode": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", - "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=", - "dev": true - }, - "node_modules/use": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", - "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/util": { - "version": "0.12.5", - "resolved": "https://registry.npmjs.org/util/-/util-0.12.5.tgz", - "integrity": "sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA==", - "dev": true, - "dependencies": { - "inherits": "^2.0.3", - "is-arguments": "^1.0.4", - "is-generator-function": "^1.0.7", - "is-typed-array": "^1.1.3", - "which-typed-array": "^1.1.2" - } - }, - "node_modules/util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" - }, - "node_modules/utils-merge": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", - "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=", - "dev": true, - "engines": { - "node": ">= 0.4.0" - } - }, - "node_modules/uuid": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", - "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", - "deprecated": "Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.", - "peer": true, - "bin": { - "uuid": "bin/uuid" - } - }, - "node_modules/v8-to-istanbul": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.0.1.tgz", - "integrity": "sha512-74Y4LqY74kLE6IFyIjPtkSTWzUZmj8tdHT9Ii/26dvQ6K9Dl2NbEfj0XgU2sHCtKgt5VupqhlO/5aWuqS+IY1w==", - "dev": true, - "dependencies": { - "@jridgewell/trace-mapping": "^0.3.12", - "@types/istanbul-lib-coverage": "^2.0.1", - "convert-source-map": "^1.6.0" - }, - "engines": { - "node": ">=10.12.0" - } - }, - "node_modules/v8-to-istanbul/node_modules/convert-source-map": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", - "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", - "dev": true - }, - "node_modules/v8flags": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/v8flags/-/v8flags-3.1.3.tgz", - "integrity": "sha512-amh9CCg3ZxkzQ48Mhcb8iX7xpAfYJgePHxWMQCBWECpOSqJUXgY26ncA61UTV0BkPqfhcy6mzwCIoP4ygxpW8w==", - "dev": true, - "dependencies": { - "homedir-polyfill": "^1.0.1" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/validate-npm-package-license": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", - "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", - "dev": true, - "dependencies": { - "spdx-correct": "^3.0.0", - "spdx-expression-parse": "^3.0.0" - } - }, - "node_modules/value-or-function": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/value-or-function/-/value-or-function-3.0.0.tgz", - "integrity": "sha1-HCQ6ULWVwb5Up1S/7OhWO5/42BM=", - "dev": true, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/vary": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", - "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", - "dev": true, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/verror": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw==", - "engines": [ - "node >=0.6.0" - ], - "peer": true, - "dependencies": { - "assert-plus": "^1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "^1.2.0" - } - }, - "node_modules/vinyl": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-2.2.1.tgz", - "integrity": "sha512-LII3bXRFBZLlezoG5FfZVcXflZgWP/4dCwKtxd5ky9+LOtM4CS3bIRQsmR1KMnMW07jpE8fqR2lcxPZ+8sJIcw==", - "dev": true, - "dependencies": { - "clone": "^2.1.1", - "clone-buffer": "^1.0.0", - "clone-stats": "^1.0.0", - "cloneable-readable": "^1.0.0", - "remove-trailing-separator": "^1.0.1", - "replace-ext": "^1.0.0" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/vinyl-buffer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/vinyl-buffer/-/vinyl-buffer-1.0.1.tgz", - "integrity": "sha1-lsGjR5uMU5JULGEgKQE7Wyf4i78=", - "dev": true, - "dependencies": { - "bl": "^1.2.1", - "through2": "^2.0.3" - } - }, - "node_modules/vinyl-buffer/node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "node_modules/vinyl-buffer/node_modules/readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/vinyl-buffer/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, - "node_modules/vinyl-buffer/node_modules/through2": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", - "dev": true, - "dependencies": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" - } - }, - "node_modules/vinyl-fs": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/vinyl-fs/-/vinyl-fs-3.0.3.tgz", - "integrity": "sha512-vIu34EkyNyJxmP0jscNzWBSygh7VWhqun6RmqVfXePrOwi9lhvRs//dOaGOTRUQr4tx7/zd26Tk5WeSVZitgng==", - "dev": true, - "dependencies": { - "fs-mkdirp-stream": "^1.0.0", - "glob-stream": "^6.1.0", - "graceful-fs": "^4.0.0", - "is-valid-glob": "^1.0.0", - "lazystream": "^1.0.0", - "lead": "^1.0.0", - "object.assign": "^4.0.4", - "pumpify": "^1.3.5", - "readable-stream": "^2.3.3", - "remove-bom-buffer": "^3.0.0", - "remove-bom-stream": "^1.2.0", - "resolve-options": "^1.1.0", - "through2": "^2.0.0", - "to-through": "^2.0.0", - "value-or-function": "^3.0.0", - "vinyl": "^2.0.0", - "vinyl-sourcemap": "^1.1.0" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/vinyl-fs/node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "node_modules/vinyl-fs/node_modules/readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/vinyl-fs/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, - "node_modules/vinyl-fs/node_modules/through2": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", - "dev": true, - "dependencies": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" - } - }, - "node_modules/vinyl-source-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/vinyl-source-stream/-/vinyl-source-stream-2.0.0.tgz", - "integrity": "sha1-84pa+53R6Ttl1VBGmsYYKsT1S44=", - "dev": true, - "dependencies": { - "through2": "^2.0.3", - "vinyl": "^2.1.0" - } - }, - "node_modules/vinyl-source-stream/node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "node_modules/vinyl-source-stream/node_modules/readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/vinyl-source-stream/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, - "node_modules/vinyl-source-stream/node_modules/through2": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", - "dev": true, - "dependencies": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" - } - }, - "node_modules/vinyl-sourcemap": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/vinyl-sourcemap/-/vinyl-sourcemap-1.1.0.tgz", - "integrity": "sha1-kqgAWTo4cDqM2xHYswCtS+Y7PhY=", - "dev": true, - "dependencies": { - "append-buffer": "^1.0.2", - "convert-source-map": "^1.5.0", - "graceful-fs": "^4.1.6", - "normalize-path": "^2.1.1", - "now-and-later": "^2.0.0", - "remove-bom-buffer": "^3.0.0", - "vinyl": "^2.0.0" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/vinyl-sourcemap/node_modules/convert-source-map": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.6.0.tgz", - "integrity": "sha512-eFu7XigvxdZ1ETfbgPBohgyQ/Z++C0eEhTor0qRwBw9unw+L0/6V8wkSuGgzdThkiS5lSpdptOQPD8Ak40a+7A==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.1.1" - } - }, - "node_modules/vinyl-sourcemap/node_modules/normalize-path": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", - "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", - "dev": true, - "dependencies": { - "remove-trailing-separator": "^1.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/vinyl-sourcemaps-apply": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/vinyl-sourcemaps-apply/-/vinyl-sourcemaps-apply-0.2.1.tgz", - "integrity": "sha1-q2VJ1h0XLCsbh75cUI0jnI74dwU=", - "dev": true, - "dependencies": { - "source-map": "^0.5.1" - } - }, - "node_modules/vm-browserify": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.0.tgz", - "integrity": "sha512-iq+S7vZJE60yejDYM0ek6zg308+UZsdtPExWP9VZoCFCz1zkJoXFnAX7aZfd/ZwrkidzdUZL0C/ryW+JwAiIGw==", - "dev": true - }, - "node_modules/webgpu": { - "version": "0.1.16", - "resolved": "https://registry.npmjs.org/webgpu/-/webgpu-0.1.16.tgz", - "integrity": "sha512-KAXn/f8lnL8o4B718zzdfi1l0nEWQpuoWlC1L5WM/svAbeHjShCEI0l5ZcZBEEUm9FF3ZTgRjWk8iwbJfnGKTA==", - "engines": { - "node": ">= 13.0.0" - } - }, - "node_modules/which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dev": true, - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "which": "bin/which" - } - }, - "node_modules/which-module": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz", - "integrity": "sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8=", - "dev": true - }, - "node_modules/which-pm-runs": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/which-pm-runs/-/which-pm-runs-1.1.0.tgz", - "integrity": "sha512-n1brCuqClxfFfq/Rb0ICg9giSZqCS+pLtccdag6C2HyufBrh3fBOiy9nb6ggRMvWOVH5GrdJskj5iGTZNxd7SA==", - "peer": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/which-typed-array": { - "version": "1.1.9", - "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.9.tgz", - "integrity": "sha512-w9c4xkx6mPidwp7180ckYWfMmvxpjlZuIudNtDf4N/tTAUB8VJbX25qZoAsrtGuYNnGw3pa0AXgbGKRB8/EceA==", - "dev": true, - "dependencies": { - "available-typed-arrays": "^1.0.5", - "call-bind": "^1.0.2", - "for-each": "^0.3.3", - "gopd": "^1.0.1", - "has-tostringtag": "^1.0.0", - "is-typed-array": "^1.1.10" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/wide-align": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", - "integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==", - "dependencies": { - "string-width": "^1.0.2 || 2 || 3 || 4" - } - }, - "node_modules/wrap-ansi": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", - "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", - "dev": true, - "dependencies": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" - }, - "node_modules/ws": { - "version": "8.2.3", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.2.3.tgz", - "integrity": "sha512-wBuoj1BDpC6ZQ1B7DWQBYVLphPWkm8i9Y0/3YdHjHKHiohOJ1ws+3OccDWtH+PoC9DZD5WOTrJvNbWvjS6JWaA==", - "dev": true, - "engines": { - "node": ">=10.0.0" - }, - "peerDependencies": { - "bufferutil": "^4.0.1", - "utf-8-validate": "^5.0.2" - }, - "peerDependenciesMeta": { - "bufferutil": { - "optional": true - }, - "utf-8-validate": { - "optional": true - } - } - }, - "node_modules/xmlhttprequest-ssl": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/xmlhttprequest-ssl/-/xmlhttprequest-ssl-2.0.0.tgz", - "integrity": "sha512-QKxVRxiRACQcVuQEYFsI1hhkrMlrXHPegbbd1yn9UHOmRxY+si12nQYzri3vbzt8VdTTRviqcKxcyllFas5z2A==", - "dev": true, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", - "engines": { - "node": ">=0.4" - } - }, - "node_modules/y18n": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.2.tgz", - "integrity": "sha512-uGZHXkHnhF0XeeAPgnKfPv1bgKAYyVvmNL1xlKsPYZPaIHxGti2hHqvOCQv71XMsLxu1QjergkqogUnms5D3YQ==", - "dev": true - }, - "node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" - }, - "node_modules/yargs": { - "version": "17.6.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.6.2.tgz", - "integrity": "sha512-1/9UrdHjDZc0eOU0HxOHoS78C69UD3JRMvzlJ7S79S2nTaWRA/whGCTV8o9e/N/1Va9YIV7Q4sOxD8VV4pCWOw==", - "dev": true, - "dependencies": { - "cliui": "^8.0.1", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.3", - "y18n": "^5.0.5", - "yargs-parser": "^21.1.1" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/yargs-parser": { - "version": "20.2.9", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", - "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", - "dev": true, - "engines": { - "node": ">=10" - } - }, - "node_modules/yargs/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/yargs/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/yargs/node_modules/cliui": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", - "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", - "dev": true, - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.1", - "wrap-ansi": "^7.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/yargs/node_modules/get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "dev": true, - "engines": { - "node": "6.* || 8.* || >= 10.*" - } - }, - "node_modules/yargs/node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/yargs/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/yargs/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/yargs/node_modules/wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, - "node_modules/yargs/node_modules/y18n": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", - "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", - "dev": true, - "engines": { - "node": ">=10" - } - }, - "node_modules/yargs/node_modules/yargs-parser": { - "version": "21.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", - "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", - "dev": true, - "engines": { - "node": ">=12" - } - }, - "node_modules/yocto-queue": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", - "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - } - }, - "dependencies": { - "@bcoe/v8-coverage": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", - "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", - "dev": true - }, - "@gar/promisify": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/@gar/promisify/-/promisify-1.1.3.tgz", - "integrity": "sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw==" - }, - "@istanbuljs/schema": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", - "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", - "dev": true - }, - "@jridgewell/gen-mapping": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz", - "integrity": "sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A==", - "dev": true, - "requires": { - "@jridgewell/set-array": "^1.0.1", - "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.9" - } - }, - "@jridgewell/resolve-uri": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz", - "integrity": "sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==", - "dev": true - }, - "@jridgewell/set-array": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", - "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", - "dev": true - }, - "@jridgewell/source-map": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.2.tgz", - "integrity": "sha512-m7O9o2uR8k2ObDysZYzdfhb08VuEml5oWGiosa1VdaPZ/A6QyPkAJuwN0Q1lhULOf6B7MtQmHENS743hWtCrgw==", - "dev": true, - "requires": { - "@jridgewell/gen-mapping": "^0.3.0", - "@jridgewell/trace-mapping": "^0.3.9" - } - }, - "@jridgewell/sourcemap-codec": { - "version": "1.4.14", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", - "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==", - "dev": true - }, - "@jridgewell/trace-mapping": { - "version": "0.3.17", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.17.tgz", - "integrity": "sha512-MCNzAp77qzKca9+W/+I0+sEpaUnZoeasnghNeVc41VZCEKaCH73Vq3BZZ/SzWIgrqE4H4ceI+p+b6C0mHf9T4g==", - "dev": true, - "requires": { - "@jridgewell/resolve-uri": "3.1.0", - "@jridgewell/sourcemap-codec": "1.4.14" - } - }, - "@nodelib/fs.scandir": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.1.tgz", - "integrity": "sha512-NT/skIZjgotDSiXs0WqYhgcuBKhUMgfekCmCGtkUAiLqZdOnrdjmZr9wRl3ll64J9NF79uZ4fk16Dx0yMc/Xbg==", - "dev": true, - "requires": { - "@nodelib/fs.stat": "2.0.1", - "run-parallel": "^1.1.9" - } - }, - "@nodelib/fs.stat": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.1.tgz", - "integrity": "sha512-+RqhBlLn6YRBGOIoVYthsG0J9dfpO79eJyN7BYBkZJtfqrBwf2KK+rD/M/yjZR6WBmIhAgOV7S60eCgaSWtbFw==", - "dev": true - }, - "@nodelib/fs.walk": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.2.tgz", - "integrity": "sha512-J/DR3+W12uCzAJkw7niXDcqcKBg6+5G5Q/ZpThpGNzAUz70eOR6RV4XnnSN01qHZiVl0eavoxJsBypQoKsV2QQ==", - "dev": true, - "requires": { - "@nodelib/fs.scandir": "2.1.1", - "fastq": "^1.6.0" - } - }, - "@npmcli/fs": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-2.1.0.tgz", - "integrity": "sha512-DmfBvNXGaetMxj9LTp8NAN9vEidXURrf5ZTslQzEAi/6GbW+4yjaLFQc6Tue5cpZ9Frlk4OBo/Snf1Bh/S7qTQ==", - "requires": { - "@gar/promisify": "^1.1.3", - "semver": "^7.3.5" - }, - "dependencies": { - "lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "requires": { - "yallist": "^4.0.0" - } - }, - "semver": { - "version": "7.3.7", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", - "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", - "requires": { - "lru-cache": "^6.0.0" - } - } - } - }, - "@npmcli/move-file": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@npmcli/move-file/-/move-file-2.0.0.tgz", - "integrity": "sha512-UR6D5f4KEGWJV6BGPH3Qb2EtgH+t+1XQ1Tt85c7qicN6cezzuHPdZwwAxqZr4JLtnQu0LZsTza/5gmNmSl8XLg==", - "requires": { - "mkdirp": "^1.0.4", - "rimraf": "^3.0.2" - }, - "dependencies": { - "mkdirp": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", - "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==" - } - } - }, - "@sinonjs/commons": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.4.0.tgz", - "integrity": "sha512-9jHK3YF/8HtJ9wCAbG+j8cD0i0+ATS9A7gXFqS36TblLPNy6rEEc+SB0imo91eCboGaBYGV/MT1/br/J+EE7Tw==", - "dev": true, - "requires": { - "type-detect": "4.0.8" - } - }, - "@sinonjs/formatio": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/@sinonjs/formatio/-/formatio-3.2.1.tgz", - "integrity": "sha512-tsHvOB24rvyvV2+zKMmPkZ7dXX6LSLKZ7aOtXY6Edklp0uRcgGpOsQTTGTcWViFyx4uhWc6GV8QdnALbIbIdeQ==", - "dev": true, - "requires": { - "@sinonjs/commons": "^1", - "@sinonjs/samsam": "^3.1.0" - } - }, - "@sinonjs/samsam": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-3.3.2.tgz", - "integrity": "sha512-ILO/rR8LfAb60Y1Yfp9vxfYAASK43NFC2mLzpvLUbCQY/Qu8YwReboseu8aheCEkyElZF2L2T9mHcR2bgdvZyA==", - "dev": true, - "requires": { - "@sinonjs/commons": "^1.0.2", - "array-from": "^2.1.1", - "lodash": "^4.17.11" - } - }, - "@sinonjs/text-encoding": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/@sinonjs/text-encoding/-/text-encoding-0.7.1.tgz", - "integrity": "sha512-+iTbntw2IZPb/anVDbypzfQa+ay64MW0Zo8aJ8gZPWMMK6/OubMVb6lUPMagqjOPnmtauXnFCACVl3O7ogjeqQ==", - "dev": true - }, - "@socket.io/component-emitter": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@socket.io/component-emitter/-/component-emitter-3.1.0.tgz", - "integrity": "sha512-+9jVqKhRSpsc591z5vX+X5Yyw+he/HCB4iQ/RYxw35CEPaY1gnsNE43nf9n9AaYjAQrTiI/mOwKUKdUs9vf7Xg==", - "dev": true - }, - "@tootallnate/once": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", - "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==" - }, - "@types/cookie": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/@types/cookie/-/cookie-0.4.1.tgz", - "integrity": "sha512-XW/Aa8APYr6jSVVA1y/DEIZX0/GMKLEVekNG727R8cs56ahETkRAy/3DR7+fJyh7oUgGwNQaRfXCun0+KbWY7Q==", - "dev": true - }, - "@types/cors": { - "version": "2.8.12", - "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.12.tgz", - "integrity": "sha512-vt+kDhq/M2ayberEtJcIN/hxXy1Pk+59g2FV/ZQceeaTyCtCucjL2Q7FXlFjtWn4n15KCr1NE2lNNFhp0lEThw==", - "dev": true - }, - "@types/events": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz", - "integrity": "sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g==", - "dev": true - }, - "@types/glob": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.1.1.tgz", - "integrity": "sha512-1Bh06cbWJUHMC97acuD6UMG29nMt0Aqz1vF3guLfG+kHHJhy3AyohZFFxYk2f7Q1SQIrNwvncxAE0N/9s70F2w==", - "dev": true, - "requires": { - "@types/events": "*", - "@types/minimatch": "*", - "@types/node": "*" - } - }, - "@types/istanbul-lib-coverage": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz", - "integrity": "sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g==", - "dev": true - }, - "@types/minimatch": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz", - "integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==", - "dev": true - }, - "@types/node": { - "version": "12.6.8", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.6.8.tgz", - "integrity": "sha512-aX+gFgA5GHcDi89KG5keey2zf0WfZk/HAQotEamsK2kbey+8yGKcson0hbK8E+v0NArlCJQCqMP161YhV6ZXLg==", - "dev": true - }, - "abbrev": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", - "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" - }, - "accepts": { - "version": "1.3.7", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", - "integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==", - "dev": true, - "requires": { - "mime-types": "~2.1.24", - "negotiator": "0.6.2" - } - }, - "acorn": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.1.1.tgz", - "integrity": "sha512-add7dgA5ppRPxCFJoAGfMDi7PIBXq1RtGo7BhbLaxwrXPOmw8gq48Y9ozT01hUKy9byMjlR20EJhu5zlkErEkg==" - }, - "acorn-node": { - "version": "1.8.2", - "resolved": "https://registry.npmjs.org/acorn-node/-/acorn-node-1.8.2.tgz", - "integrity": "sha512-8mt+fslDufLYntIoPAaIMUe/lrbrehIiwmR3t2k9LljIzoigEPF27eLk2hy8zSGzmR/ogr7zbRKINMo1u0yh5A==", - "dev": true, - "requires": { - "acorn": "^7.0.0", - "acorn-walk": "^7.0.0", - "xtend": "^4.0.2" - }, - "dependencies": { - "acorn-walk": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-7.1.1.tgz", - "integrity": "sha512-wdlPY2tm/9XBr7QkKlq0WQVgiuGTX6YWPyRyBviSoScBuLfTVQhvwg6wJ369GJ/1nPfTLMfnrFIfjqVg6d+jQQ==", - "dev": true - } - } - }, - "agent-base": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", - "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", - "requires": { - "debug": "4" - }, - "dependencies": { - "debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "requires": { - "ms": "2.1.2" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - } - } - }, - "agentkeepalive": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.2.1.tgz", - "integrity": "sha512-Zn4cw2NEqd+9fiSVWMscnjyQ1a8Yfoc5oBajLeo5w+YBHgDUcEBY2hS4YpTz6iN5f/2zQiktcuM6tS8x1p9dpA==", - "requires": { - "debug": "^4.1.0", - "depd": "^1.1.2", - "humanize-ms": "^1.2.1" - }, - "dependencies": { - "debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "requires": { - "ms": "2.1.2" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - } - } - }, - "aggregate-error": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", - "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", - "requires": { - "clean-stack": "^2.0.0", - "indent-string": "^4.0.0" - } - }, - "ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "peer": true, - "requires": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - } - }, - "ansi-colors": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-1.1.0.tgz", - "integrity": "sha512-SFKX67auSNoVR38N3L+nvsPjOE0bybKTYbkf5tRvushrAPQ9V75huw0ZxBkKVeRU9kqH3d6HA4xTckbwZ4ixmA==", - "dev": true, - "requires": { - "ansi-wrap": "^0.1.0" - } - }, - "ansi-cyan": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/ansi-cyan/-/ansi-cyan-0.1.1.tgz", - "integrity": "sha1-U4rlKK+JgvKK4w2G8vF0VtJgmHM=", - "dev": true, - "requires": { - "ansi-wrap": "0.1.0" - } - }, - "ansi-gray": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/ansi-gray/-/ansi-gray-0.1.1.tgz", - "integrity": "sha1-KWLPVOyXksSFEKPetSRDaGHvclE=", - "dev": true, - "requires": { - "ansi-wrap": "0.1.0" - } - }, - "ansi-red": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/ansi-red/-/ansi-red-0.1.1.tgz", - "integrity": "sha1-jGOPnRCAgAo1PJwoyKgcpHBdlGw=", - "dev": true, - "requires": { - "ansi-wrap": "0.1.0" - } - }, - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" - }, - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true - }, - "ansi-wrap": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/ansi-wrap/-/ansi-wrap-0.1.0.tgz", - "integrity": "sha1-qCJQ3bABXponyoLoLqYDu/pF768=", - "dev": true - }, - "anymatch": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", - "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", - "dev": true, - "requires": { - "micromatch": "^3.1.4", - "normalize-path": "^2.1.1" - }, - "dependencies": { - "normalize-path": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", - "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", - "dev": true, - "requires": { - "remove-trailing-separator": "^1.0.1" - } - } - } - }, - "append-buffer": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/append-buffer/-/append-buffer-1.0.2.tgz", - "integrity": "sha1-2CIM9GYIFSXv6lBhTz3mUU36WPE=", - "dev": true, - "requires": { - "buffer-equal": "^1.0.0" - } - }, - "aproba": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz", - "integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==" - }, - "archy": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", - "integrity": "sha1-+cjBN1fMHde8N5rHeyxipcKGjEA=", - "dev": true - }, - "are-we-there-yet": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-3.0.0.tgz", - "integrity": "sha512-0GWpv50YSOcLXaN6/FAKY3vfRbllXWV2xvfA/oKJF8pzFhWXPV+yjhJXDBbjscDYowv7Yw1A3uigpzn5iEGTyw==", - "requires": { - "delegates": "^1.0.0", - "readable-stream": "^3.6.0" - }, - "dependencies": { - "readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - }, - "safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" - }, - "string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "requires": { - "safe-buffer": "~5.2.0" - } - } - } - }, - "arr-diff": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", - "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", - "dev": true - }, - "arr-filter": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/arr-filter/-/arr-filter-1.1.2.tgz", - "integrity": "sha1-Q/3d0JHo7xGqTEXZzcGOLf8XEe4=", - "dev": true, - "requires": { - "make-iterator": "^1.0.0" - } - }, - "arr-flatten": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", - "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", - "dev": true - }, - "arr-map": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/arr-map/-/arr-map-2.0.2.tgz", - "integrity": "sha1-Onc0X/wc814qkYJWAfnljy4kysQ=", - "dev": true, - "requires": { - "make-iterator": "^1.0.0" - } - }, - "arr-union": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", - "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", - "dev": true - }, - "array-each": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/array-each/-/array-each-1.0.1.tgz", - "integrity": "sha1-p5SvDAWrF1KEbudTofIRoFugxE8=", - "dev": true - }, - "array-from": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/array-from/-/array-from-2.1.1.tgz", - "integrity": "sha1-z+nYwmYoudxa7MYqn12PHzUsEZU=", - "dev": true - }, - "array-initial": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/array-initial/-/array-initial-1.1.0.tgz", - "integrity": "sha1-L6dLJnOTccOUe9enrcc74zSz15U=", - "dev": true, - "requires": { - "array-slice": "^1.0.0", - "is-number": "^4.0.0" - }, - "dependencies": { - "is-number": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", - "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", - "dev": true - } - } - }, - "array-last": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/array-last/-/array-last-1.3.0.tgz", - "integrity": "sha512-eOCut5rXlI6aCOS7Z7kCplKRKyiFQ6dHFBem4PwlwKeNFk2/XxTrhRh5T9PyaEWGy/NHTZWbY+nsZlNFJu9rYg==", - "dev": true, - "requires": { - "is-number": "^4.0.0" - }, - "dependencies": { - "is-number": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", - "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", - "dev": true - } - } - }, - "array-slice": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/array-slice/-/array-slice-1.1.0.tgz", - "integrity": "sha512-B1qMD3RBP7O8o0H2KbrXDyB0IccejMF15+87Lvlor12ONPRHP6gTjXMNkt/d3ZuOGbAe66hFmaCfECI24Ufp6w==", - "dev": true - }, - "array-sort": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/array-sort/-/array-sort-1.0.0.tgz", - "integrity": "sha512-ihLeJkonmdiAsD7vpgN3CRcx2J2S0TiYW+IS/5zHBI7mKUq3ySvBdzzBfD236ubDBQFiiyG3SWCPc+msQ9KoYg==", - "dev": true, - "requires": { - "default-compare": "^1.0.0", - "get-value": "^2.0.6", - "kind-of": "^5.0.2" - }, - "dependencies": { - "kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "dev": true - } - } - }, - "array-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", - "dev": true - }, - "array-unique": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", - "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", - "dev": true - }, - "asn1": { - "version": "0.2.6", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz", - "integrity": "sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==", - "peer": true, - "requires": { - "safer-buffer": "~2.1.0" - } - }, - "asn1.js": { - "version": "4.10.1", - "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.10.1.tgz", - "integrity": "sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw==", - "dev": true, - "requires": { - "bn.js": "^4.0.0", - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0" - } - }, - "assert": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/assert/-/assert-1.5.0.tgz", - "integrity": "sha512-EDsgawzwoun2CZkCgtxJbv392v4nbk9XDD06zI+kQYoBM/3RBWLlEyJARDOmhAAosBjWACEkKL6S+lIZtcAubA==", - "dev": true, - "requires": { - "object-assign": "^4.1.1", - "util": "0.10.3" - }, - "dependencies": { - "inherits": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", - "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=", - "dev": true - }, - "util": { - "version": "0.10.3", - "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", - "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=", - "dev": true, - "requires": { - "inherits": "2.0.1" - } - } - } - }, - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==", - "peer": true - }, - "assign-symbols": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", - "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", - "dev": true - }, - "async": { - "version": "2.6.4", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.4.tgz", - "integrity": "sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA==", - "dev": true, - "requires": { - "lodash": "^4.17.14" - } - }, - "async-done": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/async-done/-/async-done-1.3.2.tgz", - "integrity": "sha512-uYkTP8dw2og1tu1nmza1n1CMW0qb8gWWlwqMmLb7MhBVs4BXrFziT6HXUd+/RlRA/i4H9AkofYloUbs1fwMqlw==", - "dev": true, - "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.2", - "process-nextick-args": "^2.0.0", - "stream-exhaust": "^1.0.1" - } - }, - "async-each": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.3.tgz", - "integrity": "sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ==", - "dev": true - }, - "async-each-series": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/async-each-series/-/async-each-series-0.1.1.tgz", - "integrity": "sha512-p4jj6Fws4Iy2m0iCmI2am2ZNZCgbdgE+P8F/8csmn2vx7ixXrO2zGcuNsD46X5uZSVecmkEy/M06X2vG8KD6dQ==", - "dev": true - }, - "async-settle": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/async-settle/-/async-settle-1.0.0.tgz", - "integrity": "sha1-HQqRS7Aldb7IqPOnTlCA9yssDGs=", - "dev": true, - "requires": { - "async-done": "^1.2.2" - } - }, - "asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", - "peer": true - }, - "atob": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", - "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", - "dev": true - }, - "available-typed-arrays": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", - "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==", - "dev": true - }, - "aws-sign2": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA==", - "peer": true - }, - "aws4": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.11.0.tgz", - "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==", - "peer": true - }, - "axios": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", - "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", - "dev": true, - "requires": { - "follow-redirects": "^1.14.0" - } - }, - "bach": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/bach/-/bach-1.2.0.tgz", - "integrity": "sha1-Szzpa/JxNPeaG0FKUcFONMO9mIA=", - "dev": true, - "requires": { - "arr-filter": "^1.1.1", - "arr-flatten": "^1.0.1", - "arr-map": "^2.0.0", - "array-each": "^1.0.0", - "array-initial": "^1.0.0", - "array-last": "^1.1.1", - "async-done": "^1.2.2", - "async-settle": "^1.0.0", - "now-and-later": "^2.0.0" - } - }, - "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" - }, - "base": { - "version": "0.11.2", - "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", - "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", - "dev": true, - "requires": { - "cache-base": "^1.0.1", - "class-utils": "^0.3.5", - "component-emitter": "^1.2.1", - "define-property": "^1.0.0", - "isobject": "^3.0.1", - "mixin-deep": "^1.2.0", - "pascalcase": "^0.1.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } - } - }, - "base64-js": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.0.tgz", - "integrity": "sha512-ccav/yGvoa80BQDljCxsmmQ3Xvx60/UpBIij5QN21W3wBi/hhIC9OoO+KLpu9IJTS9j4DRVJ3aDDF9cMSoa2lw==", - "dev": true - }, - "base64id": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/base64id/-/base64id-2.0.0.tgz", - "integrity": "sha512-lGe34o6EHj9y3Kts9R4ZYs/Gr+6N7MCaMlIFA3F1R2O5/m7K06AxfSeO5530PEERE6/WyEg3lsuyw4GHlPZHog==", - "dev": true - }, - "batch": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/batch/-/batch-0.6.1.tgz", - "integrity": "sha1-3DQxT05nkxgJP8dgJyUl+UvyXBY=", - "dev": true - }, - "bcrypt-pbkdf": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", - "integrity": "sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w==", - "peer": true, - "requires": { - "tweetnacl": "^0.14.3" - } - }, - "benchmark": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/benchmark/-/benchmark-2.1.4.tgz", - "integrity": "sha1-CfPeMckWQl1JjMLuVloOvzwqVik=", - "dev": true, - "requires": { - "lodash": "^4.17.4", - "platform": "^1.3.3" - } - }, - "binary-extensions": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz", - "integrity": "sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==", - "dev": true - }, - "binaryextensions": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/binaryextensions/-/binaryextensions-2.1.2.tgz", - "integrity": "sha512-xVNN69YGDghOqCCtA6FI7avYrr02mTJjOgB0/f1VPD3pJC8QEvjTKWc4epDx8AqxxA75NI0QpVM2gPJXUbE4Tg==", - "dev": true - }, - "bindings": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", - "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", - "requires": { - "file-uri-to-path": "1.0.0" - } - }, - "bit-twiddle": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/bit-twiddle/-/bit-twiddle-1.0.2.tgz", - "integrity": "sha512-B9UhK0DKFZhoTFcfvAzhqsjStvGJp9vYWf3+6SNTtdSQnvIgfkHbgHrg/e4+TH71N2GDu8tpmCVoyfrL1d7ntA==" - }, - "bl": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/bl/-/bl-1.2.3.tgz", - "integrity": "sha512-pvcNpa0UU69UT341rO6AYy4FVAIkUHuZXRIWbq+zHnsVcRzDDjIAhGuuYoi0d//cwIwtt4pkpKycWEfjdV+vww==", - "dev": true, - "requires": { - "readable-stream": "^2.3.5", - "safe-buffer": "^5.1.1" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, - "bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", - "dev": true - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "braces": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", - "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", - "dev": true, - "requires": { - "arr-flatten": "^1.1.0", - "array-unique": "^0.3.2", - "extend-shallow": "^2.0.1", - "fill-range": "^4.0.0", - "isobject": "^3.0.1", - "repeat-element": "^1.1.2", - "snapdragon": "^0.8.1", - "snapdragon-node": "^2.0.1", - "split-string": "^3.0.2", - "to-regex": "^3.0.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "brorand": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", - "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=", - "dev": true - }, - "browser-pack": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/browser-pack/-/browser-pack-6.1.0.tgz", - "integrity": "sha512-erYug8XoqzU3IfcU8fUgyHqyOXqIE4tUTTQ+7mqUjQlvnXkOO6OlT9c/ZoJVHYoAaqGxr09CN53G7XIsO4KtWA==", - "dev": true, - "requires": { - "combine-source-map": "~0.8.0", - "defined": "^1.0.0", - "JSONStream": "^1.0.3", - "safe-buffer": "^5.1.1", - "through2": "^2.0.0", - "umd": "^3.0.0" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - }, - "through2": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", - "dev": true, - "requires": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" - } - } - } - }, - "browser-resolve": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/browser-resolve/-/browser-resolve-2.0.0.tgz", - "integrity": "sha512-7sWsQlYL2rGLy2IWm8WL8DCTJvYLc/qlOnsakDac87SOoCd16WLsaAMdCiAqsTNHIe+SXfaqyxyo6THoWqs8WQ==", - "dev": true, - "requires": { - "resolve": "^1.17.0" - } - }, - "browser-sync": { - "version": "2.27.10", - "resolved": "https://registry.npmjs.org/browser-sync/-/browser-sync-2.27.10.tgz", - "integrity": "sha512-xKm+6KJmJu6RuMWWbFkKwOCSqQOxYe3nOrFkKI5Tr/ZzjPxyU3pFShKK3tWnazBo/3lYQzN7fzjixG8fwJh1Xw==", - "dev": true, - "requires": { - "browser-sync-client": "^2.27.10", - "browser-sync-ui": "^2.27.10", - "bs-recipes": "1.3.4", - "bs-snippet-injector": "^2.0.1", - "chokidar": "^3.5.1", - "connect": "3.6.6", - "connect-history-api-fallback": "^1", - "dev-ip": "^1.0.1", - "easy-extender": "^2.3.4", - "eazy-logger": "3.1.0", - "etag": "^1.8.1", - "fresh": "^0.5.2", - "fs-extra": "3.0.1", - "http-proxy": "^1.18.1", - "immutable": "^3", - "localtunnel": "^2.0.1", - "micromatch": "^4.0.2", - "opn": "5.3.0", - "portscanner": "2.2.0", - "qs": "6.2.3", - "raw-body": "^2.3.2", - "resp-modifier": "6.0.2", - "rx": "4.1.0", - "send": "0.16.2", - "serve-index": "1.9.1", - "serve-static": "1.13.2", - "server-destroy": "1.0.1", - "socket.io": "^4.4.1", - "ua-parser-js": "1.0.2", - "yargs": "^17.3.1" - }, - "dependencies": { - "anymatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", - "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", - "dev": true, - "requires": { - "normalize-path": "^3.0.0", - "picomatch": "^2.0.4" - } - }, - "binary-extensions": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", - "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", - "dev": true - }, - "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, - "requires": { - "fill-range": "^7.0.1" - } - }, - "chokidar": { - "version": "3.5.3", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", - "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", - "dev": true, - "requires": { - "anymatch": "~3.1.2", - "braces": "~3.0.2", - "fsevents": "~2.3.2", - "glob-parent": "~5.1.2", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.6.0" - } - }, - "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, - "requires": { - "to-regex-range": "^5.0.1" - } - }, - "fsevents": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", - "dev": true, - "optional": true - }, - "glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, - "requires": { - "is-glob": "^4.0.1" - } - }, - "is-binary-path": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", - "dev": true, - "requires": { - "binary-extensions": "^2.0.0" - } - }, - "is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true - }, - "micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", - "dev": true, - "requires": { - "braces": "^3.0.2", - "picomatch": "^2.3.1" - } - }, - "qs": { - "version": "6.2.3", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.2.3.tgz", - "integrity": "sha1-HPyyXBCpsrSDBT/zn138kjOQjP4=", - "dev": true - }, - "readdirp": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", - "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", - "dev": true, - "requires": { - "picomatch": "^2.2.1" - } - }, - "to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "requires": { - "is-number": "^7.0.0" - } - } - } - }, - "browser-sync-client": { - "version": "2.27.10", - "resolved": "https://registry.npmjs.org/browser-sync-client/-/browser-sync-client-2.27.10.tgz", - "integrity": "sha512-KCFKA1YDj6cNul0VsA28apohtBsdk5Wv8T82ClOZPZMZWxPj4Ny5AUbrj9UlAb/k6pdxE5HABrWDhP9+cjt4HQ==", - "dev": true, - "requires": { - "etag": "1.8.1", - "fresh": "0.5.2", - "mitt": "^1.1.3", - "rxjs": "^5.5.6", - "typescript": "^4.6.2" - } - }, - "browser-sync-ui": { - "version": "2.27.10", - "resolved": "https://registry.npmjs.org/browser-sync-ui/-/browser-sync-ui-2.27.10.tgz", - "integrity": "sha512-elbJILq4Uo6OQv6gsvS3Y9vRAJlWu+h8j0JDkF0X/ua+3S6SVbbiWnZc8sNOFlG7yvVGIwBED3eaYQ0iBo1Dtw==", - "dev": true, - "requires": { - "async-each-series": "0.1.1", - "connect-history-api-fallback": "^1", - "immutable": "^3", - "server-destroy": "1.0.1", - "socket.io-client": "^4.4.1", - "stream-throttle": "^0.1.3" - } - }, - "browserify": { - "version": "17.0.0", - "resolved": "https://registry.npmjs.org/browserify/-/browserify-17.0.0.tgz", - "integrity": "sha512-SaHqzhku9v/j6XsQMRxPyBrSP3gnwmE27gLJYZgMT2GeK3J0+0toN+MnuNYDfHwVGQfLiMZ7KSNSIXHemy905w==", - "dev": true, - "requires": { - "assert": "^1.4.0", - "browser-pack": "^6.0.1", - "browser-resolve": "^2.0.0", - "browserify-zlib": "~0.2.0", - "buffer": "~5.2.1", - "cached-path-relative": "^1.0.0", - "concat-stream": "^1.6.0", - "console-browserify": "^1.1.0", - "constants-browserify": "~1.0.0", - "crypto-browserify": "^3.0.0", - "defined": "^1.0.0", - "deps-sort": "^2.0.1", - "domain-browser": "^1.2.0", - "duplexer2": "~0.1.2", - "events": "^3.0.0", - "glob": "^7.1.0", - "has": "^1.0.0", - "htmlescape": "^1.1.0", - "https-browserify": "^1.0.0", - "inherits": "~2.0.1", - "insert-module-globals": "^7.2.1", - "JSONStream": "^1.0.3", - "labeled-stream-splicer": "^2.0.0", - "mkdirp-classic": "^0.5.2", - "module-deps": "^6.2.3", - "os-browserify": "~0.3.0", - "parents": "^1.0.1", - "path-browserify": "^1.0.0", - "process": "~0.11.0", - "punycode": "^1.3.2", - "querystring-es3": "~0.2.0", - "read-only-stream": "^2.0.0", - "readable-stream": "^2.0.2", - "resolve": "^1.1.4", - "shasum-object": "^1.0.0", - "shell-quote": "^1.6.1", - "stream-browserify": "^3.0.0", - "stream-http": "^3.0.0", - "string_decoder": "^1.1.1", - "subarg": "^1.0.0", - "syntax-error": "^1.1.1", - "through2": "^2.0.0", - "timers-browserify": "^1.0.1", - "tty-browserify": "0.0.1", - "url": "~0.11.0", - "util": "~0.12.0", - "vm-browserify": "^1.0.0", - "xtend": "^4.0.0" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", - "dev": true - }, - "readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - }, - "dependencies": { - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, - "string_decoder": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.2.0.tgz", - "integrity": "sha512-6YqyX6ZWEYguAxgZzHGL7SsCeGx3V2TtOTqZz1xSTSWnqsbWwbptafNyvf/ACquZUXV3DANr5BDIwNYe1mN42w==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - }, - "through2": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", - "dev": true, - "requires": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" - } - } - } - }, - "browserify-aes": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", - "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", - "dev": true, - "requires": { - "buffer-xor": "^1.0.3", - "cipher-base": "^1.0.0", - "create-hash": "^1.1.0", - "evp_bytestokey": "^1.0.3", - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "browserify-cipher": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz", - "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==", - "dev": true, - "requires": { - "browserify-aes": "^1.0.4", - "browserify-des": "^1.0.0", - "evp_bytestokey": "^1.0.0" - } - }, - "browserify-des": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.2.tgz", - "integrity": "sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==", - "dev": true, - "requires": { - "cipher-base": "^1.0.1", - "des.js": "^1.0.0", - "inherits": "^2.0.1", - "safe-buffer": "^5.1.2" - } - }, - "browserify-rsa": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", - "integrity": "sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ=", - "dev": true, - "requires": { - "bn.js": "^4.1.0", - "randombytes": "^2.0.1" - } - }, - "browserify-sign": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.0.4.tgz", - "integrity": "sha1-qk62jl17ZYuqa/alfmMMvXqT0pg=", - "dev": true, - "requires": { - "bn.js": "^4.1.1", - "browserify-rsa": "^4.0.0", - "create-hash": "^1.1.0", - "create-hmac": "^1.1.2", - "elliptic": "^6.0.0", - "inherits": "^2.0.1", - "parse-asn1": "^5.0.0" - } - }, - "browserify-zlib": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz", - "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==", - "dev": true, - "requires": { - "pako": "~1.0.5" - } - }, - "bs-recipes": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/bs-recipes/-/bs-recipes-1.3.4.tgz", - "integrity": "sha1-DS1NSKcYyMBEdp/cT4lZLci2lYU=", - "dev": true - }, - "bs-snippet-injector": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/bs-snippet-injector/-/bs-snippet-injector-2.0.1.tgz", - "integrity": "sha1-YbU5PxH1JVntEgaTEANDtu2wTdU=", - "dev": true - }, - "buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.2.1.tgz", - "integrity": "sha512-c+Ko0loDaFfuPWiL02ls9Xd3GO3cPVmUobQ6t3rXNUk304u6hGq+8N/kFi+QEIKhzK3uwolVhLzszmfLmMLnqg==", - "dev": true, - "requires": { - "base64-js": "^1.0.2", - "ieee754": "^1.1.4" - } - }, - "buffer-equal": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/buffer-equal/-/buffer-equal-1.0.0.tgz", - "integrity": "sha1-WWFrSYME1Var1GaWayLu2j7KX74=", - "dev": true - }, - "buffer-from": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", - "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", - "dev": true - }, - "buffer-xor": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", - "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=", - "dev": true - }, - "builtin-status-codes": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", - "integrity": "sha512-HpGFw18DgFWlncDfjTa2rcQ4W88O1mC8e8yZ2AvQY5KDaktSTwo+KRf6nHK6FRI5FyRyb/5T6+TSxfP7QyGsmQ==", - "dev": true - }, - "bytes": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz", - "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==", - "dev": true - }, - "c8": { - "version": "7.12.0", - "resolved": "https://registry.npmjs.org/c8/-/c8-7.12.0.tgz", - "integrity": "sha512-CtgQrHOkyxr5koX1wEUmN/5cfDa2ckbHRA4Gy5LAL0zaCFtVWJS5++n+w4/sr2GWGerBxgTjpKeDclk/Qk6W/A==", - "dev": true, - "requires": { - "@bcoe/v8-coverage": "^0.2.3", - "@istanbuljs/schema": "^0.1.3", - "find-up": "^5.0.0", - "foreground-child": "^2.0.0", - "istanbul-lib-coverage": "^3.2.0", - "istanbul-lib-report": "^3.0.0", - "istanbul-reports": "^3.1.4", - "rimraf": "^3.0.2", - "test-exclude": "^6.0.0", - "v8-to-istanbul": "^9.0.0", - "yargs": "^16.2.0", - "yargs-parser": "^20.2.9" - }, - "dependencies": { - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true - }, - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "cliui": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", - "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", - "dev": true, - "requires": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^7.0.0" - } - }, - "find-up": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", - "dev": true, - "requires": { - "locate-path": "^6.0.0", - "path-exists": "^4.0.0" - } - }, - "get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true - }, - "path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true - }, - "string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - } - }, - "strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.1" - } - }, - "wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, - "requires": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - } - }, - "y18n": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", - "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", - "dev": true - }, - "yargs": { - "version": "16.2.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", - "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", - "dev": true, - "requires": { - "cliui": "^7.0.2", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.0", - "y18n": "^5.0.5", - "yargs-parser": "^20.2.2" - } - } - } - }, - "cacache": { - "version": "16.1.1", - "resolved": "https://registry.npmjs.org/cacache/-/cacache-16.1.1.tgz", - "integrity": "sha512-VDKN+LHyCQXaaYZ7rA/qtkURU+/yYhviUdvqEv2LT6QPZU8jpyzEkEVAcKlKLt5dJ5BRp11ym8lo3NKLluEPLg==", - "requires": { - "@npmcli/fs": "^2.1.0", - "@npmcli/move-file": "^2.0.0", - "chownr": "^2.0.0", - "fs-minipass": "^2.1.0", - "glob": "^8.0.1", - "infer-owner": "^1.0.4", - "lru-cache": "^7.7.1", - "minipass": "^3.1.6", - "minipass-collect": "^1.0.2", - "minipass-flush": "^1.0.5", - "minipass-pipeline": "^1.2.4", - "mkdirp": "^1.0.4", - "p-map": "^4.0.0", - "promise-inflight": "^1.0.1", - "rimraf": "^3.0.2", - "ssri": "^9.0.0", - "tar": "^6.1.11", - "unique-filename": "^1.1.1" - }, - "dependencies": { - "brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "requires": { - "balanced-match": "^1.0.0" - } - }, - "glob": { - "version": "8.0.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-8.0.3.tgz", - "integrity": "sha512-ull455NHSHI/Y1FqGaaYFaLGkNMMJbavMrEGFXG/PGrg6y7sutWHUHrz6gy6WEBH6akM1M414dWKCNs+IhKdiQ==", - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^5.0.1", - "once": "^1.3.0" - } - }, - "lru-cache": { - "version": "7.12.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.12.0.tgz", - "integrity": "sha512-OIP3DwzRZDfLg9B9VP/huWBlpvbkmbfiBy8xmsXp4RPmE4A3MhwNozc5ZJ3fWnSg8fDcdlE/neRTPG2ycEKliw==" - }, - "minimatch": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.0.tgz", - "integrity": "sha512-9TPBGGak4nHfGZsPBohm9AWg6NoT7QTCehS3BIJABslyZbzxfV78QM2Y6+i741OPZIafFAaiiEMh5OyIrJPgtg==", - "requires": { - "brace-expansion": "^2.0.1" - } - }, - "mkdirp": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", - "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==" - } - } - }, - "cache-base": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", - "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", - "dev": true, - "requires": { - "collection-visit": "^1.0.0", - "component-emitter": "^1.2.1", - "get-value": "^2.0.6", - "has-value": "^1.0.0", - "isobject": "^3.0.1", - "set-value": "^2.0.0", - "to-object-path": "^0.3.0", - "union-value": "^1.0.0", - "unset-value": "^1.0.0" - } - }, - "cached-path-relative": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/cached-path-relative/-/cached-path-relative-1.1.0.tgz", - "integrity": "sha512-WF0LihfemtesFcJgO7xfOoOcnWzY/QHR4qeDqV44jPU3HTI54+LnfXK3SA27AVVGCdZFgjjFFaqUA9Jx7dMJZA==", - "dev": true - }, - "call-bind": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", - "dev": true, - "requires": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" - } - }, - "camelcase": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", - "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=", - "dev": true - }, - "caseless": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==", - "peer": true - }, - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "dev": true, - "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - } - }, - "chokidar": { - "version": "2.1.8", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.8.tgz", - "integrity": "sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg==", - "dev": true, - "requires": { - "anymatch": "^2.0.0", - "async-each": "^1.0.1", - "braces": "^2.3.2", - "fsevents": "^1.2.7", - "glob-parent": "^3.1.0", - "inherits": "^2.0.3", - "is-binary-path": "^1.0.0", - "is-glob": "^4.0.0", - "normalize-path": "^3.0.0", - "path-is-absolute": "^1.0.0", - "readdirp": "^2.2.1", - "upath": "^1.1.1" - } - }, - "chownr": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", - "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==" - }, - "cipher-base": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", - "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "class-utils": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", - "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", - "dev": true, - "requires": { - "arr-union": "^3.1.0", - "define-property": "^0.2.5", - "isobject": "^3.0.0", - "static-extend": "^0.1.1" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - } - } - }, - "clean-stack": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", - "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==" - }, - "cliui": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", - "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", - "dev": true, - "requires": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wrap-ansi": "^2.0.0" - } - }, - "clone": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz", - "integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18=", - "dev": true - }, - "clone-buffer": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/clone-buffer/-/clone-buffer-1.0.0.tgz", - "integrity": "sha1-4+JbIHrE5wGvch4staFnksrD3Fg=", - "dev": true - }, - "clone-stats": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/clone-stats/-/clone-stats-1.0.0.tgz", - "integrity": "sha1-s3gt/4u1R04Yuba/D9/ngvh3doA=", - "dev": true - }, - "cloneable-readable": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/cloneable-readable/-/cloneable-readable-1.1.3.tgz", - "integrity": "sha512-2EF8zTQOxYq70Y4XKtorQupqF0m49MBz2/yf5Bj+MHjvpG3Hy7sImifnqD6UA+TKYxeSV+u6qqQPawN5UvnpKQ==", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "process-nextick-args": "^2.0.0", - "readable-stream": "^2.3.5" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, - "code-point-at": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" - }, - "collection-map": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/collection-map/-/collection-map-1.0.0.tgz", - "integrity": "sha1-rqDwb40mx4DCt1SUOFVEsiVa8Yw=", - "dev": true, - "requires": { - "arr-map": "^2.0.2", - "for-own": "^1.0.0", - "make-iterator": "^1.0.0" - } - }, - "collection-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", - "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", - "dev": true, - "requires": { - "map-visit": "^1.0.0", - "object-visit": "^1.0.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "color-support": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", - "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==" - }, - "combine-source-map": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/combine-source-map/-/combine-source-map-0.8.0.tgz", - "integrity": "sha1-pY0N8ELBhvz4IqjoAV9UUNLXmos=", - "dev": true, - "requires": { - "convert-source-map": "~1.1.0", - "inline-source-map": "~0.6.0", - "lodash.memoize": "~3.0.3", - "source-map": "~0.5.3" - } - }, - "combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "peer": true, - "requires": { - "delayed-stream": "~1.0.0" - } - }, - "commander": { - "version": "2.20.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz", - "integrity": "sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==", - "dev": true - }, - "component-emitter": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", - "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=", - "dev": true - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" - }, - "concat-stream": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", - "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", - "dev": true, - "requires": { - "buffer-from": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^2.2.2", - "typedarray": "^0.0.6" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, - "concat-with-sourcemaps": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/concat-with-sourcemaps/-/concat-with-sourcemaps-1.1.0.tgz", - "integrity": "sha512-4gEjHJFT9e+2W/77h/DS5SGUgwDaOwprX8L/gl5+3ixnzkVJJsZWDSelmN3Oilw3LNDZjZV0yqH1hLG3k6nghg==", - "dev": true, - "requires": { - "source-map": "^0.6.1" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } - } - }, - "config-chain": { - "version": "1.1.12", - "resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.12.tgz", - "integrity": "sha512-a1eOIcu8+7lUInge4Rpf/n4Krkf3Dd9lqhljRzII1/Zno/kRtUWnznPO3jOKBmTEktkt3fkxisUcivoj0ebzoA==", - "dev": true, - "requires": { - "ini": "^1.3.4", - "proto-list": "~1.2.1" - } - }, - "connect": { - "version": "3.6.6", - "resolved": "https://registry.npmjs.org/connect/-/connect-3.6.6.tgz", - "integrity": "sha1-Ce/2xVr3I24TcTWnJXSFi2eG9SQ=", - "dev": true, - "requires": { - "debug": "2.6.9", - "finalhandler": "1.1.0", - "parseurl": "~1.3.2", - "utils-merge": "1.0.1" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - } - } - }, - "connect-history-api-fallback": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/connect-history-api-fallback/-/connect-history-api-fallback-1.6.0.tgz", - "integrity": "sha512-e54B99q/OUoH64zYYRf3HBP5z24G38h5D3qXu23JGRoigpX5Ss4r9ZnDk3g0Z8uQC2x2lPaJ+UlWBc1ZWBWdLg==", - "dev": true - }, - "console-browserify": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.1.0.tgz", - "integrity": "sha1-8CQcRXMKn8YyOyBtvzjtx0HQuxA=", - "dev": true, - "requires": { - "date-now": "^0.1.4" - } - }, - "console-control-strings": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", - "integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==" - }, - "constants-browserify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz", - "integrity": "sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U=", - "dev": true - }, - "convert-source-map": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.1.3.tgz", - "integrity": "sha1-SCnId+n+SbMWHzvzZziI4gRpmGA=", - "dev": true - }, - "cookie": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.2.tgz", - "integrity": "sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==", - "dev": true - }, - "copy-descriptor": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", - "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", - "dev": true - }, - "copy-props": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/copy-props/-/copy-props-2.0.5.tgz", - "integrity": "sha512-XBlx8HSqrT0ObQwmSzM7WE5k8FxTV75h1DX1Z3n6NhQ/UYYAvInWYmG06vFt7hQZArE2fuO62aihiWIVQwh1sw==", - "dev": true, - "requires": { - "each-props": "^1.3.2", - "is-plain-object": "^5.0.0" - }, - "dependencies": { - "is-plain-object": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", - "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==", - "dev": true - } - } - }, - "core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" - }, - "cors": { - "version": "2.8.5", - "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", - "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", - "dev": true, - "requires": { - "object-assign": "^4", - "vary": "^1" - } - }, - "create-ecdh": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.3.tgz", - "integrity": "sha512-GbEHQPMOswGpKXM9kCWVrremUcBmjteUaQ01T9rkKCPDXfUHX0IoP9LpHYo2NPFampa4e+/pFDc3jQdxrxQLaw==", - "dev": true, - "requires": { - "bn.js": "^4.1.0", - "elliptic": "^6.0.0" - } - }, - "create-hash": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", - "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", - "dev": true, - "requires": { - "cipher-base": "^1.0.1", - "inherits": "^2.0.1", - "md5.js": "^1.3.4", - "ripemd160": "^2.0.1", - "sha.js": "^2.4.0" - } - }, - "create-hmac": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", - "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", - "dev": true, - "requires": { - "cipher-base": "^1.0.3", - "create-hash": "^1.1.0", - "inherits": "^2.0.1", - "ripemd160": "^2.0.0", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" - } - }, - "cross-spawn": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.1.tgz", - "integrity": "sha512-u7v4o84SwFpD32Z8IIcPZ6z1/ie24O6RU3RbtL5Y316l3KuHVPx9ItBgWQ6VlfAFnRnTtMUrsQ9MUUTuEZjogg==", - "dev": true, - "requires": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - }, - "dependencies": { - "which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "requires": { - "isexe": "^2.0.0" - } - } - } - }, - "crypto-browserify": { - "version": "3.12.0", - "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", - "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", - "dev": true, - "requires": { - "browserify-cipher": "^1.0.0", - "browserify-sign": "^4.0.0", - "create-ecdh": "^4.0.0", - "create-hash": "^1.1.0", - "create-hmac": "^1.1.0", - "diffie-hellman": "^5.0.0", - "inherits": "^2.0.1", - "pbkdf2": "^3.0.3", - "public-encrypt": "^4.0.0", - "randombytes": "^2.0.0", - "randomfill": "^1.0.3" - } - }, - "d": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz", - "integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==", - "dev": true, - "requires": { - "es5-ext": "^0.10.50", - "type": "^1.0.1" - } - }, - "dash-ast": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/dash-ast/-/dash-ast-1.0.0.tgz", - "integrity": "sha512-Vy4dx7gquTeMcQR/hDkYLGUnwVil6vk4FOOct+djUnHOUWt+zJPJAaRIXaAFkPXtJjvlY7o3rfRu0/3hpnwoUA==", - "dev": true - }, - "dashdash": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g==", - "peer": true, - "requires": { - "assert-plus": "^1.0.0" - } - }, - "date-now": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz", - "integrity": "sha1-6vQ5/U1ISK105cx9vvIAZyueNFs=", - "dev": true - }, - "debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", - "dev": true, - "requires": { - "ms": "2.1.2" - }, - "dependencies": { - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - } - } - }, - "decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", - "dev": true - }, - "decode-uri-component": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", - "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", - "dev": true - }, - "decomment": { - "version": "0.9.2", - "resolved": "https://registry.npmjs.org/decomment/-/decomment-0.9.2.tgz", - "integrity": "sha512-sblyUmOJZxiL7oJ2ogJS6jtl/67+CTOW87SrYE/96u3PhDYikYoLCdLzcnceToiQejOLlqNnLCkaxx/+nE/ehg==", - "dev": true, - "requires": { - "esprima": "4.0.1" - } - }, - "decompress-response": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", - "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", - "requires": { - "mimic-response": "^3.1.0" - } - }, - "deep-extend": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", - "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==" - }, - "default-compare": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/default-compare/-/default-compare-1.0.0.tgz", - "integrity": "sha512-QWfXlM0EkAbqOCbD/6HjdwT19j7WCkMyiRhWilc4H9/5h/RzTF9gv5LYh1+CmDV5d1rki6KAWLtQale0xt20eQ==", - "dev": true, - "requires": { - "kind-of": "^5.0.2" - }, - "dependencies": { - "kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "dev": true - } - } - }, - "default-resolution": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/default-resolution/-/default-resolution-2.0.0.tgz", - "integrity": "sha1-vLgrqnKtebQmp2cy8aga1t8m1oQ=", - "dev": true - }, - "define-properties": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", - "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", - "dev": true, - "requires": { - "object-keys": "^1.0.12" - } - }, - "define-property": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", - "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", - "dev": true, - "requires": { - "is-descriptor": "^1.0.2", - "isobject": "^3.0.1" - }, - "dependencies": { - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } - } - }, - "defined": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz", - "integrity": "sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM=", - "dev": true - }, - "delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", - "peer": true - }, - "delegates": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", - "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==" - }, - "depd": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", - "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" - }, - "deps-sort": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/deps-sort/-/deps-sort-2.0.1.tgz", - "integrity": "sha512-1orqXQr5po+3KI6kQb9A4jnXT1PBwggGl2d7Sq2xsnOeI9GPcE/tGcF9UiSZtZBM7MukY4cAh7MemS6tZYipfw==", - "dev": true, - "requires": { - "JSONStream": "^1.0.3", - "shasum-object": "^1.0.0", - "subarg": "^1.0.0", - "through2": "^2.0.0" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", - "dev": true - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - }, - "through2": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", - "dev": true, - "requires": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" - } - } - } - }, - "des.js": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.0.tgz", - "integrity": "sha1-wHTS4qpqipoH29YfmhXCzYPsjsw=", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0" - } - }, - "destroy": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", - "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=", - "dev": true - }, - "detect-file": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz", - "integrity": "sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc=", - "dev": true - }, - "detect-libc": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.1.tgz", - "integrity": "sha512-463v3ZeIrcWtdgIg6vI6XUncguvr2TnGl4SzDXinkt9mSLpBJKXT3mW6xT3VQdDN11+WVs29pgvivTc4Lp8v+w==" - }, - "detective": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/detective/-/detective-5.2.1.tgz", - "integrity": "sha512-v9XE1zRnz1wRtgurGu0Bs8uHKFSTdteYZNbIPFVhUZ39L/S79ppMpdmVOZAnoz1jfEFodc48n6MX483Xo3t1yw==", - "dev": true, - "requires": { - "acorn-node": "^1.8.2", - "defined": "^1.0.0", - "minimist": "^1.2.6" - } - }, - "dev-ip": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/dev-ip/-/dev-ip-1.0.1.tgz", - "integrity": "sha1-p2o+0YVb56ASu4rBbLgPPADcKPA=", - "dev": true - }, - "diff": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", - "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", - "dev": true - }, - "diffie-hellman": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", - "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", - "dev": true, - "requires": { - "bn.js": "^4.1.0", - "miller-rabin": "^4.0.0", - "randombytes": "^2.0.0" - } - }, - "dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", - "dev": true, - "requires": { - "path-type": "^4.0.0" - }, - "dependencies": { - "path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "dev": true - } - } - }, - "dlv": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/dlv/-/dlv-1.1.3.tgz", - "integrity": "sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==", - "dev": true - }, - "domain-browser": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz", - "integrity": "sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA==", - "dev": true - }, - "duplexer2": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz", - "integrity": "sha512-asLFVfWWtJ90ZyOUHMqk7/S2w2guQKxUI2itj3d92ADHhxUSbCMGi1f1cBcJ7xM1To+pE/Khbwo1yuNbMEPKeA==", - "dev": true, - "requires": { - "readable-stream": "^2.0.2" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", - "dev": true - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, - "duplexify": { - "version": "3.7.1", - "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz", - "integrity": "sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g==", - "dev": true, - "requires": { - "end-of-stream": "^1.0.0", - "inherits": "^2.0.1", - "readable-stream": "^2.0.0", - "stream-shift": "^1.0.0" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, - "each-props": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/each-props/-/each-props-1.3.2.tgz", - "integrity": "sha512-vV0Hem3zAGkJAyU7JSjixeU66rwdynTAa1vofCrSA5fEln+m67Az9CcnkVD776/fsN/UjIWmBDoNRS6t6G9RfA==", - "dev": true, - "requires": { - "is-plain-object": "^2.0.1", - "object.defaults": "^1.1.0" - } - }, - "easy-extender": { - "version": "2.3.4", - "resolved": "https://registry.npmjs.org/easy-extender/-/easy-extender-2.3.4.tgz", - "integrity": "sha512-8cAwm6md1YTiPpOvDULYJL4ZS6WfM5/cTeVVh4JsvyYZAoqlRVUpHL9Gr5Fy7HA6xcSZicUia3DeAgO3Us8E+Q==", - "dev": true, - "requires": { - "lodash": "^4.17.10" - } - }, - "eazy-logger": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/eazy-logger/-/eazy-logger-3.1.0.tgz", - "integrity": "sha512-/snsn2JqBtUSSstEl4R0RKjkisGHAhvYj89i7r3ytNUKW12y178KDZwXLXIgwDqLW6E/VRMT9qfld7wvFae8bQ==", - "dev": true, - "requires": { - "tfunk": "^4.0.0" - } - }, - "ecc-jsbn": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", - "integrity": "sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw==", - "peer": true, - "requires": { - "jsbn": "~0.1.0", - "safer-buffer": "^2.1.0" - } - }, - "editions": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/editions/-/editions-1.3.4.tgz", - "integrity": "sha512-gzao+mxnYDzIysXKMQi/+M1mjy/rjestjg6OPoYTtI+3Izp23oiGZitsl9lPDPiTGXbcSIk1iJWhliSaglxnUg==", - "dev": true - }, - "editorconfig": { - "version": "0.15.3", - "resolved": "https://registry.npmjs.org/editorconfig/-/editorconfig-0.15.3.tgz", - "integrity": "sha512-M9wIMFx96vq0R4F+gRpY3o2exzb8hEj/n9S8unZtHSvYjibBp/iMufSzvmOcV/laG0ZtuTVGtiJggPOSW2r93g==", - "dev": true, - "requires": { - "commander": "^2.19.0", - "lru-cache": "^4.1.5", - "semver": "^5.6.0", - "sigmund": "^1.0.1" - }, - "dependencies": { - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - } - } - }, - "ee-first": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", - "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=", - "dev": true - }, - "elliptic": { - "version": "6.5.4", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", - "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", - "dev": true, - "requires": { - "bn.js": "^4.11.9", - "brorand": "^1.1.0", - "hash.js": "^1.0.0", - "hmac-drbg": "^1.0.1", - "inherits": "^2.0.4", - "minimalistic-assert": "^1.0.1", - "minimalistic-crypto-utils": "^1.0.1" - } - }, - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" - }, - "encodeurl": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=", - "dev": true - }, - "encoding": { - "version": "0.1.13", - "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz", - "integrity": "sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==", - "optional": true, - "requires": { - "iconv-lite": "^0.6.2" - }, - "dependencies": { - "iconv-lite": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", - "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", - "optional": true, - "requires": { - "safer-buffer": ">= 2.1.2 < 3.0.0" - } - } - } - }, - "end-of-stream": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", - "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", - "requires": { - "once": "^1.4.0" - } - }, - "engine.io": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-6.2.0.tgz", - "integrity": "sha512-4KzwW3F3bk+KlzSOY57fj/Jx6LyRQ1nbcyIadehl+AnXjKT7gDO0ORdRi/84ixvMKTym6ZKuxvbzN62HDDU1Lg==", - "dev": true, - "requires": { - "@types/cookie": "^0.4.1", - "@types/cors": "^2.8.12", - "@types/node": ">=10.0.0", - "accepts": "~1.3.4", - "base64id": "2.0.0", - "cookie": "~0.4.1", - "cors": "~2.8.5", - "debug": "~4.3.1", - "engine.io-parser": "~5.0.3", - "ws": "~8.2.3" - } - }, - "engine.io-client": { - "version": "6.2.3", - "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-6.2.3.tgz", - "integrity": "sha512-aXPtgF1JS3RuuKcpSrBtimSjYvrbhKW9froICH4s0F3XQWLxsKNxqzG39nnvQZQnva4CMvUK63T7shevxRyYHw==", - "dev": true, - "requires": { - "@socket.io/component-emitter": "~3.1.0", - "debug": "~4.3.1", - "engine.io-parser": "~5.0.3", - "ws": "~8.2.3", - "xmlhttprequest-ssl": "~2.0.0" - } - }, - "engine.io-parser": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.0.4.tgz", - "integrity": "sha512-+nVFp+5z1E3HcToEnO7ZIj3g+3k9389DvWtvJZz0T6/eOCPIyyxehFcedoYrZQrp0LgQbD9pPXhpMBKMd5QURg==", - "dev": true - }, - "env-paths": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", - "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==" - }, - "err-code": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/err-code/-/err-code-2.0.3.tgz", - "integrity": "sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==" - }, - "error-ex": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", - "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", - "dev": true, - "requires": { - "is-arrayish": "^0.2.1" - } - }, - "es5-ext": { - "version": "0.10.50", - "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.50.tgz", - "integrity": "sha512-KMzZTPBkeQV/JcSQhI5/z6d9VWJ3EnQ194USTUwIYZ2ZbpN8+SGXQKt1h68EX44+qt+Fzr8DO17vnxrw7c3agw==", - "dev": true, - "requires": { - "es6-iterator": "~2.0.3", - "es6-symbol": "~3.1.1", - "next-tick": "^1.0.0" - } - }, - "es6-iterator": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", - "integrity": "sha1-p96IkUGgWpSwhUQDstCg+/qY87c=", - "dev": true, - "requires": { - "d": "1", - "es5-ext": "^0.10.35", - "es6-symbol": "^3.1.1" - } - }, - "es6-symbol": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.1.tgz", - "integrity": "sha1-vwDvT9q2uhtG7Le2KbTH7VcVzHc=", - "dev": true, - "requires": { - "d": "1", - "es5-ext": "~0.10.14" - } - }, - "es6-weak-map": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.3.tgz", - "integrity": "sha512-p5um32HOTO1kP+w7PRnB+5lQ43Z6muuMuIMffvDN8ZB4GcnjLBV6zGStpbASIMk4DCAvEaamhe2zhyCb/QXXsA==", - "dev": true, - "requires": { - "d": "1", - "es5-ext": "^0.10.46", - "es6-iterator": "^2.0.3", - "es6-symbol": "^3.1.1" - } - }, - "escalade": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", - "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", - "dev": true - }, - "escape-html": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", - "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=", - "dev": true - }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true - }, - "esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true - }, - "etag": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", - "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=", - "dev": true - }, - "eventemitter3": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", - "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==", - "dev": true - }, - "events": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", - "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", - "dev": true - }, - "evp_bytestokey": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", - "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", - "dev": true, - "requires": { - "md5.js": "^1.3.4", - "safe-buffer": "^5.1.1" - } - }, - "expand-brackets": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", - "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", - "dev": true, - "requires": { - "debug": "^2.3.3", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "posix-character-classes": "^0.1.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "expand-template": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz", - "integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==" - }, - "expand-tilde": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz", - "integrity": "sha1-l+gBqgUt8CRU3kawK/YhZCzchQI=", - "dev": true, - "requires": { - "homedir-polyfill": "^1.0.1" - } - }, - "extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" - }, - "extend-shallow": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", - "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", - "dev": true, - "requires": { - "assign-symbols": "^1.0.0", - "is-extendable": "^1.0.1" - }, - "dependencies": { - "is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "dev": true, - "requires": { - "is-plain-object": "^2.0.4" - } - } - } - }, - "extglob": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", - "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", - "dev": true, - "requires": { - "array-unique": "^0.3.2", - "define-property": "^1.0.0", - "expand-brackets": "^2.1.4", - "extend-shallow": "^2.0.1", - "fragment-cache": "^0.2.1", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } - } - }, - "extsprintf": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g==", - "peer": true - }, - "fancy-log": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/fancy-log/-/fancy-log-1.3.3.tgz", - "integrity": "sha512-k9oEhlyc0FrVh25qYuSELjr8oxsCoc4/LEZfg2iJJrfEk/tZL9bCoJE47gqAvI2m/AUjluCS4+3I0eTx8n3AEw==", - "dev": true, - "requires": { - "ansi-gray": "^0.1.1", - "color-support": "^1.1.3", - "parse-node-version": "^1.0.0", - "time-stamp": "^1.0.0" - } - }, - "fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "peer": true - }, - "fast-glob": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.0.4.tgz", - "integrity": "sha512-wkIbV6qg37xTJwqSsdnIphL1e+LaGz4AIQqr00mIubMaEhv1/HEmJ0uuCGZRNRUkZZmOB5mJKO0ZUTVq+SxMQg==", - "dev": true, - "requires": { - "@nodelib/fs.stat": "^2.0.1", - "@nodelib/fs.walk": "^1.2.1", - "glob-parent": "^5.0.0", - "is-glob": "^4.0.1", - "merge2": "^1.2.3", - "micromatch": "^4.0.2" - }, - "dependencies": { - "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, - "requires": { - "fill-range": "^7.0.1" - } - }, - "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, - "requires": { - "to-regex-range": "^5.0.1" - } - }, - "glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, - "requires": { - "is-glob": "^4.0.1" - } - }, - "is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true - }, - "micromatch": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz", - "integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==", - "dev": true, - "requires": { - "braces": "^3.0.1", - "picomatch": "^2.0.5" - } - }, - "to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "requires": { - "is-number": "^7.0.0" - } - } - } - }, - "fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "peer": true - }, - "fast-safe-stringify": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz", - "integrity": "sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==", - "dev": true - }, - "fastq": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.6.0.tgz", - "integrity": "sha512-jmxqQ3Z/nXoeyDmWAzF9kH1aGZSis6e/SbfPmJpUnyZ0ogr6iscHQaml4wsEepEWSdtmpy+eVXmCRIMpxaXqOA==", - "dev": true, - "requires": { - "reusify": "^1.0.0" - } - }, - "file-uri-to-path": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", - "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==" - }, - "fill-range": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", - "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", - "dev": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-number": "^3.0.0", - "repeat-string": "^1.6.1", - "to-regex-range": "^2.1.0" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "finalhandler": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.0.tgz", - "integrity": "sha1-zgtoVbRYU+eRsvzGgARtiCU91/U=", - "dev": true, - "requires": { - "debug": "2.6.9", - "encodeurl": "~1.0.1", - "escape-html": "~1.0.3", - "on-finished": "~2.3.0", - "parseurl": "~1.3.2", - "statuses": "~1.3.1", - "unpipe": "~1.0.0" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - } - } - }, - "find-up": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", - "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", - "dev": true, - "requires": { - "path-exists": "^2.0.0", - "pinkie-promise": "^2.0.0" - } - }, - "findup-sync": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-3.0.0.tgz", - "integrity": "sha512-YbffarhcicEhOrm4CtrwdKBdCuz576RLdhJDsIfvNtxUuhdRet1qZcsMjqbePtAseKdAnDyM/IyXbu7PRPRLYg==", - "dev": true, - "requires": { - "detect-file": "^1.0.0", - "is-glob": "^4.0.0", - "micromatch": "^3.0.4", - "resolve-dir": "^1.0.1" - } - }, - "fined": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/fined/-/fined-1.2.0.tgz", - "integrity": "sha512-ZYDqPLGxDkDhDZBjZBb+oD1+j0rA4E0pXY50eplAAOPg2N/gUBSSk5IM1/QhPfyVo19lJ+CvXpqfvk+b2p/8Ng==", - "dev": true, - "requires": { - "expand-tilde": "^2.0.2", - "is-plain-object": "^2.0.3", - "object.defaults": "^1.1.0", - "object.pick": "^1.2.0", - "parse-filepath": "^1.0.1" - } - }, - "flagged-respawn": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/flagged-respawn/-/flagged-respawn-1.0.1.tgz", - "integrity": "sha512-lNaHNVymajmk0OJMBn8fVUAU1BtDeKIqKoVhk4xAALB57aALg6b4W0MfJ/cUE0g9YBXy5XhSlPIpYIJ7HaY/3Q==", - "dev": true - }, - "flush-write-stream": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.1.1.tgz", - "integrity": "sha512-3Z4XhFZ3992uIq0XOqb9AreonueSYphE6oYbpt5+3u06JWklbsPkNv3ZKkP9Bz/r+1MWCaMoSQ28P85+1Yc77w==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "readable-stream": "^2.3.6" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, - "follow-redirects": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", - "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==", - "dev": true - }, - "for-each": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", - "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", - "dev": true, - "requires": { - "is-callable": "^1.1.3" - } - }, - "for-in": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", - "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", - "dev": true - }, - "for-own": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/for-own/-/for-own-1.0.0.tgz", - "integrity": "sha1-xjMy9BXO3EsE2/5wz4NklMU8tEs=", - "dev": true, - "requires": { - "for-in": "^1.0.1" - } - }, - "foreground-child": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz", - "integrity": "sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==", - "dev": true, - "requires": { - "cross-spawn": "^7.0.0", - "signal-exit": "^3.0.2" - } - }, - "forever-agent": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw==", - "peer": true - }, - "form-data": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", - "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", - "peer": true, - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", - "mime-types": "^2.1.12" - } - }, - "fragment-cache": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", - "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", - "dev": true, - "requires": { - "map-cache": "^0.2.2" - } - }, - "fresh": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", - "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=", - "dev": true - }, - "fs-constants": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", - "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==" - }, - "fs-extra": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-3.0.1.tgz", - "integrity": "sha1-N5TzeMWLNC6n27sjCVEJxLO2IpE=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "jsonfile": "^3.0.0", - "universalify": "^0.1.0" - } - }, - "fs-minipass": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", - "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", - "requires": { - "minipass": "^3.0.0" - } - }, - "fs-mkdirp-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs-mkdirp-stream/-/fs-mkdirp-stream-1.0.0.tgz", - "integrity": "sha1-C3gV/DIBxqaeFNuYzgmMFpNSWes=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.11", - "through2": "^2.0.3" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - }, - "through2": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", - "dev": true, - "requires": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" - } - } - } - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" - }, - "fsevents": { - "version": "1.2.12", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.12.tgz", - "integrity": "sha512-Ggd/Ktt7E7I8pxZRbGIs7vwqAPscSESMrCSkx2FtWeqmheJgCo2R74fTsZFCifr0VTPwqRpPv17+6b8Zp7th0Q==", - "dev": true, - "optional": true, - "requires": { - "bindings": "^1.5.0", - "nan": "^2.12.1", - "node-pre-gyp": "*" - }, - "dependencies": { - "abbrev": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", - "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", - "bundled": true, - "dev": true, - "optional": true - }, - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", - "bundled": true, - "dev": true, - "optional": true - }, - "aproba": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", - "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", - "bundled": true, - "dev": true, - "optional": true - }, - "are-we-there-yet": { - "version": "1.1.5", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "delegates": "^1.0.0", - "readable-stream": "^2.0.6" - } - }, - "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "bundled": true, - "dev": true, - "optional": true - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "chownr": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", - "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", - "bundled": true, - "dev": true, - "optional": true - }, - "code-point-at": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", - "bundled": true, - "dev": true, - "optional": true - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "bundled": true, - "dev": true, - "optional": true - }, - "console-control-strings": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", - "integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==", - "bundled": true, - "dev": true, - "optional": true - }, - "core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", - "bundled": true, - "dev": true, - "optional": true - }, - "debug": { - "version": "3.2.6", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "ms": "^2.1.1" - } - }, - "deep-extend": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", - "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", - "bundled": true, - "dev": true, - "optional": true - }, - "delegates": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", - "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==", - "bundled": true, - "dev": true, - "optional": true - }, - "detect-libc": { - "version": "1.0.3", - "bundled": true, - "dev": true, - "optional": true - }, - "fs-minipass": { - "version": "1.2.7", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minipass": "^2.6.0" - } - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "bundled": true, - "dev": true, - "optional": true - }, - "gauge": { - "version": "2.7.4", - "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", - "integrity": "sha512-14x4kjc6lkD3ltw589k0NrPD6cCNTD6CWoVUNpB85+DrtONoZn+Rug6xZU5RvSC4+TZPxA5AnBibQYAvZn41Hg==", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "aproba": "^1.0.3", - "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.0", - "object-assign": "^4.1.0", - "signal-exit": "^3.0.0", - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wide-align": "^1.1.0" - } - }, - "glob": { - "version": "7.1.6", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "has-unicode": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", - "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==", - "bundled": true, - "dev": true, - "optional": true - }, - "iconv-lite": { - "version": "0.4.24", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "safer-buffer": ">= 2.1.2 < 3" - } - }, - "ignore-walk": { - "version": "3.0.3", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minimatch": "^3.0.4" - } - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "bundled": true, - "dev": true, - "optional": true - }, - "ini": { - "version": "1.3.5", - "bundled": true, - "dev": true, - "optional": true - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "bundled": true, - "dev": true, - "optional": true - }, - "minimatch": { - "version": "3.0.4", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "1.2.5", - "bundled": true, - "dev": true, - "optional": true - }, - "minipass": { - "version": "2.9.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "safe-buffer": "^5.1.2", - "yallist": "^3.0.0" - } - }, - "minizlib": { - "version": "1.3.3", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minipass": "^2.9.0" - } - }, - "mkdirp": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.3.tgz", - "integrity": "sha512-P+2gwrFqx8lhew375MQHHeTlY8AuOJSrGf0R5ddkEndUkmwpgUob/vQuBD1V22/Cw1/lJr4x+EjllSezBThzBg==", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minimist": "^1.2.5" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "bundled": true, - "dev": true, - "optional": true - }, - "needle": { - "version": "2.3.3", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "debug": "^3.2.6", - "iconv-lite": "^0.4.4", - "sax": "^1.2.4" - } - }, - "node-pre-gyp": { - "version": "0.14.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "detect-libc": "^1.0.2", - "mkdirp": "^0.5.1", - "needle": "^2.2.1", - "nopt": "^4.0.1", - "npm-packlist": "^1.1.6", - "npmlog": "^4.0.2", - "rc": "^1.2.7", - "rimraf": "^2.6.1", - "semver": "^5.3.0", - "tar": "^4.4.2" - } - }, - "nopt": { - "version": "4.0.3", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "abbrev": "1", - "osenv": "^0.1.4" - } - }, - "npm-bundled": { - "version": "1.1.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "npm-normalize-package-bin": "^1.0.1" - } - }, - "npm-normalize-package-bin": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "npm-packlist": { - "version": "1.4.8", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "ignore-walk": "^3.0.1", - "npm-bundled": "^1.0.1", - "npm-normalize-package-bin": "^1.0.1" - } - }, - "npmlog": { - "version": "4.1.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "are-we-there-yet": "~1.1.2", - "console-control-strings": "~1.1.0", - "gauge": "~2.7.3", - "set-blocking": "~2.0.0" - } - }, - "number-is-nan": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", - "bundled": true, - "dev": true, - "optional": true - }, - "object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", - "bundled": true, - "dev": true, - "optional": true - }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "wrappy": "1" - } - }, - "os-homedir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", - "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", - "bundled": true, - "dev": true, - "optional": true - }, - "os-tmpdir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", - "bundled": true, - "dev": true, - "optional": true - }, - "osenv": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz", - "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "os-homedir": "^1.0.0", - "os-tmpdir": "^1.0.0" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "bundled": true, - "dev": true, - "optional": true - }, - "process-nextick-args": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", - "bundled": true, - "dev": true, - "optional": true - }, - "rc": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", - "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "deep-extend": "^0.6.0", - "ini": "~1.3.0", - "minimist": "^1.2.0", - "strip-json-comments": "~2.0.1" - } - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "rimraf": { - "version": "2.7.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "glob": "^7.1.3" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "bundled": true, - "dev": true, - "optional": true - }, - "safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "bundled": true, - "dev": true, - "optional": true - }, - "sax": { - "version": "1.2.4", - "bundled": true, - "dev": true, - "optional": true - }, - "semver": { - "version": "5.7.1", - "bundled": true, - "dev": true, - "optional": true - }, - "set-blocking": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", - "bundled": true, - "dev": true, - "optional": true - }, - "signal-exit": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", - "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", - "bundled": true, - "dev": true, - "optional": true - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "safe-buffer": "~5.1.0" - } - }, - "string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "ansi-regex": "^2.0.0" - } - }, - "strip-json-comments": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", - "bundled": true, - "dev": true, - "optional": true - }, - "tar": { - "version": "4.4.13", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "chownr": "^1.1.1", - "fs-minipass": "^1.2.5", - "minipass": "^2.8.6", - "minizlib": "^1.2.1", - "mkdirp": "^0.5.0", - "safe-buffer": "^5.1.2", - "yallist": "^3.0.3" - } - }, - "util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", - "bundled": true, - "dev": true, - "optional": true - }, - "wide-align": { - "version": "1.1.3", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "string-width": "^1.0.2 || 2" - } - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "bundled": true, - "dev": true, - "optional": true - }, - "yallist": { - "version": "3.1.1", - "bundled": true, - "dev": true, - "optional": true - } - } - }, - "function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true - }, - "gauge": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/gauge/-/gauge-4.0.4.tgz", - "integrity": "sha512-f9m+BEN5jkg6a0fZjleidjN51VE1X+mPFQ2DJ0uv1V39oCLCbsGe6yjbBnp7eK7z/+GAon99a3nHuqbuuthyPg==", - "requires": { - "aproba": "^1.0.3 || ^2.0.0", - "color-support": "^1.1.3", - "console-control-strings": "^1.1.0", - "has-unicode": "^2.0.1", - "signal-exit": "^3.0.7", - "string-width": "^4.2.3", - "strip-ansi": "^6.0.1", - "wide-align": "^1.1.5" - }, - "dependencies": { - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" - }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" - }, - "signal-exit": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", - "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" - }, - "string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - } - }, - "strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "requires": { - "ansi-regex": "^5.0.1" - } - } - } - }, - "get-assigned-identifiers": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/get-assigned-identifiers/-/get-assigned-identifiers-1.2.0.tgz", - "integrity": "sha512-mBBwmeGTrxEMO4pMaaf/uUEFHnYtwr8FTe8Y/mer4rcV/bye0qGm6pw1bGZFGStxC5O76c5ZAVBGnqHmOaJpdQ==", - "dev": true - }, - "get-caller-file": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", - "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==", - "dev": true - }, - "get-intrinsic": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.3.tgz", - "integrity": "sha512-QJVz1Tj7MS099PevUG5jvnt9tSkXN8K14dxQlikJuPt4uD9hHAHjLyLBiLR5zELelBdD9QNRAXZzsJx0WaDL9A==", - "dev": true, - "requires": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.3" - } - }, - "get-value": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", - "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", - "dev": true - }, - "getpass": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng==", - "peer": true, - "requires": { - "assert-plus": "^1.0.0" - } - }, - "github-from-package": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", - "integrity": "sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==" - }, - "gl": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/gl/-/gl-5.0.3.tgz", - "integrity": "sha512-toWmb3Rgli5Wl9ygjZeglFBVLDYMOomy+rXlVZVDCoIRV+6mQE5nY4NgQgokYIc5oQzc1pvWY9lQJ0hGn61ZUg==", - "requires": { - "bindings": "^1.5.0", - "bit-twiddle": "^1.0.2", - "glsl-tokenizer": "^2.1.5", - "nan": "^2.16.0", - "node-abi": "^3.22.0", - "node-gyp": "^9.0.0", - "prebuild-install": "^7.1.1" - } - }, - "gl-wiretap": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/gl-wiretap/-/gl-wiretap-0.6.2.tgz", - "integrity": "sha512-fxy1XGiPkfzK+T3XKDbY7yaqMBmozCGvAFyTwaZA3imeZH83w7Hr3r3bYlMRWIyzMI/lDUvUMM/92LE2OwqFyQ==" - }, - "glob": { - "version": "7.1.4", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", - "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "glob-parent": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", - "integrity": "sha512-E8Ak/2+dZY6fnzlR7+ueWvhsH1SjHr4jjss4YS/h4py44jY9MhK/VFdaZJAWDz6BbL21KeteKxFSFpq8OS5gVA==", - "dev": true, - "requires": { - "is-glob": "^3.1.0", - "path-dirname": "^1.0.0" - }, - "dependencies": { - "is-glob": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", - "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", - "dev": true, - "requires": { - "is-extglob": "^2.1.0" - } - } - } - }, - "glob-stream": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/glob-stream/-/glob-stream-6.1.0.tgz", - "integrity": "sha512-uMbLGAP3S2aDOHUDfdoYcdIePUCfysbAd0IAoWVZbeGU/oNQ8asHVSshLDJUPWxfzj8zsCG7/XeHPHTtow0nsw==", - "dev": true, - "requires": { - "extend": "^3.0.0", - "glob": "^7.1.1", - "glob-parent": "^3.1.0", - "is-negated-glob": "^1.0.0", - "ordered-read-streams": "^1.0.0", - "pumpify": "^1.3.5", - "readable-stream": "^2.1.5", - "remove-trailing-separator": "^1.0.1", - "to-absolute-glob": "^2.0.0", - "unique-stream": "^2.0.2" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, - "glob-watcher": { - "version": "5.0.5", - "resolved": "https://registry.npmjs.org/glob-watcher/-/glob-watcher-5.0.5.tgz", - "integrity": "sha512-zOZgGGEHPklZNjZQaZ9f41i7F2YwE+tS5ZHrDhbBCk3stwahn5vQxnFmBJZHoYdusR6R1bLSXeGUy/BhctwKzw==", - "dev": true, - "requires": { - "anymatch": "^2.0.0", - "async-done": "^1.2.0", - "chokidar": "^2.0.0", - "is-negated-glob": "^1.0.0", - "just-debounce": "^1.0.0", - "normalize-path": "^3.0.0", - "object.defaults": "^1.1.0" - } - }, - "global-modules": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-1.0.0.tgz", - "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==", - "dev": true, - "requires": { - "global-prefix": "^1.0.1", - "is-windows": "^1.0.1", - "resolve-dir": "^1.0.0" - } - }, - "global-prefix": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-1.0.2.tgz", - "integrity": "sha1-2/dDxsFJklk8ZVVoy2btMsASLr4=", - "dev": true, - "requires": { - "expand-tilde": "^2.0.2", - "homedir-polyfill": "^1.0.1", - "ini": "^1.3.4", - "is-windows": "^1.0.1", - "which": "^1.2.14" - } - }, - "globalyzer": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/globalyzer/-/globalyzer-0.1.0.tgz", - "integrity": "sha512-40oNTM9UfG6aBmuKxk/giHn5nQ8RVz/SS4Ir6zgzOv9/qC3kKZ9v4etGTcJbEl/NyVQH7FGU7d+X1egr57Md2Q==", - "dev": true - }, - "globby": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/globby/-/globby-10.0.1.tgz", - "integrity": "sha512-sSs4inE1FB2YQiymcmTv6NWENryABjUNPeWhOvmn4SjtKybglsyPZxFB3U1/+L1bYi0rNZDqCLlHyLYDl1Pq5A==", - "dev": true, - "requires": { - "@types/glob": "^7.1.1", - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.0.3", - "glob": "^7.1.3", - "ignore": "^5.1.1", - "merge2": "^1.2.3", - "slash": "^3.0.0" - } - }, - "globrex": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/globrex/-/globrex-0.1.2.tgz", - "integrity": "sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==", - "dev": true - }, - "glogg": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/glogg/-/glogg-1.0.2.tgz", - "integrity": "sha512-5mwUoSuBk44Y4EshyiqcH95ZntbDdTQqA3QYSrxmzj28Ai0vXBGMH1ApSANH14j2sIRtqCEyg6PfsuP7ElOEDA==", - "dev": true, - "requires": { - "sparkles": "^1.0.0" - } - }, - "glsl-tokenizer": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/glsl-tokenizer/-/glsl-tokenizer-2.1.5.tgz", - "integrity": "sha512-XSZEJ/i4dmz3Pmbnpsy3cKh7cotvFlBiZnDOwnj/05EwNp2XrhQ4XKJxT7/pDt4kp4YcpRSKz8eTV7S+mwV6MA==", - "requires": { - "through2": "^0.6.3" - } - }, - "gopd": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", - "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", - "dev": true, - "requires": { - "get-intrinsic": "^1.1.3" - } - }, - "gpu-mock.js": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/gpu-mock.js/-/gpu-mock.js-1.3.1.tgz", - "integrity": "sha512-+lbp8rQ0p1nTa6Gk6HoLiw4yM6JTpql82U+nCF3sZbX4FJWP9PzzF1018dW8K+pbmqRmhLHbn6Bjc6i6tgUpbA==", - "requires": {} - }, - "gpu.js": { - "version": "2.15.2", - "resolved": "https://registry.npmjs.org/gpu.js/-/gpu.js-2.15.2.tgz", - "integrity": "sha512-tgTRoWEE0X2PE3OgTNub9OwadXND2K7qwOW/VwhIiedY/mbiT93jJIrgWAKBgdhQR0JmyN4ObkSu0/vjSpbuiQ==", - "peer": true, - "requires": { - "acorn": "^7.1.1", - "gl": "^4.5.2", - "gl-wiretap": "^0.6.2", - "gpu-mock.js": "^1.3.0", - "webgpu": "^0.1.16" - }, - "dependencies": { - "aproba": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", - "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", - "peer": true - }, - "are-we-there-yet": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.7.tgz", - "integrity": "sha512-nxwy40TuMiUGqMyRHgCSWZ9FM4VAoRP4xUYSTv5ImRog+h9yISPbVH7H8fASCIzYn9wlEv4zvFL7uKDMCFQm3g==", - "peer": true, - "requires": { - "delegates": "^1.0.0", - "readable-stream": "^2.0.6" - } - }, - "decompress-response": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-4.2.1.tgz", - "integrity": "sha512-jOSne2qbyE+/r8G1VU+G/82LBs2Fs4LAsTiLSHOCOMZQl2OKZ6i8i4IyHemTe+/yIXOtTcRQMzPcgyhoFlqPkw==", - "peer": true, - "requires": { - "mimic-response": "^2.0.0" - } - }, - "detect-libc": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", - "integrity": "sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg==", - "peer": true - }, - "gauge": { - "version": "2.7.4", - "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", - "integrity": "sha512-14x4kjc6lkD3ltw589k0NrPD6cCNTD6CWoVUNpB85+DrtONoZn+Rug6xZU5RvSC4+TZPxA5AnBibQYAvZn41Hg==", - "peer": true, - "requires": { - "aproba": "^1.0.3", - "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.0", - "object-assign": "^4.1.0", - "signal-exit": "^3.0.0", - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wide-align": "^1.1.0" - } - }, - "gl": { - "version": "4.9.2", - "resolved": "https://registry.npmjs.org/gl/-/gl-4.9.2.tgz", - "integrity": "sha512-lLYaicQxsRPxOnKWX9pIGmtKRuw0epvI089yl9uBvemYxR9xE01eRuXJgje1U0/06Df7bdOmmcW87IPOsu52Ow==", - "peer": true, - "requires": { - "bindings": "^1.5.0", - "bit-twiddle": "^1.0.2", - "glsl-tokenizer": "^2.0.2", - "nan": "^2.15.0", - "node-abi": "^2.30.1", - "node-gyp": "^7.1.2", - "prebuild-install": "^5.3.6" - } - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", - "peer": true - }, - "lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "peer": true, - "requires": { - "yallist": "^4.0.0" - } - }, - "mimic-response": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-2.1.0.tgz", - "integrity": "sha512-wXqjST+SLt7R009ySCglWBCFpjUygmCIfD790/kVbiGmUgfYGuB14PiTd5DwVxSV4NcYHjzMkoj5LjQZwTQLEA==", - "peer": true - }, - "node-abi": { - "version": "2.30.1", - "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-2.30.1.tgz", - "integrity": "sha512-/2D0wOQPgaUWzVSVgRMx+trKJRC2UG4SUc4oCJoXx9Uxjtp0Vy3/kt7zcbxHF8+Z/pK3UloLWzBISg72brfy1w==", - "peer": true, - "requires": { - "semver": "^5.4.1" - } - }, - "node-gyp": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-7.1.2.tgz", - "integrity": "sha512-CbpcIo7C3eMu3dL1c3d0xw449fHIGALIJsRP4DDPHpyiW8vcriNY7ubh9TE4zEKfSxscY7PjeFnshE7h75ynjQ==", - "peer": true, - "requires": { - "env-paths": "^2.2.0", - "glob": "^7.1.4", - "graceful-fs": "^4.2.3", - "nopt": "^5.0.0", - "npmlog": "^4.1.2", - "request": "^2.88.2", - "rimraf": "^3.0.2", - "semver": "^7.3.2", - "tar": "^6.0.2", - "which": "^2.0.2" - }, - "dependencies": { - "semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", - "peer": true, - "requires": { - "lru-cache": "^6.0.0" - } - } - } - }, - "npmlog": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", - "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", - "peer": true, - "requires": { - "are-we-there-yet": "~1.1.2", - "console-control-strings": "~1.1.0", - "gauge": "~2.7.3", - "set-blocking": "~2.0.0" - } - }, - "prebuild-install": { - "version": "5.3.6", - "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-5.3.6.tgz", - "integrity": "sha512-s8Aai8++QQGi4sSbs/M1Qku62PFK49Jm1CbgXklGz4nmHveDq0wzJkg7Na5QbnO1uNH8K7iqx2EQ/mV0MZEmOg==", - "peer": true, - "requires": { - "detect-libc": "^1.0.3", - "expand-template": "^2.0.3", - "github-from-package": "0.0.0", - "minimist": "^1.2.3", - "mkdirp-classic": "^0.5.3", - "napi-build-utils": "^1.0.1", - "node-abi": "^2.7.0", - "noop-logger": "^0.1.1", - "npmlog": "^4.0.1", - "pump": "^3.0.0", - "rc": "^1.2.7", - "simple-get": "^3.0.3", - "tar-fs": "^2.0.0", - "tunnel-agent": "^0.6.0", - "which-pm-runs": "^1.0.0" - } - }, - "pump": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", - "peer": true, - "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "peer": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "peer": true - }, - "simple-get": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-3.1.1.tgz", - "integrity": "sha512-CQ5LTKGfCpvE1K0n2us+kuMPbk/q0EKl82s4aheV9oXjFEz6W/Y7oQFVJuU6QG77hRT4Ghb5RURteF5vnWjupA==", - "peer": true, - "requires": { - "decompress-response": "^4.2.0", - "once": "^1.3.1", - "simple-concat": "^1.0.0" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "peer": true, - "requires": { - "safe-buffer": "~5.1.0" - } - }, - "which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "peer": true, - "requires": { - "isexe": "^2.0.0" - } - } - } - }, - "graceful-fs": { - "version": "4.2.10", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", - "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==" - }, - "gulp": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/gulp/-/gulp-4.0.2.tgz", - "integrity": "sha512-dvEs27SCZt2ibF29xYgmnwwCYZxdxhQ/+LFWlbAW8y7jt68L/65402Lz3+CKy0Ov4rOs+NERmDq7YlZaDqUIfA==", - "dev": true, - "requires": { - "glob-watcher": "^5.0.3", - "gulp-cli": "^2.2.0", - "undertaker": "^1.2.1", - "vinyl-fs": "^3.0.0" - }, - "dependencies": { - "gulp-cli": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/gulp-cli/-/gulp-cli-2.2.0.tgz", - "integrity": "sha512-rGs3bVYHdyJpLqR0TUBnlcZ1O5O++Zs4bA0ajm+zr3WFCfiSLjGwoCBqFs18wzN+ZxahT9DkOK5nDf26iDsWjA==", - "dev": true, - "requires": { - "ansi-colors": "^1.0.1", - "archy": "^1.0.0", - "array-sort": "^1.0.0", - "color-support": "^1.1.3", - "concat-stream": "^1.6.0", - "copy-props": "^2.0.1", - "fancy-log": "^1.3.2", - "gulplog": "^1.0.0", - "interpret": "^1.1.0", - "isobject": "^3.0.1", - "liftoff": "^3.1.0", - "matchdep": "^2.0.0", - "mute-stdout": "^1.0.0", - "pretty-hrtime": "^1.0.0", - "replace-homedir": "^1.0.0", - "semver-greatest-satisfied-range": "^1.1.0", - "v8flags": "^3.0.1", - "yargs": "^7.1.0" - } - }, - "yargs": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-7.1.0.tgz", - "integrity": "sha1-a6MY6xaWFyf10oT46gA+jWFU0Mg=", - "dev": true, - "requires": { - "camelcase": "^3.0.0", - "cliui": "^3.2.0", - "decamelize": "^1.1.1", - "get-caller-file": "^1.0.1", - "os-locale": "^1.4.0", - "read-pkg-up": "^1.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^1.0.1", - "set-blocking": "^2.0.0", - "string-width": "^1.0.2", - "which-module": "^1.0.0", - "y18n": "^3.2.1", - "yargs-parser": "^5.0.0" - } - }, - "yargs-parser": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-5.0.1.tgz", - "integrity": "sha512-wpav5XYiddjXxirPoCTUPbqM0PXvJ9hiBMvuJgInvo4/lAOTZzUprArw17q2O1P2+GHhbBr18/iQwjL5Z9BqfA==", - "dev": true, - "requires": { - "camelcase": "^3.0.0", - "object.assign": "^4.1.0" - } - } - } - }, - "gulp-concat": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/gulp-concat/-/gulp-concat-2.6.1.tgz", - "integrity": "sha1-Yz0WyV2IUEYorQJmVmPO5aR5M1M=", - "dev": true, - "requires": { - "concat-with-sourcemaps": "^1.0.0", - "through2": "^2.0.0", - "vinyl": "^2.0.0" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - }, - "through2": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", - "dev": true, - "requires": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" - } - } - } - }, - "gulp-header": { - "version": "1.8.12", - "resolved": "https://registry.npmjs.org/gulp-header/-/gulp-header-1.8.12.tgz", - "integrity": "sha512-lh9HLdb53sC7XIZOYzTXM4lFuXElv3EVkSDhsd7DoJBj7hm+Ni7D3qYbb+Rr8DuM8nRanBvkVO9d7askreXGnQ==", - "dev": true, - "requires": { - "concat-with-sourcemaps": "*", - "lodash.template": "^4.4.0", - "through2": "^2.0.0" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - }, - "through2": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", - "dev": true, - "requires": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" - } - } - } - }, - "gulp-jsbeautifier": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/gulp-jsbeautifier/-/gulp-jsbeautifier-2.1.2.tgz", - "integrity": "sha512-tZUk4c11zF8xzCCTOEmktxGitv/H2vpAcflZNVU8nxL+G5XxQyLJUJVUKylz7/dax+FXb3YwQYByaJ+yxmo8iw==", - "dev": true, - "requires": { - "chalk": "^1.1.3", - "fancy-log": "^1.3.2", - "js-beautify": "^1.7.5", - "lodash": "^4.17.4", - "plugin-error": "^0.1.2", - "rc": "^1.2.2", - "through2": "^2.0.3" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - }, - "through2": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", - "dev": true, - "requires": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" - } - } - } - }, - "gulp-rename": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/gulp-rename/-/gulp-rename-1.4.0.tgz", - "integrity": "sha512-swzbIGb/arEoFK89tPY58vg3Ok1bw+d35PfUNwWqdo7KM4jkmuGA78JiDNqR+JeZFaeeHnRg9N7aihX3YPmsyg==", - "dev": true - }, - "gulp-replace": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/gulp-replace/-/gulp-replace-1.0.0.tgz", - "integrity": "sha512-lgdmrFSI1SdhNMXZQbrC75MOl1UjYWlOWNbNRnz+F/KHmgxt3l6XstBoAYIdadwETFyG/6i+vWUSCawdC3pqOw==", - "dev": true, - "requires": { - "istextorbinary": "2.2.1", - "readable-stream": "^2.0.1", - "replacestream": "^4.0.0" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, - "gulp-strip-comments": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/gulp-strip-comments/-/gulp-strip-comments-2.5.2.tgz", - "integrity": "sha512-lb1bW7rsPWDD8f4ZPSguDvmCdjKmjr5HR4yZb9ros3sLl5AfW7oUj8KzY9/VRisT7dG8dL7hVHzNpQEVxfwZGQ==", - "dev": true, - "requires": { - "decomment": "^0.9.0", - "plugin-error": "^0.1.2", - "through2": "^2.0.3" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - }, - "through2": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", - "dev": true, - "requires": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" - } - } - } - }, - "gulp-uglify-es": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/gulp-uglify-es/-/gulp-uglify-es-3.0.0.tgz", - "integrity": "sha512-dQ3czMFFojNgCajcrYl0oa98+YayaQ8kXRdaacpZRZ3iw2sdVURfdt8y8Ki1ogZGQqw8BUawnB7V6NkanxqnDg==", - "dev": true, - "requires": { - "o-stream": "^0.3.0", - "plugin-error": "^1.0.1", - "terser": "^5.7.1", - "vinyl": "^2.2.1", - "vinyl-sourcemaps-apply": "^0.2.1" - }, - "dependencies": { - "plugin-error": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/plugin-error/-/plugin-error-1.0.1.tgz", - "integrity": "sha512-L1zP0dk7vGweZME2i+EeakvUNqSrdiI3F91TwEoYiGrAfUXmVv6fJIq4g82PAXxNsWOp0J7ZqQy/3Szz0ajTxA==", - "dev": true, - "requires": { - "ansi-colors": "^1.0.1", - "arr-diff": "^4.0.0", - "arr-union": "^3.1.0", - "extend-shallow": "^3.0.2" - } - } - } - }, - "gulplog": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/gulplog/-/gulplog-1.0.0.tgz", - "integrity": "sha1-4oxNRdBey77YGDY86PnFkmIp/+U=", - "dev": true, - "requires": { - "glogg": "^1.0.0" - } - }, - "har-schema": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha512-Oqluz6zhGX8cyRaTQlFMPw80bSJVG2x/cFb8ZPhUILGgHka9SsokCCOQgpveePerqidZOrT14ipqfJb7ILcW5Q==", - "peer": true - }, - "har-validator": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", - "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", - "peer": true, - "requires": { - "ajv": "^6.12.3", - "har-schema": "^2.0.0" - } - }, - "has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dev": true, - "requires": { - "function-bind": "^1.1.1" - } - }, - "has-ansi": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", - "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, - "has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", - "dev": true - }, - "has-tostringtag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", - "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", - "dev": true, - "requires": { - "has-symbols": "^1.0.2" - } - }, - "has-unicode": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", - "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==" - }, - "has-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", - "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", - "dev": true, - "requires": { - "get-value": "^2.0.6", - "has-values": "^1.0.0", - "isobject": "^3.0.0" - } - }, - "has-values": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", - "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", - "dev": true, - "requires": { - "is-number": "^3.0.0", - "kind-of": "^4.0.0" - }, - "dependencies": { - "kind-of": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", - "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "hash-base": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz", - "integrity": "sha1-X8hoaEfs1zSZQDMZprCj8/auSRg=", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "hash.js": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", - "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "minimalistic-assert": "^1.0.1" - } - }, - "hmac-drbg": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", - "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", - "dev": true, - "requires": { - "hash.js": "^1.0.3", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.1" - } - }, - "homedir-polyfill": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz", - "integrity": "sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==", - "dev": true, - "requires": { - "parse-passwd": "^1.0.0" - } - }, - "hosted-git-info": { - "version": "2.8.9", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", - "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", - "dev": true - }, - "html-escaper": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", - "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", - "dev": true - }, - "htmlescape": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/htmlescape/-/htmlescape-1.1.1.tgz", - "integrity": "sha1-OgPtwiFLyjtmQko+eVk0lQnLA1E=", - "dev": true - }, - "http-cache-semantics": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz", - "integrity": "sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==" - }, - "http-errors": { - "version": "1.7.3", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.3.tgz", - "integrity": "sha512-ZTTX0MWrsQ2ZAhA1cejAwDLycFsd7I7nVtnkT3Ol0aqodaKW+0CTZDQ1uBv5whptCnc8e8HeRRJxRs0kmm/Qfw==", - "dev": true, - "requires": { - "depd": "~1.1.2", - "inherits": "2.0.4", - "setprototypeof": "1.1.1", - "statuses": ">= 1.5.0 < 2", - "toidentifier": "1.0.0" - }, - "dependencies": { - "statuses": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", - "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=", - "dev": true - } - } - }, - "http-proxy": { - "version": "1.18.1", - "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.1.tgz", - "integrity": "sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==", - "dev": true, - "requires": { - "eventemitter3": "^4.0.0", - "follow-redirects": "^1.0.0", - "requires-port": "^1.0.0" - } - }, - "http-proxy-agent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz", - "integrity": "sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==", - "requires": { - "@tootallnate/once": "2", - "agent-base": "6", - "debug": "4" - }, - "dependencies": { - "debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "requires": { - "ms": "2.1.2" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - } - } - }, - "http-signature": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "integrity": "sha512-CAbnr6Rz4CYQkLYUtSNXxQPUH2gK8f3iWexVlsnMeD+GjlsQ0Xsy1cOX+mN3dtxYomRy21CiOzU8Uhw6OwncEQ==", - "peer": true, - "requires": { - "assert-plus": "^1.0.0", - "jsprim": "^1.2.2", - "sshpk": "^1.7.0" - } - }, - "https-browserify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz", - "integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=", - "dev": true - }, - "https-proxy-agent": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", - "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", - "requires": { - "agent-base": "6", - "debug": "4" - }, - "dependencies": { - "debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "requires": { - "ms": "2.1.2" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - } - } - }, - "humanize-ms": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz", - "integrity": "sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==", - "requires": { - "ms": "^2.0.0" - } - }, - "iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "dev": true, - "requires": { - "safer-buffer": ">= 2.1.2 < 3" - } - }, - "ieee754": { - "version": "1.1.13", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz", - "integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==" - }, - "ignore": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.2.tgz", - "integrity": "sha512-vdqWBp7MyzdmHkkRWV5nY+PfGRbYbahfuvsBCh277tq+w9zyNi7h5CYJCK0kmzti9kU+O/cB7sE8HvKv6aXAKQ==", - "dev": true - }, - "immutable": { - "version": "3.8.2", - "resolved": "https://registry.npmjs.org/immutable/-/immutable-3.8.2.tgz", - "integrity": "sha512-15gZoQ38eYjEjxkorfbcgBKBL6R7T459OuK+CpcWt7O3KF4uPCx2tD0uFETlUDIyo+1789crbMhTvQBSR5yBMg==", - "dev": true - }, - "imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==" - }, - "indent-string": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", - "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==" - }, - "infer-owner": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/infer-owner/-/infer-owner-1.0.4.tgz", - "integrity": "sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A==" - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" - }, - "ini": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", - "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" - }, - "inline-source-map": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/inline-source-map/-/inline-source-map-0.6.2.tgz", - "integrity": "sha1-+Tk0ccGKedFyT4Y/o4tYY3Ct4qU=", - "dev": true, - "requires": { - "source-map": "~0.5.3" - } - }, - "insert-module-globals": { - "version": "7.2.1", - "resolved": "https://registry.npmjs.org/insert-module-globals/-/insert-module-globals-7.2.1.tgz", - "integrity": "sha512-ufS5Qq9RZN+Bu899eA9QCAYThY+gGW7oRkmb0vC93Vlyu/CFGcH0OYPEjVkDXA5FEbTt1+VWzdoOD3Ny9N+8tg==", - "dev": true, - "requires": { - "acorn-node": "^1.5.2", - "combine-source-map": "^0.8.0", - "concat-stream": "^1.6.1", - "is-buffer": "^1.1.0", - "JSONStream": "^1.0.3", - "path-is-absolute": "^1.0.1", - "process": "~0.11.0", - "through2": "^2.0.0", - "undeclared-identifiers": "^1.1.2", - "xtend": "^4.0.0" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", - "dev": true - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - }, - "through2": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", - "dev": true, - "requires": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" - } - } - } - }, - "interpret": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.2.0.tgz", - "integrity": "sha512-mT34yGKMNceBQUoVn7iCDKDntA7SC6gycMAWzGx1z/CMCTV7b2AAtXlo3nRyHZ1FelRkQbQjprHSYGwzLtkVbw==", - "dev": true - }, - "invert-kv": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", - "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=", - "dev": true - }, - "ip": { - "version": "1.1.8", - "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.8.tgz", - "integrity": "sha512-PuExPYUiu6qMBQb4l06ecm6T6ujzhmh+MeJcW9wa89PoAz5pvd4zPgN5WJV104mb6S2T1AwNIAaB70JNrLQWhg==" - }, - "is-absolute": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-1.0.0.tgz", - "integrity": "sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA==", - "dev": true, - "requires": { - "is-relative": "^1.0.0", - "is-windows": "^1.0.1" - } - }, - "is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-arguments": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz", - "integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==", - "dev": true, - "requires": { - "call-bind": "^1.0.2", - "has-tostringtag": "^1.0.0" - } - }, - "is-arrayish": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", - "dev": true - }, - "is-binary-path": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", - "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", - "dev": true, - "requires": { - "binary-extensions": "^1.0.0" - } - }, - "is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", - "dev": true - }, - "is-callable": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", - "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", - "dev": true - }, - "is-core-module": { - "version": "2.11.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.11.0.tgz", - "integrity": "sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw==", - "dev": true, - "requires": { - "has": "^1.0.3" - } - }, - "is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" - }, - "dependencies": { - "kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "dev": true - } - } - }, - "is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", - "dev": true - }, - "is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "is-generator-function": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.10.tgz", - "integrity": "sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==", - "dev": true, - "requires": { - "has-tostringtag": "^1.0.0" - } - }, - "is-glob": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", - "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", - "dev": true, - "requires": { - "is-extglob": "^2.1.1" - } - }, - "is-lambda": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-lambda/-/is-lambda-1.0.1.tgz", - "integrity": "sha512-z7CMFGNrENq5iFB9Bqo64Xk6Y9sg+epq1myIcdHaGnbMTYOxvzsEtdYqQUylB7LxfkvgrrjP32T6Ywciio9UIQ==" - }, - "is-negated-glob": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-negated-glob/-/is-negated-glob-1.0.0.tgz", - "integrity": "sha1-aRC8pdqMleeEtXUbl2z1oQ/uNtI=", - "dev": true - }, - "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-number-like": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/is-number-like/-/is-number-like-1.0.8.tgz", - "integrity": "sha512-6rZi3ezCyFcn5L71ywzz2bS5b2Igl1En3eTlZlvKjpz1n3IZLAYMbKYAIQgFmEu0GENg92ziU/faEOA/aixjbA==", - "dev": true, - "requires": { - "lodash.isfinite": "^3.3.2" - } - }, - "is-path-cwd": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-2.2.0.tgz", - "integrity": "sha512-w942bTcih8fdJPJmQHFzkS76NEP8Kzzvmw92cXsazb8intwLqPibPPdXf4ANdKV3rYMuuQYGIWtvz9JilB3NFQ==", - "dev": true - }, - "is-path-in-cwd": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-3.0.0.tgz", - "integrity": "sha512-QGuLYLNfpHI/xLQ8ctyeD9mMCf2eBqrtxYWKQxlExrD0l3wBSDcplKYfV55lnTDB4MDvh9SRDt/VnDwVn0dYOw==", - "dev": true, - "requires": { - "is-path-inside": "^3.0.1" - } - }, - "is-path-inside": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.1.tgz", - "integrity": "sha512-CKstxrctq1kUesU6WhtZDbYKzzYBuRH0UYInAVrkc/EYdB9ltbfE0gOoayG9nhohG6447sOOVGhHqsdmBvkbNg==", - "dev": true - }, - "is-plain-object": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", - "dev": true, - "requires": { - "isobject": "^3.0.1" - } - }, - "is-relative": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-relative/-/is-relative-1.0.0.tgz", - "integrity": "sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA==", - "dev": true, - "requires": { - "is-unc-path": "^1.0.0" - } - }, - "is-typed-array": { - "version": "1.1.10", - "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.10.tgz", - "integrity": "sha512-PJqgEHiWZvMpaFZ3uTc8kHPM4+4ADTlDniuQL7cU/UDA0Ql7F70yGfHph3cLNe+c9toaigv+DFzTJKhc2CtO6A==", - "dev": true, - "requires": { - "available-typed-arrays": "^1.0.5", - "call-bind": "^1.0.2", - "for-each": "^0.3.3", - "gopd": "^1.0.1", - "has-tostringtag": "^1.0.0" - } - }, - "is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==", - "peer": true - }, - "is-unc-path": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-unc-path/-/is-unc-path-1.0.0.tgz", - "integrity": "sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ==", - "dev": true, - "requires": { - "unc-path-regex": "^0.1.2" - } - }, - "is-utf8": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", - "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", - "dev": true - }, - "is-valid-glob": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-valid-glob/-/is-valid-glob-1.0.0.tgz", - "integrity": "sha1-Kb8+/3Ab4tTTFdusw5vDn+j2Aao=", - "dev": true - }, - "is-windows": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", - "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", - "dev": true - }, - "is-wsl": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-1.1.0.tgz", - "integrity": "sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0=", - "dev": true - }, - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" - }, - "isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" - }, - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true - }, - "isstream": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==", - "peer": true - }, - "istanbul-lib-coverage": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz", - "integrity": "sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==", - "dev": true - }, - "istanbul-lib-report": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", - "integrity": "sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==", - "dev": true, - "requires": { - "istanbul-lib-coverage": "^3.0.0", - "make-dir": "^3.0.0", - "supports-color": "^7.1.0" - }, - "dependencies": { - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } - } - }, - "istanbul-reports": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.5.tgz", - "integrity": "sha512-nUsEMa9pBt/NOHqbcbeJEgqIlY/K7rVWUX6Lql2orY5e9roQOthbR3vtY4zzf2orPELg80fnxxk9zUyPlgwD1w==", - "dev": true, - "requires": { - "html-escaper": "^2.0.0", - "istanbul-lib-report": "^3.0.0" - } - }, - "istextorbinary": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/istextorbinary/-/istextorbinary-2.2.1.tgz", - "integrity": "sha512-TS+hoFl8Z5FAFMK38nhBkdLt44CclNRgDHWeMgsV8ko3nDlr/9UI2Sf839sW7enijf8oKsZYXRvM8g0it9Zmcw==", - "dev": true, - "requires": { - "binaryextensions": "2", - "editions": "^1.3.3", - "textextensions": "2" - } - }, - "js-beautify": { - "version": "1.10.3", - "resolved": "https://registry.npmjs.org/js-beautify/-/js-beautify-1.10.3.tgz", - "integrity": "sha512-wfk/IAWobz1TfApSdivH5PJ0miIHgDoYb1ugSqHcODPmaYu46rYe5FVuIEkhjg8IQiv6rDNPyhsqbsohI/C2vQ==", - "dev": true, - "requires": { - "config-chain": "^1.1.12", - "editorconfig": "^0.15.3", - "glob": "^7.1.3", - "mkdirp": "~0.5.1", - "nopt": "~4.0.1" - }, - "dependencies": { - "nopt": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.3.tgz", - "integrity": "sha512-CvaGwVMztSMJLOeXPrez7fyfObdZqNUK1cPAEzLHrTybIua9pMdmmPR5YwtfNftIOMv3DPUhFaxsZMNTQO20Kg==", - "dev": true, - "requires": { - "abbrev": "1", - "osenv": "^0.1.4" - } - } - } - }, - "jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==", - "peer": true - }, - "json-schema": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", - "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==", - "peer": true - }, - "json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "peer": true - }, - "json-stable-stringify-without-jsonify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", - "dev": true - }, - "json-stringify-safe": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==", - "peer": true - }, - "jsonfile": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-3.0.1.tgz", - "integrity": "sha1-pezG9l9T9mLEQVx2daAzHQmS7GY=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.6" - } - }, - "jsonparse": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", - "integrity": "sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=", - "dev": true - }, - "JSONStream": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz", - "integrity": "sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==", - "dev": true, - "requires": { - "jsonparse": "^1.2.0", - "through": ">=2.2.7 <3" - } - }, - "jsprim": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.2.tgz", - "integrity": "sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw==", - "peer": true, - "requires": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.4.0", - "verror": "1.10.0" - } - }, - "just-debounce": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/just-debounce/-/just-debounce-1.0.0.tgz", - "integrity": "sha1-h/zPrv/AtozRnVX2cilD+SnqNeo=", - "dev": true - }, - "just-extend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-4.0.2.tgz", - "integrity": "sha512-FrLwOgm+iXrPV+5zDU6Jqu4gCRXbWEQg2O3SKONsWE4w7AXFRkryS53bpWdaL9cNol+AmR3AEYz6kn+o0fCPnw==", - "dev": true - }, - "kind-of": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", - "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", - "dev": true - }, - "labeled-stream-splicer": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/labeled-stream-splicer/-/labeled-stream-splicer-2.0.2.tgz", - "integrity": "sha512-Ca4LSXFFZUjPScRaqOcFxneA0VpKZr4MMYCljyQr4LIewTLb3Y0IUTIsnBBsVubIeEfxeSZpSjSsRM8APEQaAw==", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "stream-splicer": "^2.0.0" - } - }, - "last-run": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/last-run/-/last-run-1.1.1.tgz", - "integrity": "sha1-RblpQsF7HHnHchmCWbqUO+v4yls=", - "dev": true, - "requires": { - "default-resolution": "^2.0.0", - "es6-weak-map": "^2.0.1" - } - }, - "lazystream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/lazystream/-/lazystream-1.0.0.tgz", - "integrity": "sha1-9plf4PggOS9hOWvolGJAe7dxaOQ=", - "dev": true, - "requires": { - "readable-stream": "^2.0.5" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, - "lcid": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", - "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", - "dev": true, - "requires": { - "invert-kv": "^1.0.0" - } - }, - "lead": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/lead/-/lead-1.0.0.tgz", - "integrity": "sha1-bxT5mje+Op3XhPVJVpDlkDRm7kI=", - "dev": true, - "requires": { - "flush-write-stream": "^1.0.2" - } - }, - "liftoff": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/liftoff/-/liftoff-3.1.0.tgz", - "integrity": "sha512-DlIPlJUkCV0Ips2zf2pJP0unEoT1kwYhiiPUGF3s/jtxTCjziNLoiVVh+jqWOWeFi6mmwQ5fNxvAUyPad4Dfog==", - "dev": true, - "requires": { - "extend": "^3.0.0", - "findup-sync": "^3.0.0", - "fined": "^1.0.1", - "flagged-respawn": "^1.0.0", - "is-plain-object": "^2.0.4", - "object.map": "^1.0.0", - "rechoir": "^0.6.2", - "resolve": "^1.1.7" - } - }, - "limiter": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/limiter/-/limiter-1.1.5.tgz", - "integrity": "sha512-FWWMIEOxz3GwUI4Ts/IvgVy6LPvoMPgjMdQ185nN6psJyBJ4yOpzqm695/h5umdLJg2vW3GR5iG11MAkR2AzJA==", - "dev": true - }, - "load-json-file": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", - "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "parse-json": "^2.2.0", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0", - "strip-bom": "^2.0.0" - } - }, - "localtunnel": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/localtunnel/-/localtunnel-2.0.2.tgz", - "integrity": "sha512-n418Cn5ynvJd7m/N1d9WVJISLJF/ellZnfsLnx8WBWGzxv/ntNcFkJ1o6se5quUhCplfLGBNL5tYHiq5WF3Nug==", - "dev": true, - "requires": { - "axios": "0.21.4", - "debug": "4.3.2", - "openurl": "1.1.1", - "yargs": "17.1.1" - }, - "dependencies": { - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true - }, - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "cliui": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", - "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", - "dev": true, - "requires": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^7.0.0" - } - }, - "get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true - }, - "string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - } - }, - "strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.1" - } - }, - "wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, - "requires": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - } - }, - "y18n": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", - "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", - "dev": true - }, - "yargs": { - "version": "17.1.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.1.1.tgz", - "integrity": "sha512-c2k48R0PwKIqKhPMWjeiF6y2xY/gPMUlro0sgxqXpbOIohWiLNXWslsootttv7E1e73QPAMQSg5FeySbVcpsPQ==", - "dev": true, - "requires": { - "cliui": "^7.0.2", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.0", - "y18n": "^5.0.5", - "yargs-parser": "^20.2.2" - } - } - } - }, - "locate-path": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", - "dev": true, - "requires": { - "p-locate": "^5.0.0" - } - }, - "lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true - }, - "lodash._reinterpolate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz", - "integrity": "sha1-DM8tiRZq8Ds2Y8eWU4t1rG4RTZ0=", - "dev": true - }, - "lodash.isfinite": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/lodash.isfinite/-/lodash.isfinite-3.3.2.tgz", - "integrity": "sha512-7FGG40uhC8Mm633uKW1r58aElFlBlxCrg9JfSi3P6aYiWmfiWF0PgMd86ZUsxE5GwWPdHoS2+48bwTh2VPkIQA==", - "dev": true - }, - "lodash.memoize": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-3.0.4.tgz", - "integrity": "sha1-LcvSwofLwKVcxCMovQxzYVDVPj8=", - "dev": true - }, - "lodash.template": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.template/-/lodash.template-4.5.0.tgz", - "integrity": "sha512-84vYFxIkmidUiFxidA/KjjH9pAycqW+h980j7Fuz5qxRtO9pgB7MDFTdys1N7A5mcucRiDyEq4fusljItR1T/A==", - "dev": true, - "requires": { - "lodash._reinterpolate": "^3.0.0", - "lodash.templatesettings": "^4.0.0" - } - }, - "lodash.templatesettings": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-4.2.0.tgz", - "integrity": "sha512-stgLz+i3Aa9mZgnjr/O+v9ruKZsPsndy7qPZOchbqk2cnTU1ZaldKK+v7m54WoKIyxiuMZTKT2H81F8BeAc3ZQ==", - "dev": true, - "requires": { - "lodash._reinterpolate": "^3.0.0" - } - }, - "lolex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/lolex/-/lolex-4.1.0.tgz", - "integrity": "sha512-BYxIEXiVq5lGIXeVHnsFzqa1TxN5acnKnPCdlZSpzm8viNEOhiigupA4vTQ9HEFQ6nLTQ9wQOgBknJgzUYQ9Aw==", - "dev": true - }, - "lru-cache": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", - "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", - "dev": true, - "requires": { - "pseudomap": "^1.0.2", - "yallist": "^2.1.2" - }, - "dependencies": { - "yallist": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", - "dev": true - } - } - }, - "make-dir": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", - "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", - "dev": true, - "requires": { - "semver": "^6.0.0" - }, - "dependencies": { - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - } - } - }, - "make-fetch-happen": { - "version": "10.1.8", - "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-10.1.8.tgz", - "integrity": "sha512-0ASJbG12Au6+N5I84W+8FhGS6iM8MyzvZady+zaQAu+6IOaESFzCLLD0AR1sAFF3Jufi8bxm586ABN6hWd3k7g==", - "requires": { - "agentkeepalive": "^4.2.1", - "cacache": "^16.1.0", - "http-cache-semantics": "^4.1.0", - "http-proxy-agent": "^5.0.0", - "https-proxy-agent": "^5.0.0", - "is-lambda": "^1.0.1", - "lru-cache": "^7.7.1", - "minipass": "^3.1.6", - "minipass-collect": "^1.0.2", - "minipass-fetch": "^2.0.3", - "minipass-flush": "^1.0.5", - "minipass-pipeline": "^1.2.4", - "negotiator": "^0.6.3", - "promise-retry": "^2.0.1", - "socks-proxy-agent": "^7.0.0", - "ssri": "^9.0.0" - }, - "dependencies": { - "lru-cache": { - "version": "7.12.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.12.0.tgz", - "integrity": "sha512-OIP3DwzRZDfLg9B9VP/huWBlpvbkmbfiBy8xmsXp4RPmE4A3MhwNozc5ZJ3fWnSg8fDcdlE/neRTPG2ycEKliw==" - }, - "negotiator": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", - "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==" - } - } - }, - "make-iterator": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/make-iterator/-/make-iterator-1.0.1.tgz", - "integrity": "sha512-pxiuXh0iVEq7VM7KMIhs5gxsfxCux2URptUQaXo4iZZJxBAzTPOLE2BumO5dbfVYq/hBJFBR/a1mFDmOx5AGmw==", - "dev": true, - "requires": { - "kind-of": "^6.0.2" - } - }, - "map-cache": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", - "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", - "dev": true - }, - "map-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", - "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", - "dev": true, - "requires": { - "object-visit": "^1.0.0" - } - }, - "matchdep": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/matchdep/-/matchdep-2.0.0.tgz", - "integrity": "sha1-xvNINKDY28OzfCfui7yyfHd1WC4=", - "dev": true, - "requires": { - "findup-sync": "^2.0.0", - "micromatch": "^3.0.4", - "resolve": "^1.4.0", - "stack-trace": "0.0.10" - }, - "dependencies": { - "findup-sync": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-2.0.0.tgz", - "integrity": "sha1-kyaxSIwi0aYIhlCoaQGy2akKLLw=", - "dev": true, - "requires": { - "detect-file": "^1.0.0", - "is-glob": "^3.1.0", - "micromatch": "^3.0.4", - "resolve-dir": "^1.0.1" - } - }, - "is-glob": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", - "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", - "dev": true, - "requires": { - "is-extglob": "^2.1.0" - } - } - } - }, - "md5.js": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", - "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", - "dev": true, - "requires": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1", - "safe-buffer": "^5.1.2" - } - }, - "merge-stream": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-1.0.1.tgz", - "integrity": "sha1-QEEgLVCKNCugAXQAjfDCUbjBNeE=", - "dev": true, - "requires": { - "readable-stream": "^2.0.1" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, - "merge2": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.2.3.tgz", - "integrity": "sha512-gdUU1Fwj5ep4kplwcmftruWofEFt6lfpkkr3h860CXbAB9c3hGb55EOL2ali0Td5oebvW0E1+3Sr+Ur7XfKpRA==", - "dev": true - }, - "micromatch": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", - "dev": true, - "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "braces": "^2.3.1", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "extglob": "^2.0.4", - "fragment-cache": "^0.2.1", - "kind-of": "^6.0.2", - "nanomatch": "^1.2.9", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.2" - } - }, - "miller-rabin": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", - "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", - "dev": true, - "requires": { - "bn.js": "^4.0.0", - "brorand": "^1.0.1" - } - }, - "mime": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.4.1.tgz", - "integrity": "sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ==", - "dev": true - }, - "mime-db": { - "version": "1.40.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.40.0.tgz", - "integrity": "sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA==" - }, - "mime-types": { - "version": "2.1.24", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.24.tgz", - "integrity": "sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ==", - "requires": { - "mime-db": "1.40.0" - } - }, - "mimic-response": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", - "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==" - }, - "minimalistic-assert": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", - "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", - "dev": true - }, - "minimalistic-crypto-utils": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", - "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=", - "dev": true - }, - "minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.7.tgz", - "integrity": "sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==" - }, - "minipass": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.4.tgz", - "integrity": "sha512-I9WPbWHCGu8W+6k1ZiGpPu0GkoKBeorkfKNuAFBNS1HNFJvke82sxvI5bzcCNpWPorkOO5QQ+zomzzwRxejXiw==", - "requires": { - "yallist": "^4.0.0" - } - }, - "minipass-collect": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/minipass-collect/-/minipass-collect-1.0.2.tgz", - "integrity": "sha512-6T6lH0H8OG9kITm/Jm6tdooIbogG9e0tLgpY6mphXSm/A9u8Nq1ryBG+Qspiub9LjWlBPsPS3tWQ/Botq4FdxA==", - "requires": { - "minipass": "^3.0.0" - } - }, - "minipass-fetch": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-2.1.0.tgz", - "integrity": "sha512-H9U4UVBGXEyyWJnqYDCLp1PwD8XIkJ4akNHp1aGVI+2Ym7wQMlxDKi4IB4JbmyU+pl9pEs/cVrK6cOuvmbK4Sg==", - "requires": { - "encoding": "^0.1.13", - "minipass": "^3.1.6", - "minipass-sized": "^1.0.3", - "minizlib": "^2.1.2" - } - }, - "minipass-flush": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/minipass-flush/-/minipass-flush-1.0.5.tgz", - "integrity": "sha512-JmQSYYpPUqX5Jyn1mXaRwOda1uQ8HP5KAT/oDSLCzt1BYRhQU0/hDtsB1ufZfEEzMZ9aAVmsBw8+FWsIXlClWw==", - "requires": { - "minipass": "^3.0.0" - } - }, - "minipass-pipeline": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/minipass-pipeline/-/minipass-pipeline-1.2.4.tgz", - "integrity": "sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A==", - "requires": { - "minipass": "^3.0.0" - } - }, - "minipass-sized": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/minipass-sized/-/minipass-sized-1.0.3.tgz", - "integrity": "sha512-MbkQQ2CTiBMlA2Dm/5cY+9SWFEN8pzzOXi6rlM5Xxq0Yqbda5ZQy9sU75a673FE9ZK0Zsbr6Y5iP6u9nktfg2g==", - "requires": { - "minipass": "^3.0.0" - } - }, - "minizlib": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", - "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", - "requires": { - "minipass": "^3.0.0", - "yallist": "^4.0.0" - } - }, - "mitt": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/mitt/-/mitt-1.2.0.tgz", - "integrity": "sha512-r6lj77KlwqLhIUku9UWYes7KJtsczvolZkzp8hbaDPPaE24OmWl5s539Mytlj22siEQKosZ26qCBgda2PKwoJw==", - "dev": true - }, - "mixin-deep": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", - "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", - "dev": true, - "requires": { - "for-in": "^1.0.2", - "is-extendable": "^1.0.1" - }, - "dependencies": { - "is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "dev": true, - "requires": { - "is-plain-object": "^2.0.4" - } - } - } - }, - "mkdirp": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.3.tgz", - "integrity": "sha512-P+2gwrFqx8lhew375MQHHeTlY8AuOJSrGf0R5ddkEndUkmwpgUob/vQuBD1V22/Cw1/lJr4x+EjllSezBThzBg==", - "dev": true, - "requires": { - "minimist": "^1.2.5" - } - }, - "mkdirp-classic": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz", - "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==" - }, - "module-deps": { - "version": "6.2.3", - "resolved": "https://registry.npmjs.org/module-deps/-/module-deps-6.2.3.tgz", - "integrity": "sha512-fg7OZaQBcL4/L+AK5f4iVqf9OMbCclXfy/znXRxTVhJSeW5AIlS9AwheYwDaXM3lVW7OBeaeUEY3gbaC6cLlSA==", - "dev": true, - "requires": { - "browser-resolve": "^2.0.0", - "cached-path-relative": "^1.0.2", - "concat-stream": "~1.6.0", - "defined": "^1.0.0", - "detective": "^5.2.0", - "duplexer2": "^0.1.2", - "inherits": "^2.0.1", - "JSONStream": "^1.0.3", - "parents": "^1.0.0", - "readable-stream": "^2.0.2", - "resolve": "^1.4.0", - "stream-combiner2": "^1.1.1", - "subarg": "^1.0.0", - "through2": "^2.0.0", - "xtend": "^4.0.0" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", - "dev": true - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - }, - "through2": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", - "dev": true, - "requires": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" - } - } - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" - }, - "mute-stdout": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/mute-stdout/-/mute-stdout-1.0.1.tgz", - "integrity": "sha512-kDcwXR4PS7caBpuRYYBUz9iVixUk3anO3f5OYFiIPwK/20vCzKCHyKoulbiDY1S53zD2bxUpxN/IJ+TnXjfvxg==", - "dev": true - }, - "nan": { - "version": "2.17.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.17.0.tgz", - "integrity": "sha512-2ZTgtl0nJsO0KQCjEpxcIr5D+Yv90plTitZt9JBfQvVJDS5seMl3FOvsh3+9CoYWXf/1l5OaZzzF6nDm4cagaQ==" - }, - "nanomatch": { - "version": "1.2.13", - "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", - "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", - "dev": true, - "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "fragment-cache": "^0.2.1", - "is-windows": "^1.0.2", - "kind-of": "^6.0.2", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - } - }, - "napi-build-utils": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz", - "integrity": "sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg==" - }, - "negotiator": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", - "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==", - "dev": true - }, - "next-tick": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz", - "integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=", - "dev": true - }, - "nise": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/nise/-/nise-1.5.0.tgz", - "integrity": "sha512-Z3sfYEkLFzFmL8KY6xnSJLRxwQwYBjOXi/24lb62ZnZiGA0JUzGGTI6TBIgfCSMIDl9Jlu8SRmHNACLTemDHww==", - "dev": true, - "requires": { - "@sinonjs/formatio": "^3.1.0", - "@sinonjs/text-encoding": "^0.7.1", - "just-extend": "^4.0.2", - "lolex": "^4.1.0", - "path-to-regexp": "^1.7.0" - } - }, - "node-abi": { - "version": "3.22.0", - "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.22.0.tgz", - "integrity": "sha512-u4uAs/4Zzmp/jjsD9cyFYDXeISfUWaAVWshPmDZOFOv4Xl4SbzTXm53I04C2uRueYJ+0t5PEtLH/owbn2Npf/w==", - "requires": { - "semver": "^7.3.5" - }, - "dependencies": { - "lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "requires": { - "yallist": "^4.0.0" - } - }, - "semver": { - "version": "7.3.7", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", - "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", - "requires": { - "lru-cache": "^6.0.0" - } - } - } - }, - "node-gyp": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-9.0.0.tgz", - "integrity": "sha512-Ma6p4s+XCTPxCuAMrOA/IJRmVy16R8Sdhtwl4PrCr7IBlj4cPawF0vg/l7nOT1jPbuNS7lIRJpBSvVsXwEZuzw==", - "requires": { - "env-paths": "^2.2.0", - "glob": "^7.1.4", - "graceful-fs": "^4.2.6", - "make-fetch-happen": "^10.0.3", - "nopt": "^5.0.0", - "npmlog": "^6.0.0", - "rimraf": "^3.0.2", - "semver": "^7.3.5", - "tar": "^6.1.2", - "which": "^2.0.2" - }, - "dependencies": { - "lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "requires": { - "yallist": "^4.0.0" - } - }, - "semver": { - "version": "7.3.7", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", - "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", - "requires": { - "lru-cache": "^6.0.0" - } - }, - "which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "requires": { - "isexe": "^2.0.0" - } - } - } - }, - "node-watch": { - "version": "0.7.3", - "resolved": "https://registry.npmjs.org/node-watch/-/node-watch-0.7.3.tgz", - "integrity": "sha512-3l4E8uMPY1HdMMryPRUAl+oIHtXtyiTlIiESNSVSNxcPfzAFzeTbXFQkZfAwBbo0B1qMSG8nUABx+Gd+YrbKrQ==", - "dev": true - }, - "noop-logger": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/noop-logger/-/noop-logger-0.1.1.tgz", - "integrity": "sha512-6kM8CLXvuW5crTxsAtva2YLrRrDaiTIkIePWs9moLHqbFWT94WpNFjwS/5dfLfECg5i/lkmw3aoqVidxt23TEQ==", - "peer": true - }, - "nopt": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", - "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", - "requires": { - "abbrev": "1" - } - }, - "normalize-package-data": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", - "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", - "dev": true, - "requires": { - "hosted-git-info": "^2.1.4", - "resolve": "^1.10.0", - "semver": "2 || 3 || 4 || 5", - "validate-npm-package-license": "^3.0.1" - } - }, - "normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "dev": true - }, - "now-and-later": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/now-and-later/-/now-and-later-2.0.1.tgz", - "integrity": "sha512-KGvQ0cB70AQfg107Xvs/Fbu+dGmZoTRJp2TaPwcwQm3/7PteUyN2BCgk8KBMPGBUXZdVwyWS8fDCGFygBm19UQ==", - "dev": true, - "requires": { - "once": "^1.3.2" - } - }, - "npmlog": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-6.0.2.tgz", - "integrity": "sha512-/vBvz5Jfr9dT/aFWd0FIRf+T/Q2WBsLENygUaFUqstqsycmZAP/t5BvFJTK0viFmSUxiUKTUplWy5vt+rvKIxg==", - "requires": { - "are-we-there-yet": "^3.0.0", - "console-control-strings": "^1.1.0", - "gauge": "^4.0.3", - "set-blocking": "^2.0.0" - } - }, - "number-is-nan": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" - }, - "o-stream": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/o-stream/-/o-stream-0.3.0.tgz", - "integrity": "sha512-gbzl6qCJZ609x/M2t25HqCYQagFzWYCtQ84jcuObGr+V8D1Am4EVubkF4J+XFs6ukfiv96vNeiBb8FrbbMZYiQ==", - "dev": true - }, - "oauth-sign": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", - "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", - "peer": true - }, - "object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" - }, - "object-copy": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", - "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", - "dev": true, - "requires": { - "copy-descriptor": "^0.1.0", - "define-property": "^0.2.5", - "kind-of": "^3.0.3" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "object-keys": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", - "dev": true - }, - "object-visit": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", - "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", - "dev": true, - "requires": { - "isobject": "^3.0.0" - } - }, - "object.assign": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", - "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", - "dev": true, - "requires": { - "define-properties": "^1.1.2", - "function-bind": "^1.1.1", - "has-symbols": "^1.0.0", - "object-keys": "^1.0.11" - } - }, - "object.defaults": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/object.defaults/-/object.defaults-1.1.0.tgz", - "integrity": "sha1-On+GgzS0B96gbaFtiNXNKeQ1/s8=", - "dev": true, - "requires": { - "array-each": "^1.0.1", - "array-slice": "^1.0.0", - "for-own": "^1.0.0", - "isobject": "^3.0.0" - } - }, - "object.map": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/object.map/-/object.map-1.0.1.tgz", - "integrity": "sha1-z4Plncj8wK1fQlDh94s7gb2AHTc=", - "dev": true, - "requires": { - "for-own": "^1.0.0", - "make-iterator": "^1.0.0" - } - }, - "object.pick": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", - "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", - "dev": true, - "requires": { - "isobject": "^3.0.1" - } - }, - "object.reduce": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/object.reduce/-/object.reduce-1.0.1.tgz", - "integrity": "sha1-b+NI8qx/oPlcpiEiZZkJaCW7A60=", - "dev": true, - "requires": { - "for-own": "^1.0.0", - "make-iterator": "^1.0.0" - } - }, - "on-finished": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", - "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", - "dev": true, - "requires": { - "ee-first": "1.1.1" - } - }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "requires": { - "wrappy": "1" - } - }, - "openurl": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/openurl/-/openurl-1.1.1.tgz", - "integrity": "sha512-d/gTkTb1i1GKz5k3XE3XFV/PxQ1k45zDqGP2OA7YhgsaLoqm6qRvARAZOFer1fcXritWlGBRCu/UgeS4HAnXAA==", - "dev": true - }, - "opn": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/opn/-/opn-5.3.0.tgz", - "integrity": "sha512-bYJHo/LOmoTd+pfiYhfZDnf9zekVJrY+cnS2a5F2x+w5ppvTqObojTP7WiFG+kVZs9Inw+qQ/lw7TroWwhdd2g==", - "dev": true, - "requires": { - "is-wsl": "^1.1.0" - } - }, - "ordered-read-streams": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/ordered-read-streams/-/ordered-read-streams-1.0.1.tgz", - "integrity": "sha1-d8DLN8QVJdZBZtmQ/61+xqDhNj4=", - "dev": true, - "requires": { - "readable-stream": "^2.0.1" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, - "os-browserify": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", - "integrity": "sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc=", - "dev": true - }, - "os-homedir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", - "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", - "dev": true - }, - "os-locale": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", - "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", - "dev": true, - "requires": { - "lcid": "^1.0.0" - } - }, - "os-tmpdir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", - "dev": true - }, - "osenv": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz", - "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", - "dev": true, - "requires": { - "os-homedir": "^1.0.0", - "os-tmpdir": "^1.0.0" - } - }, - "p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, - "requires": { - "yocto-queue": "^0.1.0" - } - }, - "p-locate": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", - "dev": true, - "requires": { - "p-limit": "^3.0.2" - } - }, - "p-map": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", - "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", - "requires": { - "aggregate-error": "^3.0.0" - } - }, - "pako": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.10.tgz", - "integrity": "sha512-0DTvPVU3ed8+HNXOu5Bs+o//Mbdj9VNQMUOe9oKCwh8l0GNwpTDMKCWbRjgtD291AWnkAgkqA/LOnQS8AmS1tw==", - "dev": true - }, - "parents": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parents/-/parents-1.0.1.tgz", - "integrity": "sha512-mXKF3xkoUt5td2DoxpLmtOmZvko9VfFpwRwkKDHSNvgmpLAeBo18YDhcPbBzJq+QLCHMbGOfzia2cX4U+0v9Mg==", - "dev": true, - "requires": { - "path-platform": "~0.11.15" - } - }, - "parse-asn1": { - "version": "5.1.4", - "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.4.tgz", - "integrity": "sha512-Qs5duJcuvNExRfFZ99HDD3z4mAi3r9Wl/FOjEOijlxwCZs7E7mW2vjTpgQ4J8LpTF8x5v+1Vn5UQFejmWT11aw==", - "dev": true, - "requires": { - "asn1.js": "^4.0.0", - "browserify-aes": "^1.0.0", - "create-hash": "^1.1.0", - "evp_bytestokey": "^1.0.0", - "pbkdf2": "^3.0.3", - "safe-buffer": "^5.1.1" - } - }, - "parse-filepath": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/parse-filepath/-/parse-filepath-1.0.2.tgz", - "integrity": "sha1-pjISf1Oq89FYdvWHLz/6x2PWyJE=", - "dev": true, - "requires": { - "is-absolute": "^1.0.0", - "map-cache": "^0.2.0", - "path-root": "^0.1.1" - } - }, - "parse-json": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", - "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", - "dev": true, - "requires": { - "error-ex": "^1.2.0" - } - }, - "parse-node-version": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parse-node-version/-/parse-node-version-1.0.1.tgz", - "integrity": "sha512-3YHlOa/JgH6Mnpr05jP9eDG254US9ek25LyIxZlDItp2iJtwyaXQb57lBYLdT3MowkUFYEV2XXNAYIPlESvJlA==", - "dev": true - }, - "parse-passwd": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", - "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=", - "dev": true - }, - "parseurl": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", - "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", - "dev": true - }, - "pascalcase": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", - "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", - "dev": true - }, - "path-browserify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", - "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==", - "dev": true - }, - "path-dirname": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", - "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=", - "dev": true - }, - "path-exists": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", - "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", - "dev": true, - "requires": { - "pinkie-promise": "^2.0.0" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" - }, - "path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true - }, - "path-parse": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", - "dev": true - }, - "path-platform": { - "version": "0.11.15", - "resolved": "https://registry.npmjs.org/path-platform/-/path-platform-0.11.15.tgz", - "integrity": "sha512-Y30dB6rab1A/nfEKsZxmr01nUotHX0c/ZiIAsCTatEe1CmS5Pm5He7fZ195bPT7RdquoaL8lLxFCMQi/bS7IJg==", - "dev": true - }, - "path-root": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/path-root/-/path-root-0.1.1.tgz", - "integrity": "sha1-mkpoFMrBwM1zNgqV8yCDyOpHRbc=", - "dev": true, - "requires": { - "path-root-regex": "^0.1.0" - } - }, - "path-root-regex": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/path-root-regex/-/path-root-regex-0.1.2.tgz", - "integrity": "sha1-v8zcjfWxLcUsi0PsONGNcsBLqW0=", - "dev": true - }, - "path-sort2": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/path-sort2/-/path-sort2-1.0.0.tgz", - "integrity": "sha512-OwUzmr3+avyEANhpUkUv+nlwAM/sCX5y9Ylok8fj3OK3SmLclq7jyEoqSL5qi+5bJAOskWGZPtdtjnoRGy5lxA==", - "dev": true - }, - "path-to-regexp": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.7.0.tgz", - "integrity": "sha1-Wf3g9DW62suhA6hOnTvGTpa5k30=", - "dev": true, - "requires": { - "isarray": "0.0.1" - } - }, - "path-type": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", - "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0" - } - }, - "pbkdf2": { - "version": "3.0.17", - "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.17.tgz", - "integrity": "sha512-U/il5MsrZp7mGg3mSQfn742na2T+1/vHDCG5/iTI3X9MKUuYUZVLQhyRsg06mCgDBTd57TxzgZt7P+fYfjRLtA==", - "dev": true, - "requires": { - "create-hash": "^1.1.2", - "create-hmac": "^1.1.4", - "ripemd160": "^2.0.1", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" - } - }, - "performance-now": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==", - "peer": true - }, - "picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true - }, - "pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", - "dev": true - }, - "pinkie": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", - "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", - "dev": true - }, - "pinkie-promise": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", - "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", - "dev": true, - "requires": { - "pinkie": "^2.0.0" - } - }, - "platform": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/platform/-/platform-1.3.5.tgz", - "integrity": "sha512-TuvHS8AOIZNAlE77WUDiR4rySV/VMptyMfcfeoMgs4P8apaZM3JrnbzBiixKUv+XR6i+BXrQh8WAnjaSPFO65Q==", - "dev": true - }, - "plugin-error": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/plugin-error/-/plugin-error-0.1.2.tgz", - "integrity": "sha1-O5uzM1zPAPQl4HQ34ZJ2ln2kes4=", - "dev": true, - "requires": { - "ansi-cyan": "^0.1.1", - "ansi-red": "^0.1.1", - "arr-diff": "^1.0.1", - "arr-union": "^2.0.1", - "extend-shallow": "^1.1.2" - }, - "dependencies": { - "arr-diff": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-1.1.0.tgz", - "integrity": "sha1-aHwydYFjWI/vfeezb6vklesaOZo=", - "dev": true, - "requires": { - "arr-flatten": "^1.0.1", - "array-slice": "^0.2.3" - } - }, - "arr-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-2.1.0.tgz", - "integrity": "sha1-IPnqtexw9cfSFbEHexw5Fh0pLH0=", - "dev": true - }, - "array-slice": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/array-slice/-/array-slice-0.2.3.tgz", - "integrity": "sha1-3Tz7gO15c6dRF82sabC5nshhhvU=", - "dev": true - }, - "extend-shallow": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-1.1.4.tgz", - "integrity": "sha1-Gda/lN/AnXa6cR85uHLSH/TdkHE=", - "dev": true, - "requires": { - "kind-of": "^1.1.0" - } - }, - "kind-of": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-1.1.0.tgz", - "integrity": "sha1-FAo9LUGjbS78+pN3tiwk+ElaXEQ=", - "dev": true - } - } - }, - "portscanner": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/portscanner/-/portscanner-2.2.0.tgz", - "integrity": "sha512-IFroCz/59Lqa2uBvzK3bKDbDDIEaAY8XJ1jFxcLWTqosrsc32//P4VuSB2vZXoHiHqOmx8B5L5hnKOxL/7FlPw==", - "dev": true, - "requires": { - "async": "^2.6.0", - "is-number-like": "^1.0.3" - } - }, - "posix-character-classes": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", - "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", - "dev": true - }, - "prebuild-install": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.1.tgz", - "integrity": "sha512-jAXscXWMcCK8GgCoHOfIr0ODh5ai8mj63L2nWrjuAgXE6tDyYGnx4/8o/rCgU+B4JSyZBKbeZqzhtwtC3ovxjw==", - "requires": { - "detect-libc": "^2.0.0", - "expand-template": "^2.0.3", - "github-from-package": "0.0.0", - "minimist": "^1.2.3", - "mkdirp-classic": "^0.5.3", - "napi-build-utils": "^1.0.1", - "node-abi": "^3.3.0", - "pump": "^3.0.0", - "rc": "^1.2.7", - "simple-get": "^4.0.0", - "tar-fs": "^2.0.0", - "tunnel-agent": "^0.6.0" - }, - "dependencies": { - "pump": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", - "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - } - } - }, - "pretty-hrtime": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz", - "integrity": "sha1-t+PqQkNaTJsnWdmeDyAesZWALuE=", - "dev": true - }, - "process": { - "version": "0.11.10", - "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", - "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=", - "dev": true - }, - "process-nextick-args": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" - }, - "promise-inflight": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", - "integrity": "sha512-6zWPyEOFaQBJYcGMHBKTKJ3u6TBsnMFOIZSa6ce1e/ZrrsOlnHRHbabMjLiBYKp+n44X9eUI6VUPaukCXHuG4g==" - }, - "promise-retry": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/promise-retry/-/promise-retry-2.0.1.tgz", - "integrity": "sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g==", - "requires": { - "err-code": "^2.0.2", - "retry": "^0.12.0" - } - }, - "proto-list": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz", - "integrity": "sha1-IS1b/hMYMGpCD2QCuOJv85ZHqEk=", - "dev": true - }, - "pseudomap": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", - "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", - "dev": true - }, - "psl": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", - "integrity": "sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==", - "peer": true - }, - "public-encrypt": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz", - "integrity": "sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==", - "dev": true, - "requires": { - "bn.js": "^4.1.0", - "browserify-rsa": "^4.0.0", - "create-hash": "^1.1.0", - "parse-asn1": "^5.0.0", - "randombytes": "^2.0.1", - "safe-buffer": "^5.1.2" - } - }, - "pump": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", - "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", - "dev": true, - "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - }, - "pumpify": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/pumpify/-/pumpify-1.5.1.tgz", - "integrity": "sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ==", - "dev": true, - "requires": { - "duplexify": "^3.6.0", - "inherits": "^2.0.3", - "pump": "^2.0.0" - } - }, - "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", - "peer": true - }, - "qs": { - "version": "6.5.3", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.3.tgz", - "integrity": "sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==", - "peer": true - }, - "querystring": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", - "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=", - "dev": true - }, - "querystring-es3": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz", - "integrity": "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=", - "dev": true - }, - "qunit": { - "version": "2.19.3", - "resolved": "https://registry.npmjs.org/qunit/-/qunit-2.19.3.tgz", - "integrity": "sha512-vEnspSZ37u2oR01OA/IZ1Td5V7BvQYFECdKPv86JaBplDNa5IHg0v7jFSPoP5L5o78Dbi8sl7/ATtpRDAKlSdw==", - "dev": true, - "requires": { - "commander": "7.2.0", - "node-watch": "0.7.3", - "tiny-glob": "0.2.9" - }, - "dependencies": { - "commander": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", - "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", - "dev": true - } - } - }, - "randombytes": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", - "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", - "dev": true, - "requires": { - "safe-buffer": "^5.1.0" - } - }, - "randomfill": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", - "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", - "dev": true, - "requires": { - "randombytes": "^2.0.5", - "safe-buffer": "^5.1.0" - } - }, - "range-parser": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", - "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", - "dev": true - }, - "raw-body": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.1.tgz", - "integrity": "sha512-9WmIKF6mkvA0SLmA2Knm9+qj89e+j1zqgyn8aXGd7+nAduPoqgI9lO57SAZNn/Byzo5P7JhXTyg9PzaJbH73bA==", - "dev": true, - "requires": { - "bytes": "3.1.0", - "http-errors": "1.7.3", - "iconv-lite": "0.4.24", - "unpipe": "1.0.0" - } - }, - "rc": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", - "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", - "requires": { - "deep-extend": "^0.6.0", - "ini": "~1.3.0", - "minimist": "^1.2.0", - "strip-json-comments": "~2.0.1" - } - }, - "read-dir-deep": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/read-dir-deep/-/read-dir-deep-7.0.1.tgz", - "integrity": "sha512-w99fvgqJm3cJ5Vb7b3oGKRDnm/m11q7w5LQ9uBCXe+repIEf1rFtkXLlPAxNrSwlp4skyPyvKd4DNNiIuc0geg==", - "dev": true, - "requires": { - "globby": "^10.0.1", - "is-path-cwd": "^2.2.0", - "is-path-in-cwd": "^3.0.0", - "path-sort2": "^1.0.0", - "slash": "^3.0.0" - } - }, - "read-only-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/read-only-stream/-/read-only-stream-2.0.0.tgz", - "integrity": "sha1-JyT9aoET1zdkrCiNQ4YnDB2/F/A=", - "dev": true, - "requires": { - "readable-stream": "^2.0.2" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, - "read-pkg": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", - "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", - "dev": true, - "requires": { - "load-json-file": "^1.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^1.0.0" - } - }, - "read-pkg-up": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", - "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", - "dev": true, - "requires": { - "find-up": "^1.0.0", - "read-pkg": "^1.0.0" - } - }, - "readable-stream": { - "version": "1.0.34", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", - "integrity": "sha512-ok1qVCJuRkNmvebYikljxJA/UEsKwLl2nI1OmaqAu4/UE+h0wKCHok4XkL/gvi39OacXvw59RJUOFUkDib2rHg==", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "0.0.1", - "string_decoder": "~0.10.x" - } - }, - "readdirp": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", - "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.11", - "micromatch": "^3.1.10", - "readable-stream": "^2.0.2" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, - "rechoir": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", - "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", - "dev": true, - "requires": { - "resolve": "^1.1.6" - } - }, - "regex-not": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", - "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", - "dev": true, - "requires": { - "extend-shallow": "^3.0.2", - "safe-regex": "^1.1.0" - } - }, - "remove-bom-buffer": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/remove-bom-buffer/-/remove-bom-buffer-3.0.0.tgz", - "integrity": "sha512-8v2rWhaakv18qcvNeli2mZ/TMTL2nEyAKRvzo1WtnZBl15SHyEhrCu2/xKlJyUFKHiHgfXIyuY6g2dObJJycXQ==", - "dev": true, - "requires": { - "is-buffer": "^1.1.5", - "is-utf8": "^0.2.1" - } - }, - "remove-bom-stream": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/remove-bom-stream/-/remove-bom-stream-1.2.0.tgz", - "integrity": "sha1-BfGlk/FuQuH7kOv1nejlaVJflSM=", - "dev": true, - "requires": { - "remove-bom-buffer": "^3.0.0", - "safe-buffer": "^5.1.0", - "through2": "^2.0.3" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - }, - "through2": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", - "dev": true, - "requires": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" - } - } - } - }, - "remove-trailing-separator": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", - "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", - "dev": true - }, - "repeat-element": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", - "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==", - "dev": true - }, - "repeat-string": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", - "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", - "dev": true - }, - "replace-ext": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.0.tgz", - "integrity": "sha1-3mMSg3P8v3w8z6TeWkgMRaZ5WOs=", - "dev": true - }, - "replace-homedir": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/replace-homedir/-/replace-homedir-1.0.0.tgz", - "integrity": "sha1-6H9tUTuSjd6AgmDBK+f+xv9ueYw=", - "dev": true, - "requires": { - "homedir-polyfill": "^1.0.1", - "is-absolute": "^1.0.0", - "remove-trailing-separator": "^1.1.0" - } - }, - "replacestream": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/replacestream/-/replacestream-4.0.3.tgz", - "integrity": "sha512-AC0FiLS352pBBiZhd4VXB1Ab/lh0lEgpP+GGvZqbQh8a5cmXVoTe5EX/YeTFArnp4SRGTHh1qCHu9lGs1qG8sA==", - "dev": true, - "requires": { - "escape-string-regexp": "^1.0.3", - "object-assign": "^4.0.1", - "readable-stream": "^2.0.2" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, - "request": { - "version": "2.88.2", - "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", - "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", - "peer": true, - "requires": { - "aws-sign2": "~0.7.0", - "aws4": "^1.8.0", - "caseless": "~0.12.0", - "combined-stream": "~1.0.6", - "extend": "~3.0.2", - "forever-agent": "~0.6.1", - "form-data": "~2.3.2", - "har-validator": "~5.1.3", - "http-signature": "~1.2.0", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.19", - "oauth-sign": "~0.9.0", - "performance-now": "^2.1.0", - "qs": "~6.5.2", - "safe-buffer": "^5.1.2", - "tough-cookie": "~2.5.0", - "tunnel-agent": "^0.6.0", - "uuid": "^3.3.2" - } - }, - "require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", - "dev": true - }, - "require-main-filename": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", - "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", - "dev": true - }, - "requires-port": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", - "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", - "dev": true - }, - "resolve": { - "version": "1.22.1", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz", - "integrity": "sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==", - "dev": true, - "requires": { - "is-core-module": "^2.9.0", - "path-parse": "^1.0.7", - "supports-preserve-symlinks-flag": "^1.0.0" - } - }, - "resolve-dir": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/resolve-dir/-/resolve-dir-1.0.1.tgz", - "integrity": "sha1-eaQGRMNivoLybv/nOcm7U4IEb0M=", - "dev": true, - "requires": { - "expand-tilde": "^2.0.0", - "global-modules": "^1.0.0" - } - }, - "resolve-options": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/resolve-options/-/resolve-options-1.1.0.tgz", - "integrity": "sha1-MrueOcBtZzONyTeMDW1gdFZq0TE=", - "dev": true, - "requires": { - "value-or-function": "^3.0.0" - } - }, - "resolve-url": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", - "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", - "dev": true - }, - "resp-modifier": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/resp-modifier/-/resp-modifier-6.0.2.tgz", - "integrity": "sha1-sSTeXE+6/LpUH0j/pzlw9KpFa08=", - "dev": true, - "requires": { - "debug": "^2.2.0", - "minimatch": "^3.0.2" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - } - } - }, - "ret": { - "version": "0.1.15", - "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", - "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", - "dev": true - }, - "retry": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", - "integrity": "sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==" - }, - "reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "dev": true - }, - "rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "requires": { - "glob": "^7.1.3" - } - }, - "ripemd160": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", - "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", - "dev": true, - "requires": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1" - } - }, - "run-parallel": { - "version": "1.1.9", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.1.9.tgz", - "integrity": "sha512-DEqnSRTDw/Tc3FXf49zedI638Z9onwUotBMiUFKmrO2sdFKIbXamXGQ3Axd4qgphxKB4kw/qP1w5kTxnfU1B9Q==", - "dev": true - }, - "rx": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/rx/-/rx-4.1.0.tgz", - "integrity": "sha1-pfE/957zt0D+MKqAP7CfmIBdR4I=", - "dev": true - }, - "rxjs": { - "version": "5.5.12", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-5.5.12.tgz", - "integrity": "sha512-xx2itnL5sBbqeeiVgNPVuQQ1nC8Jp2WfNJhXWHmElW9YmrpS9UVnNzhP3EH3HFqexO5Tlp8GhYY+WEcqcVMvGw==", - "dev": true, - "requires": { - "symbol-observable": "1.0.1" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "safe-regex": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", - "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", - "dev": true, - "requires": { - "ret": "~0.1.10" - } - }, - "safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" - }, - "semver": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz", - "integrity": "sha1-myzl094C0XxgEq0yaqa00M9U+U8=", - "dev": true - }, - "semver-greatest-satisfied-range": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/semver-greatest-satisfied-range/-/semver-greatest-satisfied-range-1.1.0.tgz", - "integrity": "sha1-E+jCZYq5aRywzXEJMkAoDTb3els=", - "dev": true, - "requires": { - "sver-compat": "^1.5.0" - } - }, - "send": { - "version": "0.16.2", - "resolved": "https://registry.npmjs.org/send/-/send-0.16.2.tgz", - "integrity": "sha512-E64YFPUssFHEFBvpbbjr44NCLtI1AohxQ8ZSiJjQLskAdKuriYEP6VyGEsRDH8ScozGpkaX1BGvhanqCwkcEZw==", - "dev": true, - "requires": { - "debug": "2.6.9", - "depd": "~1.1.2", - "destroy": "~1.0.4", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "fresh": "0.5.2", - "http-errors": "~1.6.2", - "mime": "1.4.1", - "ms": "2.0.0", - "on-finished": "~2.3.0", - "range-parser": "~1.2.0", - "statuses": "~1.4.0" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "http-errors": { - "version": "1.6.3", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", - "integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=", - "dev": true, - "requires": { - "depd": "~1.1.2", - "inherits": "2.0.3", - "setprototypeof": "1.1.0", - "statuses": ">= 1.4.0 < 2" - } - }, - "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", - "dev": true - }, - "setprototypeof": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", - "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==", - "dev": true - }, - "statuses": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz", - "integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew==", - "dev": true - } - } - }, - "serve-index": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/serve-index/-/serve-index-1.9.1.tgz", - "integrity": "sha1-03aNabHn2C5c4FD/9bRTvqEqkjk=", - "dev": true, - "requires": { - "accepts": "~1.3.4", - "batch": "0.6.1", - "debug": "2.6.9", - "escape-html": "~1.0.3", - "http-errors": "~1.6.2", - "mime-types": "~2.1.17", - "parseurl": "~1.3.2" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "http-errors": { - "version": "1.6.3", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", - "integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=", - "dev": true, - "requires": { - "depd": "~1.1.2", - "inherits": "2.0.3", - "setprototypeof": "1.1.0", - "statuses": ">= 1.4.0 < 2" - } - }, - "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", - "dev": true - }, - "setprototypeof": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", - "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==", - "dev": true - }, - "statuses": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", - "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=", - "dev": true - } - } - }, - "serve-static": { - "version": "1.13.2", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.13.2.tgz", - "integrity": "sha512-p/tdJrO4U387R9oMjb1oj7qSMaMfmOyd4j9hOFoxZe2baQszgHcSWjuya/CiT5kgZZKRudHNOA0pYXOl8rQ5nw==", - "dev": true, - "requires": { - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "parseurl": "~1.3.2", - "send": "0.16.2" - } - }, - "server-destroy": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/server-destroy/-/server-destroy-1.0.1.tgz", - "integrity": "sha512-rb+9B5YBIEzYcD6x2VKidaa+cqYBJQKnU4oe4E3ANwRRN56yk/ua1YCJT1n21NTS8w6CcOclAKNP3PhdCXKYtQ==", - "dev": true - }, - "set-blocking": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" - }, - "set-value": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", - "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", - "dev": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-extendable": "^0.1.1", - "is-plain-object": "^2.0.3", - "split-string": "^3.0.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "setprototypeof": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", - "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==", - "dev": true - }, - "sha.js": { - "version": "2.4.11", - "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", - "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "shasum-object": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shasum-object/-/shasum-object-1.0.0.tgz", - "integrity": "sha512-Iqo5rp/3xVi6M4YheapzZhhGPVs0yZwHj7wvwQ1B9z8H6zk+FEnI7y3Teq7qwnekfEhu8WmG2z0z4iWZaxLWVg==", - "dev": true, - "requires": { - "fast-safe-stringify": "^2.0.7" - } - }, - "shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "requires": { - "shebang-regex": "^3.0.0" - } - }, - "shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true - }, - "shell-quote": { - "version": "1.7.3", - "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.7.3.tgz", - "integrity": "sha512-Vpfqwm4EnqGdlsBFNmHhxhElJYrdfcxPThu+ryKS5J8L/fhAwLazFZtq+S+TWZ9ANj2piSQLGj6NQg+lKPmxrw==", - "dev": true - }, - "sigmund": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.1.tgz", - "integrity": "sha1-P/IfGYytIXX587eBhT/ZTQ0ZtZA=", - "dev": true - }, - "signal-exit": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", - "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=" - }, - "simple-concat": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.0.tgz", - "integrity": "sha1-c0TLuLbib7J9ZrL8hvn21Zl1IcY=" - }, - "simple-get": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-4.0.1.tgz", - "integrity": "sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==", - "requires": { - "decompress-response": "^6.0.0", - "once": "^1.3.1", - "simple-concat": "^1.0.0" - } - }, - "sinon": { - "version": "7.3.2", - "resolved": "https://registry.npmjs.org/sinon/-/sinon-7.3.2.tgz", - "integrity": "sha512-thErC1z64BeyGiPvF8aoSg0LEnptSaWE7YhdWWbWXgelOyThent7uKOnnEh9zBxDbKixtr5dEko+ws1sZMuFMA==", - "dev": true, - "requires": { - "@sinonjs/commons": "^1.4.0", - "@sinonjs/formatio": "^3.2.1", - "@sinonjs/samsam": "^3.3.1", - "diff": "^3.5.0", - "lolex": "^4.0.1", - "nise": "^1.4.10", - "supports-color": "^5.5.0" - }, - "dependencies": { - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } - } - }, - "slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true - }, - "smart-buffer": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", - "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==" - }, - "snapdragon": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", - "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", - "dev": true, - "requires": { - "base": "^0.11.1", - "debug": "^2.2.0", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "map-cache": "^0.2.2", - "source-map": "^0.5.6", - "source-map-resolve": "^0.5.0", - "use": "^3.1.0" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "snapdragon-node": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", - "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", - "dev": true, - "requires": { - "define-property": "^1.0.0", - "isobject": "^3.0.0", - "snapdragon-util": "^3.0.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } - } - }, - "snapdragon-util": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", - "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", - "dev": true, - "requires": { - "kind-of": "^3.2.0" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "socket.io": { - "version": "4.5.3", - "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-4.5.3.tgz", - "integrity": "sha512-zdpnnKU+H6mOp7nYRXH4GNv1ux6HL6+lHL8g7Ds7Lj8CkdK1jJK/dlwsKDculbyOHifcJ0Pr/yeXnZQ5GeFrcg==", - "dev": true, - "requires": { - "accepts": "~1.3.4", - "base64id": "~2.0.0", - "debug": "~4.3.2", - "engine.io": "~6.2.0", - "socket.io-adapter": "~2.4.0", - "socket.io-parser": "~4.2.0" - } - }, - "socket.io-adapter": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-2.4.0.tgz", - "integrity": "sha512-W4N+o69rkMEGVuk2D/cvca3uYsvGlMwsySWV447y99gUPghxq42BxqLNMndb+a1mm/5/7NeXVQS7RLa2XyXvYg==", - "dev": true - }, - "socket.io-client": { - "version": "4.5.3", - "resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-4.5.3.tgz", - "integrity": "sha512-I/hqDYpQ6JKwtJOf5ikM+Qz+YujZPMEl6qBLhxiP0nX+TfXKhW4KZZG8lamrD6Y5ngjmYHreESVasVCgi5Kl3A==", - "dev": true, - "requires": { - "@socket.io/component-emitter": "~3.1.0", - "debug": "~4.3.2", - "engine.io-client": "~6.2.3", - "socket.io-parser": "~4.2.0" - } - }, - "socket.io-parser": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.2.1.tgz", - "integrity": "sha512-V4GrkLy+HeF1F/en3SpUaM+7XxYXpuMUWLGde1kSSh5nQMN4hLrbPIkD+otwh6q9R6NOQBN4AMaOZ2zVjui82g==", - "dev": true, - "requires": { - "@socket.io/component-emitter": "~3.1.0", - "debug": "~4.3.1" - } - }, - "socks": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/socks/-/socks-2.6.2.tgz", - "integrity": "sha512-zDZhHhZRY9PxRruRMR7kMhnf3I8hDs4S3f9RecfnGxvcBHQcKcIH/oUcEWffsfl1XxdYlA7nnlGbbTvPz9D8gA==", - "requires": { - "ip": "^1.1.5", - "smart-buffer": "^4.2.0" - } - }, - "socks-proxy-agent": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-7.0.0.tgz", - "integrity": "sha512-Fgl0YPZ902wEsAyiQ+idGd1A7rSFx/ayC1CQVMw5P+EQx2V0SgpGtf6OKFhVjPflPUl9YMmEOnmfjCdMUsygww==", - "requires": { - "agent-base": "^6.0.2", - "debug": "^4.3.3", - "socks": "^2.6.2" - }, - "dependencies": { - "debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "requires": { - "ms": "2.1.2" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - } - } - }, - "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true - }, - "source-map-resolve": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.2.tgz", - "integrity": "sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA==", - "dev": true, - "requires": { - "atob": "^2.1.1", - "decode-uri-component": "^0.2.0", - "resolve-url": "^0.2.1", - "source-map-url": "^0.4.0", - "urix": "^0.1.0" - } - }, - "source-map-support": { - "version": "0.5.21", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", - "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", - "dev": true, - "requires": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } - } - }, - "source-map-url": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", - "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=", - "dev": true - }, - "sparkles": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/sparkles/-/sparkles-1.0.1.tgz", - "integrity": "sha512-dSO0DDYUahUt/0/pD/Is3VIm5TGJjludZ0HVymmhYF6eNA53PVLhnUk0znSYbH8IYBuJdCE+1luR22jNLMaQdw==", - "dev": true - }, - "spdx-correct": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz", - "integrity": "sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==", - "dev": true, - "requires": { - "spdx-expression-parse": "^3.0.0", - "spdx-license-ids": "^3.0.0" - } - }, - "spdx-exceptions": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz", - "integrity": "sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA==", - "dev": true - }, - "spdx-expression-parse": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", - "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", - "dev": true, - "requires": { - "spdx-exceptions": "^2.1.0", - "spdx-license-ids": "^3.0.0" - } - }, - "spdx-license-ids": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz", - "integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q==", - "dev": true - }, - "split-string": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", - "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", - "dev": true, - "requires": { - "extend-shallow": "^3.0.0" - } - }, - "sshpk": { - "version": "1.17.0", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.17.0.tgz", - "integrity": "sha512-/9HIEs1ZXGhSPE8X6Ccm7Nam1z8KcoCqPdI7ecm1N33EzAetWahvQWVqLZtaZQ+IDKX4IyA2o0gBzqIMkAagHQ==", - "peer": true, - "requires": { - "asn1": "~0.2.3", - "assert-plus": "^1.0.0", - "bcrypt-pbkdf": "^1.0.0", - "dashdash": "^1.12.0", - "ecc-jsbn": "~0.1.1", - "getpass": "^0.1.1", - "jsbn": "~0.1.0", - "safer-buffer": "^2.0.2", - "tweetnacl": "~0.14.0" - } - }, - "ssri": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/ssri/-/ssri-9.0.1.tgz", - "integrity": "sha512-o57Wcn66jMQvfHG1FlYbWeZWW/dHZhJXjpIcTfXldXEk5nz5lStPo3mK0OJQfGR3RbZUlbISexbljkJzuEj/8Q==", - "requires": { - "minipass": "^3.1.1" - } - }, - "stack-trace": { - "version": "0.0.10", - "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz", - "integrity": "sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA=", - "dev": true - }, - "static-extend": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", - "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", - "dev": true, - "requires": { - "define-property": "^0.2.5", - "object-copy": "^0.1.0" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - } - } - }, - "statuses": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.3.1.tgz", - "integrity": "sha1-+vUbnrdKrvOzrPStX2Gr8ky3uT4=", - "dev": true - }, - "stream-browserify": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-3.0.0.tgz", - "integrity": "sha512-H73RAHsVBapbim0tU2JwwOiXUj+fikfiaoYAKHF3VJfA0pe2BCzkhAHBlLG6REzE+2WNZcxOXjK7lkso+9euLA==", - "dev": true, - "requires": { - "inherits": "~2.0.4", - "readable-stream": "^3.5.0" - }, - "dependencies": { - "readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - }, - "safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true - }, - "string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dev": true, - "requires": { - "safe-buffer": "~5.2.0" - } - } - } - }, - "stream-combiner2": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/stream-combiner2/-/stream-combiner2-1.1.1.tgz", - "integrity": "sha512-3PnJbYgS56AeWgtKF5jtJRT6uFJe56Z0Hc5Ngg/6sI6rIt8iiMBTa9cvdyFfpMQjaVHr8dusbNeFGIIonxOvKw==", - "dev": true, - "requires": { - "duplexer2": "~0.1.0", - "readable-stream": "^2.0.2" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", - "dev": true - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, - "stream-exhaust": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/stream-exhaust/-/stream-exhaust-1.0.2.tgz", - "integrity": "sha512-b/qaq/GlBK5xaq1yrK9/zFcyRSTNxmcZwFLGSTG0mXgZl/4Z6GgiyYOXOvY7N3eEvFRAG1bkDRz5EPGSvPYQlw==", - "dev": true - }, - "stream-http": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-3.2.0.tgz", - "integrity": "sha512-Oq1bLqisTyK3TSCXpPbT4sdeYNdmyZJv1LxpEm2vu1ZhK89kSE5YXwZc3cWk0MagGaKriBh9mCFbVGtO+vY29A==", - "dev": true, - "requires": { - "builtin-status-codes": "^3.0.0", - "inherits": "^2.0.4", - "readable-stream": "^3.6.0", - "xtend": "^4.0.2" - }, - "dependencies": { - "readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - }, - "safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true - }, - "string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dev": true, - "requires": { - "safe-buffer": "~5.2.0" - } - } - } - }, - "stream-shift": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.0.tgz", - "integrity": "sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI=", - "dev": true - }, - "stream-splicer": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/stream-splicer/-/stream-splicer-2.0.1.tgz", - "integrity": "sha512-Xizh4/NPuYSyAXyT7g8IvdJ9HJpxIGL9PjyhtywCZvvP0OPIdqyrr4dMikeuvY8xahpdKEBlBTySe583totajg==", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "readable-stream": "^2.0.2" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, - "stream-throttle": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/stream-throttle/-/stream-throttle-0.1.3.tgz", - "integrity": "sha512-889+B9vN9dq7/vLbGyuHeZ6/ctf5sNuGWsDy89uNxkFTAgzy0eK7+w5fL3KLNRTkLle7EgZGvHUphZW0Q26MnQ==", - "dev": true, - "requires": { - "commander": "^2.2.0", - "limiter": "^1.0.5" - } - }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==" - }, - "string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "requires": { - "ansi-regex": "^2.0.0" - } - }, - "strip-bom": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", - "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", - "dev": true, - "requires": { - "is-utf8": "^0.2.0" - } - }, - "strip-json-comments": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=" - }, - "subarg": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/subarg/-/subarg-1.0.0.tgz", - "integrity": "sha512-RIrIdRY0X1xojthNcVtgT9sjpOGagEUKpZdgBUi054OEPFo282yg+zE+t1Rj3+RqKq2xStL7uUHhY+AjbC4BXg==", - "dev": true, - "requires": { - "minimist": "^1.1.0" - } - }, - "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", - "dev": true - }, - "supports-preserve-symlinks-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", - "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", - "dev": true - }, - "sver-compat": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/sver-compat/-/sver-compat-1.5.0.tgz", - "integrity": "sha1-PPh9/rTQe0o/FIJ7wYaz/QxkXNg=", - "dev": true, - "requires": { - "es6-iterator": "^2.0.1", - "es6-symbol": "^3.1.1" - } - }, - "symbol-observable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.0.1.tgz", - "integrity": "sha512-Kb3PrPYz4HanVF1LVGuAdW6LoVgIwjUYJGzFe7NDrBLCN4lsV/5J0MFurV+ygS4bRVwrCEt2c7MQ1R2a72oJDw==", - "dev": true - }, - "syntax-error": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/syntax-error/-/syntax-error-1.4.0.tgz", - "integrity": "sha512-YPPlu67mdnHGTup2A8ff7BC2Pjq0e0Yp/IyTFN03zWO0RcK07uLcbi7C2KpGR2FvWbaB0+bfE27a+sBKebSo7w==", - "dev": true, - "requires": { - "acorn-node": "^1.2.0" - } - }, - "tar": { - "version": "6.1.12", - "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.12.tgz", - "integrity": "sha512-jU4TdemS31uABHd+Lt5WEYJuzn+TJTCBLljvIAHZOz6M9Os5pJ4dD+vRFLxPa/n3T0iEFzpi+0x1UfuDZYbRMw==", - "requires": { - "chownr": "^2.0.0", - "fs-minipass": "^2.0.0", - "minipass": "^3.0.0", - "minizlib": "^2.1.1", - "mkdirp": "^1.0.3", - "yallist": "^4.0.0" - }, - "dependencies": { - "mkdirp": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", - "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==" - } - } - }, - "tar-fs": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz", - "integrity": "sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==", - "requires": { - "chownr": "^1.1.1", - "mkdirp-classic": "^0.5.2", - "pump": "^3.0.0", - "tar-stream": "^2.1.4" - }, - "dependencies": { - "chownr": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", - "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==" - }, - "pump": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", - "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - } - } - }, - "tar-stream": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", - "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", - "requires": { - "bl": "^4.0.3", - "end-of-stream": "^1.4.1", - "fs-constants": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^3.1.1" - }, - "dependencies": { - "base64-js": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", - "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==" - }, - "bl": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", - "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", - "requires": { - "buffer": "^5.5.0", - "inherits": "^2.0.4", - "readable-stream": "^3.4.0" - } - }, - "buffer": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", - "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", - "requires": { - "base64-js": "^1.3.1", - "ieee754": "^1.1.13" - } - }, - "readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - }, - "safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" - }, - "string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "requires": { - "safe-buffer": "~5.2.0" - } - } - } - }, - "terser": { - "version": "5.15.1", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.15.1.tgz", - "integrity": "sha512-K1faMUvpm/FBxjBXud0LWVAGxmvoPbZbfTCYbSgaaYQaIXI3/TdI7a7ZGA73Zrou6Q8Zmz3oeUTsp/dj+ag2Xw==", - "dev": true, - "requires": { - "@jridgewell/source-map": "^0.3.2", - "acorn": "^8.5.0", - "commander": "^2.20.0", - "source-map-support": "~0.5.20" - }, - "dependencies": { - "acorn": { - "version": "8.8.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.1.tgz", - "integrity": "sha512-7zFpHzhnqYKrkYdUjF1HI1bzd0VygEGX8lFk4k5zVMqHEoES+P+7TKI+EvLO9WVMJ8eekdO0aDEK044xTXwPPA==", - "dev": true - } - } - }, - "test-exclude": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", - "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", - "dev": true, - "requires": { - "@istanbuljs/schema": "^0.1.2", - "glob": "^7.1.4", - "minimatch": "^3.0.4" - } - }, - "textextensions": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/textextensions/-/textextensions-2.4.0.tgz", - "integrity": "sha512-qftQXnX1DzpSV8EddtHIT0eDDEiBF8ywhFYR2lI9xrGtxqKN+CvLXhACeCIGbCpQfxxERbrkZEFb8cZcDKbVZA==", - "dev": true - }, - "tfunk": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/tfunk/-/tfunk-4.0.0.tgz", - "integrity": "sha512-eJQ0dGfDIzWNiFNYFVjJ+Ezl/GmwHaFTBTjrtqNPW0S7cuVDBrZrmzUz6VkMeCR4DZFqhd4YtLwsw3i2wYHswQ==", - "dev": true, - "requires": { - "chalk": "^1.1.3", - "dlv": "^1.1.3" - } - }, - "through": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", - "dev": true - }, - "through2": { - "version": "0.6.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-0.6.5.tgz", - "integrity": "sha512-RkK/CCESdTKQZHdmKICijdKKsCRVHs5KsLZ6pACAmF/1GPUQhonHSXWNERctxEp7RmvjdNbZTL5z9V7nSCXKcg==", - "requires": { - "readable-stream": ">=1.0.33-1 <1.1.0-0", - "xtend": ">=4.0.0 <4.1.0-0" - } - }, - "through2-filter": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/through2-filter/-/through2-filter-3.0.0.tgz", - "integrity": "sha512-jaRjI2WxN3W1V8/FMZ9HKIBXixtiqs3SQSX4/YGIiP3gL6djW48VoZq9tDqeCWs3MT8YY5wb/zli8VW8snY1CA==", - "dev": true, - "requires": { - "through2": "~2.0.0", - "xtend": "~4.0.0" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - }, - "through2": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", - "dev": true, - "requires": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" - } - } - } - }, - "time-stamp": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/time-stamp/-/time-stamp-1.1.0.tgz", - "integrity": "sha1-dkpaEa9QVhkhsTPztE5hhofg9cM=", - "dev": true - }, - "timers-browserify": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-1.4.2.tgz", - "integrity": "sha1-ycWLV1voQHN1y14kYtrO50NZ9B0=", - "dev": true, - "requires": { - "process": "~0.11.0" - } - }, - "tiny-glob": { - "version": "0.2.9", - "resolved": "https://registry.npmjs.org/tiny-glob/-/tiny-glob-0.2.9.tgz", - "integrity": "sha512-g/55ssRPUjShh+xkfx9UPDXqhckHEsHr4Vd9zX55oSdGZc/MD0m3sferOkwWtp98bv+kcVfEHtRJgBVJzelrzg==", - "dev": true, - "requires": { - "globalyzer": "0.1.0", - "globrex": "^0.1.2" - } - }, - "to-absolute-glob": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/to-absolute-glob/-/to-absolute-glob-2.0.2.tgz", - "integrity": "sha1-GGX0PZ50sIItufFFt4z/fQ98hJs=", - "dev": true, - "requires": { - "is-absolute": "^1.0.0", - "is-negated-glob": "^1.0.0" - } - }, - "to-object-path": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", - "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "to-regex": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", - "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", - "dev": true, - "requires": { - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "regex-not": "^1.0.2", - "safe-regex": "^1.1.0" - } - }, - "to-regex-range": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", - "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", - "dev": true, - "requires": { - "is-number": "^3.0.0", - "repeat-string": "^1.6.1" - } - }, - "to-through": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/to-through/-/to-through-2.0.0.tgz", - "integrity": "sha1-/JKtq6ByZHvAtn1rA2ZKoZUJOvY=", - "dev": true, - "requires": { - "through2": "^2.0.3" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - }, - "through2": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", - "dev": true, - "requires": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" - } - } - } - }, - "toidentifier": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", - "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==", - "dev": true - }, - "tough-cookie": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", - "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", - "peer": true, - "requires": { - "psl": "^1.1.28", - "punycode": "^2.1.1" - } - }, - "tty-browserify": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.1.tgz", - "integrity": "sha512-C3TaO7K81YvjCgQH9Q1S3R3P3BtN3RIM8n+OvX4il1K1zgE8ZhI0op7kClgkxtutIE8hQrcrHBXvIheqKUUCxw==", - "dev": true - }, - "tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", - "requires": { - "safe-buffer": "^5.0.1" - } - }, - "tweetnacl": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==", - "peer": true - }, - "type": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/type/-/type-1.0.1.tgz", - "integrity": "sha512-MAM5dBMJCJNKs9E7JXo4CXRAansRfG0nlJxW7Wf6GZzSOvH31zClSaHdIMWLehe/EGMBkqeC55rrkaOr5Oo7Nw==", - "dev": true - }, - "type-detect": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", - "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", - "dev": true - }, - "typedarray": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", - "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", - "dev": true - }, - "typescript": { - "version": "4.9.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.3.tgz", - "integrity": "sha512-CIfGzTelbKNEnLpLdGFgdyKhG23CKdKgQPOBc+OUNrkJ2vr+KSzsSV5kq5iWhEQbok+quxgGzrAtGWCyU7tHnA==", - "dev": true - }, - "ua-parser-js": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-1.0.2.tgz", - "integrity": "sha512-00y/AXhx0/SsnI51fTc0rLRmafiGOM4/O+ny10Ps7f+j/b8p/ZY11ytMgznXkOVo4GQ+KwQG5UQLkLGirsACRg==", - "dev": true - }, - "umd": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/umd/-/umd-3.0.3.tgz", - "integrity": "sha512-4IcGSufhFshvLNcMCV80UnQVlZ5pMOC8mvNPForqwA4+lzYQuetTESLDQkeLmihq8bRcnpbQa48Wb8Lh16/xow==", - "dev": true - }, - "unc-path-regex": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/unc-path-regex/-/unc-path-regex-0.1.2.tgz", - "integrity": "sha1-5z3T17DXxe2G+6xrCufYxqadUPo=", - "dev": true - }, - "undeclared-identifiers": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/undeclared-identifiers/-/undeclared-identifiers-1.1.3.tgz", - "integrity": "sha512-pJOW4nxjlmfwKApE4zvxLScM/njmwj/DiUBv7EabwE4O8kRUy+HIwxQtZLBPll/jx1LJyBcqNfB3/cpv9EZwOw==", - "dev": true, - "requires": { - "acorn-node": "^1.3.0", - "dash-ast": "^1.0.0", - "get-assigned-identifiers": "^1.2.0", - "simple-concat": "^1.0.0", - "xtend": "^4.0.1" - } - }, - "undertaker": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/undertaker/-/undertaker-1.2.1.tgz", - "integrity": "sha512-71WxIzDkgYk9ZS+spIB8iZXchFhAdEo2YU8xYqBYJ39DIUIqziK78ftm26eecoIY49X0J2MLhG4hr18Yp6/CMA==", - "dev": true, - "requires": { - "arr-flatten": "^1.0.1", - "arr-map": "^2.0.0", - "bach": "^1.0.0", - "collection-map": "^1.0.0", - "es6-weak-map": "^2.0.1", - "last-run": "^1.1.0", - "object.defaults": "^1.0.0", - "object.reduce": "^1.0.0", - "undertaker-registry": "^1.0.0" - } - }, - "undertaker-registry": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/undertaker-registry/-/undertaker-registry-1.0.1.tgz", - "integrity": "sha1-XkvaMI5KiirlhPm5pDWaSZglzFA=", - "dev": true - }, - "union-value": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", - "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", - "dev": true, - "requires": { - "arr-union": "^3.1.0", - "get-value": "^2.0.6", - "is-extendable": "^0.1.1", - "set-value": "^2.0.1" - } - }, - "unique-filename": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz", - "integrity": "sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ==", - "requires": { - "unique-slug": "^2.0.0" - } - }, - "unique-slug": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.2.tgz", - "integrity": "sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w==", - "requires": { - "imurmurhash": "^0.1.4" - } - }, - "unique-stream": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/unique-stream/-/unique-stream-2.3.1.tgz", - "integrity": "sha512-2nY4TnBE70yoxHkDli7DMazpWiP7xMdCYqU2nBRO0UB+ZpEkGsSija7MvmvnZFUeC+mrgiUfcHSr3LmRFIg4+A==", - "dev": true, - "requires": { - "json-stable-stringify-without-jsonify": "^1.0.1", - "through2-filter": "^3.0.0" - } - }, - "universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", - "dev": true - }, - "unpipe": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", - "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=", - "dev": true - }, - "unset-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", - "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", - "dev": true, - "requires": { - "has-value": "^0.3.1", - "isobject": "^3.0.0" - }, - "dependencies": { - "has-value": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", - "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", - "dev": true, - "requires": { - "get-value": "^2.0.3", - "has-values": "^0.1.4", - "isobject": "^2.0.0" - }, - "dependencies": { - "isobject": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", - "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", - "dev": true, - "requires": { - "isarray": "1.0.0" - } - } - } - }, - "has-values": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", - "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", - "dev": true - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - } - } - }, - "upath": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/upath/-/upath-1.2.0.tgz", - "integrity": "sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg==", - "dev": true - }, - "uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "peer": true, - "requires": { - "punycode": "^2.1.0" - } - }, - "urix": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", - "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", - "dev": true - }, - "url": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", - "integrity": "sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=", - "dev": true, - "requires": { - "punycode": "1.3.2", - "querystring": "0.2.0" - }, - "dependencies": { - "punycode": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", - "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=", - "dev": true - } - } - }, - "use": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", - "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", - "dev": true - }, - "util": { - "version": "0.12.5", - "resolved": "https://registry.npmjs.org/util/-/util-0.12.5.tgz", - "integrity": "sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "is-arguments": "^1.0.4", - "is-generator-function": "^1.0.7", - "is-typed-array": "^1.1.3", - "which-typed-array": "^1.1.2" - } - }, - "util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" - }, - "utils-merge": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", - "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=", - "dev": true - }, - "uuid": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", - "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", - "peer": true - }, - "v8-to-istanbul": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.0.1.tgz", - "integrity": "sha512-74Y4LqY74kLE6IFyIjPtkSTWzUZmj8tdHT9Ii/26dvQ6K9Dl2NbEfj0XgU2sHCtKgt5VupqhlO/5aWuqS+IY1w==", - "dev": true, - "requires": { - "@jridgewell/trace-mapping": "^0.3.12", - "@types/istanbul-lib-coverage": "^2.0.1", - "convert-source-map": "^1.6.0" - }, - "dependencies": { - "convert-source-map": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", - "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", - "dev": true - } - } - }, - "v8flags": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/v8flags/-/v8flags-3.1.3.tgz", - "integrity": "sha512-amh9CCg3ZxkzQ48Mhcb8iX7xpAfYJgePHxWMQCBWECpOSqJUXgY26ncA61UTV0BkPqfhcy6mzwCIoP4ygxpW8w==", - "dev": true, - "requires": { - "homedir-polyfill": "^1.0.1" - } - }, - "validate-npm-package-license": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", - "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", - "dev": true, - "requires": { - "spdx-correct": "^3.0.0", - "spdx-expression-parse": "^3.0.0" - } - }, - "value-or-function": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/value-or-function/-/value-or-function-3.0.0.tgz", - "integrity": "sha1-HCQ6ULWVwb5Up1S/7OhWO5/42BM=", - "dev": true - }, - "vary": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", - "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", - "dev": true - }, - "verror": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw==", - "peer": true, - "requires": { - "assert-plus": "^1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "^1.2.0" - } - }, - "vinyl": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-2.2.1.tgz", - "integrity": "sha512-LII3bXRFBZLlezoG5FfZVcXflZgWP/4dCwKtxd5ky9+LOtM4CS3bIRQsmR1KMnMW07jpE8fqR2lcxPZ+8sJIcw==", - "dev": true, - "requires": { - "clone": "^2.1.1", - "clone-buffer": "^1.0.0", - "clone-stats": "^1.0.0", - "cloneable-readable": "^1.0.0", - "remove-trailing-separator": "^1.0.1", - "replace-ext": "^1.0.0" - } - }, - "vinyl-buffer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/vinyl-buffer/-/vinyl-buffer-1.0.1.tgz", - "integrity": "sha1-lsGjR5uMU5JULGEgKQE7Wyf4i78=", - "dev": true, - "requires": { - "bl": "^1.2.1", - "through2": "^2.0.3" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - }, - "through2": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", - "dev": true, - "requires": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" - } - } - } - }, - "vinyl-fs": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/vinyl-fs/-/vinyl-fs-3.0.3.tgz", - "integrity": "sha512-vIu34EkyNyJxmP0jscNzWBSygh7VWhqun6RmqVfXePrOwi9lhvRs//dOaGOTRUQr4tx7/zd26Tk5WeSVZitgng==", - "dev": true, - "requires": { - "fs-mkdirp-stream": "^1.0.0", - "glob-stream": "^6.1.0", - "graceful-fs": "^4.0.0", - "is-valid-glob": "^1.0.0", - "lazystream": "^1.0.0", - "lead": "^1.0.0", - "object.assign": "^4.0.4", - "pumpify": "^1.3.5", - "readable-stream": "^2.3.3", - "remove-bom-buffer": "^3.0.0", - "remove-bom-stream": "^1.2.0", - "resolve-options": "^1.1.0", - "through2": "^2.0.0", - "to-through": "^2.0.0", - "value-or-function": "^3.0.0", - "vinyl": "^2.0.0", - "vinyl-sourcemap": "^1.1.0" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - }, - "through2": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", - "dev": true, - "requires": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" - } - } - } - }, - "vinyl-source-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/vinyl-source-stream/-/vinyl-source-stream-2.0.0.tgz", - "integrity": "sha1-84pa+53R6Ttl1VBGmsYYKsT1S44=", - "dev": true, - "requires": { - "through2": "^2.0.3", - "vinyl": "^2.1.0" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - }, - "through2": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", - "dev": true, - "requires": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" - } - } - } - }, - "vinyl-sourcemap": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/vinyl-sourcemap/-/vinyl-sourcemap-1.1.0.tgz", - "integrity": "sha1-kqgAWTo4cDqM2xHYswCtS+Y7PhY=", - "dev": true, - "requires": { - "append-buffer": "^1.0.2", - "convert-source-map": "^1.5.0", - "graceful-fs": "^4.1.6", - "normalize-path": "^2.1.1", - "now-and-later": "^2.0.0", - "remove-bom-buffer": "^3.0.0", - "vinyl": "^2.0.0" - }, - "dependencies": { - "convert-source-map": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.6.0.tgz", - "integrity": "sha512-eFu7XigvxdZ1ETfbgPBohgyQ/Z++C0eEhTor0qRwBw9unw+L0/6V8wkSuGgzdThkiS5lSpdptOQPD8Ak40a+7A==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.1" - } - }, - "normalize-path": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", - "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", - "dev": true, - "requires": { - "remove-trailing-separator": "^1.0.1" - } - } - } - }, - "vinyl-sourcemaps-apply": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/vinyl-sourcemaps-apply/-/vinyl-sourcemaps-apply-0.2.1.tgz", - "integrity": "sha1-q2VJ1h0XLCsbh75cUI0jnI74dwU=", - "dev": true, - "requires": { - "source-map": "^0.5.1" - } - }, - "vm-browserify": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.0.tgz", - "integrity": "sha512-iq+S7vZJE60yejDYM0ek6zg308+UZsdtPExWP9VZoCFCz1zkJoXFnAX7aZfd/ZwrkidzdUZL0C/ryW+JwAiIGw==", - "dev": true - }, - "webgpu": { - "version": "0.1.16", - "resolved": "https://registry.npmjs.org/webgpu/-/webgpu-0.1.16.tgz", - "integrity": "sha512-KAXn/f8lnL8o4B718zzdfi1l0nEWQpuoWlC1L5WM/svAbeHjShCEI0l5ZcZBEEUm9FF3ZTgRjWk8iwbJfnGKTA==" - }, - "which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dev": true, - "requires": { - "isexe": "^2.0.0" - } - }, - "which-module": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz", - "integrity": "sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8=", - "dev": true - }, - "which-pm-runs": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/which-pm-runs/-/which-pm-runs-1.1.0.tgz", - "integrity": "sha512-n1brCuqClxfFfq/Rb0ICg9giSZqCS+pLtccdag6C2HyufBrh3fBOiy9nb6ggRMvWOVH5GrdJskj5iGTZNxd7SA==", - "peer": true - }, - "which-typed-array": { - "version": "1.1.9", - "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.9.tgz", - "integrity": "sha512-w9c4xkx6mPidwp7180ckYWfMmvxpjlZuIudNtDf4N/tTAUB8VJbX25qZoAsrtGuYNnGw3pa0AXgbGKRB8/EceA==", - "dev": true, - "requires": { - "available-typed-arrays": "^1.0.5", - "call-bind": "^1.0.2", - "for-each": "^0.3.3", - "gopd": "^1.0.1", - "has-tostringtag": "^1.0.0", - "is-typed-array": "^1.1.10" - } - }, - "wide-align": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", - "integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==", - "requires": { - "string-width": "^1.0.2 || 2 || 3 || 4" - } - }, - "wrap-ansi": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", - "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", - "dev": true, - "requires": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1" - } - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" - }, - "ws": { - "version": "8.2.3", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.2.3.tgz", - "integrity": "sha512-wBuoj1BDpC6ZQ1B7DWQBYVLphPWkm8i9Y0/3YdHjHKHiohOJ1ws+3OccDWtH+PoC9DZD5WOTrJvNbWvjS6JWaA==", - "dev": true, - "requires": {} - }, - "xmlhttprequest-ssl": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/xmlhttprequest-ssl/-/xmlhttprequest-ssl-2.0.0.tgz", - "integrity": "sha512-QKxVRxiRACQcVuQEYFsI1hhkrMlrXHPegbbd1yn9UHOmRxY+si12nQYzri3vbzt8VdTTRviqcKxcyllFas5z2A==", - "dev": true - }, - "xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" - }, - "y18n": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.2.tgz", - "integrity": "sha512-uGZHXkHnhF0XeeAPgnKfPv1bgKAYyVvmNL1xlKsPYZPaIHxGti2hHqvOCQv71XMsLxu1QjergkqogUnms5D3YQ==", - "dev": true - }, - "yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" - }, - "yargs": { - "version": "17.6.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.6.2.tgz", - "integrity": "sha512-1/9UrdHjDZc0eOU0HxOHoS78C69UD3JRMvzlJ7S79S2nTaWRA/whGCTV8o9e/N/1Va9YIV7Q4sOxD8VV4pCWOw==", - "dev": true, - "requires": { - "cliui": "^8.0.1", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.3", - "y18n": "^5.0.5", - "yargs-parser": "^21.1.1" - }, - "dependencies": { - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true - }, - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "cliui": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", - "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", - "dev": true, - "requires": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.1", - "wrap-ansi": "^7.0.0" - } - }, - "get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true - }, - "string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - } - }, - "strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.1" - } - }, - "wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, - "requires": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - } - }, - "y18n": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", - "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", - "dev": true - }, - "yargs-parser": { - "version": "21.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", - "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", - "dev": true - } - } - }, - "yargs-parser": { - "version": "20.2.9", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", - "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", - "dev": true - }, - "yocto-queue": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", - "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", - "dev": true - } - } -} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml new file mode 100644 index 00000000..00c29506 --- /dev/null +++ b/pnpm-lock.yaml @@ -0,0 +1,5488 @@ +lockfileVersion: 5.4 + +specifiers: + acorn: ^7.1.1 + benchmark: ^2.1.4 + browser-sync: ^2.26.7 + browserify: ^17.0.0 + c8: ^7.12.0 + gl: ^5.0.3 + gl-wiretap: ^0.6.2 + gpu-mock.js: ^1.3.0 + gulp: ^4.0.0 + gulp-concat: ^2.6.0 + gulp-header: ^1.7.1 + gulp-jsbeautifier: ^2.1.0 + gulp-rename: ^1.2.2 + gulp-replace: ^1.0.0 + gulp-strip-comments: ^2.4.5 + gulp-uglify-es: ^3.0.0 + merge-stream: ^1.0.1 + qunit: ^2.9.1 + read-dir-deep: ^7.0.1 + sinon: ^7.3.2 + vinyl-buffer: ^1.0.0 + vinyl-source-stream: ^2.0.0 + webgpu: ^0.1.16 + +dependencies: + acorn: 7.4.1 + gl: 5.0.3 + gl-wiretap: 0.6.2 + gpu-mock.js: 1.3.1 + webgpu: 0.1.16 + +devDependencies: + benchmark: 2.1.4 + browser-sync: 2.27.11 + browserify: 17.0.0 + c8: 7.12.0 + gulp: 4.0.2 + gulp-concat: 2.6.1 + gulp-header: 1.8.12 + gulp-jsbeautifier: 2.1.2 + gulp-rename: 1.4.0 + gulp-replace: 1.1.4 + gulp-strip-comments: 2.5.2 + gulp-uglify-es: 3.0.0 + merge-stream: 1.0.1 + qunit: 2.19.4 + read-dir-deep: 7.0.1 + sinon: 7.5.0 + vinyl-buffer: 1.0.1 + vinyl-source-stream: 2.0.0 + +packages: + + /@bcoe/v8-coverage/0.2.3: + resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==} + dev: true + + /@gar/promisify/1.1.3: + resolution: {integrity: sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw==} + dev: false + + /@istanbuljs/schema/0.1.3: + resolution: {integrity: sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==} + engines: {node: '>=8'} + dev: true + + /@jridgewell/gen-mapping/0.3.2: + resolution: {integrity: sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A==} + engines: {node: '>=6.0.0'} + dependencies: + '@jridgewell/set-array': 1.1.2 + '@jridgewell/sourcemap-codec': 1.4.14 + '@jridgewell/trace-mapping': 0.3.17 + dev: true + + /@jridgewell/resolve-uri/3.1.0: + resolution: {integrity: sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==} + engines: {node: '>=6.0.0'} + dev: true + + /@jridgewell/set-array/1.1.2: + resolution: {integrity: sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==} + engines: {node: '>=6.0.0'} + dev: true + + /@jridgewell/source-map/0.3.2: + resolution: {integrity: sha512-m7O9o2uR8k2ObDysZYzdfhb08VuEml5oWGiosa1VdaPZ/A6QyPkAJuwN0Q1lhULOf6B7MtQmHENS743hWtCrgw==} + dependencies: + '@jridgewell/gen-mapping': 0.3.2 + '@jridgewell/trace-mapping': 0.3.17 + dev: true + + /@jridgewell/sourcemap-codec/1.4.14: + resolution: {integrity: sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==} + dev: true + + /@jridgewell/trace-mapping/0.3.17: + resolution: {integrity: sha512-MCNzAp77qzKca9+W/+I0+sEpaUnZoeasnghNeVc41VZCEKaCH73Vq3BZZ/SzWIgrqE4H4ceI+p+b6C0mHf9T4g==} + dependencies: + '@jridgewell/resolve-uri': 3.1.0 + '@jridgewell/sourcemap-codec': 1.4.14 + dev: true + + /@nodelib/fs.scandir/2.1.5: + resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} + engines: {node: '>= 8'} + dependencies: + '@nodelib/fs.stat': 2.0.5 + run-parallel: 1.2.0 + dev: true + + /@nodelib/fs.stat/2.0.5: + resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} + engines: {node: '>= 8'} + dev: true + + /@nodelib/fs.walk/1.2.8: + resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} + engines: {node: '>= 8'} + dependencies: + '@nodelib/fs.scandir': 2.1.5 + fastq: 1.15.0 + dev: true + + /@npmcli/fs/2.1.2: + resolution: {integrity: sha512-yOJKRvohFOaLqipNtwYB9WugyZKhC/DZC4VYPmpaCzDBrA8YpK3qHZ8/HGscMnE4GqbkLNuVcCnxkeQEdGt6LQ==} + engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} + dependencies: + '@gar/promisify': 1.1.3 + semver: 7.3.8 + dev: false + + /@npmcli/move-file/2.0.1: + resolution: {integrity: sha512-mJd2Z5TjYWq/ttPLLGqArdtnC74J6bOzg4rMDnN+p1xTacZ2yPRCk2y0oSWQtygLR9YVQXgOcONrwtnk3JupxQ==} + engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} + deprecated: This functionality has been moved to @npmcli/fs + dependencies: + mkdirp: 1.0.4 + rimraf: 3.0.2 + dev: false + + /@sinonjs/commons/1.8.6: + resolution: {integrity: sha512-Ky+XkAkqPZSm3NLBeUng77EBQl3cmeJhITaGHdYH8kjVB+aun3S4XBRti2zt17mtt0mIUDiNxYeoJm6drVvBJQ==} + dependencies: + type-detect: 4.0.8 + dev: true + + /@sinonjs/formatio/3.2.2: + resolution: {integrity: sha512-B8SEsgd8gArBLMD6zpRw3juQ2FVSsmdd7qlevyDqzS9WTCtvF55/gAL+h6gue8ZvPYcdiPdvueM/qm//9XzyTQ==} + dependencies: + '@sinonjs/commons': 1.8.6 + '@sinonjs/samsam': 3.3.3 + dev: true + + /@sinonjs/samsam/3.3.3: + resolution: {integrity: sha512-bKCMKZvWIjYD0BLGnNrxVuw4dkWCYsLqFOUWw8VgKF/+5Y+mE7LfHWPIYoDXowH+3a9LsWDMo0uAP8YDosPvHQ==} + dependencies: + '@sinonjs/commons': 1.8.6 + array-from: 2.1.1 + lodash: 4.17.21 + dev: true + + /@sinonjs/text-encoding/0.7.2: + resolution: {integrity: sha512-sXXKG+uL9IrKqViTtao2Ws6dy0znu9sOaP1di/jKGW1M6VssO8vlpXCQcpZ+jisQ1tTFAC5Jo/EOzFbggBagFQ==} + dev: true + + /@socket.io/component-emitter/3.1.0: + resolution: {integrity: sha512-+9jVqKhRSpsc591z5vX+X5Yyw+he/HCB4iQ/RYxw35CEPaY1gnsNE43nf9n9AaYjAQrTiI/mOwKUKdUs9vf7Xg==} + dev: true + + /@tootallnate/once/2.0.0: + resolution: {integrity: sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==} + engines: {node: '>= 10'} + dev: false + + /@types/cookie/0.4.1: + resolution: {integrity: sha512-XW/Aa8APYr6jSVVA1y/DEIZX0/GMKLEVekNG727R8cs56ahETkRAy/3DR7+fJyh7oUgGwNQaRfXCun0+KbWY7Q==} + dev: true + + /@types/cors/2.8.13: + resolution: {integrity: sha512-RG8AStHlUiV5ysZQKq97copd2UmVYw3/pRMLefISZ3S1hK104Cwm7iLQ3fTKx+lsUH2CE8FlLaYeEA2LSeqYUA==} + dependencies: + '@types/node': 18.11.18 + dev: true + + /@types/expect/1.20.4: + resolution: {integrity: sha512-Q5Vn3yjTDyCMV50TB6VRIbQNxSE4OmZR86VSbGaNpfUolm0iePBB4KdEEHmxoY5sT2+2DIvXW0rvMDP2nHZ4Mg==} + dev: true + + /@types/glob/7.2.0: + resolution: {integrity: sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==} + dependencies: + '@types/minimatch': 5.1.2 + '@types/node': 18.11.18 + dev: true + + /@types/istanbul-lib-coverage/2.0.4: + resolution: {integrity: sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g==} + dev: true + + /@types/minimatch/5.1.2: + resolution: {integrity: sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==} + dev: true + + /@types/node/18.11.18: + resolution: {integrity: sha512-DHQpWGjyQKSHj3ebjFI/wRKcqQcdR+MoFBygntYOZytCqNfkd2ZC4ARDJ2DQqhjH5p85Nnd3jhUJIXrszFX/JA==} + dev: true + + /@types/vinyl/2.0.7: + resolution: {integrity: sha512-4UqPv+2567NhMQuMLdKAyK4yzrfCqwaTt6bLhHEs8PFcxbHILsrxaY63n4wgE/BRLDWDQeI+WcTmkXKExh9hQg==} + dependencies: + '@types/expect': 1.20.4 + '@types/node': 18.11.18 + dev: true + + /JSONStream/1.3.5: + resolution: {integrity: sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==} + hasBin: true + dependencies: + jsonparse: 1.3.1 + through: 2.3.8 + dev: true + + /abbrev/1.1.1: + resolution: {integrity: sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==} + + /accepts/1.3.8: + resolution: {integrity: sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==} + engines: {node: '>= 0.6'} + dependencies: + mime-types: 2.1.35 + negotiator: 0.6.3 + dev: true + + /acorn-node/1.8.2: + resolution: {integrity: sha512-8mt+fslDufLYntIoPAaIMUe/lrbrehIiwmR3t2k9LljIzoigEPF27eLk2hy8zSGzmR/ogr7zbRKINMo1u0yh5A==} + dependencies: + acorn: 7.4.1 + acorn-walk: 7.2.0 + xtend: 4.0.2 + dev: true + + /acorn-walk/7.2.0: + resolution: {integrity: sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA==} + engines: {node: '>=0.4.0'} + dev: true + + /acorn/7.4.1: + resolution: {integrity: sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==} + engines: {node: '>=0.4.0'} + hasBin: true + + /acorn/8.8.2: + resolution: {integrity: sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==} + engines: {node: '>=0.4.0'} + hasBin: true + dev: true + + /agent-base/6.0.2: + resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} + engines: {node: '>= 6.0.0'} + dependencies: + debug: 4.3.4 + transitivePeerDependencies: + - supports-color + dev: false + + /agentkeepalive/4.2.1: + resolution: {integrity: sha512-Zn4cw2NEqd+9fiSVWMscnjyQ1a8Yfoc5oBajLeo5w+YBHgDUcEBY2hS4YpTz6iN5f/2zQiktcuM6tS8x1p9dpA==} + engines: {node: '>= 8.0.0'} + dependencies: + debug: 4.3.4 + depd: 1.1.2 + humanize-ms: 1.2.1 + transitivePeerDependencies: + - supports-color + dev: false + + /aggregate-error/3.1.0: + resolution: {integrity: sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==} + engines: {node: '>=8'} + dependencies: + clean-stack: 2.2.0 + indent-string: 4.0.0 + dev: false + + /ansi-colors/1.1.0: + resolution: {integrity: sha512-SFKX67auSNoVR38N3L+nvsPjOE0bybKTYbkf5tRvushrAPQ9V75huw0ZxBkKVeRU9kqH3d6HA4xTckbwZ4ixmA==} + engines: {node: '>=0.10.0'} + dependencies: + ansi-wrap: 0.1.0 + dev: true + + /ansi-cyan/0.1.1: + resolution: {integrity: sha512-eCjan3AVo/SxZ0/MyIYRtkpxIu/H3xZN7URr1vXVrISxeyz8fUFz0FJziamK4sS8I+t35y4rHg1b2PklyBe/7A==} + engines: {node: '>=0.10.0'} + dependencies: + ansi-wrap: 0.1.0 + dev: true + + /ansi-gray/0.1.1: + resolution: {integrity: sha512-HrgGIZUl8h2EHuZaU9hTR/cU5nhKxpVE1V6kdGsQ8e4zirElJ5fvtfc8N7Q1oq1aatO275i8pUFUCpNWCAnVWw==} + engines: {node: '>=0.10.0'} + dependencies: + ansi-wrap: 0.1.0 + dev: true + + /ansi-red/0.1.1: + resolution: {integrity: sha512-ewaIr5y+9CUTGFwZfpECUbFlGcC0GCw1oqR9RI6h1gQCd9Aj2GxSckCnPsVJnmfMZbwFYE+leZGASgkWl06Jow==} + engines: {node: '>=0.10.0'} + dependencies: + ansi-wrap: 0.1.0 + dev: true + + /ansi-regex/2.1.1: + resolution: {integrity: sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==} + engines: {node: '>=0.10.0'} + dev: true + + /ansi-regex/5.0.1: + resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} + engines: {node: '>=8'} + + /ansi-styles/2.2.1: + resolution: {integrity: sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA==} + engines: {node: '>=0.10.0'} + dev: true + + /ansi-styles/4.3.0: + resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} + engines: {node: '>=8'} + dependencies: + color-convert: 2.0.1 + dev: true + + /ansi-wrap/0.1.0: + resolution: {integrity: sha512-ZyznvL8k/FZeQHr2T6LzcJ/+vBApDnMNZvfVFy3At0knswWd6rJ3/0Hhmpu8oqa6C92npmozs890sX9Dl6q+Qw==} + engines: {node: '>=0.10.0'} + dev: true + + /anymatch/2.0.0: + resolution: {integrity: sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==} + dependencies: + micromatch: 3.1.10 + normalize-path: 2.1.1 + transitivePeerDependencies: + - supports-color + dev: true + + /anymatch/3.1.3: + resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} + engines: {node: '>= 8'} + dependencies: + normalize-path: 3.0.0 + picomatch: 2.3.1 + dev: true + + /append-buffer/1.0.2: + resolution: {integrity: sha512-WLbYiXzD3y/ATLZFufV/rZvWdZOs+Z/+5v1rBZ463Jn398pa6kcde27cvozYnBoxXblGZTFfoPpsaEw0orU5BA==} + engines: {node: '>=0.10.0'} + dependencies: + buffer-equal: 1.0.1 + dev: true + + /aproba/2.0.0: + resolution: {integrity: sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==} + dev: false + + /archy/1.0.0: + resolution: {integrity: sha512-Xg+9RwCg/0p32teKdGMPTPnVXKD0w3DfHnFTficozsAgsvq2XenPJq/MYpzzQ/v8zrOyJn6Ds39VA4JIDwFfqw==} + dev: true + + /are-we-there-yet/3.0.1: + resolution: {integrity: sha512-QZW4EDmGwlYur0Yyf/b2uGucHQMa8aFUP7eu9ddR73vvhFyt4V0Vl3QHPcTNJ8l6qYOBdxgXdnBXQrHilfRQBg==} + engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} + dependencies: + delegates: 1.0.0 + readable-stream: 3.6.0 + dev: false + + /arr-diff/1.1.0: + resolution: {integrity: sha512-OQwDZUqYaQwyyhDJHThmzId8daf4/RFNLaeh3AevmSeZ5Y7ug4Ga/yKc6l6kTZOBW781rCj103ZuTh8GAsB3+Q==} + engines: {node: '>=0.10.0'} + dependencies: + arr-flatten: 1.1.0 + array-slice: 0.2.3 + dev: true + + /arr-diff/4.0.0: + resolution: {integrity: sha512-YVIQ82gZPGBebQV/a8dar4AitzCQs0jjXwMPZllpXMaGjXPYVUawSxQrRsjhjupyVxEvbHgUmIhKVlND+j02kA==} + engines: {node: '>=0.10.0'} + dev: true + + /arr-filter/1.1.2: + resolution: {integrity: sha512-A2BETWCqhsecSvCkWAeVBFLH6sXEUGASuzkpjL3GR1SlL/PWL6M3J8EAAld2Uubmh39tvkJTqC9LeLHCUKmFXA==} + engines: {node: '>=0.10.0'} + dependencies: + make-iterator: 1.0.1 + dev: true + + /arr-flatten/1.1.0: + resolution: {integrity: sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==} + engines: {node: '>=0.10.0'} + dev: true + + /arr-map/2.0.2: + resolution: {integrity: sha512-tVqVTHt+Q5Xb09qRkbu+DidW1yYzz5izWS2Xm2yFm7qJnmUfz4HPzNxbHkdRJbz2lrqI7S+z17xNYdFcBBO8Hw==} + engines: {node: '>=0.10.0'} + dependencies: + make-iterator: 1.0.1 + dev: true + + /arr-union/2.1.0: + resolution: {integrity: sha512-t5db90jq+qdgk8aFnxEkjqta0B/GHrM1pxzuuZz2zWsOXc5nKu3t+76s/PQBA8FTcM/ipspIH9jWG4OxCBc2eA==} + engines: {node: '>=0.10.0'} + dev: true + + /arr-union/3.1.0: + resolution: {integrity: sha512-sKpyeERZ02v1FeCZT8lrfJq5u6goHCtpTAzPwJYe7c8SPFOboNjNg1vz2L4VTn9T4PQxEx13TbXLmYUcS6Ug7Q==} + engines: {node: '>=0.10.0'} + dev: true + + /array-each/1.0.1: + resolution: {integrity: sha512-zHjL5SZa68hkKHBFBK6DJCTtr9sfTCPCaph/L7tMSLcTFgy+zX7E+6q5UArbtOtMBCtxdICpfTCspRse+ywyXA==} + engines: {node: '>=0.10.0'} + dev: true + + /array-from/2.1.1: + resolution: {integrity: sha512-GQTc6Uupx1FCavi5mPzBvVT7nEOeWMmUA9P95wpfpW1XwMSKs+KaymD5C2Up7KAUKg/mYwbsUYzdZWcoajlNZg==} + dev: true + + /array-initial/1.1.0: + resolution: {integrity: sha512-BC4Yl89vneCYfpLrs5JU2aAu9/a+xWbeKhvISg9PT7eWFB9UlRvI+rKEtk6mgxWr3dSkk9gQ8hCrdqt06NXPdw==} + engines: {node: '>=0.10.0'} + dependencies: + array-slice: 1.1.0 + is-number: 4.0.0 + dev: true + + /array-last/1.3.0: + resolution: {integrity: sha512-eOCut5rXlI6aCOS7Z7kCplKRKyiFQ6dHFBem4PwlwKeNFk2/XxTrhRh5T9PyaEWGy/NHTZWbY+nsZlNFJu9rYg==} + engines: {node: '>=0.10.0'} + dependencies: + is-number: 4.0.0 + dev: true + + /array-slice/0.2.3: + resolution: {integrity: sha512-rlVfZW/1Ph2SNySXwR9QYkChp8EkOEiTMO5Vwx60usw04i4nWemkm9RXmQqgkQFaLHsqLuADvjp6IfgL9l2M8Q==} + engines: {node: '>=0.10.0'} + dev: true + + /array-slice/1.1.0: + resolution: {integrity: sha512-B1qMD3RBP7O8o0H2KbrXDyB0IccejMF15+87Lvlor12ONPRHP6gTjXMNkt/d3ZuOGbAe66hFmaCfECI24Ufp6w==} + engines: {node: '>=0.10.0'} + dev: true + + /array-sort/1.0.0: + resolution: {integrity: sha512-ihLeJkonmdiAsD7vpgN3CRcx2J2S0TiYW+IS/5zHBI7mKUq3ySvBdzzBfD236ubDBQFiiyG3SWCPc+msQ9KoYg==} + engines: {node: '>=0.10.0'} + dependencies: + default-compare: 1.0.0 + get-value: 2.0.6 + kind-of: 5.1.0 + dev: true + + /array-union/2.1.0: + resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==} + engines: {node: '>=8'} + dev: true + + /array-unique/0.3.2: + resolution: {integrity: sha512-SleRWjh9JUud2wH1hPs9rZBZ33H6T9HOiL0uwGnGx9FpE6wKGyfWugmbkEOIs6qWrZhg0LWeLziLrEwQJhs5mQ==} + engines: {node: '>=0.10.0'} + dev: true + + /asn1.js/5.4.1: + resolution: {integrity: sha512-+I//4cYPccV8LdmBLiX8CYvf9Sp3vQsrqu2QNXRcrbiWvcx/UdlFiqUJJzxRQxgsZmvhXhn4cSKeSmoFjVdupA==} + dependencies: + bn.js: 4.12.0 + inherits: 2.0.4 + minimalistic-assert: 1.0.1 + safer-buffer: 2.1.2 + dev: true + + /assert/1.5.0: + resolution: {integrity: sha512-EDsgawzwoun2CZkCgtxJbv392v4nbk9XDD06zI+kQYoBM/3RBWLlEyJARDOmhAAosBjWACEkKL6S+lIZtcAubA==} + dependencies: + object-assign: 4.1.1 + util: 0.10.3 + dev: true + + /assign-symbols/1.0.0: + resolution: {integrity: sha512-Q+JC7Whu8HhmTdBph/Tq59IoRtoy6KAm5zzPv00WdujX82lbAL8K7WVjne7vdCsAmbF4AYaDOPyO3k0kl8qIrw==} + engines: {node: '>=0.10.0'} + dev: true + + /async-done/1.3.2: + resolution: {integrity: sha512-uYkTP8dw2og1tu1nmza1n1CMW0qb8gWWlwqMmLb7MhBVs4BXrFziT6HXUd+/RlRA/i4H9AkofYloUbs1fwMqlw==} + engines: {node: '>= 0.10'} + dependencies: + end-of-stream: 1.4.4 + once: 1.4.0 + process-nextick-args: 2.0.1 + stream-exhaust: 1.0.2 + dev: true + + /async-each-series/0.1.1: + resolution: {integrity: sha512-p4jj6Fws4Iy2m0iCmI2am2ZNZCgbdgE+P8F/8csmn2vx7ixXrO2zGcuNsD46X5uZSVecmkEy/M06X2vG8KD6dQ==} + engines: {node: '>=0.8.0'} + dev: true + + /async-each/1.0.4: + resolution: {integrity: sha512-qL5v0vnRtD4rxlrzLz3WMnMfTvTrMf3IK1xFCF0Q5vqXJkULhM13gO2ynE8RZMjE+bPcH0AUHgcd5BU1FtO1tA==} + dev: true + + /async-settle/1.0.0: + resolution: {integrity: sha512-VPXfB4Vk49z1LHHodrEQ6Xf7W4gg1w0dAPROHngx7qgDjqmIQ+fXmwgGXTW/ITLai0YLSvWepJOP9EVpMnEAcw==} + engines: {node: '>= 0.10'} + dependencies: + async-done: 1.3.2 + dev: true + + /async/2.6.4: + resolution: {integrity: sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA==} + dependencies: + lodash: 4.17.21 + dev: true + + /atob/2.1.2: + resolution: {integrity: sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==} + engines: {node: '>= 4.5.0'} + hasBin: true + dev: true + + /available-typed-arrays/1.0.5: + resolution: {integrity: sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==} + engines: {node: '>= 0.4'} + dev: true + + /axios/0.21.4_debug@4.3.2: + resolution: {integrity: sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==} + dependencies: + follow-redirects: 1.15.2_debug@4.3.2 + transitivePeerDependencies: + - debug + dev: true + + /bach/1.2.0: + resolution: {integrity: sha512-bZOOfCb3gXBXbTFXq3OZtGR88LwGeJvzu6szttaIzymOTS4ZttBNOWSv7aLZja2EMycKtRYV0Oa8SNKH/zkxvg==} + engines: {node: '>= 0.10'} + dependencies: + arr-filter: 1.1.2 + arr-flatten: 1.1.0 + arr-map: 2.0.2 + array-each: 1.0.1 + array-initial: 1.1.0 + array-last: 1.3.0 + async-done: 1.3.2 + async-settle: 1.0.0 + now-and-later: 2.0.1 + dev: true + + /balanced-match/1.0.2: + resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} + + /base/0.11.2: + resolution: {integrity: sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==} + engines: {node: '>=0.10.0'} + dependencies: + cache-base: 1.0.1 + class-utils: 0.3.6 + component-emitter: 1.3.0 + define-property: 1.0.0 + isobject: 3.0.1 + mixin-deep: 1.3.2 + pascalcase: 0.1.1 + dev: true + + /base64-js/1.5.1: + resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} + + /base64id/2.0.0: + resolution: {integrity: sha512-lGe34o6EHj9y3Kts9R4ZYs/Gr+6N7MCaMlIFA3F1R2O5/m7K06AxfSeO5530PEERE6/WyEg3lsuyw4GHlPZHog==} + engines: {node: ^4.5.0 || >= 5.9} + dev: true + + /batch/0.6.1: + resolution: {integrity: sha512-x+VAiMRL6UPkx+kudNvxTl6hB2XNNCG2r+7wixVfIYwu/2HKRXimwQyaumLjMveWvT2Hkd/cAJw+QBMfJ/EKVw==} + dev: true + + /benchmark/2.1.4: + resolution: {integrity: sha512-l9MlfN4M1K/H2fbhfMy3B7vJd6AGKJVQn2h6Sg/Yx+KckoUA7ewS5Vv6TjSq18ooE1kS9hhAlQRH3AkXIh/aOQ==} + dependencies: + lodash: 4.17.21 + platform: 1.3.6 + dev: true + + /binary-extensions/1.13.1: + resolution: {integrity: sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==} + engines: {node: '>=0.10.0'} + dev: true + + /binary-extensions/2.2.0: + resolution: {integrity: sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==} + engines: {node: '>=8'} + dev: true + + /binaryextensions/2.3.0: + resolution: {integrity: sha512-nAihlQsYGyc5Bwq6+EsubvANYGExeJKHDO3RjnvwU042fawQTQfM3Kxn7IHUXQOz4bzfwsGYYHGSvXyW4zOGLg==} + engines: {node: '>=0.8'} + dev: true + + /bindings/1.5.0: + resolution: {integrity: sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==} + dependencies: + file-uri-to-path: 1.0.0 + + /bit-twiddle/1.0.2: + resolution: {integrity: sha512-B9UhK0DKFZhoTFcfvAzhqsjStvGJp9vYWf3+6SNTtdSQnvIgfkHbgHrg/e4+TH71N2GDu8tpmCVoyfrL1d7ntA==} + dev: false + + /bl/1.2.3: + resolution: {integrity: sha512-pvcNpa0UU69UT341rO6AYy4FVAIkUHuZXRIWbq+zHnsVcRzDDjIAhGuuYoi0d//cwIwtt4pkpKycWEfjdV+vww==} + dependencies: + readable-stream: 2.3.7 + safe-buffer: 5.2.1 + dev: true + + /bl/4.1.0: + resolution: {integrity: sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==} + dependencies: + buffer: 5.7.1 + inherits: 2.0.4 + readable-stream: 3.6.0 + dev: false + + /bn.js/4.12.0: + resolution: {integrity: sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==} + dev: true + + /bn.js/5.2.1: + resolution: {integrity: sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==} + dev: true + + /brace-expansion/1.1.11: + resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} + dependencies: + balanced-match: 1.0.2 + concat-map: 0.0.1 + + /brace-expansion/2.0.1: + resolution: {integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==} + dependencies: + balanced-match: 1.0.2 + + /braces/2.3.2: + resolution: {integrity: sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==} + engines: {node: '>=0.10.0'} + dependencies: + arr-flatten: 1.1.0 + array-unique: 0.3.2 + extend-shallow: 2.0.1 + fill-range: 4.0.0 + isobject: 3.0.1 + repeat-element: 1.1.4 + snapdragon: 0.8.2 + snapdragon-node: 2.1.1 + split-string: 3.1.0 + to-regex: 3.0.2 + transitivePeerDependencies: + - supports-color + dev: true + + /braces/3.0.2: + resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==} + engines: {node: '>=8'} + dependencies: + fill-range: 7.0.1 + dev: true + + /brorand/1.1.0: + resolution: {integrity: sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==} + dev: true + + /browser-pack/6.1.0: + resolution: {integrity: sha512-erYug8XoqzU3IfcU8fUgyHqyOXqIE4tUTTQ+7mqUjQlvnXkOO6OlT9c/ZoJVHYoAaqGxr09CN53G7XIsO4KtWA==} + hasBin: true + dependencies: + JSONStream: 1.3.5 + combine-source-map: 0.8.0 + defined: 1.0.1 + safe-buffer: 5.2.1 + through2: 2.0.5 + umd: 3.0.3 + dev: true + + /browser-resolve/2.0.0: + resolution: {integrity: sha512-7sWsQlYL2rGLy2IWm8WL8DCTJvYLc/qlOnsakDac87SOoCd16WLsaAMdCiAqsTNHIe+SXfaqyxyo6THoWqs8WQ==} + dependencies: + resolve: 1.22.1 + dev: true + + /browser-sync-client/2.27.11: + resolution: {integrity: sha512-okMNfD2NasL/XD1/BclP3onXjhahisk3e/kTQ5HPDT/lLqdBqNDd6QFcjI5I1ak7na2hxKQSLjryql+7fp5gKQ==} + engines: {node: '>=8.0.0'} + dependencies: + etag: 1.8.1 + fresh: 0.5.2 + mitt: 1.2.0 + rxjs: 5.5.12 + typescript: 4.9.4 + dev: true + + /browser-sync-ui/2.27.11: + resolution: {integrity: sha512-1T/Y8Pp1R68aUL7zVSFq0nxtr258xWd/nTasCAHX2M6EsGaswVOFtXsw3bKqsr35z+J+LfVfOdz1HFLYKxdgrA==} + dependencies: + async-each-series: 0.1.1 + connect-history-api-fallback: 1.6.0 + immutable: 3.8.2 + server-destroy: 1.0.1 + socket.io-client: 4.5.4 + stream-throttle: 0.1.3 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + dev: true + + /browser-sync/2.27.11: + resolution: {integrity: sha512-U5f9u97OYJH66T0MGWWzG9rOQTW6ZmDMj97vsmtqwNS03JAwdLVES8eel2lD3rvAqQCNAFqaJ74NMacBI57vJg==} + engines: {node: '>= 8.0.0'} + hasBin: true + dependencies: + browser-sync-client: 2.27.11 + browser-sync-ui: 2.27.11 + bs-recipes: 1.3.4 + bs-snippet-injector: 2.0.1 + chokidar: 3.5.3 + connect: 3.6.6 + connect-history-api-fallback: 1.6.0 + dev-ip: 1.0.1 + easy-extender: 2.3.4 + eazy-logger: 3.1.0 + etag: 1.8.1 + fresh: 0.5.2 + fs-extra: 3.0.1 + http-proxy: 1.18.1 + immutable: 3.8.2 + localtunnel: 2.0.2 + micromatch: 4.0.5 + opn: 5.3.0 + portscanner: 2.2.0 + qs: 6.11.0 + raw-body: 2.5.1 + resp-modifier: 6.0.2 + rx: 4.1.0 + send: 0.16.2 + serve-index: 1.9.1 + serve-static: 1.13.2 + server-destroy: 1.0.1 + socket.io: 4.5.4 + ua-parser-js: 1.0.2 + yargs: 17.6.2 + transitivePeerDependencies: + - bufferutil + - debug + - supports-color + - utf-8-validate + dev: true + + /browserify-aes/1.2.0: + resolution: {integrity: sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==} + dependencies: + buffer-xor: 1.0.3 + cipher-base: 1.0.4 + create-hash: 1.2.0 + evp_bytestokey: 1.0.3 + inherits: 2.0.4 + safe-buffer: 5.2.1 + dev: true + + /browserify-cipher/1.0.1: + resolution: {integrity: sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==} + dependencies: + browserify-aes: 1.2.0 + browserify-des: 1.0.2 + evp_bytestokey: 1.0.3 + dev: true + + /browserify-des/1.0.2: + resolution: {integrity: sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==} + dependencies: + cipher-base: 1.0.4 + des.js: 1.0.1 + inherits: 2.0.4 + safe-buffer: 5.2.1 + dev: true + + /browserify-rsa/4.1.0: + resolution: {integrity: sha512-AdEER0Hkspgno2aR97SAf6vi0y0k8NuOpGnVH3O99rcA5Q6sh8QxcngtHuJ6uXwnfAXNM4Gn1Gb7/MV1+Ymbog==} + dependencies: + bn.js: 5.2.1 + randombytes: 2.1.0 + dev: true + + /browserify-sign/4.2.1: + resolution: {integrity: sha512-/vrA5fguVAKKAVTNJjgSm1tRQDHUU6DbwO9IROu/0WAzC8PKhucDSh18J0RMvVeHAn5puMd+QHC2erPRNf8lmg==} + dependencies: + bn.js: 5.2.1 + browserify-rsa: 4.1.0 + create-hash: 1.2.0 + create-hmac: 1.1.7 + elliptic: 6.5.4 + inherits: 2.0.4 + parse-asn1: 5.1.6 + readable-stream: 3.6.0 + safe-buffer: 5.2.1 + dev: true + + /browserify-zlib/0.2.0: + resolution: {integrity: sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==} + dependencies: + pako: 1.0.11 + dev: true + + /browserify/17.0.0: + resolution: {integrity: sha512-SaHqzhku9v/j6XsQMRxPyBrSP3gnwmE27gLJYZgMT2GeK3J0+0toN+MnuNYDfHwVGQfLiMZ7KSNSIXHemy905w==} + engines: {node: '>= 0.8'} + hasBin: true + dependencies: + JSONStream: 1.3.5 + assert: 1.5.0 + browser-pack: 6.1.0 + browser-resolve: 2.0.0 + browserify-zlib: 0.2.0 + buffer: 5.2.1 + cached-path-relative: 1.1.0 + concat-stream: 1.6.2 + console-browserify: 1.2.0 + constants-browserify: 1.0.0 + crypto-browserify: 3.12.0 + defined: 1.0.1 + deps-sort: 2.0.1 + domain-browser: 1.2.0 + duplexer2: 0.1.4 + events: 3.3.0 + glob: 7.2.3 + has: 1.0.3 + htmlescape: 1.1.1 + https-browserify: 1.0.0 + inherits: 2.0.4 + insert-module-globals: 7.2.1 + labeled-stream-splicer: 2.0.2 + mkdirp-classic: 0.5.3 + module-deps: 6.2.3 + os-browserify: 0.3.0 + parents: 1.0.1 + path-browserify: 1.0.1 + process: 0.11.10 + punycode: 1.4.1 + querystring-es3: 0.2.1 + read-only-stream: 2.0.0 + readable-stream: 2.3.7 + resolve: 1.22.1 + shasum-object: 1.0.0 + shell-quote: 1.7.4 + stream-browserify: 3.0.0 + stream-http: 3.2.0 + string_decoder: 1.3.0 + subarg: 1.0.0 + syntax-error: 1.4.0 + through2: 2.0.5 + timers-browserify: 1.4.2 + tty-browserify: 0.0.1 + url: 0.11.0 + util: 0.12.5 + vm-browserify: 1.1.2 + xtend: 4.0.2 + dev: true + + /bs-recipes/1.3.4: + resolution: {integrity: sha512-BXvDkqhDNxXEjeGM8LFkSbR+jzmP/CYpCiVKYn+soB1dDldeU15EBNDkwVXndKuX35wnNUaPd0qSoQEAkmQtMw==} + dev: true + + /bs-snippet-injector/2.0.1: + resolution: {integrity: sha512-4u8IgB+L9L+S5hknOj3ddNSb42436gsnGm1AuM15B7CdbkpQTyVWgIM5/JUBiKiRwGOR86uo0Lu/OsX+SAlJmw==} + dev: true + + /buffer-equal/1.0.1: + resolution: {integrity: sha512-QoV3ptgEaQpvVwbXdSO39iqPQTCxSF7A5U99AxbHYqUdCizL/lH2Z0A2y6nbZucxMEOtNyZfG2s6gsVugGpKkg==} + engines: {node: '>=0.4'} + dev: true + + /buffer-from/1.1.2: + resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==} + dev: true + + /buffer-xor/1.0.3: + resolution: {integrity: sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ==} + dev: true + + /buffer/5.2.1: + resolution: {integrity: sha512-c+Ko0loDaFfuPWiL02ls9Xd3GO3cPVmUobQ6t3rXNUk304u6hGq+8N/kFi+QEIKhzK3uwolVhLzszmfLmMLnqg==} + dependencies: + base64-js: 1.5.1 + ieee754: 1.2.1 + dev: true + + /buffer/5.7.1: + resolution: {integrity: sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==} + dependencies: + base64-js: 1.5.1 + ieee754: 1.2.1 + dev: false + + /builtin-status-codes/3.0.0: + resolution: {integrity: sha512-HpGFw18DgFWlncDfjTa2rcQ4W88O1mC8e8yZ2AvQY5KDaktSTwo+KRf6nHK6FRI5FyRyb/5T6+TSxfP7QyGsmQ==} + dev: true + + /bytes/3.1.2: + resolution: {integrity: sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==} + engines: {node: '>= 0.8'} + dev: true + + /c8/7.12.0: + resolution: {integrity: sha512-CtgQrHOkyxr5koX1wEUmN/5cfDa2ckbHRA4Gy5LAL0zaCFtVWJS5++n+w4/sr2GWGerBxgTjpKeDclk/Qk6W/A==} + engines: {node: '>=10.12.0'} + hasBin: true + dependencies: + '@bcoe/v8-coverage': 0.2.3 + '@istanbuljs/schema': 0.1.3 + find-up: 5.0.0 + foreground-child: 2.0.0 + istanbul-lib-coverage: 3.2.0 + istanbul-lib-report: 3.0.0 + istanbul-reports: 3.1.5 + rimraf: 3.0.2 + test-exclude: 6.0.0 + v8-to-istanbul: 9.0.1 + yargs: 16.2.0 + yargs-parser: 20.2.9 + dev: true + + /cacache/16.1.3: + resolution: {integrity: sha512-/+Emcj9DAXxX4cwlLmRI9c166RuL3w30zp4R7Joiv2cQTtTtA+jeuCAjH3ZlGnYS3tKENSrKhAzVVP9GVyzeYQ==} + engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} + dependencies: + '@npmcli/fs': 2.1.2 + '@npmcli/move-file': 2.0.1 + chownr: 2.0.0 + fs-minipass: 2.1.0 + glob: 8.1.0 + infer-owner: 1.0.4 + lru-cache: 7.14.1 + minipass: 3.3.6 + minipass-collect: 1.0.2 + minipass-flush: 1.0.5 + minipass-pipeline: 1.2.4 + mkdirp: 1.0.4 + p-map: 4.0.0 + promise-inflight: 1.0.1 + rimraf: 3.0.2 + ssri: 9.0.1 + tar: 6.1.13 + unique-filename: 2.0.1 + transitivePeerDependencies: + - bluebird + dev: false + + /cache-base/1.0.1: + resolution: {integrity: sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==} + engines: {node: '>=0.10.0'} + dependencies: + collection-visit: 1.0.0 + component-emitter: 1.3.0 + get-value: 2.0.6 + has-value: 1.0.0 + isobject: 3.0.1 + set-value: 2.0.1 + to-object-path: 0.3.0 + union-value: 1.0.1 + unset-value: 1.0.0 + dev: true + + /cached-path-relative/1.1.0: + resolution: {integrity: sha512-WF0LihfemtesFcJgO7xfOoOcnWzY/QHR4qeDqV44jPU3HTI54+LnfXK3SA27AVVGCdZFgjjFFaqUA9Jx7dMJZA==} + dev: true + + /call-bind/1.0.2: + resolution: {integrity: sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==} + dependencies: + function-bind: 1.1.1 + get-intrinsic: 1.2.0 + dev: true + + /camelcase/3.0.0: + resolution: {integrity: sha512-4nhGqUkc4BqbBBB4Q6zLuD7lzzrHYrjKGeYaEji/3tFR5VdJu9v+LilhGIVe8wxEJPPOeWo7eg8dwY13TZ1BNg==} + engines: {node: '>=0.10.0'} + dev: true + + /chalk/1.1.3: + resolution: {integrity: sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A==} + engines: {node: '>=0.10.0'} + dependencies: + ansi-styles: 2.2.1 + escape-string-regexp: 1.0.5 + has-ansi: 2.0.0 + strip-ansi: 3.0.1 + supports-color: 2.0.0 + dev: true + + /chokidar/2.1.8: + resolution: {integrity: sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg==} + deprecated: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies + dependencies: + anymatch: 2.0.0 + async-each: 1.0.4 + braces: 2.3.2 + glob-parent: 3.1.0 + inherits: 2.0.4 + is-binary-path: 1.0.1 + is-glob: 4.0.3 + normalize-path: 3.0.0 + path-is-absolute: 1.0.1 + readdirp: 2.2.1 + upath: 1.2.0 + optionalDependencies: + fsevents: 1.2.13 + transitivePeerDependencies: + - supports-color + dev: true + + /chokidar/3.5.3: + resolution: {integrity: sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==} + engines: {node: '>= 8.10.0'} + dependencies: + anymatch: 3.1.3 + braces: 3.0.2 + glob-parent: 5.1.2 + is-binary-path: 2.1.0 + is-glob: 4.0.3 + normalize-path: 3.0.0 + readdirp: 3.6.0 + optionalDependencies: + fsevents: 2.3.2 + dev: true + + /chownr/1.1.4: + resolution: {integrity: sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==} + dev: false + + /chownr/2.0.0: + resolution: {integrity: sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==} + engines: {node: '>=10'} + dev: false + + /cipher-base/1.0.4: + resolution: {integrity: sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==} + dependencies: + inherits: 2.0.4 + safe-buffer: 5.2.1 + dev: true + + /class-utils/0.3.6: + resolution: {integrity: sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==} + engines: {node: '>=0.10.0'} + dependencies: + arr-union: 3.1.0 + define-property: 0.2.5 + isobject: 3.0.1 + static-extend: 0.1.2 + dev: true + + /clean-stack/2.2.0: + resolution: {integrity: sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==} + engines: {node: '>=6'} + dev: false + + /cliui/3.2.0: + resolution: {integrity: sha512-0yayqDxWQbqk3ojkYqUKqaAQ6AfNKeKWRNA8kR0WXzAsdHpP4BIaOmMAG87JGuO6qcobyW4GjxHd9PmhEd+T9w==} + dependencies: + string-width: 1.0.2 + strip-ansi: 3.0.1 + wrap-ansi: 2.1.0 + dev: true + + /cliui/7.0.4: + resolution: {integrity: sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==} + dependencies: + string-width: 4.2.3 + strip-ansi: 6.0.1 + wrap-ansi: 7.0.0 + dev: true + + /cliui/8.0.1: + resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} + engines: {node: '>=12'} + dependencies: + string-width: 4.2.3 + strip-ansi: 6.0.1 + wrap-ansi: 7.0.0 + dev: true + + /clone-buffer/1.0.0: + resolution: {integrity: sha512-KLLTJWrvwIP+OPfMn0x2PheDEP20RPUcGXj/ERegTgdmPEZylALQldygiqrPPu8P45uNuPs7ckmReLY6v/iA5g==} + engines: {node: '>= 0.10'} + dev: true + + /clone-stats/1.0.0: + resolution: {integrity: sha512-au6ydSpg6nsrigcZ4m8Bc9hxjeW+GJ8xh5G3BJCMt4WXe1H10UNaVOamqQTmrx1kjVuxAHIQSNU6hY4Nsn9/ag==} + dev: true + + /clone/2.1.2: + resolution: {integrity: sha512-3Pe/CF1Nn94hyhIYpjtiLhdCoEoz0DqQ+988E9gmeEdQZlojxnOb74wctFyuwWQHzqyf9X7C7MG8juUpqBJT8w==} + engines: {node: '>=0.8'} + dev: true + + /cloneable-readable/1.1.3: + resolution: {integrity: sha512-2EF8zTQOxYq70Y4XKtorQupqF0m49MBz2/yf5Bj+MHjvpG3Hy7sImifnqD6UA+TKYxeSV+u6qqQPawN5UvnpKQ==} + dependencies: + inherits: 2.0.4 + process-nextick-args: 2.0.1 + readable-stream: 2.3.7 + dev: true + + /code-point-at/1.1.0: + resolution: {integrity: sha512-RpAVKQA5T63xEj6/giIbUEtZwJ4UFIc3ZtvEkiaUERylqe8xb5IvqcgOurZLahv93CLKfxcw5YI+DZcUBRyLXA==} + engines: {node: '>=0.10.0'} + dev: true + + /collection-map/1.0.0: + resolution: {integrity: sha512-5D2XXSpkOnleOI21TG7p3T0bGAsZ/XknZpKBmGYyluO8pw4zA3K8ZlrBIbC4FXg3m6z/RNFiUFfT2sQK01+UHA==} + engines: {node: '>=0.10.0'} + dependencies: + arr-map: 2.0.2 + for-own: 1.0.0 + make-iterator: 1.0.1 + dev: true + + /collection-visit/1.0.0: + resolution: {integrity: sha512-lNkKvzEeMBBjUGHZ+q6z9pSJla0KWAQPvtzhEV9+iGyQYG+pBpl7xKDhxoNSOZH2hhv0v5k0y2yAM4o4SjoSkw==} + engines: {node: '>=0.10.0'} + dependencies: + map-visit: 1.0.0 + object-visit: 1.0.1 + dev: true + + /color-convert/2.0.1: + resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} + engines: {node: '>=7.0.0'} + dependencies: + color-name: 1.1.4 + dev: true + + /color-name/1.1.4: + resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} + dev: true + + /color-support/1.1.3: + resolution: {integrity: sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==} + hasBin: true + + /combine-source-map/0.8.0: + resolution: {integrity: sha512-UlxQ9Vw0b/Bt/KYwCFqdEwsQ1eL8d1gibiFb7lxQJFdvTgc2hIZi6ugsg+kyhzhPV+QEpUiEIwInIAIrgoEkrg==} + dependencies: + convert-source-map: 1.1.3 + inline-source-map: 0.6.2 + lodash.memoize: 3.0.4 + source-map: 0.5.7 + dev: true + + /commander/2.20.3: + resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==} + dev: true + + /commander/7.2.0: + resolution: {integrity: sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==} + engines: {node: '>= 10'} + dev: true + + /component-emitter/1.3.0: + resolution: {integrity: sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==} + dev: true + + /concat-map/0.0.1: + resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} + + /concat-stream/1.6.2: + resolution: {integrity: sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==} + engines: {'0': node >= 0.8} + dependencies: + buffer-from: 1.1.2 + inherits: 2.0.4 + readable-stream: 2.3.7 + typedarray: 0.0.6 + dev: true + + /concat-with-sourcemaps/1.1.0: + resolution: {integrity: sha512-4gEjHJFT9e+2W/77h/DS5SGUgwDaOwprX8L/gl5+3ixnzkVJJsZWDSelmN3Oilw3LNDZjZV0yqH1hLG3k6nghg==} + dependencies: + source-map: 0.6.1 + dev: true + + /config-chain/1.1.13: + resolution: {integrity: sha512-qj+f8APARXHrM0hraqXYb2/bOVSV4PvJQlNZ/DVj0QrmNM2q2euizkeuVckQ57J+W0mRH6Hvi+k50M4Jul2VRQ==} + dependencies: + ini: 1.3.8 + proto-list: 1.2.4 + dev: true + + /connect-history-api-fallback/1.6.0: + resolution: {integrity: sha512-e54B99q/OUoH64zYYRf3HBP5z24G38h5D3qXu23JGRoigpX5Ss4r9ZnDk3g0Z8uQC2x2lPaJ+UlWBc1ZWBWdLg==} + engines: {node: '>=0.8'} + dev: true + + /connect/3.6.6: + resolution: {integrity: sha512-OO7axMmPpu/2XuX1+2Yrg0ddju31B6xLZMWkJ5rYBu4YRmRVlOjvlY6kw2FJKiAzyxGwnrDUAG4s1Pf0sbBMCQ==} + engines: {node: '>= 0.10.0'} + dependencies: + debug: 2.6.9 + finalhandler: 1.1.0 + parseurl: 1.3.3 + utils-merge: 1.0.1 + transitivePeerDependencies: + - supports-color + dev: true + + /console-browserify/1.2.0: + resolution: {integrity: sha512-ZMkYO/LkF17QvCPqM0gxw8yUzigAOZOSWSHg91FH6orS7vcEj5dVZTidN2fQ14yBSdg97RqhSNwLUXInd52OTA==} + dev: true + + /console-control-strings/1.1.0: + resolution: {integrity: sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==} + dev: false + + /constants-browserify/1.0.0: + resolution: {integrity: sha512-xFxOwqIzR/e1k1gLiWEophSCMqXcwVHIH7akf7b/vxcUeGunlj3hvZaaqxwHsTgn+IndtkQJgSztIDWeumWJDQ==} + dev: true + + /convert-source-map/1.1.3: + resolution: {integrity: sha512-Y8L5rp6jo+g9VEPgvqNfEopjTR4OTYct8lXlS8iVQdmnjDvbdbzYe9rjtFCB9egC86JoNCU61WRY+ScjkZpnIg==} + dev: true + + /convert-source-map/1.9.0: + resolution: {integrity: sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==} + dev: true + + /cookie/0.4.2: + resolution: {integrity: sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==} + engines: {node: '>= 0.6'} + dev: true + + /copy-descriptor/0.1.1: + resolution: {integrity: sha512-XgZ0pFcakEUlbwQEVNg3+QAis1FyTL3Qel9FYy8pSkQqoG3PNoT0bOCQtOXcOkur21r2Eq2kI+IE+gsmAEVlYw==} + engines: {node: '>=0.10.0'} + dev: true + + /copy-props/2.0.5: + resolution: {integrity: sha512-XBlx8HSqrT0ObQwmSzM7WE5k8FxTV75h1DX1Z3n6NhQ/UYYAvInWYmG06vFt7hQZArE2fuO62aihiWIVQwh1sw==} + dependencies: + each-props: 1.3.2 + is-plain-object: 5.0.0 + dev: true + + /core-util-is/1.0.3: + resolution: {integrity: sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==} + + /cors/2.8.5: + resolution: {integrity: sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==} + engines: {node: '>= 0.10'} + dependencies: + object-assign: 4.1.1 + vary: 1.1.2 + dev: true + + /create-ecdh/4.0.4: + resolution: {integrity: sha512-mf+TCx8wWc9VpuxfP2ht0iSISLZnt0JgWlrOKZiNqyUZWnjIaCIVNQArMHnCZKfEYRg6IM7A+NeJoN8gf/Ws0A==} + dependencies: + bn.js: 4.12.0 + elliptic: 6.5.4 + dev: true + + /create-hash/1.2.0: + resolution: {integrity: sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==} + dependencies: + cipher-base: 1.0.4 + inherits: 2.0.4 + md5.js: 1.3.5 + ripemd160: 2.0.2 + sha.js: 2.4.11 + dev: true + + /create-hmac/1.1.7: + resolution: {integrity: sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==} + dependencies: + cipher-base: 1.0.4 + create-hash: 1.2.0 + inherits: 2.0.4 + ripemd160: 2.0.2 + safe-buffer: 5.2.1 + sha.js: 2.4.11 + dev: true + + /cross-spawn/7.0.3: + resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==} + engines: {node: '>= 8'} + dependencies: + path-key: 3.1.1 + shebang-command: 2.0.0 + which: 2.0.2 + dev: true + + /crypto-browserify/3.12.0: + resolution: {integrity: sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==} + dependencies: + browserify-cipher: 1.0.1 + browserify-sign: 4.2.1 + create-ecdh: 4.0.4 + create-hash: 1.2.0 + create-hmac: 1.1.7 + diffie-hellman: 5.0.3 + inherits: 2.0.4 + pbkdf2: 3.1.2 + public-encrypt: 4.0.3 + randombytes: 2.1.0 + randomfill: 1.0.4 + dev: true + + /d/1.0.1: + resolution: {integrity: sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==} + dependencies: + es5-ext: 0.10.62 + type: 1.2.0 + dev: true + + /dash-ast/1.0.0: + resolution: {integrity: sha512-Vy4dx7gquTeMcQR/hDkYLGUnwVil6vk4FOOct+djUnHOUWt+zJPJAaRIXaAFkPXtJjvlY7o3rfRu0/3hpnwoUA==} + dev: true + + /debug/2.6.9: + resolution: {integrity: sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + dependencies: + ms: 2.0.0 + dev: true + + /debug/4.3.2: + resolution: {integrity: sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==} + engines: {node: '>=6.0'} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + dependencies: + ms: 2.1.2 + dev: true + + /debug/4.3.4: + resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} + engines: {node: '>=6.0'} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + dependencies: + ms: 2.1.2 + + /decamelize/1.2.0: + resolution: {integrity: sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==} + engines: {node: '>=0.10.0'} + dev: true + + /decode-uri-component/0.2.2: + resolution: {integrity: sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ==} + engines: {node: '>=0.10'} + dev: true + + /decomment/0.9.5: + resolution: {integrity: sha512-h0TZ8t6Dp49duwyDHo3iw67mnh9/UpFiSSiOb5gDK1sqoXzrfX/SQxIUQd2R2QEiSnqib0KF2fnKnGfAhAs6lg==} + engines: {node: '>=6.4', npm: '>=2.15'} + dependencies: + esprima: 4.0.1 + dev: true + + /decompress-response/6.0.0: + resolution: {integrity: sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==} + engines: {node: '>=10'} + dependencies: + mimic-response: 3.1.0 + dev: false + + /deep-extend/0.6.0: + resolution: {integrity: sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==} + engines: {node: '>=4.0.0'} + + /default-compare/1.0.0: + resolution: {integrity: sha512-QWfXlM0EkAbqOCbD/6HjdwT19j7WCkMyiRhWilc4H9/5h/RzTF9gv5LYh1+CmDV5d1rki6KAWLtQale0xt20eQ==} + engines: {node: '>=0.10.0'} + dependencies: + kind-of: 5.1.0 + dev: true + + /default-resolution/2.0.0: + resolution: {integrity: sha512-2xaP6GiwVwOEbXCGoJ4ufgC76m8cj805jrghScewJC2ZDsb9U0b4BIrba+xt/Uytyd0HvQ6+WymSRTfnYj59GQ==} + engines: {node: '>= 0.10'} + dev: true + + /define-properties/1.1.4: + resolution: {integrity: sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA==} + engines: {node: '>= 0.4'} + dependencies: + has-property-descriptors: 1.0.0 + object-keys: 1.1.1 + dev: true + + /define-property/0.2.5: + resolution: {integrity: sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA==} + engines: {node: '>=0.10.0'} + dependencies: + is-descriptor: 0.1.6 + dev: true + + /define-property/1.0.0: + resolution: {integrity: sha512-cZTYKFWspt9jZsMscWo8sc/5lbPC9Q0N5nBLgb+Yd915iL3udB1uFgS3B8YCx66UVHq018DAVFoee7x+gxggeA==} + engines: {node: '>=0.10.0'} + dependencies: + is-descriptor: 1.0.2 + dev: true + + /define-property/2.0.2: + resolution: {integrity: sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==} + engines: {node: '>=0.10.0'} + dependencies: + is-descriptor: 1.0.2 + isobject: 3.0.1 + dev: true + + /defined/1.0.1: + resolution: {integrity: sha512-hsBd2qSVCRE+5PmNdHt1uzyrFu5d3RwmFDKzyNZMFq/EwDNJF7Ee5+D5oEKF0hU6LhtoUF1macFvOe4AskQC1Q==} + dev: true + + /delegates/1.0.0: + resolution: {integrity: sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==} + dev: false + + /depd/1.1.2: + resolution: {integrity: sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==} + engines: {node: '>= 0.6'} + + /depd/2.0.0: + resolution: {integrity: sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==} + engines: {node: '>= 0.8'} + dev: true + + /deps-sort/2.0.1: + resolution: {integrity: sha512-1orqXQr5po+3KI6kQb9A4jnXT1PBwggGl2d7Sq2xsnOeI9GPcE/tGcF9UiSZtZBM7MukY4cAh7MemS6tZYipfw==} + hasBin: true + dependencies: + JSONStream: 1.3.5 + shasum-object: 1.0.0 + subarg: 1.0.0 + through2: 2.0.5 + dev: true + + /des.js/1.0.1: + resolution: {integrity: sha512-Q0I4pfFrv2VPd34/vfLrFOoRmlYj3OV50i7fskps1jZWK1kApMWWT9G6RRUeYedLcBDIhnSDaUvJMb3AhUlaEA==} + dependencies: + inherits: 2.0.4 + minimalistic-assert: 1.0.1 + dev: true + + /destroy/1.0.4: + resolution: {integrity: sha512-3NdhDuEXnfun/z7x9GOElY49LoqVHoGScmOKwmxhsS8N5Y+Z8KyPPDnaSzqWgYt/ji4mqwfTS34Htrk0zPIXVg==} + dev: true + + /detect-file/1.0.0: + resolution: {integrity: sha512-DtCOLG98P007x7wiiOmfI0fi3eIKyWiLTGJ2MDnVi/E04lWGbf+JzrRHMm0rgIIZJGtHpKpbVgLWHrv8xXpc3Q==} + engines: {node: '>=0.10.0'} + dev: true + + /detect-libc/2.0.1: + resolution: {integrity: sha512-463v3ZeIrcWtdgIg6vI6XUncguvr2TnGl4SzDXinkt9mSLpBJKXT3mW6xT3VQdDN11+WVs29pgvivTc4Lp8v+w==} + engines: {node: '>=8'} + dev: false + + /detective/5.2.1: + resolution: {integrity: sha512-v9XE1zRnz1wRtgurGu0Bs8uHKFSTdteYZNbIPFVhUZ39L/S79ppMpdmVOZAnoz1jfEFodc48n6MX483Xo3t1yw==} + engines: {node: '>=0.8.0'} + hasBin: true + dependencies: + acorn-node: 1.8.2 + defined: 1.0.1 + minimist: 1.2.7 + dev: true + + /dev-ip/1.0.1: + resolution: {integrity: sha512-LmVkry/oDShEgSZPNgqCIp2/TlqtExeGmymru3uCELnfyjY11IzpAproLYs+1X88fXO6DBoYP3ul2Xo2yz2j6A==} + engines: {node: '>= 0.8.0'} + hasBin: true + dev: true + + /diff/3.5.0: + resolution: {integrity: sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==} + engines: {node: '>=0.3.1'} + dev: true + + /diffie-hellman/5.0.3: + resolution: {integrity: sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==} + dependencies: + bn.js: 4.12.0 + miller-rabin: 4.0.1 + randombytes: 2.1.0 + dev: true + + /dir-glob/3.0.1: + resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==} + engines: {node: '>=8'} + dependencies: + path-type: 4.0.0 + dev: true + + /dlv/1.1.3: + resolution: {integrity: sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==} + dev: true + + /domain-browser/1.2.0: + resolution: {integrity: sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA==} + engines: {node: '>=0.4', npm: '>=1.2'} + dev: true + + /duplexer2/0.1.4: + resolution: {integrity: sha512-asLFVfWWtJ90ZyOUHMqk7/S2w2guQKxUI2itj3d92ADHhxUSbCMGi1f1cBcJ7xM1To+pE/Khbwo1yuNbMEPKeA==} + dependencies: + readable-stream: 2.3.7 + dev: true + + /duplexify/3.7.1: + resolution: {integrity: sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g==} + dependencies: + end-of-stream: 1.4.4 + inherits: 2.0.4 + readable-stream: 2.3.7 + stream-shift: 1.0.1 + dev: true + + /each-props/1.3.2: + resolution: {integrity: sha512-vV0Hem3zAGkJAyU7JSjixeU66rwdynTAa1vofCrSA5fEln+m67Az9CcnkVD776/fsN/UjIWmBDoNRS6t6G9RfA==} + dependencies: + is-plain-object: 2.0.4 + object.defaults: 1.1.0 + dev: true + + /easy-extender/2.3.4: + resolution: {integrity: sha512-8cAwm6md1YTiPpOvDULYJL4ZS6WfM5/cTeVVh4JsvyYZAoqlRVUpHL9Gr5Fy7HA6xcSZicUia3DeAgO3Us8E+Q==} + engines: {node: '>= 4.0.0'} + dependencies: + lodash: 4.17.21 + dev: true + + /eazy-logger/3.1.0: + resolution: {integrity: sha512-/snsn2JqBtUSSstEl4R0RKjkisGHAhvYj89i7r3ytNUKW12y178KDZwXLXIgwDqLW6E/VRMT9qfld7wvFae8bQ==} + engines: {node: '>= 0.8.0'} + dependencies: + tfunk: 4.0.0 + dev: true + + /editorconfig/0.15.3: + resolution: {integrity: sha512-M9wIMFx96vq0R4F+gRpY3o2exzb8hEj/n9S8unZtHSvYjibBp/iMufSzvmOcV/laG0ZtuTVGtiJggPOSW2r93g==} + hasBin: true + dependencies: + commander: 2.20.3 + lru-cache: 4.1.5 + semver: 5.7.1 + sigmund: 1.0.1 + dev: true + + /ee-first/1.1.1: + resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==} + dev: true + + /elliptic/6.5.4: + resolution: {integrity: sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==} + dependencies: + bn.js: 4.12.0 + brorand: 1.1.0 + hash.js: 1.1.7 + hmac-drbg: 1.0.1 + inherits: 2.0.4 + minimalistic-assert: 1.0.1 + minimalistic-crypto-utils: 1.0.1 + dev: true + + /emoji-regex/8.0.0: + resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} + + /encodeurl/1.0.2: + resolution: {integrity: sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==} + engines: {node: '>= 0.8'} + dev: true + + /encoding/0.1.13: + resolution: {integrity: sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==} + requiresBuild: true + dependencies: + iconv-lite: 0.6.3 + dev: false + optional: true + + /end-of-stream/1.4.4: + resolution: {integrity: sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==} + dependencies: + once: 1.4.0 + + /engine.io-client/6.2.3: + resolution: {integrity: sha512-aXPtgF1JS3RuuKcpSrBtimSjYvrbhKW9froICH4s0F3XQWLxsKNxqzG39nnvQZQnva4CMvUK63T7shevxRyYHw==} + dependencies: + '@socket.io/component-emitter': 3.1.0 + debug: 4.3.4 + engine.io-parser: 5.0.6 + ws: 8.2.3 + xmlhttprequest-ssl: 2.0.0 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + dev: true + + /engine.io-parser/5.0.6: + resolution: {integrity: sha512-tjuoZDMAdEhVnSFleYPCtdL2GXwVTGtNjoeJd9IhIG3C1xs9uwxqRNEu5WpnDZCaozwVlK/nuQhpodhXSIMaxw==} + engines: {node: '>=10.0.0'} + dev: true + + /engine.io/6.2.1: + resolution: {integrity: sha512-ECceEFcAaNRybd3lsGQKas3ZlMVjN3cyWwMP25D2i0zWfyiytVbTpRPa34qrr+FHddtpBVOmq4H/DCv1O0lZRA==} + engines: {node: '>=10.0.0'} + dependencies: + '@types/cookie': 0.4.1 + '@types/cors': 2.8.13 + '@types/node': 18.11.18 + accepts: 1.3.8 + base64id: 2.0.0 + cookie: 0.4.2 + cors: 2.8.5 + debug: 4.3.4 + engine.io-parser: 5.0.6 + ws: 8.2.3 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + dev: true + + /env-paths/2.2.1: + resolution: {integrity: sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==} + engines: {node: '>=6'} + dev: false + + /err-code/2.0.3: + resolution: {integrity: sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==} + dev: false + + /error-ex/1.3.2: + resolution: {integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==} + dependencies: + is-arrayish: 0.2.1 + dev: true + + /es5-ext/0.10.62: + resolution: {integrity: sha512-BHLqn0klhEpnOKSrzn/Xsz2UIW8j+cGmo9JLzr8BiUapV8hPL9+FliFqjwr9ngW7jWdnxv6eO+/LqyhJVqgrjA==} + engines: {node: '>=0.10'} + requiresBuild: true + dependencies: + es6-iterator: 2.0.3 + es6-symbol: 3.1.3 + next-tick: 1.1.0 + dev: true + + /es6-iterator/2.0.3: + resolution: {integrity: sha512-zw4SRzoUkd+cl+ZoE15A9o1oQd920Bb0iOJMQkQhl3jNc03YqVjAhG7scf9C5KWRU/R13Orf588uCC6525o02g==} + dependencies: + d: 1.0.1 + es5-ext: 0.10.62 + es6-symbol: 3.1.3 + dev: true + + /es6-symbol/3.1.3: + resolution: {integrity: sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==} + dependencies: + d: 1.0.1 + ext: 1.7.0 + dev: true + + /es6-weak-map/2.0.3: + resolution: {integrity: sha512-p5um32HOTO1kP+w7PRnB+5lQ43Z6muuMuIMffvDN8ZB4GcnjLBV6zGStpbASIMk4DCAvEaamhe2zhyCb/QXXsA==} + dependencies: + d: 1.0.1 + es5-ext: 0.10.62 + es6-iterator: 2.0.3 + es6-symbol: 3.1.3 + dev: true + + /escalade/3.1.1: + resolution: {integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==} + engines: {node: '>=6'} + dev: true + + /escape-html/1.0.3: + resolution: {integrity: sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==} + dev: true + + /escape-string-regexp/1.0.5: + resolution: {integrity: sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==} + engines: {node: '>=0.8.0'} + dev: true + + /esprima/4.0.1: + resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} + engines: {node: '>=4'} + hasBin: true + dev: true + + /etag/1.8.1: + resolution: {integrity: sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==} + engines: {node: '>= 0.6'} + dev: true + + /eventemitter3/4.0.7: + resolution: {integrity: sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==} + dev: true + + /events/3.3.0: + resolution: {integrity: sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==} + engines: {node: '>=0.8.x'} + dev: true + + /evp_bytestokey/1.0.3: + resolution: {integrity: sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==} + dependencies: + md5.js: 1.3.5 + safe-buffer: 5.2.1 + dev: true + + /expand-brackets/2.1.4: + resolution: {integrity: sha512-w/ozOKR9Obk3qoWeY/WDi6MFta9AoMR+zud60mdnbniMcBxRuFJyDt2LdX/14A1UABeqk+Uk+LDfUpvoGKppZA==} + engines: {node: '>=0.10.0'} + dependencies: + debug: 2.6.9 + define-property: 0.2.5 + extend-shallow: 2.0.1 + posix-character-classes: 0.1.1 + regex-not: 1.0.2 + snapdragon: 0.8.2 + to-regex: 3.0.2 + transitivePeerDependencies: + - supports-color + dev: true + + /expand-template/2.0.3: + resolution: {integrity: sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==} + engines: {node: '>=6'} + dev: false + + /expand-tilde/2.0.2: + resolution: {integrity: sha512-A5EmesHW6rfnZ9ysHQjPdJRni0SRar0tjtG5MNtm9n5TUvsYU8oozprtRD4AqHxcZWWlVuAmQo2nWKfN9oyjTw==} + engines: {node: '>=0.10.0'} + dependencies: + homedir-polyfill: 1.0.3 + dev: true + + /ext/1.7.0: + resolution: {integrity: sha512-6hxeJYaL110a9b5TEJSj0gojyHQAmA2ch5Os+ySCiA1QGdS697XWY1pzsrSjqA9LDEEgdB/KypIlR59RcLuHYw==} + dependencies: + type: 2.7.2 + dev: true + + /extend-shallow/1.1.4: + resolution: {integrity: sha512-L7AGmkO6jhDkEBBGWlLtftA80Xq8DipnrRPr0pyi7GQLXkaq9JYA4xF4z6qnadIC6euiTDKco0cGSU9muw+WTw==} + engines: {node: '>=0.10.0'} + dependencies: + kind-of: 1.1.0 + dev: true + + /extend-shallow/2.0.1: + resolution: {integrity: sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==} + engines: {node: '>=0.10.0'} + dependencies: + is-extendable: 0.1.1 + dev: true + + /extend-shallow/3.0.2: + resolution: {integrity: sha512-BwY5b5Ql4+qZoefgMj2NUmx+tehVTH/Kf4k1ZEtOHNFcm2wSxMRo992l6X3TIgni2eZVTZ85xMOjF31fwZAj6Q==} + engines: {node: '>=0.10.0'} + dependencies: + assign-symbols: 1.0.0 + is-extendable: 1.0.1 + dev: true + + /extend/3.0.2: + resolution: {integrity: sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==} + dev: true + + /extglob/2.0.4: + resolution: {integrity: sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==} + engines: {node: '>=0.10.0'} + dependencies: + array-unique: 0.3.2 + define-property: 1.0.0 + expand-brackets: 2.1.4 + extend-shallow: 2.0.1 + fragment-cache: 0.2.1 + regex-not: 1.0.2 + snapdragon: 0.8.2 + to-regex: 3.0.2 + transitivePeerDependencies: + - supports-color + dev: true + + /fancy-log/1.3.3: + resolution: {integrity: sha512-k9oEhlyc0FrVh25qYuSELjr8oxsCoc4/LEZfg2iJJrfEk/tZL9bCoJE47gqAvI2m/AUjluCS4+3I0eTx8n3AEw==} + engines: {node: '>= 0.10'} + dependencies: + ansi-gray: 0.1.1 + color-support: 1.1.3 + parse-node-version: 1.0.1 + time-stamp: 1.1.0 + dev: true + + /fast-glob/3.2.12: + resolution: {integrity: sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==} + engines: {node: '>=8.6.0'} + dependencies: + '@nodelib/fs.stat': 2.0.5 + '@nodelib/fs.walk': 1.2.8 + glob-parent: 5.1.2 + merge2: 1.4.1 + micromatch: 4.0.5 + dev: true + + /fast-levenshtein/1.1.4: + resolution: {integrity: sha512-Ia0sQNrMPXXkqVFt6w6M1n1oKo3NfKs+mvaV811Jwir7vAk9a6PVV9VPYf6X3BU97QiLEmuW3uXH9u87zDFfdw==} + dev: true + + /fast-safe-stringify/2.1.1: + resolution: {integrity: sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==} + dev: true + + /fastq/1.15.0: + resolution: {integrity: sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==} + dependencies: + reusify: 1.0.4 + dev: true + + /file-uri-to-path/1.0.0: + resolution: {integrity: sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==} + + /fill-range/4.0.0: + resolution: {integrity: sha512-VcpLTWqWDiTerugjj8e3+esbg+skS3M9e54UuR3iCeIDMXCLTsAH8hTSzDQU/X6/6t3eYkOKoZSef2PlU6U1XQ==} + engines: {node: '>=0.10.0'} + dependencies: + extend-shallow: 2.0.1 + is-number: 3.0.0 + repeat-string: 1.6.1 + to-regex-range: 2.1.1 + dev: true + + /fill-range/7.0.1: + resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==} + engines: {node: '>=8'} + dependencies: + to-regex-range: 5.0.1 + dev: true + + /finalhandler/1.1.0: + resolution: {integrity: sha512-ejnvM9ZXYzp6PUPUyQBMBf0Co5VX2gr5H2VQe2Ui2jWXNlxv+PYZo8wpAymJNJdLsG1R4p+M4aynF8KuoUEwRw==} + engines: {node: '>= 0.8'} + dependencies: + debug: 2.6.9 + encodeurl: 1.0.2 + escape-html: 1.0.3 + on-finished: 2.3.0 + parseurl: 1.3.3 + statuses: 1.3.1 + unpipe: 1.0.0 + transitivePeerDependencies: + - supports-color + dev: true + + /find-up/1.1.2: + resolution: {integrity: sha512-jvElSjyuo4EMQGoTwo1uJU5pQMwTW5lS1x05zzfJuTIyLR3zwO27LYrxNg+dlvKpGOuGy/MzBdXh80g0ve5+HA==} + engines: {node: '>=0.10.0'} + dependencies: + path-exists: 2.1.0 + pinkie-promise: 2.0.1 + dev: true + + /find-up/5.0.0: + resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==} + engines: {node: '>=10'} + dependencies: + locate-path: 6.0.0 + path-exists: 4.0.0 + dev: true + + /findup-sync/2.0.0: + resolution: {integrity: sha512-vs+3unmJT45eczmcAZ6zMJtxN3l/QXeccaXQx5cu/MeJMhewVfoWZqibRkOxPnmoR59+Zy5hjabfQc6JLSah4g==} + engines: {node: '>= 0.10'} + dependencies: + detect-file: 1.0.0 + is-glob: 3.1.0 + micromatch: 3.1.10 + resolve-dir: 1.0.1 + transitivePeerDependencies: + - supports-color + dev: true + + /findup-sync/3.0.0: + resolution: {integrity: sha512-YbffarhcicEhOrm4CtrwdKBdCuz576RLdhJDsIfvNtxUuhdRet1qZcsMjqbePtAseKdAnDyM/IyXbu7PRPRLYg==} + engines: {node: '>= 0.10'} + dependencies: + detect-file: 1.0.0 + is-glob: 4.0.3 + micromatch: 3.1.10 + resolve-dir: 1.0.1 + transitivePeerDependencies: + - supports-color + dev: true + + /fined/1.2.0: + resolution: {integrity: sha512-ZYDqPLGxDkDhDZBjZBb+oD1+j0rA4E0pXY50eplAAOPg2N/gUBSSk5IM1/QhPfyVo19lJ+CvXpqfvk+b2p/8Ng==} + engines: {node: '>= 0.10'} + dependencies: + expand-tilde: 2.0.2 + is-plain-object: 2.0.4 + object.defaults: 1.1.0 + object.pick: 1.3.0 + parse-filepath: 1.0.2 + dev: true + + /flagged-respawn/1.0.1: + resolution: {integrity: sha512-lNaHNVymajmk0OJMBn8fVUAU1BtDeKIqKoVhk4xAALB57aALg6b4W0MfJ/cUE0g9YBXy5XhSlPIpYIJ7HaY/3Q==} + engines: {node: '>= 0.10'} + dev: true + + /flush-write-stream/1.1.1: + resolution: {integrity: sha512-3Z4XhFZ3992uIq0XOqb9AreonueSYphE6oYbpt5+3u06JWklbsPkNv3ZKkP9Bz/r+1MWCaMoSQ28P85+1Yc77w==} + dependencies: + inherits: 2.0.4 + readable-stream: 2.3.7 + dev: true + + /follow-redirects/1.15.2_debug@4.3.2: + resolution: {integrity: sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==} + engines: {node: '>=4.0'} + peerDependencies: + debug: '*' + peerDependenciesMeta: + debug: + optional: true + dependencies: + debug: 4.3.2 + dev: true + + /for-each/0.3.3: + resolution: {integrity: sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==} + dependencies: + is-callable: 1.2.7 + dev: true + + /for-in/1.0.2: + resolution: {integrity: sha512-7EwmXrOjyL+ChxMhmG5lnW9MPt1aIeZEwKhQzoBUdTV0N3zuwWDZYVJatDvZ2OyzPUvdIAZDsCetk3coyMfcnQ==} + engines: {node: '>=0.10.0'} + dev: true + + /for-own/1.0.0: + resolution: {integrity: sha512-0OABksIGrxKK8K4kynWkQ7y1zounQxP+CWnyclVwj81KW3vlLlGUx57DKGcP/LH216GzqnstnPocF16Nxs0Ycg==} + engines: {node: '>=0.10.0'} + dependencies: + for-in: 1.0.2 + dev: true + + /foreground-child/2.0.0: + resolution: {integrity: sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==} + engines: {node: '>=8.0.0'} + dependencies: + cross-spawn: 7.0.3 + signal-exit: 3.0.7 + dev: true + + /fragment-cache/0.2.1: + resolution: {integrity: sha512-GMBAbW9antB8iZRHLoGw0b3HANt57diZYFO/HL1JGIC1MjKrdmhxvrJbupnVvpys0zsz7yBApXdQyfepKly2kA==} + engines: {node: '>=0.10.0'} + dependencies: + map-cache: 0.2.2 + dev: true + + /fresh/0.5.2: + resolution: {integrity: sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==} + engines: {node: '>= 0.6'} + dev: true + + /fs-constants/1.0.0: + resolution: {integrity: sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==} + dev: false + + /fs-extra/3.0.1: + resolution: {integrity: sha512-V3Z3WZWVUYd8hoCL5xfXJCaHWYzmtwW5XWYSlLgERi8PWd8bx1kUHUk8L1BT57e49oKnDDD180mjfrHc1yA9rg==} + dependencies: + graceful-fs: 4.2.10 + jsonfile: 3.0.1 + universalify: 0.1.2 + dev: true + + /fs-minipass/2.1.0: + resolution: {integrity: sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==} + engines: {node: '>= 8'} + dependencies: + minipass: 3.3.6 + dev: false + + /fs-mkdirp-stream/1.0.0: + resolution: {integrity: sha512-+vSd9frUnapVC2RZYfL3FCB2p3g4TBhaUmrsWlSudsGdnxIuUvBB2QM1VZeBtc49QFwrp+wQLrDs3+xxDgI5gQ==} + engines: {node: '>= 0.10'} + dependencies: + graceful-fs: 4.2.10 + through2: 2.0.5 + dev: true + + /fs.realpath/1.0.0: + resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} + + /fsevents/1.2.13: + resolution: {integrity: sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==} + engines: {node: '>= 4.0'} + os: [darwin] + deprecated: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2. + requiresBuild: true + dependencies: + bindings: 1.5.0 + nan: 2.17.0 + dev: true + optional: true + + /fsevents/2.3.2: + resolution: {integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==} + engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /function-bind/1.1.1: + resolution: {integrity: sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==} + dev: true + + /gauge/4.0.4: + resolution: {integrity: sha512-f9m+BEN5jkg6a0fZjleidjN51VE1X+mPFQ2DJ0uv1V39oCLCbsGe6yjbBnp7eK7z/+GAon99a3nHuqbuuthyPg==} + engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} + dependencies: + aproba: 2.0.0 + color-support: 1.1.3 + console-control-strings: 1.1.0 + has-unicode: 2.0.1 + signal-exit: 3.0.7 + string-width: 4.2.3 + strip-ansi: 6.0.1 + wide-align: 1.1.5 + dev: false + + /get-assigned-identifiers/1.2.0: + resolution: {integrity: sha512-mBBwmeGTrxEMO4pMaaf/uUEFHnYtwr8FTe8Y/mer4rcV/bye0qGm6pw1bGZFGStxC5O76c5ZAVBGnqHmOaJpdQ==} + dev: true + + /get-caller-file/1.0.3: + resolution: {integrity: sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==} + dev: true + + /get-caller-file/2.0.5: + resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} + engines: {node: 6.* || 8.* || >= 10.*} + dev: true + + /get-intrinsic/1.2.0: + resolution: {integrity: sha512-L049y6nFOuom5wGyRc3/gdTLO94dySVKRACj1RmJZBQXlbTMhtNIgkWkUHq+jYmZvKf14EW1EoJnnjbmoHij0Q==} + dependencies: + function-bind: 1.1.1 + has: 1.0.3 + has-symbols: 1.0.3 + dev: true + + /get-value/2.0.6: + resolution: {integrity: sha512-Ln0UQDlxH1BapMu3GPtf7CuYNwRZf2gwCuPqbyG6pB8WfmFpzqcy4xtAaAMUhnNqjMKTiCPZG2oMT3YSx8U2NA==} + engines: {node: '>=0.10.0'} + dev: true + + /github-from-package/0.0.0: + resolution: {integrity: sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==} + dev: false + + /gl-wiretap/0.6.2: + resolution: {integrity: sha512-fxy1XGiPkfzK+T3XKDbY7yaqMBmozCGvAFyTwaZA3imeZH83w7Hr3r3bYlMRWIyzMI/lDUvUMM/92LE2OwqFyQ==} + dev: false + + /gl/5.0.3: + resolution: {integrity: sha512-toWmb3Rgli5Wl9ygjZeglFBVLDYMOomy+rXlVZVDCoIRV+6mQE5nY4NgQgokYIc5oQzc1pvWY9lQJ0hGn61ZUg==} + engines: {node: '>=12.0.0'} + requiresBuild: true + dependencies: + bindings: 1.5.0 + bit-twiddle: 1.0.2 + glsl-tokenizer: 2.1.5 + nan: 2.17.0 + node-abi: 3.31.0 + node-gyp: 9.3.1 + prebuild-install: 7.1.1 + transitivePeerDependencies: + - bluebird + - supports-color + dev: false + + /glob-parent/3.1.0: + resolution: {integrity: sha512-E8Ak/2+dZY6fnzlR7+ueWvhsH1SjHr4jjss4YS/h4py44jY9MhK/VFdaZJAWDz6BbL21KeteKxFSFpq8OS5gVA==} + dependencies: + is-glob: 3.1.0 + path-dirname: 1.0.2 + dev: true + + /glob-parent/5.1.2: + resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} + engines: {node: '>= 6'} + dependencies: + is-glob: 4.0.3 + dev: true + + /glob-stream/6.1.0: + resolution: {integrity: sha512-uMbLGAP3S2aDOHUDfdoYcdIePUCfysbAd0IAoWVZbeGU/oNQ8asHVSshLDJUPWxfzj8zsCG7/XeHPHTtow0nsw==} + engines: {node: '>= 0.10'} + dependencies: + extend: 3.0.2 + glob: 7.2.3 + glob-parent: 3.1.0 + is-negated-glob: 1.0.0 + ordered-read-streams: 1.0.1 + pumpify: 1.5.1 + readable-stream: 2.3.7 + remove-trailing-separator: 1.1.0 + to-absolute-glob: 2.0.2 + unique-stream: 2.3.1 + dev: true + + /glob-watcher/5.0.5: + resolution: {integrity: sha512-zOZgGGEHPklZNjZQaZ9f41i7F2YwE+tS5ZHrDhbBCk3stwahn5vQxnFmBJZHoYdusR6R1bLSXeGUy/BhctwKzw==} + engines: {node: '>= 0.10'} + dependencies: + anymatch: 2.0.0 + async-done: 1.3.2 + chokidar: 2.1.8 + is-negated-glob: 1.0.0 + just-debounce: 1.1.0 + normalize-path: 3.0.0 + object.defaults: 1.1.0 + transitivePeerDependencies: + - supports-color + dev: true + + /glob/7.2.3: + resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} + dependencies: + fs.realpath: 1.0.0 + inflight: 1.0.6 + inherits: 2.0.4 + minimatch: 3.1.2 + once: 1.4.0 + path-is-absolute: 1.0.1 + + /glob/8.1.0: + resolution: {integrity: sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==} + engines: {node: '>=12'} + dependencies: + fs.realpath: 1.0.0 + inflight: 1.0.6 + inherits: 2.0.4 + minimatch: 5.1.6 + once: 1.4.0 + + /global-modules/1.0.0: + resolution: {integrity: sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==} + engines: {node: '>=0.10.0'} + dependencies: + global-prefix: 1.0.2 + is-windows: 1.0.2 + resolve-dir: 1.0.1 + dev: true + + /global-prefix/1.0.2: + resolution: {integrity: sha512-5lsx1NUDHtSjfg0eHlmYvZKv8/nVqX4ckFbM+FrGcQ+04KWcWFo9P5MxPZYSzUvyzmdTbI7Eix8Q4IbELDqzKg==} + engines: {node: '>=0.10.0'} + dependencies: + expand-tilde: 2.0.2 + homedir-polyfill: 1.0.3 + ini: 1.3.8 + is-windows: 1.0.2 + which: 1.3.1 + dev: true + + /globalyzer/0.1.0: + resolution: {integrity: sha512-40oNTM9UfG6aBmuKxk/giHn5nQ8RVz/SS4Ir6zgzOv9/qC3kKZ9v4etGTcJbEl/NyVQH7FGU7d+X1egr57Md2Q==} + dev: true + + /globby/10.0.2: + resolution: {integrity: sha512-7dUi7RvCoT/xast/o/dLN53oqND4yk0nsHkhRgn9w65C4PofCLOoJ39iSOg+qVDdWQPIEj+eszMHQ+aLVwwQSg==} + engines: {node: '>=8'} + dependencies: + '@types/glob': 7.2.0 + array-union: 2.1.0 + dir-glob: 3.0.1 + fast-glob: 3.2.12 + glob: 7.2.3 + ignore: 5.2.4 + merge2: 1.4.1 + slash: 3.0.0 + dev: true + + /globrex/0.1.2: + resolution: {integrity: sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==} + dev: true + + /glogg/1.0.2: + resolution: {integrity: sha512-5mwUoSuBk44Y4EshyiqcH95ZntbDdTQqA3QYSrxmzj28Ai0vXBGMH1ApSANH14j2sIRtqCEyg6PfsuP7ElOEDA==} + engines: {node: '>= 0.10'} + dependencies: + sparkles: 1.0.1 + dev: true + + /glsl-tokenizer/2.1.5: + resolution: {integrity: sha512-XSZEJ/i4dmz3Pmbnpsy3cKh7cotvFlBiZnDOwnj/05EwNp2XrhQ4XKJxT7/pDt4kp4YcpRSKz8eTV7S+mwV6MA==} + dependencies: + through2: 0.6.5 + dev: false + + /gopd/1.0.1: + resolution: {integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==} + dependencies: + get-intrinsic: 1.2.0 + dev: true + + /gpu-mock.js/1.3.1: + resolution: {integrity: sha512-+lbp8rQ0p1nTa6Gk6HoLiw4yM6JTpql82U+nCF3sZbX4FJWP9PzzF1018dW8K+pbmqRmhLHbn6Bjc6i6tgUpbA==} + peerDependencies: + gpu.js: ^2.10.3 + dev: false + + /graceful-fs/4.2.10: + resolution: {integrity: sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==} + + /gulp-cli/2.3.0: + resolution: {integrity: sha512-zzGBl5fHo0EKSXsHzjspp3y5CONegCm8ErO5Qh0UzFzk2y4tMvzLWhoDokADbarfZRL2pGpRp7yt6gfJX4ph7A==} + engines: {node: '>= 0.10'} + hasBin: true + dependencies: + ansi-colors: 1.1.0 + archy: 1.0.0 + array-sort: 1.0.0 + color-support: 1.1.3 + concat-stream: 1.6.2 + copy-props: 2.0.5 + fancy-log: 1.3.3 + gulplog: 1.0.0 + interpret: 1.4.0 + isobject: 3.0.1 + liftoff: 3.1.0 + matchdep: 2.0.0 + mute-stdout: 1.0.1 + pretty-hrtime: 1.0.3 + replace-homedir: 1.0.0 + semver-greatest-satisfied-range: 1.1.0 + v8flags: 3.2.0 + yargs: 7.1.2 + transitivePeerDependencies: + - supports-color + dev: true + + /gulp-concat/2.6.1: + resolution: {integrity: sha512-a2scActrQrDBpBbR3WUZGyGS1JEPLg5PZJdIa7/Bi3GuKAmPYDK6SFhy/NZq5R8KsKKFvtfR0fakbUCcKGCCjg==} + engines: {node: '>= 0.10'} + dependencies: + concat-with-sourcemaps: 1.1.0 + through2: 2.0.5 + vinyl: 2.2.1 + dev: true + + /gulp-header/1.8.12: + resolution: {integrity: sha512-lh9HLdb53sC7XIZOYzTXM4lFuXElv3EVkSDhsd7DoJBj7hm+Ni7D3qYbb+Rr8DuM8nRanBvkVO9d7askreXGnQ==} + deprecated: Removed event-stream from gulp-header + dependencies: + concat-with-sourcemaps: 1.1.0 + lodash.template: 4.5.0 + through2: 2.0.5 + dev: true + + /gulp-jsbeautifier/2.1.2: + resolution: {integrity: sha512-tZUk4c11zF8xzCCTOEmktxGitv/H2vpAcflZNVU8nxL+G5XxQyLJUJVUKylz7/dax+FXb3YwQYByaJ+yxmo8iw==} + engines: {node: '>=0.10.0'} + dependencies: + chalk: 1.1.3 + fancy-log: 1.3.3 + js-beautify: 1.14.7 + lodash: 4.17.21 + plugin-error: 0.1.2 + rc: 1.2.8 + through2: 2.0.5 + dev: true + + /gulp-rename/1.4.0: + resolution: {integrity: sha512-swzbIGb/arEoFK89tPY58vg3Ok1bw+d35PfUNwWqdo7KM4jkmuGA78JiDNqR+JeZFaeeHnRg9N7aihX3YPmsyg==} + engines: {node: '>=4'} + dev: true + + /gulp-replace/1.1.4: + resolution: {integrity: sha512-SVSF7ikuWKhpAW4l4wapAqPPSToJoiNKsbDoUnRrSgwZHH7lH8pbPeQj1aOVYQrbZKhfSVBxVW+Py7vtulRktw==} + engines: {node: '>=10'} + dependencies: + '@types/node': 18.11.18 + '@types/vinyl': 2.0.7 + istextorbinary: 3.3.0 + replacestream: 4.0.3 + yargs-parser: 21.1.1 + dev: true + + /gulp-strip-comments/2.5.2: + resolution: {integrity: sha512-lb1bW7rsPWDD8f4ZPSguDvmCdjKmjr5HR4yZb9ros3sLl5AfW7oUj8KzY9/VRisT7dG8dL7hVHzNpQEVxfwZGQ==} + dependencies: + decomment: 0.9.5 + plugin-error: 0.1.2 + through2: 2.0.5 + dev: true + + /gulp-uglify-es/3.0.0: + resolution: {integrity: sha512-dQ3czMFFojNgCajcrYl0oa98+YayaQ8kXRdaacpZRZ3iw2sdVURfdt8y8Ki1ogZGQqw8BUawnB7V6NkanxqnDg==} + dependencies: + o-stream: 0.3.0 + plugin-error: 1.0.1 + terser: 5.16.1 + vinyl: 2.2.1 + vinyl-sourcemaps-apply: 0.2.1 + dev: true + + /gulp/4.0.2: + resolution: {integrity: sha512-dvEs27SCZt2ibF29xYgmnwwCYZxdxhQ/+LFWlbAW8y7jt68L/65402Lz3+CKy0Ov4rOs+NERmDq7YlZaDqUIfA==} + engines: {node: '>= 0.10'} + hasBin: true + dependencies: + glob-watcher: 5.0.5 + gulp-cli: 2.3.0 + undertaker: 1.3.0 + vinyl-fs: 3.0.3 + transitivePeerDependencies: + - supports-color + dev: true + + /gulplog/1.0.0: + resolution: {integrity: sha512-hm6N8nrm3Y08jXie48jsC55eCZz9mnb4OirAStEk2deqeyhXU3C1otDVh+ccttMuc1sBi6RX6ZJ720hs9RCvgw==} + engines: {node: '>= 0.10'} + dependencies: + glogg: 1.0.2 + dev: true + + /has-ansi/2.0.0: + resolution: {integrity: sha512-C8vBJ8DwUCx19vhm7urhTuUsr4/IyP6l4VzNQDv+ryHQObW3TTTp9yB68WpYgRe2bbaGuZ/se74IqFeVnMnLZg==} + engines: {node: '>=0.10.0'} + dependencies: + ansi-regex: 2.1.1 + dev: true + + /has-flag/3.0.0: + resolution: {integrity: sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==} + engines: {node: '>=4'} + dev: true + + /has-flag/4.0.0: + resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} + engines: {node: '>=8'} + dev: true + + /has-property-descriptors/1.0.0: + resolution: {integrity: sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==} + dependencies: + get-intrinsic: 1.2.0 + dev: true + + /has-symbols/1.0.3: + resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==} + engines: {node: '>= 0.4'} + dev: true + + /has-tostringtag/1.0.0: + resolution: {integrity: sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==} + engines: {node: '>= 0.4'} + dependencies: + has-symbols: 1.0.3 + dev: true + + /has-unicode/2.0.1: + resolution: {integrity: sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==} + dev: false + + /has-value/0.3.1: + resolution: {integrity: sha512-gpG936j8/MzaeID5Yif+577c17TxaDmhuyVgSwtnL/q8UUTySg8Mecb+8Cf1otgLoD7DDH75axp86ER7LFsf3Q==} + engines: {node: '>=0.10.0'} + dependencies: + get-value: 2.0.6 + has-values: 0.1.4 + isobject: 2.1.0 + dev: true + + /has-value/1.0.0: + resolution: {integrity: sha512-IBXk4GTsLYdQ7Rvt+GRBrFSVEkmuOUy4re0Xjd9kJSUQpnTrWR4/y9RpfexN9vkAPMFuQoeWKwqzPozRTlasGw==} + engines: {node: '>=0.10.0'} + dependencies: + get-value: 2.0.6 + has-values: 1.0.0 + isobject: 3.0.1 + dev: true + + /has-values/0.1.4: + resolution: {integrity: sha512-J8S0cEdWuQbqD9//tlZxiMuMNmxB8PlEwvYwuxsTmR1G5RXUePEX/SJn7aD0GMLieuZYSwNH0cQuJGwnYunXRQ==} + engines: {node: '>=0.10.0'} + dev: true + + /has-values/1.0.0: + resolution: {integrity: sha512-ODYZC64uqzmtfGMEAX/FvZiRyWLpAC3vYnNunURUnkGVTS+mI0smVsWaPydRBsE3g+ok7h960jChO8mFcWlHaQ==} + engines: {node: '>=0.10.0'} + dependencies: + is-number: 3.0.0 + kind-of: 4.0.0 + dev: true + + /has/1.0.3: + resolution: {integrity: sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==} + engines: {node: '>= 0.4.0'} + dependencies: + function-bind: 1.1.1 + dev: true + + /hash-base/3.1.0: + resolution: {integrity: sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==} + engines: {node: '>=4'} + dependencies: + inherits: 2.0.4 + readable-stream: 3.6.0 + safe-buffer: 5.2.1 + dev: true + + /hash.js/1.1.7: + resolution: {integrity: sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==} + dependencies: + inherits: 2.0.4 + minimalistic-assert: 1.0.1 + dev: true + + /hmac-drbg/1.0.1: + resolution: {integrity: sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg==} + dependencies: + hash.js: 1.1.7 + minimalistic-assert: 1.0.1 + minimalistic-crypto-utils: 1.0.1 + dev: true + + /homedir-polyfill/1.0.3: + resolution: {integrity: sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==} + engines: {node: '>=0.10.0'} + dependencies: + parse-passwd: 1.0.0 + dev: true + + /hosted-git-info/2.8.9: + resolution: {integrity: sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==} + dev: true + + /html-escaper/2.0.2: + resolution: {integrity: sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==} + dev: true + + /htmlescape/1.1.1: + resolution: {integrity: sha512-eVcrzgbR4tim7c7soKQKtxa/kQM4TzjnlU83rcZ9bHU6t31ehfV7SktN6McWgwPWg+JYMA/O3qpGxBvFq1z2Jg==} + engines: {node: '>=0.10'} + dev: true + + /http-cache-semantics/4.1.1: + resolution: {integrity: sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==} + dev: false + + /http-errors/1.6.3: + resolution: {integrity: sha512-lks+lVC8dgGyh97jxvxeYTWQFvh4uw4yC12gVl63Cg30sjPX4wuGcdkICVXDAESr6OJGjqGA8Iz5mkeN6zlD7A==} + engines: {node: '>= 0.6'} + dependencies: + depd: 1.1.2 + inherits: 2.0.3 + setprototypeof: 1.1.0 + statuses: 1.4.0 + dev: true + + /http-errors/2.0.0: + resolution: {integrity: sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==} + engines: {node: '>= 0.8'} + dependencies: + depd: 2.0.0 + inherits: 2.0.4 + setprototypeof: 1.2.0 + statuses: 2.0.1 + toidentifier: 1.0.1 + dev: true + + /http-proxy-agent/5.0.0: + resolution: {integrity: sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==} + engines: {node: '>= 6'} + dependencies: + '@tootallnate/once': 2.0.0 + agent-base: 6.0.2 + debug: 4.3.4 + transitivePeerDependencies: + - supports-color + dev: false + + /http-proxy/1.18.1: + resolution: {integrity: sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==} + engines: {node: '>=8.0.0'} + dependencies: + eventemitter3: 4.0.7 + follow-redirects: 1.15.2_debug@4.3.2 + requires-port: 1.0.0 + transitivePeerDependencies: + - debug + dev: true + + /https-browserify/1.0.0: + resolution: {integrity: sha512-J+FkSdyD+0mA0N+81tMotaRMfSL9SGi+xpD3T6YApKsc3bGSXJlfXri3VyFOeYkfLRQisDk1W+jIFFKBeUBbBg==} + dev: true + + /https-proxy-agent/5.0.1: + resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==} + engines: {node: '>= 6'} + dependencies: + agent-base: 6.0.2 + debug: 4.3.4 + transitivePeerDependencies: + - supports-color + dev: false + + /humanize-ms/1.2.1: + resolution: {integrity: sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==} + dependencies: + ms: 2.1.3 + dev: false + + /iconv-lite/0.4.24: + resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} + engines: {node: '>=0.10.0'} + dependencies: + safer-buffer: 2.1.2 + dev: true + + /iconv-lite/0.6.3: + resolution: {integrity: sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==} + engines: {node: '>=0.10.0'} + dependencies: + safer-buffer: 2.1.2 + dev: false + optional: true + + /ieee754/1.2.1: + resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} + + /ignore/5.2.4: + resolution: {integrity: sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==} + engines: {node: '>= 4'} + dev: true + + /immutable/3.8.2: + resolution: {integrity: sha512-15gZoQ38eYjEjxkorfbcgBKBL6R7T459OuK+CpcWt7O3KF4uPCx2tD0uFETlUDIyo+1789crbMhTvQBSR5yBMg==} + engines: {node: '>=0.10.0'} + dev: true + + /imurmurhash/0.1.4: + resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} + engines: {node: '>=0.8.19'} + dev: false + + /indent-string/4.0.0: + resolution: {integrity: sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==} + engines: {node: '>=8'} + dev: false + + /infer-owner/1.0.4: + resolution: {integrity: sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A==} + dev: false + + /inflight/1.0.6: + resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} + dependencies: + once: 1.4.0 + wrappy: 1.0.2 + + /inherits/2.0.1: + resolution: {integrity: sha512-8nWq2nLTAwd02jTqJExUYFSD/fKq6VH9Y/oG2accc/kdI0V98Bag8d5a4gi3XHz73rDWa2PvTtvcWYquKqSENA==} + dev: true + + /inherits/2.0.3: + resolution: {integrity: sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw==} + dev: true + + /inherits/2.0.4: + resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} + + /ini/1.3.8: + resolution: {integrity: sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==} + + /inline-source-map/0.6.2: + resolution: {integrity: sha512-0mVWSSbNDvedDWIN4wxLsdPM4a7cIPcpyMxj3QZ406QRwQ6ePGB1YIHxVPjqpcUGbWQ5C+nHTwGNWAGvt7ggVA==} + dependencies: + source-map: 0.5.7 + dev: true + + /insert-module-globals/7.2.1: + resolution: {integrity: sha512-ufS5Qq9RZN+Bu899eA9QCAYThY+gGW7oRkmb0vC93Vlyu/CFGcH0OYPEjVkDXA5FEbTt1+VWzdoOD3Ny9N+8tg==} + hasBin: true + dependencies: + JSONStream: 1.3.5 + acorn-node: 1.8.2 + combine-source-map: 0.8.0 + concat-stream: 1.6.2 + is-buffer: 1.1.6 + path-is-absolute: 1.0.1 + process: 0.11.10 + through2: 2.0.5 + undeclared-identifiers: 1.1.3 + xtend: 4.0.2 + dev: true + + /interpret/1.4.0: + resolution: {integrity: sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==} + engines: {node: '>= 0.10'} + dev: true + + /invert-kv/1.0.0: + resolution: {integrity: sha512-xgs2NH9AE66ucSq4cNG1nhSFghr5l6tdL15Pk+jl46bmmBapgoaY/AacXyaDznAqmGL99TiLSQgO/XazFSKYeQ==} + engines: {node: '>=0.10.0'} + dev: true + + /ip/2.0.0: + resolution: {integrity: sha512-WKa+XuLG1A1R0UWhl2+1XQSi+fZWMsYKffMZTTYsiZaUD8k2yDAj5atimTUD2TZkyCkNEeYE5NhFZmupOGtjYQ==} + dev: false + + /is-absolute/1.0.0: + resolution: {integrity: sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA==} + engines: {node: '>=0.10.0'} + dependencies: + is-relative: 1.0.0 + is-windows: 1.0.2 + dev: true + + /is-accessor-descriptor/0.1.6: + resolution: {integrity: sha512-e1BM1qnDbMRG3ll2U9dSK0UMHuWOs3pY3AtcFsmvwPtKL3MML/Q86i+GilLfvqEs4GW+ExB91tQ3Ig9noDIZ+A==} + engines: {node: '>=0.10.0'} + dependencies: + kind-of: 3.2.2 + dev: true + + /is-accessor-descriptor/1.0.0: + resolution: {integrity: sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==} + engines: {node: '>=0.10.0'} + dependencies: + kind-of: 6.0.3 + dev: true + + /is-arguments/1.1.1: + resolution: {integrity: sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + has-tostringtag: 1.0.0 + dev: true + + /is-arrayish/0.2.1: + resolution: {integrity: sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==} + dev: true + + /is-binary-path/1.0.1: + resolution: {integrity: sha512-9fRVlXc0uCxEDj1nQzaWONSpbTfx0FmJfzHF7pwlI8DkWGoHBBea4Pg5Ky0ojwwxQmnSifgbKkI06Qv0Ljgj+Q==} + engines: {node: '>=0.10.0'} + dependencies: + binary-extensions: 1.13.1 + dev: true + + /is-binary-path/2.1.0: + resolution: {integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==} + engines: {node: '>=8'} + dependencies: + binary-extensions: 2.2.0 + dev: true + + /is-buffer/1.1.6: + resolution: {integrity: sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==} + dev: true + + /is-callable/1.2.7: + resolution: {integrity: sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==} + engines: {node: '>= 0.4'} + dev: true + + /is-core-module/2.11.0: + resolution: {integrity: sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw==} + dependencies: + has: 1.0.3 + dev: true + + /is-data-descriptor/0.1.4: + resolution: {integrity: sha512-+w9D5ulSoBNlmw9OHn3U2v51SyoCd0he+bB3xMl62oijhrspxowjU+AIcDY0N3iEJbUEkB15IlMASQsxYigvXg==} + engines: {node: '>=0.10.0'} + dependencies: + kind-of: 3.2.2 + dev: true + + /is-data-descriptor/1.0.0: + resolution: {integrity: sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==} + engines: {node: '>=0.10.0'} + dependencies: + kind-of: 6.0.3 + dev: true + + /is-descriptor/0.1.6: + resolution: {integrity: sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==} + engines: {node: '>=0.10.0'} + dependencies: + is-accessor-descriptor: 0.1.6 + is-data-descriptor: 0.1.4 + kind-of: 5.1.0 + dev: true + + /is-descriptor/1.0.2: + resolution: {integrity: sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==} + engines: {node: '>=0.10.0'} + dependencies: + is-accessor-descriptor: 1.0.0 + is-data-descriptor: 1.0.0 + kind-of: 6.0.3 + dev: true + + /is-extendable/0.1.1: + resolution: {integrity: sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==} + engines: {node: '>=0.10.0'} + dev: true + + /is-extendable/1.0.1: + resolution: {integrity: sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==} + engines: {node: '>=0.10.0'} + dependencies: + is-plain-object: 2.0.4 + dev: true + + /is-extglob/2.1.1: + resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} + engines: {node: '>=0.10.0'} + dev: true + + /is-fullwidth-code-point/1.0.0: + resolution: {integrity: sha512-1pqUqRjkhPJ9miNq9SwMfdvi6lBJcd6eFxvfaivQhaH3SgisfiuudvFntdKOmxuee/77l+FPjKrQjWvmPjWrRw==} + engines: {node: '>=0.10.0'} + dependencies: + number-is-nan: 1.0.1 + dev: true + + /is-fullwidth-code-point/3.0.0: + resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} + engines: {node: '>=8'} + + /is-generator-function/1.0.10: + resolution: {integrity: sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==} + engines: {node: '>= 0.4'} + dependencies: + has-tostringtag: 1.0.0 + dev: true + + /is-glob/3.1.0: + resolution: {integrity: sha512-UFpDDrPgM6qpnFNI+rh/p3bUaq9hKLZN8bMUWzxmcnZVS3omf4IPK+BrewlnWjO1WmUsMYuSjKh4UJuV4+Lqmw==} + engines: {node: '>=0.10.0'} + dependencies: + is-extglob: 2.1.1 + dev: true + + /is-glob/4.0.3: + resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} + engines: {node: '>=0.10.0'} + dependencies: + is-extglob: 2.1.1 + dev: true + + /is-lambda/1.0.1: + resolution: {integrity: sha512-z7CMFGNrENq5iFB9Bqo64Xk6Y9sg+epq1myIcdHaGnbMTYOxvzsEtdYqQUylB7LxfkvgrrjP32T6Ywciio9UIQ==} + dev: false + + /is-negated-glob/1.0.0: + resolution: {integrity: sha512-czXVVn/QEmgvej1f50BZ648vUI+em0xqMq2Sn+QncCLN4zj1UAxlT+kw/6ggQTOaZPd1HqKQGEqbpQVtJucWug==} + engines: {node: '>=0.10.0'} + dev: true + + /is-number-like/1.0.8: + resolution: {integrity: sha512-6rZi3ezCyFcn5L71ywzz2bS5b2Igl1En3eTlZlvKjpz1n3IZLAYMbKYAIQgFmEu0GENg92ziU/faEOA/aixjbA==} + dependencies: + lodash.isfinite: 3.3.2 + dev: true + + /is-number/3.0.0: + resolution: {integrity: sha512-4cboCqIpliH+mAvFNegjZQ4kgKc3ZUhQVr3HvWbSh5q3WH2v82ct+T2Y1hdU5Gdtorx/cLifQjqCbL7bpznLTg==} + engines: {node: '>=0.10.0'} + dependencies: + kind-of: 3.2.2 + dev: true + + /is-number/4.0.0: + resolution: {integrity: sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==} + engines: {node: '>=0.10.0'} + dev: true + + /is-number/7.0.0: + resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} + engines: {node: '>=0.12.0'} + dev: true + + /is-path-cwd/2.2.0: + resolution: {integrity: sha512-w942bTcih8fdJPJmQHFzkS76NEP8Kzzvmw92cXsazb8intwLqPibPPdXf4ANdKV3rYMuuQYGIWtvz9JilB3NFQ==} + engines: {node: '>=6'} + dev: true + + /is-path-in-cwd/3.0.0: + resolution: {integrity: sha512-QGuLYLNfpHI/xLQ8ctyeD9mMCf2eBqrtxYWKQxlExrD0l3wBSDcplKYfV55lnTDB4MDvh9SRDt/VnDwVn0dYOw==} + engines: {node: '>=8'} + dependencies: + is-path-inside: 3.0.3 + dev: true + + /is-path-inside/3.0.3: + resolution: {integrity: sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==} + engines: {node: '>=8'} + dev: true + + /is-plain-object/2.0.4: + resolution: {integrity: sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==} + engines: {node: '>=0.10.0'} + dependencies: + isobject: 3.0.1 + dev: true + + /is-plain-object/5.0.0: + resolution: {integrity: sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==} + engines: {node: '>=0.10.0'} + dev: true + + /is-relative/1.0.0: + resolution: {integrity: sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA==} + engines: {node: '>=0.10.0'} + dependencies: + is-unc-path: 1.0.0 + dev: true + + /is-typed-array/1.1.10: + resolution: {integrity: sha512-PJqgEHiWZvMpaFZ3uTc8kHPM4+4ADTlDniuQL7cU/UDA0Ql7F70yGfHph3cLNe+c9toaigv+DFzTJKhc2CtO6A==} + engines: {node: '>= 0.4'} + dependencies: + available-typed-arrays: 1.0.5 + call-bind: 1.0.2 + for-each: 0.3.3 + gopd: 1.0.1 + has-tostringtag: 1.0.0 + dev: true + + /is-unc-path/1.0.0: + resolution: {integrity: sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ==} + engines: {node: '>=0.10.0'} + dependencies: + unc-path-regex: 0.1.2 + dev: true + + /is-utf8/0.2.1: + resolution: {integrity: sha512-rMYPYvCzsXywIsldgLaSoPlw5PfoB/ssr7hY4pLfcodrA5M/eArza1a9VmTiNIBNMjOGr1Ow9mTyU2o69U6U9Q==} + dev: true + + /is-valid-glob/1.0.0: + resolution: {integrity: sha512-AhiROmoEFDSsjx8hW+5sGwgKVIORcXnrlAx/R0ZSeaPw70Vw0CqkGBBhHGL58Uox2eXnU1AnvXJl1XlyedO5bA==} + engines: {node: '>=0.10.0'} + dev: true + + /is-windows/1.0.2: + resolution: {integrity: sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==} + engines: {node: '>=0.10.0'} + dev: true + + /is-wsl/1.1.0: + resolution: {integrity: sha512-gfygJYZ2gLTDlmbWMI0CE2MwnFzSN/2SZfkMlItC4K/JBlsWVDB0bO6XhqcY13YXE7iMcAJnzTCJjPiTeJJ0Mw==} + engines: {node: '>=4'} + dev: true + + /isarray/0.0.1: + resolution: {integrity: sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==} + + /isarray/1.0.0: + resolution: {integrity: sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==} + dev: true + + /isexe/2.0.0: + resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} + + /isobject/2.1.0: + resolution: {integrity: sha512-+OUdGJlgjOBZDfxnDjYYG6zp487z0JGNQq3cYQYg5f5hKR+syHMsaztzGeml/4kGG55CSpKSpWTY+jYGgsHLgA==} + engines: {node: '>=0.10.0'} + dependencies: + isarray: 1.0.0 + dev: true + + /isobject/3.0.1: + resolution: {integrity: sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==} + engines: {node: '>=0.10.0'} + dev: true + + /istanbul-lib-coverage/3.2.0: + resolution: {integrity: sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==} + engines: {node: '>=8'} + dev: true + + /istanbul-lib-report/3.0.0: + resolution: {integrity: sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==} + engines: {node: '>=8'} + dependencies: + istanbul-lib-coverage: 3.2.0 + make-dir: 3.1.0 + supports-color: 7.2.0 + dev: true + + /istanbul-reports/3.1.5: + resolution: {integrity: sha512-nUsEMa9pBt/NOHqbcbeJEgqIlY/K7rVWUX6Lql2orY5e9roQOthbR3vtY4zzf2orPELg80fnxxk9zUyPlgwD1w==} + engines: {node: '>=8'} + dependencies: + html-escaper: 2.0.2 + istanbul-lib-report: 3.0.0 + dev: true + + /istextorbinary/3.3.0: + resolution: {integrity: sha512-Tvq1W6NAcZeJ8op+Hq7tdZ434rqnMx4CCZ7H0ff83uEloDvVbqAwaMTZcafKGJT0VHkYzuXUiCY4hlXQg6WfoQ==} + engines: {node: '>=8'} + dependencies: + binaryextensions: 2.3.0 + textextensions: 3.3.0 + dev: true + + /js-beautify/1.14.7: + resolution: {integrity: sha512-5SOX1KXPFKx+5f6ZrPsIPEY7NwKeQz47n3jm2i+XeHx9MoRsfQenlOP13FQhWvg8JRS0+XLO6XYUQ2GX+q+T9A==} + engines: {node: '>=10'} + hasBin: true + dependencies: + config-chain: 1.1.13 + editorconfig: 0.15.3 + glob: 8.1.0 + nopt: 6.0.0 + dev: true + + /json-stable-stringify-without-jsonify/1.0.1: + resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==} + dev: true + + /jsonfile/3.0.1: + resolution: {integrity: sha512-oBko6ZHlubVB5mRFkur5vgYR1UyqX+S6Y/oCfLhqNdcc2fYFlDpIoNc7AfKS1KOGcnNAkvsr0grLck9ANM815w==} + optionalDependencies: + graceful-fs: 4.2.10 + dev: true + + /jsonparse/1.3.1: + resolution: {integrity: sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg==} + engines: {'0': node >= 0.2.0} + dev: true + + /just-debounce/1.1.0: + resolution: {integrity: sha512-qpcRocdkUmf+UTNBYx5w6dexX5J31AKK1OmPwH630a83DdVVUIngk55RSAiIGpQyoH0dlr872VHfPjnQnK1qDQ==} + dev: true + + /just-extend/4.2.1: + resolution: {integrity: sha512-g3UB796vUFIY90VIv/WX3L2c8CS2MdWUww3CNrYmqza1Fg0DURc2K/O4YrnklBdQarSJ/y8JnJYDGc+1iumQjg==} + dev: true + + /kind-of/1.1.0: + resolution: {integrity: sha512-aUH6ElPnMGon2/YkxRIigV32MOpTVcoXQ1Oo8aYn40s+sJ3j+0gFZsT8HKDcxNy7Fi9zuquWtGaGAahOdv5p/g==} + engines: {node: '>=0.10.0'} + dev: true + + /kind-of/3.2.2: + resolution: {integrity: sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==} + engines: {node: '>=0.10.0'} + dependencies: + is-buffer: 1.1.6 + dev: true + + /kind-of/4.0.0: + resolution: {integrity: sha512-24XsCxmEbRwEDbz/qz3stgin8TTzZ1ESR56OMCN0ujYg+vRutNSiOj9bHH9u85DKgXguraugV5sFuvbD4FW/hw==} + engines: {node: '>=0.10.0'} + dependencies: + is-buffer: 1.1.6 + dev: true + + /kind-of/5.1.0: + resolution: {integrity: sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==} + engines: {node: '>=0.10.0'} + dev: true + + /kind-of/6.0.3: + resolution: {integrity: sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==} + engines: {node: '>=0.10.0'} + dev: true + + /labeled-stream-splicer/2.0.2: + resolution: {integrity: sha512-Ca4LSXFFZUjPScRaqOcFxneA0VpKZr4MMYCljyQr4LIewTLb3Y0IUTIsnBBsVubIeEfxeSZpSjSsRM8APEQaAw==} + dependencies: + inherits: 2.0.4 + stream-splicer: 2.0.1 + dev: true + + /last-run/1.1.1: + resolution: {integrity: sha512-U/VxvpX4N/rFvPzr3qG5EtLKEnNI0emvIQB3/ecEwv+8GHaUKbIB8vxv1Oai5FAF0d0r7LXHhLLe5K/yChm5GQ==} + engines: {node: '>= 0.10'} + dependencies: + default-resolution: 2.0.0 + es6-weak-map: 2.0.3 + dev: true + + /lazystream/1.0.1: + resolution: {integrity: sha512-b94GiNHQNy6JNTrt5w6zNyffMrNkXZb3KTkCZJb2V1xaEGCk093vkZ2jk3tpaeP33/OiXC+WvK9AxUebnf5nbw==} + engines: {node: '>= 0.6.3'} + dependencies: + readable-stream: 2.3.7 + dev: true + + /lcid/1.0.0: + resolution: {integrity: sha512-YiGkH6EnGrDGqLMITnGjXtGmNtjoXw9SVUzcaos8RBi7Ps0VBylkq+vOcY9QE5poLasPCR849ucFUkl0UzUyOw==} + engines: {node: '>=0.10.0'} + dependencies: + invert-kv: 1.0.0 + dev: true + + /lead/1.0.0: + resolution: {integrity: sha512-IpSVCk9AYvLHo5ctcIXxOBpMWUe+4TKN3VPWAKUbJikkmsGp0VrSM8IttVc32D6J4WUsiPE6aEFRNmIoF/gdow==} + engines: {node: '>= 0.10'} + dependencies: + flush-write-stream: 1.1.1 + dev: true + + /liftoff/3.1.0: + resolution: {integrity: sha512-DlIPlJUkCV0Ips2zf2pJP0unEoT1kwYhiiPUGF3s/jtxTCjziNLoiVVh+jqWOWeFi6mmwQ5fNxvAUyPad4Dfog==} + engines: {node: '>= 0.8'} + dependencies: + extend: 3.0.2 + findup-sync: 3.0.0 + fined: 1.2.0 + flagged-respawn: 1.0.1 + is-plain-object: 2.0.4 + object.map: 1.0.1 + rechoir: 0.6.2 + resolve: 1.22.1 + transitivePeerDependencies: + - supports-color + dev: true + + /limiter/1.1.5: + resolution: {integrity: sha512-FWWMIEOxz3GwUI4Ts/IvgVy6LPvoMPgjMdQ185nN6psJyBJ4yOpzqm695/h5umdLJg2vW3GR5iG11MAkR2AzJA==} + dev: true + + /load-json-file/1.1.0: + resolution: {integrity: sha512-cy7ZdNRXdablkXYNI049pthVeXFurRyb9+hA/dZzerZ0pGTx42z+y+ssxBaVV2l70t1muq5IdKhn4UtcoGUY9A==} + engines: {node: '>=0.10.0'} + dependencies: + graceful-fs: 4.2.10 + parse-json: 2.2.0 + pify: 2.3.0 + pinkie-promise: 2.0.1 + strip-bom: 2.0.0 + dev: true + + /localtunnel/2.0.2: + resolution: {integrity: sha512-n418Cn5ynvJd7m/N1d9WVJISLJF/ellZnfsLnx8WBWGzxv/ntNcFkJ1o6se5quUhCplfLGBNL5tYHiq5WF3Nug==} + engines: {node: '>=8.3.0'} + hasBin: true + dependencies: + axios: 0.21.4_debug@4.3.2 + debug: 4.3.2 + openurl: 1.1.1 + yargs: 17.1.1 + transitivePeerDependencies: + - supports-color + dev: true + + /locate-path/6.0.0: + resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==} + engines: {node: '>=10'} + dependencies: + p-locate: 5.0.0 + dev: true + + /lodash._reinterpolate/3.0.0: + resolution: {integrity: sha512-xYHt68QRoYGjeeM/XOE1uJtvXQAgvszfBhjV4yvsQH0u2i9I6cI6c6/eG4Hh3UAOVn0y/xAXwmTzEay49Q//HA==} + dev: true + + /lodash.isfinite/3.3.2: + resolution: {integrity: sha512-7FGG40uhC8Mm633uKW1r58aElFlBlxCrg9JfSi3P6aYiWmfiWF0PgMd86ZUsxE5GwWPdHoS2+48bwTh2VPkIQA==} + dev: true + + /lodash.memoize/3.0.4: + resolution: {integrity: sha512-eDn9kqrAmVUC1wmZvlQ6Uhde44n+tXpqPrN8olQJbttgh0oKclk+SF54P47VEGE9CEiMeRwAP8BaM7UHvBkz2A==} + dev: true + + /lodash.template/4.5.0: + resolution: {integrity: sha512-84vYFxIkmidUiFxidA/KjjH9pAycqW+h980j7Fuz5qxRtO9pgB7MDFTdys1N7A5mcucRiDyEq4fusljItR1T/A==} + dependencies: + lodash._reinterpolate: 3.0.0 + lodash.templatesettings: 4.2.0 + dev: true + + /lodash.templatesettings/4.2.0: + resolution: {integrity: sha512-stgLz+i3Aa9mZgnjr/O+v9ruKZsPsndy7qPZOchbqk2cnTU1ZaldKK+v7m54WoKIyxiuMZTKT2H81F8BeAc3ZQ==} + dependencies: + lodash._reinterpolate: 3.0.0 + dev: true + + /lodash/4.17.21: + resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} + dev: true + + /lolex/4.2.0: + resolution: {integrity: sha512-gKO5uExCXvSm6zbF562EvM+rd1kQDnB9AZBbiQVzf1ZmdDpxUSvpnAaVOP83N/31mRK8Ml8/VE8DMvsAZQ+7wg==} + dev: true + + /lolex/5.1.2: + resolution: {integrity: sha512-h4hmjAvHTmd+25JSwrtTIuwbKdwg5NzZVRMLn9saij4SZaepCrTCxPr35H/3bjwfMJtN+t3CX8672UIkglz28A==} + dependencies: + '@sinonjs/commons': 1.8.6 + dev: true + + /lru-cache/4.1.5: + resolution: {integrity: sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==} + dependencies: + pseudomap: 1.0.2 + yallist: 2.1.2 + dev: true + + /lru-cache/6.0.0: + resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==} + engines: {node: '>=10'} + dependencies: + yallist: 4.0.0 + dev: false + + /lru-cache/7.14.1: + resolution: {integrity: sha512-ysxwsnTKdAx96aTRdhDOCQfDgbHnt8SK0KY8SEjO0wHinhWOFTESbjVCMPbU1uGXg/ch4lifqx0wfjOawU2+WA==} + engines: {node: '>=12'} + dev: false + + /make-dir/3.1.0: + resolution: {integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==} + engines: {node: '>=8'} + dependencies: + semver: 6.3.0 + dev: true + + /make-fetch-happen/10.2.1: + resolution: {integrity: sha512-NgOPbRiaQM10DYXvN3/hhGVI2M5MtITFryzBGxHM5p4wnFxsVCbxkrBrDsk+EZ5OB4jEOT7AjDxtdF+KVEFT7w==} + engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} + dependencies: + agentkeepalive: 4.2.1 + cacache: 16.1.3 + http-cache-semantics: 4.1.1 + http-proxy-agent: 5.0.0 + https-proxy-agent: 5.0.1 + is-lambda: 1.0.1 + lru-cache: 7.14.1 + minipass: 3.3.6 + minipass-collect: 1.0.2 + minipass-fetch: 2.1.2 + minipass-flush: 1.0.5 + minipass-pipeline: 1.2.4 + negotiator: 0.6.3 + promise-retry: 2.0.1 + socks-proxy-agent: 7.0.0 + ssri: 9.0.1 + transitivePeerDependencies: + - bluebird + - supports-color + dev: false + + /make-iterator/1.0.1: + resolution: {integrity: sha512-pxiuXh0iVEq7VM7KMIhs5gxsfxCux2URptUQaXo4iZZJxBAzTPOLE2BumO5dbfVYq/hBJFBR/a1mFDmOx5AGmw==} + engines: {node: '>=0.10.0'} + dependencies: + kind-of: 6.0.3 + dev: true + + /map-cache/0.2.2: + resolution: {integrity: sha512-8y/eV9QQZCiyn1SprXSrCmqJN0yNRATe+PO8ztwqrvrbdRLA3eYJF0yaR0YayLWkMbsQSKWS9N2gPcGEc4UsZg==} + engines: {node: '>=0.10.0'} + dev: true + + /map-visit/1.0.0: + resolution: {integrity: sha512-4y7uGv8bd2WdM9vpQsiQNo41Ln1NvhvDRuVt0k2JZQ+ezN2uaQes7lZeZ+QQUHOLQAtDaBJ+7wCbi+ab/KFs+w==} + engines: {node: '>=0.10.0'} + dependencies: + object-visit: 1.0.1 + dev: true + + /matchdep/2.0.0: + resolution: {integrity: sha512-LFgVbaHIHMqCRuCZyfCtUOq9/Lnzhi7Z0KFUE2fhD54+JN2jLh3hC02RLkqauJ3U4soU6H1J3tfj/Byk7GoEjA==} + engines: {node: '>= 0.10.0'} + dependencies: + findup-sync: 2.0.0 + micromatch: 3.1.10 + resolve: 1.22.1 + stack-trace: 0.0.10 + transitivePeerDependencies: + - supports-color + dev: true + + /md5.js/1.3.5: + resolution: {integrity: sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==} + dependencies: + hash-base: 3.1.0 + inherits: 2.0.4 + safe-buffer: 5.2.1 + dev: true + + /merge-stream/1.0.1: + resolution: {integrity: sha512-e6RM36aegd4f+r8BZCcYXlO2P3H6xbUM6ktL2Xmf45GAOit9bI4z6/3VU7JwllVO1L7u0UDSg/EhzQ5lmMLolA==} + dependencies: + readable-stream: 2.3.7 + dev: true + + /merge2/1.4.1: + resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} + engines: {node: '>= 8'} + dev: true + + /micromatch/3.1.10: + resolution: {integrity: sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==} + engines: {node: '>=0.10.0'} + dependencies: + arr-diff: 4.0.0 + array-unique: 0.3.2 + braces: 2.3.2 + define-property: 2.0.2 + extend-shallow: 3.0.2 + extglob: 2.0.4 + fragment-cache: 0.2.1 + kind-of: 6.0.3 + nanomatch: 1.2.13 + object.pick: 1.3.0 + regex-not: 1.0.2 + snapdragon: 0.8.2 + to-regex: 3.0.2 + transitivePeerDependencies: + - supports-color + dev: true + + /micromatch/4.0.5: + resolution: {integrity: sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==} + engines: {node: '>=8.6'} + dependencies: + braces: 3.0.2 + picomatch: 2.3.1 + dev: true + + /miller-rabin/4.0.1: + resolution: {integrity: sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==} + hasBin: true + dependencies: + bn.js: 4.12.0 + brorand: 1.1.0 + dev: true + + /mime-db/1.52.0: + resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} + engines: {node: '>= 0.6'} + dev: true + + /mime-types/2.1.35: + resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} + engines: {node: '>= 0.6'} + dependencies: + mime-db: 1.52.0 + dev: true + + /mime/1.4.1: + resolution: {integrity: sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ==} + hasBin: true + dev: true + + /mimic-response/3.1.0: + resolution: {integrity: sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==} + engines: {node: '>=10'} + dev: false + + /minimalistic-assert/1.0.1: + resolution: {integrity: sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==} + dev: true + + /minimalistic-crypto-utils/1.0.1: + resolution: {integrity: sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==} + dev: true + + /minimatch/3.1.2: + resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} + dependencies: + brace-expansion: 1.1.11 + + /minimatch/5.1.6: + resolution: {integrity: sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==} + engines: {node: '>=10'} + dependencies: + brace-expansion: 2.0.1 + + /minimist/1.2.7: + resolution: {integrity: sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==} + + /minipass-collect/1.0.2: + resolution: {integrity: sha512-6T6lH0H8OG9kITm/Jm6tdooIbogG9e0tLgpY6mphXSm/A9u8Nq1ryBG+Qspiub9LjWlBPsPS3tWQ/Botq4FdxA==} + engines: {node: '>= 8'} + dependencies: + minipass: 3.3.6 + dev: false + + /minipass-fetch/2.1.2: + resolution: {integrity: sha512-LT49Zi2/WMROHYoqGgdlQIZh8mLPZmOrN2NdJjMXxYe4nkN6FUyuPuOAOedNJDrx0IRGg9+4guZewtp8hE6TxA==} + engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} + dependencies: + minipass: 3.3.6 + minipass-sized: 1.0.3 + minizlib: 2.1.2 + optionalDependencies: + encoding: 0.1.13 + dev: false + + /minipass-flush/1.0.5: + resolution: {integrity: sha512-JmQSYYpPUqX5Jyn1mXaRwOda1uQ8HP5KAT/oDSLCzt1BYRhQU0/hDtsB1ufZfEEzMZ9aAVmsBw8+FWsIXlClWw==} + engines: {node: '>= 8'} + dependencies: + minipass: 3.3.6 + dev: false + + /minipass-pipeline/1.2.4: + resolution: {integrity: sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A==} + engines: {node: '>=8'} + dependencies: + minipass: 3.3.6 + dev: false + + /minipass-sized/1.0.3: + resolution: {integrity: sha512-MbkQQ2CTiBMlA2Dm/5cY+9SWFEN8pzzOXi6rlM5Xxq0Yqbda5ZQy9sU75a673FE9ZK0Zsbr6Y5iP6u9nktfg2g==} + engines: {node: '>=8'} + dependencies: + minipass: 3.3.6 + dev: false + + /minipass/3.3.6: + resolution: {integrity: sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==} + engines: {node: '>=8'} + dependencies: + yallist: 4.0.0 + dev: false + + /minipass/4.0.0: + resolution: {integrity: sha512-g2Uuh2jEKoht+zvO6vJqXmYpflPqzRBT+Th2h01DKh5z7wbY/AZ2gCQ78cP70YoHPyFdY30YBV5WxgLOEwOykw==} + engines: {node: '>=8'} + dependencies: + yallist: 4.0.0 + dev: false + + /minizlib/2.1.2: + resolution: {integrity: sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==} + engines: {node: '>= 8'} + dependencies: + minipass: 3.3.6 + yallist: 4.0.0 + dev: false + + /mitt/1.2.0: + resolution: {integrity: sha512-r6lj77KlwqLhIUku9UWYes7KJtsczvolZkzp8hbaDPPaE24OmWl5s539Mytlj22siEQKosZ26qCBgda2PKwoJw==} + dev: true + + /mixin-deep/1.3.2: + resolution: {integrity: sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==} + engines: {node: '>=0.10.0'} + dependencies: + for-in: 1.0.2 + is-extendable: 1.0.1 + dev: true + + /mkdirp-classic/0.5.3: + resolution: {integrity: sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==} + + /mkdirp/1.0.4: + resolution: {integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==} + engines: {node: '>=10'} + hasBin: true + dev: false + + /module-deps/6.2.3: + resolution: {integrity: sha512-fg7OZaQBcL4/L+AK5f4iVqf9OMbCclXfy/znXRxTVhJSeW5AIlS9AwheYwDaXM3lVW7OBeaeUEY3gbaC6cLlSA==} + engines: {node: '>= 0.8.0'} + hasBin: true + dependencies: + JSONStream: 1.3.5 + browser-resolve: 2.0.0 + cached-path-relative: 1.1.0 + concat-stream: 1.6.2 + defined: 1.0.1 + detective: 5.2.1 + duplexer2: 0.1.4 + inherits: 2.0.4 + parents: 1.0.1 + readable-stream: 2.3.7 + resolve: 1.22.1 + stream-combiner2: 1.1.1 + subarg: 1.0.0 + through2: 2.0.5 + xtend: 4.0.2 + dev: true + + /ms/2.0.0: + resolution: {integrity: sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==} + dev: true + + /ms/2.1.2: + resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} + + /ms/2.1.3: + resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} + dev: false + + /mute-stdout/1.0.1: + resolution: {integrity: sha512-kDcwXR4PS7caBpuRYYBUz9iVixUk3anO3f5OYFiIPwK/20vCzKCHyKoulbiDY1S53zD2bxUpxN/IJ+TnXjfvxg==} + engines: {node: '>= 0.10'} + dev: true + + /nan/2.17.0: + resolution: {integrity: sha512-2ZTgtl0nJsO0KQCjEpxcIr5D+Yv90plTitZt9JBfQvVJDS5seMl3FOvsh3+9CoYWXf/1l5OaZzzF6nDm4cagaQ==} + + /nanomatch/1.2.13: + resolution: {integrity: sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==} + engines: {node: '>=0.10.0'} + dependencies: + arr-diff: 4.0.0 + array-unique: 0.3.2 + define-property: 2.0.2 + extend-shallow: 3.0.2 + fragment-cache: 0.2.1 + is-windows: 1.0.2 + kind-of: 6.0.3 + object.pick: 1.3.0 + regex-not: 1.0.2 + snapdragon: 0.8.2 + to-regex: 3.0.2 + transitivePeerDependencies: + - supports-color + dev: true + + /napi-build-utils/1.0.2: + resolution: {integrity: sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg==} + dev: false + + /negotiator/0.6.3: + resolution: {integrity: sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==} + engines: {node: '>= 0.6'} + + /next-tick/1.1.0: + resolution: {integrity: sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==} + dev: true + + /nise/1.5.3: + resolution: {integrity: sha512-Ymbac/94xeIrMf59REBPOv0thr+CJVFMhrlAkW/gjCIE58BGQdCj0x7KRCb3yz+Ga2Rz3E9XXSvUyyxqqhjQAQ==} + dependencies: + '@sinonjs/formatio': 3.2.2 + '@sinonjs/text-encoding': 0.7.2 + just-extend: 4.2.1 + lolex: 5.1.2 + path-to-regexp: 1.8.0 + dev: true + + /node-abi/3.31.0: + resolution: {integrity: sha512-eSKV6s+APenqVh8ubJyiu/YhZgxQpGP66ntzUb3lY1xB9ukSRaGnx0AIxI+IM+1+IVYC1oWobgG5L3Lt9ARykQ==} + engines: {node: '>=10'} + dependencies: + semver: 7.3.8 + dev: false + + /node-gyp/9.3.1: + resolution: {integrity: sha512-4Q16ZCqq3g8awk6UplT7AuxQ35XN4R/yf/+wSAwcBUAjg7l58RTactWaP8fIDTi0FzI7YcVLujwExakZlfWkXg==} + engines: {node: ^12.13 || ^14.13 || >=16} + hasBin: true + dependencies: + env-paths: 2.2.1 + glob: 7.2.3 + graceful-fs: 4.2.10 + make-fetch-happen: 10.2.1 + nopt: 6.0.0 + npmlog: 6.0.2 + rimraf: 3.0.2 + semver: 7.3.8 + tar: 6.1.13 + which: 2.0.2 + transitivePeerDependencies: + - bluebird + - supports-color + dev: false + + /node-watch/0.7.3: + resolution: {integrity: sha512-3l4E8uMPY1HdMMryPRUAl+oIHtXtyiTlIiESNSVSNxcPfzAFzeTbXFQkZfAwBbo0B1qMSG8nUABx+Gd+YrbKrQ==} + engines: {node: '>=6'} + dev: true + + /nopt/6.0.0: + resolution: {integrity: sha512-ZwLpbTgdhuZUnZzjd7nb1ZV+4DoiC6/sfiVKok72ym/4Tlf+DFdlHYmT2JPmcNNWV6Pi3SDf1kT+A4r9RTuT9g==} + engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} + hasBin: true + dependencies: + abbrev: 1.1.1 + + /normalize-package-data/2.5.0: + resolution: {integrity: sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==} + dependencies: + hosted-git-info: 2.8.9 + resolve: 1.22.1 + semver: 5.7.1 + validate-npm-package-license: 3.0.4 + dev: true + + /normalize-path/2.1.1: + resolution: {integrity: sha512-3pKJwH184Xo/lnH6oyP1q2pMd7HcypqqmRs91/6/i2CGtWwIKGCkOOMTm/zXbgTEWHw1uNpNi/igc3ePOYHb6w==} + engines: {node: '>=0.10.0'} + dependencies: + remove-trailing-separator: 1.1.0 + dev: true + + /normalize-path/3.0.0: + resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} + engines: {node: '>=0.10.0'} + dev: true + + /now-and-later/2.0.1: + resolution: {integrity: sha512-KGvQ0cB70AQfg107Xvs/Fbu+dGmZoTRJp2TaPwcwQm3/7PteUyN2BCgk8KBMPGBUXZdVwyWS8fDCGFygBm19UQ==} + engines: {node: '>= 0.10'} + dependencies: + once: 1.4.0 + dev: true + + /npmlog/6.0.2: + resolution: {integrity: sha512-/vBvz5Jfr9dT/aFWd0FIRf+T/Q2WBsLENygUaFUqstqsycmZAP/t5BvFJTK0viFmSUxiUKTUplWy5vt+rvKIxg==} + engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} + dependencies: + are-we-there-yet: 3.0.1 + console-control-strings: 1.1.0 + gauge: 4.0.4 + set-blocking: 2.0.0 + dev: false + + /number-is-nan/1.0.1: + resolution: {integrity: sha512-4jbtZXNAsfZbAHiiqjLPBiCl16dES1zI4Hpzzxw61Tk+loF+sBDBKx1ICKKKwIqQ7M0mFn1TmkN7euSncWgHiQ==} + engines: {node: '>=0.10.0'} + dev: true + + /o-stream/0.3.0: + resolution: {integrity: sha512-gbzl6qCJZ609x/M2t25HqCYQagFzWYCtQ84jcuObGr+V8D1Am4EVubkF4J+XFs6ukfiv96vNeiBb8FrbbMZYiQ==} + dev: true + + /object-assign/4.1.1: + resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} + engines: {node: '>=0.10.0'} + dev: true + + /object-copy/0.1.0: + resolution: {integrity: sha512-79LYn6VAb63zgtmAteVOWo9Vdj71ZVBy3Pbse+VqxDpEP83XuujMrGqHIwAXJ5I/aM0zU7dIyIAhifVTPrNItQ==} + engines: {node: '>=0.10.0'} + dependencies: + copy-descriptor: 0.1.1 + define-property: 0.2.5 + kind-of: 3.2.2 + dev: true + + /object-inspect/1.12.3: + resolution: {integrity: sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==} + dev: true + + /object-keys/1.1.1: + resolution: {integrity: sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==} + engines: {node: '>= 0.4'} + dev: true + + /object-visit/1.0.1: + resolution: {integrity: sha512-GBaMwwAVK9qbQN3Scdo0OyvgPW7l3lnaVMj84uTOZlswkX0KpF6fyDBJhtTthf7pymztoN36/KEr1DyhF96zEA==} + engines: {node: '>=0.10.0'} + dependencies: + isobject: 3.0.1 + dev: true + + /object.assign/4.1.4: + resolution: {integrity: sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + define-properties: 1.1.4 + has-symbols: 1.0.3 + object-keys: 1.1.1 + dev: true + + /object.defaults/1.1.0: + resolution: {integrity: sha512-c/K0mw/F11k4dEUBMW8naXUuBuhxRCfG7W+yFy8EcijU/rSmazOUd1XAEEe6bC0OuXY4HUKjTJv7xbxIMqdxrA==} + engines: {node: '>=0.10.0'} + dependencies: + array-each: 1.0.1 + array-slice: 1.1.0 + for-own: 1.0.0 + isobject: 3.0.1 + dev: true + + /object.map/1.0.1: + resolution: {integrity: sha512-3+mAJu2PLfnSVGHwIWubpOFLscJANBKuB/6A4CxBstc4aqwQY0FWcsppuy4jU5GSB95yES5JHSI+33AWuS4k6w==} + engines: {node: '>=0.10.0'} + dependencies: + for-own: 1.0.0 + make-iterator: 1.0.1 + dev: true + + /object.pick/1.3.0: + resolution: {integrity: sha512-tqa/UMy/CCoYmj+H5qc07qvSL9dqcs/WZENZ1JbtWBlATP+iVOe778gE6MSijnyCnORzDuX6hU+LA4SZ09YjFQ==} + engines: {node: '>=0.10.0'} + dependencies: + isobject: 3.0.1 + dev: true + + /object.reduce/1.0.1: + resolution: {integrity: sha512-naLhxxpUESbNkRqc35oQ2scZSJueHGQNUfMW/0U37IgN6tE2dgDWg3whf+NEliy3F/QysrO48XKUz/nGPe+AQw==} + engines: {node: '>=0.10.0'} + dependencies: + for-own: 1.0.0 + make-iterator: 1.0.1 + dev: true + + /on-finished/2.3.0: + resolution: {integrity: sha512-ikqdkGAAyf/X/gPhXGvfgAytDZtDbr+bkNUJ0N9h5MI/dmdgCs3l6hoHrcUv41sRKew3jIwrp4qQDXiK99Utww==} + engines: {node: '>= 0.8'} + dependencies: + ee-first: 1.1.1 + dev: true + + /once/1.4.0: + resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} + dependencies: + wrappy: 1.0.2 + + /openurl/1.1.1: + resolution: {integrity: sha512-d/gTkTb1i1GKz5k3XE3XFV/PxQ1k45zDqGP2OA7YhgsaLoqm6qRvARAZOFer1fcXritWlGBRCu/UgeS4HAnXAA==} + dev: true + + /opn/5.3.0: + resolution: {integrity: sha512-bYJHo/LOmoTd+pfiYhfZDnf9zekVJrY+cnS2a5F2x+w5ppvTqObojTP7WiFG+kVZs9Inw+qQ/lw7TroWwhdd2g==} + engines: {node: '>=4'} + dependencies: + is-wsl: 1.1.0 + dev: true + + /ordered-read-streams/1.0.1: + resolution: {integrity: sha512-Z87aSjx3r5c0ZB7bcJqIgIRX5bxR7A4aSzvIbaxd0oTkWBCOoKfuGHiKj60CHVUgg1Phm5yMZzBdt8XqRs73Mw==} + dependencies: + readable-stream: 2.3.7 + dev: true + + /os-browserify/0.3.0: + resolution: {integrity: sha512-gjcpUc3clBf9+210TRaDWbf+rZZZEshZ+DlXMRCeAjp0xhTrnQsKHypIy1J3d5hKdUzj69t708EHtU8P6bUn0A==} + dev: true + + /os-locale/1.4.0: + resolution: {integrity: sha512-PRT7ZORmwu2MEFt4/fv3Q+mEfN4zetKxufQrkShY2oGvUms9r8otu5HfdyIFHkYXjO7laNsoVGmM2MANfuTA8g==} + engines: {node: '>=0.10.0'} + dependencies: + lcid: 1.0.0 + dev: true + + /p-limit/3.1.0: + resolution: {integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==} + engines: {node: '>=10'} + dependencies: + yocto-queue: 0.1.0 + dev: true + + /p-locate/5.0.0: + resolution: {integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==} + engines: {node: '>=10'} + dependencies: + p-limit: 3.1.0 + dev: true + + /p-map/4.0.0: + resolution: {integrity: sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==} + engines: {node: '>=10'} + dependencies: + aggregate-error: 3.1.0 + dev: false + + /pako/1.0.11: + resolution: {integrity: sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==} + dev: true + + /parents/1.0.1: + resolution: {integrity: sha512-mXKF3xkoUt5td2DoxpLmtOmZvko9VfFpwRwkKDHSNvgmpLAeBo18YDhcPbBzJq+QLCHMbGOfzia2cX4U+0v9Mg==} + dependencies: + path-platform: 0.11.15 + dev: true + + /parse-asn1/5.1.6: + resolution: {integrity: sha512-RnZRo1EPU6JBnra2vGHj0yhp6ebyjBZpmUCLHWiFhxlzvBCCpAuZ7elsBp1PVAbQN0/04VD/19rfzlBSwLstMw==} + dependencies: + asn1.js: 5.4.1 + browserify-aes: 1.2.0 + evp_bytestokey: 1.0.3 + pbkdf2: 3.1.2 + safe-buffer: 5.2.1 + dev: true + + /parse-filepath/1.0.2: + resolution: {integrity: sha512-FwdRXKCohSVeXqwtYonZTXtbGJKrn+HNyWDYVcp5yuJlesTwNH4rsmRZ+GrKAPJ5bLpRxESMeS+Rl0VCHRvB2Q==} + engines: {node: '>=0.8'} + dependencies: + is-absolute: 1.0.0 + map-cache: 0.2.2 + path-root: 0.1.1 + dev: true + + /parse-json/2.2.0: + resolution: {integrity: sha512-QR/GGaKCkhwk1ePQNYDRKYZ3mwU9ypsKhB0XyFnLQdomyEqk3e8wpW3V5Jp88zbxK4n5ST1nqo+g9juTpownhQ==} + engines: {node: '>=0.10.0'} + dependencies: + error-ex: 1.3.2 + dev: true + + /parse-node-version/1.0.1: + resolution: {integrity: sha512-3YHlOa/JgH6Mnpr05jP9eDG254US9ek25LyIxZlDItp2iJtwyaXQb57lBYLdT3MowkUFYEV2XXNAYIPlESvJlA==} + engines: {node: '>= 0.10'} + dev: true + + /parse-passwd/1.0.0: + resolution: {integrity: sha512-1Y1A//QUXEZK7YKz+rD9WydcE1+EuPr6ZBgKecAB8tmoW6UFv0NREVJe1p+jRxtThkcbbKkfwIbWJe/IeE6m2Q==} + engines: {node: '>=0.10.0'} + dev: true + + /parseurl/1.3.3: + resolution: {integrity: sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==} + engines: {node: '>= 0.8'} + dev: true + + /pascalcase/0.1.1: + resolution: {integrity: sha512-XHXfu/yOQRy9vYOtUDVMN60OEJjW013GoObG1o+xwQTpB9eYJX/BjXMsdW13ZDPruFhYYn0AG22w0xgQMwl3Nw==} + engines: {node: '>=0.10.0'} + dev: true + + /path-browserify/1.0.1: + resolution: {integrity: sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==} + dev: true + + /path-dirname/1.0.2: + resolution: {integrity: sha512-ALzNPpyNq9AqXMBjeymIjFDAkAFH06mHJH/cSBHAgU0s4vfpBn6b2nf8tiRLvagKD8RbTpq2FKTBg7cl9l3c7Q==} + dev: true + + /path-exists/2.1.0: + resolution: {integrity: sha512-yTltuKuhtNeFJKa1PiRzfLAU5182q1y4Eb4XCJ3PBqyzEDkAZRzBrKKBct682ls9reBVHf9udYLN5Nd+K1B9BQ==} + engines: {node: '>=0.10.0'} + dependencies: + pinkie-promise: 2.0.1 + dev: true + + /path-exists/4.0.0: + resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} + engines: {node: '>=8'} + dev: true + + /path-is-absolute/1.0.1: + resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} + engines: {node: '>=0.10.0'} + + /path-key/3.1.1: + resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} + engines: {node: '>=8'} + dev: true + + /path-parse/1.0.7: + resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} + dev: true + + /path-platform/0.11.15: + resolution: {integrity: sha512-Y30dB6rab1A/nfEKsZxmr01nUotHX0c/ZiIAsCTatEe1CmS5Pm5He7fZ195bPT7RdquoaL8lLxFCMQi/bS7IJg==} + engines: {node: '>= 0.8.0'} + dev: true + + /path-root-regex/0.1.2: + resolution: {integrity: sha512-4GlJ6rZDhQZFE0DPVKh0e9jmZ5egZfxTkp7bcRDuPlJXbAwhxcl2dINPUAsjLdejqaLsCeg8axcLjIbvBjN4pQ==} + engines: {node: '>=0.10.0'} + dev: true + + /path-root/0.1.1: + resolution: {integrity: sha512-QLcPegTHF11axjfojBIoDygmS2E3Lf+8+jI6wOVmNVenrKSo3mFdSGiIgdSHenczw3wPtlVMQaFVwGmM7BJdtg==} + engines: {node: '>=0.10.0'} + dependencies: + path-root-regex: 0.1.2 + dev: true + + /path-sort2/1.0.0: + resolution: {integrity: sha512-OwUzmr3+avyEANhpUkUv+nlwAM/sCX5y9Ylok8fj3OK3SmLclq7jyEoqSL5qi+5bJAOskWGZPtdtjnoRGy5lxA==} + dev: true + + /path-to-regexp/1.8.0: + resolution: {integrity: sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==} + dependencies: + isarray: 0.0.1 + dev: true + + /path-type/1.1.0: + resolution: {integrity: sha512-S4eENJz1pkiQn9Znv33Q+deTOKmbl+jj1Fl+qiP/vYezj+S8x+J3Uo0ISrx/QoEvIlOaDWJhPaRd1flJ9HXZqg==} + engines: {node: '>=0.10.0'} + dependencies: + graceful-fs: 4.2.10 + pify: 2.3.0 + pinkie-promise: 2.0.1 + dev: true + + /path-type/4.0.0: + resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==} + engines: {node: '>=8'} + dev: true + + /pbkdf2/3.1.2: + resolution: {integrity: sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA==} + engines: {node: '>=0.12'} + dependencies: + create-hash: 1.2.0 + create-hmac: 1.1.7 + ripemd160: 2.0.2 + safe-buffer: 5.2.1 + sha.js: 2.4.11 + dev: true + + /picomatch/2.3.1: + resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} + engines: {node: '>=8.6'} + dev: true + + /pify/2.3.0: + resolution: {integrity: sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==} + engines: {node: '>=0.10.0'} + dev: true + + /pinkie-promise/2.0.1: + resolution: {integrity: sha512-0Gni6D4UcLTbv9c57DfxDGdr41XfgUjqWZu492f0cIGr16zDU06BWP/RAEvOuo7CQ0CNjHaLlM59YJJFm3NWlw==} + engines: {node: '>=0.10.0'} + dependencies: + pinkie: 2.0.4 + dev: true + + /pinkie/2.0.4: + resolution: {integrity: sha512-MnUuEycAemtSaeFSjXKW/aroV7akBbY+Sv+RkyqFjgAe73F+MR0TBWKBRDkmfWq/HiFmdavfZ1G7h4SPZXaCSg==} + engines: {node: '>=0.10.0'} + dev: true + + /platform/1.3.6: + resolution: {integrity: sha512-fnWVljUchTro6RiCFvCXBbNhJc2NijN7oIQxbwsyL0buWJPG85v81ehlHI9fXrJsMNgTofEoWIQeClKpgxFLrg==} + dev: true + + /plugin-error/0.1.2: + resolution: {integrity: sha512-WzZHcm4+GO34sjFMxQMqZbsz3xiNEgonCskQ9v+IroMmYgk/tas8dG+Hr2D6IbRPybZ12oWpzE/w3cGJ6FJzOw==} + engines: {node: '>=0.10.0'} + dependencies: + ansi-cyan: 0.1.1 + ansi-red: 0.1.1 + arr-diff: 1.1.0 + arr-union: 2.1.0 + extend-shallow: 1.1.4 + dev: true + + /plugin-error/1.0.1: + resolution: {integrity: sha512-L1zP0dk7vGweZME2i+EeakvUNqSrdiI3F91TwEoYiGrAfUXmVv6fJIq4g82PAXxNsWOp0J7ZqQy/3Szz0ajTxA==} + engines: {node: '>= 0.10'} + dependencies: + ansi-colors: 1.1.0 + arr-diff: 4.0.0 + arr-union: 3.1.0 + extend-shallow: 3.0.2 + dev: true + + /portscanner/2.2.0: + resolution: {integrity: sha512-IFroCz/59Lqa2uBvzK3bKDbDDIEaAY8XJ1jFxcLWTqosrsc32//P4VuSB2vZXoHiHqOmx8B5L5hnKOxL/7FlPw==} + engines: {node: '>=0.4', npm: '>=1.0.0'} + dependencies: + async: 2.6.4 + is-number-like: 1.0.8 + dev: true + + /posix-character-classes/0.1.1: + resolution: {integrity: sha512-xTgYBc3fuo7Yt7JbiuFxSYGToMoz8fLoE6TC9Wx1P/u+LfeThMOAqmuyECnlBaaJb+u1m9hHiXUEtwW4OzfUJg==} + engines: {node: '>=0.10.0'} + dev: true + + /prebuild-install/7.1.1: + resolution: {integrity: sha512-jAXscXWMcCK8GgCoHOfIr0ODh5ai8mj63L2nWrjuAgXE6tDyYGnx4/8o/rCgU+B4JSyZBKbeZqzhtwtC3ovxjw==} + engines: {node: '>=10'} + hasBin: true + dependencies: + detect-libc: 2.0.1 + expand-template: 2.0.3 + github-from-package: 0.0.0 + minimist: 1.2.7 + mkdirp-classic: 0.5.3 + napi-build-utils: 1.0.2 + node-abi: 3.31.0 + pump: 3.0.0 + rc: 1.2.8 + simple-get: 4.0.1 + tar-fs: 2.1.1 + tunnel-agent: 0.6.0 + dev: false + + /pretty-hrtime/1.0.3: + resolution: {integrity: sha512-66hKPCr+72mlfiSjlEB1+45IjXSqvVAIy6mocupoww4tBFE9R9IhwwUGoI4G++Tc9Aq+2rxOt0RFU6gPcrte0A==} + engines: {node: '>= 0.8'} + dev: true + + /process-nextick-args/2.0.1: + resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==} + dev: true + + /process/0.11.10: + resolution: {integrity: sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==} + engines: {node: '>= 0.6.0'} + dev: true + + /promise-inflight/1.0.1: + resolution: {integrity: sha512-6zWPyEOFaQBJYcGMHBKTKJ3u6TBsnMFOIZSa6ce1e/ZrrsOlnHRHbabMjLiBYKp+n44X9eUI6VUPaukCXHuG4g==} + peerDependencies: + bluebird: '*' + peerDependenciesMeta: + bluebird: + optional: true + dev: false + + /promise-retry/2.0.1: + resolution: {integrity: sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g==} + engines: {node: '>=10'} + dependencies: + err-code: 2.0.3 + retry: 0.12.0 + dev: false + + /proto-list/1.2.4: + resolution: {integrity: sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==} + dev: true + + /pseudomap/1.0.2: + resolution: {integrity: sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ==} + dev: true + + /public-encrypt/4.0.3: + resolution: {integrity: sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==} + dependencies: + bn.js: 4.12.0 + browserify-rsa: 4.1.0 + create-hash: 1.2.0 + parse-asn1: 5.1.6 + randombytes: 2.1.0 + safe-buffer: 5.2.1 + dev: true + + /pump/2.0.1: + resolution: {integrity: sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==} + dependencies: + end-of-stream: 1.4.4 + once: 1.4.0 + dev: true + + /pump/3.0.0: + resolution: {integrity: sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==} + dependencies: + end-of-stream: 1.4.4 + once: 1.4.0 + dev: false + + /pumpify/1.5.1: + resolution: {integrity: sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ==} + dependencies: + duplexify: 3.7.1 + inherits: 2.0.4 + pump: 2.0.1 + dev: true + + /punycode/1.3.2: + resolution: {integrity: sha512-RofWgt/7fL5wP1Y7fxE7/EmTLzQVnB0ycyibJ0OOHIlJqTNzglYFxVwETOcIoJqJmpDXJ9xImDv+Fq34F/d4Dw==} + dev: true + + /punycode/1.4.1: + resolution: {integrity: sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ==} + dev: true + + /qs/6.11.0: + resolution: {integrity: sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==} + engines: {node: '>=0.6'} + dependencies: + side-channel: 1.0.4 + dev: true + + /querystring-es3/0.2.1: + resolution: {integrity: sha512-773xhDQnZBMFobEiztv8LIl70ch5MSF/jUQVlhwFyBILqq96anmoctVIYz+ZRp0qbCKATTn6ev02M3r7Ga5vqA==} + engines: {node: '>=0.4.x'} + dev: true + + /querystring/0.2.0: + resolution: {integrity: sha512-X/xY82scca2tau62i9mDyU9K+I+djTMUsvwf7xnUX5GLvVzgJybOJf4Y6o9Zx3oJK/LSXg5tTZBjwzqVPaPO2g==} + engines: {node: '>=0.4.x'} + deprecated: The querystring API is considered Legacy. new code should use the URLSearchParams API instead. + dev: true + + /queue-microtask/1.2.3: + resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} + dev: true + + /qunit/2.19.4: + resolution: {integrity: sha512-aqUzzUeCqlleWYKlpgfdHHw9C6KxkB9H3wNfiBg5yHqQMzy0xw/pbCRHYFkjl8MsP/t8qkTQE+JTYL71azgiew==} + engines: {node: '>=10'} + hasBin: true + dependencies: + commander: 7.2.0 + node-watch: 0.7.3 + tiny-glob: 0.2.9 + dev: true + + /randombytes/2.1.0: + resolution: {integrity: sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==} + dependencies: + safe-buffer: 5.2.1 + dev: true + + /randomfill/1.0.4: + resolution: {integrity: sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==} + dependencies: + randombytes: 2.1.0 + safe-buffer: 5.2.1 + dev: true + + /range-parser/1.2.1: + resolution: {integrity: sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==} + engines: {node: '>= 0.6'} + dev: true + + /raw-body/2.5.1: + resolution: {integrity: sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==} + engines: {node: '>= 0.8'} + dependencies: + bytes: 3.1.2 + http-errors: 2.0.0 + iconv-lite: 0.4.24 + unpipe: 1.0.0 + dev: true + + /rc/1.2.8: + resolution: {integrity: sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==} + hasBin: true + dependencies: + deep-extend: 0.6.0 + ini: 1.3.8 + minimist: 1.2.7 + strip-json-comments: 2.0.1 + + /read-dir-deep/7.0.1: + resolution: {integrity: sha512-w99fvgqJm3cJ5Vb7b3oGKRDnm/m11q7w5LQ9uBCXe+repIEf1rFtkXLlPAxNrSwlp4skyPyvKd4DNNiIuc0geg==} + engines: {node: '>=8.9.0'} + dependencies: + globby: 10.0.2 + is-path-cwd: 2.2.0 + is-path-in-cwd: 3.0.0 + path-sort2: 1.0.0 + slash: 3.0.0 + dev: true + + /read-only-stream/2.0.0: + resolution: {integrity: sha512-3ALe0bjBVZtkdWKIcThYpQCLbBMd/+Tbh2CDSrAIDO3UsZ4Xs+tnyjv2MjCOMMgBG+AsUOeuP1cgtY1INISc8w==} + dependencies: + readable-stream: 2.3.7 + dev: true + + /read-pkg-up/1.0.1: + resolution: {integrity: sha512-WD9MTlNtI55IwYUS27iHh9tK3YoIVhxis8yKhLpTqWtml739uXc9NWTpxoHkfZf3+DkCCsXox94/VWZniuZm6A==} + engines: {node: '>=0.10.0'} + dependencies: + find-up: 1.1.2 + read-pkg: 1.1.0 + dev: true + + /read-pkg/1.1.0: + resolution: {integrity: sha512-7BGwRHqt4s/uVbuyoeejRn4YmFnYZiFl4AuaeXHlgZf3sONF0SOGlxs2Pw8g6hCKupo08RafIO5YXFNOKTfwsQ==} + engines: {node: '>=0.10.0'} + dependencies: + load-json-file: 1.1.0 + normalize-package-data: 2.5.0 + path-type: 1.1.0 + dev: true + + /readable-stream/1.0.34: + resolution: {integrity: sha512-ok1qVCJuRkNmvebYikljxJA/UEsKwLl2nI1OmaqAu4/UE+h0wKCHok4XkL/gvi39OacXvw59RJUOFUkDib2rHg==} + dependencies: + core-util-is: 1.0.3 + inherits: 2.0.4 + isarray: 0.0.1 + string_decoder: 0.10.31 + dev: false + + /readable-stream/2.3.7: + resolution: {integrity: sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==} + dependencies: + core-util-is: 1.0.3 + inherits: 2.0.4 + isarray: 1.0.0 + process-nextick-args: 2.0.1 + safe-buffer: 5.1.2 + string_decoder: 1.1.1 + util-deprecate: 1.0.2 + dev: true + + /readable-stream/3.6.0: + resolution: {integrity: sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==} + engines: {node: '>= 6'} + dependencies: + inherits: 2.0.4 + string_decoder: 1.3.0 + util-deprecate: 1.0.2 + + /readdirp/2.2.1: + resolution: {integrity: sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==} + engines: {node: '>=0.10'} + dependencies: + graceful-fs: 4.2.10 + micromatch: 3.1.10 + readable-stream: 2.3.7 + transitivePeerDependencies: + - supports-color + dev: true + + /readdirp/3.6.0: + resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==} + engines: {node: '>=8.10.0'} + dependencies: + picomatch: 2.3.1 + dev: true + + /rechoir/0.6.2: + resolution: {integrity: sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw==} + engines: {node: '>= 0.10'} + dependencies: + resolve: 1.22.1 + dev: true + + /regex-not/1.0.2: + resolution: {integrity: sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==} + engines: {node: '>=0.10.0'} + dependencies: + extend-shallow: 3.0.2 + safe-regex: 1.1.0 + dev: true + + /remove-bom-buffer/3.0.0: + resolution: {integrity: sha512-8v2rWhaakv18qcvNeli2mZ/TMTL2nEyAKRvzo1WtnZBl15SHyEhrCu2/xKlJyUFKHiHgfXIyuY6g2dObJJycXQ==} + engines: {node: '>=0.10.0'} + dependencies: + is-buffer: 1.1.6 + is-utf8: 0.2.1 + dev: true + + /remove-bom-stream/1.2.0: + resolution: {integrity: sha512-wigO8/O08XHb8YPzpDDT+QmRANfW6vLqxfaXm1YXhnFf3AkSLyjfG3GEFg4McZkmgL7KvCj5u2KczkvSP6NfHA==} + engines: {node: '>= 0.10'} + dependencies: + remove-bom-buffer: 3.0.0 + safe-buffer: 5.2.1 + through2: 2.0.5 + dev: true + + /remove-trailing-separator/1.1.0: + resolution: {integrity: sha512-/hS+Y0u3aOfIETiaiirUFwDBDzmXPvO+jAfKTitUngIPzdKc6Z0LoFjM/CK5PL4C+eKwHohlHAb6H0VFfmmUsw==} + dev: true + + /repeat-element/1.1.4: + resolution: {integrity: sha512-LFiNfRcSu7KK3evMyYOuCzv3L10TW7yC1G2/+StMjK8Y6Vqd2MG7r/Qjw4ghtuCOjFvlnms/iMmLqpvW/ES/WQ==} + engines: {node: '>=0.10.0'} + dev: true + + /repeat-string/1.6.1: + resolution: {integrity: sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w==} + engines: {node: '>=0.10'} + dev: true + + /replace-ext/1.0.1: + resolution: {integrity: sha512-yD5BHCe7quCgBph4rMQ+0KkIRKwWCrHDOX1p1Gp6HwjPM5kVoCdKGNhN7ydqqsX6lJEnQDKZ/tFMiEdQ1dvPEw==} + engines: {node: '>= 0.10'} + dev: true + + /replace-homedir/1.0.0: + resolution: {integrity: sha512-CHPV/GAglbIB1tnQgaiysb8H2yCy8WQ7lcEwQ/eT+kLj0QHV8LnJW0zpqpE7RSkrMSRoa+EBoag86clf7WAgSg==} + engines: {node: '>= 0.10'} + dependencies: + homedir-polyfill: 1.0.3 + is-absolute: 1.0.0 + remove-trailing-separator: 1.1.0 + dev: true + + /replacestream/4.0.3: + resolution: {integrity: sha512-AC0FiLS352pBBiZhd4VXB1Ab/lh0lEgpP+GGvZqbQh8a5cmXVoTe5EX/YeTFArnp4SRGTHh1qCHu9lGs1qG8sA==} + dependencies: + escape-string-regexp: 1.0.5 + object-assign: 4.1.1 + readable-stream: 2.3.7 + dev: true + + /require-directory/2.1.1: + resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} + engines: {node: '>=0.10.0'} + dev: true + + /require-main-filename/1.0.1: + resolution: {integrity: sha512-IqSUtOVP4ksd1C/ej5zeEh/BIP2ajqpn8c5x+q99gvcIG/Qf0cud5raVnE/Dwd0ua9TXYDoDc0RE5hBSdz22Ug==} + dev: true + + /requires-port/1.0.0: + resolution: {integrity: sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==} + dev: true + + /resolve-dir/1.0.1: + resolution: {integrity: sha512-R7uiTjECzvOsWSfdM0QKFNBVFcK27aHOUwdvK53BcW8zqnGdYp0Fbj82cy54+2A4P2tFM22J5kRfe1R+lM/1yg==} + engines: {node: '>=0.10.0'} + dependencies: + expand-tilde: 2.0.2 + global-modules: 1.0.0 + dev: true + + /resolve-options/1.1.0: + resolution: {integrity: sha512-NYDgziiroVeDC29xq7bp/CacZERYsA9bXYd1ZmcJlF3BcrZv5pTb4NG7SjdyKDnXZ84aC4vo2u6sNKIA1LCu/A==} + engines: {node: '>= 0.10'} + dependencies: + value-or-function: 3.0.0 + dev: true + + /resolve-url/0.2.1: + resolution: {integrity: sha512-ZuF55hVUQaaczgOIwqWzkEcEidmlD/xl44x1UZnhOXcYuFN2S6+rcxpG+C1N3So0wvNI3DmJICUFfu2SxhBmvg==} + deprecated: https://github.com/lydell/resolve-url#deprecated + dev: true + + /resolve/1.22.1: + resolution: {integrity: sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==} + hasBin: true + dependencies: + is-core-module: 2.11.0 + path-parse: 1.0.7 + supports-preserve-symlinks-flag: 1.0.0 + dev: true + + /resp-modifier/6.0.2: + resolution: {integrity: sha512-U1+0kWC/+4ncRFYqQWTx/3qkfE6a4B/h3XXgmXypfa0SPZ3t7cbbaFk297PjQS/yov24R18h6OZe6iZwj3NSLw==} + engines: {node: '>= 0.8.0'} + dependencies: + debug: 2.6.9 + minimatch: 3.1.2 + transitivePeerDependencies: + - supports-color + dev: true + + /ret/0.1.15: + resolution: {integrity: sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==} + engines: {node: '>=0.12'} + dev: true + + /retry/0.12.0: + resolution: {integrity: sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==} + engines: {node: '>= 4'} + dev: false + + /reusify/1.0.4: + resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} + engines: {iojs: '>=1.0.0', node: '>=0.10.0'} + dev: true + + /rimraf/3.0.2: + resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} + hasBin: true + dependencies: + glob: 7.2.3 + + /ripemd160/2.0.2: + resolution: {integrity: sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==} + dependencies: + hash-base: 3.1.0 + inherits: 2.0.4 + dev: true + + /run-parallel/1.2.0: + resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} + dependencies: + queue-microtask: 1.2.3 + dev: true + + /rx/4.1.0: + resolution: {integrity: sha512-CiaiuN6gapkdl+cZUr67W6I8jquN4lkak3vtIsIWCl4XIPP8ffsoyN6/+PuGXnQy8Cu8W2y9Xxh31Rq4M6wUug==} + dev: true + + /rxjs/5.5.12: + resolution: {integrity: sha512-xx2itnL5sBbqeeiVgNPVuQQ1nC8Jp2WfNJhXWHmElW9YmrpS9UVnNzhP3EH3HFqexO5Tlp8GhYY+WEcqcVMvGw==} + engines: {npm: '>=2.0.0'} + dependencies: + symbol-observable: 1.0.1 + dev: true + + /safe-buffer/5.1.2: + resolution: {integrity: sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==} + dev: true + + /safe-buffer/5.2.1: + resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} + + /safe-regex/1.1.0: + resolution: {integrity: sha512-aJXcif4xnaNUzvUuC5gcb46oTS7zvg4jpMTnuqtrEPlR3vFr4pxtdTwaF1Qs3Enjn9HK+ZlwQui+a7z0SywIzg==} + dependencies: + ret: 0.1.15 + dev: true + + /safer-buffer/2.1.2: + resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} + + /semver-greatest-satisfied-range/1.1.0: + resolution: {integrity: sha512-Ny/iyOzSSa8M5ML46IAx3iXc6tfOsYU2R4AXi2UpHk60Zrgyq6eqPj/xiOfS0rRl/iiQ/rdJkVjw/5cdUyCntQ==} + engines: {node: '>= 0.10'} + dependencies: + sver-compat: 1.5.0 + dev: true + + /semver/5.7.1: + resolution: {integrity: sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==} + hasBin: true + dev: true + + /semver/6.3.0: + resolution: {integrity: sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==} + hasBin: true + dev: true + + /semver/7.3.8: + resolution: {integrity: sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==} + engines: {node: '>=10'} + hasBin: true + dependencies: + lru-cache: 6.0.0 + dev: false + + /send/0.16.2: + resolution: {integrity: sha512-E64YFPUssFHEFBvpbbjr44NCLtI1AohxQ8ZSiJjQLskAdKuriYEP6VyGEsRDH8ScozGpkaX1BGvhanqCwkcEZw==} + engines: {node: '>= 0.8.0'} + dependencies: + debug: 2.6.9 + depd: 1.1.2 + destroy: 1.0.4 + encodeurl: 1.0.2 + escape-html: 1.0.3 + etag: 1.8.1 + fresh: 0.5.2 + http-errors: 1.6.3 + mime: 1.4.1 + ms: 2.0.0 + on-finished: 2.3.0 + range-parser: 1.2.1 + statuses: 1.4.0 + transitivePeerDependencies: + - supports-color + dev: true + + /serve-index/1.9.1: + resolution: {integrity: sha512-pXHfKNP4qujrtteMrSBb0rc8HJ9Ms/GrXwcUtUtD5s4ewDJI8bT3Cz2zTVRMKtri49pLx2e0Ya8ziP5Ya2pZZw==} + engines: {node: '>= 0.8.0'} + dependencies: + accepts: 1.3.8 + batch: 0.6.1 + debug: 2.6.9 + escape-html: 1.0.3 + http-errors: 1.6.3 + mime-types: 2.1.35 + parseurl: 1.3.3 + transitivePeerDependencies: + - supports-color + dev: true + + /serve-static/1.13.2: + resolution: {integrity: sha512-p/tdJrO4U387R9oMjb1oj7qSMaMfmOyd4j9hOFoxZe2baQszgHcSWjuya/CiT5kgZZKRudHNOA0pYXOl8rQ5nw==} + engines: {node: '>= 0.8.0'} + dependencies: + encodeurl: 1.0.2 + escape-html: 1.0.3 + parseurl: 1.3.3 + send: 0.16.2 + transitivePeerDependencies: + - supports-color + dev: true + + /server-destroy/1.0.1: + resolution: {integrity: sha512-rb+9B5YBIEzYcD6x2VKidaa+cqYBJQKnU4oe4E3ANwRRN56yk/ua1YCJT1n21NTS8w6CcOclAKNP3PhdCXKYtQ==} + dev: true + + /set-blocking/2.0.0: + resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} + + /set-value/2.0.1: + resolution: {integrity: sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==} + engines: {node: '>=0.10.0'} + dependencies: + extend-shallow: 2.0.1 + is-extendable: 0.1.1 + is-plain-object: 2.0.4 + split-string: 3.1.0 + dev: true + + /setprototypeof/1.1.0: + resolution: {integrity: sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==} + dev: true + + /setprototypeof/1.2.0: + resolution: {integrity: sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==} + dev: true + + /sha.js/2.4.11: + resolution: {integrity: sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==} + hasBin: true + dependencies: + inherits: 2.0.4 + safe-buffer: 5.2.1 + dev: true + + /shasum-object/1.0.0: + resolution: {integrity: sha512-Iqo5rp/3xVi6M4YheapzZhhGPVs0yZwHj7wvwQ1B9z8H6zk+FEnI7y3Teq7qwnekfEhu8WmG2z0z4iWZaxLWVg==} + dependencies: + fast-safe-stringify: 2.1.1 + dev: true + + /shebang-command/2.0.0: + resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} + engines: {node: '>=8'} + dependencies: + shebang-regex: 3.0.0 + dev: true + + /shebang-regex/3.0.0: + resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} + engines: {node: '>=8'} + dev: true + + /shell-quote/1.7.4: + resolution: {integrity: sha512-8o/QEhSSRb1a5i7TFR0iM4G16Z0vYB2OQVs4G3aAFXjn3T6yEx8AZxy1PgDF7I00LZHYA3WxaSYIf5e5sAX8Rw==} + dev: true + + /side-channel/1.0.4: + resolution: {integrity: sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==} + dependencies: + call-bind: 1.0.2 + get-intrinsic: 1.2.0 + object-inspect: 1.12.3 + dev: true + + /sigmund/1.0.1: + resolution: {integrity: sha512-fCvEXfh6NWpm+YSuY2bpXb/VIihqWA6hLsgboC+0nl71Q7N7o2eaCW8mJa/NLvQhs6jpd3VZV4UiUQlV6+lc8g==} + dev: true + + /signal-exit/3.0.7: + resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} + + /simple-concat/1.0.1: + resolution: {integrity: sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==} + + /simple-get/4.0.1: + resolution: {integrity: sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==} + dependencies: + decompress-response: 6.0.0 + once: 1.4.0 + simple-concat: 1.0.1 + dev: false + + /sinon/7.5.0: + resolution: {integrity: sha512-AoD0oJWerp0/rY9czP/D6hDTTUYGpObhZjMpd7Cl/A6+j0xBE+ayL/ldfggkBXUs0IkvIiM1ljM8+WkOc5k78Q==} + dependencies: + '@sinonjs/commons': 1.8.6 + '@sinonjs/formatio': 3.2.2 + '@sinonjs/samsam': 3.3.3 + diff: 3.5.0 + lolex: 4.2.0 + nise: 1.5.3 + supports-color: 5.5.0 + dev: true + + /slash/3.0.0: + resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} + engines: {node: '>=8'} + dev: true + + /smart-buffer/4.2.0: + resolution: {integrity: sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==} + engines: {node: '>= 6.0.0', npm: '>= 3.0.0'} + dev: false + + /snapdragon-node/2.1.1: + resolution: {integrity: sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==} + engines: {node: '>=0.10.0'} + dependencies: + define-property: 1.0.0 + isobject: 3.0.1 + snapdragon-util: 3.0.1 + dev: true + + /snapdragon-util/3.0.1: + resolution: {integrity: sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==} + engines: {node: '>=0.10.0'} + dependencies: + kind-of: 3.2.2 + dev: true + + /snapdragon/0.8.2: + resolution: {integrity: sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==} + engines: {node: '>=0.10.0'} + dependencies: + base: 0.11.2 + debug: 2.6.9 + define-property: 0.2.5 + extend-shallow: 2.0.1 + map-cache: 0.2.2 + source-map: 0.5.7 + source-map-resolve: 0.5.3 + use: 3.1.1 + transitivePeerDependencies: + - supports-color + dev: true + + /socket.io-adapter/2.4.0: + resolution: {integrity: sha512-W4N+o69rkMEGVuk2D/cvca3uYsvGlMwsySWV447y99gUPghxq42BxqLNMndb+a1mm/5/7NeXVQS7RLa2XyXvYg==} + dev: true + + /socket.io-client/4.5.4: + resolution: {integrity: sha512-ZpKteoA06RzkD32IbqILZ+Cnst4xewU7ZYK12aS1mzHftFFjpoMz69IuhP/nL25pJfao/amoPI527KnuhFm01g==} + engines: {node: '>=10.0.0'} + dependencies: + '@socket.io/component-emitter': 3.1.0 + debug: 4.3.4 + engine.io-client: 6.2.3 + socket.io-parser: 4.2.2 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + dev: true + + /socket.io-parser/4.2.2: + resolution: {integrity: sha512-DJtziuKypFkMMHCm2uIshOYC7QaylbtzQwiMYDuCKy3OPkjLzu4B2vAhTlqipRHHzrI0NJeBAizTK7X+6m1jVw==} + engines: {node: '>=10.0.0'} + dependencies: + '@socket.io/component-emitter': 3.1.0 + debug: 4.3.4 + transitivePeerDependencies: + - supports-color + dev: true + + /socket.io/4.5.4: + resolution: {integrity: sha512-m3GC94iK9MfIEeIBfbhJs5BqFibMtkRk8ZpKwG2QwxV0m/eEhPIV4ara6XCF1LWNAus7z58RodiZlAH71U3EhQ==} + engines: {node: '>=10.0.0'} + dependencies: + accepts: 1.3.8 + base64id: 2.0.0 + debug: 4.3.4 + engine.io: 6.2.1 + socket.io-adapter: 2.4.0 + socket.io-parser: 4.2.2 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + dev: true + + /socks-proxy-agent/7.0.0: + resolution: {integrity: sha512-Fgl0YPZ902wEsAyiQ+idGd1A7rSFx/ayC1CQVMw5P+EQx2V0SgpGtf6OKFhVjPflPUl9YMmEOnmfjCdMUsygww==} + engines: {node: '>= 10'} + dependencies: + agent-base: 6.0.2 + debug: 4.3.4 + socks: 2.7.1 + transitivePeerDependencies: + - supports-color + dev: false + + /socks/2.7.1: + resolution: {integrity: sha512-7maUZy1N7uo6+WVEX6psASxtNlKaNVMlGQKkG/63nEDdLOWNbiUMoLK7X4uYoLhQstau72mLgfEWcXcwsaHbYQ==} + engines: {node: '>= 10.13.0', npm: '>= 3.0.0'} + dependencies: + ip: 2.0.0 + smart-buffer: 4.2.0 + dev: false + + /source-map-resolve/0.5.3: + resolution: {integrity: sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==} + deprecated: See https://github.com/lydell/source-map-resolve#deprecated + dependencies: + atob: 2.1.2 + decode-uri-component: 0.2.2 + resolve-url: 0.2.1 + source-map-url: 0.4.1 + urix: 0.1.0 + dev: true + + /source-map-support/0.5.21: + resolution: {integrity: sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==} + dependencies: + buffer-from: 1.1.2 + source-map: 0.6.1 + dev: true + + /source-map-url/0.4.1: + resolution: {integrity: sha512-cPiFOTLUKvJFIg4SKVScy4ilPPW6rFgMgfuZJPNoDuMs3nC1HbMUycBoJw77xFIp6z1UJQJOfx6C9GMH80DiTw==} + deprecated: See https://github.com/lydell/source-map-url#deprecated + dev: true + + /source-map/0.5.7: + resolution: {integrity: sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==} + engines: {node: '>=0.10.0'} + dev: true + + /source-map/0.6.1: + resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==} + engines: {node: '>=0.10.0'} + dev: true + + /sparkles/1.0.1: + resolution: {integrity: sha512-dSO0DDYUahUt/0/pD/Is3VIm5TGJjludZ0HVymmhYF6eNA53PVLhnUk0znSYbH8IYBuJdCE+1luR22jNLMaQdw==} + engines: {node: '>= 0.10'} + dev: true + + /spdx-correct/3.1.1: + resolution: {integrity: sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==} + dependencies: + spdx-expression-parse: 3.0.1 + spdx-license-ids: 3.0.12 + dev: true + + /spdx-exceptions/2.3.0: + resolution: {integrity: sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==} + dev: true + + /spdx-expression-parse/3.0.1: + resolution: {integrity: sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==} + dependencies: + spdx-exceptions: 2.3.0 + spdx-license-ids: 3.0.12 + dev: true + + /spdx-license-ids/3.0.12: + resolution: {integrity: sha512-rr+VVSXtRhO4OHbXUiAF7xW3Bo9DuuF6C5jH+q/x15j2jniycgKbxU09Hr0WqlSLUs4i4ltHGXqTe7VHclYWyA==} + dev: true + + /split-string/3.1.0: + resolution: {integrity: sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==} + engines: {node: '>=0.10.0'} + dependencies: + extend-shallow: 3.0.2 + dev: true + + /ssri/9.0.1: + resolution: {integrity: sha512-o57Wcn66jMQvfHG1FlYbWeZWW/dHZhJXjpIcTfXldXEk5nz5lStPo3mK0OJQfGR3RbZUlbISexbljkJzuEj/8Q==} + engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} + dependencies: + minipass: 3.3.6 + dev: false + + /stack-trace/0.0.10: + resolution: {integrity: sha512-KGzahc7puUKkzyMt+IqAep+TVNbKP+k2Lmwhub39m1AsTSkaDutx56aDCo+HLDzf/D26BIHTJWNiTG1KAJiQCg==} + dev: true + + /static-extend/0.1.2: + resolution: {integrity: sha512-72E9+uLc27Mt718pMHt9VMNiAL4LMsmDbBva8mxWUCkT07fSzEGMYUCk0XWY6lp0j6RBAG4cJ3mWuZv2OE3s0g==} + engines: {node: '>=0.10.0'} + dependencies: + define-property: 0.2.5 + object-copy: 0.1.0 + dev: true + + /statuses/1.3.1: + resolution: {integrity: sha512-wuTCPGlJONk/a1kqZ4fQM2+908lC7fa7nPYpTC1EhnvqLX/IICbeP1OZGDtA374trpSq68YubKUMo8oRhN46yg==} + engines: {node: '>= 0.6'} + dev: true + + /statuses/1.4.0: + resolution: {integrity: sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew==} + engines: {node: '>= 0.6'} + dev: true + + /statuses/2.0.1: + resolution: {integrity: sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==} + engines: {node: '>= 0.8'} + dev: true + + /stream-browserify/3.0.0: + resolution: {integrity: sha512-H73RAHsVBapbim0tU2JwwOiXUj+fikfiaoYAKHF3VJfA0pe2BCzkhAHBlLG6REzE+2WNZcxOXjK7lkso+9euLA==} + dependencies: + inherits: 2.0.4 + readable-stream: 3.6.0 + dev: true + + /stream-combiner2/1.1.1: + resolution: {integrity: sha512-3PnJbYgS56AeWgtKF5jtJRT6uFJe56Z0Hc5Ngg/6sI6rIt8iiMBTa9cvdyFfpMQjaVHr8dusbNeFGIIonxOvKw==} + dependencies: + duplexer2: 0.1.4 + readable-stream: 2.3.7 + dev: true + + /stream-exhaust/1.0.2: + resolution: {integrity: sha512-b/qaq/GlBK5xaq1yrK9/zFcyRSTNxmcZwFLGSTG0mXgZl/4Z6GgiyYOXOvY7N3eEvFRAG1bkDRz5EPGSvPYQlw==} + dev: true + + /stream-http/3.2.0: + resolution: {integrity: sha512-Oq1bLqisTyK3TSCXpPbT4sdeYNdmyZJv1LxpEm2vu1ZhK89kSE5YXwZc3cWk0MagGaKriBh9mCFbVGtO+vY29A==} + dependencies: + builtin-status-codes: 3.0.0 + inherits: 2.0.4 + readable-stream: 3.6.0 + xtend: 4.0.2 + dev: true + + /stream-shift/1.0.1: + resolution: {integrity: sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==} + dev: true + + /stream-splicer/2.0.1: + resolution: {integrity: sha512-Xizh4/NPuYSyAXyT7g8IvdJ9HJpxIGL9PjyhtywCZvvP0OPIdqyrr4dMikeuvY8xahpdKEBlBTySe583totajg==} + dependencies: + inherits: 2.0.4 + readable-stream: 2.3.7 + dev: true + + /stream-throttle/0.1.3: + resolution: {integrity: sha512-889+B9vN9dq7/vLbGyuHeZ6/ctf5sNuGWsDy89uNxkFTAgzy0eK7+w5fL3KLNRTkLle7EgZGvHUphZW0Q26MnQ==} + engines: {node: '>= 0.10.0'} + hasBin: true + dependencies: + commander: 2.20.3 + limiter: 1.1.5 + dev: true + + /string-width/1.0.2: + resolution: {integrity: sha512-0XsVpQLnVCXHJfyEs8tC0zpTVIr5PKKsQtkT29IwupnPTjtPmQ3xT/4yCREF9hYkV/3M3kzcUTSAZT6a6h81tw==} + engines: {node: '>=0.10.0'} + dependencies: + code-point-at: 1.1.0 + is-fullwidth-code-point: 1.0.0 + strip-ansi: 3.0.1 + dev: true + + /string-width/4.2.3: + resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} + engines: {node: '>=8'} + dependencies: + emoji-regex: 8.0.0 + is-fullwidth-code-point: 3.0.0 + strip-ansi: 6.0.1 + + /string_decoder/0.10.31: + resolution: {integrity: sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==} + dev: false + + /string_decoder/1.1.1: + resolution: {integrity: sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==} + dependencies: + safe-buffer: 5.1.2 + dev: true + + /string_decoder/1.3.0: + resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} + dependencies: + safe-buffer: 5.2.1 + + /strip-ansi/3.0.1: + resolution: {integrity: sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==} + engines: {node: '>=0.10.0'} + dependencies: + ansi-regex: 2.1.1 + dev: true + + /strip-ansi/6.0.1: + resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} + engines: {node: '>=8'} + dependencies: + ansi-regex: 5.0.1 + + /strip-bom/2.0.0: + resolution: {integrity: sha512-kwrX1y7czp1E69n2ajbG65mIo9dqvJ+8aBQXOGVxqwvNbsXdFM6Lq37dLAY3mknUwru8CfcCbfOLL/gMo+fi3g==} + engines: {node: '>=0.10.0'} + dependencies: + is-utf8: 0.2.1 + dev: true + + /strip-json-comments/2.0.1: + resolution: {integrity: sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==} + engines: {node: '>=0.10.0'} + + /subarg/1.0.0: + resolution: {integrity: sha512-RIrIdRY0X1xojthNcVtgT9sjpOGagEUKpZdgBUi054OEPFo282yg+zE+t1Rj3+RqKq2xStL7uUHhY+AjbC4BXg==} + dependencies: + minimist: 1.2.7 + dev: true + + /supports-color/2.0.0: + resolution: {integrity: sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g==} + engines: {node: '>=0.8.0'} + dev: true + + /supports-color/5.5.0: + resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==} + engines: {node: '>=4'} + dependencies: + has-flag: 3.0.0 + dev: true + + /supports-color/7.2.0: + resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} + engines: {node: '>=8'} + dependencies: + has-flag: 4.0.0 + dev: true + + /supports-preserve-symlinks-flag/1.0.0: + resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} + engines: {node: '>= 0.4'} + dev: true + + /sver-compat/1.5.0: + resolution: {integrity: sha512-aFTHfmjwizMNlNE6dsGmoAM4lHjL0CyiobWaFiXWSlD7cIxshW422Nb8KbXCmR6z+0ZEPY+daXJrDyh/vuwTyg==} + dependencies: + es6-iterator: 2.0.3 + es6-symbol: 3.1.3 + dev: true + + /symbol-observable/1.0.1: + resolution: {integrity: sha512-Kb3PrPYz4HanVF1LVGuAdW6LoVgIwjUYJGzFe7NDrBLCN4lsV/5J0MFurV+ygS4bRVwrCEt2c7MQ1R2a72oJDw==} + engines: {node: '>=0.10.0'} + dev: true + + /syntax-error/1.4.0: + resolution: {integrity: sha512-YPPlu67mdnHGTup2A8ff7BC2Pjq0e0Yp/IyTFN03zWO0RcK07uLcbi7C2KpGR2FvWbaB0+bfE27a+sBKebSo7w==} + dependencies: + acorn-node: 1.8.2 + dev: true + + /tar-fs/2.1.1: + resolution: {integrity: sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==} + dependencies: + chownr: 1.1.4 + mkdirp-classic: 0.5.3 + pump: 3.0.0 + tar-stream: 2.2.0 + dev: false + + /tar-stream/2.2.0: + resolution: {integrity: sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==} + engines: {node: '>=6'} + dependencies: + bl: 4.1.0 + end-of-stream: 1.4.4 + fs-constants: 1.0.0 + inherits: 2.0.4 + readable-stream: 3.6.0 + dev: false + + /tar/6.1.13: + resolution: {integrity: sha512-jdIBIN6LTIe2jqzay/2vtYLlBHa3JF42ot3h1dW8Q0PaAG4v8rm0cvpVePtau5C6OKXGGcgO9q2AMNSWxiLqKw==} + engines: {node: '>=10'} + dependencies: + chownr: 2.0.0 + fs-minipass: 2.1.0 + minipass: 4.0.0 + minizlib: 2.1.2 + mkdirp: 1.0.4 + yallist: 4.0.0 + dev: false + + /terser/5.16.1: + resolution: {integrity: sha512-xvQfyfA1ayT0qdK47zskQgRZeWLoOQ8JQ6mIgRGVNwZKdQMU+5FkCBjmv4QjcrTzyZquRw2FVtlJSRUmMKQslw==} + engines: {node: '>=10'} + hasBin: true + dependencies: + '@jridgewell/source-map': 0.3.2 + acorn: 8.8.2 + commander: 2.20.3 + source-map-support: 0.5.21 + dev: true + + /test-exclude/6.0.0: + resolution: {integrity: sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==} + engines: {node: '>=8'} + dependencies: + '@istanbuljs/schema': 0.1.3 + glob: 7.2.3 + minimatch: 3.1.2 + dev: true + + /textextensions/3.3.0: + resolution: {integrity: sha512-mk82dS8eRABNbeVJrEiN5/UMSCliINAuz8mkUwH4SwslkNP//gbEzlWNS5au0z5Dpx40SQxzqZevZkn+WYJ9Dw==} + engines: {node: '>=8'} + dev: true + + /tfunk/4.0.0: + resolution: {integrity: sha512-eJQ0dGfDIzWNiFNYFVjJ+Ezl/GmwHaFTBTjrtqNPW0S7cuVDBrZrmzUz6VkMeCR4DZFqhd4YtLwsw3i2wYHswQ==} + dependencies: + chalk: 1.1.3 + dlv: 1.1.3 + dev: true + + /through/2.3.8: + resolution: {integrity: sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==} + dev: true + + /through2-filter/3.0.0: + resolution: {integrity: sha512-jaRjI2WxN3W1V8/FMZ9HKIBXixtiqs3SQSX4/YGIiP3gL6djW48VoZq9tDqeCWs3MT8YY5wb/zli8VW8snY1CA==} + dependencies: + through2: 2.0.5 + xtend: 4.0.2 + dev: true + + /through2/0.6.5: + resolution: {integrity: sha512-RkK/CCESdTKQZHdmKICijdKKsCRVHs5KsLZ6pACAmF/1GPUQhonHSXWNERctxEp7RmvjdNbZTL5z9V7nSCXKcg==} + dependencies: + readable-stream: 1.0.34 + xtend: 4.0.2 + dev: false + + /through2/2.0.5: + resolution: {integrity: sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==} + dependencies: + readable-stream: 2.3.7 + xtend: 4.0.2 + dev: true + + /time-stamp/1.1.0: + resolution: {integrity: sha512-gLCeArryy2yNTRzTGKbZbloctj64jkZ57hj5zdraXue6aFgd6PmvVtEyiUU+hvU0v7q08oVv8r8ev0tRo6bvgw==} + engines: {node: '>=0.10.0'} + dev: true + + /timers-browserify/1.4.2: + resolution: {integrity: sha512-PIxwAupJZiYU4JmVZYwXp9FKsHMXb5h0ZEFyuXTAn8WLHOlcij+FEcbrvDsom1o5dr1YggEtFbECvGCW2sT53Q==} + engines: {node: '>=0.6.0'} + dependencies: + process: 0.11.10 + dev: true + + /tiny-glob/0.2.9: + resolution: {integrity: sha512-g/55ssRPUjShh+xkfx9UPDXqhckHEsHr4Vd9zX55oSdGZc/MD0m3sferOkwWtp98bv+kcVfEHtRJgBVJzelrzg==} + dependencies: + globalyzer: 0.1.0 + globrex: 0.1.2 + dev: true + + /to-absolute-glob/2.0.2: + resolution: {integrity: sha512-rtwLUQEwT8ZeKQbyFJyomBRYXyE16U5VKuy0ftxLMK/PZb2fkOsg5r9kHdauuVDbsNdIBoC/HCthpidamQFXYA==} + engines: {node: '>=0.10.0'} + dependencies: + is-absolute: 1.0.0 + is-negated-glob: 1.0.0 + dev: true + + /to-object-path/0.3.0: + resolution: {integrity: sha512-9mWHdnGRuh3onocaHzukyvCZhzvr6tiflAy/JRFXcJX0TjgfWA9pk9t8CMbzmBE4Jfw58pXbkngtBtqYxzNEyg==} + engines: {node: '>=0.10.0'} + dependencies: + kind-of: 3.2.2 + dev: true + + /to-regex-range/2.1.1: + resolution: {integrity: sha512-ZZWNfCjUokXXDGXFpZehJIkZqq91BcULFq/Pi7M5i4JnxXdhMKAK682z8bCW3o8Hj1wuuzoKcW3DfVzaP6VuNg==} + engines: {node: '>=0.10.0'} + dependencies: + is-number: 3.0.0 + repeat-string: 1.6.1 + dev: true + + /to-regex-range/5.0.1: + resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} + engines: {node: '>=8.0'} + dependencies: + is-number: 7.0.0 + dev: true + + /to-regex/3.0.2: + resolution: {integrity: sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==} + engines: {node: '>=0.10.0'} + dependencies: + define-property: 2.0.2 + extend-shallow: 3.0.2 + regex-not: 1.0.2 + safe-regex: 1.1.0 + dev: true + + /to-through/2.0.0: + resolution: {integrity: sha512-+QIz37Ly7acM4EMdw2PRN389OneM5+d844tirkGp4dPKzI5OE72V9OsbFp+CIYJDahZ41ZV05hNtcPAQUAm9/Q==} + engines: {node: '>= 0.10'} + dependencies: + through2: 2.0.5 + dev: true + + /toidentifier/1.0.1: + resolution: {integrity: sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==} + engines: {node: '>=0.6'} + dev: true + + /tty-browserify/0.0.1: + resolution: {integrity: sha512-C3TaO7K81YvjCgQH9Q1S3R3P3BtN3RIM8n+OvX4il1K1zgE8ZhI0op7kClgkxtutIE8hQrcrHBXvIheqKUUCxw==} + dev: true + + /tunnel-agent/0.6.0: + resolution: {integrity: sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==} + dependencies: + safe-buffer: 5.2.1 + dev: false + + /type-detect/4.0.8: + resolution: {integrity: sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==} + engines: {node: '>=4'} + dev: true + + /type/1.2.0: + resolution: {integrity: sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==} + dev: true + + /type/2.7.2: + resolution: {integrity: sha512-dzlvlNlt6AXU7EBSfpAscydQ7gXB+pPGsPnfJnZpiNJBDj7IaJzQlBZYGdEi4R9HmPdBv2XmWJ6YUtoTa7lmCw==} + dev: true + + /typedarray/0.0.6: + resolution: {integrity: sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==} + dev: true + + /typescript/4.9.4: + resolution: {integrity: sha512-Uz+dTXYzxXXbsFpM86Wh3dKCxrQqUcVMxwU54orwlJjOpO3ao8L7j5lH+dWfTwgCwIuM9GQ2kvVotzYJMXTBZg==} + engines: {node: '>=4.2.0'} + hasBin: true + dev: true + + /ua-parser-js/1.0.2: + resolution: {integrity: sha512-00y/AXhx0/SsnI51fTc0rLRmafiGOM4/O+ny10Ps7f+j/b8p/ZY11ytMgznXkOVo4GQ+KwQG5UQLkLGirsACRg==} + dev: true + + /umd/3.0.3: + resolution: {integrity: sha512-4IcGSufhFshvLNcMCV80UnQVlZ5pMOC8mvNPForqwA4+lzYQuetTESLDQkeLmihq8bRcnpbQa48Wb8Lh16/xow==} + hasBin: true + dev: true + + /unc-path-regex/0.1.2: + resolution: {integrity: sha512-eXL4nmJT7oCpkZsHZUOJo8hcX3GbsiDOa0Qu9F646fi8dT3XuSVopVqAcEiVzSKKH7UoDti23wNX3qGFxcW5Qg==} + engines: {node: '>=0.10.0'} + dev: true + + /undeclared-identifiers/1.1.3: + resolution: {integrity: sha512-pJOW4nxjlmfwKApE4zvxLScM/njmwj/DiUBv7EabwE4O8kRUy+HIwxQtZLBPll/jx1LJyBcqNfB3/cpv9EZwOw==} + hasBin: true + dependencies: + acorn-node: 1.8.2 + dash-ast: 1.0.0 + get-assigned-identifiers: 1.2.0 + simple-concat: 1.0.1 + xtend: 4.0.2 + dev: true + + /undertaker-registry/1.0.1: + resolution: {integrity: sha512-UR1khWeAjugW3548EfQmL9Z7pGMlBgXteQpr1IZeZBtnkCJQJIJ1Scj0mb9wQaPvUZ9Q17XqW6TIaPchJkyfqw==} + engines: {node: '>= 0.10'} + dev: true + + /undertaker/1.3.0: + resolution: {integrity: sha512-/RXwi5m/Mu3H6IHQGww3GNt1PNXlbeCuclF2QYR14L/2CHPz3DFZkvB5hZ0N/QUkiXWCACML2jXViIQEQc2MLg==} + engines: {node: '>= 0.10'} + dependencies: + arr-flatten: 1.1.0 + arr-map: 2.0.2 + bach: 1.2.0 + collection-map: 1.0.0 + es6-weak-map: 2.0.3 + fast-levenshtein: 1.1.4 + last-run: 1.1.1 + object.defaults: 1.1.0 + object.reduce: 1.0.1 + undertaker-registry: 1.0.1 + dev: true + + /union-value/1.0.1: + resolution: {integrity: sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==} + engines: {node: '>=0.10.0'} + dependencies: + arr-union: 3.1.0 + get-value: 2.0.6 + is-extendable: 0.1.1 + set-value: 2.0.1 + dev: true + + /unique-filename/2.0.1: + resolution: {integrity: sha512-ODWHtkkdx3IAR+veKxFV+VBkUMcN+FaqzUUd7IZzt+0zhDZFPFxhlqwPF3YQvMHx1TD0tdgYl+kuPnJ8E6ql7A==} + engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} + dependencies: + unique-slug: 3.0.0 + dev: false + + /unique-slug/3.0.0: + resolution: {integrity: sha512-8EyMynh679x/0gqE9fT9oilG+qEt+ibFyqjuVTsZn1+CMxH+XLlpvr2UZx4nVcCwTpx81nICr2JQFkM+HPLq4w==} + engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} + dependencies: + imurmurhash: 0.1.4 + dev: false + + /unique-stream/2.3.1: + resolution: {integrity: sha512-2nY4TnBE70yoxHkDli7DMazpWiP7xMdCYqU2nBRO0UB+ZpEkGsSija7MvmvnZFUeC+mrgiUfcHSr3LmRFIg4+A==} + dependencies: + json-stable-stringify-without-jsonify: 1.0.1 + through2-filter: 3.0.0 + dev: true + + /universalify/0.1.2: + resolution: {integrity: sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==} + engines: {node: '>= 4.0.0'} + dev: true + + /unpipe/1.0.0: + resolution: {integrity: sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==} + engines: {node: '>= 0.8'} + dev: true + + /unset-value/1.0.0: + resolution: {integrity: sha512-PcA2tsuGSF9cnySLHTLSh2qrQiJ70mn+r+Glzxv2TWZblxsxCC52BDlZoPCsz7STd9pN7EZetkWZBAvk4cgZdQ==} + engines: {node: '>=0.10.0'} + dependencies: + has-value: 0.3.1 + isobject: 3.0.1 + dev: true + + /upath/1.2.0: + resolution: {integrity: sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg==} + engines: {node: '>=4'} + dev: true + + /urix/0.1.0: + resolution: {integrity: sha512-Am1ousAhSLBeB9cG/7k7r2R0zj50uDRlZHPGbazid5s9rlF1F/QKYObEKSIunSjIOkJZqwRRLpvewjEkM7pSqg==} + deprecated: Please see https://github.com/lydell/urix#deprecated + dev: true + + /url/0.11.0: + resolution: {integrity: sha512-kbailJa29QrtXnxgq+DdCEGlbTeYM2eJUxsz6vjZavrCYPMIFHMKQmSKYAIuUK2i7hgPm28a8piX5NTUtM/LKQ==} + dependencies: + punycode: 1.3.2 + querystring: 0.2.0 + dev: true + + /use/3.1.1: + resolution: {integrity: sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==} + engines: {node: '>=0.10.0'} + dev: true + + /util-deprecate/1.0.2: + resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} + + /util/0.10.3: + resolution: {integrity: sha512-5KiHfsmkqacuKjkRkdV7SsfDJ2EGiPsK92s2MhNSY0craxjTdKTtqKsJaCWp4LW33ZZ0OPUv1WO/TFvNQRiQxQ==} + dependencies: + inherits: 2.0.1 + dev: true + + /util/0.12.5: + resolution: {integrity: sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA==} + dependencies: + inherits: 2.0.4 + is-arguments: 1.1.1 + is-generator-function: 1.0.10 + is-typed-array: 1.1.10 + which-typed-array: 1.1.9 + dev: true + + /utils-merge/1.0.1: + resolution: {integrity: sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==} + engines: {node: '>= 0.4.0'} + dev: true + + /v8-to-istanbul/9.0.1: + resolution: {integrity: sha512-74Y4LqY74kLE6IFyIjPtkSTWzUZmj8tdHT9Ii/26dvQ6K9Dl2NbEfj0XgU2sHCtKgt5VupqhlO/5aWuqS+IY1w==} + engines: {node: '>=10.12.0'} + dependencies: + '@jridgewell/trace-mapping': 0.3.17 + '@types/istanbul-lib-coverage': 2.0.4 + convert-source-map: 1.9.0 + dev: true + + /v8flags/3.2.0: + resolution: {integrity: sha512-mH8etigqMfiGWdeXpaaqGfs6BndypxusHHcv2qSHyZkGEznCd/qAXCWWRzeowtL54147cktFOC4P5y+kl8d8Jg==} + engines: {node: '>= 0.10'} + dependencies: + homedir-polyfill: 1.0.3 + dev: true + + /validate-npm-package-license/3.0.4: + resolution: {integrity: sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==} + dependencies: + spdx-correct: 3.1.1 + spdx-expression-parse: 3.0.1 + dev: true + + /value-or-function/3.0.0: + resolution: {integrity: sha512-jdBB2FrWvQC/pnPtIqcLsMaQgjhdb6B7tk1MMyTKapox+tQZbdRP4uLxu/JY0t7fbfDCUMnuelzEYv5GsxHhdg==} + engines: {node: '>= 0.10'} + dev: true + + /vary/1.1.2: + resolution: {integrity: sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==} + engines: {node: '>= 0.8'} + dev: true + + /vinyl-buffer/1.0.1: + resolution: {integrity: sha512-LRBE2/g3C1hSHL2k/FynSZcVTRhEw8sb08oKGt/0hukZXwrh2m8nfy+r5yLhGEk7eFFuclhyIuPct/Bxlxk6rg==} + dependencies: + bl: 1.2.3 + through2: 2.0.5 + dev: true + + /vinyl-fs/3.0.3: + resolution: {integrity: sha512-vIu34EkyNyJxmP0jscNzWBSygh7VWhqun6RmqVfXePrOwi9lhvRs//dOaGOTRUQr4tx7/zd26Tk5WeSVZitgng==} + engines: {node: '>= 0.10'} + dependencies: + fs-mkdirp-stream: 1.0.0 + glob-stream: 6.1.0 + graceful-fs: 4.2.10 + is-valid-glob: 1.0.0 + lazystream: 1.0.1 + lead: 1.0.0 + object.assign: 4.1.4 + pumpify: 1.5.1 + readable-stream: 2.3.7 + remove-bom-buffer: 3.0.0 + remove-bom-stream: 1.2.0 + resolve-options: 1.1.0 + through2: 2.0.5 + to-through: 2.0.0 + value-or-function: 3.0.0 + vinyl: 2.2.1 + vinyl-sourcemap: 1.1.0 + dev: true + + /vinyl-source-stream/2.0.0: + resolution: {integrity: sha512-Y5f1wRGajOfYukhv8biIGA7iZiY8UOIc3zJ6zcUNIbRG1BVuXzBsfSfe7MUJTttVkuy64k/pGQtJdd/aIt+hbw==} + dependencies: + through2: 2.0.5 + vinyl: 2.2.1 + dev: true + + /vinyl-sourcemap/1.1.0: + resolution: {integrity: sha512-NiibMgt6VJGJmyw7vtzhctDcfKch4e4n9TBeoWlirb7FMg9/1Ov9k+A5ZRAtywBpRPiyECvQRQllYM8dECegVA==} + engines: {node: '>= 0.10'} + dependencies: + append-buffer: 1.0.2 + convert-source-map: 1.9.0 + graceful-fs: 4.2.10 + normalize-path: 2.1.1 + now-and-later: 2.0.1 + remove-bom-buffer: 3.0.0 + vinyl: 2.2.1 + dev: true + + /vinyl-sourcemaps-apply/0.2.1: + resolution: {integrity: sha512-+oDh3KYZBoZC8hfocrbrxbLUeaYtQK7J5WU5Br9VqWqmCll3tFJqKp97GC9GmMsVIL0qnx2DgEDVxdo5EZ5sSw==} + dependencies: + source-map: 0.5.7 + dev: true + + /vinyl/2.2.1: + resolution: {integrity: sha512-LII3bXRFBZLlezoG5FfZVcXflZgWP/4dCwKtxd5ky9+LOtM4CS3bIRQsmR1KMnMW07jpE8fqR2lcxPZ+8sJIcw==} + engines: {node: '>= 0.10'} + dependencies: + clone: 2.1.2 + clone-buffer: 1.0.0 + clone-stats: 1.0.0 + cloneable-readable: 1.1.3 + remove-trailing-separator: 1.1.0 + replace-ext: 1.0.1 + dev: true + + /vm-browserify/1.1.2: + resolution: {integrity: sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==} + dev: true + + /webgpu/0.1.16: + resolution: {integrity: sha512-KAXn/f8lnL8o4B718zzdfi1l0nEWQpuoWlC1L5WM/svAbeHjShCEI0l5ZcZBEEUm9FF3ZTgRjWk8iwbJfnGKTA==} + engines: {node: '>= 13.0.0'} + dev: false + + /which-module/1.0.0: + resolution: {integrity: sha512-F6+WgncZi/mJDrammbTuHe1q0R5hOXv/mBaiNA2TCNT/LTHusX0V+CJnj9XT8ki5ln2UZyyddDgHfCzyrOH7MQ==} + dev: true + + /which-typed-array/1.1.9: + resolution: {integrity: sha512-w9c4xkx6mPidwp7180ckYWfMmvxpjlZuIudNtDf4N/tTAUB8VJbX25qZoAsrtGuYNnGw3pa0AXgbGKRB8/EceA==} + engines: {node: '>= 0.4'} + dependencies: + available-typed-arrays: 1.0.5 + call-bind: 1.0.2 + for-each: 0.3.3 + gopd: 1.0.1 + has-tostringtag: 1.0.0 + is-typed-array: 1.1.10 + dev: true + + /which/1.3.1: + resolution: {integrity: sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==} + hasBin: true + dependencies: + isexe: 2.0.0 + dev: true + + /which/2.0.2: + resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} + engines: {node: '>= 8'} + hasBin: true + dependencies: + isexe: 2.0.0 + + /wide-align/1.1.5: + resolution: {integrity: sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==} + dependencies: + string-width: 4.2.3 + dev: false + + /wrap-ansi/2.1.0: + resolution: {integrity: sha512-vAaEaDM946gbNpH5pLVNR+vX2ht6n0Bt3GXwVB1AuAqZosOvHNF3P7wDnh8KLkSqgUh0uh77le7Owgoz+Z9XBw==} + engines: {node: '>=0.10.0'} + dependencies: + string-width: 1.0.2 + strip-ansi: 3.0.1 + dev: true + + /wrap-ansi/7.0.0: + resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} + engines: {node: '>=10'} + dependencies: + ansi-styles: 4.3.0 + string-width: 4.2.3 + strip-ansi: 6.0.1 + dev: true + + /wrappy/1.0.2: + resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} + + /ws/8.2.3: + resolution: {integrity: sha512-wBuoj1BDpC6ZQ1B7DWQBYVLphPWkm8i9Y0/3YdHjHKHiohOJ1ws+3OccDWtH+PoC9DZD5WOTrJvNbWvjS6JWaA==} + engines: {node: '>=10.0.0'} + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: ^5.0.2 + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + dev: true + + /xmlhttprequest-ssl/2.0.0: + resolution: {integrity: sha512-QKxVRxiRACQcVuQEYFsI1hhkrMlrXHPegbbd1yn9UHOmRxY+si12nQYzri3vbzt8VdTTRviqcKxcyllFas5z2A==} + engines: {node: '>=0.4.0'} + dev: true + + /xtend/4.0.2: + resolution: {integrity: sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==} + engines: {node: '>=0.4'} + + /y18n/3.2.2: + resolution: {integrity: sha512-uGZHXkHnhF0XeeAPgnKfPv1bgKAYyVvmNL1xlKsPYZPaIHxGti2hHqvOCQv71XMsLxu1QjergkqogUnms5D3YQ==} + dev: true + + /y18n/5.0.8: + resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} + engines: {node: '>=10'} + dev: true + + /yallist/2.1.2: + resolution: {integrity: sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A==} + dev: true + + /yallist/4.0.0: + resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} + dev: false + + /yargs-parser/20.2.9: + resolution: {integrity: sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==} + engines: {node: '>=10'} + dev: true + + /yargs-parser/21.1.1: + resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} + engines: {node: '>=12'} + dev: true + + /yargs-parser/5.0.1: + resolution: {integrity: sha512-wpav5XYiddjXxirPoCTUPbqM0PXvJ9hiBMvuJgInvo4/lAOTZzUprArw17q2O1P2+GHhbBr18/iQwjL5Z9BqfA==} + dependencies: + camelcase: 3.0.0 + object.assign: 4.1.4 + dev: true + + /yargs/16.2.0: + resolution: {integrity: sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==} + engines: {node: '>=10'} + dependencies: + cliui: 7.0.4 + escalade: 3.1.1 + get-caller-file: 2.0.5 + require-directory: 2.1.1 + string-width: 4.2.3 + y18n: 5.0.8 + yargs-parser: 20.2.9 + dev: true + + /yargs/17.1.1: + resolution: {integrity: sha512-c2k48R0PwKIqKhPMWjeiF6y2xY/gPMUlro0sgxqXpbOIohWiLNXWslsootttv7E1e73QPAMQSg5FeySbVcpsPQ==} + engines: {node: '>=12'} + dependencies: + cliui: 7.0.4 + escalade: 3.1.1 + get-caller-file: 2.0.5 + require-directory: 2.1.1 + string-width: 4.2.3 + y18n: 5.0.8 + yargs-parser: 20.2.9 + dev: true + + /yargs/17.6.2: + resolution: {integrity: sha512-1/9UrdHjDZc0eOU0HxOHoS78C69UD3JRMvzlJ7S79S2nTaWRA/whGCTV8o9e/N/1Va9YIV7Q4sOxD8VV4pCWOw==} + engines: {node: '>=12'} + dependencies: + cliui: 8.0.1 + escalade: 3.1.1 + get-caller-file: 2.0.5 + require-directory: 2.1.1 + string-width: 4.2.3 + y18n: 5.0.8 + yargs-parser: 21.1.1 + dev: true + + /yargs/7.1.2: + resolution: {integrity: sha512-ZEjj/dQYQy0Zx0lgLMLR8QuaqTihnxirir7EwUHp1Axq4e3+k8jXU5K0VLbNvedv1f4EWtBonDIZm0NUr+jCcA==} + dependencies: + camelcase: 3.0.0 + cliui: 3.2.0 + decamelize: 1.2.0 + get-caller-file: 1.0.3 + os-locale: 1.4.0 + read-pkg-up: 1.0.1 + require-directory: 2.1.1 + require-main-filename: 1.0.1 + set-blocking: 2.0.0 + string-width: 1.0.2 + which-module: 1.0.0 + y18n: 3.2.2 + yargs-parser: 5.0.1 + dev: true + + /yocto-queue/0.1.0: + resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} + engines: {node: '>=10'} + dev: true From 3e3371e4f5b2f0def419265d9ced052262cced22 Mon Sep 17 00:00:00 2001 From: 17097231932 <17097231932@163.com> Date: Sat, 28 Jan 2023 23:19:28 +0800 Subject: [PATCH 02/11] switch to rollup and convert source to esmodule format --- .prettierrc | 18 + dist/gpu-browser-core.js | 32032 +++++++++------- dist/gpu-browser-core.js.map | 1 + dist/gpu-browser-core.min.js | 42 +- dist/gpu-browser-core.min.js.map | 1 + dist/gpu-browser.js | 28045 +++++++------- dist/gpu-browser.js.map | 1 + dist/gpu-browser.min.js | 42 +- dist/gpu-browser.min.js.map | 1 + index.html | 75 + package.json | 8 +- pnpm-lock.yaml | 158 + rollup.config.js | 69 + src/alias.js | 8 +- src/backend/cpu/function-node.js | 8 +- src/backend/cpu/kernel-string.js | 8 +- src/backend/cpu/kernel.js | 16 +- src/backend/function-builder.js | 6 +- src/backend/function-node.js | 12 +- src/backend/function-tracer.js | 8 +- src/backend/gl/kernel-string.js | 10 +- src/backend/gl/kernel.js | 48 +- src/backend/gl/texture/array-2-float-2d.js | 10 +- src/backend/gl/texture/array-2-float-3d.js | 10 +- src/backend/gl/texture/array-2-float.js | 10 +- src/backend/gl/texture/array-3-float-2d.js | 10 +- src/backend/gl/texture/array-3-float-3d.js | 10 +- src/backend/gl/texture/array-3-float.js | 10 +- src/backend/gl/texture/array-4-float-2d.js | 10 +- src/backend/gl/texture/array-4-float-3d.js | 10 +- src/backend/gl/texture/array-4-float.js | 10 +- src/backend/gl/texture/float-2d.js | 10 +- src/backend/gl/texture/float-3d.js | 10 +- src/backend/gl/texture/float.js | 10 +- src/backend/gl/texture/graphical.js | 8 +- src/backend/gl/texture/index.js | 6 +- src/backend/gl/texture/memory-optimized-2d.js | 10 +- src/backend/gl/texture/memory-optimized-3d.js | 10 +- src/backend/gl/texture/memory-optimized.js | 10 +- src/backend/gl/texture/unsigned-2d.js | 10 +- src/backend/gl/texture/unsigned-3d.js | 10 +- src/backend/gl/texture/unsigned.js | 10 +- src/backend/headless-gl/kernel.js | 12 +- src/backend/kernel-value.js | 6 +- src/backend/kernel.js | 10 +- src/backend/web-gl/fragment-shader.js | 6 +- src/backend/web-gl/function-node.js | 10 +- src/backend/web-gl/kernel-value-maps.js | 65 +- src/backend/web-gl/kernel-value/array.js | 10 +- src/backend/web-gl/kernel-value/array2.js | 8 +- src/backend/web-gl/kernel-value/array3.js | 8 +- src/backend/web-gl/kernel-value/array4.js | 8 +- src/backend/web-gl/kernel-value/boolean.js | 9 +- .../web-gl/kernel-value/dynamic-html-image.js | 10 +- .../web-gl/kernel-value/dynamic-html-video.js | 8 +- ...dynamic-memory-optimized-number-texture.js | 10 +- .../kernel-value/dynamic-number-texture.js | 10 +- .../kernel-value/dynamic-single-array.js | 10 +- .../kernel-value/dynamic-single-array1d-i.js | 10 +- .../kernel-value/dynamic-single-array2d-i.js | 10 +- .../kernel-value/dynamic-single-array3d-i.js | 10 +- .../kernel-value/dynamic-single-input.js | 10 +- .../kernel-value/dynamic-unsigned-array.js | 10 +- .../kernel-value/dynamic-unsigned-input.js | 10 +- src/backend/web-gl/kernel-value/float.js | 10 +- src/backend/web-gl/kernel-value/html-image.js | 10 +- src/backend/web-gl/kernel-value/html-video.js | 8 +- src/backend/web-gl/kernel-value/index.js | 10 +- src/backend/web-gl/kernel-value/integer.js | 9 +- .../memory-optimized-number-texture.js | 13 +- .../web-gl/kernel-value/number-texture.js | 12 +- .../web-gl/kernel-value/single-array.js | 10 +- .../web-gl/kernel-value/single-array1d-i.js | 10 +- .../web-gl/kernel-value/single-array2d-i.js | 10 +- .../web-gl/kernel-value/single-array3d-i.js | 10 +- .../web-gl/kernel-value/single-input.js | 10 +- .../web-gl/kernel-value/unsigned-array.js | 10 +- .../web-gl/kernel-value/unsigned-input.js | 10 +- src/backend/web-gl/kernel.js | 24 +- src/backend/web-gl/vertex-shader.js | 5 +- src/backend/web-gl2/fragment-shader.js | 6 +- src/backend/web-gl2/function-node.js | 10 +- src/backend/web-gl2/kernel-value-maps.js | 69 +- src/backend/web-gl2/kernel-value/array2.js | 8 +- src/backend/web-gl2/kernel-value/array3.js | 8 +- src/backend/web-gl2/kernel-value/array4.js | 8 +- src/backend/web-gl2/kernel-value/boolean.js | 7 +- .../kernel-value/dynamic-html-image-array.js | 10 +- .../kernel-value/dynamic-html-image.js | 10 +- .../kernel-value/dynamic-html-video.js | 9 +- ...dynamic-memory-optimized-number-texture.js | 10 +- .../kernel-value/dynamic-number-texture.js | 10 +- .../kernel-value/dynamic-single-array.js | 10 +- .../kernel-value/dynamic-single-array1d-i.js | 10 +- .../kernel-value/dynamic-single-array2d-i.js | 10 +- .../kernel-value/dynamic-single-array3d-i.js | 10 +- .../kernel-value/dynamic-single-input.js | 10 +- .../kernel-value/dynamic-unsigned-array.js | 10 +- .../kernel-value/dynamic-unsigned-input.js | 10 +- src/backend/web-gl2/kernel-value/float.js | 9 +- .../web-gl2/kernel-value/html-image-array.js | 10 +- .../web-gl2/kernel-value/html-image.js | 10 +- .../web-gl2/kernel-value/html-video.js | 10 +- src/backend/web-gl2/kernel-value/integer.js | 8 +- .../memory-optimized-number-texture.js | 10 +- .../web-gl2/kernel-value/number-texture.js | 10 +- .../web-gl2/kernel-value/single-array.js | 10 +- .../web-gl2/kernel-value/single-array1d-i.js | 10 +- .../web-gl2/kernel-value/single-array2d-i.js | 10 +- .../web-gl2/kernel-value/single-array3d-i.js | 10 +- .../web-gl2/kernel-value/single-input.js | 10 +- .../web-gl2/kernel-value/unsigned-array.js | 10 +- .../web-gl2/kernel-value/unsigned-input.js | 10 +- src/backend/web-gl2/kernel.js | 20 +- src/backend/web-gl2/vertex-shader.js | 6 +- src/browser-header.txt | 14 - src/browser.js | 67 +- src/gpu.js | 39 +- src/index.js | 93 +- src/input.js | 12 +- src/kernel-run-shortcut.js | 7 +- src/plugins/math-random-triangle-noise.js | 2 +- .../math-random-uniformly-distributed.js | 2 +- src/texture.js | 6 +- src/utils.js | 12 +- 125 files changed, 34544 insertions(+), 27350 deletions(-) create mode 100644 .prettierrc create mode 100644 dist/gpu-browser-core.js.map create mode 100644 dist/gpu-browser-core.min.js.map create mode 100644 dist/gpu-browser.js.map create mode 100644 dist/gpu-browser.min.js.map create mode 100644 index.html create mode 100644 rollup.config.js delete mode 100644 src/browser-header.txt diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 00000000..07fa30ac --- /dev/null +++ b/.prettierrc @@ -0,0 +1,18 @@ +{ + "arrowParens": "avoid", + "bracketSpacing": true, + "endOfLine": "lf", + "htmlWhitespaceSensitivity": "css", + "insertPragma": false, + "jsxSingleQuote": false, + "printWidth": 79, + "proseWrap": "preserve", + "quoteProps": "as-needed", + "requirePragma": false, + "semi": false, + "singleQuote": true, + "tabWidth": 2, + "trailingComma": "es5", + "useTabs": false, + "vueIndentScriptAndStyle": false +} diff --git a/dist/gpu-browser-core.js b/dist/gpu-browser-core.js index 6f1e2e50..150b5534 100644 --- a/dist/gpu-browser-core.js +++ b/dist/gpu-browser-core.js @@ -1,10752 +1,17659 @@ /** - * gpu.js - * http://gpu.rocks/ - * - * GPU Accelerated JavaScript - * - * @version 2.16.0 - * @date Wed Nov 16 2022 15:48:37 GMT-0500 (Eastern Standard Time) - * - * @license MIT - * The MIT License - * - * Copyright (c) 2022 gpu.js Team - */(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.GPU = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i 0) { - recording.pop(); - } + return newArguments; } - function insertVariable(name, value) { - variables[name] = value; - } - function getEntity(value) { - const name = entityNames[value]; - if (name) { - return contextName + '.' + name; + + function mock1D() { + const args = setupArguments(arguments); + const row = new Float32Array(this.output.x); + for (let x = 0; x < this.output.x; x++) { + this.thread.x = x; + this.thread.y = 0; + this.thread.z = 0; + row[x] = this._fn.apply(this, args); } - return value; - } - function setIndent(spaces) { - indent = ' '.repeat(spaces); - } - function addVariable(value, source) { - const variableName = `${contextName}Variable${contextVariables.length}`; - recording.push(`${indent}const ${variableName} = ${source};`); - contextVariables.push(value); - return variableName; - } - function writePPM(width, height) { - const sourceVariable = `${contextName}Variable${contextVariables.length}`; - const imageVariable = `imageDatum${imageCount}`; - recording.push(`${indent}let ${imageVariable} = ["P3\\n# ${readPixelsFile}.ppm\\n", ${width}, ' ', ${height}, "\\n255\\n"].join("");`); - recording.push(`${indent}for (let i = 0; i < ${imageVariable}.length; i += 4) {`); - recording.push(`${indent} ${imageVariable} += ${sourceVariable}[i] + ' ' + ${sourceVariable}[i + 1] + ' ' + ${sourceVariable}[i + 2] + ' ';`); - recording.push(`${indent}}`); - recording.push(`${indent}if (typeof require !== "undefined") {`); - recording.push(`${indent} require('fs').writeFileSync('./${readPixelsFile}.ppm', ${imageVariable});`); - recording.push(`${indent}}`); - imageCount++; - } - function addComment(value) { - recording.push(`${indent}// ${value}`); - } - function checkThrowError() { - recording.push(`${indent}(() => { -${indent}const error = ${contextName}.getError(); -${indent}if (error !== ${contextName}.NONE) { -${indent} const names = Object.getOwnPropertyNames(gl); -${indent} for (let i = 0; i < names.length; i++) { -${indent} const name = names[i]; -${indent} if (${contextName}[name] === error) { -${indent} throw new Error('${contextName} threw ' + name); -${indent} } -${indent} } -${indent}} -${indent}})();`); - } - function methodCallToString(method, args) { - return `${contextName}.${method}(${argumentsToString(args, { contextName, contextVariables, getEntity, addVariable, variables, onUnrecognizedArgumentLookup })})`; + return row; } - function getVariableName(value) { - if (variables) { - for (const name in variables) { - if (variables[name] === value) { - return name; - } + function mock2D() { + const args = setupArguments(arguments); + const matrix = new Array(this.output.y); + for (let y = 0; y < this.output.y; y++) { + const row = new Float32Array(this.output.x); + for (let x = 0; x < this.output.x; x++) { + this.thread.x = x; + this.thread.y = y; + this.thread.z = 0; + row[x] = this._fn.apply(this, args); } + matrix[y] = row; } - return null; + return matrix; } - function getContextVariableName(value) { - const i = contextVariables.indexOf(value); - if (i !== -1) { - return `${contextName}Variable${i}`; + function mock2DGraphical() { + const args = setupArguments(arguments); + for (let y = 0; y < this.output.y; y++) { + for (let x = 0; x < this.output.x; x++) { + this.thread.x = x; + this.thread.y = y; + this.thread.z = 0; + this._fn.apply(this, args); + } } - return null; } -} -function glExtensionWiretap(extension, options) { - const proxy = new Proxy(extension, { get: listen }); - const extensionEntityNames = {}; - const { - contextName, - contextVariables, - getEntity, - useTrackablePrimitives, - recording, - variables, - indent, - onUnrecognizedArgumentLookup, - } = options; - return proxy; - function listen(obj, property) { - if (typeof obj[property] === 'function') { - return function() { - switch (property) { - case 'drawBuffersWEBGL': - recording.push(`${indent}${contextName}.drawBuffersWEBGL([${argumentsToString(arguments[0], { contextName, contextVariables, getEntity: getExtensionEntity, addVariable, variables, onUnrecognizedArgumentLookup })}]);`); - return extension.drawBuffersWEBGL(arguments[0]); - } - let result = extension[property].apply(extension, arguments); - switch (typeof result) { - case 'undefined': - recording.push(`${indent}${methodCallToString(property, arguments)};`); - return; - case 'number': - case 'boolean': - if (useTrackablePrimitives && contextVariables.indexOf(trackablePrimitive(result)) === -1) { - recording.push(`${indent}const ${contextName}Variable${contextVariables.length} = ${methodCallToString(property, arguments)};`); - contextVariables.push(result = trackablePrimitive(result)); - } else { - recording.push(`${indent}const ${contextName}Variable${contextVariables.length} = ${methodCallToString(property, arguments)};`); - contextVariables.push(result); - } - break; - default: - if (result === null) { - recording.push(`${methodCallToString(property, arguments)};`); - } else { - recording.push(`${indent}const ${contextName}Variable${contextVariables.length} = ${methodCallToString(property, arguments)};`); - } - contextVariables.push(result); + function mock3D() { + const args = setupArguments(arguments); + const cube = new Array(this.output.z); + for (let z = 0; z < this.output.z; z++) { + const matrix = new Array(this.output.y); + for (let y = 0; y < this.output.y; y++) { + const row = new Float32Array(this.output.x); + for (let x = 0; x < this.output.x; x++) { + this.thread.x = x; + this.thread.y = y; + this.thread.z = z; + row[x] = this._fn.apply(this, args); } - return result; - }; + matrix[y] = row; + } + cube[z] = matrix; } - extensionEntityNames[extension[property]] = property; - return extension[property]; + return cube; } - function getExtensionEntity(value) { - if (extensionEntityNames.hasOwnProperty(value)) { - return `${contextName}.${extensionEntityNames[value]}`; + function apiDecorate(kernel) { + kernel.setOutput = (output) => { + kernel.output = setupOutput(output); + if (kernel.graphical) { + setupGraphical(kernel); + } + }; + kernel.toJSON = () => { + throw new Error('Not usable with gpuMock'); + }; + kernel.setConstants = (flag) => { + kernel.constants = flag; + return kernel; + }; + kernel.setGraphical = (flag) => { + kernel.graphical = flag; + return kernel; + }; + kernel.setCanvas = (flag) => { + kernel.canvas = flag; + return kernel; + }; + kernel.setContext = (flag) => { + kernel.context = flag; + return kernel; + }; + kernel.destroy = () => {}; + kernel.validateSettings = () => {}; + if (kernel.graphical && kernel.output) { + setupGraphical(kernel); } - return getEntity(value); - } + kernel.exec = function() { + return new Promise((resolve, reject) => { + try { + resolve(kernel.apply(kernel, arguments)); + } catch(e) { + reject(e); + } + }); + }; + kernel.getPixels = (flip) => { + const {x, y} = kernel.output; + // cpu is not flipped by default + return flip ? flipPixels(kernel._imageData.data, x, y) : kernel._imageData.data.slice(0); + }; + kernel.color = function(r, g, b, a) { + if (typeof a === 'undefined') { + a = 1; + } - function methodCallToString(method, args) { - return `${contextName}.${method}(${argumentsToString(args, { contextName, contextVariables, getEntity: getExtensionEntity, addVariable, variables, onUnrecognizedArgumentLookup })})`; - } + r = Math.floor(r * 255); + g = Math.floor(g * 255); + b = Math.floor(b * 255); + a = Math.floor(a * 255); + + const width = kernel.output.x; + const height = kernel.output.y; + + const x = kernel.thread.x; + const y = height - kernel.thread.y - 1; - function addVariable(value, source) { - const variableName = `${contextName}Variable${contextVariables.length}`; - contextVariables.push(value); - recording.push(`${indent}const ${variableName} = ${source};`); - return variableName; + const index = x + y * width; + + kernel._colorData[index * 4 + 0] = r; + kernel._colorData[index * 4 + 1] = g; + kernel._colorData[index * 4 + 2] = b; + kernel._colorData[index * 4 + 3] = a; + }; + + // these are added for api compatibility, but have no affect + const mockMethod = () => kernel; + const methods = [ + 'setWarnVarUsage', + 'setArgumentTypes', + 'setTactic', + 'setOptimizeFloatMemory', + 'setDebug', + 'setLoopMaxIterations', + 'setConstantTypes', + 'setFunctions', + 'setNativeFunctions', + 'setInjectedNative', + 'setPipeline', + 'setPrecision', + 'setOutputToTexture', + 'setImmutable', + 'setStrictIntegers', + 'setDynamicOutput', + 'setHardcodeConstants', + 'setDynamicArguments', + 'setUseLegacyEncoder', + 'setWarnVarUsage', + 'addSubKernel', + ]; + for (let i = 0; i < methods.length; i++) { + kernel[methods[i]] = mockMethod; + } + return kernel; } -} -function argumentsToString(args, options) { - const { variables, onUnrecognizedArgumentLookup } = options; - return (Array.from(args).map((arg) => { - const variableName = getVariableName(arg); - if (variableName) { - return variableName; + function setupGraphical(kernel) { + const {x, y} = kernel.output; + if (kernel.context && kernel.context.createImageData) { + const data = new Uint8ClampedArray(x * y * 4); + kernel._imageData = kernel.context.createImageData(x, y); + kernel._colorData = data; + } else { + const data = new Uint8ClampedArray(x * y * 4); + kernel._imageData = { data }; + kernel._colorData = data; } - return argumentToString(arg, options); - }).join(', ')); + } - function getVariableName(value) { - if (variables) { - for (const name in variables) { - if (!variables.hasOwnProperty(name)) continue; - if (variables[name] === value) { - return name; - } + function setupOutput(output) { + let result = null; + if (output.length) { + if (output.length === 3) { + const [x,y,z] = output; + result = { x, y, z }; + } else if (output.length === 2) { + const [x,y] = output; + result = { x, y }; + } else { + const [x] = output; + result = { x }; } + } else { + result = output; } - if (onUnrecognizedArgumentLookup) { - return onUnrecognizedArgumentLookup(value); - } - return null; + return result; } -} -function argumentToString(arg, options) { - const { contextName, contextVariables, getEntity, addVariable, onUnrecognizedArgumentLookup } = options; - if (typeof arg === 'undefined') { - return 'undefined'; - } - if (arg === null) { - return 'null'; - } - const i = contextVariables.indexOf(arg); - if (i > -1) { - return `${contextName}Variable${i}`; - } - switch (arg.constructor.name) { - case 'String': - const hasLines = /\n/.test(arg); - const hasSingleQuotes = /'/.test(arg); - const hasDoubleQuotes = /"/.test(arg); - if (hasLines) { - return '`' + arg + '`'; - } else if (hasSingleQuotes && !hasDoubleQuotes) { - return '"' + arg + '"'; - } else if (!hasSingleQuotes && hasDoubleQuotes) { - return "'" + arg + "'"; - } else { - return '\'' + arg + '\''; - } - case 'Number': return getEntity(arg); - case 'Boolean': return getEntity(arg); - case 'Array': - return addVariable(arg, `new ${arg.constructor.name}([${Array.from(arg).join(',')}])`); - case 'Float32Array': - case 'Uint8Array': - case 'Uint16Array': - case 'Int32Array': - return addVariable(arg, `new ${arg.constructor.name}(${JSON.stringify(Array.from(arg))})`); - default: - if (onUnrecognizedArgumentLookup) { - const instantiationString = onUnrecognizedArgumentLookup(arg); - if (instantiationString) { - return instantiationString; + function gpuMock(fn, settings = {}) { + const output = settings.output ? setupOutput(settings.output) : null; + function kernel() { + if (kernel.output.z) { + return mock3D.apply(kernel, arguments); + } else if (kernel.output.y) { + if (kernel.graphical) { + return mock2DGraphical.apply(kernel, arguments); } + return mock2D.apply(kernel, arguments); + } else { + return mock1D.apply(kernel, arguments); } - throw new Error(`unrecognized argument type ${arg.constructor.name}`); + } + kernel._fn = fn; + kernel.constants = settings.constants || null; + kernel.context = settings.context || null; + kernel.canvas = settings.canvas || null; + kernel.graphical = settings.graphical || false; + kernel._imageData = null; + kernel._colorData = null; + kernel.output = output; + kernel.thread = { + x: 0, + y: 0, + z: 0 + }; + return apiDecorate(kernel); } -} -function trackablePrimitive(value) { - return new value.constructor(value); -} + function flipPixels(pixels, width, height) { + // https://stackoverflow.com/a/41973289/1324039 + const halfHeight = height / 2 | 0; // the | 0 keeps the result an int + const bytesPerRow = width * 4; + // make a temp buffer to hold one row + const temp = new Uint8ClampedArray(width * 4); + const result = pixels.slice(0); + for (let y = 0; y < halfHeight; ++y) { + const topOffset = y * bytesPerRow; + const bottomOffset = (height - y - 1) * bytesPerRow; -if (typeof module !== 'undefined') { - module.exports = { glWiretap, glExtensionWiretap }; -} + // make copy of a row on the top half + temp.set(result.subarray(topOffset, topOffset + bytesPerRow)); -if (typeof window !== 'undefined') { - glWiretap.glExtensionWiretap = glExtensionWiretap; - window.glWiretap = glWiretap; -} + // copy a row from the bottom half to the top + result.copyWithin(topOffset, bottomOffset, bottomOffset + bytesPerRow); -},{}],3:[function(require,module,exports){ -function setupArguments(args) { - const newArguments = new Array(args.length); - for (let i = 0; i < args.length; i++) { - const arg = args[i]; - if (arg.toArray) { - newArguments[i] = arg.toArray(); - } else { - newArguments[i] = arg; + // copy the copy of the top half row to the bottom half + result.set(temp, bottomOffset); } + return result; } - return newArguments; -} -function mock1D() { - const args = setupArguments(arguments); - const row = new Float32Array(this.output.x); - for (let x = 0; x < this.output.x; x++) { - this.thread.x = x; - this.thread.y = 0; - this.thread.z = 0; - row[x] = this._fn.apply(this, args); - } - return row; -} + var gpuMock_js = { + gpuMock + }; -function mock2D() { - const args = setupArguments(arguments); - const matrix = new Array(this.output.y); - for (let y = 0; y < this.output.y; y++) { - const row = new Float32Array(this.output.x); - for (let x = 0; x < this.output.x; x++) { - this.thread.x = x; - this.thread.y = y; - this.thread.z = 0; - row[x] = this._fn.apply(this, args); - } - matrix[y] = row; - } - return matrix; -} + // Reserved word lists for various dialects of the language -function mock2DGraphical() { - const args = setupArguments(arguments); - for (let y = 0; y < this.output.y; y++) { - for (let x = 0; x < this.output.x; x++) { - this.thread.x = x; - this.thread.y = y; - this.thread.z = 0; - this._fn.apply(this, args); - } - } -} + var reservedWords = { + 3: "abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile", + 5: "class enum extends super const export import", + 6: "enum", + strict: "implements interface let package private protected public static yield", + strictBind: "eval arguments" + }; -function mock3D() { - const args = setupArguments(arguments); - const cube = new Array(this.output.z); - for (let z = 0; z < this.output.z; z++) { - const matrix = new Array(this.output.y); - for (let y = 0; y < this.output.y; y++) { - const row = new Float32Array(this.output.x); - for (let x = 0; x < this.output.x; x++) { - this.thread.x = x; - this.thread.y = y; - this.thread.z = z; - row[x] = this._fn.apply(this, args); - } - matrix[y] = row; - } - cube[z] = matrix; - } - return cube; -} + // And the keywords -function apiDecorate(kernel) { - kernel.setOutput = (output) => { - kernel.output = setupOutput(output); - if (kernel.graphical) { - setupGraphical(kernel); - } - }; - kernel.toJSON = () => { - throw new Error('Not usable with gpuMock'); - }; - kernel.setConstants = (flag) => { - kernel.constants = flag; - return kernel; - }; - kernel.setGraphical = (flag) => { - kernel.graphical = flag; - return kernel; - }; - kernel.setCanvas = (flag) => { - kernel.canvas = flag; - return kernel; + var ecma5AndLessKeywords = "break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this"; + + var keywords = { + 5: ecma5AndLessKeywords, + "5module": ecma5AndLessKeywords + " export import", + 6: ecma5AndLessKeywords + " const class extends export import super" }; - kernel.setContext = (flag) => { - kernel.context = flag; - return kernel; + + var keywordRelationalOperator = /^in(stanceof)?$/; + + // ## Character categories + + // Big ugly regular expressions that match characters in the + // whitespace, identifier, and identifier-start categories. These + // are only applied when a character is found to actually have a + // code point above 128. + // Generated by `bin/generate-identifier-regex.js`. + var nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u08a0-\u08b4\u08b6-\u08c7\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d04-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c88\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31bf\u31f0-\u31ff\u3400-\u4dbf\u4e00-\u9ffc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7bf\ua7c2-\ua7ca\ua7f5-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab69\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc"; + var nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08d3-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b55-\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d81-\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1abf\u1ac0\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf4\u1cf7-\u1cf9\u1dc0-\u1df9\u1dfb-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua82c\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f"; + + var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]"); + var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]"); + + nonASCIIidentifierStartChars = nonASCIIidentifierChars = null; + + // These are a run-length and offset encoded representation of the + // >0xffff code points that are a valid part of identifiers. The + // offset starts at 0x10000, and each pair of numbers represents an + // offset to the next range, and then a size of the range. They were + // generated by bin/generate-identifier-regex.js + + // eslint-disable-next-line comma-spacing + var astralIdentifierStartCodes = [0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,157,310,10,21,11,7,153,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,107,20,28,22,13,52,76,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,230,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,35,56,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,190,0,80,921,103,110,18,195,2749,1070,4050,582,8634,568,8,30,114,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8952,286,50,2,18,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,2357,44,11,6,17,0,370,43,1301,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42717,35,4148,12,221,3,5761,15,7472,3104,541,1507,4938]; + + // eslint-disable-next-line comma-spacing + var astralIdentifierCodes = [509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,154,10,176,2,54,14,32,9,16,3,46,10,54,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,161,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,19306,9,135,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,5319,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,262,6,10,9,419,13,1495,6,110,6,6,9,4759,9,787719,239]; + + // This has a complexity linear to the value of the code. The + // assumption is that looking up astral identifier characters is + // rare. + function isInAstralSet(code, set) { + var pos = 0x10000; + for (var i = 0; i < set.length; i += 2) { + pos += set[i]; + if (pos > code) { return false } + pos += set[i + 1]; + if (pos >= code) { return true } + } + } + + // Test whether a given character code starts an identifier. + + function isIdentifierStart(code, astral) { + if (code < 65) { return code === 36 } + if (code < 91) { return true } + if (code < 97) { return code === 95 } + if (code < 123) { return true } + if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code)) } + if (astral === false) { return false } + return isInAstralSet(code, astralIdentifierStartCodes) + } + + // Test whether a given character is part of an identifier. + + function isIdentifierChar(code, astral) { + if (code < 48) { return code === 36 } + if (code < 58) { return true } + if (code < 65) { return false } + if (code < 91) { return true } + if (code < 97) { return code === 95 } + if (code < 123) { return true } + if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)) } + if (astral === false) { return false } + return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes) + } + + // ## Token types + + // The assignment of fine-grained, information-carrying type objects + // allows the tokenizer to store the information it has about a + // token in a way that is very cheap for the parser to look up. + + // All token type variables start with an underscore, to make them + // easy to recognize. + + // The `beforeExpr` property is used to disambiguate between regular + // expressions and divisions. It is set on all token types that can + // be followed by an expression (thus, a slash after them would be a + // regular expression). + // + // The `startsExpr` property is used to check if the token ends a + // `yield` expression. It is set on all token types that either can + // directly start an expression (like a quotation mark) or can + // continue an expression (like the body of a string). + // + // `isLoop` marks a keyword as starting a loop, which is important + // to know when parsing a label, in order to allow or disallow + // continue jumps to that label. + + var TokenType = function TokenType(label, conf) { + if ( conf === void 0 ) conf = {}; + + this.label = label; + this.keyword = conf.keyword; + this.beforeExpr = !!conf.beforeExpr; + this.startsExpr = !!conf.startsExpr; + this.isLoop = !!conf.isLoop; + this.isAssign = !!conf.isAssign; + this.prefix = !!conf.prefix; + this.postfix = !!conf.postfix; + this.binop = conf.binop || null; + this.updateContext = null; }; - kernel.destroy = () => {}; - kernel.validateSettings = () => {}; - if (kernel.graphical && kernel.output) { - setupGraphical(kernel); - } - kernel.exec = function() { - return new Promise((resolve, reject) => { - try { - resolve(kernel.apply(kernel, arguments)); - } catch(e) { - reject(e); - } - }); + + function binop(name, prec) { + return new TokenType(name, {beforeExpr: true, binop: prec}) + } + var beforeExpr = {beforeExpr: true}, startsExpr = {startsExpr: true}; + + // Map keyword names to token types. + + var keywords$1 = {}; + + // Succinct definitions of keyword token types + function kw(name, options) { + if ( options === void 0 ) options = {}; + + options.keyword = name; + return keywords$1[name] = new TokenType(name, options) + } + + var types = { + num: new TokenType("num", startsExpr), + regexp: new TokenType("regexp", startsExpr), + string: new TokenType("string", startsExpr), + name: new TokenType("name", startsExpr), + eof: new TokenType("eof"), + + // Punctuation token types. + bracketL: new TokenType("[", {beforeExpr: true, startsExpr: true}), + bracketR: new TokenType("]"), + braceL: new TokenType("{", {beforeExpr: true, startsExpr: true}), + braceR: new TokenType("}"), + parenL: new TokenType("(", {beforeExpr: true, startsExpr: true}), + parenR: new TokenType(")"), + comma: new TokenType(",", beforeExpr), + semi: new TokenType(";", beforeExpr), + colon: new TokenType(":", beforeExpr), + dot: new TokenType("."), + question: new TokenType("?", beforeExpr), + questionDot: new TokenType("?."), + arrow: new TokenType("=>", beforeExpr), + template: new TokenType("template"), + invalidTemplate: new TokenType("invalidTemplate"), + ellipsis: new TokenType("...", beforeExpr), + backQuote: new TokenType("`", startsExpr), + dollarBraceL: new TokenType("${", {beforeExpr: true, startsExpr: true}), + + // Operators. These carry several kinds of properties to help the + // parser use them properly (the presence of these properties is + // what categorizes them as operators). + // + // `binop`, when present, specifies that this operator is a binary + // operator, and will refer to its precedence. + // + // `prefix` and `postfix` mark the operator as a prefix or postfix + // unary operator. + // + // `isAssign` marks all of `=`, `+=`, `-=` etcetera, which act as + // binary operators with a very low precedence, that should result + // in AssignmentExpression nodes. + + eq: new TokenType("=", {beforeExpr: true, isAssign: true}), + assign: new TokenType("_=", {beforeExpr: true, isAssign: true}), + incDec: new TokenType("++/--", {prefix: true, postfix: true, startsExpr: true}), + prefix: new TokenType("!/~", {beforeExpr: true, prefix: true, startsExpr: true}), + logicalOR: binop("||", 1), + logicalAND: binop("&&", 2), + bitwiseOR: binop("|", 3), + bitwiseXOR: binop("^", 4), + bitwiseAND: binop("&", 5), + equality: binop("==/!=/===/!==", 6), + relational: binop("/<=/>=", 7), + bitShift: binop("<>/>>>", 8), + plusMin: new TokenType("+/-", {beforeExpr: true, binop: 9, prefix: true, startsExpr: true}), + modulo: binop("%", 10), + star: binop("*", 10), + slash: binop("/", 10), + starstar: new TokenType("**", {beforeExpr: true}), + coalesce: binop("??", 1), + + // Keyword token types. + _break: kw("break"), + _case: kw("case", beforeExpr), + _catch: kw("catch"), + _continue: kw("continue"), + _debugger: kw("debugger"), + _default: kw("default", beforeExpr), + _do: kw("do", {isLoop: true, beforeExpr: true}), + _else: kw("else", beforeExpr), + _finally: kw("finally"), + _for: kw("for", {isLoop: true}), + _function: kw("function", startsExpr), + _if: kw("if"), + _return: kw("return", beforeExpr), + _switch: kw("switch"), + _throw: kw("throw", beforeExpr), + _try: kw("try"), + _var: kw("var"), + _const: kw("const"), + _while: kw("while", {isLoop: true}), + _with: kw("with"), + _new: kw("new", {beforeExpr: true, startsExpr: true}), + _this: kw("this", startsExpr), + _super: kw("super", startsExpr), + _class: kw("class", startsExpr), + _extends: kw("extends", beforeExpr), + _export: kw("export"), + _import: kw("import", startsExpr), + _null: kw("null", startsExpr), + _true: kw("true", startsExpr), + _false: kw("false", startsExpr), + _in: kw("in", {beforeExpr: true, binop: 7}), + _instanceof: kw("instanceof", {beforeExpr: true, binop: 7}), + _typeof: kw("typeof", {beforeExpr: true, prefix: true, startsExpr: true}), + _void: kw("void", {beforeExpr: true, prefix: true, startsExpr: true}), + _delete: kw("delete", {beforeExpr: true, prefix: true, startsExpr: true}) }; - kernel.getPixels = (flip) => { - const {x, y} = kernel.output; - return flip ? flipPixels(kernel._imageData.data, x, y) : kernel._imageData.data.slice(0); - }; - kernel.color = function(r, g, b, a) { - if (typeof a === 'undefined') { - a = 1; - } - - r = Math.floor(r * 255); - g = Math.floor(g * 255); - b = Math.floor(b * 255); - a = Math.floor(a * 255); - - const width = kernel.output.x; - const height = kernel.output.y; - - const x = kernel.thread.x; - const y = height - kernel.thread.y - 1; - - const index = x + y * width; - - kernel._colorData[index * 4 + 0] = r; - kernel._colorData[index * 4 + 1] = g; - kernel._colorData[index * 4 + 2] = b; - kernel._colorData[index * 4 + 3] = a; - }; - - const mockMethod = () => kernel; - const methods = [ - 'setWarnVarUsage', - 'setArgumentTypes', - 'setTactic', - 'setOptimizeFloatMemory', - 'setDebug', - 'setLoopMaxIterations', - 'setConstantTypes', - 'setFunctions', - 'setNativeFunctions', - 'setInjectedNative', - 'setPipeline', - 'setPrecision', - 'setOutputToTexture', - 'setImmutable', - 'setStrictIntegers', - 'setDynamicOutput', - 'setHardcodeConstants', - 'setDynamicArguments', - 'setUseLegacyEncoder', - 'setWarnVarUsage', - 'addSubKernel', - ]; - for (let i = 0; i < methods.length; i++) { - kernel[methods[i]] = mockMethod; - } - return kernel; -} -function setupGraphical(kernel) { - const {x, y} = kernel.output; - if (kernel.context && kernel.context.createImageData) { - const data = new Uint8ClampedArray(x * y * 4); - kernel._imageData = kernel.context.createImageData(x, y); - kernel._colorData = data; - } else { - const data = new Uint8ClampedArray(x * y * 4); - kernel._imageData = { data }; - kernel._colorData = data; - } -} + // Matches a whole line break (where CRLF is considered a single + // line break). Used to count lines. -function setupOutput(output) { - let result = null; - if (output.length) { - if (output.length === 3) { - const [x,y,z] = output; - result = { x, y, z }; - } else if (output.length === 2) { - const [x,y] = output; - result = { x, y }; - } else { - const [x] = output; - result = { x }; - } - } else { - result = output; + var lineBreak = /\r\n?|\n|\u2028|\u2029/; + var lineBreakG = new RegExp(lineBreak.source, "g"); + + function isNewLine(code, ecma2019String) { + return code === 10 || code === 13 || (!ecma2019String && (code === 0x2028 || code === 0x2029)) } - return result; -} -function gpuMock(fn, settings = {}) { - const output = settings.output ? setupOutput(settings.output) : null; - function kernel() { - if (kernel.output.z) { - return mock3D.apply(kernel, arguments); - } else if (kernel.output.y) { - if (kernel.graphical) { - return mock2DGraphical.apply(kernel, arguments); - } - return mock2D.apply(kernel, arguments); - } else { - return mock1D.apply(kernel, arguments); - } - } - kernel._fn = fn; - kernel.constants = settings.constants || null; - kernel.context = settings.context || null; - kernel.canvas = settings.canvas || null; - kernel.graphical = settings.graphical || false; - kernel._imageData = null; - kernel._colorData = null; - kernel.output = output; - kernel.thread = { - x: 0, - y: 0, - z: 0 - }; - return apiDecorate(kernel); -} + var nonASCIIwhitespace = /[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/; -function flipPixels(pixels, width, height) { - const halfHeight = height / 2 | 0; - const bytesPerRow = width * 4; - const temp = new Uint8ClampedArray(width * 4); - const result = pixels.slice(0); - for (let y = 0; y < halfHeight; ++y) { - const topOffset = y * bytesPerRow; - const bottomOffset = (height - y - 1) * bytesPerRow; + var skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g; - temp.set(result.subarray(topOffset, topOffset + bytesPerRow)); + var ref = Object.prototype; + var hasOwnProperty = ref.hasOwnProperty; + var toString = ref.toString; - result.copyWithin(topOffset, bottomOffset, bottomOffset + bytesPerRow); + // Checks if an object has a property. - result.set(temp, bottomOffset); + function has(obj, propName) { + return hasOwnProperty.call(obj, propName) } - return result; -} -module.exports = { - gpuMock -}; + var isArray = Array.isArray || (function (obj) { return ( + toString.call(obj) === "[object Array]" + ); }); -},{}],4:[function(require,module,exports){ -const { utils } = require('./utils'); - -function alias(name, source) { - const fnString = source.toString(); - return new Function(`return function ${ name } (${ utils.getArgumentNamesFromString(fnString).join(', ') }) { - ${ utils.getFunctionBodyFromString(fnString) } -}`)(); -} + function wordsRegexp(words) { + return new RegExp("^(?:" + words.replace(/ /g, "|") + ")$") + } -module.exports = { - alias -}; -},{"./utils":113}],5:[function(require,module,exports){ -const { FunctionNode } = require('../function-node'); + // These are used when `options.locations` is on, for the + // `startLoc` and `endLoc` properties. -class CPUFunctionNode extends FunctionNode { - astFunction(ast, retArr) { + var Position = function Position(line, col) { + this.line = line; + this.column = col; + }; - if (!this.isRootKernel) { - retArr.push('function'); - retArr.push(' '); - retArr.push(this.name); - retArr.push('('); + Position.prototype.offset = function offset (n) { + return new Position(this.line, this.column + n) + }; - for (let i = 0; i < this.argumentNames.length; ++i) { - const argumentName = this.argumentNames[i]; + var SourceLocation = function SourceLocation(p, start, end) { + this.start = start; + this.end = end; + if (p.sourceFile !== null) { this.source = p.sourceFile; } + }; - if (i > 0) { - retArr.push(', '); - } - retArr.push('user_'); - retArr.push(argumentName); + // The `getLineInfo` function is mostly useful when the + // `locations` option is off (for performance reasons) and you + // want to find the line/column position for a given character + // offset. `input` should be the code string that the offset refers + // into. + + function getLineInfo(input, offset) { + for (var line = 1, cur = 0;;) { + lineBreakG.lastIndex = cur; + var match = lineBreakG.exec(input); + if (match && match.index < offset) { + ++line; + cur = match.index + match[0].length; + } else { + return new Position(line, offset - cur) } - - retArr.push(') {\n'); } + } - for (let i = 0; i < ast.body.body.length; ++i) { - this.astGeneric(ast.body.body[i], retArr); - retArr.push('\n'); - } + // A second optional argument can be given to further configure + // the parser process. These options are recognized: + + var defaultOptions = { + // `ecmaVersion` indicates the ECMAScript version to parse. Must be + // either 3, 5, 6 (2015), 7 (2016), 8 (2017), 9 (2018), or 10 + // (2019). This influences support for strict mode, the set of + // reserved words, and support for new syntax features. The default + // is 10. + ecmaVersion: 10, + // `sourceType` indicates the mode the code should be parsed in. + // Can be either `"script"` or `"module"`. This influences global + // strict mode and parsing of `import` and `export` declarations. + sourceType: "script", + // `onInsertedSemicolon` can be a callback that will be called + // when a semicolon is automatically inserted. It will be passed + // the position of the comma as an offset, and if `locations` is + // enabled, it is given the location as a `{line, column}` object + // as second argument. + onInsertedSemicolon: null, + // `onTrailingComma` is similar to `onInsertedSemicolon`, but for + // trailing commas. + onTrailingComma: null, + // By default, reserved words are only enforced if ecmaVersion >= 5. + // Set `allowReserved` to a boolean value to explicitly turn this on + // an off. When this option has the value "never", reserved words + // and keywords can also not be used as property names. + allowReserved: null, + // When enabled, a return at the top level is not considered an + // error. + allowReturnOutsideFunction: false, + // When enabled, import/export statements are not constrained to + // appearing at the top of the program. + allowImportExportEverywhere: false, + // When enabled, await identifiers are allowed to appear at the top-level scope, + // but they are still not allowed in non-async functions. + allowAwaitOutsideFunction: false, + // When enabled, hashbang directive in the beginning of file + // is allowed and treated as a line comment. + allowHashBang: false, + // When `locations` is on, `loc` properties holding objects with + // `start` and `end` properties in `{line, column}` form (with + // line being 1-based and column 0-based) will be attached to the + // nodes. + locations: false, + // A function can be passed as `onToken` option, which will + // cause Acorn to call that function with object in the same + // format as tokens returned from `tokenizer().getToken()`. Note + // that you are not allowed to call the parser from the + // callback—that will corrupt its internal state. + onToken: null, + // A function can be passed as `onComment` option, which will + // cause Acorn to call that function with `(block, text, start, + // end)` parameters whenever a comment is skipped. `block` is a + // boolean indicating whether this is a block (`/* */`) comment, + // `text` is the content of the comment, and `start` and `end` are + // character offsets that denote the start and end of the comment. + // When the `locations` option is on, two more parameters are + // passed, the full `{line, column}` locations of the start and + // end of the comments. Note that you are not allowed to call the + // parser from the callback—that will corrupt its internal state. + onComment: null, + // Nodes have their start and end characters offsets recorded in + // `start` and `end` properties (directly on the node, rather than + // the `loc` object, which holds line/column data. To also add a + // [semi-standardized][range] `range` property holding a `[start, + // end]` array with the same numbers, set the `ranges` option to + // `true`. + // + // [range]: https://bugzilla.mozilla.org/show_bug.cgi?id=745678 + ranges: false, + // It is possible to parse multiple files into a single AST by + // passing the tree produced by parsing the first file as + // `program` option in subsequent parses. This will add the + // toplevel forms of the parsed file to the `Program` (top) node + // of an existing parse tree. + program: null, + // When `locations` is on, you can pass this to record the source + // file in every node's `loc` object. + sourceFile: null, + // This value, if given, is stored in every node, whether + // `locations` is on or off. + directSourceFile: null, + // When enabled, parenthesized expressions are represented by + // (non-standard) ParenthesizedExpression nodes + preserveParens: false + }; - if (!this.isRootKernel) { - retArr.push('}\n'); - } - return retArr; - } + // Interpret and default an options object - astReturnStatement(ast, retArr) { - const type = this.returnType || this.getType(ast.argument); + function getOptions(opts) { + var options = {}; - if (!this.returnType) { - this.returnType = type; - } + for (var opt in defaultOptions) + { options[opt] = opts && has(opts, opt) ? opts[opt] : defaultOptions[opt]; } - if (this.isRootKernel) { - retArr.push(this.leadingReturnStatement); - this.astGeneric(ast.argument, retArr); - retArr.push(';\n'); - retArr.push(this.followingReturnStatement); - retArr.push('continue;\n'); - } else if (this.isSubKernel) { - retArr.push(`subKernelResult_${ this.name } = `); - this.astGeneric(ast.argument, retArr); - retArr.push(';'); - retArr.push(`return subKernelResult_${ this.name };`); - } else { - retArr.push('return '); - this.astGeneric(ast.argument, retArr); - retArr.push(';'); - } - return retArr; - } + if (options.ecmaVersion >= 2015) + { options.ecmaVersion -= 2009; } - astLiteral(ast, retArr) { + if (options.allowReserved == null) + { options.allowReserved = options.ecmaVersion < 5; } - if (isNaN(ast.value)) { - throw this.astErrorOutput( - 'Non-numeric literal not supported : ' + ast.value, - ast - ); + if (isArray(options.onToken)) { + var tokens = options.onToken; + options.onToken = function (token) { return tokens.push(token); }; } + if (isArray(options.onComment)) + { options.onComment = pushComment(options, options.onComment); } - retArr.push(ast.value); - - return retArr; + return options } - astBinaryExpression(ast, retArr) { - retArr.push('('); - this.astGeneric(ast.left, retArr); - retArr.push(ast.operator); - this.astGeneric(ast.right, retArr); - retArr.push(')'); - return retArr; - } + function pushComment(options, array) { + return function(block, text, start, end, startLoc, endLoc) { + var comment = { + type: block ? "Block" : "Line", + value: text, + start: start, + end: end + }; + if (options.locations) + { comment.loc = new SourceLocation(this, startLoc, endLoc); } + if (options.ranges) + { comment.range = [start, end]; } + array.push(comment); + } + } + + // Each scope gets a bitset that may contain these flags + var + SCOPE_TOP = 1, + SCOPE_FUNCTION = 2, + SCOPE_VAR = SCOPE_TOP | SCOPE_FUNCTION, + SCOPE_ASYNC = 4, + SCOPE_GENERATOR = 8, + SCOPE_ARROW = 16, + SCOPE_SIMPLE_CATCH = 32, + SCOPE_SUPER = 64, + SCOPE_DIRECT_SUPER = 128; + + function functionFlags(async, generator) { + return SCOPE_FUNCTION | (async ? SCOPE_ASYNC : 0) | (generator ? SCOPE_GENERATOR : 0) + } + + // Used in checkLVal and declareName to determine the type of a binding + var + BIND_NONE = 0, // Not a binding + BIND_VAR = 1, // Var-style binding + BIND_LEXICAL = 2, // Let- or const-style binding + BIND_FUNCTION = 3, // Function declaration + BIND_SIMPLE_CATCH = 4, // Simple (identifier pattern) catch binding + BIND_OUTSIDE = 5; // Special case for function names as bound inside the function + + var Parser = function Parser(options, input, startPos) { + this.options = options = getOptions(options); + this.sourceFile = options.sourceFile; + this.keywords = wordsRegexp(keywords[options.ecmaVersion >= 6 ? 6 : options.sourceType === "module" ? "5module" : 5]); + var reserved = ""; + if (options.allowReserved !== true) { + for (var v = options.ecmaVersion;; v--) + { if (reserved = reservedWords[v]) { break } } + if (options.sourceType === "module") { reserved += " await"; } + } + this.reservedWords = wordsRegexp(reserved); + var reservedStrict = (reserved ? reserved + " " : "") + reservedWords.strict; + this.reservedWordsStrict = wordsRegexp(reservedStrict); + this.reservedWordsStrictBind = wordsRegexp(reservedStrict + " " + reservedWords.strictBind); + this.input = String(input); + + // Used to signal to callers of `readWord1` whether the word + // contained any escape sequences. This is needed because words with + // escape sequences must not be interpreted as keywords. + this.containsEsc = false; + + // Set up token state + + // The current position of the tokenizer in the input. + if (startPos) { + this.pos = startPos; + this.lineStart = this.input.lastIndexOf("\n", startPos - 1) + 1; + this.curLine = this.input.slice(0, this.lineStart).split(lineBreak).length; + } else { + this.pos = this.lineStart = 0; + this.curLine = 1; + } + + // Properties of the current token: + // Its type + this.type = types.eof; + // For tokens that include more information than their type, the value + this.value = null; + // Its start and end offset + this.start = this.end = this.pos; + // And, if locations are used, the {line, column} object + // corresponding to those offsets + this.startLoc = this.endLoc = this.curPosition(); + + // Position information for the previous token + this.lastTokEndLoc = this.lastTokStartLoc = null; + this.lastTokStart = this.lastTokEnd = this.pos; + + // The context stack is used to superficially track syntactic + // context to predict whether a regular expression is allowed in a + // given position. + this.context = this.initialContext(); + this.exprAllowed = true; + + // Figure out if it's a module code. + this.inModule = options.sourceType === "module"; + this.strict = this.inModule || this.strictDirective(this.pos); + + // Used to signify the start of a potential arrow function + this.potentialArrowAt = -1; + + // Positions to delayed-check that yield/await does not exist in default parameters. + this.yieldPos = this.awaitPos = this.awaitIdentPos = 0; + // Labels in scope. + this.labels = []; + // Thus-far undefined exports. + this.undefinedExports = {}; + + // If enabled, skip leading hashbang line. + if (this.pos === 0 && options.allowHashBang && this.input.slice(0, 2) === "#!") + { this.skipLineComment(2); } + + // Scope tracking for duplicate variable names (see scope.js) + this.scopeStack = []; + this.enterScope(SCOPE_TOP); + + // For RegExp validation + this.regexpState = null; + }; - astIdentifierExpression(idtNode, retArr) { - if (idtNode.type !== 'Identifier') { - throw this.astErrorOutput( - 'IdentifierExpression - not an Identifier', - idtNode - ); - } + var prototypeAccessors = { inFunction: { configurable: true },inGenerator: { configurable: true },inAsync: { configurable: true },allowSuper: { configurable: true },allowDirectSuper: { configurable: true },treatFunctionsAsVar: { configurable: true } }; - switch (idtNode.name) { - case 'Infinity': - retArr.push('Infinity'); - break; - default: - if (this.constants && this.constants.hasOwnProperty(idtNode.name)) { - retArr.push('constants_' + idtNode.name); - } else { - retArr.push('user_' + idtNode.name); - } - } + Parser.prototype.parse = function parse () { + var node = this.options.program || this.startNode(); + this.nextToken(); + return this.parseTopLevel(node) + }; - return retArr; - } + prototypeAccessors.inFunction.get = function () { return (this.currentVarScope().flags & SCOPE_FUNCTION) > 0 }; + prototypeAccessors.inGenerator.get = function () { return (this.currentVarScope().flags & SCOPE_GENERATOR) > 0 }; + prototypeAccessors.inAsync.get = function () { return (this.currentVarScope().flags & SCOPE_ASYNC) > 0 }; + prototypeAccessors.allowSuper.get = function () { return (this.currentThisScope().flags & SCOPE_SUPER) > 0 }; + prototypeAccessors.allowDirectSuper.get = function () { return (this.currentThisScope().flags & SCOPE_DIRECT_SUPER) > 0 }; + prototypeAccessors.treatFunctionsAsVar.get = function () { return this.treatFunctionsAsVarInScope(this.currentScope()) }; - astForStatement(forNode, retArr) { - if (forNode.type !== 'ForStatement') { - throw this.astErrorOutput('Invalid for statement', forNode); - } + // Switch to a getter for 7.0.0. + Parser.prototype.inNonArrowFunction = function inNonArrowFunction () { return (this.currentThisScope().flags & SCOPE_FUNCTION) > 0 }; - const initArr = []; - const testArr = []; - const updateArr = []; - const bodyArr = []; - let isSafe = null; + Parser.extend = function extend () { + var plugins = [], len = arguments.length; + while ( len-- ) plugins[ len ] = arguments[ len ]; - if (forNode.init) { - this.pushState('in-for-loop-init'); - this.astGeneric(forNode.init, initArr); - for (let i = 0; i < initArr.length; i++) { - if (initArr[i].includes && initArr[i].includes(',')) { - isSafe = false; - } + var cls = this; + for (var i = 0; i < plugins.length; i++) { cls = plugins[i](cls); } + return cls + }; + + Parser.parse = function parse (input, options) { + return new this(options, input).parse() + }; + + Parser.parseExpressionAt = function parseExpressionAt (input, pos, options) { + var parser = new this(options, input, pos); + parser.nextToken(); + return parser.parseExpression() + }; + + Parser.tokenizer = function tokenizer (input, options) { + return new this(options, input) + }; + + Object.defineProperties( Parser.prototype, prototypeAccessors ); + + var pp = Parser.prototype; + + // ## Parser utilities + + var literal = /^(?:'((?:\\.|[^'\\])*?)'|"((?:\\.|[^"\\])*?)")/; + pp.strictDirective = function(start) { + for (;;) { + // Try to find string literal. + skipWhiteSpace.lastIndex = start; + start += skipWhiteSpace.exec(this.input)[0].length; + var match = literal.exec(this.input.slice(start)); + if (!match) { return false } + if ((match[1] || match[2]) === "use strict") { + skipWhiteSpace.lastIndex = start + match[0].length; + var spaceAfter = skipWhiteSpace.exec(this.input), end = spaceAfter.index + spaceAfter[0].length; + var next = this.input.charAt(end); + return next === ";" || next === "}" || + (lineBreak.test(spaceAfter[0]) && + !(/[(`.[+\-/*%<>=,?^&]/.test(next) || next === "!" && this.input.charAt(end + 1) === "=")) } - this.popState('in-for-loop-init'); - } else { - isSafe = false; - } + start += match[0].length; - if (forNode.test) { - this.astGeneric(forNode.test, testArr); - } else { - isSafe = false; + // Skip semicolon, if any. + skipWhiteSpace.lastIndex = start; + start += skipWhiteSpace.exec(this.input)[0].length; + if (this.input[start] === ";") + { start++; } } + }; + + // Predicate that tests whether the next token is of the given + // type, and if yes, consumes it as a side effect. - if (forNode.update) { - this.astGeneric(forNode.update, updateArr); + pp.eat = function(type) { + if (this.type === type) { + this.next(); + return true } else { - isSafe = false; + return false } + }; - if (forNode.body) { - this.pushState('loop-body'); - this.astGeneric(forNode.body, bodyArr); - this.popState('loop-body'); - } + // Tests whether parsed token is a contextual keyword. - if (isSafe === null) { - isSafe = this.isSafe(forNode.init) && this.isSafe(forNode.test); - } + pp.isContextual = function(name) { + return this.type === types.name && this.value === name && !this.containsEsc + }; - if (isSafe) { - retArr.push(`for (${initArr.join('')};${testArr.join('')};${updateArr.join('')}){\n`); - retArr.push(bodyArr.join('')); - retArr.push('}\n'); - } else { - const iVariableName = this.getInternalVariableName('safeI'); - if (initArr.length > 0) { - retArr.push(initArr.join(''), ';\n'); - } - retArr.push(`for (let ${iVariableName}=0;${iVariableName} 0) { - retArr.push(`if (!${testArr.join('')}) break;\n`); - } - retArr.push(bodyArr.join('')); - retArr.push(`\n${updateArr.join('')};`); - retArr.push('}\n'); - } - return retArr; - } + // Consumes contextual keyword if possible. - astWhileStatement(whileNode, retArr) { - if (whileNode.type !== 'WhileStatement') { - throw this.astErrorOutput( - 'Invalid while statement', - whileNode - ); + pp.eatContextual = function(name) { + if (!this.isContextual(name)) { return false } + this.next(); + return true + }; + + // Asserts that following token is given contextual keyword. + + pp.expectContextual = function(name) { + if (!this.eatContextual(name)) { this.unexpected(); } + }; + + // Test whether a semicolon can be inserted at the current position. + + pp.canInsertSemicolon = function() { + return this.type === types.eof || + this.type === types.braceR || + lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) + }; + + pp.insertSemicolon = function() { + if (this.canInsertSemicolon()) { + if (this.options.onInsertedSemicolon) + { this.options.onInsertedSemicolon(this.lastTokEnd, this.lastTokEndLoc); } + return true } + }; - retArr.push('for (let i = 0; i < LOOP_MAX; i++) {'); - retArr.push('if ('); - this.astGeneric(whileNode.test, retArr); - retArr.push(') {\n'); - this.astGeneric(whileNode.body, retArr); - retArr.push('} else {\n'); - retArr.push('break;\n'); - retArr.push('}\n'); - retArr.push('}\n'); + // Consume a semicolon, or, failing that, see if we are allowed to + // pretend that there is a semicolon at this position. - return retArr; - } + pp.semicolon = function() { + if (!this.eat(types.semi) && !this.insertSemicolon()) { this.unexpected(); } + }; - astDoWhileStatement(doWhileNode, retArr) { - if (doWhileNode.type !== 'DoWhileStatement') { - throw this.astErrorOutput( - 'Invalid while statement', - doWhileNode - ); + pp.afterTrailingComma = function(tokType, notNext) { + if (this.type === tokType) { + if (this.options.onTrailingComma) + { this.options.onTrailingComma(this.lastTokStart, this.lastTokStartLoc); } + if (!notNext) + { this.next(); } + return true } + }; - retArr.push('for (let i = 0; i < LOOP_MAX; i++) {'); - this.astGeneric(doWhileNode.body, retArr); - retArr.push('if (!'); - this.astGeneric(doWhileNode.test, retArr); - retArr.push(') {\n'); - retArr.push('break;\n'); - retArr.push('}\n'); - retArr.push('}\n'); + // Expect a token of a given type. If found, consume it, otherwise, + // raise an unexpected token error. - return retArr; + pp.expect = function(type) { + this.eat(type) || this.unexpected(); + }; - } + // Raise an unexpected token error. - astAssignmentExpression(assNode, retArr) { - const declaration = this.getDeclaration(assNode.left); - if (declaration && !declaration.assignable) { - throw this.astErrorOutput(`Variable ${assNode.left.name} is not assignable here`, assNode); - } - this.astGeneric(assNode.left, retArr); - retArr.push(assNode.operator); - this.astGeneric(assNode.right, retArr); - return retArr; - } + pp.unexpected = function(pos) { + this.raise(pos != null ? pos : this.start, "Unexpected token"); + }; - astBlockStatement(bNode, retArr) { - if (this.isState('loop-body')) { - this.pushState('block-body'); - for (let i = 0; i < bNode.body.length; i++) { - this.astGeneric(bNode.body[i], retArr); - } - this.popState('block-body'); - } else { - retArr.push('{\n'); - for (let i = 0; i < bNode.body.length; i++) { - this.astGeneric(bNode.body[i], retArr); + function DestructuringErrors() { + this.shorthandAssign = + this.trailingComma = + this.parenthesizedAssign = + this.parenthesizedBind = + this.doubleProto = + -1; + } + + pp.checkPatternErrors = function(refDestructuringErrors, isAssign) { + if (!refDestructuringErrors) { return } + if (refDestructuringErrors.trailingComma > -1) + { this.raiseRecoverable(refDestructuringErrors.trailingComma, "Comma is not permitted after the rest element"); } + var parens = isAssign ? refDestructuringErrors.parenthesizedAssign : refDestructuringErrors.parenthesizedBind; + if (parens > -1) { this.raiseRecoverable(parens, "Parenthesized pattern"); } + }; + + pp.checkExpressionErrors = function(refDestructuringErrors, andThrow) { + if (!refDestructuringErrors) { return false } + var shorthandAssign = refDestructuringErrors.shorthandAssign; + var doubleProto = refDestructuringErrors.doubleProto; + if (!andThrow) { return shorthandAssign >= 0 || doubleProto >= 0 } + if (shorthandAssign >= 0) + { this.raise(shorthandAssign, "Shorthand property assignments are valid only in destructuring patterns"); } + if (doubleProto >= 0) + { this.raiseRecoverable(doubleProto, "Redefinition of __proto__ property"); } + }; + + pp.checkYieldAwaitInDefaultParams = function() { + if (this.yieldPos && (!this.awaitPos || this.yieldPos < this.awaitPos)) + { this.raise(this.yieldPos, "Yield expression cannot be a default value"); } + if (this.awaitPos) + { this.raise(this.awaitPos, "Await expression cannot be a default value"); } + }; + + pp.isSimpleAssignTarget = function(expr) { + if (expr.type === "ParenthesizedExpression") + { return this.isSimpleAssignTarget(expr.expression) } + return expr.type === "Identifier" || expr.type === "MemberExpression" + }; + + var pp$1 = Parser.prototype; + + // ### Statement parsing + + // Parse a program. Initializes the parser, reads any number of + // statements, and wraps them in a Program node. Optionally takes a + // `program` argument. If present, the statements will be appended + // to its body instead of creating a new node. + + pp$1.parseTopLevel = function(node) { + var exports = {}; + if (!node.body) { node.body = []; } + while (this.type !== types.eof) { + var stmt = this.parseStatement(null, true, exports); + node.body.push(stmt); + } + if (this.inModule) + { for (var i = 0, list = Object.keys(this.undefinedExports); i < list.length; i += 1) + { + var name = list[i]; + + this.raiseRecoverable(this.undefinedExports[name].start, ("Export '" + name + "' is not defined")); + } } + this.adaptDirectivePrologue(node.body); + this.next(); + node.sourceType = this.options.sourceType; + return this.finishNode(node, "Program") + }; + + var loopLabel = {kind: "loop"}, switchLabel = {kind: "switch"}; + + pp$1.isLet = function(context) { + if (this.options.ecmaVersion < 6 || !this.isContextual("let")) { return false } + skipWhiteSpace.lastIndex = this.pos; + var skip = skipWhiteSpace.exec(this.input); + var next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next); + // For ambiguous cases, determine if a LexicalDeclaration (or only a + // Statement) is allowed here. If context is not empty then only a Statement + // is allowed. However, `let [` is an explicit negative lookahead for + // ExpressionStatement, so special-case it first. + if (nextCh === 91) { return true } // '[' + if (context) { return false } + + if (nextCh === 123) { return true } // '{' + if (isIdentifierStart(nextCh, true)) { + var pos = next + 1; + while (isIdentifierChar(this.input.charCodeAt(pos), true)) { ++pos; } + var ident = this.input.slice(next, pos); + if (!keywordRelationalOperator.test(ident)) { return true } + } + return false + }; + + // check 'async [no LineTerminator here] function' + // - 'async /*foo*/ function' is OK. + // - 'async /*\n*/ function' is invalid. + pp$1.isAsyncFunction = function() { + if (this.options.ecmaVersion < 8 || !this.isContextual("async")) + { return false } + + skipWhiteSpace.lastIndex = this.pos; + var skip = skipWhiteSpace.exec(this.input); + var next = this.pos + skip[0].length; + return !lineBreak.test(this.input.slice(this.pos, next)) && + this.input.slice(next, next + 8) === "function" && + (next + 8 === this.input.length || !isIdentifierChar(this.input.charAt(next + 8))) + }; + + // Parse a single statement. + // + // If expecting a statement and finding a slash operator, parse a + // regular expression literal. This is to handle cases like + // `if (foo) /blah/.exec(foo)`, where looking at the previous token + // does not help. + + pp$1.parseStatement = function(context, topLevel, exports) { + var starttype = this.type, node = this.startNode(), kind; + + if (this.isLet(context)) { + starttype = types._var; + kind = "let"; + } + + // Most types of statements are recognized by the keyword they + // start with. Many are trivial to parse, some require a bit of + // complexity. + + switch (starttype) { + case types._break: case types._continue: return this.parseBreakContinueStatement(node, starttype.keyword) + case types._debugger: return this.parseDebuggerStatement(node) + case types._do: return this.parseDoStatement(node) + case types._for: return this.parseForStatement(node) + case types._function: + // Function as sole body of either an if statement or a labeled statement + // works, but not when it is part of a labeled statement that is the sole + // body of an if statement. + if ((context && (this.strict || context !== "if" && context !== "label")) && this.options.ecmaVersion >= 6) { this.unexpected(); } + return this.parseFunctionStatement(node, false, !context) + case types._class: + if (context) { this.unexpected(); } + return this.parseClass(node, true) + case types._if: return this.parseIfStatement(node) + case types._return: return this.parseReturnStatement(node) + case types._switch: return this.parseSwitchStatement(node) + case types._throw: return this.parseThrowStatement(node) + case types._try: return this.parseTryStatement(node) + case types._const: case types._var: + kind = kind || this.value; + if (context && kind !== "var") { this.unexpected(); } + return this.parseVarStatement(node, kind) + case types._while: return this.parseWhileStatement(node) + case types._with: return this.parseWithStatement(node) + case types.braceL: return this.parseBlock(true, node) + case types.semi: return this.parseEmptyStatement(node) + case types._export: + case types._import: + if (this.options.ecmaVersion > 10 && starttype === types._import) { + skipWhiteSpace.lastIndex = this.pos; + var skip = skipWhiteSpace.exec(this.input); + var next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next); + if (nextCh === 40 || nextCh === 46) // '(' or '.' + { return this.parseExpressionStatement(node, this.parseExpression()) } } - retArr.push('}\n'); - } - return retArr; - } - astVariableDeclaration(varDecNode, retArr) { - retArr.push(`${varDecNode.kind} `); - const { declarations } = varDecNode; - for (let i = 0; i < declarations.length; i++) { - if (i > 0) { - retArr.push(','); + if (!this.options.allowImportExportEverywhere) { + if (!topLevel) + { this.raise(this.start, "'import' and 'export' may only appear at the top level"); } + if (!this.inModule) + { this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'"); } } - const declaration = declarations[i]; - const info = this.getDeclaration(declaration.id); - if (!info.valueType) { - info.valueType = this.getType(declaration.init); + return starttype === types._import ? this.parseImport(node) : this.parseExport(node, exports) + + // If the statement does not start with a statement keyword or a + // brace, it's an ExpressionStatement or LabeledStatement. We + // simply start parsing an expression, and afterwards, if the + // next token is a colon and the expression was a simple + // Identifier node, we switch to interpreting it as a label. + default: + if (this.isAsyncFunction()) { + if (context) { this.unexpected(); } + this.next(); + return this.parseFunctionStatement(node, true, !context) } - this.astGeneric(declaration, retArr); - } - if (!this.isState('in-for-loop-init')) { - retArr.push(';'); - } - return retArr; - } - astIfStatement(ifNode, retArr) { - retArr.push('if ('); - this.astGeneric(ifNode.test, retArr); - retArr.push(')'); - if (ifNode.consequent.type === 'BlockStatement') { - this.astGeneric(ifNode.consequent, retArr); - } else { - retArr.push(' {\n'); - this.astGeneric(ifNode.consequent, retArr); - retArr.push('\n}\n'); + var maybeName = this.value, expr = this.parseExpression(); + if (starttype === types.name && expr.type === "Identifier" && this.eat(types.colon)) + { return this.parseLabeledStatement(node, maybeName, expr, context) } + else { return this.parseExpressionStatement(node, expr) } } + }; - if (ifNode.alternate) { - retArr.push('else '); - if (ifNode.alternate.type === 'BlockStatement' || ifNode.alternate.type === 'IfStatement') { - this.astGeneric(ifNode.alternate, retArr); - } else { - retArr.push(' {\n'); - this.astGeneric(ifNode.alternate, retArr); - retArr.push('\n}\n'); + pp$1.parseBreakContinueStatement = function(node, keyword) { + var isBreak = keyword === "break"; + this.next(); + if (this.eat(types.semi) || this.insertSemicolon()) { node.label = null; } + else if (this.type !== types.name) { this.unexpected(); } + else { + node.label = this.parseIdent(); + this.semicolon(); + } + + // Verify that there is an actual destination to break or + // continue to. + var i = 0; + for (; i < this.labels.length; ++i) { + var lab = this.labels[i]; + if (node.label == null || lab.name === node.label.name) { + if (lab.kind != null && (isBreak || lab.kind === "loop")) { break } + if (node.label && isBreak) { break } } } - return retArr; + if (i === this.labels.length) { this.raise(node.start, "Unsyntactic " + keyword); } + return this.finishNode(node, isBreak ? "BreakStatement" : "ContinueStatement") + }; - } + pp$1.parseDebuggerStatement = function(node) { + this.next(); + this.semicolon(); + return this.finishNode(node, "DebuggerStatement") + }; - astSwitchStatement(ast, retArr) { - const { discriminant, cases } = ast; - retArr.push('switch ('); - this.astGeneric(discriminant, retArr); - retArr.push(') {\n'); - for (let i = 0; i < cases.length; i++) { - if (cases[i].test === null) { - retArr.push('default:\n'); - this.astGeneric(cases[i].consequent, retArr); - if (cases[i].consequent && cases[i].consequent.length > 0) { - retArr.push('break;\n'); + pp$1.parseDoStatement = function(node) { + this.next(); + this.labels.push(loopLabel); + node.body = this.parseStatement("do"); + this.labels.pop(); + this.expect(types._while); + node.test = this.parseParenExpression(); + if (this.options.ecmaVersion >= 6) + { this.eat(types.semi); } + else + { this.semicolon(); } + return this.finishNode(node, "DoWhileStatement") + }; + + // Disambiguating between a `for` and a `for`/`in` or `for`/`of` + // loop is non-trivial. Basically, we have to parse the init `var` + // statement or expression, disallowing the `in` operator (see + // the second parameter to `parseExpression`), and then check + // whether the next token is `in` or `of`. When there is no init + // part (semicolon immediately after the opening parenthesis), it + // is a regular `for` loop. + + pp$1.parseForStatement = function(node) { + this.next(); + var awaitAt = (this.options.ecmaVersion >= 9 && (this.inAsync || (!this.inFunction && this.options.allowAwaitOutsideFunction)) && this.eatContextual("await")) ? this.lastTokStart : -1; + this.labels.push(loopLabel); + this.enterScope(0); + this.expect(types.parenL); + if (this.type === types.semi) { + if (awaitAt > -1) { this.unexpected(awaitAt); } + return this.parseFor(node, null) + } + var isLet = this.isLet(); + if (this.type === types._var || this.type === types._const || isLet) { + var init$1 = this.startNode(), kind = isLet ? "let" : this.value; + this.next(); + this.parseVar(init$1, true, kind); + this.finishNode(init$1, "VariableDeclaration"); + if ((this.type === types._in || (this.options.ecmaVersion >= 6 && this.isContextual("of"))) && init$1.declarations.length === 1) { + if (this.options.ecmaVersion >= 9) { + if (this.type === types._in) { + if (awaitAt > -1) { this.unexpected(awaitAt); } + } else { node.await = awaitAt > -1; } } - continue; + return this.parseForIn(node, init$1) } - retArr.push('case '); - this.astGeneric(cases[i].test, retArr); - retArr.push(':\n'); - if (cases[i].consequent && cases[i].consequent.length > 0) { - this.astGeneric(cases[i].consequent, retArr); - retArr.push('break;\n'); + if (awaitAt > -1) { this.unexpected(awaitAt); } + return this.parseFor(node, init$1) + } + var refDestructuringErrors = new DestructuringErrors; + var init = this.parseExpression(true, refDestructuringErrors); + if (this.type === types._in || (this.options.ecmaVersion >= 6 && this.isContextual("of"))) { + if (this.options.ecmaVersion >= 9) { + if (this.type === types._in) { + if (awaitAt > -1) { this.unexpected(awaitAt); } + } else { node.await = awaitAt > -1; } } + this.toAssignable(init, false, refDestructuringErrors); + this.checkLVal(init); + return this.parseForIn(node, init) + } else { + this.checkExpressionErrors(refDestructuringErrors, true); } - retArr.push('\n}'); - } + if (awaitAt > -1) { this.unexpected(awaitAt); } + return this.parseFor(node, init) + }; - astThisExpression(tNode, retArr) { - retArr.push('_this'); - return retArr; - } + pp$1.parseFunctionStatement = function(node, isAsync, declarationPosition) { + this.next(); + return this.parseFunction(node, FUNC_STATEMENT | (declarationPosition ? 0 : FUNC_HANGING_STATEMENT), false, isAsync) + }; - astMemberExpression(mNode, retArr) { - const { - signature, - type, - property, - xProperty, - yProperty, - zProperty, - name, - origin - } = this.getMemberExpressionDetails(mNode); - switch (signature) { - case 'this.thread.value': - retArr.push(`_this.thread.${ name }`); - return retArr; - case 'this.output.value': - switch (name) { - case 'x': - retArr.push('outputX'); - break; - case 'y': - retArr.push('outputY'); - break; - case 'z': - retArr.push('outputZ'); - break; - default: - throw this.astErrorOutput('Unexpected expression', mNode); - } - return retArr; - case 'value': - throw this.astErrorOutput('Unexpected expression', mNode); - case 'value[]': - case 'value[][]': - case 'value[][][]': - case 'value.value': - if (origin === 'Math') { - retArr.push(Math[name]); - return retArr; - } - switch (property) { - case 'r': - retArr.push(`user_${ name }[0]`); - return retArr; - case 'g': - retArr.push(`user_${ name }[1]`); - return retArr; - case 'b': - retArr.push(`user_${ name }[2]`); - return retArr; - case 'a': - retArr.push(`user_${ name }[3]`); - return retArr; + pp$1.parseIfStatement = function(node) { + this.next(); + node.test = this.parseParenExpression(); + // allow function declarations in branches, but only in non-strict mode + node.consequent = this.parseStatement("if"); + node.alternate = this.eat(types._else) ? this.parseStatement("if") : null; + return this.finishNode(node, "IfStatement") + }; + + pp$1.parseReturnStatement = function(node) { + if (!this.inFunction && !this.options.allowReturnOutsideFunction) + { this.raise(this.start, "'return' outside of function"); } + this.next(); + + // In `return` (and `break`/`continue`), the keywords with + // optional arguments, we eagerly look for a semicolon or the + // possibility to insert one. + + if (this.eat(types.semi) || this.insertSemicolon()) { node.argument = null; } + else { node.argument = this.parseExpression(); this.semicolon(); } + return this.finishNode(node, "ReturnStatement") + }; + + pp$1.parseSwitchStatement = function(node) { + this.next(); + node.discriminant = this.parseParenExpression(); + node.cases = []; + this.expect(types.braceL); + this.labels.push(switchLabel); + this.enterScope(0); + + // Statements under must be grouped (by label) in SwitchCase + // nodes. `cur` is used to keep the node that we are currently + // adding statements to. + + var cur; + for (var sawDefault = false; this.type !== types.braceR;) { + if (this.type === types._case || this.type === types._default) { + var isCase = this.type === types._case; + if (cur) { this.finishNode(cur, "SwitchCase"); } + node.cases.push(cur = this.startNode()); + cur.consequent = []; + this.next(); + if (isCase) { + cur.test = this.parseExpression(); + } else { + if (sawDefault) { this.raiseRecoverable(this.lastTokStart, "Multiple default clauses"); } + sawDefault = true; + cur.test = null; } - break; - case 'this.constants.value': - case 'this.constants.value[]': - case 'this.constants.value[][]': - case 'this.constants.value[][][]': - break; - case 'fn()[]': - this.astGeneric(mNode.object, retArr); - retArr.push('['); - this.astGeneric(mNode.property, retArr); - retArr.push(']'); - return retArr; - case 'fn()[][]': - this.astGeneric(mNode.object.object, retArr); - retArr.push('['); - this.astGeneric(mNode.object.property, retArr); - retArr.push(']'); - retArr.push('['); - this.astGeneric(mNode.property, retArr); - retArr.push(']'); - return retArr; - default: - throw this.astErrorOutput('Unexpected expression', mNode); + this.expect(types.colon); + } else { + if (!cur) { this.unexpected(); } + cur.consequent.push(this.parseStatement(null)); + } } + this.exitScope(); + if (cur) { this.finishNode(cur, "SwitchCase"); } + this.next(); // Closing brace + this.labels.pop(); + return this.finishNode(node, "SwitchStatement") + }; - if (!mNode.computed) { - switch (type) { - case 'Number': - case 'Integer': - case 'Float': - case 'Boolean': - retArr.push(`${origin}_${name}`); - return retArr; + pp$1.parseThrowStatement = function(node) { + this.next(); + if (lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) + { this.raise(this.lastTokEnd, "Illegal newline after throw"); } + node.argument = this.parseExpression(); + this.semicolon(); + return this.finishNode(node, "ThrowStatement") + }; + + // Reused empty array added for node fields that are always empty. + + var empty = []; + + pp$1.parseTryStatement = function(node) { + this.next(); + node.block = this.parseBlock(); + node.handler = null; + if (this.type === types._catch) { + var clause = this.startNode(); + this.next(); + if (this.eat(types.parenL)) { + clause.param = this.parseBindingAtom(); + var simple = clause.param.type === "Identifier"; + this.enterScope(simple ? SCOPE_SIMPLE_CATCH : 0); + this.checkLVal(clause.param, simple ? BIND_SIMPLE_CATCH : BIND_LEXICAL); + this.expect(types.parenR); + } else { + if (this.options.ecmaVersion < 10) { this.unexpected(); } + clause.param = null; + this.enterScope(0); } - } + clause.body = this.parseBlock(false); + this.exitScope(); + node.handler = this.finishNode(clause, "CatchClause"); + } + node.finalizer = this.eat(types._finally) ? this.parseBlock() : null; + if (!node.handler && !node.finalizer) + { this.raise(node.start, "Missing catch or finally clause"); } + return this.finishNode(node, "TryStatement") + }; - const markupName = `${origin}_${name}`; + pp$1.parseVarStatement = function(node, kind) { + this.next(); + this.parseVar(node, false, kind); + this.semicolon(); + return this.finishNode(node, "VariableDeclaration") + }; - switch (type) { - case 'Array(2)': - case 'Array(3)': - case 'Array(4)': - case 'Matrix(2)': - case 'Matrix(3)': - case 'Matrix(4)': - case 'HTMLImageArray': - case 'ArrayTexture(1)': - case 'ArrayTexture(2)': - case 'ArrayTexture(3)': - case 'ArrayTexture(4)': - case 'HTMLImage': - default: - let size; - let isInput; - if (origin === 'constants') { - const constant = this.constants[name]; - isInput = this.constantTypes[name] === 'Input'; - size = isInput ? constant.size : null; - } else { - isInput = this.isInput(name); - size = isInput ? this.argumentSizes[this.argumentNames.indexOf(name)] : null; - } - retArr.push(`${ markupName }`); - if (zProperty && yProperty) { - if (isInput) { - retArr.push('[('); - this.astGeneric(zProperty, retArr); - retArr.push(`*${ this.dynamicArguments ? '(outputY * outputX)' : size[1] * size[0] })+(`); - this.astGeneric(yProperty, retArr); - retArr.push(`*${ this.dynamicArguments ? 'outputX' : size[0] })+`); - this.astGeneric(xProperty, retArr); - retArr.push(']'); - } else { - retArr.push('['); - this.astGeneric(zProperty, retArr); - retArr.push(']'); - retArr.push('['); - this.astGeneric(yProperty, retArr); - retArr.push(']'); - retArr.push('['); - this.astGeneric(xProperty, retArr); - retArr.push(']'); - } - } else if (yProperty) { - if (isInput) { - retArr.push('[('); - this.astGeneric(yProperty, retArr); - retArr.push(`*${ this.dynamicArguments ? 'outputX' : size[0] })+`); - this.astGeneric(xProperty, retArr); - retArr.push(']'); - } else { - retArr.push('['); - this.astGeneric(yProperty, retArr); - retArr.push(']'); - retArr.push('['); - this.astGeneric(xProperty, retArr); - retArr.push(']'); - } - } else if (typeof xProperty !== 'undefined') { - retArr.push('['); - this.astGeneric(xProperty, retArr); - retArr.push(']'); - } + pp$1.parseWhileStatement = function(node) { + this.next(); + node.test = this.parseParenExpression(); + this.labels.push(loopLabel); + node.body = this.parseStatement("while"); + this.labels.pop(); + return this.finishNode(node, "WhileStatement") + }; + + pp$1.parseWithStatement = function(node) { + if (this.strict) { this.raise(this.start, "'with' in strict mode"); } + this.next(); + node.object = this.parseParenExpression(); + node.body = this.parseStatement("with"); + return this.finishNode(node, "WithStatement") + }; + + pp$1.parseEmptyStatement = function(node) { + this.next(); + return this.finishNode(node, "EmptyStatement") + }; + + pp$1.parseLabeledStatement = function(node, maybeName, expr, context) { + for (var i$1 = 0, list = this.labels; i$1 < list.length; i$1 += 1) + { + var label = list[i$1]; + + if (label.name === maybeName) + { this.raise(expr.start, "Label '" + maybeName + "' is already declared"); + } } + var kind = this.type.isLoop ? "loop" : this.type === types._switch ? "switch" : null; + for (var i = this.labels.length - 1; i >= 0; i--) { + var label$1 = this.labels[i]; + if (label$1.statementStart === node.start) { + // Update information about previous labels on this node + label$1.statementStart = this.start; + label$1.kind = kind; + } else { break } + } + this.labels.push({name: maybeName, kind: kind, statementStart: this.start}); + node.body = this.parseStatement(context ? context.indexOf("label") === -1 ? context + "label" : context : "label"); + this.labels.pop(); + node.label = expr; + return this.finishNode(node, "LabeledStatement") + }; + + pp$1.parseExpressionStatement = function(node, expr) { + node.expression = expr; + this.semicolon(); + return this.finishNode(node, "ExpressionStatement") + }; + + // Parse a semicolon-enclosed block of statements, handling `"use + // strict"` declarations when `allowStrict` is true (used for + // function bodies). + + pp$1.parseBlock = function(createNewLexicalScope, node, exitStrict) { + if ( createNewLexicalScope === void 0 ) createNewLexicalScope = true; + if ( node === void 0 ) node = this.startNode(); + + node.body = []; + this.expect(types.braceL); + if (createNewLexicalScope) { this.enterScope(0); } + while (this.type !== types.braceR) { + var stmt = this.parseStatement(null); + node.body.push(stmt); + } + if (exitStrict) { this.strict = false; } + this.next(); + if (createNewLexicalScope) { this.exitScope(); } + return this.finishNode(node, "BlockStatement") + }; + + // Parse a regular `for` loop. The disambiguation code in + // `parseStatement` will already have parsed the init statement or + // expression. + + pp$1.parseFor = function(node, init) { + node.init = init; + this.expect(types.semi); + node.test = this.type === types.semi ? null : this.parseExpression(); + this.expect(types.semi); + node.update = this.type === types.parenR ? null : this.parseExpression(); + this.expect(types.parenR); + node.body = this.parseStatement("for"); + this.exitScope(); + this.labels.pop(); + return this.finishNode(node, "ForStatement") + }; + + // Parse a `for`/`in` and `for`/`of` loop, which are almost + // same from parser's perspective. + + pp$1.parseForIn = function(node, init) { + var isForIn = this.type === types._in; + this.next(); + + if ( + init.type === "VariableDeclaration" && + init.declarations[0].init != null && + ( + !isForIn || + this.options.ecmaVersion < 8 || + this.strict || + init.kind !== "var" || + init.declarations[0].id.type !== "Identifier" + ) + ) { + this.raise( + init.start, + ((isForIn ? "for-in" : "for-of") + " loop variable declaration may not have an initializer") + ); + } else if (init.type === "AssignmentPattern") { + this.raise(init.start, "Invalid left-hand side in for-loop"); + } + node.left = init; + node.right = isForIn ? this.parseExpression() : this.parseMaybeAssign(); + this.expect(types.parenR); + node.body = this.parseStatement("for"); + this.exitScope(); + this.labels.pop(); + return this.finishNode(node, isForIn ? "ForInStatement" : "ForOfStatement") + }; + + // Parse a list of variable declarations. + + pp$1.parseVar = function(node, isFor, kind) { + node.declarations = []; + node.kind = kind; + for (;;) { + var decl = this.startNode(); + this.parseVarId(decl, kind); + if (this.eat(types.eq)) { + decl.init = this.parseMaybeAssign(isFor); + } else if (kind === "const" && !(this.type === types._in || (this.options.ecmaVersion >= 6 && this.isContextual("of")))) { + this.unexpected(); + } else if (decl.id.type !== "Identifier" && !(isFor && (this.type === types._in || this.isContextual("of")))) { + this.raise(this.lastTokEnd, "Complex binding patterns require an initialization value"); + } else { + decl.init = null; + } + node.declarations.push(this.finishNode(decl, "VariableDeclarator")); + if (!this.eat(types.comma)) { break } } - return retArr; - } + return node + }; + + pp$1.parseVarId = function(decl, kind) { + decl.id = this.parseBindingAtom(); + this.checkLVal(decl.id, kind === "var" ? BIND_VAR : BIND_LEXICAL, false); + }; + + var FUNC_STATEMENT = 1, FUNC_HANGING_STATEMENT = 2, FUNC_NULLABLE_ID = 4; + + // Parse a function declaration or literal (depending on the + // `statement & FUNC_STATEMENT`). - astCallExpression(ast, retArr) { - if (ast.type !== 'CallExpression') { - throw this.astErrorOutput('Unknown CallExpression', ast); + // Remove `allowExpressionBody` for 7.0.0, as it is only called with false + pp$1.parseFunction = function(node, statement, allowExpressionBody, isAsync) { + this.initFunction(node); + if (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !isAsync) { + if (this.type === types.star && (statement & FUNC_HANGING_STATEMENT)) + { this.unexpected(); } + node.generator = this.eat(types.star); } - let functionName = this.astMemberExpressionUnroll(ast.callee); + if (this.options.ecmaVersion >= 8) + { node.async = !!isAsync; } - if (this.calledFunctions.indexOf(functionName) < 0) { - this.calledFunctions.push(functionName); + if (statement & FUNC_STATEMENT) { + node.id = (statement & FUNC_NULLABLE_ID) && this.type !== types.name ? null : this.parseIdent(); + if (node.id && !(statement & FUNC_HANGING_STATEMENT)) + // If it is a regular function declaration in sloppy mode, then it is + // subject to Annex B semantics (BIND_FUNCTION). Otherwise, the binding + // mode depends on properties of the current scope (see + // treatFunctionsAsVar). + { this.checkLVal(node.id, (this.strict || node.generator || node.async) ? this.treatFunctionsAsVar ? BIND_VAR : BIND_LEXICAL : BIND_FUNCTION); } } - const isMathFunction = this.isAstMathFunction(ast); + var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; + this.yieldPos = 0; + this.awaitPos = 0; + this.awaitIdentPos = 0; + this.enterScope(functionFlags(node.async, node.generator)); - if (this.onFunctionCall) { - this.onFunctionCall(this.name, functionName, ast.arguments); - } + if (!(statement & FUNC_STATEMENT)) + { node.id = this.type === types.name ? this.parseIdent() : null; } - retArr.push(functionName); + this.parseFunctionParams(node); + this.parseFunctionBody(node, allowExpressionBody, false); - retArr.push('('); - const targetTypes = this.lookupFunctionArgumentTypes(functionName) || []; - for (let i = 0; i < ast.arguments.length; ++i) { - const argument = ast.arguments[i]; + this.yieldPos = oldYieldPos; + this.awaitPos = oldAwaitPos; + this.awaitIdentPos = oldAwaitIdentPos; + return this.finishNode(node, (statement & FUNC_STATEMENT) ? "FunctionDeclaration" : "FunctionExpression") + }; - let argumentType = this.getType(argument); - if (!targetTypes[i]) { - this.triggerImplyArgumentType(functionName, i, argumentType, this); - } + pp$1.parseFunctionParams = function(node) { + this.expect(types.parenL); + node.params = this.parseBindingList(types.parenR, false, this.options.ecmaVersion >= 8); + this.checkYieldAwaitInDefaultParams(); + }; - if (i > 0) { - retArr.push(', '); + // Parse a class declaration or literal (depending on the + // `isStatement` parameter). + + pp$1.parseClass = function(node, isStatement) { + this.next(); + + // ecma-262 14.6 Class Definitions + // A class definition is always strict mode code. + var oldStrict = this.strict; + this.strict = true; + + this.parseClassId(node, isStatement); + this.parseClassSuper(node); + var classBody = this.startNode(); + var hadConstructor = false; + classBody.body = []; + this.expect(types.braceL); + while (this.type !== types.braceR) { + var element = this.parseClassElement(node.superClass !== null); + if (element) { + classBody.body.push(element); + if (element.type === "MethodDefinition" && element.kind === "constructor") { + if (hadConstructor) { this.raise(element.start, "Duplicate constructor in the same class"); } + hadConstructor = true; + } } - this.astGeneric(argument, retArr); } - retArr.push(')'); + this.strict = oldStrict; + this.next(); + node.body = this.finishNode(classBody, "ClassBody"); + return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression") + }; - return retArr; - } + pp$1.parseClassElement = function(constructorAllowsSuper) { + var this$1$1 = this; - astArrayExpression(arrNode, retArr) { - const returnType = this.getType(arrNode); - const arrLen = arrNode.elements.length; - const elements = []; - for (let i = 0; i < arrLen; ++i) { - const element = []; - this.astGeneric(arrNode.elements[i], element); - elements.push(element.join('')); - } - switch (returnType) { - case 'Matrix(2)': - case 'Matrix(3)': - case 'Matrix(4)': - retArr.push(`[${elements.join(', ')}]`); - break; - default: - retArr.push(`new Float32Array([${elements.join(', ')}])`); + if (this.eat(types.semi)) { return null } + + var method = this.startNode(); + var tryContextual = function (k, noLineBreak) { + if ( noLineBreak === void 0 ) noLineBreak = false; + + var start = this$1$1.start, startLoc = this$1$1.startLoc; + if (!this$1$1.eatContextual(k)) { return false } + if (this$1$1.type !== types.parenL && (!noLineBreak || !this$1$1.canInsertSemicolon())) { return true } + if (method.key) { this$1$1.unexpected(); } + method.computed = false; + method.key = this$1$1.startNodeAt(start, startLoc); + method.key.name = k; + this$1$1.finishNode(method.key, "Identifier"); + return false + }; + + method.kind = "method"; + method.static = tryContextual("static"); + var isGenerator = this.eat(types.star); + var isAsync = false; + if (!isGenerator) { + if (this.options.ecmaVersion >= 8 && tryContextual("async", true)) { + isAsync = true; + isGenerator = this.options.ecmaVersion >= 9 && this.eat(types.star); + } else if (tryContextual("get")) { + method.kind = "get"; + } else if (tryContextual("set")) { + method.kind = "set"; + } } - return retArr; - } + if (!method.key) { this.parsePropertyName(method); } + var key = method.key; + var allowsDirectSuper = false; + if (!method.computed && !method.static && (key.type === "Identifier" && key.name === "constructor" || + key.type === "Literal" && key.value === "constructor")) { + if (method.kind !== "method") { this.raise(key.start, "Constructor can't have get/set modifier"); } + if (isGenerator) { this.raise(key.start, "Constructor can't be a generator"); } + if (isAsync) { this.raise(key.start, "Constructor can't be an async method"); } + method.kind = "constructor"; + allowsDirectSuper = constructorAllowsSuper; + } else if (method.static && key.type === "Identifier" && key.name === "prototype") { + this.raise(key.start, "Classes may not have a static property named prototype"); + } + this.parseClassMethod(method, isGenerator, isAsync, allowsDirectSuper); + if (method.kind === "get" && method.value.params.length !== 0) + { this.raiseRecoverable(method.value.start, "getter should have no params"); } + if (method.kind === "set" && method.value.params.length !== 1) + { this.raiseRecoverable(method.value.start, "setter should have exactly one param"); } + if (method.kind === "set" && method.value.params[0].type === "RestElement") + { this.raiseRecoverable(method.value.params[0].start, "Setter cannot use rest params"); } + return method + }; - astDebuggerStatement(arrNode, retArr) { - retArr.push('debugger;'); - return retArr; - } -} + pp$1.parseClassMethod = function(method, isGenerator, isAsync, allowsDirectSuper) { + method.value = this.parseMethod(isGenerator, isAsync, allowsDirectSuper); + return this.finishNode(method, "MethodDefinition") + }; -module.exports = { - CPUFunctionNode -}; -},{"../function-node":9}],6:[function(require,module,exports){ -const { utils } = require('../../utils'); - -function constantsToString(constants, types) { - const results = []; - for (const name in types) { - if (!types.hasOwnProperty(name)) continue; - const type = types[name]; - const constant = constants[name]; - switch (type) { - case 'Number': - case 'Integer': - case 'Float': - case 'Boolean': - results.push(`${name}:${constant}`); - break; - case 'Array(2)': - case 'Array(3)': - case 'Array(4)': - case 'Matrix(2)': - case 'Matrix(3)': - case 'Matrix(4)': - results.push(`${name}:new ${constant.constructor.name}(${JSON.stringify(Array.from(constant))})`); - break; + pp$1.parseClassId = function(node, isStatement) { + if (this.type === types.name) { + node.id = this.parseIdent(); + if (isStatement) + { this.checkLVal(node.id, BIND_LEXICAL, false); } + } else { + if (isStatement === true) + { this.unexpected(); } + node.id = null; } - } - return `{ ${ results.join() } }`; -} + }; -function cpuKernelString(cpuKernel, name) { - const header = []; - const thisProperties = []; - const beforeReturn = []; - - const useFunctionKeyword = !/^function/.test(cpuKernel.color.toString()); - - header.push( - ' const { context, canvas, constants: incomingConstants } = settings;', - ` const output = new Int32Array(${JSON.stringify(Array.from(cpuKernel.output))});`, - ` const _constantTypes = ${JSON.stringify(cpuKernel.constantTypes)};`, - ` const _constants = ${constantsToString(cpuKernel.constants, cpuKernel.constantTypes)};` - ); - - thisProperties.push( - ' constants: _constants,', - ' context,', - ' output,', - ' thread: {x: 0, y: 0, z: 0},' - ); - - if (cpuKernel.graphical) { - header.push(` const _imageData = context.createImageData(${cpuKernel.output[0]}, ${cpuKernel.output[1]});`); - header.push(` const _colorData = new Uint8ClampedArray(${cpuKernel.output[0]} * ${cpuKernel.output[1]} * 4);`); - - const colorFn = utils.flattenFunctionToString((useFunctionKeyword ? 'function ' : '') + cpuKernel.color.toString(), { - thisLookup: (propertyName) => { - switch (propertyName) { - case '_colorData': - return '_colorData'; - case '_imageData': - return '_imageData'; - case 'output': - return 'output'; - case 'thread': - return 'this.thread'; + pp$1.parseClassSuper = function(node) { + node.superClass = this.eat(types._extends) ? this.parseExprSubscripts() : null; + }; + + // Parses module export declaration. + + pp$1.parseExport = function(node, exports) { + this.next(); + // export * from '...' + if (this.eat(types.star)) { + if (this.options.ecmaVersion >= 11) { + if (this.eatContextual("as")) { + node.exported = this.parseIdent(true); + this.checkExport(exports, node.exported.name, this.lastTokStart); + } else { + node.exported = null; } - return JSON.stringify(cpuKernel[propertyName]); - }, - findDependency: (object, name) => { - return null; } - }); + this.expectContextual("from"); + if (this.type !== types.string) { this.unexpected(); } + node.source = this.parseExprAtom(); + this.semicolon(); + return this.finishNode(node, "ExportAllDeclaration") + } + if (this.eat(types._default)) { // export default ... + this.checkExport(exports, "default", this.lastTokStart); + var isAsync; + if (this.type === types._function || (isAsync = this.isAsyncFunction())) { + var fNode = this.startNode(); + this.next(); + if (isAsync) { this.next(); } + node.declaration = this.parseFunction(fNode, FUNC_STATEMENT | FUNC_NULLABLE_ID, false, isAsync); + } else if (this.type === types._class) { + var cNode = this.startNode(); + node.declaration = this.parseClass(cNode, "nullableID"); + } else { + node.declaration = this.parseMaybeAssign(); + this.semicolon(); + } + return this.finishNode(node, "ExportDefaultDeclaration") + } + // export var|const|let|function|class ... + if (this.shouldParseExportStatement()) { + node.declaration = this.parseStatement(null); + if (node.declaration.type === "VariableDeclaration") + { this.checkVariableExport(exports, node.declaration.declarations); } + else + { this.checkExport(exports, node.declaration.id.name, node.declaration.id.start); } + node.specifiers = []; + node.source = null; + } else { // export { x, y as z } [from '...'] + node.declaration = null; + node.specifiers = this.parseExportSpecifiers(exports); + if (this.eatContextual("from")) { + if (this.type !== types.string) { this.unexpected(); } + node.source = this.parseExprAtom(); + } else { + for (var i = 0, list = node.specifiers; i < list.length; i += 1) { + // check for keywords used as local names + var spec = list[i]; - const getPixelsFn = utils.flattenFunctionToString((useFunctionKeyword ? 'function ' : '') + cpuKernel.getPixels.toString(), { - thisLookup: (propertyName) => { - switch (propertyName) { - case '_colorData': - return '_colorData'; - case '_imageData': - return '_imageData'; - case 'output': - return 'output'; - case 'thread': - return 'this.thread'; + this.checkUnreserved(spec.local); + // check if export is defined + this.checkLocalExport(spec.local); } - return JSON.stringify(cpuKernel[propertyName]); - }, - findDependency: () => { - return null; + + node.source = null; } - }); + this.semicolon(); + } + return this.finishNode(node, "ExportNamedDeclaration") + }; - thisProperties.push( - ' _imageData,', - ' _colorData,', - ` color: ${colorFn},` - ); + pp$1.checkExport = function(exports, name, pos) { + if (!exports) { return } + if (has(exports, name)) + { this.raiseRecoverable(pos, "Duplicate export '" + name + "'"); } + exports[name] = true; + }; - beforeReturn.push( - ` kernel.getPixels = ${getPixelsFn};` - ); - } + pp$1.checkPatternExport = function(exports, pat) { + var type = pat.type; + if (type === "Identifier") + { this.checkExport(exports, pat.name, pat.start); } + else if (type === "ObjectPattern") + { for (var i = 0, list = pat.properties; i < list.length; i += 1) + { + var prop = list[i]; + + this.checkPatternExport(exports, prop); + } } + else if (type === "ArrayPattern") + { for (var i$1 = 0, list$1 = pat.elements; i$1 < list$1.length; i$1 += 1) { + var elt = list$1[i$1]; + + if (elt) { this.checkPatternExport(exports, elt); } + } } + else if (type === "Property") + { this.checkPatternExport(exports, pat.value); } + else if (type === "AssignmentPattern") + { this.checkPatternExport(exports, pat.left); } + else if (type === "RestElement") + { this.checkPatternExport(exports, pat.argument); } + else if (type === "ParenthesizedExpression") + { this.checkPatternExport(exports, pat.expression); } + }; - const constantTypes = []; - const constantKeys = Object.keys(cpuKernel.constantTypes); - for (let i = 0; i < constantKeys.length; i++) { - constantTypes.push(cpuKernel.constantTypes[constantKeys]); - } - if (cpuKernel.argumentTypes.indexOf('HTMLImageArray') !== -1 || constantTypes.indexOf('HTMLImageArray') !== -1) { - const flattenedImageTo3DArray = utils.flattenFunctionToString((useFunctionKeyword ? 'function ' : '') + cpuKernel._imageTo3DArray.toString(), { - doNotDefine: ['canvas'], - findDependency: (object, name) => { - if (object === 'this') { - return (useFunctionKeyword ? 'function ' : '') + cpuKernel[name].toString(); - } - return null; - }, - thisLookup: (propertyName) => { - switch (propertyName) { - case 'canvas': - return; - case 'context': - return 'context'; - } + pp$1.checkVariableExport = function(exports, decls) { + if (!exports) { return } + for (var i = 0, list = decls; i < list.length; i += 1) + { + var decl = list[i]; + + this.checkPatternExport(exports, decl.id); + } + }; + + pp$1.shouldParseExportStatement = function() { + return this.type.keyword === "var" || + this.type.keyword === "const" || + this.type.keyword === "class" || + this.type.keyword === "function" || + this.isLet() || + this.isAsyncFunction() + }; + + // Parses a comma-separated list of module exports. + + pp$1.parseExportSpecifiers = function(exports) { + var nodes = [], first = true; + // export { x, y as z } [from '...'] + this.expect(types.braceL); + while (!this.eat(types.braceR)) { + if (!first) { + this.expect(types.comma); + if (this.afterTrailingComma(types.braceR)) { break } + } else { first = false; } + + var node = this.startNode(); + node.local = this.parseIdent(true); + node.exported = this.eatContextual("as") ? this.parseIdent(true) : node.local; + this.checkExport(exports, node.exported.name, node.exported.start); + nodes.push(this.finishNode(node, "ExportSpecifier")); + } + return nodes + }; + + // Parses import declaration. + + pp$1.parseImport = function(node) { + this.next(); + // import '...' + if (this.type === types.string) { + node.specifiers = empty; + node.source = this.parseExprAtom(); + } else { + node.specifiers = this.parseImportSpecifiers(); + this.expectContextual("from"); + node.source = this.type === types.string ? this.parseExprAtom() : this.unexpected(); + } + this.semicolon(); + return this.finishNode(node, "ImportDeclaration") + }; + + // Parses a comma-separated list of module imports. + + pp$1.parseImportSpecifiers = function() { + var nodes = [], first = true; + if (this.type === types.name) { + // import defaultObj, { x, y as z } from '...' + var node = this.startNode(); + node.local = this.parseIdent(); + this.checkLVal(node.local, BIND_LEXICAL); + nodes.push(this.finishNode(node, "ImportDefaultSpecifier")); + if (!this.eat(types.comma)) { return nodes } + } + if (this.type === types.star) { + var node$1 = this.startNode(); + this.next(); + this.expectContextual("as"); + node$1.local = this.parseIdent(); + this.checkLVal(node$1.local, BIND_LEXICAL); + nodes.push(this.finishNode(node$1, "ImportNamespaceSpecifier")); + return nodes + } + this.expect(types.braceL); + while (!this.eat(types.braceR)) { + if (!first) { + this.expect(types.comma); + if (this.afterTrailingComma(types.braceR)) { break } + } else { first = false; } + + var node$2 = this.startNode(); + node$2.imported = this.parseIdent(true); + if (this.eatContextual("as")) { + node$2.local = this.parseIdent(); + } else { + this.checkUnreserved(node$2.imported); + node$2.local = node$2.imported; } - }); - beforeReturn.push(flattenedImageTo3DArray); - thisProperties.push(` _mediaTo2DArray,`); - thisProperties.push(` _imageTo3DArray,`); - } else if (cpuKernel.argumentTypes.indexOf('HTMLImage') !== -1 || constantTypes.indexOf('HTMLImage') !== -1) { - const flattenedImageTo2DArray = utils.flattenFunctionToString((useFunctionKeyword ? 'function ' : '') + cpuKernel._mediaTo2DArray.toString(), { - findDependency: (object, name) => { - return null; - }, - thisLookup: (propertyName) => { - switch (propertyName) { - case 'canvas': - return 'settings.canvas'; - case 'context': - return 'settings.context'; + this.checkLVal(node$2.local, BIND_LEXICAL); + nodes.push(this.finishNode(node$2, "ImportSpecifier")); + } + return nodes + }; + + // Set `ExpressionStatement#directive` property for directive prologues. + pp$1.adaptDirectivePrologue = function(statements) { + for (var i = 0; i < statements.length && this.isDirectiveCandidate(statements[i]); ++i) { + statements[i].directive = statements[i].expression.raw.slice(1, -1); + } + }; + pp$1.isDirectiveCandidate = function(statement) { + return ( + statement.type === "ExpressionStatement" && + statement.expression.type === "Literal" && + typeof statement.expression.value === "string" && + // Reject parenthesized strings. + (this.input[statement.start] === "\"" || this.input[statement.start] === "'") + ) + }; + + var pp$2 = Parser.prototype; + + // Convert existing expression atom to assignable pattern + // if possible. + + pp$2.toAssignable = function(node, isBinding, refDestructuringErrors) { + if (this.options.ecmaVersion >= 6 && node) { + switch (node.type) { + case "Identifier": + if (this.inAsync && node.name === "await") + { this.raise(node.start, "Cannot use 'await' as identifier inside an async function"); } + break + + case "ObjectPattern": + case "ArrayPattern": + case "RestElement": + break + + case "ObjectExpression": + node.type = "ObjectPattern"; + if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); } + for (var i = 0, list = node.properties; i < list.length; i += 1) { + var prop = list[i]; + + this.toAssignable(prop, isBinding); + // Early error: + // AssignmentRestProperty[Yield, Await] : + // `...` DestructuringAssignmentTarget[Yield, Await] + // + // It is a Syntax Error if |DestructuringAssignmentTarget| is an |ArrayLiteral| or an |ObjectLiteral|. + if ( + prop.type === "RestElement" && + (prop.argument.type === "ArrayPattern" || prop.argument.type === "ObjectPattern") + ) { + this.raise(prop.argument.start, "Unexpected token"); + } } - throw new Error('unhandled thisLookup'); + break + + case "Property": + // AssignmentProperty has type === "Property" + if (node.kind !== "init") { this.raise(node.key.start, "Object pattern can't contain getter or setter"); } + this.toAssignable(node.value, isBinding); + break + + case "ArrayExpression": + node.type = "ArrayPattern"; + if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); } + this.toAssignableList(node.elements, isBinding); + break + + case "SpreadElement": + node.type = "RestElement"; + this.toAssignable(node.argument, isBinding); + if (node.argument.type === "AssignmentPattern") + { this.raise(node.argument.start, "Rest elements cannot have a default value"); } + break + + case "AssignmentExpression": + if (node.operator !== "=") { this.raise(node.left.end, "Only '=' operator can be used for specifying default value."); } + node.type = "AssignmentPattern"; + delete node.operator; + this.toAssignable(node.left, isBinding); + // falls through to AssignmentPattern + + case "AssignmentPattern": + break + + case "ParenthesizedExpression": + this.toAssignable(node.expression, isBinding, refDestructuringErrors); + break + + case "ChainExpression": + this.raiseRecoverable(node.start, "Optional chaining cannot appear in left-hand side"); + break + + case "MemberExpression": + if (!isBinding) { break } + + default: + this.raise(node.start, "Assigning to rvalue"); } - }); - beforeReturn.push(flattenedImageTo2DArray); - thisProperties.push(` _mediaTo2DArray,`); - } + } else if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); } + return node + }; - return `function(settings) { -${ header.join('\n') } - for (const p in _constantTypes) { - if (!_constantTypes.hasOwnProperty(p)) continue; - const type = _constantTypes[p]; - switch (type) { - case 'Number': - case 'Integer': - case 'Float': - case 'Boolean': - case 'Array(2)': - case 'Array(3)': - case 'Array(4)': - case 'Matrix(2)': - case 'Matrix(3)': - case 'Matrix(4)': - if (incomingConstants.hasOwnProperty(p)) { - console.warn('constant ' + p + ' of type ' + type + ' cannot be resigned'); - } - continue; + // Convert list of expression atoms to binding list. + + pp$2.toAssignableList = function(exprList, isBinding) { + var end = exprList.length; + for (var i = 0; i < end; i++) { + var elt = exprList[i]; + if (elt) { this.toAssignable(elt, isBinding); } } - if (!incomingConstants.hasOwnProperty(p)) { - throw new Error('constant ' + p + ' not found'); + if (end) { + var last = exprList[end - 1]; + if (this.options.ecmaVersion === 6 && isBinding && last && last.type === "RestElement" && last.argument.type !== "Identifier") + { this.unexpected(last.argument.start); } } - _constants[p] = incomingConstants[p]; - } - const kernel = (function() { -${cpuKernel._kernelString} - }) - .apply({ ${thisProperties.join('\n')} }); - ${ beforeReturn.join('\n') } - return kernel; -}`; -} - -module.exports = { - cpuKernelString -}; -},{"../../utils":113}],7:[function(require,module,exports){ -const { Kernel } = require('../kernel'); -const { FunctionBuilder } = require('../function-builder'); -const { CPUFunctionNode } = require('./function-node'); -const { utils } = require('../../utils'); -const { cpuKernelString } = require('./kernel-string'); - -class CPUKernel extends Kernel { - static getFeatures() { - return this.features; - } - static get features() { - return Object.freeze({ - kernelMap: true, - isIntegerDivisionAccurate: true - }); - } - static get isSupported() { - return true; - } - static isContextMatch(context) { - return false; - } - static get mode() { - return 'cpu'; - } - - static nativeFunctionArguments() { - return null; - } + return exprList + }; - static nativeFunctionReturnType() { - throw new Error(`Looking up native function return type not supported on ${this.name}`); - } + // Parses spread element. - static combineKernels(combinedKernel) { - return combinedKernel; - } + pp$2.parseSpread = function(refDestructuringErrors) { + var node = this.startNode(); + this.next(); + node.argument = this.parseMaybeAssign(false, refDestructuringErrors); + return this.finishNode(node, "SpreadElement") + }; - static getSignature(kernel, argumentTypes) { - return 'cpu' + (argumentTypes.length > 0 ? ':' + argumentTypes.join(',') : ''); - } + pp$2.parseRestBinding = function() { + var node = this.startNode(); + this.next(); - constructor(source, settings) { - super(source, settings); - this.mergeSettings(source.settings || settings); + // RestElement inside of a function parameter must be an identifier + if (this.options.ecmaVersion === 6 && this.type !== types.name) + { this.unexpected(); } - this._imageData = null; - this._colorData = null; - this._kernelString = null; - this._prependedString = []; - this.thread = { - x: 0, - y: 0, - z: 0 - }; - this.translatedSources = null; - } + node.argument = this.parseBindingAtom(); - initCanvas() { - if (typeof document !== 'undefined') { - return document.createElement('canvas'); - } else if (typeof OffscreenCanvas !== 'undefined') { - return new OffscreenCanvas(0, 0); - } - } + return this.finishNode(node, "RestElement") + }; - initContext() { - if (!this.canvas) return null; - return this.canvas.getContext('2d'); - } + // Parses lvalue (assignable) atom. - initPlugins(settings) { - return []; - } + pp$2.parseBindingAtom = function() { + if (this.options.ecmaVersion >= 6) { + switch (this.type) { + case types.bracketL: + var node = this.startNode(); + this.next(); + node.elements = this.parseBindingList(types.bracketR, true, true); + return this.finishNode(node, "ArrayPattern") - validateSettings(args) { - if (!this.output || this.output.length === 0) { - if (args.length !== 1) { - throw new Error('Auto output only supported for kernels with only one input'); + case types.braceL: + return this.parseObj(true) } + } + return this.parseIdent() + }; - const argType = utils.getVariableType(args[0], this.strictIntegers); - if (argType === 'Array') { - this.output = utils.getDimensions(argType); - } else if (argType === 'NumberTexture' || argType === 'ArrayTexture(4)') { - this.output = args[0].output; + pp$2.parseBindingList = function(close, allowEmpty, allowTrailingComma) { + var elts = [], first = true; + while (!this.eat(close)) { + if (first) { first = false; } + else { this.expect(types.comma); } + if (allowEmpty && this.type === types.comma) { + elts.push(null); + } else if (allowTrailingComma && this.afterTrailingComma(close)) { + break + } else if (this.type === types.ellipsis) { + var rest = this.parseRestBinding(); + this.parseBindingListItem(rest); + elts.push(rest); + if (this.type === types.comma) { this.raise(this.start, "Comma is not permitted after the rest element"); } + this.expect(close); + break } else { - throw new Error('Auto output not supported for input type: ' + argType); + var elem = this.parseMaybeDefault(this.start, this.startLoc); + this.parseBindingListItem(elem); + elts.push(elem); } } + return elts + }; - if (this.graphical) { - if (this.output.length !== 2) { - throw new Error('Output must have 2 dimensions on graphical mode'); - } - } + pp$2.parseBindingListItem = function(param) { + return param + }; - this.checkOutput(); - } + // Parses assignment pattern around given atom if possible. - translateSource() { - this.leadingReturnStatement = this.output.length > 1 ? 'resultX[x] = ' : 'result[x] = '; - if (this.subKernels) { - const followingReturnStatement = []; - for (let i = 0; i < this.subKernels.length; i++) { - const { - name - } = this.subKernels[i]; - followingReturnStatement.push(this.output.length > 1 ? `resultX_${ name }[x] = subKernelResult_${ name };\n` : `result_${ name }[x] = subKernelResult_${ name };\n`); + pp$2.parseMaybeDefault = function(startPos, startLoc, left) { + left = left || this.parseBindingAtom(); + if (this.options.ecmaVersion < 6 || !this.eat(types.eq)) { return left } + var node = this.startNodeAt(startPos, startLoc); + node.left = left; + node.right = this.parseMaybeAssign(); + return this.finishNode(node, "AssignmentPattern") + }; + + // Verify that a node is an lval — something that can be assigned + // to. + // bindingType can be either: + // 'var' indicating that the lval creates a 'var' binding + // 'let' indicating that the lval creates a lexical ('let' or 'const') binding + // 'none' indicating that the binding should be checked for illegal identifiers, but not for duplicate references + + pp$2.checkLVal = function(expr, bindingType, checkClashes) { + if ( bindingType === void 0 ) bindingType = BIND_NONE; + + switch (expr.type) { + case "Identifier": + if (bindingType === BIND_LEXICAL && expr.name === "let") + { this.raiseRecoverable(expr.start, "let is disallowed as a lexically bound name"); } + if (this.strict && this.reservedWordsStrictBind.test(expr.name)) + { this.raiseRecoverable(expr.start, (bindingType ? "Binding " : "Assigning to ") + expr.name + " in strict mode"); } + if (checkClashes) { + if (has(checkClashes, expr.name)) + { this.raiseRecoverable(expr.start, "Argument name clash"); } + checkClashes[expr.name] = true; } - this.followingReturnStatement = followingReturnStatement.join(''); - } - const functionBuilder = FunctionBuilder.fromKernel(this, CPUFunctionNode); - this.translatedSources = functionBuilder.getPrototypes('kernel'); - if (!this.graphical && !this.returnType) { - this.returnType = functionBuilder.getKernelResultType(); + if (bindingType !== BIND_NONE && bindingType !== BIND_OUTSIDE) { this.declareName(expr.name, bindingType, expr.start); } + break + + case "ChainExpression": + this.raiseRecoverable(expr.start, "Optional chaining cannot appear in left-hand side"); + break + + case "MemberExpression": + if (bindingType) { this.raiseRecoverable(expr.start, "Binding member expression"); } + break + + case "ObjectPattern": + for (var i = 0, list = expr.properties; i < list.length; i += 1) + { + var prop = list[i]; + + this.checkLVal(prop, bindingType, checkClashes); } - } + break - build() { - if (this.built) return; - this.setupConstants(); - this.setupArguments(arguments); - this.validateSettings(arguments); - this.translateSource(); + case "Property": + // AssignmentProperty has type === "Property" + this.checkLVal(expr.value, bindingType, checkClashes); + break - if (this.graphical) { - const { - canvas, - output - } = this; - if (!canvas) { - throw new Error('no canvas available for using graphical output'); + case "ArrayPattern": + for (var i$1 = 0, list$1 = expr.elements; i$1 < list$1.length; i$1 += 1) { + var elem = list$1[i$1]; + + if (elem) { this.checkLVal(elem, bindingType, checkClashes); } } - const width = output[0]; - const height = output[1] || 1; - canvas.width = width; - canvas.height = height; - this._imageData = this.context.createImageData(width, height); - this._colorData = new Uint8ClampedArray(width * height * 4); - } + break - const kernelString = this.getKernelString(); - this.kernelString = kernelString; + case "AssignmentPattern": + this.checkLVal(expr.left, bindingType, checkClashes); + break - if (this.debug) { - console.log('Function output:'); - console.log(kernelString); + case "RestElement": + this.checkLVal(expr.argument, bindingType, checkClashes); + break + + case "ParenthesizedExpression": + this.checkLVal(expr.expression, bindingType, checkClashes); + break + + default: + this.raise(expr.start, (bindingType ? "Binding" : "Assigning to") + " rvalue"); } + }; - try { - this.run = new Function([], kernelString).bind(this)(); - } catch (e) { - console.error('An error occurred compiling the javascript: ', e); + // A recursive descent parser operates by defining functions for all + + var pp$3 = Parser.prototype; + + // Check if property name clashes with already added. + // Object/class getters and setters are not allowed to clash — + // either with each other or with an init property — and in + // strict mode, init properties are also not allowed to be repeated. + + pp$3.checkPropClash = function(prop, propHash, refDestructuringErrors) { + if (this.options.ecmaVersion >= 9 && prop.type === "SpreadElement") + { return } + if (this.options.ecmaVersion >= 6 && (prop.computed || prop.method || prop.shorthand)) + { return } + var key = prop.key; + var name; + switch (key.type) { + case "Identifier": name = key.name; break + case "Literal": name = String(key.value); break + default: return + } + var kind = prop.kind; + if (this.options.ecmaVersion >= 6) { + if (name === "__proto__" && kind === "init") { + if (propHash.proto) { + if (refDestructuringErrors) { + if (refDestructuringErrors.doubleProto < 0) + { refDestructuringErrors.doubleProto = key.start; } + // Backwards-compat kludge. Can be removed in version 6.0 + } else { this.raiseRecoverable(key.start, "Redefinition of __proto__ property"); } + } + propHash.proto = true; + } + return + } + name = "$" + name; + var other = propHash[name]; + if (other) { + var redefinition; + if (kind === "init") { + redefinition = this.strict && other.init || other.get || other.set; + } else { + redefinition = other.init || other[kind]; + } + if (redefinition) + { this.raiseRecoverable(key.start, "Redefinition of property"); } + } else { + other = propHash[name] = { + init: false, + get: false, + set: false + }; } - this.buildSignature(arguments); - this.built = true; - } + other[kind] = true; + }; + + // ### Expression parsing + + // These nest, from the most general expression type at the top to + // 'atomic', nondivisible expression types at the bottom. Most of + // the functions will simply let the function(s) below them parse, + // and, *if* the syntactic construct they handle is present, wrap + // the AST node that the inner parser gave them in another node. + + // Parse a full expression. The optional arguments are used to + // forbid the `in` operator (in for loops initalization expressions) + // and provide reference for storing '=' operator inside shorthand + // property assignment in contexts where both object expression + // and object pattern might appear (so it's possible to raise + // delayed syntax error at correct position). + + pp$3.parseExpression = function(noIn, refDestructuringErrors) { + var startPos = this.start, startLoc = this.startLoc; + var expr = this.parseMaybeAssign(noIn, refDestructuringErrors); + if (this.type === types.comma) { + var node = this.startNodeAt(startPos, startLoc); + node.expressions = [expr]; + while (this.eat(types.comma)) { node.expressions.push(this.parseMaybeAssign(noIn, refDestructuringErrors)); } + return this.finishNode(node, "SequenceExpression") + } + return expr + }; - color(r, g, b, a) { - if (typeof a === 'undefined') { - a = 1; + // Parse an assignment expression. This includes applications of + // operators like `+=`. + + pp$3.parseMaybeAssign = function(noIn, refDestructuringErrors, afterLeftParse) { + if (this.isContextual("yield")) { + if (this.inGenerator) { return this.parseYield(noIn) } + // The tokenizer will assume an expression is allowed after + // `yield`, but this isn't that kind of yield + else { this.exprAllowed = false; } } - r = Math.floor(r * 255); - g = Math.floor(g * 255); - b = Math.floor(b * 255); - a = Math.floor(a * 255); + var ownDestructuringErrors = false, oldParenAssign = -1, oldTrailingComma = -1; + if (refDestructuringErrors) { + oldParenAssign = refDestructuringErrors.parenthesizedAssign; + oldTrailingComma = refDestructuringErrors.trailingComma; + refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = -1; + } else { + refDestructuringErrors = new DestructuringErrors; + ownDestructuringErrors = true; + } + + var startPos = this.start, startLoc = this.startLoc; + if (this.type === types.parenL || this.type === types.name) + { this.potentialArrowAt = this.start; } + var left = this.parseMaybeConditional(noIn, refDestructuringErrors); + if (afterLeftParse) { left = afterLeftParse.call(this, left, startPos, startLoc); } + if (this.type.isAssign) { + var node = this.startNodeAt(startPos, startLoc); + node.operator = this.value; + node.left = this.type === types.eq ? this.toAssignable(left, false, refDestructuringErrors) : left; + if (!ownDestructuringErrors) { + refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = refDestructuringErrors.doubleProto = -1; + } + if (refDestructuringErrors.shorthandAssign >= node.left.start) + { refDestructuringErrors.shorthandAssign = -1; } // reset because shorthand default was used correctly + this.checkLVal(left); + this.next(); + node.right = this.parseMaybeAssign(noIn); + return this.finishNode(node, "AssignmentExpression") + } else { + if (ownDestructuringErrors) { this.checkExpressionErrors(refDestructuringErrors, true); } + } + if (oldParenAssign > -1) { refDestructuringErrors.parenthesizedAssign = oldParenAssign; } + if (oldTrailingComma > -1) { refDestructuringErrors.trailingComma = oldTrailingComma; } + return left + }; - const width = this.output[0]; - const height = this.output[1]; + // Parse a ternary conditional (`?:`) operator. + + pp$3.parseMaybeConditional = function(noIn, refDestructuringErrors) { + var startPos = this.start, startLoc = this.startLoc; + var expr = this.parseExprOps(noIn, refDestructuringErrors); + if (this.checkExpressionErrors(refDestructuringErrors)) { return expr } + if (this.eat(types.question)) { + var node = this.startNodeAt(startPos, startLoc); + node.test = expr; + node.consequent = this.parseMaybeAssign(); + this.expect(types.colon); + node.alternate = this.parseMaybeAssign(noIn); + return this.finishNode(node, "ConditionalExpression") + } + return expr + }; - const x = this.thread.x; - const y = height - this.thread.y - 1; + // Start the precedence parser. - const index = x + y * width; + pp$3.parseExprOps = function(noIn, refDestructuringErrors) { + var startPos = this.start, startLoc = this.startLoc; + var expr = this.parseMaybeUnary(refDestructuringErrors, false); + if (this.checkExpressionErrors(refDestructuringErrors)) { return expr } + return expr.start === startPos && expr.type === "ArrowFunctionExpression" ? expr : this.parseExprOp(expr, startPos, startLoc, -1, noIn) + }; - this._colorData[index * 4 + 0] = r; - this._colorData[index * 4 + 1] = g; - this._colorData[index * 4 + 2] = b; - this._colorData[index * 4 + 3] = a; - } + // Parse binary operators with the operator precedence parsing + // algorithm. `left` is the left-hand side of the operator. + // `minPrec` provides context that allows the function to stop and + // defer further parser to one of its callers when it encounters an + // operator that has a lower precedence than the set it is parsing. + + pp$3.parseExprOp = function(left, leftStartPos, leftStartLoc, minPrec, noIn) { + var prec = this.type.binop; + if (prec != null && (!noIn || this.type !== types._in)) { + if (prec > minPrec) { + var logical = this.type === types.logicalOR || this.type === types.logicalAND; + var coalesce = this.type === types.coalesce; + if (coalesce) { + // Handle the precedence of `tt.coalesce` as equal to the range of logical expressions. + // In other words, `node.right` shouldn't contain logical expressions in order to check the mixed error. + prec = types.logicalAND.binop; + } + var op = this.value; + this.next(); + var startPos = this.start, startLoc = this.startLoc; + var right = this.parseExprOp(this.parseMaybeUnary(null, false), startPos, startLoc, prec, noIn); + var node = this.buildBinary(leftStartPos, leftStartLoc, left, right, op, logical || coalesce); + if ((logical && this.type === types.coalesce) || (coalesce && (this.type === types.logicalOR || this.type === types.logicalAND))) { + this.raiseRecoverable(this.start, "Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"); + } + return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec, noIn) + } + } + return left + }; - getKernelString() { - if (this._kernelString !== null) return this._kernelString; + pp$3.buildBinary = function(startPos, startLoc, left, right, op, logical) { + var node = this.startNodeAt(startPos, startLoc); + node.left = left; + node.operator = op; + node.right = right; + return this.finishNode(node, logical ? "LogicalExpression" : "BinaryExpression") + }; - let kernelThreadString = null; - let { - translatedSources - } = this; - if (translatedSources.length > 1) { - translatedSources = translatedSources.filter(fn => { - if (/^function/.test(fn)) return fn; - kernelThreadString = fn; - return false; - }); + // Parse unary operators, both prefix and postfix. + + pp$3.parseMaybeUnary = function(refDestructuringErrors, sawUnary) { + var startPos = this.start, startLoc = this.startLoc, expr; + if (this.isContextual("await") && (this.inAsync || (!this.inFunction && this.options.allowAwaitOutsideFunction))) { + expr = this.parseAwait(); + sawUnary = true; + } else if (this.type.prefix) { + var node = this.startNode(), update = this.type === types.incDec; + node.operator = this.value; + node.prefix = true; + this.next(); + node.argument = this.parseMaybeUnary(null, true); + this.checkExpressionErrors(refDestructuringErrors, true); + if (update) { this.checkLVal(node.argument); } + else if (this.strict && node.operator === "delete" && + node.argument.type === "Identifier") + { this.raiseRecoverable(node.start, "Deleting local variable in strict mode"); } + else { sawUnary = true; } + expr = this.finishNode(node, update ? "UpdateExpression" : "UnaryExpression"); } else { - kernelThreadString = translatedSources.shift(); + expr = this.parseExprSubscripts(refDestructuringErrors); + if (this.checkExpressionErrors(refDestructuringErrors)) { return expr } + while (this.type.postfix && !this.canInsertSemicolon()) { + var node$1 = this.startNodeAt(startPos, startLoc); + node$1.operator = this.value; + node$1.prefix = false; + node$1.argument = expr; + this.checkLVal(expr); + this.next(); + expr = this.finishNode(node$1, "UpdateExpression"); + } } - return this._kernelString = ` const LOOP_MAX = ${ this._getLoopMaxString() }; - ${ this.injectedNative || '' } - const _this = this; - ${ this._resultKernelHeader() } - ${ this._processConstants() } - return (${ this.argumentNames.map(argumentName => 'user_' + argumentName).join(', ') }) => { - ${ this._prependedString.join('') } - ${ this._earlyThrows() } - ${ this._processArguments() } - ${ this.graphical ? this._graphicalKernelBody(kernelThreadString) : this._resultKernelBody(kernelThreadString) } - ${ translatedSources.length > 0 ? translatedSources.join('\n') : '' } - };`; - } - - toString() { - return cpuKernelString(this); - } - _getLoopMaxString() { - return ( - this.loopMaxIterations ? - ` ${ parseInt(this.loopMaxIterations) };` : - ' 1000;' - ); - } + if (!sawUnary && this.eat(types.starstar)) + { return this.buildBinary(startPos, startLoc, expr, this.parseMaybeUnary(null, false), "**", false) } + else + { return expr } + }; - _processConstants() { - if (!this.constants) return ''; + // Parse call, dot, and `[]`-subscript expressions. - const result = []; - for (let p in this.constants) { - const type = this.constantTypes[p]; - switch (type) { - case 'HTMLCanvas': - case 'OffscreenCanvas': - case 'HTMLImage': - case 'ImageBitmap': - case 'ImageData': - case 'HTMLVideo': - result.push(` const constants_${p} = this._mediaTo2DArray(this.constants.${p});\n`); - break; - case 'HTMLImageArray': - result.push(` const constants_${p} = this._imageTo3DArray(this.constants.${p});\n`); - break; - case 'Input': - result.push(` const constants_${p} = this.constants.${p}.value;\n`); - break; - default: - result.push(` const constants_${p} = this.constants.${p};\n`); - } + pp$3.parseExprSubscripts = function(refDestructuringErrors) { + var startPos = this.start, startLoc = this.startLoc; + var expr = this.parseExprAtom(refDestructuringErrors); + if (expr.type === "ArrowFunctionExpression" && this.input.slice(this.lastTokStart, this.lastTokEnd) !== ")") + { return expr } + var result = this.parseSubscripts(expr, startPos, startLoc); + if (refDestructuringErrors && result.type === "MemberExpression") { + if (refDestructuringErrors.parenthesizedAssign >= result.start) { refDestructuringErrors.parenthesizedAssign = -1; } + if (refDestructuringErrors.parenthesizedBind >= result.start) { refDestructuringErrors.parenthesizedBind = -1; } } - return result.join(''); - } + return result + }; + + pp$3.parseSubscripts = function(base, startPos, startLoc, noCalls) { + var maybeAsyncArrow = this.options.ecmaVersion >= 8 && base.type === "Identifier" && base.name === "async" && + this.lastTokEnd === base.end && !this.canInsertSemicolon() && base.end - base.start === 5 && + this.potentialArrowAt === base.start; + var optionalChained = false; - _earlyThrows() { - if (this.graphical) return ''; - if (this.immutable) return ''; - if (!this.pipeline) return ''; - const arrayArguments = []; - for (let i = 0; i < this.argumentTypes.length; i++) { - if (this.argumentTypes[i] === 'Array') { - arrayArguments.push(this.argumentNames[i]); + while (true) { + var element = this.parseSubscript(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained); + + if (element.optional) { optionalChained = true; } + if (element === base || element.type === "ArrowFunctionExpression") { + if (optionalChained) { + var chainNode = this.startNodeAt(startPos, startLoc); + chainNode.expression = element; + element = this.finishNode(chainNode, "ChainExpression"); + } + return element } + + base = element; } - if (arrayArguments.length === 0) return ''; - const checks = []; - for (let i = 0; i < arrayArguments.length; i++) { - const argumentName = arrayArguments[i]; - const checkSubKernels = this._mapSubKernels(subKernel => `user_${argumentName} === result_${subKernel.name}`).join(' || '); - checks.push(`user_${argumentName} === result${checkSubKernels ? ` || ${checkSubKernels}` : ''}`); - } - return `if (${checks.join(' || ')}) throw new Error('Source and destination arrays are the same. Use immutable = true');`; - } + }; - _processArguments() { - const result = []; - for (let i = 0; i < this.argumentTypes.length; i++) { - const variableName = `user_${this.argumentNames[i]}`; - switch (this.argumentTypes[i]) { - case 'HTMLCanvas': - case 'OffscreenCanvas': - case 'HTMLImage': - case 'ImageBitmap': - case 'ImageData': - case 'HTMLVideo': - result.push(` ${variableName} = this._mediaTo2DArray(${variableName});\n`); - break; - case 'HTMLImageArray': - result.push(` ${variableName} = this._imageTo3DArray(${variableName});\n`); - break; - case 'Input': - result.push(` ${variableName} = ${variableName}.value;\n`); - break; - case 'ArrayTexture(1)': - case 'ArrayTexture(2)': - case 'ArrayTexture(3)': - case 'ArrayTexture(4)': - case 'NumberTexture': - case 'MemoryOptimizedNumberTexture': - result.push(` - if (${variableName}.toArray) { - if (!_this.textureCache) { - _this.textureCache = []; - _this.arrayCache = []; + pp$3.parseSubscript = function(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained) { + var optionalSupported = this.options.ecmaVersion >= 11; + var optional = optionalSupported && this.eat(types.questionDot); + if (noCalls && optional) { this.raise(this.lastTokStart, "Optional chaining cannot appear in the callee of new expressions"); } + + var computed = this.eat(types.bracketL); + if (computed || (optional && this.type !== types.parenL && this.type !== types.backQuote) || this.eat(types.dot)) { + var node = this.startNodeAt(startPos, startLoc); + node.object = base; + node.property = computed ? this.parseExpression() : this.parseIdent(this.options.allowReserved !== "never"); + node.computed = !!computed; + if (computed) { this.expect(types.bracketR); } + if (optionalSupported) { + node.optional = optional; } - const textureIndex = _this.textureCache.indexOf(${variableName}); - if (textureIndex !== -1) { - ${variableName} = _this.arrayCache[textureIndex]; - } else { - _this.textureCache.push(${variableName}); - ${variableName} = ${variableName}.toArray(); - _this.arrayCache.push(${variableName}); + base = this.finishNode(node, "MemberExpression"); + } else if (!noCalls && this.eat(types.parenL)) { + var refDestructuringErrors = new DestructuringErrors, oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; + this.yieldPos = 0; + this.awaitPos = 0; + this.awaitIdentPos = 0; + var exprList = this.parseExprList(types.parenR, this.options.ecmaVersion >= 8, false, refDestructuringErrors); + if (maybeAsyncArrow && !optional && !this.canInsertSemicolon() && this.eat(types.arrow)) { + this.checkPatternErrors(refDestructuringErrors, false); + this.checkYieldAwaitInDefaultParams(); + if (this.awaitIdentPos > 0) + { this.raise(this.awaitIdentPos, "Cannot use 'await' as identifier inside an async function"); } + this.yieldPos = oldYieldPos; + this.awaitPos = oldAwaitPos; + this.awaitIdentPos = oldAwaitIdentPos; + return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, true) } - }`); - break; + this.checkExpressionErrors(refDestructuringErrors, true); + this.yieldPos = oldYieldPos || this.yieldPos; + this.awaitPos = oldAwaitPos || this.awaitPos; + this.awaitIdentPos = oldAwaitIdentPos || this.awaitIdentPos; + var node$1 = this.startNodeAt(startPos, startLoc); + node$1.callee = base; + node$1.arguments = exprList; + if (optionalSupported) { + node$1.optional = optional; + } + base = this.finishNode(node$1, "CallExpression"); + } else if (this.type === types.backQuote) { + if (optional || optionalChained) { + this.raise(this.start, "Optional chaining cannot appear in the tag of tagged template expressions"); } + var node$2 = this.startNodeAt(startPos, startLoc); + node$2.tag = base; + node$2.quasi = this.parseTemplate({isTagged: true}); + base = this.finishNode(node$2, "TaggedTemplateExpression"); } - return result.join(''); - } + return base + }; - _mediaTo2DArray(media) { - const canvas = this.canvas; - const width = media.width > 0 ? media.width : media.videoWidth; - const height = media.height > 0 ? media.height : media.videoHeight; - if (canvas.width < width) { - canvas.width = width; - } - if (canvas.height < height) { - canvas.height = height; - } - const ctx = this.context; - let pixelsData; - if (media.constructor === ImageData) { - pixelsData = media.data; - } else { - ctx.drawImage(media, 0, 0, width, height); - pixelsData = ctx.getImageData(0, 0, width, height).data; - } - const imageArray = new Array(height); - let index = 0; - for (let y = height - 1; y >= 0; y--) { - const row = imageArray[y] = new Array(width); - for (let x = 0; x < width; x++) { - const pixel = new Float32Array(4); - pixel[0] = pixelsData[index++] / 255; - pixel[1] = pixelsData[index++] / 255; - pixel[2] = pixelsData[index++] / 255; - pixel[3] = pixelsData[index++] / 255; - row[x] = pixel; + // Parse an atomic expression — either a single token that is an + // expression, an expression started by a keyword like `function` or + // `new`, or an expression wrapped in punctuation like `()`, `[]`, + // or `{}`. + + pp$3.parseExprAtom = function(refDestructuringErrors) { + // If a division operator appears in an expression position, the + // tokenizer got confused, and we force it to read a regexp instead. + if (this.type === types.slash) { this.readRegexp(); } + + var node, canBeArrow = this.potentialArrowAt === this.start; + switch (this.type) { + case types._super: + if (!this.allowSuper) + { this.raise(this.start, "'super' keyword outside a method"); } + node = this.startNode(); + this.next(); + if (this.type === types.parenL && !this.allowDirectSuper) + { this.raise(node.start, "super() call outside constructor of a subclass"); } + // The `super` keyword can appear at below: + // SuperProperty: + // super [ Expression ] + // super . IdentifierName + // SuperCall: + // super ( Arguments ) + if (this.type !== types.dot && this.type !== types.bracketL && this.type !== types.parenL) + { this.unexpected(); } + return this.finishNode(node, "Super") + + case types._this: + node = this.startNode(); + this.next(); + return this.finishNode(node, "ThisExpression") + + case types.name: + var startPos = this.start, startLoc = this.startLoc, containsEsc = this.containsEsc; + var id = this.parseIdent(false); + if (this.options.ecmaVersion >= 8 && !containsEsc && id.name === "async" && !this.canInsertSemicolon() && this.eat(types._function)) + { return this.parseFunction(this.startNodeAt(startPos, startLoc), 0, false, true) } + if (canBeArrow && !this.canInsertSemicolon()) { + if (this.eat(types.arrow)) + { return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], false) } + if (this.options.ecmaVersion >= 8 && id.name === "async" && this.type === types.name && !containsEsc) { + id = this.parseIdent(false); + if (this.canInsertSemicolon() || !this.eat(types.arrow)) + { this.unexpected(); } + return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], true) + } } - } - return imageArray; - } + return id + + case types.regexp: + var value = this.value; + node = this.parseLiteral(value.value); + node.regex = {pattern: value.pattern, flags: value.flags}; + return node + + case types.num: case types.string: + return this.parseLiteral(this.value) + + case types._null: case types._true: case types._false: + node = this.startNode(); + node.value = this.type === types._null ? null : this.type === types._true; + node.raw = this.type.keyword; + this.next(); + return this.finishNode(node, "Literal") + + case types.parenL: + var start = this.start, expr = this.parseParenAndDistinguishExpression(canBeArrow); + if (refDestructuringErrors) { + if (refDestructuringErrors.parenthesizedAssign < 0 && !this.isSimpleAssignTarget(expr)) + { refDestructuringErrors.parenthesizedAssign = start; } + if (refDestructuringErrors.parenthesizedBind < 0) + { refDestructuringErrors.parenthesizedBind = start; } + } + return expr - getPixels(flip) { - const [width, height] = this.output; - return flip ? utils.flipPixels(this._imageData.data, width, height) : this._imageData.data.slice(0); - } + case types.bracketL: + node = this.startNode(); + this.next(); + node.elements = this.parseExprList(types.bracketR, true, true, refDestructuringErrors); + return this.finishNode(node, "ArrayExpression") - _imageTo3DArray(images) { - const imagesArray = new Array(images.length); - for (let i = 0; i < images.length; i++) { - imagesArray[i] = this._mediaTo2DArray(images[i]); - } - return imagesArray; - } + case types.braceL: + return this.parseObj(false, refDestructuringErrors) - _resultKernelHeader() { - if (this.graphical) return ''; - if (this.immutable) return ''; - if (!this.pipeline) return ''; - switch (this.output.length) { - case 1: - return this._mutableKernel1DResults(); - case 2: - return this._mutableKernel2DResults(); - case 3: - return this._mutableKernel3DResults(); - } - } + case types._function: + node = this.startNode(); + this.next(); + return this.parseFunction(node, 0) - _resultKernelBody(kernelString) { - switch (this.output.length) { - case 1: - return (!this.immutable && this.pipeline ? this._resultMutableKernel1DLoop(kernelString) : this._resultImmutableKernel1DLoop(kernelString)) + this._kernelOutput(); - case 2: - return (!this.immutable && this.pipeline ? this._resultMutableKernel2DLoop(kernelString) : this._resultImmutableKernel2DLoop(kernelString)) + this._kernelOutput(); - case 3: - return (!this.immutable && this.pipeline ? this._resultMutableKernel3DLoop(kernelString) : this._resultImmutableKernel3DLoop(kernelString)) + this._kernelOutput(); - default: - throw new Error('unsupported size kernel'); - } - } + case types._class: + return this.parseClass(this.startNode(), false) - _graphicalKernelBody(kernelThreadString) { - switch (this.output.length) { - case 2: - return this._graphicalKernel2DLoop(kernelThreadString) + this._graphicalOutput(); - default: - throw new Error('unsupported size kernel'); + case types._new: + return this.parseNew() + + case types.backQuote: + return this.parseTemplate() + + case types._import: + if (this.options.ecmaVersion >= 11) { + return this.parseExprImport() + } else { + return this.unexpected() + } + + default: + this.unexpected(); } - } + }; - _graphicalOutput() { - return ` - this._imageData.data.set(this._colorData); - this.context.putImageData(this._imageData, 0, 0); - return;` - } + pp$3.parseExprImport = function() { + var node = this.startNode(); - _getKernelResultTypeConstructorString() { - switch (this.returnType) { - case 'LiteralInteger': - case 'Number': - case 'Integer': - case 'Float': - return 'Float32Array'; - case 'Array(2)': - case 'Array(3)': - case 'Array(4)': - return 'Array'; - default: - if (this.graphical) { - return 'Float32Array'; - } - throw new Error(`unhandled returnType ${ this.returnType }`); - } - } + // Consume `import` as an identifier for `import.meta`. + // Because `this.parseIdent(true)` doesn't check escape sequences, it needs the check of `this.containsEsc`. + if (this.containsEsc) { this.raiseRecoverable(this.start, "Escape sequence in keyword import"); } + var meta = this.parseIdent(true); - _resultImmutableKernel1DLoop(kernelString) { - const constructorString = this._getKernelResultTypeConstructorString(); - return ` const outputX = _this.output[0]; - const result = new ${constructorString}(outputX); - ${ this._mapSubKernels(subKernel => `const result_${ subKernel.name } = new ${constructorString}(outputX);\n`).join(' ') } - ${ this._mapSubKernels(subKernel => `let subKernelResult_${ subKernel.name };\n`).join(' ') } - for (let x = 0; x < outputX; x++) { - this.thread.x = x; - this.thread.y = 0; - this.thread.z = 0; - ${ kernelString } - }`; - } + switch (this.type) { + case types.parenL: + return this.parseDynamicImport(node) + case types.dot: + node.meta = meta; + return this.parseImportMeta(node) + default: + this.unexpected(); + } + }; - _mutableKernel1DResults() { - const constructorString = this._getKernelResultTypeConstructorString(); - return ` const outputX = _this.output[0]; - const result = new ${constructorString}(outputX); - ${ this._mapSubKernels(subKernel => `const result_${ subKernel.name } = new ${constructorString}(outputX);\n`).join(' ') } - ${ this._mapSubKernels(subKernel => `let subKernelResult_${ subKernel.name };\n`).join(' ') }`; - } + pp$3.parseDynamicImport = function(node) { + this.next(); // skip `(` - _resultMutableKernel1DLoop(kernelString) { - return ` const outputX = _this.output[0]; - for (let x = 0; x < outputX; x++) { - this.thread.x = x; - this.thread.y = 0; - this.thread.z = 0; - ${ kernelString } - }`; - } + // Parse node.source. + node.source = this.parseMaybeAssign(); - _resultImmutableKernel2DLoop(kernelString) { - const constructorString = this._getKernelResultTypeConstructorString(); - return ` const outputX = _this.output[0]; - const outputY = _this.output[1]; - const result = new Array(outputY); - ${ this._mapSubKernels(subKernel => `const result_${ subKernel.name } = new Array(outputY);\n`).join(' ') } - ${ this._mapSubKernels(subKernel => `let subKernelResult_${ subKernel.name };\n`).join(' ') } - for (let y = 0; y < outputY; y++) { - this.thread.z = 0; - this.thread.y = y; - const resultX = result[y] = new ${constructorString}(outputX); - ${ this._mapSubKernels(subKernel => `const resultX_${ subKernel.name } = result_${subKernel.name}[y] = new ${constructorString}(outputX);\n`).join('') } - for (let x = 0; x < outputX; x++) { - this.thread.x = x; - ${ kernelString } + // Verify ending. + if (!this.eat(types.parenR)) { + var errorPos = this.start; + if (this.eat(types.comma) && this.eat(types.parenR)) { + this.raiseRecoverable(errorPos, "Trailing comma is not allowed in import()"); + } else { + this.unexpected(errorPos); } - }`; - } + } - _mutableKernel2DResults() { - const constructorString = this._getKernelResultTypeConstructorString(); - return ` const outputX = _this.output[0]; - const outputY = _this.output[1]; - const result = new Array(outputY); - ${ this._mapSubKernels(subKernel => `const result_${ subKernel.name } = new Array(outputY);\n`).join(' ') } - ${ this._mapSubKernels(subKernel => `let subKernelResult_${ subKernel.name };\n`).join(' ') } - for (let y = 0; y < outputY; y++) { - const resultX = result[y] = new ${constructorString}(outputX); - ${ this._mapSubKernels(subKernel => `const resultX_${ subKernel.name } = result_${subKernel.name}[y] = new ${constructorString}(outputX);\n`).join('') } - }`; - } + return this.finishNode(node, "ImportExpression") + }; - _resultMutableKernel2DLoop(kernelString) { - const constructorString = this._getKernelResultTypeConstructorString(); - return ` const outputX = _this.output[0]; - const outputY = _this.output[1]; - for (let y = 0; y < outputY; y++) { - this.thread.z = 0; - this.thread.y = y; - const resultX = result[y]; - ${ this._mapSubKernels(subKernel => `const resultX_${ subKernel.name } = result_${subKernel.name}[y] = new ${constructorString}(outputX);\n`).join('') } - for (let x = 0; x < outputX; x++) { - this.thread.x = x; - ${ kernelString } - } - }`; - } + pp$3.parseImportMeta = function(node) { + this.next(); // skip `.` - _graphicalKernel2DLoop(kernelString) { - return ` const outputX = _this.output[0]; - const outputY = _this.output[1]; - for (let y = 0; y < outputY; y++) { - this.thread.z = 0; - this.thread.y = y; - for (let x = 0; x < outputX; x++) { - this.thread.x = x; - ${ kernelString } - } - }`; - } + var containsEsc = this.containsEsc; + node.property = this.parseIdent(true); - _resultImmutableKernel3DLoop(kernelString) { - const constructorString = this._getKernelResultTypeConstructorString(); - return ` const outputX = _this.output[0]; - const outputY = _this.output[1]; - const outputZ = _this.output[2]; - const result = new Array(outputZ); - ${ this._mapSubKernels(subKernel => `const result_${ subKernel.name } = new Array(outputZ);\n`).join(' ') } - ${ this._mapSubKernels(subKernel => `let subKernelResult_${ subKernel.name };\n`).join(' ') } - for (let z = 0; z < outputZ; z++) { - this.thread.z = z; - const resultY = result[z] = new Array(outputY); - ${ this._mapSubKernels(subKernel => `const resultY_${ subKernel.name } = result_${subKernel.name}[z] = new Array(outputY);\n`).join(' ') } - for (let y = 0; y < outputY; y++) { - this.thread.y = y; - const resultX = resultY[y] = new ${constructorString}(outputX); - ${ this._mapSubKernels(subKernel => `const resultX_${ subKernel.name } = resultY_${subKernel.name}[y] = new ${constructorString}(outputX);\n`).join(' ') } - for (let x = 0; x < outputX; x++) { - this.thread.x = x; - ${ kernelString } + if (node.property.name !== "meta") + { this.raiseRecoverable(node.property.start, "The only valid meta property for import is 'import.meta'"); } + if (containsEsc) + { this.raiseRecoverable(node.start, "'import.meta' must not contain escaped characters"); } + if (this.options.sourceType !== "module") + { this.raiseRecoverable(node.start, "Cannot use 'import.meta' outside a module"); } + + return this.finishNode(node, "MetaProperty") + }; + + pp$3.parseLiteral = function(value) { + var node = this.startNode(); + node.value = value; + node.raw = this.input.slice(this.start, this.end); + if (node.raw.charCodeAt(node.raw.length - 1) === 110) { node.bigint = node.raw.slice(0, -1).replace(/_/g, ""); } + this.next(); + return this.finishNode(node, "Literal") + }; + + pp$3.parseParenExpression = function() { + this.expect(types.parenL); + var val = this.parseExpression(); + this.expect(types.parenR); + return val + }; + + pp$3.parseParenAndDistinguishExpression = function(canBeArrow) { + var startPos = this.start, startLoc = this.startLoc, val, allowTrailingComma = this.options.ecmaVersion >= 8; + if (this.options.ecmaVersion >= 6) { + this.next(); + + var innerStartPos = this.start, innerStartLoc = this.startLoc; + var exprList = [], first = true, lastIsComma = false; + var refDestructuringErrors = new DestructuringErrors, oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, spreadStart; + this.yieldPos = 0; + this.awaitPos = 0; + // Do not save awaitIdentPos to allow checking awaits nested in parameters + while (this.type !== types.parenR) { + first ? first = false : this.expect(types.comma); + if (allowTrailingComma && this.afterTrailingComma(types.parenR, true)) { + lastIsComma = true; + break + } else if (this.type === types.ellipsis) { + spreadStart = this.start; + exprList.push(this.parseParenItem(this.parseRestBinding())); + if (this.type === types.comma) { this.raise(this.start, "Comma is not permitted after the rest element"); } + break + } else { + exprList.push(this.parseMaybeAssign(false, refDestructuringErrors, this.parseParenItem)); } } - }`; - } - - _mutableKernel3DResults() { - const constructorString = this._getKernelResultTypeConstructorString(); - return ` const outputX = _this.output[0]; - const outputY = _this.output[1]; - const outputZ = _this.output[2]; - const result = new Array(outputZ); - ${ this._mapSubKernels(subKernel => `const result_${ subKernel.name } = new Array(outputZ);\n`).join(' ') } - ${ this._mapSubKernels(subKernel => `let subKernelResult_${ subKernel.name };\n`).join(' ') } - for (let z = 0; z < outputZ; z++) { - const resultY = result[z] = new Array(outputY); - ${ this._mapSubKernels(subKernel => `const resultY_${ subKernel.name } = result_${subKernel.name}[z] = new Array(outputY);\n`).join(' ') } - for (let y = 0; y < outputY; y++) { - const resultX = resultY[y] = new ${constructorString}(outputX); - ${ this._mapSubKernels(subKernel => `const resultX_${ subKernel.name } = resultY_${subKernel.name}[y] = new ${constructorString}(outputX);\n`).join(' ') } + var innerEndPos = this.start, innerEndLoc = this.startLoc; + this.expect(types.parenR); + + if (canBeArrow && !this.canInsertSemicolon() && this.eat(types.arrow)) { + this.checkPatternErrors(refDestructuringErrors, false); + this.checkYieldAwaitInDefaultParams(); + this.yieldPos = oldYieldPos; + this.awaitPos = oldAwaitPos; + return this.parseParenArrowList(startPos, startLoc, exprList) } - }`; - } - _resultMutableKernel3DLoop(kernelString) { - return ` const outputX = _this.output[0]; - const outputY = _this.output[1]; - const outputZ = _this.output[2]; - for (let z = 0; z < outputZ; z++) { - this.thread.z = z; - const resultY = result[z]; - for (let y = 0; y < outputY; y++) { - this.thread.y = y; - const resultX = resultY[y]; - for (let x = 0; x < outputX; x++) { - this.thread.x = x; - ${ kernelString } - } + if (!exprList.length || lastIsComma) { this.unexpected(this.lastTokStart); } + if (spreadStart) { this.unexpected(spreadStart); } + this.checkExpressionErrors(refDestructuringErrors, true); + this.yieldPos = oldYieldPos || this.yieldPos; + this.awaitPos = oldAwaitPos || this.awaitPos; + + if (exprList.length > 1) { + val = this.startNodeAt(innerStartPos, innerStartLoc); + val.expressions = exprList; + this.finishNodeAt(val, "SequenceExpression", innerEndPos, innerEndLoc); + } else { + val = exprList[0]; } - }`; - } + } else { + val = this.parseParenExpression(); + } - _kernelOutput() { - if (!this.subKernels) { - return '\n return result;'; + if (this.options.preserveParens) { + var par = this.startNodeAt(startPos, startLoc); + par.expression = val; + return this.finishNode(par, "ParenthesizedExpression") + } else { + return val } - return `\n return { - result: result, - ${ this.subKernels.map(subKernel => `${ subKernel.property }: result_${ subKernel.name }`).join(',\n ') } - };`; - } + }; - _mapSubKernels(fn) { - return this.subKernels === null ? [''] : - this.subKernels.map(fn); - } + pp$3.parseParenItem = function(item) { + return item + }; - destroy(removeCanvasReference) { - if (removeCanvasReference) { - delete this.canvas; - } - } + pp$3.parseParenArrowList = function(startPos, startLoc, exprList) { + return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList) + }; - static destroyContext(context) {} + // New's precedence is slightly tricky. It must allow its argument to + // be a `[]` or dot subscript expression, but not a call — at least, + // not without wrapping it in parentheses. Thus, it uses the noCalls + // argument to parseSubscripts to prevent it from consuming the + // argument list. + + var empty$1 = []; + + pp$3.parseNew = function() { + if (this.containsEsc) { this.raiseRecoverable(this.start, "Escape sequence in keyword new"); } + var node = this.startNode(); + var meta = this.parseIdent(true); + if (this.options.ecmaVersion >= 6 && this.eat(types.dot)) { + node.meta = meta; + var containsEsc = this.containsEsc; + node.property = this.parseIdent(true); + if (node.property.name !== "target") + { this.raiseRecoverable(node.property.start, "The only valid meta property for new is 'new.target'"); } + if (containsEsc) + { this.raiseRecoverable(node.start, "'new.target' must not contain escaped characters"); } + if (!this.inNonArrowFunction()) + { this.raiseRecoverable(node.start, "'new.target' can only be used in functions"); } + return this.finishNode(node, "MetaProperty") + } + var startPos = this.start, startLoc = this.startLoc, isImport = this.type === types._import; + node.callee = this.parseSubscripts(this.parseExprAtom(), startPos, startLoc, true); + if (isImport && node.callee.type === "ImportExpression") { + this.raise(startPos, "Cannot use new with import()"); + } + if (this.eat(types.parenL)) { node.arguments = this.parseExprList(types.parenR, this.options.ecmaVersion >= 8, false); } + else { node.arguments = empty$1; } + return this.finishNode(node, "NewExpression") + }; - toJSON() { - const json = super.toJSON(); - json.functionNodes = FunctionBuilder.fromKernel(this, CPUFunctionNode).toJSON(); - return json; - } + // Parse template expression. - setOutput(output) { - super.setOutput(output); - const [width, height] = this.output; - if (this.graphical) { - this._imageData = this.context.createImageData(width, height); - this._colorData = new Uint8ClampedArray(width * height * 4); + pp$3.parseTemplateElement = function(ref) { + var isTagged = ref.isTagged; + + var elem = this.startNode(); + if (this.type === types.invalidTemplate) { + if (!isTagged) { + this.raiseRecoverable(this.start, "Bad escape sequence in untagged template literal"); + } + elem.value = { + raw: this.value, + cooked: null + }; + } else { + elem.value = { + raw: this.input.slice(this.start, this.end).replace(/\r\n?/g, "\n"), + cooked: this.value + }; } - } + this.next(); + elem.tail = this.type === types.backQuote; + return this.finishNode(elem, "TemplateElement") + }; - prependString(value) { - if (this._kernelString) throw new Error('Kernel already built'); - this._prependedString.push(value); - } + pp$3.parseTemplate = function(ref) { + if ( ref === void 0 ) ref = {}; + var isTagged = ref.isTagged; if ( isTagged === void 0 ) isTagged = false; + + var node = this.startNode(); + this.next(); + node.expressions = []; + var curElt = this.parseTemplateElement({isTagged: isTagged}); + node.quasis = [curElt]; + while (!curElt.tail) { + if (this.type === types.eof) { this.raise(this.pos, "Unterminated template literal"); } + this.expect(types.dollarBraceL); + node.expressions.push(this.parseExpression()); + this.expect(types.braceR); + node.quasis.push(curElt = this.parseTemplateElement({isTagged: isTagged})); + } + this.next(); + return this.finishNode(node, "TemplateLiteral") + }; - hasPrependString(value) { - return this._prependedString.indexOf(value) > -1; - } -} + pp$3.isAsyncProp = function(prop) { + return !prop.computed && prop.key.type === "Identifier" && prop.key.name === "async" && + (this.type === types.name || this.type === types.num || this.type === types.string || this.type === types.bracketL || this.type.keyword || (this.options.ecmaVersion >= 9 && this.type === types.star)) && + !lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) + }; -module.exports = { - CPUKernel -}; -},{"../../utils":113,"../function-builder":8,"../kernel":35,"./function-node":5,"./kernel-string":6}],8:[function(require,module,exports){ -class FunctionBuilder { - static fromKernel(kernel, FunctionNode, extraNodeOptions) { - const { - kernelArguments, - kernelConstants, - argumentNames, - argumentSizes, - argumentBitRatios, - constants, - constantBitRatios, - debug, - loopMaxIterations, - nativeFunctions, - output, - optimizeFloatMemory, - precision, - plugins, - source, - subKernels, - functions, - leadingReturnStatement, - followingReturnStatement, - dynamicArguments, - dynamicOutput, - } = kernel; + // Parse an object literal or binding pattern. - const argumentTypes = new Array(kernelArguments.length); - const constantTypes = {}; + pp$3.parseObj = function(isPattern, refDestructuringErrors) { + var node = this.startNode(), first = true, propHash = {}; + node.properties = []; + this.next(); + while (!this.eat(types.braceR)) { + if (!first) { + this.expect(types.comma); + if (this.options.ecmaVersion >= 5 && this.afterTrailingComma(types.braceR)) { break } + } else { first = false; } - for (let i = 0; i < kernelArguments.length; i++) { - argumentTypes[i] = kernelArguments[i].type; + var prop = this.parseProperty(isPattern, refDestructuringErrors); + if (!isPattern) { this.checkPropClash(prop, propHash, refDestructuringErrors); } + node.properties.push(prop); } + return this.finishNode(node, isPattern ? "ObjectPattern" : "ObjectExpression") + }; - for (let i = 0; i < kernelConstants.length; i++) { - const kernelConstant = kernelConstants[i]; - constantTypes[kernelConstant.name] = kernelConstant.type; + pp$3.parseProperty = function(isPattern, refDestructuringErrors) { + var prop = this.startNode(), isGenerator, isAsync, startPos, startLoc; + if (this.options.ecmaVersion >= 9 && this.eat(types.ellipsis)) { + if (isPattern) { + prop.argument = this.parseIdent(false); + if (this.type === types.comma) { + this.raise(this.start, "Comma is not permitted after the rest element"); + } + return this.finishNode(prop, "RestElement") + } + // To disallow parenthesized identifier via `this.toAssignable()`. + if (this.type === types.parenL && refDestructuringErrors) { + if (refDestructuringErrors.parenthesizedAssign < 0) { + refDestructuringErrors.parenthesizedAssign = this.start; + } + if (refDestructuringErrors.parenthesizedBind < 0) { + refDestructuringErrors.parenthesizedBind = this.start; + } + } + // Parse argument. + prop.argument = this.parseMaybeAssign(false, refDestructuringErrors); + // To disallow trailing comma via `this.toAssignable()`. + if (this.type === types.comma && refDestructuringErrors && refDestructuringErrors.trailingComma < 0) { + refDestructuringErrors.trailingComma = this.start; + } + // Finish + return this.finishNode(prop, "SpreadElement") + } + if (this.options.ecmaVersion >= 6) { + prop.method = false; + prop.shorthand = false; + if (isPattern || refDestructuringErrors) { + startPos = this.start; + startLoc = this.startLoc; + } + if (!isPattern) + { isGenerator = this.eat(types.star); } + } + var containsEsc = this.containsEsc; + this.parsePropertyName(prop); + if (!isPattern && !containsEsc && this.options.ecmaVersion >= 8 && !isGenerator && this.isAsyncProp(prop)) { + isAsync = true; + isGenerator = this.options.ecmaVersion >= 9 && this.eat(types.star); + this.parsePropertyName(prop, refDestructuringErrors); + } else { + isAsync = false; } + this.parsePropertyValue(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc); + return this.finishNode(prop, "Property") + }; - const needsArgumentType = (functionName, index) => { - return functionBuilder.needsArgumentType(functionName, index); - }; + pp$3.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc) { + if ((isGenerator || isAsync) && this.type === types.colon) + { this.unexpected(); } + + if (this.eat(types.colon)) { + prop.value = isPattern ? this.parseMaybeDefault(this.start, this.startLoc) : this.parseMaybeAssign(false, refDestructuringErrors); + prop.kind = "init"; + } else if (this.options.ecmaVersion >= 6 && this.type === types.parenL) { + if (isPattern) { this.unexpected(); } + prop.kind = "init"; + prop.method = true; + prop.value = this.parseMethod(isGenerator, isAsync); + } else if (!isPattern && !containsEsc && + this.options.ecmaVersion >= 5 && !prop.computed && prop.key.type === "Identifier" && + (prop.key.name === "get" || prop.key.name === "set") && + (this.type !== types.comma && this.type !== types.braceR && this.type !== types.eq)) { + if (isGenerator || isAsync) { this.unexpected(); } + prop.kind = prop.key.name; + this.parsePropertyName(prop); + prop.value = this.parseMethod(false); + var paramCount = prop.kind === "get" ? 0 : 1; + if (prop.value.params.length !== paramCount) { + var start = prop.value.start; + if (prop.kind === "get") + { this.raiseRecoverable(start, "getter should have no params"); } + else + { this.raiseRecoverable(start, "setter should have exactly one param"); } + } else { + if (prop.kind === "set" && prop.value.params[0].type === "RestElement") + { this.raiseRecoverable(prop.value.params[0].start, "Setter cannot use rest params"); } + } + } else if (this.options.ecmaVersion >= 6 && !prop.computed && prop.key.type === "Identifier") { + if (isGenerator || isAsync) { this.unexpected(); } + this.checkUnreserved(prop.key); + if (prop.key.name === "await" && !this.awaitIdentPos) + { this.awaitIdentPos = startPos; } + prop.kind = "init"; + if (isPattern) { + prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key); + } else if (this.type === types.eq && refDestructuringErrors) { + if (refDestructuringErrors.shorthandAssign < 0) + { refDestructuringErrors.shorthandAssign = this.start; } + prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key); + } else { + prop.value = prop.key; + } + prop.shorthand = true; + } else { this.unexpected(); } + }; - const assignArgumentType = (functionName, index, type) => { - functionBuilder.assignArgumentType(functionName, index, type); - }; + pp$3.parsePropertyName = function(prop) { + if (this.options.ecmaVersion >= 6) { + if (this.eat(types.bracketL)) { + prop.computed = true; + prop.key = this.parseMaybeAssign(); + this.expect(types.bracketR); + return prop.key + } else { + prop.computed = false; + } + } + return prop.key = this.type === types.num || this.type === types.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== "never") + }; - const lookupReturnType = (functionName, ast, requestingNode) => { - return functionBuilder.lookupReturnType(functionName, ast, requestingNode); - }; + // Initialize empty function node. - const lookupFunctionArgumentTypes = (functionName) => { - return functionBuilder.lookupFunctionArgumentTypes(functionName); - }; + pp$3.initFunction = function(node) { + node.id = null; + if (this.options.ecmaVersion >= 6) { node.generator = node.expression = false; } + if (this.options.ecmaVersion >= 8) { node.async = false; } + }; - const lookupFunctionArgumentName = (functionName, argumentIndex) => { - return functionBuilder.lookupFunctionArgumentName(functionName, argumentIndex); - }; + // Parse object or class method. - const lookupFunctionArgumentBitRatio = (functionName, argumentName) => { - return functionBuilder.lookupFunctionArgumentBitRatio(functionName, argumentName); - }; + pp$3.parseMethod = function(isGenerator, isAsync, allowDirectSuper) { + var node = this.startNode(), oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; - const triggerImplyArgumentType = (functionName, i, argumentType, requestingNode) => { - functionBuilder.assignArgumentType(functionName, i, argumentType, requestingNode); - }; + this.initFunction(node); + if (this.options.ecmaVersion >= 6) + { node.generator = isGenerator; } + if (this.options.ecmaVersion >= 8) + { node.async = !!isAsync; } - const triggerImplyArgumentBitRatio = (functionName, argumentName, calleeFunctionName, argumentIndex) => { - functionBuilder.assignArgumentBitRatio(functionName, argumentName, calleeFunctionName, argumentIndex); - }; + this.yieldPos = 0; + this.awaitPos = 0; + this.awaitIdentPos = 0; + this.enterScope(functionFlags(isAsync, node.generator) | SCOPE_SUPER | (allowDirectSuper ? SCOPE_DIRECT_SUPER : 0)); - const onFunctionCall = (functionName, calleeFunctionName, args) => { - functionBuilder.trackFunctionCall(functionName, calleeFunctionName, args); - }; + this.expect(types.parenL); + node.params = this.parseBindingList(types.parenR, false, this.options.ecmaVersion >= 8); + this.checkYieldAwaitInDefaultParams(); + this.parseFunctionBody(node, false, true); - const onNestedFunction = (ast, source) => { - const argumentNames = []; - for (let i = 0; i < ast.params.length; i++) { - argumentNames.push(ast.params[i].name); - } - const nestedFunction = new FunctionNode(source, Object.assign({}, nodeOptions, { - returnType: null, - ast, - name: ast.id.name, - argumentNames, - lookupReturnType, - lookupFunctionArgumentTypes, - lookupFunctionArgumentName, - lookupFunctionArgumentBitRatio, - needsArgumentType, - assignArgumentType, - triggerImplyArgumentType, - triggerImplyArgumentBitRatio, - onFunctionCall, - })); - nestedFunction.traceFunctionAST(ast); - functionBuilder.addFunctionNode(nestedFunction); - }; + this.yieldPos = oldYieldPos; + this.awaitPos = oldAwaitPos; + this.awaitIdentPos = oldAwaitIdentPos; + return this.finishNode(node, "FunctionExpression") + }; - const nodeOptions = Object.assign({ - isRootKernel: false, - onNestedFunction, - lookupReturnType, - lookupFunctionArgumentTypes, - lookupFunctionArgumentName, - lookupFunctionArgumentBitRatio, - needsArgumentType, - assignArgumentType, - triggerImplyArgumentType, - triggerImplyArgumentBitRatio, - onFunctionCall, - optimizeFloatMemory, - precision, - constants, - constantTypes, - constantBitRatios, - debug, - loopMaxIterations, - output, - plugins, - dynamicArguments, - dynamicOutput, - }, extraNodeOptions || {}); - - const rootNodeOptions = Object.assign({}, nodeOptions, { - isRootKernel: true, - name: 'kernel', - argumentNames, - argumentTypes, - argumentSizes, - argumentBitRatios, - leadingReturnStatement, - followingReturnStatement, - }); + // Parse arrow function expression with given parameters. - if (typeof source === 'object' && source.functionNodes) { - return new FunctionBuilder().fromJSON(source.functionNodes, FunctionNode); - } + pp$3.parseArrowExpression = function(node, params, isAsync) { + var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; - const rootNode = new FunctionNode(source, rootNodeOptions); + this.enterScope(functionFlags(isAsync, false) | SCOPE_ARROW); + this.initFunction(node); + if (this.options.ecmaVersion >= 8) { node.async = !!isAsync; } - let functionNodes = null; - if (functions) { - functionNodes = functions.map((fn) => new FunctionNode(fn.source, { - returnType: fn.returnType, - argumentTypes: fn.argumentTypes, - output, - plugins, - constants, - constantTypes, - constantBitRatios, - optimizeFloatMemory, - precision, - lookupReturnType, - lookupFunctionArgumentTypes, - lookupFunctionArgumentName, - lookupFunctionArgumentBitRatio, - needsArgumentType, - assignArgumentType, - triggerImplyArgumentType, - triggerImplyArgumentBitRatio, - onFunctionCall, - onNestedFunction, - })); - } + this.yieldPos = 0; + this.awaitPos = 0; + this.awaitIdentPos = 0; - let subKernelNodes = null; - if (subKernels) { - subKernelNodes = subKernels.map((subKernel) => { - const { name, source } = subKernel; - return new FunctionNode(source, Object.assign({}, nodeOptions, { - name, - isSubKernel: true, - isRootKernel: false, - })); - }); - } + node.params = this.toAssignableList(params, true); + this.parseFunctionBody(node, true, false); - const functionBuilder = new FunctionBuilder({ - kernel, - rootNode, - functionNodes, - nativeFunctions, - subKernelNodes - }); + this.yieldPos = oldYieldPos; + this.awaitPos = oldAwaitPos; + this.awaitIdentPos = oldAwaitIdentPos; + return this.finishNode(node, "ArrowFunctionExpression") + }; - return functionBuilder; - } + // Parse function body and check parameters. + + pp$3.parseFunctionBody = function(node, isArrowFunction, isMethod) { + var isExpression = isArrowFunction && this.type !== types.braceL; + var oldStrict = this.strict, useStrict = false; + + if (isExpression) { + node.body = this.parseMaybeAssign(); + node.expression = true; + this.checkParams(node, false); + } else { + var nonSimple = this.options.ecmaVersion >= 7 && !this.isSimpleParamList(node.params); + if (!oldStrict || nonSimple) { + useStrict = this.strictDirective(this.end); + // If this is a strict mode function, verify that argument names + // are not repeated, and it does not try to bind the words `eval` + // or `arguments`. + if (useStrict && nonSimple) + { this.raiseRecoverable(node.start, "Illegal 'use strict' directive in function with non-simple parameter list"); } + } + // Start a new scope with regard to labels and the `inFunction` + // flag (restore them to their old value afterwards). + var oldLabels = this.labels; + this.labels = []; + if (useStrict) { this.strict = true; } + + // Add the params to varDeclaredNames to ensure that an error is thrown + // if a let/const declaration in the function clashes with one of the params. + this.checkParams(node, !oldStrict && !useStrict && !isArrowFunction && !isMethod && this.isSimpleParamList(node.params)); + // Ensure the function name isn't a forbidden identifier in strict mode, e.g. 'eval' + if (this.strict && node.id) { this.checkLVal(node.id, BIND_OUTSIDE); } + node.body = this.parseBlock(false, undefined, useStrict && !oldStrict); + node.expression = false; + this.adaptDirectivePrologue(node.body.body); + this.labels = oldLabels; + } + this.exitScope(); + }; + + pp$3.isSimpleParamList = function(params) { + for (var i = 0, list = params; i < list.length; i += 1) + { + var param = list[i]; - constructor(settings) { - settings = settings || {}; - this.kernel = settings.kernel; - this.rootNode = settings.rootNode; - this.functionNodes = settings.functionNodes || []; - this.subKernelNodes = settings.subKernelNodes || []; - this.nativeFunctions = settings.nativeFunctions || []; - this.functionMap = {}; - this.nativeFunctionNames = []; - this.lookupChain = []; - this.functionNodeDependencies = {}; - this.functionCalls = {}; + if (param.type !== "Identifier") { return false + } } + return true + }; + + // Checks function params for various disallowed patterns such as using "eval" + // or "arguments" and duplicate parameters. - if (this.rootNode) { - this.functionMap['kernel'] = this.rootNode; + pp$3.checkParams = function(node, allowDuplicates) { + var nameHash = {}; + for (var i = 0, list = node.params; i < list.length; i += 1) + { + var param = list[i]; + + this.checkLVal(param, BIND_VAR, allowDuplicates ? null : nameHash); } + }; - if (this.functionNodes) { - for (let i = 0; i < this.functionNodes.length; i++) { - this.functionMap[this.functionNodes[i].name] = this.functionNodes[i]; + // Parses a comma-separated list of expressions, and returns them as + // an array. `close` is the token type that ends the list, and + // `allowEmpty` can be turned on to allow subsequent commas with + // nothing in between them to be parsed as `null` (which is needed + // for array literals). + + pp$3.parseExprList = function(close, allowTrailingComma, allowEmpty, refDestructuringErrors) { + var elts = [], first = true; + while (!this.eat(close)) { + if (!first) { + this.expect(types.comma); + if (allowTrailingComma && this.afterTrailingComma(close)) { break } + } else { first = false; } + + var elt = (void 0); + if (allowEmpty && this.type === types.comma) + { elt = null; } + else if (this.type === types.ellipsis) { + elt = this.parseSpread(refDestructuringErrors); + if (refDestructuringErrors && this.type === types.comma && refDestructuringErrors.trailingComma < 0) + { refDestructuringErrors.trailingComma = this.start; } + } else { + elt = this.parseMaybeAssign(false, refDestructuringErrors); } + elts.push(elt); } + return elts + }; - if (this.subKernelNodes) { - for (let i = 0; i < this.subKernelNodes.length; i++) { - this.functionMap[this.subKernelNodes[i].name] = this.subKernelNodes[i]; - } + pp$3.checkUnreserved = function(ref) { + var start = ref.start; + var end = ref.end; + var name = ref.name; + + if (this.inGenerator && name === "yield") + { this.raiseRecoverable(start, "Cannot use 'yield' as identifier inside a generator"); } + if (this.inAsync && name === "await") + { this.raiseRecoverable(start, "Cannot use 'await' as identifier inside an async function"); } + if (this.keywords.test(name)) + { this.raise(start, ("Unexpected keyword '" + name + "'")); } + if (this.options.ecmaVersion < 6 && + this.input.slice(start, end).indexOf("\\") !== -1) { return } + var re = this.strict ? this.reservedWordsStrict : this.reservedWords; + if (re.test(name)) { + if (!this.inAsync && name === "await") + { this.raiseRecoverable(start, "Cannot use keyword 'await' outside an async function"); } + this.raiseRecoverable(start, ("The keyword '" + name + "' is reserved")); } + }; - if (this.nativeFunctions) { - for (let i = 0; i < this.nativeFunctions.length; i++) { - const nativeFunction = this.nativeFunctions[i]; - this.nativeFunctionNames.push(nativeFunction.name); + // Parse the next token as an identifier. If `liberal` is true (used + // when parsing properties), it will also convert keywords into + // identifiers. + + pp$3.parseIdent = function(liberal, isBinding) { + var node = this.startNode(); + if (this.type === types.name) { + node.name = this.value; + } else if (this.type.keyword) { + node.name = this.type.keyword; + + // To fix https://github.com/acornjs/acorn/issues/575 + // `class` and `function` keywords push new context into this.context. + // But there is no chance to pop the context if the keyword is consumed as an identifier such as a property name. + // If the previous token is a dot, this does not apply because the context-managing code already ignored the keyword + if ((node.name === "class" || node.name === "function") && + (this.lastTokEnd !== this.lastTokStart + 1 || this.input.charCodeAt(this.lastTokStart) !== 46)) { + this.context.pop(); } + } else { + this.unexpected(); } - } - - addFunctionNode(functionNode) { - if (!functionNode.name) throw new Error('functionNode.name needs set'); - this.functionMap[functionNode.name] = functionNode; - if (functionNode.isRootKernel) { - this.rootNode = functionNode; + this.next(!!liberal); + this.finishNode(node, "Identifier"); + if (!liberal) { + this.checkUnreserved(node); + if (node.name === "await" && !this.awaitIdentPos) + { this.awaitIdentPos = node.start; } } - } + return node + }; - traceFunctionCalls(functionName, retList) { - functionName = functionName || 'kernel'; - retList = retList || []; + // Parses yield expression inside generator. - if (this.nativeFunctionNames.indexOf(functionName) > -1) { - const nativeFunctionIndex = retList.indexOf(functionName); - if (nativeFunctionIndex === -1) { - retList.push(functionName); - } else { - const dependantNativeFunctionName = retList.splice(nativeFunctionIndex, 1)[0]; - retList.push(dependantNativeFunctionName); - } - return retList; - } + pp$3.parseYield = function(noIn) { + if (!this.yieldPos) { this.yieldPos = this.start; } - const functionNode = this.functionMap[functionName]; - if (functionNode) { - const functionIndex = retList.indexOf(functionName); - if (functionIndex === -1) { - retList.push(functionName); - functionNode.toString(); - for (let i = 0; i < functionNode.calledFunctions.length; ++i) { - this.traceFunctionCalls(functionNode.calledFunctions[i], retList); - } - } else { - const dependantFunctionName = retList.splice(functionIndex, 1)[0]; - retList.push(dependantFunctionName); - } + var node = this.startNode(); + this.next(); + if (this.type === types.semi || this.canInsertSemicolon() || (this.type !== types.star && !this.type.startsExpr)) { + node.delegate = false; + node.argument = null; + } else { + node.delegate = this.eat(types.star); + node.argument = this.parseMaybeAssign(noIn); } + return this.finishNode(node, "YieldExpression") + }; - return retList; - } + pp$3.parseAwait = function() { + if (!this.awaitPos) { this.awaitPos = this.start; } - getPrototypeString(functionName) { - return this.getPrototypes(functionName).join('\n'); - } + var node = this.startNode(); + this.next(); + node.argument = this.parseMaybeUnary(null, false); + return this.finishNode(node, "AwaitExpression") + }; - getPrototypes(functionName) { - if (this.rootNode) { - this.rootNode.toString(); - } - if (functionName) { - return this.getPrototypesFromFunctionNames(this.traceFunctionCalls(functionName, []).reverse()); + var pp$4 = Parser.prototype; + + // This function is used to raise exceptions on parse errors. It + // takes an offset integer (into the current `input`) to indicate + // the location of the error, attaches the position to the end + // of the error message, and then raises a `SyntaxError` with that + // message. + + pp$4.raise = function(pos, message) { + var loc = getLineInfo(this.input, pos); + message += " (" + loc.line + ":" + loc.column + ")"; + var err = new SyntaxError(message); + err.pos = pos; err.loc = loc; err.raisedAt = this.pos; + throw err + }; + + pp$4.raiseRecoverable = pp$4.raise; + + pp$4.curPosition = function() { + if (this.options.locations) { + return new Position(this.curLine, this.pos - this.lineStart) } - return this.getPrototypesFromFunctionNames(Object.keys(this.functionMap)); - } + }; + + var pp$5 = Parser.prototype; + + var Scope = function Scope(flags) { + this.flags = flags; + // A list of var-declared names in the current lexical scope + this.var = []; + // A list of lexically-declared names in the current lexical scope + this.lexical = []; + // A list of lexically-declared FunctionDeclaration names in the current lexical scope + this.functions = []; + }; + + // The functions in this module keep track of declared variables in the current scope in order to detect duplicate variable names. + + pp$5.enterScope = function(flags) { + this.scopeStack.push(new Scope(flags)); + }; + + pp$5.exitScope = function() { + this.scopeStack.pop(); + }; + + // The spec says: + // > At the top level of a function, or script, function declarations are + // > treated like var declarations rather than like lexical declarations. + pp$5.treatFunctionsAsVarInScope = function(scope) { + return (scope.flags & SCOPE_FUNCTION) || !this.inModule && (scope.flags & SCOPE_TOP) + }; - getStringFromFunctionNames(functionList) { - const ret = []; - for (let i = 0; i < functionList.length; ++i) { - const node = this.functionMap[functionList[i]]; - if (node) { - ret.push(this.functionMap[functionList[i]].toString()); + pp$5.declareName = function(name, bindingType, pos) { + var redeclared = false; + if (bindingType === BIND_LEXICAL) { + var scope = this.currentScope(); + redeclared = scope.lexical.indexOf(name) > -1 || scope.functions.indexOf(name) > -1 || scope.var.indexOf(name) > -1; + scope.lexical.push(name); + if (this.inModule && (scope.flags & SCOPE_TOP)) + { delete this.undefinedExports[name]; } + } else if (bindingType === BIND_SIMPLE_CATCH) { + var scope$1 = this.currentScope(); + scope$1.lexical.push(name); + } else if (bindingType === BIND_FUNCTION) { + var scope$2 = this.currentScope(); + if (this.treatFunctionsAsVar) + { redeclared = scope$2.lexical.indexOf(name) > -1; } + else + { redeclared = scope$2.lexical.indexOf(name) > -1 || scope$2.var.indexOf(name) > -1; } + scope$2.functions.push(name); + } else { + for (var i = this.scopeStack.length - 1; i >= 0; --i) { + var scope$3 = this.scopeStack[i]; + if (scope$3.lexical.indexOf(name) > -1 && !((scope$3.flags & SCOPE_SIMPLE_CATCH) && scope$3.lexical[0] === name) || + !this.treatFunctionsAsVarInScope(scope$3) && scope$3.functions.indexOf(name) > -1) { + redeclared = true; + break + } + scope$3.var.push(name); + if (this.inModule && (scope$3.flags & SCOPE_TOP)) + { delete this.undefinedExports[name]; } + if (scope$3.flags & SCOPE_VAR) { break } } } - return ret.join('\n'); - } + if (redeclared) { this.raiseRecoverable(pos, ("Identifier '" + name + "' has already been declared")); } + }; - getPrototypesFromFunctionNames(functionList) { - const ret = []; - for (let i = 0; i < functionList.length; ++i) { - const functionName = functionList[i]; - const functionIndex = this.nativeFunctionNames.indexOf(functionName); - if (functionIndex > -1) { - ret.push(this.nativeFunctions[functionIndex].source); - continue; - } - const node = this.functionMap[functionName]; - if (node) { - ret.push(node.toString()); - } + pp$5.checkLocalExport = function(id) { + // scope.functions must be empty as Module code is always strict. + if (this.scopeStack[0].lexical.indexOf(id.name) === -1 && + this.scopeStack[0].var.indexOf(id.name) === -1) { + this.undefinedExports[id.name] = id; } - return ret; - } + }; - toJSON() { - return this.traceFunctionCalls(this.rootNode.name).reverse().map(name => { - const nativeIndex = this.nativeFunctions.indexOf(name); - if (nativeIndex > -1) { - return { - name, - source: this.nativeFunctions[nativeIndex].source - }; - } else if (this.functionMap[name]) { - return this.functionMap[name].toJSON(); - } else { - throw new Error(`function ${ name } not found`); - } - }); - } + pp$5.currentScope = function() { + return this.scopeStack[this.scopeStack.length - 1] + }; - fromJSON(jsonFunctionNodes, FunctionNode) { - this.functionMap = {}; - for (let i = 0; i < jsonFunctionNodes.length; i++) { - const jsonFunctionNode = jsonFunctionNodes[i]; - this.functionMap[jsonFunctionNode.settings.name] = new FunctionNode(jsonFunctionNode.ast, jsonFunctionNode.settings); + pp$5.currentVarScope = function() { + for (var i = this.scopeStack.length - 1;; i--) { + var scope = this.scopeStack[i]; + if (scope.flags & SCOPE_VAR) { return scope } } - return this; - } + }; - getString(functionName) { - if (functionName) { - return this.getStringFromFunctionNames(this.traceFunctionCalls(functionName).reverse()); + // Could be useful for `this`, `new.target`, `super()`, `super.property`, and `super[property]`. + pp$5.currentThisScope = function() { + for (var i = this.scopeStack.length - 1;; i--) { + var scope = this.scopeStack[i]; + if (scope.flags & SCOPE_VAR && !(scope.flags & SCOPE_ARROW)) { return scope } } - return this.getStringFromFunctionNames(Object.keys(this.functionMap)); - } + }; - lookupReturnType(functionName, ast, requestingNode) { - if (ast.type !== 'CallExpression') { - throw new Error(`expected ast type of "CallExpression", but is ${ ast.type }`); - } - if (this._isNativeFunction(functionName)) { - return this._lookupNativeFunctionReturnType(functionName); - } else if (this._isFunction(functionName)) { - const node = this._getFunction(functionName); - if (node.returnType) { - return node.returnType; - } else { - for (let i = 0; i < this.lookupChain.length; i++) { - if (this.lookupChain[i].ast === ast) { - if (node.argumentTypes.length === 0 && ast.arguments.length > 0) { - const args = ast.arguments; - for (let j = 0; j < args.length; j++) { - this.lookupChain.push({ - name: requestingNode.name, - ast: args[i], - requestingNode - }); - node.argumentTypes[j] = requestingNode.getType(args[j]); - this.lookupChain.pop(); - } - return node.returnType = node.getType(node.getJsAST()); - } + var Node = function Node(parser, pos, loc) { + this.type = ""; + this.start = pos; + this.end = 0; + if (parser.options.locations) + { this.loc = new SourceLocation(parser, loc); } + if (parser.options.directSourceFile) + { this.sourceFile = parser.options.directSourceFile; } + if (parser.options.ranges) + { this.range = [pos, 0]; } + }; - throw new Error('circlical logic detected!'); - } - } - this.lookupChain.push({ - name: requestingNode.name, - ast, - requestingNode - }); - const type = node.getType(node.getJsAST()); - this.lookupChain.pop(); - return node.returnType = type; - } - } + // Start an AST node, attaching a start offset. - return null; - } + var pp$6 = Parser.prototype; - _getFunction(functionName) { - if (!this._isFunction(functionName)) { - new Error(`Function ${functionName} not found`); - } - return this.functionMap[functionName]; - } + pp$6.startNode = function() { + return new Node(this, this.start, this.startLoc) + }; - _isFunction(functionName) { - return Boolean(this.functionMap[functionName]); - } + pp$6.startNodeAt = function(pos, loc) { + return new Node(this, pos, loc) + }; - _getNativeFunction(functionName) { - for (let i = 0; i < this.nativeFunctions.length; i++) { - if (this.nativeFunctions[i].name === functionName) return this.nativeFunctions[i]; - } - return null; - } + // Finish an AST node, adding `type` and `end` properties. - _isNativeFunction(functionName) { - return Boolean(this._getNativeFunction(functionName)); + function finishNodeAt(node, type, pos, loc) { + node.type = type; + node.end = pos; + if (this.options.locations) + { node.loc.end = loc; } + if (this.options.ranges) + { node.range[1] = pos; } + return node } - _lookupNativeFunctionReturnType(functionName) { - let nativeFunction = this._getNativeFunction(functionName); - if (nativeFunction) { - return nativeFunction.returnType; - } - throw new Error(`Native function ${ functionName } not found`); - } + pp$6.finishNode = function(node, type) { + return finishNodeAt.call(this, node, type, this.lastTokEnd, this.lastTokEndLoc) + }; - lookupFunctionArgumentTypes(functionName) { - if (this._isNativeFunction(functionName)) { - return this._getNativeFunction(functionName).argumentTypes; - } else if (this._isFunction(functionName)) { - return this._getFunction(functionName).argumentTypes; - } - return null; - } + // Finish node at given position - lookupFunctionArgumentName(functionName, argumentIndex) { - return this._getFunction(functionName).argumentNames[argumentIndex]; - } + pp$6.finishNodeAt = function(node, type, pos, loc) { + return finishNodeAt.call(this, node, type, pos, loc) + }; - lookupFunctionArgumentBitRatio(functionName, argumentName) { - if (!this._isFunction(functionName)) { - throw new Error('function not found'); - } - if (this.rootNode.name === functionName) { - const i = this.rootNode.argumentNames.indexOf(argumentName); - if (i !== -1) { - return this.rootNode.argumentBitRatios[i]; - } - } - const node = this._getFunction(functionName); - const i = node.argumentNames.indexOf(argumentName); - if (i === -1) { - throw new Error('argument not found'); - } - const bitRatio = node.argumentBitRatios[i]; - if (typeof bitRatio !== 'number') { - throw new Error('argument bit ratio not found'); - } - return bitRatio; - } + // The algorithm used to determine whether a regexp can appear at a - needsArgumentType(functionName, i) { - if (!this._isFunction(functionName)) return false; - const fnNode = this._getFunction(functionName); - return !fnNode.argumentTypes[i]; - } + var TokContext = function TokContext(token, isExpr, preserveSpace, override, generator) { + this.token = token; + this.isExpr = !!isExpr; + this.preserveSpace = !!preserveSpace; + this.override = override; + this.generator = !!generator; + }; - assignArgumentType(functionName, i, argumentType, requestingNode) { - if (!this._isFunction(functionName)) return; - const fnNode = this._getFunction(functionName); - if (!fnNode.argumentTypes[i]) { - fnNode.argumentTypes[i] = argumentType; - } - } + var types$1 = { + b_stat: new TokContext("{", false), + b_expr: new TokContext("{", true), + b_tmpl: new TokContext("${", false), + p_stat: new TokContext("(", false), + p_expr: new TokContext("(", true), + q_tmpl: new TokContext("`", true, true, function (p) { return p.tryReadTemplateToken(); }), + f_stat: new TokContext("function", false), + f_expr: new TokContext("function", true), + f_expr_gen: new TokContext("function", true, false, null, true), + f_gen: new TokContext("function", false, false, null, true) + }; - assignArgumentBitRatio(functionName, argumentName, calleeFunctionName, argumentIndex) { - const node = this._getFunction(functionName); - if (this._isNativeFunction(calleeFunctionName)) return null; - const calleeNode = this._getFunction(calleeFunctionName); - const i = node.argumentNames.indexOf(argumentName); - if (i === -1) { - throw new Error(`Argument ${argumentName} not found in arguments from function ${functionName}`); - } - const bitRatio = node.argumentBitRatios[i]; - if (typeof bitRatio !== 'number') { - throw new Error(`Bit ratio for argument ${argumentName} not found in function ${functionName}`); + var pp$7 = Parser.prototype; + + pp$7.initialContext = function() { + return [types$1.b_stat] + }; + + pp$7.braceIsBlock = function(prevType) { + var parent = this.curContext(); + if (parent === types$1.f_expr || parent === types$1.f_stat) + { return true } + if (prevType === types.colon && (parent === types$1.b_stat || parent === types$1.b_expr)) + { return !parent.isExpr } + + // The check for `tt.name && exprAllowed` detects whether we are + // after a `yield` or `of` construct. See the `updateContext` for + // `tt.name`. + if (prevType === types._return || prevType === types.name && this.exprAllowed) + { return lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) } + if (prevType === types._else || prevType === types.semi || prevType === types.eof || prevType === types.parenR || prevType === types.arrow) + { return true } + if (prevType === types.braceL) + { return parent === types$1.b_stat } + if (prevType === types._var || prevType === types._const || prevType === types.name) + { return false } + return !this.exprAllowed + }; + + pp$7.inGeneratorContext = function() { + for (var i = this.context.length - 1; i >= 1; i--) { + var context = this.context[i]; + if (context.token === "function") + { return context.generator } } - if (!calleeNode.argumentBitRatios) { - calleeNode.argumentBitRatios = new Array(calleeNode.argumentNames.length); + return false + }; + + pp$7.updateContext = function(prevType) { + var update, type = this.type; + if (type.keyword && prevType === types.dot) + { this.exprAllowed = false; } + else if (update = type.updateContext) + { update.call(this, prevType); } + else + { this.exprAllowed = type.beforeExpr; } + }; + + // Token-specific context update code + + types.parenR.updateContext = types.braceR.updateContext = function() { + if (this.context.length === 1) { + this.exprAllowed = true; + return } - const calleeBitRatio = calleeNode.argumentBitRatios[i]; - if (typeof calleeBitRatio === 'number') { - if (calleeBitRatio !== bitRatio) { - throw new Error(`Incompatible bit ratio found at function ${functionName} at argument ${argumentName}`); - } - return calleeBitRatio; + var out = this.context.pop(); + if (out === types$1.b_stat && this.curContext().token === "function") { + out = this.context.pop(); } - calleeNode.argumentBitRatios[i] = bitRatio; - return bitRatio; - } + this.exprAllowed = !out.isExpr; + }; - trackFunctionCall(functionName, calleeFunctionName, args) { - if (!this.functionNodeDependencies[functionName]) { - this.functionNodeDependencies[functionName] = new Set(); - this.functionCalls[functionName] = []; - } - this.functionNodeDependencies[functionName].add(calleeFunctionName); - this.functionCalls[functionName].push(args); - } + types.braceL.updateContext = function(prevType) { + this.context.push(this.braceIsBlock(prevType) ? types$1.b_stat : types$1.b_expr); + this.exprAllowed = true; + }; - getKernelResultType() { - return this.rootNode.returnType || this.rootNode.getType(this.rootNode.ast); - } + types.dollarBraceL.updateContext = function() { + this.context.push(types$1.b_tmpl); + this.exprAllowed = true; + }; - getSubKernelResultType(index) { - const subKernelNode = this.subKernelNodes[index]; - let called = false; - for (let functionCallIndex = 0; functionCallIndex < this.rootNode.functionCalls.length; functionCallIndex++) { - const functionCall = this.rootNode.functionCalls[functionCallIndex]; - if (functionCall.ast.callee.name === subKernelNode.name) { - called = true; - } - } - if (!called) { - throw new Error(`SubKernel ${ subKernelNode.name } never called by kernel`); + types.parenL.updateContext = function(prevType) { + var statementParens = prevType === types._if || prevType === types._for || prevType === types._with || prevType === types._while; + this.context.push(statementParens ? types$1.p_stat : types$1.p_expr); + this.exprAllowed = true; + }; + + types.incDec.updateContext = function() { + // tokExprAllowed stays unchanged + }; + + types._function.updateContext = types._class.updateContext = function(prevType) { + if (prevType.beforeExpr && prevType !== types.semi && prevType !== types._else && + !(prevType === types._return && lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) && + !((prevType === types.colon || prevType === types.braceL) && this.curContext() === types$1.b_stat)) + { this.context.push(types$1.f_expr); } + else + { this.context.push(types$1.f_stat); } + this.exprAllowed = false; + }; + + types.backQuote.updateContext = function() { + if (this.curContext() === types$1.q_tmpl) + { this.context.pop(); } + else + { this.context.push(types$1.q_tmpl); } + this.exprAllowed = false; + }; + + types.star.updateContext = function(prevType) { + if (prevType === types._function) { + var index = this.context.length - 1; + if (this.context[index] === types$1.f_expr) + { this.context[index] = types$1.f_expr_gen; } + else + { this.context[index] = types$1.f_gen; } } - return subKernelNode.returnType || subKernelNode.getType(subKernelNode.getJsAST()); - } + this.exprAllowed = true; + }; - getReturnTypes() { - const result = { - [this.rootNode.name]: this.rootNode.getType(this.rootNode.ast), - }; - const list = this.traceFunctionCalls(this.rootNode.name); - for (let i = 0; i < list.length; i++) { - const functionName = list[i]; - const functionNode = this.functionMap[functionName]; - result[functionName] = functionNode.getType(functionNode.ast); + types.name.updateContext = function(prevType) { + var allowed = false; + if (this.options.ecmaVersion >= 6 && prevType !== types.dot) { + if (this.value === "of" && !this.exprAllowed || + this.value === "yield" && this.inGeneratorContext()) + { allowed = true; } } - return result; - } -} + this.exprAllowed = allowed; + }; -module.exports = { - FunctionBuilder -}; -},{}],9:[function(require,module,exports){ -const acorn = require('acorn'); -const { utils } = require('../utils'); -const { FunctionTracer } = require('./function-tracer'); - -class FunctionNode { - constructor(source, settings) { - if (!source && !settings.ast) { - throw new Error('source parameter is missing'); - } - settings = settings || {}; - this.source = source; - this.ast = null; - this.name = typeof source === 'string' ? settings.isRootKernel ? - 'kernel' : - (settings.name || utils.getFunctionNameFromString(source)) : null; - this.calledFunctions = []; - this.constants = {}; - this.constantTypes = {}; - this.constantBitRatios = {}; - this.isRootKernel = false; - this.isSubKernel = false; - this.debug = null; - this.functions = null; - this.identifiers = null; - this.contexts = null; - this.functionCalls = null; - this.states = []; - this.needsArgumentType = null; - this.assignArgumentType = null; - this.lookupReturnType = null; - this.lookupFunctionArgumentTypes = null; - this.lookupFunctionArgumentBitRatio = null; - this.triggerImplyArgumentType = null; - this.triggerImplyArgumentBitRatio = null; - this.onNestedFunction = null; - this.onFunctionCall = null; - this.optimizeFloatMemory = null; - this.precision = null; - this.loopMaxIterations = null; - this.argumentNames = (typeof this.source === 'string' ? utils.getArgumentNamesFromString(this.source) : null); - this.argumentTypes = []; - this.argumentSizes = []; - this.argumentBitRatios = null; - this.returnType = null; - this.output = []; - this.plugins = null; - this.leadingReturnStatement = null; - this.followingReturnStatement = null; - this.dynamicOutput = null; - this.dynamicArguments = null; - this.strictTypingChecking = false; - this.fixIntegerDivisionAccuracy = null; - - if (settings) { - for (const p in settings) { - if (!settings.hasOwnProperty(p)) continue; - if (!this.hasOwnProperty(p)) continue; - this[p] = settings[p]; + // This file contains Unicode properties extracted from the ECMAScript + // specification. The lists are extracted like so: + // $$('#table-binary-unicode-properties > figure > table > tbody > tr > td:nth-child(1) code').map(el => el.innerText) + + // #table-binary-unicode-properties + var ecma9BinaryProperties = "ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS"; + var ecma10BinaryProperties = ecma9BinaryProperties + " Extended_Pictographic"; + var ecma11BinaryProperties = ecma10BinaryProperties; + var unicodeBinaryProperties = { + 9: ecma9BinaryProperties, + 10: ecma10BinaryProperties, + 11: ecma11BinaryProperties + }; + + // #table-unicode-general-category-values + var unicodeGeneralCategoryValues = "Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu"; + + // #table-unicode-script-values + var ecma9ScriptValues = "Adlam Adlm Ahom Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb"; + var ecma10ScriptValues = ecma9ScriptValues + " Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd"; + var ecma11ScriptValues = ecma10ScriptValues + " Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho"; + var unicodeScriptValues = { + 9: ecma9ScriptValues, + 10: ecma10ScriptValues, + 11: ecma11ScriptValues + }; + + var data = {}; + function buildUnicodeData(ecmaVersion) { + var d = data[ecmaVersion] = { + binary: wordsRegexp(unicodeBinaryProperties[ecmaVersion] + " " + unicodeGeneralCategoryValues), + nonBinary: { + General_Category: wordsRegexp(unicodeGeneralCategoryValues), + Script: wordsRegexp(unicodeScriptValues[ecmaVersion]) } - } + }; + d.nonBinary.Script_Extensions = d.nonBinary.Script; + + d.nonBinary.gc = d.nonBinary.General_Category; + d.nonBinary.sc = d.nonBinary.Script; + d.nonBinary.scx = d.nonBinary.Script_Extensions; + } + buildUnicodeData(9); + buildUnicodeData(10); + buildUnicodeData(11); + + var pp$8 = Parser.prototype; + + var RegExpValidationState = function RegExpValidationState(parser) { + this.parser = parser; + this.validFlags = "gim" + (parser.options.ecmaVersion >= 6 ? "uy" : "") + (parser.options.ecmaVersion >= 9 ? "s" : ""); + this.unicodeProperties = data[parser.options.ecmaVersion >= 11 ? 11 : parser.options.ecmaVersion]; + this.source = ""; + this.flags = ""; + this.start = 0; + this.switchU = false; + this.switchN = false; + this.pos = 0; + this.lastIntValue = 0; + this.lastStringValue = ""; + this.lastAssertionIsQuantifiable = false; + this.numCapturingParens = 0; + this.maxBackReference = 0; + this.groupNames = []; + this.backReferenceNames = []; + }; + + RegExpValidationState.prototype.reset = function reset (start, pattern, flags) { + var unicode = flags.indexOf("u") !== -1; + this.start = start | 0; + this.source = pattern + ""; + this.flags = flags; + this.switchU = unicode && this.parser.options.ecmaVersion >= 6; + this.switchN = unicode && this.parser.options.ecmaVersion >= 9; + }; - this.literalTypes = {}; + RegExpValidationState.prototype.raise = function raise (message) { + this.parser.raiseRecoverable(this.start, ("Invalid regular expression: /" + (this.source) + "/: " + message)); + }; - this.validate(); - this._string = null; - this._internalVariableNames = {}; - } + // If u flag is given, this returns the code point at the index (it combines a surrogate pair). + // Otherwise, this returns the code unit of the index (can be a part of a surrogate pair). + RegExpValidationState.prototype.at = function at (i, forceU) { + if ( forceU === void 0 ) forceU = false; - validate() { - if (typeof this.source !== 'string' && !this.ast) { - throw new Error('this.source not a string'); + var s = this.source; + var l = s.length; + if (i >= l) { + return -1 } - - if (!this.ast && !utils.isFunctionString(this.source)) { - throw new Error('this.source not a function string'); + var c = s.charCodeAt(i); + if (!(forceU || this.switchU) || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l) { + return c } + var next = s.charCodeAt(i + 1); + return next >= 0xDC00 && next <= 0xDFFF ? (c << 10) + next - 0x35FDC00 : c + }; - if (!this.name) { - throw new Error('this.name could not be set'); - } + RegExpValidationState.prototype.nextIndex = function nextIndex (i, forceU) { + if ( forceU === void 0 ) forceU = false; - if (this.argumentTypes.length > 0 && this.argumentTypes.length !== this.argumentNames.length) { - throw new Error(`argumentTypes count of ${ this.argumentTypes.length } exceeds ${ this.argumentNames.length }`); + var s = this.source; + var l = s.length; + if (i >= l) { + return l } - - if (this.output.length < 1) { - throw new Error('this.output is not big enough'); + var c = s.charCodeAt(i), next; + if (!(forceU || this.switchU) || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l || + (next = s.charCodeAt(i + 1)) < 0xDC00 || next > 0xDFFF) { + return i + 1 } - } + return i + 2 + }; - isIdentifierConstant(name) { - if (!this.constants) return false; - return this.constants.hasOwnProperty(name); - } + RegExpValidationState.prototype.current = function current (forceU) { + if ( forceU === void 0 ) forceU = false; - isInput(argumentName) { - return this.argumentTypes[this.argumentNames.indexOf(argumentName)] === 'Input'; - } + return this.at(this.pos, forceU) + }; - pushState(state) { - this.states.push(state); - } + RegExpValidationState.prototype.lookahead = function lookahead (forceU) { + if ( forceU === void 0 ) forceU = false; - popState(state) { - if (this.state !== state) { - throw new Error(`Cannot popState ${ state } when in ${ this.state }`); - } - this.states.pop(); - } + return this.at(this.nextIndex(this.pos, forceU), forceU) + }; - isState(state) { - return this.state === state; - } + RegExpValidationState.prototype.advance = function advance (forceU) { + if ( forceU === void 0 ) forceU = false; - get state() { - return this.states[this.states.length - 1]; - } + this.pos = this.nextIndex(this.pos, forceU); + }; + + RegExpValidationState.prototype.eat = function eat (ch, forceU) { + if ( forceU === void 0 ) forceU = false; - astMemberExpressionUnroll(ast) { - if (ast.type === 'Identifier') { - return ast.name; - } else if (ast.type === 'ThisExpression') { - return 'this'; + if (this.current(forceU) === ch) { + this.advance(forceU); + return true } + return false + }; - if (ast.type === 'MemberExpression') { - if (ast.object && ast.property) { - if (ast.object.hasOwnProperty('name') && ast.object.name !== 'Math') { - return this.astMemberExpressionUnroll(ast.property); - } + function codePointToString(ch) { + if (ch <= 0xFFFF) { return String.fromCharCode(ch) } + ch -= 0x10000; + return String.fromCharCode((ch >> 10) + 0xD800, (ch & 0x03FF) + 0xDC00) + } + + /** + * Validate the flags part of a given RegExpLiteral. + * + * @param {RegExpValidationState} state The state to validate RegExp. + * @returns {void} + */ + pp$8.validateRegExpFlags = function(state) { + var validFlags = state.validFlags; + var flags = state.flags; + + for (var i = 0; i < flags.length; i++) { + var flag = flags.charAt(i); + if (validFlags.indexOf(flag) === -1) { + this.raise(state.start, "Invalid regular expression flag"); + } + if (flags.indexOf(flag, i + 1) > -1) { + this.raise(state.start, "Duplicate regular expression flag"); + } + } + }; - return ( - this.astMemberExpressionUnroll(ast.object) + - '.' + - this.astMemberExpressionUnroll(ast.property) - ); + /** + * Validate the pattern part of a given RegExpLiteral. + * + * @param {RegExpValidationState} state The state to validate RegExp. + * @returns {void} + */ + pp$8.validateRegExpPattern = function(state) { + this.regexp_pattern(state); + + // The goal symbol for the parse is |Pattern[~U, ~N]|. If the result of + // parsing contains a |GroupName|, reparse with the goal symbol + // |Pattern[~U, +N]| and use this result instead. Throw a *SyntaxError* + // exception if _P_ did not conform to the grammar, if any elements of _P_ + // were not matched by the parse, or if any Early Error conditions exist. + if (!state.switchN && this.options.ecmaVersion >= 9 && state.groupNames.length > 0) { + state.switchN = true; + this.regexp_pattern(state); + } + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-Pattern + pp$8.regexp_pattern = function(state) { + state.pos = 0; + state.lastIntValue = 0; + state.lastStringValue = ""; + state.lastAssertionIsQuantifiable = false; + state.numCapturingParens = 0; + state.maxBackReference = 0; + state.groupNames.length = 0; + state.backReferenceNames.length = 0; + + this.regexp_disjunction(state); + + if (state.pos !== state.source.length) { + // Make the same messages as V8. + if (state.eat(0x29 /* ) */)) { + state.raise("Unmatched ')'"); } + if (state.eat(0x5D /* ] */) || state.eat(0x7D /* } */)) { + state.raise("Lone quantifier brackets"); + } + } + if (state.maxBackReference > state.numCapturingParens) { + state.raise("Invalid escape"); } + for (var i = 0, list = state.backReferenceNames; i < list.length; i += 1) { + var name = list[i]; - if (ast.hasOwnProperty('expressions')) { - const firstExpression = ast.expressions[0]; - if (firstExpression.type === 'Literal' && firstExpression.value === 0 && ast.expressions.length === 2) { - return this.astMemberExpressionUnroll(ast.expressions[1]); + if (state.groupNames.indexOf(name) === -1) { + state.raise("Invalid named capture referenced"); } } + }; - throw this.astErrorOutput('Unknown astMemberExpressionUnroll', ast); - } + // https://www.ecma-international.org/ecma-262/8.0/#prod-Disjunction + pp$8.regexp_disjunction = function(state) { + this.regexp_alternative(state); + while (state.eat(0x7C /* | */)) { + this.regexp_alternative(state); + } - getJsAST(inParser) { - if (this.ast) { - return this.ast; + // Make the same message as V8. + if (this.regexp_eatQuantifier(state, true)) { + state.raise("Nothing to repeat"); } - if (typeof this.source === 'object') { - this.traceFunctionAST(this.source); - return this.ast = this.source; + if (state.eat(0x7B /* { */)) { + state.raise("Lone quantifier brackets"); } + }; - inParser = inParser || acorn; - if (inParser === null) { - throw new Error('Missing JS to AST parser'); - } + // https://www.ecma-international.org/ecma-262/8.0/#prod-Alternative + pp$8.regexp_alternative = function(state) { + while (state.pos < state.source.length && this.regexp_eatTerm(state)) + { } + }; - const ast = Object.freeze(inParser.parse(`const parser_${ this.name } = ${ this.source };`, { - locations: true - })); - const functionAST = ast.body[0].declarations[0].init; - this.traceFunctionAST(functionAST); + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Term + pp$8.regexp_eatTerm = function(state) { + if (this.regexp_eatAssertion(state)) { + // Handle `QuantifiableAssertion Quantifier` alternative. + // `state.lastAssertionIsQuantifiable` is true if the last eaten Assertion + // is a QuantifiableAssertion. + if (state.lastAssertionIsQuantifiable && this.regexp_eatQuantifier(state)) { + // Make the same message as V8. + if (state.switchU) { + state.raise("Invalid quantifier"); + } + } + return true + } - if (!ast) { - throw new Error('Failed to parse JS code'); + if (state.switchU ? this.regexp_eatAtom(state) : this.regexp_eatExtendedAtom(state)) { + this.regexp_eatQuantifier(state); + return true } - return this.ast = functionAST; - } + return false + }; - traceFunctionAST(ast) { - const { contexts, declarations, functions, identifiers, functionCalls } = new FunctionTracer(ast); - this.contexts = contexts; - this.identifiers = identifiers; - this.functionCalls = functionCalls; - this.functions = functions; - for (let i = 0; i < declarations.length; i++) { - const declaration = declarations[i]; - const { ast, inForLoopInit, inForLoopTest } = declaration; - const { init } = ast; - const dependencies = this.getDependencies(init); - let valueType = null; + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Assertion + pp$8.regexp_eatAssertion = function(state) { + var start = state.pos; + state.lastAssertionIsQuantifiable = false; - if (inForLoopInit && inForLoopTest) { - valueType = 'Integer'; - } else { - if (init) { - const realType = this.getType(init); - switch (realType) { - case 'Integer': - case 'Float': - case 'Number': - if (init.type === 'MemberExpression') { - valueType = realType; - } else { - valueType = 'Number'; - } - break; - case 'LiteralInteger': - valueType = 'Number'; - break; - default: - valueType = realType; - } + // ^, $ + if (state.eat(0x5E /* ^ */) || state.eat(0x24 /* $ */)) { + return true + } + + // \b \B + if (state.eat(0x5C /* \ */)) { + if (state.eat(0x42 /* B */) || state.eat(0x62 /* b */)) { + return true + } + state.pos = start; + } + + // Lookahead / Lookbehind + if (state.eat(0x28 /* ( */) && state.eat(0x3F /* ? */)) { + var lookbehind = false; + if (this.options.ecmaVersion >= 9) { + lookbehind = state.eat(0x3C /* < */); + } + if (state.eat(0x3D /* = */) || state.eat(0x21 /* ! */)) { + this.regexp_disjunction(state); + if (!state.eat(0x29 /* ) */)) { + state.raise("Unterminated group"); } + state.lastAssertionIsQuantifiable = !lookbehind; + return true } - declaration.valueType = valueType; - declaration.dependencies = dependencies; - declaration.isSafe = this.isSafeDependencies(dependencies); } - for (let i = 0; i < functions.length; i++) { - this.onNestedFunction(functions[i], this.source); + state.pos = start; + return false + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-Quantifier + pp$8.regexp_eatQuantifier = function(state, noError) { + if ( noError === void 0 ) noError = false; + + if (this.regexp_eatQuantifierPrefix(state, noError)) { + state.eat(0x3F /* ? */); + return true } - } + return false + }; - getDeclaration(ast) { - for (let i = 0; i < this.identifiers.length; i++) { - const identifier = this.identifiers[i]; - if (ast === identifier.ast) { - return identifier.declaration; + // https://www.ecma-international.org/ecma-262/8.0/#prod-QuantifierPrefix + pp$8.regexp_eatQuantifierPrefix = function(state, noError) { + return ( + state.eat(0x2A /* * */) || + state.eat(0x2B /* + */) || + state.eat(0x3F /* ? */) || + this.regexp_eatBracedQuantifier(state, noError) + ) + }; + pp$8.regexp_eatBracedQuantifier = function(state, noError) { + var start = state.pos; + if (state.eat(0x7B /* { */)) { + var min = 0, max = -1; + if (this.regexp_eatDecimalDigits(state)) { + min = state.lastIntValue; + if (state.eat(0x2C /* , */) && this.regexp_eatDecimalDigits(state)) { + max = state.lastIntValue; + } + if (state.eat(0x7D /* } */)) { + // SyntaxError in https://www.ecma-international.org/ecma-262/8.0/#sec-term + if (max !== -1 && max < min && !noError) { + state.raise("numbers out of order in {} quantifier"); + } + return true + } } + if (state.switchU && !noError) { + state.raise("Incomplete quantifier"); + } + state.pos = start; } - return null; - } + return false + }; - getVariableType(ast) { - if (ast.type !== 'Identifier') { - throw new Error(`ast of ${ast.type} not "Identifier"`); + // https://www.ecma-international.org/ecma-262/8.0/#prod-Atom + pp$8.regexp_eatAtom = function(state) { + return ( + this.regexp_eatPatternCharacters(state) || + state.eat(0x2E /* . */) || + this.regexp_eatReverseSolidusAtomEscape(state) || + this.regexp_eatCharacterClass(state) || + this.regexp_eatUncapturingGroup(state) || + this.regexp_eatCapturingGroup(state) + ) + }; + pp$8.regexp_eatReverseSolidusAtomEscape = function(state) { + var start = state.pos; + if (state.eat(0x5C /* \ */)) { + if (this.regexp_eatAtomEscape(state)) { + return true + } + state.pos = start; + } + return false + }; + pp$8.regexp_eatUncapturingGroup = function(state) { + var start = state.pos; + if (state.eat(0x28 /* ( */)) { + if (state.eat(0x3F /* ? */) && state.eat(0x3A /* : */)) { + this.regexp_disjunction(state); + if (state.eat(0x29 /* ) */)) { + return true + } + state.raise("Unterminated group"); + } + state.pos = start; } - let type = null; - const argumentIndex = this.argumentNames.indexOf(ast.name); - if (argumentIndex === -1) { - const declaration = this.getDeclaration(ast); - if (declaration) { - return declaration.valueType; + return false + }; + pp$8.regexp_eatCapturingGroup = function(state) { + if (state.eat(0x28 /* ( */)) { + if (this.options.ecmaVersion >= 9) { + this.regexp_groupSpecifier(state); + } else if (state.current() === 0x3F /* ? */) { + state.raise("Invalid group"); } - } else { - const argumentType = this.argumentTypes[argumentIndex]; - if (argumentType) { - type = argumentType; + this.regexp_disjunction(state); + if (state.eat(0x29 /* ) */)) { + state.numCapturingParens += 1; + return true } + state.raise("Unterminated group"); } - if (!type && this.strictTypingChecking) { - throw new Error(`Declaration of ${name} not found`); + return false + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedAtom + pp$8.regexp_eatExtendedAtom = function(state) { + return ( + state.eat(0x2E /* . */) || + this.regexp_eatReverseSolidusAtomEscape(state) || + this.regexp_eatCharacterClass(state) || + this.regexp_eatUncapturingGroup(state) || + this.regexp_eatCapturingGroup(state) || + this.regexp_eatInvalidBracedQuantifier(state) || + this.regexp_eatExtendedPatternCharacter(state) + ) + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-InvalidBracedQuantifier + pp$8.regexp_eatInvalidBracedQuantifier = function(state) { + if (this.regexp_eatBracedQuantifier(state, true)) { + state.raise("Nothing to repeat"); } - return type; - } + return false + }; - getLookupType(type) { - if (!typeLookupMap.hasOwnProperty(type)) { - throw new Error(`unknown typeLookupMap ${ type }`); + // https://www.ecma-international.org/ecma-262/8.0/#prod-SyntaxCharacter + pp$8.regexp_eatSyntaxCharacter = function(state) { + var ch = state.current(); + if (isSyntaxCharacter(ch)) { + state.lastIntValue = ch; + state.advance(); + return true } - return typeLookupMap[type]; - } + return false + }; + function isSyntaxCharacter(ch) { + return ( + ch === 0x24 /* $ */ || + ch >= 0x28 /* ( */ && ch <= 0x2B /* + */ || + ch === 0x2E /* . */ || + ch === 0x3F /* ? */ || + ch >= 0x5B /* [ */ && ch <= 0x5E /* ^ */ || + ch >= 0x7B /* { */ && ch <= 0x7D /* } */ + ) + } + + // https://www.ecma-international.org/ecma-262/8.0/#prod-PatternCharacter + // But eat eager. + pp$8.regexp_eatPatternCharacters = function(state) { + var start = state.pos; + var ch = 0; + while ((ch = state.current()) !== -1 && !isSyntaxCharacter(ch)) { + state.advance(); + } + return state.pos !== start + }; - getConstantType(constantName) { - if (this.constantTypes[constantName]) { - const type = this.constantTypes[constantName]; - if (type === 'Float') { - return 'Number'; - } else { - return type; - } - } - throw new Error(`Type for constant "${ constantName }" not declared`); - } - - toString() { - if (this._string) return this._string; - return this._string = this.astGeneric(this.getJsAST(), []).join('').trim(); - } - - toJSON() { - const settings = { - source: this.source, - name: this.name, - constants: this.constants, - constantTypes: this.constantTypes, - isRootKernel: this.isRootKernel, - isSubKernel: this.isSubKernel, - debug: this.debug, - output: this.output, - loopMaxIterations: this.loopMaxIterations, - argumentNames: this.argumentNames, - argumentTypes: this.argumentTypes, - argumentSizes: this.argumentSizes, - returnType: this.returnType, - leadingReturnStatement: this.leadingReturnStatement, - followingReturnStatement: this.followingReturnStatement, - }; - - return { - ast: this.ast, - settings - }; - } - - getType(ast) { - if (Array.isArray(ast)) { - return this.getType(ast[ast.length - 1]); + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedPatternCharacter + pp$8.regexp_eatExtendedPatternCharacter = function(state) { + var ch = state.current(); + if ( + ch !== -1 && + ch !== 0x24 /* $ */ && + !(ch >= 0x28 /* ( */ && ch <= 0x2B /* + */) && + ch !== 0x2E /* . */ && + ch !== 0x3F /* ? */ && + ch !== 0x5B /* [ */ && + ch !== 0x5E /* ^ */ && + ch !== 0x7C /* | */ + ) { + state.advance(); + return true } - switch (ast.type) { - case 'BlockStatement': - return this.getType(ast.body); - case 'ArrayExpression': - const childType = this.getType(ast.elements[0]); - switch (childType) { - case 'Array(2)': - case 'Array(3)': - case 'Array(4)': - return `Matrix(${ast.elements.length})`; - } - return `Array(${ ast.elements.length })`; - case 'Literal': - const literalKey = this.astKey(ast); - if (this.literalTypes[literalKey]) { - return this.literalTypes[literalKey]; - } - if (Number.isInteger(ast.value)) { - return 'LiteralInteger'; - } else if (ast.value === true || ast.value === false) { - return 'Boolean'; - } else { - return 'Number'; - } - case 'AssignmentExpression': - return this.getType(ast.left); - case 'CallExpression': - if (this.isAstMathFunction(ast)) { - return 'Number'; - } - if (!ast.callee || !ast.callee.name) { - if (ast.callee.type === 'SequenceExpression' && ast.callee.expressions[ast.callee.expressions.length - 1].property.name) { - const functionName = ast.callee.expressions[ast.callee.expressions.length - 1].property.name; - this.inferArgumentTypesIfNeeded(functionName, ast.arguments); - return this.lookupReturnType(functionName, ast, this); - } - if (this.getVariableSignature(ast.callee, true) === 'this.color') { - return null; - } - if (ast.callee.type === 'MemberExpression' && ast.callee.object && ast.callee.property && ast.callee.property.name && ast.arguments) { - const functionName = ast.callee.property.name; - this.inferArgumentTypesIfNeeded(functionName, ast.arguments); - return this.lookupReturnType(functionName, ast, this); - } - throw this.astErrorOutput('Unknown call expression', ast); - } - if (ast.callee && ast.callee.name) { - const functionName = ast.callee.name; - this.inferArgumentTypesIfNeeded(functionName, ast.arguments); - return this.lookupReturnType(functionName, ast, this); - } - throw this.astErrorOutput(`Unhandled getType Type "${ ast.type }"`, ast); - case 'LogicalExpression': - return 'Boolean'; - case 'BinaryExpression': - switch (ast.operator) { - case '%': - case '/': - if (this.fixIntegerDivisionAccuracy) { - return 'Number'; - } else { - break; - } - case '>': - case '<': - return 'Boolean'; - case '&': - case '|': - case '^': - case '<<': - case '>>': - case '>>>': - return 'Integer'; - } - const type = this.getType(ast.left); - if (this.isState('skip-literal-correction')) return type; - if (type === 'LiteralInteger') { - const rightType = this.getType(ast.right); - if (rightType === 'LiteralInteger') { - if (ast.left.value % 1 === 0) { - return 'Integer'; - } else { - return 'Float'; - } - } - return rightType; - } - return typeLookupMap[type] || type; - case 'UpdateExpression': - return this.getType(ast.argument); - case 'UnaryExpression': - if (ast.operator === '~') { - return 'Integer'; - } - return this.getType(ast.argument); - case 'VariableDeclaration': { - const declarations = ast.declarations; - let lastType; - for (let i = 0; i < declarations.length; i++) { - const declaration = declarations[i]; - lastType = this.getType(declaration); - } - if (!lastType) { - throw this.astErrorOutput(`Unable to find type for declaration`, ast); - } - return lastType; - } - case 'VariableDeclarator': - const declaration = this.getDeclaration(ast.id); - if (!declaration) { - throw this.astErrorOutput(`Unable to find declarator`, ast); - } - - if (!declaration.valueType) { - throw this.astErrorOutput(`Unable to find declarator valueType`, ast); - } + return false + }; - return declaration.valueType; - case 'Identifier': - if (ast.name === 'Infinity') { - return 'Number'; - } - if (this.isAstVariable(ast)) { - const signature = this.getVariableSignature(ast); - if (signature === 'value') { - return this.getCheckVariableType(ast); - } - } - const origin = this.findIdentifierOrigin(ast); - if (origin && origin.init) { - return this.getType(origin.init); - } - return null; - case 'ReturnStatement': - return this.getType(ast.argument); - case 'MemberExpression': - if (this.isAstMathFunction(ast)) { - switch (ast.property.name) { - case 'ceil': - return 'Integer'; - case 'floor': - return 'Integer'; - case 'round': - return 'Integer'; - } - return 'Number'; - } - if (this.isAstVariable(ast)) { - const variableSignature = this.getVariableSignature(ast); - switch (variableSignature) { - case 'value[]': - return this.getLookupType(this.getCheckVariableType(ast.object)); - case 'value[][]': - return this.getLookupType(this.getCheckVariableType(ast.object.object)); - case 'value[][][]': - return this.getLookupType(this.getCheckVariableType(ast.object.object.object)); - case 'value[][][][]': - return this.getLookupType(this.getCheckVariableType(ast.object.object.object.object)); - case 'value.thread.value': - case 'this.thread.value': - return 'Integer'; - case 'this.output.value': - return this.dynamicOutput ? 'Integer' : 'LiteralInteger'; - case 'this.constants.value': - return this.getConstantType(ast.property.name); - case 'this.constants.value[]': - return this.getLookupType(this.getConstantType(ast.object.property.name)); - case 'this.constants.value[][]': - return this.getLookupType(this.getConstantType(ast.object.object.property.name)); - case 'this.constants.value[][][]': - return this.getLookupType(this.getConstantType(ast.object.object.object.property.name)); - case 'this.constants.value[][][][]': - return this.getLookupType(this.getConstantType(ast.object.object.object.object.property.name)); - case 'fn()[]': - case 'fn()[][]': - case 'fn()[][][]': - return this.getLookupType(this.getType(ast.object)); - case 'value.value': - if (this.isAstMathVariable(ast)) { - return 'Number'; - } - switch (ast.property.name) { - case 'r': - case 'g': - case 'b': - case 'a': - return this.getLookupType(this.getCheckVariableType(ast.object)); - } - case '[][]': - return 'Number'; - } - throw this.astErrorOutput('Unhandled getType MemberExpression', ast); - } - throw this.astErrorOutput('Unhandled getType MemberExpression', ast); - case 'ConditionalExpression': - return this.getType(ast.consequent); - case 'FunctionDeclaration': - case 'FunctionExpression': - const lastReturn = this.findLastReturn(ast.body); - if (lastReturn) { - return this.getType(lastReturn); - } - return null; - case 'IfStatement': - return this.getType(ast.consequent); - case 'SequenceExpression': - return this.getType(ast.expressions[ast.expressions.length - 1]); - default: - throw this.astErrorOutput(`Unhandled getType Type "${ ast.type }"`, ast); + // GroupSpecifier :: + // [empty] + // `?` GroupName + pp$8.regexp_groupSpecifier = function(state) { + if (state.eat(0x3F /* ? */)) { + if (this.regexp_eatGroupName(state)) { + if (state.groupNames.indexOf(state.lastStringValue) !== -1) { + state.raise("Duplicate capture group name"); + } + state.groupNames.push(state.lastStringValue); + return + } + state.raise("Invalid group"); } - } + }; - getCheckVariableType(ast) { - const type = this.getVariableType(ast); - if (!type) { - throw this.astErrorOutput(`${ast.type} is not defined`, ast); + // GroupName :: + // `<` RegExpIdentifierName `>` + // Note: this updates `state.lastStringValue` property with the eaten name. + pp$8.regexp_eatGroupName = function(state) { + state.lastStringValue = ""; + if (state.eat(0x3C /* < */)) { + if (this.regexp_eatRegExpIdentifierName(state) && state.eat(0x3E /* > */)) { + return true + } + state.raise("Invalid capture group name"); } - return type; - } + return false + }; - inferArgumentTypesIfNeeded(functionName, args) { - for (let i = 0; i < args.length; i++) { - if (!this.needsArgumentType(functionName, i)) continue; - const type = this.getType(args[i]); - if (!type) { - throw this.astErrorOutput(`Unable to infer argument ${i}`, args[i]); + // RegExpIdentifierName :: + // RegExpIdentifierStart + // RegExpIdentifierName RegExpIdentifierPart + // Note: this updates `state.lastStringValue` property with the eaten name. + pp$8.regexp_eatRegExpIdentifierName = function(state) { + state.lastStringValue = ""; + if (this.regexp_eatRegExpIdentifierStart(state)) { + state.lastStringValue += codePointToString(state.lastIntValue); + while (this.regexp_eatRegExpIdentifierPart(state)) { + state.lastStringValue += codePointToString(state.lastIntValue); } - this.assignArgumentType(functionName, i, type); + return true } - } + return false + }; - isAstMathVariable(ast) { - const mathProperties = [ - 'E', - 'PI', - 'SQRT2', - 'SQRT1_2', - 'LN2', - 'LN10', - 'LOG2E', - 'LOG10E', - ]; - return ast.type === 'MemberExpression' && - ast.object && ast.object.type === 'Identifier' && - ast.object.name === 'Math' && - ast.property && - ast.property.type === 'Identifier' && - mathProperties.indexOf(ast.property.name) > -1; - } - - isAstMathFunction(ast) { - const mathFunctions = [ - 'abs', - 'acos', - 'acosh', - 'asin', - 'asinh', - 'atan', - 'atan2', - 'atanh', - 'cbrt', - 'ceil', - 'clz32', - 'cos', - 'cosh', - 'expm1', - 'exp', - 'floor', - 'fround', - 'imul', - 'log', - 'log2', - 'log10', - 'log1p', - 'max', - 'min', - 'pow', - 'random', - 'round', - 'sign', - 'sin', - 'sinh', - 'sqrt', - 'tan', - 'tanh', - 'trunc', - ]; - return ast.type === 'CallExpression' && - ast.callee && - ast.callee.type === 'MemberExpression' && - ast.callee.object && - ast.callee.object.type === 'Identifier' && - ast.callee.object.name === 'Math' && - ast.callee.property && - ast.callee.property.type === 'Identifier' && - mathFunctions.indexOf(ast.callee.property.name) > -1; - } + // RegExpIdentifierStart :: + // UnicodeIDStart + // `$` + // `_` + // `\` RegExpUnicodeEscapeSequence[+U] + pp$8.regexp_eatRegExpIdentifierStart = function(state) { + var start = state.pos; + var forceU = this.options.ecmaVersion >= 11; + var ch = state.current(forceU); + state.advance(forceU); - isAstVariable(ast) { - return ast.type === 'Identifier' || ast.type === 'MemberExpression'; - } + if (ch === 0x5C /* \ */ && this.regexp_eatRegExpUnicodeEscapeSequence(state, forceU)) { + ch = state.lastIntValue; + } + if (isRegExpIdentifierStart(ch)) { + state.lastIntValue = ch; + return true + } - isSafe(ast) { - return this.isSafeDependencies(this.getDependencies(ast)); + state.pos = start; + return false + }; + function isRegExpIdentifierStart(ch) { + return isIdentifierStart(ch, true) || ch === 0x24 /* $ */ || ch === 0x5F /* _ */ } - isSafeDependencies(dependencies) { - return dependencies && dependencies.every ? dependencies.every(dependency => dependency.isSafe) : true; + // RegExpIdentifierPart :: + // UnicodeIDContinue + // `$` + // `_` + // `\` RegExpUnicodeEscapeSequence[+U] + // + // + pp$8.regexp_eatRegExpIdentifierPart = function(state) { + var start = state.pos; + var forceU = this.options.ecmaVersion >= 11; + var ch = state.current(forceU); + state.advance(forceU); + + if (ch === 0x5C /* \ */ && this.regexp_eatRegExpUnicodeEscapeSequence(state, forceU)) { + ch = state.lastIntValue; + } + if (isRegExpIdentifierPart(ch)) { + state.lastIntValue = ch; + return true + } + + state.pos = start; + return false + }; + function isRegExpIdentifierPart(ch) { + return isIdentifierChar(ch, true) || ch === 0x24 /* $ */ || ch === 0x5F /* _ */ || ch === 0x200C /* */ || ch === 0x200D /* */ } - getDependencies(ast, dependencies, isNotSafe) { - if (!dependencies) { - dependencies = []; + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-AtomEscape + pp$8.regexp_eatAtomEscape = function(state) { + if ( + this.regexp_eatBackReference(state) || + this.regexp_eatCharacterClassEscape(state) || + this.regexp_eatCharacterEscape(state) || + (state.switchN && this.regexp_eatKGroupName(state)) + ) { + return true } - if (!ast) return null; - if (Array.isArray(ast)) { - for (let i = 0; i < ast.length; i++) { - this.getDependencies(ast[i], dependencies, isNotSafe); + if (state.switchU) { + // Make the same message as V8. + if (state.current() === 0x63 /* c */) { + state.raise("Invalid unicode escape"); } - return dependencies; + state.raise("Invalid escape"); } - switch (ast.type) { - case 'AssignmentExpression': - this.getDependencies(ast.left, dependencies, isNotSafe); - this.getDependencies(ast.right, dependencies, isNotSafe); - return dependencies; - case 'ConditionalExpression': - this.getDependencies(ast.test, dependencies, isNotSafe); - this.getDependencies(ast.alternate, dependencies, isNotSafe); - this.getDependencies(ast.consequent, dependencies, isNotSafe); - return dependencies; - case 'Literal': - dependencies.push({ - origin: 'literal', - value: ast.value, - isSafe: isNotSafe === true ? false : ast.value > -Infinity && ast.value < Infinity && !isNaN(ast.value) - }); - break; - case 'VariableDeclarator': - return this.getDependencies(ast.init, dependencies, isNotSafe); - case 'Identifier': - const declaration = this.getDeclaration(ast); - if (declaration) { - dependencies.push({ - name: ast.name, - origin: 'declaration', - isSafe: isNotSafe ? false : this.isSafeDependencies(declaration.dependencies), - }); - } else if (this.argumentNames.indexOf(ast.name) > -1) { - dependencies.push({ - name: ast.name, - origin: 'argument', - isSafe: false, - }); - } else if (this.strictTypingChecking) { - throw new Error(`Cannot find identifier origin "${ast.name}"`); - } - break; - case 'FunctionDeclaration': - return this.getDependencies(ast.body.body[ast.body.body.length - 1], dependencies, isNotSafe); - case 'ReturnStatement': - return this.getDependencies(ast.argument, dependencies); - case 'BinaryExpression': - case 'LogicalExpression': - isNotSafe = (ast.operator === '/' || ast.operator === '*'); - this.getDependencies(ast.left, dependencies, isNotSafe); - this.getDependencies(ast.right, dependencies, isNotSafe); - return dependencies; - case 'UnaryExpression': - case 'UpdateExpression': - return this.getDependencies(ast.argument, dependencies, isNotSafe); - case 'VariableDeclaration': - return this.getDependencies(ast.declarations, dependencies, isNotSafe); - case 'ArrayExpression': - dependencies.push({ - origin: 'declaration', - isSafe: true, - }); - return dependencies; - case 'CallExpression': - dependencies.push({ - origin: 'function', - isSafe: true, - }); - return dependencies; - case 'MemberExpression': - const details = this.getMemberExpressionDetails(ast); - switch (details.signature) { - case 'value[]': - this.getDependencies(ast.object, dependencies, isNotSafe); - break; - case 'value[][]': - this.getDependencies(ast.object.object, dependencies, isNotSafe); - break; - case 'value[][][]': - this.getDependencies(ast.object.object.object, dependencies, isNotSafe); - break; - case 'this.output.value': - if (this.dynamicOutput) { - dependencies.push({ - name: details.name, - origin: 'output', - isSafe: false, - }); - } - break; - } - if (details) { - if (details.property) { - this.getDependencies(details.property, dependencies, isNotSafe); - } - if (details.xProperty) { - this.getDependencies(details.xProperty, dependencies, isNotSafe); - } - if (details.yProperty) { - this.getDependencies(details.yProperty, dependencies, isNotSafe); - } - if (details.zProperty) { - this.getDependencies(details.zProperty, dependencies, isNotSafe); - } - return dependencies; + return false + }; + pp$8.regexp_eatBackReference = function(state) { + var start = state.pos; + if (this.regexp_eatDecimalEscape(state)) { + var n = state.lastIntValue; + if (state.switchU) { + // For SyntaxError in https://www.ecma-international.org/ecma-262/8.0/#sec-atomescape + if (n > state.maxBackReference) { + state.maxBackReference = n; } - case 'SequenceExpression': - return this.getDependencies(ast.expressions, dependencies, isNotSafe); - default: - throw this.astErrorOutput(`Unhandled type ${ ast.type } in getDependencies`, ast); + return true + } + if (n <= state.numCapturingParens) { + return true + } + state.pos = start; } - return dependencies; - } - - getVariableSignature(ast, returnRawValue) { - if (!this.isAstVariable(ast)) { - throw new Error(`ast of type "${ ast.type }" is not a variable signature`); + return false + }; + pp$8.regexp_eatKGroupName = function(state) { + if (state.eat(0x6B /* k */)) { + if (this.regexp_eatGroupName(state)) { + state.backReferenceNames.push(state.lastStringValue); + return true + } + state.raise("Invalid named reference"); } - if (ast.type === 'Identifier') { - return 'value'; + return false + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-CharacterEscape + pp$8.regexp_eatCharacterEscape = function(state) { + return ( + this.regexp_eatControlEscape(state) || + this.regexp_eatCControlLetter(state) || + this.regexp_eatZero(state) || + this.regexp_eatHexEscapeSequence(state) || + this.regexp_eatRegExpUnicodeEscapeSequence(state, false) || + (!state.switchU && this.regexp_eatLegacyOctalEscapeSequence(state)) || + this.regexp_eatIdentityEscape(state) + ) + }; + pp$8.regexp_eatCControlLetter = function(state) { + var start = state.pos; + if (state.eat(0x63 /* c */)) { + if (this.regexp_eatControlLetter(state)) { + return true + } + state.pos = start; } - const signature = []; - while (true) { - if (!ast) break; - if (ast.computed) { - signature.push('[]'); - } else if (ast.type === 'ThisExpression') { - signature.unshift('this'); - } else if (ast.property && ast.property.name) { - if ( - ast.property.name === 'x' || - ast.property.name === 'y' || - ast.property.name === 'z' - ) { - signature.unshift(returnRawValue ? '.' + ast.property.name : '.value'); - } else if ( - ast.property.name === 'constants' || - ast.property.name === 'thread' || - ast.property.name === 'output' - ) { - signature.unshift('.' + ast.property.name); - } else { - signature.unshift(returnRawValue ? '.' + ast.property.name : '.value'); - } - } else if (ast.name) { - signature.unshift(returnRawValue ? ast.name : 'value'); - } else if (ast.callee && ast.callee.name) { - signature.unshift(returnRawValue ? ast.callee.name + '()' : 'fn()'); - } else if (ast.elements) { - signature.unshift('[]'); - } else { - signature.unshift('unknown'); - } - ast = ast.object; - } - - const signatureString = signature.join(''); - if (returnRawValue) { - return signatureString; - } - - const allowedExpressions = [ - 'value', - 'value[]', - 'value[][]', - 'value[][][]', - 'value[][][][]', - 'value.value', - 'value.thread.value', - 'this.thread.value', - 'this.output.value', - 'this.constants.value', - 'this.constants.value[]', - 'this.constants.value[][]', - 'this.constants.value[][][]', - 'this.constants.value[][][][]', - 'fn()[]', - 'fn()[][]', - 'fn()[][][]', - '[][]', - ]; - if (allowedExpressions.indexOf(signatureString) > -1) { - return signatureString; + return false + }; + pp$8.regexp_eatZero = function(state) { + if (state.current() === 0x30 /* 0 */ && !isDecimalDigit(state.lookahead())) { + state.lastIntValue = 0; + state.advance(); + return true } - return null; - } + return false + }; - build() { - return this.toString().length > 0; - } + // https://www.ecma-international.org/ecma-262/8.0/#prod-ControlEscape + pp$8.regexp_eatControlEscape = function(state) { + var ch = state.current(); + if (ch === 0x74 /* t */) { + state.lastIntValue = 0x09; /* \t */ + state.advance(); + return true + } + if (ch === 0x6E /* n */) { + state.lastIntValue = 0x0A; /* \n */ + state.advance(); + return true + } + if (ch === 0x76 /* v */) { + state.lastIntValue = 0x0B; /* \v */ + state.advance(); + return true + } + if (ch === 0x66 /* f */) { + state.lastIntValue = 0x0C; /* \f */ + state.advance(); + return true + } + if (ch === 0x72 /* r */) { + state.lastIntValue = 0x0D; /* \r */ + state.advance(); + return true + } + return false + }; - astGeneric(ast, retArr) { - if (ast === null) { - throw this.astErrorOutput('NULL ast', ast); - } else { - if (Array.isArray(ast)) { - for (let i = 0; i < ast.length; i++) { - this.astGeneric(ast[i], retArr); + // https://www.ecma-international.org/ecma-262/8.0/#prod-ControlLetter + pp$8.regexp_eatControlLetter = function(state) { + var ch = state.current(); + if (isControlLetter(ch)) { + state.lastIntValue = ch % 0x20; + state.advance(); + return true + } + return false + }; + function isControlLetter(ch) { + return ( + (ch >= 0x41 /* A */ && ch <= 0x5A /* Z */) || + (ch >= 0x61 /* a */ && ch <= 0x7A /* z */) + ) + } + + // https://www.ecma-international.org/ecma-262/8.0/#prod-RegExpUnicodeEscapeSequence + pp$8.regexp_eatRegExpUnicodeEscapeSequence = function(state, forceU) { + if ( forceU === void 0 ) forceU = false; + + var start = state.pos; + var switchU = forceU || state.switchU; + + if (state.eat(0x75 /* u */)) { + if (this.regexp_eatFixedHexDigits(state, 4)) { + var lead = state.lastIntValue; + if (switchU && lead >= 0xD800 && lead <= 0xDBFF) { + var leadSurrogateEnd = state.pos; + if (state.eat(0x5C /* \ */) && state.eat(0x75 /* u */) && this.regexp_eatFixedHexDigits(state, 4)) { + var trail = state.lastIntValue; + if (trail >= 0xDC00 && trail <= 0xDFFF) { + state.lastIntValue = (lead - 0xD800) * 0x400 + (trail - 0xDC00) + 0x10000; + return true + } + } + state.pos = leadSurrogateEnd; + state.lastIntValue = lead; } - return retArr; + return true + } + if ( + switchU && + state.eat(0x7B /* { */) && + this.regexp_eatHexDigits(state) && + state.eat(0x7D /* } */) && + isValidUnicode(state.lastIntValue) + ) { + return true + } + if (switchU) { + state.raise("Invalid unicode escape"); } + state.pos = start; + } - switch (ast.type) { - case 'FunctionDeclaration': - return this.astFunctionDeclaration(ast, retArr); - case 'FunctionExpression': - return this.astFunctionExpression(ast, retArr); - case 'ReturnStatement': - return this.astReturnStatement(ast, retArr); - case 'Literal': - return this.astLiteral(ast, retArr); - case 'BinaryExpression': - return this.astBinaryExpression(ast, retArr); - case 'Identifier': - return this.astIdentifierExpression(ast, retArr); - case 'AssignmentExpression': - return this.astAssignmentExpression(ast, retArr); - case 'ExpressionStatement': - return this.astExpressionStatement(ast, retArr); - case 'EmptyStatement': - return this.astEmptyStatement(ast, retArr); - case 'BlockStatement': - return this.astBlockStatement(ast, retArr); - case 'IfStatement': - return this.astIfStatement(ast, retArr); - case 'SwitchStatement': - return this.astSwitchStatement(ast, retArr); - case 'BreakStatement': - return this.astBreakStatement(ast, retArr); - case 'ContinueStatement': - return this.astContinueStatement(ast, retArr); - case 'ForStatement': - return this.astForStatement(ast, retArr); - case 'WhileStatement': - return this.astWhileStatement(ast, retArr); - case 'DoWhileStatement': - return this.astDoWhileStatement(ast, retArr); - case 'VariableDeclaration': - return this.astVariableDeclaration(ast, retArr); - case 'VariableDeclarator': - return this.astVariableDeclarator(ast, retArr); - case 'ThisExpression': - return this.astThisExpression(ast, retArr); - case 'SequenceExpression': - return this.astSequenceExpression(ast, retArr); - case 'UnaryExpression': - return this.astUnaryExpression(ast, retArr); - case 'UpdateExpression': - return this.astUpdateExpression(ast, retArr); - case 'LogicalExpression': - return this.astLogicalExpression(ast, retArr); - case 'MemberExpression': - return this.astMemberExpression(ast, retArr); - case 'CallExpression': - return this.astCallExpression(ast, retArr); - case 'ArrayExpression': - return this.astArrayExpression(ast, retArr); - case 'DebuggerStatement': - return this.astDebuggerStatement(ast, retArr); - case 'ConditionalExpression': - return this.astConditionalExpression(ast, retArr); + return false + }; + function isValidUnicode(ch) { + return ch >= 0 && ch <= 0x10FFFF + } + + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-IdentityEscape + pp$8.regexp_eatIdentityEscape = function(state) { + if (state.switchU) { + if (this.regexp_eatSyntaxCharacter(state)) { + return true + } + if (state.eat(0x2F /* / */)) { + state.lastIntValue = 0x2F; /* / */ + return true } + return false + } - throw this.astErrorOutput('Unknown ast type : ' + ast.type, ast); + var ch = state.current(); + if (ch !== 0x63 /* c */ && (!state.switchN || ch !== 0x6B /* k */)) { + state.lastIntValue = ch; + state.advance(); + return true } - } - astErrorOutput(error, ast) { - if (typeof this.source !== 'string') { - return new Error(error); + + return false + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalEscape + pp$8.regexp_eatDecimalEscape = function(state) { + state.lastIntValue = 0; + var ch = state.current(); + if (ch >= 0x31 /* 1 */ && ch <= 0x39 /* 9 */) { + do { + state.lastIntValue = 10 * state.lastIntValue + (ch - 0x30 /* 0 */); + state.advance(); + } while ((ch = state.current()) >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */) + return true + } + return false + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClassEscape + pp$8.regexp_eatCharacterClassEscape = function(state) { + var ch = state.current(); + + if (isCharacterClassEscape(ch)) { + state.lastIntValue = -1; + state.advance(); + return true } - const debugString = utils.getAstString(this.source, ast); - const leadingSource = this.source.substr(ast.start); - const splitLines = leadingSource.split(/\n/); - const lineBefore = splitLines.length > 0 ? splitLines[splitLines.length - 1] : 0; - return new Error(`${error} on line ${ splitLines.length }, position ${ lineBefore.length }:\n ${ debugString }`); - } + if ( + state.switchU && + this.options.ecmaVersion >= 9 && + (ch === 0x50 /* P */ || ch === 0x70 /* p */) + ) { + state.lastIntValue = -1; + state.advance(); + if ( + state.eat(0x7B /* { */) && + this.regexp_eatUnicodePropertyValueExpression(state) && + state.eat(0x7D /* } */) + ) { + return true + } + state.raise("Invalid property name"); + } - astDebuggerStatement(arrNode, retArr) { - return retArr; - } + return false + }; + function isCharacterClassEscape(ch) { + return ( + ch === 0x64 /* d */ || + ch === 0x44 /* D */ || + ch === 0x73 /* s */ || + ch === 0x53 /* S */ || + ch === 0x77 /* w */ || + ch === 0x57 /* W */ + ) + } + + // UnicodePropertyValueExpression :: + // UnicodePropertyName `=` UnicodePropertyValue + // LoneUnicodePropertyNameOrValue + pp$8.regexp_eatUnicodePropertyValueExpression = function(state) { + var start = state.pos; + + // UnicodePropertyName `=` UnicodePropertyValue + if (this.regexp_eatUnicodePropertyName(state) && state.eat(0x3D /* = */)) { + var name = state.lastStringValue; + if (this.regexp_eatUnicodePropertyValue(state)) { + var value = state.lastStringValue; + this.regexp_validateUnicodePropertyNameAndValue(state, name, value); + return true + } + } + state.pos = start; - astConditionalExpression(ast, retArr) { - if (ast.type !== 'ConditionalExpression') { - throw this.astErrorOutput('Not a conditional expression', ast); + // LoneUnicodePropertyNameOrValue + if (this.regexp_eatLoneUnicodePropertyNameOrValue(state)) { + var nameOrValue = state.lastStringValue; + this.regexp_validateUnicodePropertyNameOrValue(state, nameOrValue); + return true } - retArr.push('('); - this.astGeneric(ast.test, retArr); - retArr.push('?'); - this.astGeneric(ast.consequent, retArr); - retArr.push(':'); - this.astGeneric(ast.alternate, retArr); - retArr.push(')'); - return retArr; - } + return false + }; + pp$8.regexp_validateUnicodePropertyNameAndValue = function(state, name, value) { + if (!has(state.unicodeProperties.nonBinary, name)) + { state.raise("Invalid property name"); } + if (!state.unicodeProperties.nonBinary[name].test(value)) + { state.raise("Invalid property value"); } + }; + pp$8.regexp_validateUnicodePropertyNameOrValue = function(state, nameOrValue) { + if (!state.unicodeProperties.binary.test(nameOrValue)) + { state.raise("Invalid property name"); } + }; - astFunction(ast, retArr) { - throw new Error(`"astFunction" not defined on ${ this.constructor.name }`); + // UnicodePropertyName :: + // UnicodePropertyNameCharacters + pp$8.regexp_eatUnicodePropertyName = function(state) { + var ch = 0; + state.lastStringValue = ""; + while (isUnicodePropertyNameCharacter(ch = state.current())) { + state.lastStringValue += codePointToString(ch); + state.advance(); + } + return state.lastStringValue !== "" + }; + function isUnicodePropertyNameCharacter(ch) { + return isControlLetter(ch) || ch === 0x5F /* _ */ } - astFunctionDeclaration(ast, retArr) { - if (this.isChildFunction(ast)) { - return retArr; + // UnicodePropertyValue :: + // UnicodePropertyValueCharacters + pp$8.regexp_eatUnicodePropertyValue = function(state) { + var ch = 0; + state.lastStringValue = ""; + while (isUnicodePropertyValueCharacter(ch = state.current())) { + state.lastStringValue += codePointToString(ch); + state.advance(); } - return this.astFunction(ast, retArr); + return state.lastStringValue !== "" + }; + function isUnicodePropertyValueCharacter(ch) { + return isUnicodePropertyNameCharacter(ch) || isDecimalDigit(ch) } - astFunctionExpression(ast, retArr) { - if (this.isChildFunction(ast)) { - return retArr; + + // LoneUnicodePropertyNameOrValue :: + // UnicodePropertyValueCharacters + pp$8.regexp_eatLoneUnicodePropertyNameOrValue = function(state) { + return this.regexp_eatUnicodePropertyValue(state) + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClass + pp$8.regexp_eatCharacterClass = function(state) { + if (state.eat(0x5B /* [ */)) { + state.eat(0x5E /* ^ */); + this.regexp_classRanges(state); + if (state.eat(0x5D /* ] */)) { + return true + } + // Unreachable since it threw "unterminated regular expression" error before. + state.raise("Unterminated character class"); } - return this.astFunction(ast, retArr); - } - isChildFunction(ast) { - for (let i = 0; i < this.functions.length; i++) { - if (this.functions[i] === ast) { - return true; + return false + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassRanges + // https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRanges + // https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRangesNoDash + pp$8.regexp_classRanges = function(state) { + while (this.regexp_eatClassAtom(state)) { + var left = state.lastIntValue; + if (state.eat(0x2D /* - */) && this.regexp_eatClassAtom(state)) { + var right = state.lastIntValue; + if (state.switchU && (left === -1 || right === -1)) { + state.raise("Invalid character class"); + } + if (left !== -1 && right !== -1 && left > right) { + state.raise("Range out of order in character class"); + } } } - return false; - } - astReturnStatement(ast, retArr) { - return retArr; - } - astLiteral(ast, retArr) { - this.literalTypes[this.astKey(ast)] = 'Number'; - return retArr; - } - astBinaryExpression(ast, retArr) { - return retArr; - } - astIdentifierExpression(ast, retArr) { - return retArr; - } - astAssignmentExpression(ast, retArr) { - return retArr; - } - astExpressionStatement(esNode, retArr) { - this.astGeneric(esNode.expression, retArr); - retArr.push(';'); - return retArr; - } - astEmptyStatement(eNode, retArr) { - return retArr; - } - astBlockStatement(ast, retArr) { - return retArr; - } - astIfStatement(ast, retArr) { - return retArr; - } - astSwitchStatement(ast, retArr) { - return retArr; - } - astBreakStatement(brNode, retArr) { - retArr.push('break;'); - return retArr; - } - astContinueStatement(crNode, retArr) { - retArr.push('continue;\n'); - return retArr; - } - astForStatement(ast, retArr) { - return retArr; - } - astWhileStatement(ast, retArr) { - return retArr; - } - astDoWhileStatement(ast, retArr) { - return retArr; - } - astVariableDeclarator(iVarDecNode, retArr) { - this.astGeneric(iVarDecNode.id, retArr); - if (iVarDecNode.init !== null) { - retArr.push('='); - this.astGeneric(iVarDecNode.init, retArr); + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtom + // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtomNoDash + pp$8.regexp_eatClassAtom = function(state) { + var start = state.pos; + + if (state.eat(0x5C /* \ */)) { + if (this.regexp_eatClassEscape(state)) { + return true + } + if (state.switchU) { + // Make the same message as V8. + var ch$1 = state.current(); + if (ch$1 === 0x63 /* c */ || isOctalDigit(ch$1)) { + state.raise("Invalid class escape"); + } + state.raise("Invalid escape"); + } + state.pos = start; } - return retArr; - } - astThisExpression(ast, retArr) { - return retArr; - } - astSequenceExpression(sNode, retArr) { - const { expressions } = sNode; - const sequenceResult = []; - for (let i = 0; i < expressions.length; i++) { - const expression = expressions[i]; - const expressionResult = []; - this.astGeneric(expression, expressionResult); - sequenceResult.push(expressionResult.join('')); + + var ch = state.current(); + if (ch !== 0x5D /* ] */) { + state.lastIntValue = ch; + state.advance(); + return true } - if (sequenceResult.length > 1) { - retArr.push('(', sequenceResult.join(','), ')'); - } else { - retArr.push(sequenceResult[0]); + + return false + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassEscape + pp$8.regexp_eatClassEscape = function(state) { + var start = state.pos; + + if (state.eat(0x62 /* b */)) { + state.lastIntValue = 0x08; /* */ + return true } - return retArr; - } - astUnaryExpression(uNode, retArr) { - const unaryResult = this.checkAndUpconvertBitwiseUnary(uNode, retArr); - if (unaryResult) { - return retArr; + + if (state.switchU && state.eat(0x2D /* - */)) { + state.lastIntValue = 0x2D; /* - */ + return true } - if (uNode.prefix) { - retArr.push(uNode.operator); - this.astGeneric(uNode.argument, retArr); - } else { - this.astGeneric(uNode.argument, retArr); - retArr.push(uNode.operator); + if (!state.switchU && state.eat(0x63 /* c */)) { + if (this.regexp_eatClassControlLetter(state)) { + return true + } + state.pos = start; } - return retArr; - } + return ( + this.regexp_eatCharacterClassEscape(state) || + this.regexp_eatCharacterEscape(state) + ) + }; - checkAndUpconvertBitwiseUnary(uNode, retArr) {} + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassControlLetter + pp$8.regexp_eatClassControlLetter = function(state) { + var ch = state.current(); + if (isDecimalDigit(ch) || ch === 0x5F /* _ */) { + state.lastIntValue = ch % 0x20; + state.advance(); + return true + } + return false + }; - astUpdateExpression(uNode, retArr) { - if (uNode.prefix) { - retArr.push(uNode.operator); - this.astGeneric(uNode.argument, retArr); - } else { - this.astGeneric(uNode.argument, retArr); - retArr.push(uNode.operator); + // https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence + pp$8.regexp_eatHexEscapeSequence = function(state) { + var start = state.pos; + if (state.eat(0x78 /* x */)) { + if (this.regexp_eatFixedHexDigits(state, 2)) { + return true + } + if (state.switchU) { + state.raise("Invalid escape"); + } + state.pos = start; } + return false + }; - return retArr; - } - astLogicalExpression(logNode, retArr) { - retArr.push('('); - this.astGeneric(logNode.left, retArr); - retArr.push(logNode.operator); - this.astGeneric(logNode.right, retArr); - retArr.push(')'); - return retArr; - } - astMemberExpression(ast, retArr) { - return retArr; - } - astCallExpression(ast, retArr) { - return retArr; - } - astArrayExpression(ast, retArr) { - return retArr; + // https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalDigits + pp$8.regexp_eatDecimalDigits = function(state) { + var start = state.pos; + var ch = 0; + state.lastIntValue = 0; + while (isDecimalDigit(ch = state.current())) { + state.lastIntValue = 10 * state.lastIntValue + (ch - 0x30 /* 0 */); + state.advance(); + } + return state.pos !== start + }; + function isDecimalDigit(ch) { + return ch >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */ } - getMemberExpressionDetails(ast) { - if (ast.type !== 'MemberExpression') { - throw this.astErrorOutput(`Expression ${ ast.type } not a MemberExpression`, ast); + // https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigits + pp$8.regexp_eatHexDigits = function(state) { + var start = state.pos; + var ch = 0; + state.lastIntValue = 0; + while (isHexDigit(ch = state.current())) { + state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch); + state.advance(); } - let name = null; - let type = null; - const variableSignature = this.getVariableSignature(ast); - switch (variableSignature) { - case 'value': - return null; - case 'value.thread.value': - case 'this.thread.value': - case 'this.output.value': - return { - signature: variableSignature, - type: 'Integer', - name: ast.property.name - }; - case 'value[]': - if (typeof ast.object.name !== 'string') { - throw this.astErrorOutput('Unexpected expression', ast); - } - name = ast.object.name; - return { - name, - origin: 'user', - signature: variableSignature, - type: this.getVariableType(ast.object), - xProperty: ast.property - }; - case 'value[][]': - if (typeof ast.object.object.name !== 'string') { - throw this.astErrorOutput('Unexpected expression', ast); - } - name = ast.object.object.name; - return { - name, - origin: 'user', - signature: variableSignature, - type: this.getVariableType(ast.object.object), - yProperty: ast.object.property, - xProperty: ast.property, - }; - case 'value[][][]': - if (typeof ast.object.object.object.name !== 'string') { - throw this.astErrorOutput('Unexpected expression', ast); - } - name = ast.object.object.object.name; - return { - name, - origin: 'user', - signature: variableSignature, - type: this.getVariableType(ast.object.object.object), - zProperty: ast.object.object.property, - yProperty: ast.object.property, - xProperty: ast.property, - }; - case 'value[][][][]': - if (typeof ast.object.object.object.object.name !== 'string') { - throw this.astErrorOutput('Unexpected expression', ast); - } - name = ast.object.object.object.object.name; - return { - name, - origin: 'user', - signature: variableSignature, - type: this.getVariableType(ast.object.object.object.object), - zProperty: ast.object.object.property, - yProperty: ast.object.property, - xProperty: ast.property, - }; - case 'value.value': - if (typeof ast.property.name !== 'string') { - throw this.astErrorOutput('Unexpected expression', ast); - } - if (this.isAstMathVariable(ast)) { - name = ast.property.name; - return { - name, - origin: 'Math', - type: 'Number', - signature: variableSignature, - }; - } - switch (ast.property.name) { - case 'r': - case 'g': - case 'b': - case 'a': - name = ast.object.name; - return { - name, - property: ast.property.name, - origin: 'user', - signature: variableSignature, - type: 'Number' - }; - default: - throw this.astErrorOutput('Unexpected expression', ast); + return state.pos !== start + }; + function isHexDigit(ch) { + return ( + (ch >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */) || + (ch >= 0x41 /* A */ && ch <= 0x46 /* F */) || + (ch >= 0x61 /* a */ && ch <= 0x66 /* f */) + ) + } + function hexToInt(ch) { + if (ch >= 0x41 /* A */ && ch <= 0x46 /* F */) { + return 10 + (ch - 0x41 /* A */) + } + if (ch >= 0x61 /* a */ && ch <= 0x66 /* f */) { + return 10 + (ch - 0x61 /* a */) + } + return ch - 0x30 /* 0 */ + } + + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-LegacyOctalEscapeSequence + // Allows only 0-377(octal) i.e. 0-255(decimal). + pp$8.regexp_eatLegacyOctalEscapeSequence = function(state) { + if (this.regexp_eatOctalDigit(state)) { + var n1 = state.lastIntValue; + if (this.regexp_eatOctalDigit(state)) { + var n2 = state.lastIntValue; + if (n1 <= 3 && this.regexp_eatOctalDigit(state)) { + state.lastIntValue = n1 * 64 + n2 * 8 + state.lastIntValue; + } else { + state.lastIntValue = n1 * 8 + n2; } - case 'this.constants.value': - if (typeof ast.property.name !== 'string') { - throw this.astErrorOutput('Unexpected expression', ast); - } - name = ast.property.name; - type = this.getConstantType(name); - if (!type) { - throw this.astErrorOutput('Constant has no type', ast); - } - return { - name, - type, - origin: 'constants', - signature: variableSignature, - }; - case 'this.constants.value[]': - if (typeof ast.object.property.name !== 'string') { - throw this.astErrorOutput('Unexpected expression', ast); - } - name = ast.object.property.name; - type = this.getConstantType(name); - if (!type) { - throw this.astErrorOutput('Constant has no type', ast); - } + } else { + state.lastIntValue = n1; + } + return true + } + return false + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-OctalDigit + pp$8.regexp_eatOctalDigit = function(state) { + var ch = state.current(); + if (isOctalDigit(ch)) { + state.lastIntValue = ch - 0x30; /* 0 */ + state.advance(); + return true + } + state.lastIntValue = 0; + return false + }; + function isOctalDigit(ch) { + return ch >= 0x30 /* 0 */ && ch <= 0x37 /* 7 */ + } + + // https://www.ecma-international.org/ecma-262/8.0/#prod-Hex4Digits + // https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigit + // And HexDigit HexDigit in https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence + pp$8.regexp_eatFixedHexDigits = function(state, length) { + var start = state.pos; + state.lastIntValue = 0; + for (var i = 0; i < length; ++i) { + var ch = state.current(); + if (!isHexDigit(ch)) { + state.pos = start; + return false + } + state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch); + state.advance(); + } + return true + }; + + // Object type used to represent tokens. Note that normally, tokens + // simply exist as properties on the parser object. This is only + // used for the onToken callback and the external tokenizer. + + var Token = function Token(p) { + this.type = p.type; + this.value = p.value; + this.start = p.start; + this.end = p.end; + if (p.options.locations) + { this.loc = new SourceLocation(p, p.startLoc, p.endLoc); } + if (p.options.ranges) + { this.range = [p.start, p.end]; } + }; + + // ## Tokenizer + + var pp$9 = Parser.prototype; + + // Move to the next token + + pp$9.next = function(ignoreEscapeSequenceInKeyword) { + if (!ignoreEscapeSequenceInKeyword && this.type.keyword && this.containsEsc) + { this.raiseRecoverable(this.start, "Escape sequence in keyword " + this.type.keyword); } + if (this.options.onToken) + { this.options.onToken(new Token(this)); } + + this.lastTokEnd = this.end; + this.lastTokStart = this.start; + this.lastTokEndLoc = this.endLoc; + this.lastTokStartLoc = this.startLoc; + this.nextToken(); + }; + + pp$9.getToken = function() { + this.next(); + return new Token(this) + }; + + // If we're in an ES6 environment, make parsers iterable + if (typeof Symbol !== "undefined") + { pp$9[Symbol.iterator] = function() { + var this$1$1 = this; + + return { + next: function () { + var token = this$1$1.getToken(); return { - name, - type, - origin: 'constants', - signature: variableSignature, - xProperty: ast.property, - }; - case 'this.constants.value[][]': { - if (typeof ast.object.object.property.name !== 'string') { - throw this.astErrorOutput('Unexpected expression', ast); + done: token.type === types.eof, + value: token } - name = ast.object.object.property.name; - type = this.getConstantType(name); - if (!type) { - throw this.astErrorOutput('Constant has no type', ast); - } - return { - name, - type, - origin: 'constants', - signature: variableSignature, - yProperty: ast.object.property, - xProperty: ast.property, - }; } - case 'this.constants.value[][][]': { - if (typeof ast.object.object.object.property.name !== 'string') { - throw this.astErrorOutput('Unexpected expression', ast); - } - name = ast.object.object.object.property.name; - type = this.getConstantType(name); - if (!type) { - throw this.astErrorOutput('Constant has no type', ast); - } - return { - name, - type, - origin: 'constants', - signature: variableSignature, - zProperty: ast.object.object.property, - yProperty: ast.object.property, - xProperty: ast.property, - }; + } + }; } + + // Toggle strict mode. Re-reads the next number or string to please + // pedantic tests (`"use strict"; 010;` should fail). + + pp$9.curContext = function() { + return this.context[this.context.length - 1] + }; + + // Read a single token, updating the parser object's token-related + // properties. + + pp$9.nextToken = function() { + var curContext = this.curContext(); + if (!curContext || !curContext.preserveSpace) { this.skipSpace(); } + + this.start = this.pos; + if (this.options.locations) { this.startLoc = this.curPosition(); } + if (this.pos >= this.input.length) { return this.finishToken(types.eof) } + + if (curContext.override) { return curContext.override(this) } + else { this.readToken(this.fullCharCodeAtPos()); } + }; + + pp$9.readToken = function(code) { + // Identifier or keyword. '\uXXXX' sequences are allowed in + // identifiers, so '\' also dispatches to that. + if (isIdentifierStart(code, this.options.ecmaVersion >= 6) || code === 92 /* '\' */) + { return this.readWord() } + + return this.getTokenFromCode(code) + }; + + pp$9.fullCharCodeAtPos = function() { + var code = this.input.charCodeAt(this.pos); + if (code <= 0xd7ff || code >= 0xe000) { return code } + var next = this.input.charCodeAt(this.pos + 1); + return (code << 10) + next - 0x35fdc00 + }; + + pp$9.skipBlockComment = function() { + var startLoc = this.options.onComment && this.curPosition(); + var start = this.pos, end = this.input.indexOf("*/", this.pos += 2); + if (end === -1) { this.raise(this.pos - 2, "Unterminated comment"); } + this.pos = end + 2; + if (this.options.locations) { + lineBreakG.lastIndex = start; + var match; + while ((match = lineBreakG.exec(this.input)) && match.index < this.pos) { + ++this.curLine; + this.lineStart = match.index + match[0].length; + } + } + if (this.options.onComment) + { this.options.onComment(true, this.input.slice(start + 2, end), start, this.pos, + startLoc, this.curPosition()); } + }; + + pp$9.skipLineComment = function(startSkip) { + var start = this.pos; + var startLoc = this.options.onComment && this.curPosition(); + var ch = this.input.charCodeAt(this.pos += startSkip); + while (this.pos < this.input.length && !isNewLine(ch)) { + ch = this.input.charCodeAt(++this.pos); + } + if (this.options.onComment) + { this.options.onComment(false, this.input.slice(start + startSkip, this.pos), start, this.pos, + startLoc, this.curPosition()); } + }; + + // Called at the start of the parse and after every token. Skips + // whitespace and comments, and. + + pp$9.skipSpace = function() { + loop: while (this.pos < this.input.length) { + var ch = this.input.charCodeAt(this.pos); + switch (ch) { + case 32: case 160: // ' ' + ++this.pos; + break + case 13: + if (this.input.charCodeAt(this.pos + 1) === 10) { + ++this.pos; } - case 'fn()[]': - case 'fn()[][]': - case '[][]': - return { - signature: variableSignature, - property: ast.property, - }; + case 10: case 8232: case 8233: + ++this.pos; + if (this.options.locations) { + ++this.curLine; + this.lineStart = this.pos; + } + break + case 47: // '/' + switch (this.input.charCodeAt(this.pos + 1)) { + case 42: // '*' + this.skipBlockComment(); + break + case 47: + this.skipLineComment(2); + break default: - throw this.astErrorOutput('Unexpected expression', ast); + break loop + } + break + default: + if (ch > 8 && ch < 14 || ch >= 5760 && nonASCIIwhitespace.test(String.fromCharCode(ch))) { + ++this.pos; + } else { + break loop + } + } } - } + }; - findIdentifierOrigin(astToFind) { - const stack = [this.ast]; + // Called at the end of every token. Sets `end`, `val`, and + // maintains `context` and `exprAllowed`, and skips the space after + // the token, so that the next one's `start` will point at the + // right position. - while (stack.length > 0) { - const atNode = stack[0]; - if (atNode.type === 'VariableDeclarator' && atNode.id && atNode.id.name && atNode.id.name === astToFind.name) { - return atNode; - } - stack.shift(); - if (atNode.argument) { - stack.push(atNode.argument); - } else if (atNode.body) { - stack.push(atNode.body); - } else if (atNode.declarations) { - stack.push(atNode.declarations); - } else if (Array.isArray(atNode)) { - for (let i = 0; i < atNode.length; i++) { - stack.push(atNode[i]); - } + pp$9.finishToken = function(type, val) { + this.end = this.pos; + if (this.options.locations) { this.endLoc = this.curPosition(); } + var prevType = this.type; + this.type = type; + this.value = val; + + this.updateContext(prevType); + }; + + // ### Token reading + + // This is the function that is called to fetch the next token. It + // is somewhat obscure, because it works in character codes rather + // than characters, and because operator parsing has been inlined + // into it. + // + // All in the name of speed. + // + pp$9.readToken_dot = function() { + var next = this.input.charCodeAt(this.pos + 1); + if (next >= 48 && next <= 57) { return this.readNumber(true) } + var next2 = this.input.charCodeAt(this.pos + 2); + if (this.options.ecmaVersion >= 6 && next === 46 && next2 === 46) { // 46 = dot '.' + this.pos += 3; + return this.finishToken(types.ellipsis) + } else { + ++this.pos; + return this.finishToken(types.dot) + } + }; + + pp$9.readToken_slash = function() { // '/' + var next = this.input.charCodeAt(this.pos + 1); + if (this.exprAllowed) { ++this.pos; return this.readRegexp() } + if (next === 61) { return this.finishOp(types.assign, 2) } + return this.finishOp(types.slash, 1) + }; + + pp$9.readToken_mult_modulo_exp = function(code) { // '%*' + var next = this.input.charCodeAt(this.pos + 1); + var size = 1; + var tokentype = code === 42 ? types.star : types.modulo; + + // exponentiation operator ** and **= + if (this.options.ecmaVersion >= 7 && code === 42 && next === 42) { + ++size; + tokentype = types.starstar; + next = this.input.charCodeAt(this.pos + 2); + } + + if (next === 61) { return this.finishOp(types.assign, size + 1) } + return this.finishOp(tokentype, size) + }; + + pp$9.readToken_pipe_amp = function(code) { // '|&' + var next = this.input.charCodeAt(this.pos + 1); + if (next === code) { + if (this.options.ecmaVersion >= 12) { + var next2 = this.input.charCodeAt(this.pos + 2); + if (next2 === 61) { return this.finishOp(types.assign, 3) } } + return this.finishOp(code === 124 ? types.logicalOR : types.logicalAND, 2) } - return null; - } + if (next === 61) { return this.finishOp(types.assign, 2) } + return this.finishOp(code === 124 ? types.bitwiseOR : types.bitwiseAND, 1) + }; - findLastReturn(ast) { - const stack = [ast || this.ast]; + pp$9.readToken_caret = function() { // '^' + var next = this.input.charCodeAt(this.pos + 1); + if (next === 61) { return this.finishOp(types.assign, 2) } + return this.finishOp(types.bitwiseXOR, 1) + }; - while (stack.length > 0) { - const atNode = stack.pop(); - if (atNode.type === 'ReturnStatement') { - return atNode; + pp$9.readToken_plus_min = function(code) { // '+-' + var next = this.input.charCodeAt(this.pos + 1); + if (next === code) { + if (next === 45 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 62 && + (this.lastTokEnd === 0 || lineBreak.test(this.input.slice(this.lastTokEnd, this.pos)))) { + // A `-->` line comment + this.skipLineComment(3); + this.skipSpace(); + return this.nextToken() } - if (atNode.type === 'FunctionDeclaration') { - continue; + return this.finishOp(types.incDec, 2) + } + if (next === 61) { return this.finishOp(types.assign, 2) } + return this.finishOp(types.plusMin, 1) + }; + + pp$9.readToken_lt_gt = function(code) { // '<>' + var next = this.input.charCodeAt(this.pos + 1); + var size = 1; + if (next === code) { + size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2; + if (this.input.charCodeAt(this.pos + size) === 61) { return this.finishOp(types.assign, size + 1) } + return this.finishOp(types.bitShift, size) + } + if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 && + this.input.charCodeAt(this.pos + 3) === 45) { + // `` line comment\n this.skipLineComment(3);\n this.skipSpace();\n return this.nextToken()\n }\n return this.finishOp(types.incDec, 2)\n }\n if (next === 61) { return this.finishOp(types.assign, 2) }\n return this.finishOp(types.plusMin, 1)\n};\n\npp$9.readToken_lt_gt = function(code) { // '<>'\n var next = this.input.charCodeAt(this.pos + 1);\n var size = 1;\n if (next === code) {\n size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2;\n if (this.input.charCodeAt(this.pos + size) === 61) { return this.finishOp(types.assign, size + 1) }\n return this.finishOp(types.bitShift, size)\n }\n if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 &&\n this.input.charCodeAt(this.pos + 3) === 45) {\n // `` line comment\n this.skipLineComment(3);\n this.skipSpace();\n return this.nextToken()\n }\n return this.finishOp(types.incDec, 2)\n }\n if (next === 61) { return this.finishOp(types.assign, 2) }\n return this.finishOp(types.plusMin, 1)\n};\n\npp$9.readToken_lt_gt = function(code) { // '<>'\n var next = this.input.charCodeAt(this.pos + 1);\n var size = 1;\n if (next === code) {\n size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2;\n if (this.input.charCodeAt(this.pos + size) === 61) { return this.finishOp(types.assign, size + 1) }\n return this.finishOp(types.bitShift, size)\n }\n if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 &&\n this.input.charCodeAt(this.pos + 3) === 45) {\n // `` line comment this.skipLineComment(3); this.skipSpace(); return this.nextToken() @@ -3967,7 +4860,7 @@ return this.finishOp(types.plusMin, 1) }; - pp$9.readToken_lt_gt = function(code) { + pp$9.readToken_lt_gt = function(code) { // '<>' var next = this.input.charCodeAt(this.pos + 1); var size = 1; if (next === code) { @@ -3977,6 +4870,7 @@ } if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 && this.input.charCodeAt(this.pos + 3) === 45) { + // `` line comment\n this.skipLineComment(3);\n this.skipSpace();\n return this.nextToken()\n }\n return this.finishOp(types.incDec, 2)\n }\n if (next === 61) { return this.finishOp(types.assign, 2) }\n return this.finishOp(types.plusMin, 1)\n};\n\npp$9.readToken_lt_gt = function(code) { // '<>'\n var next = this.input.charCodeAt(this.pos + 1);\n var size = 1;\n if (next === code) {\n size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2;\n if (this.input.charCodeAt(this.pos + size) === 61) { return this.finishOp(types.assign, size + 1) }\n return this.finishOp(types.bitShift, size)\n }\n if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 &&\n this.input.charCodeAt(this.pos + 3) === 45) {\n // `` line comment\n this.skipLineComment(3);\n this.skipSpace();\n return this.nextToken()\n }\n return this.finishOp(types.incDec, 2)\n }\n if (next === 61) { return this.finishOp(types.assign, 2) }\n return this.finishOp(types.plusMin, 1)\n};\n\npp$9.readToken_lt_gt = function(code) { // '<>'\n var next = this.input.charCodeAt(this.pos + 1);\n var size = 1;\n if (next === code) {\n size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2;\n if (this.input.charCodeAt(this.pos + size) === 61) { return this.finishOp(types.assign, size + 1) }\n return this.finishOp(types.bitShift, size)\n }\n if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 &&\n this.input.charCodeAt(this.pos + 3) === 45) {\n // `` line comment - this.skipLineComment(3); - this.skipSpace(); - return this.nextToken() - } - return this.finishOp(types.incDec, 2) - } - if (next === 61) { return this.finishOp(types.assign, 2) } - return this.finishOp(types.plusMin, 1) - }; - - pp$9.readToken_lt_gt = function(code) { // '<>' - var next = this.input.charCodeAt(this.pos + 1); - var size = 1; - if (next === code) { - size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2; - if (this.input.charCodeAt(this.pos + size) === 61) { return this.finishOp(types.assign, size + 1) } - return this.finishOp(types.bitShift, size) - } - if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 && - this.input.charCodeAt(this.pos + 3) === 45) { - // `` line comment\n this.skipLineComment(3);\n this.skipSpace();\n return this.nextToken()\n }\n return this.finishOp(types.incDec, 2)\n }\n if (next === 61) { return this.finishOp(types.assign, 2) }\n return this.finishOp(types.plusMin, 1)\n};\n\npp$9.readToken_lt_gt = function(code) { // '<>'\n var next = this.input.charCodeAt(this.pos + 1);\n var size = 1;\n if (next === code) {\n size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2;\n if (this.input.charCodeAt(this.pos + size) === 61) { return this.finishOp(types.assign, size + 1) }\n return this.finishOp(types.bitShift, size)\n }\n if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 &&\n this.input.charCodeAt(this.pos + 3) === 45) {\n // `` line comment\n this.skipLineComment(3);\n this.skipSpace();\n return this.nextToken()\n }\n return this.finishOp(types.incDec, 2)\n }\n if (next === 61) { return this.finishOp(types.assign, 2) }\n return this.finishOp(types.plusMin, 1)\n};\n\npp$9.readToken_lt_gt = function(code) { // '<>'\n var next = this.input.charCodeAt(this.pos + 1);\n var size = 1;\n if (next === code) {\n size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2;\n if (this.input.charCodeAt(this.pos + size) === 61) { return this.finishOp(types.assign, size + 1) }\n return this.finishOp(types.bitShift, size)\n }\n if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 &&\n this.input.charCodeAt(this.pos + 3) === 45) {\n // `` line comment - this.skipLineComment(3); - this.skipSpace(); - return this.nextToken() - } - return this.finishOp(types.incDec, 2) - } - if (next === 61) { return this.finishOp(types.assign, 2) } - return this.finishOp(types.plusMin, 1) - }; - - pp$9.readToken_lt_gt = function(code) { // '<>' - var next = this.input.charCodeAt(this.pos + 1); - var size = 1; - if (next === code) { - size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2; - if (this.input.charCodeAt(this.pos + size) === 61) { return this.finishOp(types.assign, size + 1) } - return this.finishOp(types.bitShift, size) - } - if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 && - this.input.charCodeAt(this.pos + 3) === 45) { - // `` line comment\n this.skipLineComment(3);\n this.skipSpace();\n return this.nextToken()\n }\n return this.finishOp(types.incDec, 2)\n }\n if (next === 61) { return this.finishOp(types.assign, 2) }\n return this.finishOp(types.plusMin, 1)\n};\n\npp$9.readToken_lt_gt = function(code) { // '<>'\n var next = this.input.charCodeAt(this.pos + 1);\n var size = 1;\n if (next === code) {\n size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2;\n if (this.input.charCodeAt(this.pos + size) === 61) { return this.finishOp(types.assign, size + 1) }\n return this.finishOp(types.bitShift, size)\n }\n if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 &&\n this.input.charCodeAt(this.pos + 3) === 45) {\n // `` line comment\n this.skipLineComment(3);\n this.skipSpace();\n return this.nextToken()\n }\n return this.finishOp(types.incDec, 2)\n }\n if (next === 61) { return this.finishOp(types.assign, 2) }\n return this.finishOp(types.plusMin, 1)\n};\n\npp$9.readToken_lt_gt = function(code) { // '<>'\n var next = this.input.charCodeAt(this.pos + 1);\n var size = 1;\n if (next === code) {\n size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2;\n if (this.input.charCodeAt(this.pos + size) === 61) { return this.finishOp(types.assign, size + 1) }\n return this.finishOp(types.bitShift, size)\n }\n if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 &&\n this.input.charCodeAt(this.pos + 3) === 45) {\n // `\n'; const files = readDirDeepSync(rootPath, { - patterns: [ - '**/*.js' - ], - ignore: [ - '*.js' - ] - }) + patterns: [ + '**/*.js' + ], + ignore: [ + '*.js' + ] + }) .map(file => file.replace(/^test\//, '')); return gulp.src(`${folder}/all-template.html`) .pipe(replace('{{test-files}}', warning + files.map(file => ``).join('\n'))) .pipe(rename(testFile)) .pipe(gulp.dest(folder)); -}); - -gulp.task('make', gulp.series('build', 'beautify', 'minify', 'build-tests')); - +}); \ No newline at end of file diff --git a/package.json b/package.json index 5ab4d028..cd382d70 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,6 @@ "node": ">=8.0.0" }, "main": "./src/index.js", - "type": "module", "files": [ "src", "dist" @@ -42,6 +41,7 @@ "gulp-replace": "^1.0.0", "gulp-strip-comments": "^2.4.5", "gulp-uglify-es": "^3.0.0", + "js-beautify": "^1.14.7", "merge-stream": "^1.0.1", "qunit": "^2.9.1", "read-dir-deep": "^7.0.1", @@ -53,10 +53,8 @@ "scripts": { "test": "qunit test/issues test/internal test/features", "coverage": "c8 qunit test/issues test/internal test/features", - "setup": "npm i -g gulp-cli", - "make": "gulp make", - "build": "rollup -c", - "docs": "doxdox ./src --layout bootstrap --output docs.html" + "lint": "js-beautify --config .jsbeautify -f *.js src/**/*.js test/**/*.js", + "build": "rollup -c --bundleConfigAsCjs" }, "repository": { "type": "git", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 636aec61..2e22bfff 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -21,6 +21,7 @@ specifiers: gulp-replace: ^1.0.0 gulp-strip-comments: ^2.4.5 gulp-uglify-es: ^3.0.0 + js-beautify: ^1.14.7 merge-stream: ^1.0.1 qunit: ^2.9.1 read-dir-deep: ^7.0.1 @@ -54,6 +55,7 @@ devDependencies: gulp-replace: 1.1.4 gulp-strip-comments: 2.5.2 gulp-uglify-es: 3.0.0 + js-beautify: 1.14.7 merge-stream: 1.0.1 qunit: 2.19.4 read-dir-deep: 7.0.1 diff --git a/rollup.config.js b/rollup.config.js index 034adc2c..a29fc1dd 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -23,47 +23,47 @@ const banner = `/** */` function buildBrowser(isCore) { - function makeOutput(minify) { - const coreExt = isCore ? '-core' : '' - const ext = minify ? '.min.js' : '.js' - return { - banner, - file: './dist/gpu-browser' + coreExt + ext, - name: 'GPU', - format: 'umd', - plugins: minify ? [terser()] : [], - sourcemap: true, - globals: { - acorn: 'acorn' - } - } + function makeOutput(minify) { + const coreExt = isCore ? '-core' : '' + const ext = minify ? '.min.js' : '.js' + return { + banner, + file: './dist/gpu-browser' + coreExt + ext, + name: 'GPU', + format: 'umd', + plugins: minify ? [terser()] : [], + sourcemap: true, + globals: { + acorn: 'acorn' + } } + } - return defineConfig({ - input: './src/browser.js', - plugins: [ - resolve(), - commonjs(), - replace({ - 'process.version': false, - preventAssignment: true, - }) - ], - output: [ - makeOutput(false), - makeOutput(true), - ], - onwarn(msg, warn) { - if (!/Circular/.test(msg)) { - warn(msg) - } - }, + return defineConfig({ + input: './src/browser.js', + plugins: [ + resolve(), + commonjs(), + replace({ + 'process.version': false, + preventAssignment: true, + }) + ], + output: [ + makeOutput(false), + makeOutput(true), + ], + onwarn(msg, warn) { + if (!/Circular/.test(msg)) { + warn(msg) + } + }, - external: isCore ? ['acron'] : [], - }) + external: isCore ? ['acron'] : [], + }) } export default [ - buildBrowser(true), - buildBrowser(false) -] + buildBrowser(true), + buildBrowser(false) +] \ No newline at end of file diff --git a/src/alias.js b/src/alias.js index 6346852c..8c453ef9 100644 --- a/src/alias.js +++ b/src/alias.js @@ -11,4 +11,4 @@ export function alias(name, source) { return new Function(`return function ${ name } (${ utils.getArgumentNamesFromString(fnString).join(', ') }) { ${ utils.getFunctionBodyFromString(fnString) } }`)(); -} +} \ No newline at end of file diff --git a/src/backend/cpu/function-node.js b/src/backend/cpu/function-node.js index c150943c..50bde8cd 100644 --- a/src/backend/cpu/function-node.js +++ b/src/backend/cpu/function-node.js @@ -661,4 +661,4 @@ export class CPUFunctionNode extends FunctionNode { retArr.push('debugger;'); return retArr; } -} +} \ No newline at end of file diff --git a/src/backend/cpu/kernel-string.js b/src/backend/cpu/kernel-string.js index 485bc766..3e933c6c 100644 --- a/src/backend/cpu/kernel-string.js +++ b/src/backend/cpu/kernel-string.js @@ -178,4 +178,4 @@ ${cpuKernel._kernelString} ${ beforeReturn.join('\n') } return kernel; }`; -} +} \ No newline at end of file diff --git a/src/backend/cpu/kernel.js b/src/backend/cpu/kernel.js index 28b4661a..97051663 100644 --- a/src/backend/cpu/kernel.js +++ b/src/backend/cpu/kernel.js @@ -666,4 +666,4 @@ export class CPUKernel extends Kernel { hasPrependString(value) { return this._prependedString.indexOf(value) > -1; } -} +} \ No newline at end of file diff --git a/src/backend/function-builder.js b/src/backend/function-builder.js index 76ca37d7..055ed86d 100644 --- a/src/backend/function-builder.js +++ b/src/backend/function-builder.js @@ -620,4 +620,4 @@ export class FunctionBuilder { } return result; } -} +} \ No newline at end of file diff --git a/src/backend/function-node.js b/src/backend/function-node.js index 1b05f886..54046c50 100644 --- a/src/backend/function-node.js +++ b/src/backend/function-node.js @@ -382,192 +382,192 @@ export class FunctionNode { } else { return 'Number'; } - case 'AssignmentExpression': - return this.getType(ast.left); - case 'CallExpression': - if (this.isAstMathFunction(ast)) { - return 'Number'; + case 'AssignmentExpression': + return this.getType(ast.left); + case 'CallExpression': + if (this.isAstMathFunction(ast)) { + return 'Number'; + } + if (!ast.callee || !ast.callee.name) { + if (ast.callee.type === 'SequenceExpression' && ast.callee.expressions[ast.callee.expressions.length - 1].property.name) { + const functionName = ast.callee.expressions[ast.callee.expressions.length - 1].property.name; + this.inferArgumentTypesIfNeeded(functionName, ast.arguments); + return this.lookupReturnType(functionName, ast, this); } - if (!ast.callee || !ast.callee.name) { - if (ast.callee.type === 'SequenceExpression' && ast.callee.expressions[ast.callee.expressions.length - 1].property.name) { - const functionName = ast.callee.expressions[ast.callee.expressions.length - 1].property.name; - this.inferArgumentTypesIfNeeded(functionName, ast.arguments); - return this.lookupReturnType(functionName, ast, this); - } - if (this.getVariableSignature(ast.callee, true) === 'this.color') { - return null; - } - if (ast.callee.type === 'MemberExpression' && ast.callee.object && ast.callee.property && ast.callee.property.name && ast.arguments) { - const functionName = ast.callee.property.name; - this.inferArgumentTypesIfNeeded(functionName, ast.arguments); - return this.lookupReturnType(functionName, ast, this); - } - throw this.astErrorOutput('Unknown call expression', ast); + if (this.getVariableSignature(ast.callee, true) === 'this.color') { + return null; } - if (ast.callee && ast.callee.name) { - const functionName = ast.callee.name; + if (ast.callee.type === 'MemberExpression' && ast.callee.object && ast.callee.property && ast.callee.property.name && ast.arguments) { + const functionName = ast.callee.property.name; this.inferArgumentTypesIfNeeded(functionName, ast.arguments); return this.lookupReturnType(functionName, ast, this); } - throw this.astErrorOutput(`Unhandled getType Type "${ ast.type }"`, ast); - case 'LogicalExpression': - return 'Boolean'; - case 'BinaryExpression': - // modulos is Number - switch (ast.operator) { - case '%': - case '/': - if (this.fixIntegerDivisionAccuracy) { - return 'Number'; - } else { - break; - } - case '>': - case '<': - return 'Boolean'; - case '&': - case '|': - case '^': - case '<<': - case '>>': - case '>>>': - return 'Integer'; - } - const type = this.getType(ast.left); - if (this.isState('skip-literal-correction')) return type; - if (type === 'LiteralInteger') { - const rightType = this.getType(ast.right); - if (rightType === 'LiteralInteger') { - if (ast.left.value % 1 === 0) { - return 'Integer'; - } else { - return 'Float'; - } + throw this.astErrorOutput('Unknown call expression', ast); + } + if (ast.callee && ast.callee.name) { + const functionName = ast.callee.name; + this.inferArgumentTypesIfNeeded(functionName, ast.arguments); + return this.lookupReturnType(functionName, ast, this); + } + throw this.astErrorOutput(`Unhandled getType Type "${ ast.type }"`, ast); + case 'LogicalExpression': + return 'Boolean'; + case 'BinaryExpression': + // modulos is Number + switch (ast.operator) { + case '%': + case '/': + if (this.fixIntegerDivisionAccuracy) { + return 'Number'; + } else { + break; } - return rightType; - } - return typeLookupMap[type] || type; - case 'UpdateExpression': - return this.getType(ast.argument); - case 'UnaryExpression': - if (ast.operator === '~') { + case '>': + case '<': + return 'Boolean'; + case '&': + case '|': + case '^': + case '<<': + case '>>': + case '>>>': return 'Integer'; - } - return this.getType(ast.argument); - case 'VariableDeclaration': { - const declarations = ast.declarations; - let lastType; - for (let i = 0; i < declarations.length; i++) { - const declaration = declarations[i]; - lastType = this.getType(declaration); - } - if (!lastType) { - throw this.astErrorOutput(`Unable to find type for declaration`, ast); - } - return lastType; } - case 'VariableDeclarator': - const declaration = this.getDeclaration(ast.id); - if (!declaration) { - throw this.astErrorOutput(`Unable to find declarator`, ast); + const type = this.getType(ast.left); + if (this.isState('skip-literal-correction')) return type; + if (type === 'LiteralInteger') { + const rightType = this.getType(ast.right); + if (rightType === 'LiteralInteger') { + if (ast.left.value % 1 === 0) { + return 'Integer'; + } else { + return 'Float'; + } } + return rightType; + } + return typeLookupMap[type] || type; + case 'UpdateExpression': + return this.getType(ast.argument); + case 'UnaryExpression': + if (ast.operator === '~') { + return 'Integer'; + } + return this.getType(ast.argument); + case 'VariableDeclaration': { + const declarations = ast.declarations; + let lastType; + for (let i = 0; i < declarations.length; i++) { + const declaration = declarations[i]; + lastType = this.getType(declaration); + } + if (!lastType) { + throw this.astErrorOutput(`Unable to find type for declaration`, ast); + } + return lastType; + } + case 'VariableDeclarator': + const declaration = this.getDeclaration(ast.id); + if (!declaration) { + throw this.astErrorOutput(`Unable to find declarator`, ast); + } - if (!declaration.valueType) { - throw this.astErrorOutput(`Unable to find declarator valueType`, ast); - } + if (!declaration.valueType) { + throw this.astErrorOutput(`Unable to find declarator valueType`, ast); + } - return declaration.valueType; - case 'Identifier': - if (ast.name === 'Infinity') { - return 'Number'; - } - if (this.isAstVariable(ast)) { - const signature = this.getVariableSignature(ast); - if (signature === 'value') { - return this.getCheckVariableType(ast); - } - } - const origin = this.findIdentifierOrigin(ast); - if (origin && origin.init) { - return this.getType(origin.init); + return declaration.valueType; + case 'Identifier': + if (ast.name === 'Infinity') { + return 'Number'; + } + if (this.isAstVariable(ast)) { + const signature = this.getVariableSignature(ast); + if (signature === 'value') { + return this.getCheckVariableType(ast); } - return null; - case 'ReturnStatement': - return this.getType(ast.argument); - case 'MemberExpression': - if (this.isAstMathFunction(ast)) { - switch (ast.property.name) { - case 'ceil': - return 'Integer'; - case 'floor': - return 'Integer'; - case 'round': - return 'Integer'; - } - return 'Number'; + } + const origin = this.findIdentifierOrigin(ast); + if (origin && origin.init) { + return this.getType(origin.init); + } + return null; + case 'ReturnStatement': + return this.getType(ast.argument); + case 'MemberExpression': + if (this.isAstMathFunction(ast)) { + switch (ast.property.name) { + case 'ceil': + return 'Integer'; + case 'floor': + return 'Integer'; + case 'round': + return 'Integer'; } - if (this.isAstVariable(ast)) { - const variableSignature = this.getVariableSignature(ast); - switch (variableSignature) { - case 'value[]': - return this.getLookupType(this.getCheckVariableType(ast.object)); - case 'value[][]': - return this.getLookupType(this.getCheckVariableType(ast.object.object)); - case 'value[][][]': - return this.getLookupType(this.getCheckVariableType(ast.object.object.object)); - case 'value[][][][]': - return this.getLookupType(this.getCheckVariableType(ast.object.object.object.object)); - case 'value.thread.value': - case 'this.thread.value': - return 'Integer'; - case 'this.output.value': - return this.dynamicOutput ? 'Integer' : 'LiteralInteger'; - case 'this.constants.value': - return this.getConstantType(ast.property.name); - case 'this.constants.value[]': - return this.getLookupType(this.getConstantType(ast.object.property.name)); - case 'this.constants.value[][]': - return this.getLookupType(this.getConstantType(ast.object.object.property.name)); - case 'this.constants.value[][][]': - return this.getLookupType(this.getConstantType(ast.object.object.object.property.name)); - case 'this.constants.value[][][][]': - return this.getLookupType(this.getConstantType(ast.object.object.object.object.property.name)); - case 'fn()[]': - case 'fn()[][]': - case 'fn()[][][]': - return this.getLookupType(this.getType(ast.object)); - case 'value.value': - if (this.isAstMathVariable(ast)) { - return 'Number'; - } - switch (ast.property.name) { - case 'r': - case 'g': - case 'b': - case 'a': - return this.getLookupType(this.getCheckVariableType(ast.object)); - } - case '[][]': - return 'Number'; - } - throw this.astErrorOutput('Unhandled getType MemberExpression', ast); + return 'Number'; + } + if (this.isAstVariable(ast)) { + const variableSignature = this.getVariableSignature(ast); + switch (variableSignature) { + case 'value[]': + return this.getLookupType(this.getCheckVariableType(ast.object)); + case 'value[][]': + return this.getLookupType(this.getCheckVariableType(ast.object.object)); + case 'value[][][]': + return this.getLookupType(this.getCheckVariableType(ast.object.object.object)); + case 'value[][][][]': + return this.getLookupType(this.getCheckVariableType(ast.object.object.object.object)); + case 'value.thread.value': + case 'this.thread.value': + return 'Integer'; + case 'this.output.value': + return this.dynamicOutput ? 'Integer' : 'LiteralInteger'; + case 'this.constants.value': + return this.getConstantType(ast.property.name); + case 'this.constants.value[]': + return this.getLookupType(this.getConstantType(ast.object.property.name)); + case 'this.constants.value[][]': + return this.getLookupType(this.getConstantType(ast.object.object.property.name)); + case 'this.constants.value[][][]': + return this.getLookupType(this.getConstantType(ast.object.object.object.property.name)); + case 'this.constants.value[][][][]': + return this.getLookupType(this.getConstantType(ast.object.object.object.object.property.name)); + case 'fn()[]': + case 'fn()[][]': + case 'fn()[][][]': + return this.getLookupType(this.getType(ast.object)); + case 'value.value': + if (this.isAstMathVariable(ast)) { + return 'Number'; + } + switch (ast.property.name) { + case 'r': + case 'g': + case 'b': + case 'a': + return this.getLookupType(this.getCheckVariableType(ast.object)); + } + case '[][]': + return 'Number'; } throw this.astErrorOutput('Unhandled getType MemberExpression', ast); - case 'ConditionalExpression': - return this.getType(ast.consequent); - case 'FunctionDeclaration': - case 'FunctionExpression': - const lastReturn = this.findLastReturn(ast.body); - if (lastReturn) { - return this.getType(lastReturn); - } - return null; - case 'IfStatement': - return this.getType(ast.consequent); - case 'SequenceExpression': - return this.getType(ast.expressions[ast.expressions.length - 1]); - default: - throw this.astErrorOutput(`Unhandled getType Type "${ ast.type }"`, ast); + } + throw this.astErrorOutput('Unhandled getType MemberExpression', ast); + case 'ConditionalExpression': + return this.getType(ast.consequent); + case 'FunctionDeclaration': + case 'FunctionExpression': + const lastReturn = this.findLastReturn(ast.body); + if (lastReturn) { + return this.getType(lastReturn); + } + return null; + case 'IfStatement': + return this.getType(ast.consequent); + case 'SequenceExpression': + return this.getType(ast.expressions[ast.expressions.length - 1]); + default: + throw this.astErrorOutput(`Unhandled getType Type "${ ast.type }"`, ast); } } @@ -789,10 +789,10 @@ export class FunctionNode { } return dependencies; } - case 'SequenceExpression': - return this.getDependencies(ast.expressions, dependencies, isNotSafe); - default: - throw this.astErrorOutput(`Unhandled type ${ ast.type } in getDependencies`, ast); + case 'SequenceExpression': + return this.getDependencies(ast.expressions, dependencies, isNotSafe); + default: + throw this.astErrorOutput(`Unhandled type ${ ast.type } in getDependencies`, ast); } return dependencies; } @@ -1304,83 +1304,83 @@ export class FunctionNode { default: throw this.astErrorOutput('Unexpected expression', ast); } - case 'this.constants.value': - if (typeof ast.property.name !== 'string') { - throw this.astErrorOutput('Unexpected expression', ast); - } - name = ast.property.name; - type = this.getConstantType(name); - if (!type) { - throw this.astErrorOutput('Constant has no type', ast); - } - return { - name, - type, - origin: 'constants', - signature: variableSignature, - }; - case 'this.constants.value[]': - if (typeof ast.object.property.name !== 'string') { - throw this.astErrorOutput('Unexpected expression', ast); - } - name = ast.object.property.name; - type = this.getConstantType(name); - if (!type) { - throw this.astErrorOutput('Constant has no type', ast); - } - return { - name, - type, - origin: 'constants', - signature: variableSignature, - xProperty: ast.property, - }; - case 'this.constants.value[][]': { - if (typeof ast.object.object.property.name !== 'string') { - throw this.astErrorOutput('Unexpected expression', ast); - } - name = ast.object.object.property.name; - type = this.getConstantType(name); - if (!type) { - throw this.astErrorOutput('Constant has no type', ast); - } - return { - name, - type, - origin: 'constants', + case 'this.constants.value': + if (typeof ast.property.name !== 'string') { + throw this.astErrorOutput('Unexpected expression', ast); + } + name = ast.property.name; + type = this.getConstantType(name); + if (!type) { + throw this.astErrorOutput('Constant has no type', ast); + } + return { + name, + type, + origin: 'constants', signature: variableSignature, - yProperty: ast.object.property, - xProperty: ast.property, - }; + }; + case 'this.constants.value[]': + if (typeof ast.object.property.name !== 'string') { + throw this.astErrorOutput('Unexpected expression', ast); } - case 'this.constants.value[][][]': { - if (typeof ast.object.object.object.property.name !== 'string') { - throw this.astErrorOutput('Unexpected expression', ast); - } - name = ast.object.object.object.property.name; - type = this.getConstantType(name); - if (!type) { - throw this.astErrorOutput('Constant has no type', ast); - } - return { - name, - type, - origin: 'constants', + name = ast.object.property.name; + type = this.getConstantType(name); + if (!type) { + throw this.astErrorOutput('Constant has no type', ast); + } + return { + name, + type, + origin: 'constants', signature: variableSignature, - zProperty: ast.object.object.property, - yProperty: ast.object.property, xProperty: ast.property, - }; + }; + case 'this.constants.value[][]': { + if (typeof ast.object.object.property.name !== 'string') { + throw this.astErrorOutput('Unexpected expression', ast); } - case 'fn()[]': - case 'fn()[][]': - case '[][]': - return { - signature: variableSignature, - property: ast.property, - }; - default: + name = ast.object.object.property.name; + type = this.getConstantType(name); + if (!type) { + throw this.astErrorOutput('Constant has no type', ast); + } + return { + name, + type, + origin: 'constants', + signature: variableSignature, + yProperty: ast.object.property, + xProperty: ast.property, + }; + } + case 'this.constants.value[][][]': { + if (typeof ast.object.object.object.property.name !== 'string') { throw this.astErrorOutput('Unexpected expression', ast); + } + name = ast.object.object.object.property.name; + type = this.getConstantType(name); + if (!type) { + throw this.astErrorOutput('Constant has no type', ast); + } + return { + name, + type, + origin: 'constants', + signature: variableSignature, + zProperty: ast.object.object.property, + yProperty: ast.object.property, + xProperty: ast.property, + }; + } + case 'fn()[]': + case 'fn()[][]': + case '[][]': + return { + signature: variableSignature, + property: ast.property, + }; + default: + throw this.astErrorOutput('Unexpected expression', ast); } } @@ -1491,4 +1491,4 @@ const typeLookupMap = { 'ArrayTexture(2)': 'Array(2)', 'ArrayTexture(3)': 'Array(3)', 'ArrayTexture(4)': 'Array(4)', -}; +}; \ No newline at end of file diff --git a/src/backend/function-tracer.js b/src/backend/function-tracer.js index 2a530556..35195bd4 100644 --- a/src/backend/function-tracer.js +++ b/src/backend/function-tracer.js @@ -304,4 +304,4 @@ export class FunctionTracer { throw new Error(`unhandled type "${ast.type}"`); } } -} +} \ No newline at end of file diff --git a/src/backend/gl/kernel-string.js b/src/backend/gl/kernel-string.js index 37083809..ea5e7519 100644 --- a/src/backend/gl/kernel-string.js +++ b/src/backend/gl/kernel-string.js @@ -359,4 +359,4 @@ function findKernelValue(argument, kernelValues, values, context, uploadedValues return variable; } return null; -} +} \ No newline at end of file diff --git a/src/backend/gl/kernel.js b/src/backend/gl/kernel.js index 2425f0a4..c387dc55 100644 --- a/src/backend/gl/kernel.js +++ b/src/backend/gl/kernel.js @@ -395,10 +395,10 @@ export class GLKernel extends Kernel { this.TextureConstructor = GLTextureUnsigned; return null; } - case 'Array(2)': - case 'Array(3)': - case 'Array(4)': - return this.requestFallback(args); + case 'Array(2)': + case 'Array(3)': + case 'Array(4)': + return this.requestFallback(args); } } else { if (this.subKernels !== null) { @@ -423,10 +423,10 @@ export class GLKernel extends Kernel { this.formatValues = utils.erectPackedFloat; return null; } - case 'Array(2)': - case 'Array(3)': - case 'Array(4)': - return this.requestFallback(args); + case 'Array(2)': + case 'Array(3)': + case 'Array(4)': + return this.requestFallback(args); } } } else if (this.precision === 'single') { @@ -1052,4 +1052,4 @@ const typeMap = { vec2: 'Array(2)', vec3: 'Array(3)', vec4: 'Array(4)', -}; +}; \ No newline at end of file diff --git a/src/backend/gl/texture/array-2-float-2d.js b/src/backend/gl/texture/array-2-float-2d.js index 7fb9f80f..b4745fe0 100644 --- a/src/backend/gl/texture/array-2-float-2d.js +++ b/src/backend/gl/texture/array-2-float-2d.js @@ -9,4 +9,4 @@ export class GLTextureArray2Float2D extends GLTextureFloat { toArray() { return utils.erect2DArray2(this.renderValues(), this.output[0], this.output[1]); } -} +} \ No newline at end of file diff --git a/src/backend/gl/texture/array-2-float-3d.js b/src/backend/gl/texture/array-2-float-3d.js index 25510f93..e07ba4de 100644 --- a/src/backend/gl/texture/array-2-float-3d.js +++ b/src/backend/gl/texture/array-2-float-3d.js @@ -9,4 +9,4 @@ export class GLTextureArray2Float3D extends GLTextureFloat { toArray() { return utils.erect3DArray2(this.renderValues(), this.output[0], this.output[1], this.output[2]); } -} +} \ No newline at end of file diff --git a/src/backend/gl/texture/array-2-float.js b/src/backend/gl/texture/array-2-float.js index 7fe7442f..8750e414 100644 --- a/src/backend/gl/texture/array-2-float.js +++ b/src/backend/gl/texture/array-2-float.js @@ -9,4 +9,4 @@ export class GLTextureArray2Float extends GLTextureFloat { toArray() { return utils.erectArray2(this.renderValues(), this.output[0], this.output[1]); } -} +} \ No newline at end of file diff --git a/src/backend/gl/texture/array-3-float-2d.js b/src/backend/gl/texture/array-3-float-2d.js index b4e72b52..e35e504b 100644 --- a/src/backend/gl/texture/array-3-float-2d.js +++ b/src/backend/gl/texture/array-3-float-2d.js @@ -9,4 +9,4 @@ export class GLTextureArray3Float2D extends GLTextureFloat { toArray() { return utils.erect2DArray3(this.renderValues(), this.output[0], this.output[1]); } -} +} \ No newline at end of file diff --git a/src/backend/gl/texture/array-3-float-3d.js b/src/backend/gl/texture/array-3-float-3d.js index b4cdbaf3..5e258cc5 100644 --- a/src/backend/gl/texture/array-3-float-3d.js +++ b/src/backend/gl/texture/array-3-float-3d.js @@ -9,4 +9,4 @@ export class GLTextureArray3Float3D extends GLTextureFloat { toArray() { return utils.erect3DArray3(this.renderValues(), this.output[0], this.output[1], this.output[2]); } -} +} \ No newline at end of file diff --git a/src/backend/gl/texture/array-3-float.js b/src/backend/gl/texture/array-3-float.js index 01fe4fe0..570869a8 100644 --- a/src/backend/gl/texture/array-3-float.js +++ b/src/backend/gl/texture/array-3-float.js @@ -9,4 +9,4 @@ export class GLTextureArray3Float extends GLTextureFloat { toArray() { return utils.erectArray3(this.renderValues(), this.output[0]); } -} +} \ No newline at end of file diff --git a/src/backend/gl/texture/array-4-float-2d.js b/src/backend/gl/texture/array-4-float-2d.js index 9a1df32c..21609cde 100644 --- a/src/backend/gl/texture/array-4-float-2d.js +++ b/src/backend/gl/texture/array-4-float-2d.js @@ -9,4 +9,4 @@ export class GLTextureArray4Float2D extends GLTextureFloat { toArray() { return utils.erect2DArray4(this.renderValues(), this.output[0], this.output[1]); } -} +} \ No newline at end of file diff --git a/src/backend/gl/texture/array-4-float-3d.js b/src/backend/gl/texture/array-4-float-3d.js index 1c6496cc..6a414b77 100644 --- a/src/backend/gl/texture/array-4-float-3d.js +++ b/src/backend/gl/texture/array-4-float-3d.js @@ -9,4 +9,4 @@ export class GLTextureArray4Float3D extends GLTextureFloat { toArray() { return utils.erect3DArray4(this.renderValues(), this.output[0], this.output[1], this.output[2]); } -} +} \ No newline at end of file diff --git a/src/backend/gl/texture/array-4-float.js b/src/backend/gl/texture/array-4-float.js index 443ea12d..f24f9daa 100644 --- a/src/backend/gl/texture/array-4-float.js +++ b/src/backend/gl/texture/array-4-float.js @@ -9,4 +9,4 @@ export class GLTextureArray4Float extends GLTextureFloat { toArray() { return utils.erectArray4(this.renderValues(), this.output[0]); } -} +} \ No newline at end of file diff --git a/src/backend/gl/texture/float-2d.js b/src/backend/gl/texture/float-2d.js index 3ec329af..d74a3b3f 100644 --- a/src/backend/gl/texture/float-2d.js +++ b/src/backend/gl/texture/float-2d.js @@ -9,4 +9,4 @@ export class GLTextureFloat2D extends GLTextureFloat { toArray() { return utils.erect2DFloat(this.renderValues(), this.output[0], this.output[1]); } -} +} \ No newline at end of file diff --git a/src/backend/gl/texture/float-3d.js b/src/backend/gl/texture/float-3d.js index 2d29a43e..93b13dd4 100644 --- a/src/backend/gl/texture/float-3d.js +++ b/src/backend/gl/texture/float-3d.js @@ -9,4 +9,4 @@ export class GLTextureFloat3D extends GLTextureFloat { toArray() { return utils.erect3DFloat(this.renderValues(), this.output[0], this.output[1], this.output[2]); } -} +} \ No newline at end of file diff --git a/src/backend/gl/texture/float.js b/src/backend/gl/texture/float.js index 2dfe91d6..160d596f 100644 --- a/src/backend/gl/texture/float.js +++ b/src/backend/gl/texture/float.js @@ -31,4 +31,4 @@ export class GLTextureFloat extends GLTexture { toArray() { return utils.erectFloat(this.renderValues(), this.output[0]); } -} +} \ No newline at end of file diff --git a/src/backend/gl/texture/graphical.js b/src/backend/gl/texture/graphical.js index b49ec466..0a68edf4 100644 --- a/src/backend/gl/texture/graphical.js +++ b/src/backend/gl/texture/graphical.js @@ -8,4 +8,4 @@ export class GLTextureGraphical extends GLTextureUnsigned { toArray() { return this.renderValues(); } -} +} \ No newline at end of file diff --git a/src/backend/gl/texture/index.js b/src/backend/gl/texture/index.js index 2e9b7467..68084ab1 100644 --- a/src/backend/gl/texture/index.js +++ b/src/backend/gl/texture/index.js @@ -120,4 +120,4 @@ function selectTexture(gl, texture) { gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST); gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST); -} +} \ No newline at end of file diff --git a/src/backend/gl/texture/memory-optimized-2d.js b/src/backend/gl/texture/memory-optimized-2d.js index 1d45052e..463d350e 100644 --- a/src/backend/gl/texture/memory-optimized-2d.js +++ b/src/backend/gl/texture/memory-optimized-2d.js @@ -1,5 +1,5 @@ import { utils } from '../../../utils'; -import {GLTextureFloat} from './float'; +import { GLTextureFloat } from './float'; export class GLTextureMemoryOptimized2D extends GLTextureFloat { constructor(settings) { @@ -9,4 +9,4 @@ export class GLTextureMemoryOptimized2D extends GLTextureFloat { toArray() { return utils.erectMemoryOptimized2DFloat(this.renderValues(), this.output[0], this.output[1]); } -} +} \ No newline at end of file diff --git a/src/backend/gl/texture/memory-optimized-3d.js b/src/backend/gl/texture/memory-optimized-3d.js index 8935f702..665df2c5 100644 --- a/src/backend/gl/texture/memory-optimized-3d.js +++ b/src/backend/gl/texture/memory-optimized-3d.js @@ -9,4 +9,4 @@ export class GLTextureMemoryOptimized3D extends GLTextureFloat { toArray() { return utils.erectMemoryOptimized3DFloat(this.renderValues(), this.output[0], this.output[1], this.output[2]); } -} +} \ No newline at end of file diff --git a/src/backend/gl/texture/memory-optimized.js b/src/backend/gl/texture/memory-optimized.js index 56088acb..865629d5 100644 --- a/src/backend/gl/texture/memory-optimized.js +++ b/src/backend/gl/texture/memory-optimized.js @@ -9,4 +9,4 @@ export class GLTextureMemoryOptimized extends GLTextureFloat { toArray() { return utils.erectMemoryOptimizedFloat(this.renderValues(), this.output[0]); } -} +} \ No newline at end of file diff --git a/src/backend/gl/texture/unsigned-2d.js b/src/backend/gl/texture/unsigned-2d.js index 59dcbc74..ee273cfc 100644 --- a/src/backend/gl/texture/unsigned-2d.js +++ b/src/backend/gl/texture/unsigned-2d.js @@ -9,4 +9,4 @@ export class GLTextureUnsigned2D extends GLTextureUnsigned { toArray() { return utils.erect2DPackedFloat(this.renderValues(), this.output[0], this.output[1]); } -} +} \ No newline at end of file diff --git a/src/backend/gl/texture/unsigned-3d.js b/src/backend/gl/texture/unsigned-3d.js index c72b6364..00ba913a 100644 --- a/src/backend/gl/texture/unsigned-3d.js +++ b/src/backend/gl/texture/unsigned-3d.js @@ -9,4 +9,4 @@ export class GLTextureUnsigned3D extends GLTextureUnsigned { toArray() { return utils.erect3DPackedFloat(this.renderValues(), this.output[0], this.output[1], this.output[2]); } -} +} \ No newline at end of file diff --git a/src/backend/gl/texture/unsigned.js b/src/backend/gl/texture/unsigned.js index 5e5f5021..d8632944 100644 --- a/src/backend/gl/texture/unsigned.js +++ b/src/backend/gl/texture/unsigned.js @@ -30,4 +30,4 @@ export class GLTextureUnsigned extends GLTexture { toArray() { return utils.erectPackedFloat(this.renderValues(), this.output[0]); } -} +} \ No newline at end of file diff --git a/src/backend/headless-gl/kernel.js b/src/backend/headless-gl/kernel.js index 962ac50b..87fd5839 100644 --- a/src/backend/headless-gl/kernel.js +++ b/src/backend/headless-gl/kernel.js @@ -138,4 +138,4 @@ export class HeadlessGLKernel extends WebGLKernel { } return this; } -} +} \ No newline at end of file diff --git a/src/backend/kernel-value.js b/src/backend/kernel-value.js index 7090a679..bd0ccf1e 100644 --- a/src/backend/kernel-value.js +++ b/src/backend/kernel-value.js @@ -63,4 +63,4 @@ export class KernelValue { updateValue(value) { throw new Error(`"updateValue" not defined on ${ this.constructor.name }`); } -} +} \ No newline at end of file diff --git a/src/backend/kernel.js b/src/backend/kernel.js index 8d2eace6..6c53787f 100644 --- a/src/backend/kernel.js +++ b/src/backend/kernel.js @@ -942,4 +942,4 @@ function splitArgumentTypes(argumentTypesObject) { argumentTypes.push(argumentTypesObject[argumentName]); } return { argumentTypes, argumentNames }; -} +} \ No newline at end of file diff --git a/src/backend/web-gl/fragment-shader.js b/src/backend/web-gl/fragment-shader.js index 29123690..1ec9745f 100644 --- a/src/backend/web-gl/fragment-shader.js +++ b/src/backend/web-gl/fragment-shader.js @@ -489,4 +489,4 @@ __KERNEL__; void main(void) { index = int(vTexCoord.s * float(uTexSize.x)) + int(vTexCoord.t * float(uTexSize.y)) * uTexSize.x; __MAIN_RESULT__; -}`; +}`; \ No newline at end of file diff --git a/src/backend/web-gl/function-node.js b/src/backend/web-gl/function-node.js index b78a45c7..d336766a 100644 --- a/src/backend/web-gl/function-node.js +++ b/src/backend/web-gl/function-node.js @@ -1149,34 +1149,34 @@ export class WebGLFunctionNode extends FunctionNode { return retArr; } } - case 'this.constants.value[]': - case 'this.constants.value[][]': - case 'this.constants.value[][][]': - case 'this.constants.value[][][][]': - break; - case 'fn()[]': - this.astCallExpression(mNode.object, retArr); - retArr.push('['); - retArr.push(this.memberExpressionPropertyMarkup(property)); - retArr.push(']'); - return retArr; - case 'fn()[][]': - this.astCallExpression(mNode.object.object, retArr); - retArr.push('['); - retArr.push(this.memberExpressionPropertyMarkup(mNode.object.property)); - retArr.push(']'); - retArr.push('['); - retArr.push(this.memberExpressionPropertyMarkup(mNode.property)); - retArr.push(']'); - return retArr; - case '[][]': - this.astArrayExpression(mNode.object, retArr); - retArr.push('['); - retArr.push(this.memberExpressionPropertyMarkup(property)); - retArr.push(']'); - return retArr; - default: - throw this.astErrorOutput('Unexpected expression', mNode); + case 'this.constants.value[]': + case 'this.constants.value[][]': + case 'this.constants.value[][][]': + case 'this.constants.value[][][][]': + break; + case 'fn()[]': + this.astCallExpression(mNode.object, retArr); + retArr.push('['); + retArr.push(this.memberExpressionPropertyMarkup(property)); + retArr.push(']'); + return retArr; + case 'fn()[][]': + this.astCallExpression(mNode.object.object, retArr); + retArr.push('['); + retArr.push(this.memberExpressionPropertyMarkup(mNode.object.property)); + retArr.push(']'); + retArr.push('['); + retArr.push(this.memberExpressionPropertyMarkup(mNode.property)); + retArr.push(']'); + return retArr; + case '[][]': + this.astArrayExpression(mNode.object, retArr); + retArr.push('['); + retArr.push(this.memberExpressionPropertyMarkup(property)); + retArr.push(']'); + return retArr; + default: + throw this.astErrorOutput('Unexpected expression', mNode); } if (mNode.computed === false) { @@ -1599,4 +1599,4 @@ const typeMap = { const operatorMap = { '===': '==', '!==': '!=' -}; +}; \ No newline at end of file diff --git a/src/backend/web-gl/kernel-value-maps.js b/src/backend/web-gl/kernel-value-maps.js index 6e67321e..78e016a9 100644 --- a/src/backend/web-gl/kernel-value-maps.js +++ b/src/backend/web-gl/kernel-value-maps.js @@ -194,4 +194,4 @@ export function lookupKernelValueType(type, dynamic, precision, value) { throw new Error(`Could not find a KernelValue for ${ type }`); } return types[type]; -} +} \ No newline at end of file diff --git a/src/backend/web-gl/kernel-value/array.js b/src/backend/web-gl/kernel-value/array.js index 7c2b4e66..3c3a2106 100644 --- a/src/backend/web-gl/kernel-value/array.js +++ b/src/backend/web-gl/kernel-value/array.js @@ -83,4 +83,4 @@ export class WebGLKernelArray extends WebGLKernelValue { } this.context.deleteTexture(this.texture); } -} +} \ No newline at end of file diff --git a/src/backend/web-gl/kernel-value/array2.js b/src/backend/web-gl/kernel-value/array2.js index d0191094..080f56a5 100644 --- a/src/backend/web-gl/kernel-value/array2.js +++ b/src/backend/web-gl/kernel-value/array2.js @@ -22,4 +22,4 @@ export class WebGLKernelValueArray2 extends WebGLKernelValue { if (this.origin === 'constants') return; this.kernel.setUniform2fv(this.id, this.uploadValue = value); } -} +} \ No newline at end of file diff --git a/src/backend/web-gl/kernel-value/array3.js b/src/backend/web-gl/kernel-value/array3.js index 6158e1a4..ebc06e30 100644 --- a/src/backend/web-gl/kernel-value/array3.js +++ b/src/backend/web-gl/kernel-value/array3.js @@ -22,4 +22,4 @@ export class WebGLKernelValueArray3 extends WebGLKernelValue { if (this.origin === 'constants') return; this.kernel.setUniform3fv(this.id, this.uploadValue = value); } -} +} \ No newline at end of file diff --git a/src/backend/web-gl/kernel-value/array4.js b/src/backend/web-gl/kernel-value/array4.js index 1896d5d1..83cef99e 100644 --- a/src/backend/web-gl/kernel-value/array4.js +++ b/src/backend/web-gl/kernel-value/array4.js @@ -22,4 +22,4 @@ export class WebGLKernelValueArray4 extends WebGLKernelValue { if (this.origin === 'constants') return; this.kernel.setUniform4fv(this.id, this.uploadValue = value); } -} +} \ No newline at end of file diff --git a/src/backend/web-gl/kernel-value/boolean.js b/src/backend/web-gl/kernel-value/boolean.js index 8dbfad57..5f05fbd1 100644 --- a/src/backend/web-gl/kernel-value/boolean.js +++ b/src/backend/web-gl/kernel-value/boolean.js @@ -20,4 +20,4 @@ export class WebGLKernelValueBoolean extends WebGLKernelValue { if (this.origin === 'constants') return; this.kernel.setUniform1i(this.id, this.uploadValue = value); } -} +} \ No newline at end of file diff --git a/src/backend/web-gl/kernel-value/dynamic-html-image.js b/src/backend/web-gl/kernel-value/dynamic-html-image.js index 1b985f21..8a1e0189 100644 --- a/src/backend/web-gl/kernel-value/dynamic-html-image.js +++ b/src/backend/web-gl/kernel-value/dynamic-html-image.js @@ -19,4 +19,4 @@ export class WebGLKernelValueDynamicHTMLImage extends WebGLKernelValueHTMLImage this.kernel.setUniform2iv(this.sizeId, this.textureSize); super.updateValue(value); } -} +} \ No newline at end of file diff --git a/src/backend/web-gl/kernel-value/dynamic-html-video.js b/src/backend/web-gl/kernel-value/dynamic-html-video.js index 2a8e1b0f..7f9b7f3d 100644 --- a/src/backend/web-gl/kernel-value/dynamic-html-video.js +++ b/src/backend/web-gl/kernel-value/dynamic-html-video.js @@ -1,3 +1,3 @@ import { WebGLKernelValueDynamicHTMLImage } from './dynamic-html-image'; -export class WebGLKernelValueDynamicHTMLVideo extends WebGLKernelValueDynamicHTMLImage {} +export class WebGLKernelValueDynamicHTMLVideo extends WebGLKernelValueDynamicHTMLImage {} \ No newline at end of file diff --git a/src/backend/web-gl/kernel-value/dynamic-memory-optimized-number-texture.js b/src/backend/web-gl/kernel-value/dynamic-memory-optimized-number-texture.js index f093f76c..6a51c334 100644 --- a/src/backend/web-gl/kernel-value/dynamic-memory-optimized-number-texture.js +++ b/src/backend/web-gl/kernel-value/dynamic-memory-optimized-number-texture.js @@ -18,4 +18,4 @@ export class WebGLKernelValueDynamicMemoryOptimizedNumberTexture extends WebGLKe this.kernel.setUniform2iv(this.sizeId, this.textureSize); super.updateValue(inputTexture); } -} +} \ No newline at end of file diff --git a/src/backend/web-gl/kernel-value/dynamic-number-texture.js b/src/backend/web-gl/kernel-value/dynamic-number-texture.js index 75b18735..f5e8cd9f 100644 --- a/src/backend/web-gl/kernel-value/dynamic-number-texture.js +++ b/src/backend/web-gl/kernel-value/dynamic-number-texture.js @@ -18,4 +18,4 @@ export class WebGLKernelValueDynamicNumberTexture extends WebGLKernelValueNumber this.kernel.setUniform2iv(this.sizeId, this.textureSize); super.updateValue(value); } -} +} \ No newline at end of file diff --git a/src/backend/web-gl/kernel-value/dynamic-single-array.js b/src/backend/web-gl/kernel-value/dynamic-single-array.js index 881ec235..dffdd077 100644 --- a/src/backend/web-gl/kernel-value/dynamic-single-array.js +++ b/src/backend/web-gl/kernel-value/dynamic-single-array.js @@ -20,4 +20,4 @@ export class WebGLKernelValueDynamicSingleArray extends WebGLKernelValueSingleAr this.kernel.setUniform2iv(this.sizeId, this.textureSize); super.updateValue(value); } -} +} \ No newline at end of file diff --git a/src/backend/web-gl/kernel-value/dynamic-single-array1d-i.js b/src/backend/web-gl/kernel-value/dynamic-single-array1d-i.js index 338f4e68..b3ebb370 100644 --- a/src/backend/web-gl/kernel-value/dynamic-single-array1d-i.js +++ b/src/backend/web-gl/kernel-value/dynamic-single-array1d-i.js @@ -16,4 +16,4 @@ export class WebGLKernelValueDynamicSingleArray1DI extends WebGLKernelValueSingl this.kernel.setUniform2iv(this.sizeId, this.textureSize); super.updateValue(value); } -} +} \ No newline at end of file diff --git a/src/backend/web-gl/kernel-value/dynamic-single-array2d-i.js b/src/backend/web-gl/kernel-value/dynamic-single-array2d-i.js index 28d52727..4a72d0a7 100644 --- a/src/backend/web-gl/kernel-value/dynamic-single-array2d-i.js +++ b/src/backend/web-gl/kernel-value/dynamic-single-array2d-i.js @@ -16,4 +16,4 @@ export class WebGLKernelValueDynamicSingleArray2DI extends WebGLKernelValueSingl this.kernel.setUniform2iv(this.sizeId, this.textureSize); super.updateValue(value); } -} +} \ No newline at end of file diff --git a/src/backend/web-gl/kernel-value/dynamic-single-array3d-i.js b/src/backend/web-gl/kernel-value/dynamic-single-array3d-i.js index 2a5c1932..6d7bcfd6 100644 --- a/src/backend/web-gl/kernel-value/dynamic-single-array3d-i.js +++ b/src/backend/web-gl/kernel-value/dynamic-single-array3d-i.js @@ -16,4 +16,4 @@ export class WebGLKernelValueDynamicSingleArray3DI extends WebGLKernelValueSingl this.kernel.setUniform2iv(this.sizeId, this.textureSize); super.updateValue(value); } -} +} \ No newline at end of file diff --git a/src/backend/web-gl/kernel-value/dynamic-single-input.js b/src/backend/web-gl/kernel-value/dynamic-single-input.js index 07ad158b..beefa23a 100644 --- a/src/backend/web-gl/kernel-value/dynamic-single-input.js +++ b/src/backend/web-gl/kernel-value/dynamic-single-input.js @@ -21,4 +21,4 @@ export class WebGLKernelValueDynamicSingleInput extends WebGLKernelValueSingleIn this.kernel.setUniform2iv(this.sizeId, this.textureSize); super.updateValue(value); } -} +} \ No newline at end of file diff --git a/src/backend/web-gl/kernel-value/dynamic-unsigned-array.js b/src/backend/web-gl/kernel-value/dynamic-unsigned-array.js index d0bbdf49..25a23232 100644 --- a/src/backend/web-gl/kernel-value/dynamic-unsigned-array.js +++ b/src/backend/web-gl/kernel-value/dynamic-unsigned-array.js @@ -22,4 +22,4 @@ export class WebGLKernelValueDynamicUnsignedArray extends WebGLKernelValueUnsign this.kernel.setUniform2iv(this.sizeId, this.textureSize); super.updateValue(value); } -} +} \ No newline at end of file diff --git a/src/backend/web-gl/kernel-value/dynamic-unsigned-input.js b/src/backend/web-gl/kernel-value/dynamic-unsigned-input.js index 0a05d6c7..8d2d266e 100644 --- a/src/backend/web-gl/kernel-value/dynamic-unsigned-input.js +++ b/src/backend/web-gl/kernel-value/dynamic-unsigned-input.js @@ -23,4 +23,4 @@ export class WebGLKernelValueDynamicUnsignedInput extends WebGLKernelValueUnsign this.kernel.setUniform2iv(this.sizeId, this.textureSize); super.updateValue(value); } -} +} \ No newline at end of file diff --git a/src/backend/web-gl/kernel-value/float.js b/src/backend/web-gl/kernel-value/float.js index ee135123..99908556 100644 --- a/src/backend/web-gl/kernel-value/float.js +++ b/src/backend/web-gl/kernel-value/float.js @@ -23,4 +23,4 @@ export class WebGLKernelValueFloat extends WebGLKernelValue { if (this.origin === 'constants') return; this.kernel.setUniform1f(this.id, this.uploadValue = value); } -} +} \ No newline at end of file diff --git a/src/backend/web-gl/kernel-value/html-image.js b/src/backend/web-gl/kernel-value/html-image.js index 2b32622c..6aad2a85 100644 --- a/src/backend/web-gl/kernel-value/html-image.js +++ b/src/backend/web-gl/kernel-value/html-image.js @@ -35,4 +35,4 @@ export class WebGLKernelValueHTMLImage extends WebGLKernelArray { gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, this.uploadValue = inputImage); this.kernel.setUniform1i(this.id, this.index); } -} +} \ No newline at end of file diff --git a/src/backend/web-gl/kernel-value/html-video.js b/src/backend/web-gl/kernel-value/html-video.js index f6febe4e..050c19e6 100644 --- a/src/backend/web-gl/kernel-value/html-video.js +++ b/src/backend/web-gl/kernel-value/html-video.js @@ -1,3 +1,3 @@ import { WebGLKernelValueHTMLImage } from './html-image'; -export class WebGLKernelValueHTMLVideo extends WebGLKernelValueHTMLImage {} +export class WebGLKernelValueHTMLVideo extends WebGLKernelValueHTMLImage {} \ No newline at end of file diff --git a/src/backend/web-gl/kernel-value/index.js b/src/backend/web-gl/kernel-value/index.js index c9ca7945..28a4afa6 100644 --- a/src/backend/web-gl/kernel-value/index.js +++ b/src/backend/web-gl/kernel-value/index.js @@ -59,4 +59,4 @@ export class WebGLKernelValue extends KernelValue { } destroy() {} -} +} \ No newline at end of file diff --git a/src/backend/web-gl/kernel-value/integer.js b/src/backend/web-gl/kernel-value/integer.js index 45588ce6..925c2cbe 100644 --- a/src/backend/web-gl/kernel-value/integer.js +++ b/src/backend/web-gl/kernel-value/integer.js @@ -19,4 +19,4 @@ export class WebGLKernelValueInteger extends WebGLKernelValue { if (this.origin === 'constants') return; this.kernel.setUniform1i(this.id, this.uploadValue = value); } -} +} \ No newline at end of file diff --git a/src/backend/web-gl/kernel-value/memory-optimized-number-texture.js b/src/backend/web-gl/kernel-value/memory-optimized-number-texture.js index 7d878ff6..de17b87e 100644 --- a/src/backend/web-gl/kernel-value/memory-optimized-number-texture.js +++ b/src/backend/web-gl/kernel-value/memory-optimized-number-texture.js @@ -64,4 +64,4 @@ export class WebGLKernelValueMemoryOptimizedNumberTexture extends WebGLKernelArr gl.bindTexture(gl.TEXTURE_2D, this.uploadValue = inputTexture.texture); this.kernel.setUniform1i(this.id, this.index); } -} +} \ No newline at end of file diff --git a/src/backend/web-gl/kernel-value/number-texture.js b/src/backend/web-gl/kernel-value/number-texture.js index 5a6bd6c5..c7c55468 100644 --- a/src/backend/web-gl/kernel-value/number-texture.js +++ b/src/backend/web-gl/kernel-value/number-texture.js @@ -66,4 +66,4 @@ export class WebGLKernelValueNumberTexture extends WebGLKernelArray { gl.bindTexture(gl.TEXTURE_2D, this.uploadValue = inputTexture.texture); this.kernel.setUniform1i(this.id, this.index); } -} +} \ No newline at end of file diff --git a/src/backend/web-gl/kernel-value/single-array.js b/src/backend/web-gl/kernel-value/single-array.js index da6d7935..a7a29bb0 100644 --- a/src/backend/web-gl/kernel-value/single-array.js +++ b/src/backend/web-gl/kernel-value/single-array.js @@ -40,4 +40,4 @@ export class WebGLKernelValueSingleArray extends WebGLKernelArray { gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, this.textureSize[0], this.textureSize[1], 0, gl.RGBA, gl.FLOAT, this.uploadValue); this.kernel.setUniform1i(this.id, this.index); } -} +} \ No newline at end of file diff --git a/src/backend/web-gl/kernel-value/single-array1d-i.js b/src/backend/web-gl/kernel-value/single-array1d-i.js index dbb88700..9c89e24f 100644 --- a/src/backend/web-gl/kernel-value/single-array1d-i.js +++ b/src/backend/web-gl/kernel-value/single-array1d-i.js @@ -45,4 +45,4 @@ export class WebGLKernelValueSingleArray1DI extends WebGLKernelArray { gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, this.textureSize[0], this.textureSize[1], 0, gl.RGBA, gl.FLOAT, this.uploadValue); this.kernel.setUniform1i(this.id, this.index); } -} +} \ No newline at end of file diff --git a/src/backend/web-gl/kernel-value/single-array2d-i.js b/src/backend/web-gl/kernel-value/single-array2d-i.js index 4cffc618..2a28861f 100644 --- a/src/backend/web-gl/kernel-value/single-array2d-i.js +++ b/src/backend/web-gl/kernel-value/single-array2d-i.js @@ -45,4 +45,4 @@ export class WebGLKernelValueSingleArray2DI extends WebGLKernelArray { gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, this.textureSize[0], this.textureSize[1], 0, gl.RGBA, gl.FLOAT, this.uploadValue); this.kernel.setUniform1i(this.id, this.index); } -} +} \ No newline at end of file diff --git a/src/backend/web-gl/kernel-value/single-array3d-i.js b/src/backend/web-gl/kernel-value/single-array3d-i.js index ae2273a2..13b721bf 100644 --- a/src/backend/web-gl/kernel-value/single-array3d-i.js +++ b/src/backend/web-gl/kernel-value/single-array3d-i.js @@ -45,4 +45,4 @@ export class WebGLKernelValueSingleArray3DI extends WebGLKernelArray { gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, this.textureSize[0], this.textureSize[1], 0, gl.RGBA, gl.FLOAT, this.uploadValue); this.kernel.setUniform1i(this.id, this.index); } -} +} \ No newline at end of file diff --git a/src/backend/web-gl/kernel-value/single-input.js b/src/backend/web-gl/kernel-value/single-input.js index 2c6d5df6..00c794fc 100644 --- a/src/backend/web-gl/kernel-value/single-input.js +++ b/src/backend/web-gl/kernel-value/single-input.js @@ -41,4 +41,4 @@ export class WebGLKernelValueSingleInput extends WebGLKernelArray { gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, this.textureSize[0], this.textureSize[1], 0, gl.RGBA, gl.FLOAT, this.uploadValue); this.kernel.setUniform1i(this.id, this.index); } -} +} \ No newline at end of file diff --git a/src/backend/web-gl/kernel-value/unsigned-array.js b/src/backend/web-gl/kernel-value/unsigned-array.js index d3194a6d..42b83f6a 100644 --- a/src/backend/web-gl/kernel-value/unsigned-array.js +++ b/src/backend/web-gl/kernel-value/unsigned-array.js @@ -43,4 +43,4 @@ export class WebGLKernelValueUnsignedArray extends WebGLKernelArray { gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, this.textureSize[0], this.textureSize[1], 0, gl.RGBA, gl.UNSIGNED_BYTE, this.uploadValue); this.kernel.setUniform1i(this.id, this.index); } -} +} \ No newline at end of file diff --git a/src/backend/web-gl/kernel-value/unsigned-input.js b/src/backend/web-gl/kernel-value/unsigned-input.js index 8e68ded0..100ffe40 100644 --- a/src/backend/web-gl/kernel-value/unsigned-input.js +++ b/src/backend/web-gl/kernel-value/unsigned-input.js @@ -44,4 +44,4 @@ export class WebGLKernelValueUnsignedInput extends WebGLKernelArray { gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, this.textureSize[0], this.textureSize[1], 0, gl.RGBA, gl.UNSIGNED_BYTE, this.uploadValue); this.kernel.setUniform1i(this.id, this.index); } -} +} \ No newline at end of file diff --git a/src/backend/web-gl/kernel.js b/src/backend/web-gl/kernel.js index 8069fd39..1468df4a 100644 --- a/src/backend/web-gl/kernel.js +++ b/src/backend/web-gl/kernel.js @@ -1600,4 +1600,4 @@ float integerCorrectionModulo(float number, float divisor) { json.settings.threadDim = this.threadDim; return json; } -} +} \ No newline at end of file diff --git a/src/backend/web-gl/vertex-shader.js b/src/backend/web-gl/vertex-shader.js index f8a0c632..22b07f8b 100644 --- a/src/backend/web-gl/vertex-shader.js +++ b/src/backend/web-gl/vertex-shader.js @@ -12,5 +12,4 @@ uniform vec2 ratio; void main(void) { gl_Position = vec4((aPos + vec2(1)) * ratio + vec2(-1), 0, 1); vTexCoord = aTexCoord; -}`; - +}`; \ No newline at end of file diff --git a/src/backend/web-gl2/fragment-shader.js b/src/backend/web-gl2/fragment-shader.js index 1716fc4c..8d1c5962 100644 --- a/src/backend/web-gl2/fragment-shader.js +++ b/src/backend/web-gl2/fragment-shader.js @@ -445,4 +445,4 @@ __KERNEL__; void main(void) { index = int(vTexCoord.s * float(uTexSize.x)) + int(vTexCoord.t * float(uTexSize.y)) * uTexSize.x; __MAIN_RESULT__; -}`; +}`; \ No newline at end of file diff --git a/src/backend/web-gl2/function-node.js b/src/backend/web-gl2/function-node.js index e8d232a7..10a48fe3 100644 --- a/src/backend/web-gl2/function-node.js +++ b/src/backend/web-gl2/function-node.js @@ -40,4 +40,4 @@ export class WebGL2FunctionNode extends WebGLFunctionNode { return retArr; } -} +} \ No newline at end of file diff --git a/src/backend/web-gl2/kernel-value-maps.js b/src/backend/web-gl2/kernel-value-maps.js index 1705cf1b..0d8944b9 100644 --- a/src/backend/web-gl2/kernel-value-maps.js +++ b/src/backend/web-gl2/kernel-value-maps.js @@ -197,4 +197,4 @@ export function lookupKernelValueType(type, dynamic, precision, value) { throw new Error(`Could not find a KernelValue for ${ type }`); } return types[type]; -} +} \ No newline at end of file diff --git a/src/backend/web-gl2/kernel-value/array2.js b/src/backend/web-gl2/kernel-value/array2.js index a8872d86..3b1ecb87 100644 --- a/src/backend/web-gl2/kernel-value/array2.js +++ b/src/backend/web-gl2/kernel-value/array2.js @@ -1,3 +1,3 @@ import { WebGLKernelValueArray2 } from '../../web-gl/kernel-value/array2'; -export class WebGL2KernelValueArray2 extends WebGLKernelValueArray2 {} +export class WebGL2KernelValueArray2 extends WebGLKernelValueArray2 {} \ No newline at end of file diff --git a/src/backend/web-gl2/kernel-value/array3.js b/src/backend/web-gl2/kernel-value/array3.js index 98bd819a..b8b61b38 100644 --- a/src/backend/web-gl2/kernel-value/array3.js +++ b/src/backend/web-gl2/kernel-value/array3.js @@ -1,3 +1,3 @@ import { WebGLKernelValueArray3 } from '../../web-gl/kernel-value/array3'; -export class WebGL2KernelValueArray3 extends WebGLKernelValueArray3 {} +export class WebGL2KernelValueArray3 extends WebGLKernelValueArray3 {} \ No newline at end of file diff --git a/src/backend/web-gl2/kernel-value/array4.js b/src/backend/web-gl2/kernel-value/array4.js index 1481a098..094830b9 100644 --- a/src/backend/web-gl2/kernel-value/array4.js +++ b/src/backend/web-gl2/kernel-value/array4.js @@ -1,3 +1,3 @@ import { WebGLKernelValueArray4 } from '../../web-gl/kernel-value/array4'; -export class WebGL2KernelValueArray4 extends WebGLKernelValueArray4 {} +export class WebGL2KernelValueArray4 extends WebGLKernelValueArray4 {} \ No newline at end of file diff --git a/src/backend/web-gl2/kernel-value/boolean.js b/src/backend/web-gl2/kernel-value/boolean.js index cef37d0d..61cdf0f5 100644 --- a/src/backend/web-gl2/kernel-value/boolean.js +++ b/src/backend/web-gl2/kernel-value/boolean.js @@ -1,4 +1,3 @@ import { WebGLKernelValueBoolean } from '../../web-gl/kernel-value/boolean'; -export class WebGL2KernelValueBoolean extends WebGLKernelValueBoolean {} - +export class WebGL2KernelValueBoolean extends WebGLKernelValueBoolean {} \ No newline at end of file diff --git a/src/backend/web-gl2/kernel-value/dynamic-html-image-array.js b/src/backend/web-gl2/kernel-value/dynamic-html-image-array.js index 7756c08d..069c744a 100644 --- a/src/backend/web-gl2/kernel-value/dynamic-html-image-array.js +++ b/src/backend/web-gl2/kernel-value/dynamic-html-image-array.js @@ -20,4 +20,4 @@ export class WebGL2KernelValueDynamicHTMLImageArray extends WebGL2KernelValueHTM this.kernel.setUniform2iv(this.sizeId, this.textureSize); super.updateValue(images); } -} +} \ No newline at end of file diff --git a/src/backend/web-gl2/kernel-value/dynamic-html-image.js b/src/backend/web-gl2/kernel-value/dynamic-html-image.js index ed7409c3..c6d2bfdf 100644 --- a/src/backend/web-gl2/kernel-value/dynamic-html-image.js +++ b/src/backend/web-gl2/kernel-value/dynamic-html-image.js @@ -10,4 +10,4 @@ export class WebGL2KernelValueDynamicHTMLImage extends WebGLKernelValueDynamicHT `uniform ${ variablePrecision } ivec3 ${this.dimensionsId}`, ]); } -} +} \ No newline at end of file diff --git a/src/backend/web-gl2/kernel-value/dynamic-html-video.js b/src/backend/web-gl2/kernel-value/dynamic-html-video.js index 1f83c368..e8686b44 100644 --- a/src/backend/web-gl2/kernel-value/dynamic-html-video.js +++ b/src/backend/web-gl2/kernel-value/dynamic-html-video.js @@ -1,3 +1,3 @@ import { WebGL2KernelValueDynamicHTMLImage } from './dynamic-html-image'; -export class WebGL2KernelValueDynamicHTMLVideo extends WebGL2KernelValueDynamicHTMLImage {} +export class WebGL2KernelValueDynamicHTMLVideo extends WebGL2KernelValueDynamicHTMLImage {} \ No newline at end of file diff --git a/src/backend/web-gl2/kernel-value/dynamic-memory-optimized-number-texture.js b/src/backend/web-gl2/kernel-value/dynamic-memory-optimized-number-texture.js index 5a536767..b1414b1c 100644 --- a/src/backend/web-gl2/kernel-value/dynamic-memory-optimized-number-texture.js +++ b/src/backend/web-gl2/kernel-value/dynamic-memory-optimized-number-texture.js @@ -9,4 +9,4 @@ export class WebGL2KernelValueDynamicMemoryOptimizedNumberTexture extends WebGLK `uniform ivec3 ${this.dimensionsId}`, ]); } -} +} \ No newline at end of file diff --git a/src/backend/web-gl2/kernel-value/dynamic-number-texture.js b/src/backend/web-gl2/kernel-value/dynamic-number-texture.js index 570b5d0a..756d31b6 100644 --- a/src/backend/web-gl2/kernel-value/dynamic-number-texture.js +++ b/src/backend/web-gl2/kernel-value/dynamic-number-texture.js @@ -10,4 +10,4 @@ export class WebGL2KernelValueDynamicNumberTexture extends WebGLKernelValueDynam `uniform ${ variablePrecision } ivec3 ${this.dimensionsId}`, ]); } -} +} \ No newline at end of file diff --git a/src/backend/web-gl2/kernel-value/dynamic-single-array.js b/src/backend/web-gl2/kernel-value/dynamic-single-array.js index 25b7c145..8e3905de 100644 --- a/src/backend/web-gl2/kernel-value/dynamic-single-array.js +++ b/src/backend/web-gl2/kernel-value/dynamic-single-array.js @@ -21,4 +21,4 @@ export class WebGL2KernelValueDynamicSingleArray extends WebGL2KernelValueSingle this.kernel.setUniform2iv(this.sizeId, this.textureSize); super.updateValue(value); } -} +} \ No newline at end of file diff --git a/src/backend/web-gl2/kernel-value/dynamic-single-array1d-i.js b/src/backend/web-gl2/kernel-value/dynamic-single-array1d-i.js index 2b5889e9..f8bbf16f 100644 --- a/src/backend/web-gl2/kernel-value/dynamic-single-array1d-i.js +++ b/src/backend/web-gl2/kernel-value/dynamic-single-array1d-i.js @@ -17,4 +17,4 @@ export class WebGL2KernelValueDynamicSingleArray1DI extends WebGL2KernelValueSin this.kernel.setUniform2iv(this.sizeId, this.textureSize); super.updateValue(value); } -} +} \ No newline at end of file diff --git a/src/backend/web-gl2/kernel-value/dynamic-single-array2d-i.js b/src/backend/web-gl2/kernel-value/dynamic-single-array2d-i.js index fdf26496..d20fb80c 100644 --- a/src/backend/web-gl2/kernel-value/dynamic-single-array2d-i.js +++ b/src/backend/web-gl2/kernel-value/dynamic-single-array2d-i.js @@ -17,4 +17,4 @@ export class WebGL2KernelValueDynamicSingleArray2DI extends WebGL2KernelValueSin this.kernel.setUniform2iv(this.sizeId, this.textureSize); super.updateValue(value); } -} +} \ No newline at end of file diff --git a/src/backend/web-gl2/kernel-value/dynamic-single-array3d-i.js b/src/backend/web-gl2/kernel-value/dynamic-single-array3d-i.js index 9c7fe07d..7e406d7f 100644 --- a/src/backend/web-gl2/kernel-value/dynamic-single-array3d-i.js +++ b/src/backend/web-gl2/kernel-value/dynamic-single-array3d-i.js @@ -17,4 +17,4 @@ export class WebGL2KernelValueDynamicSingleArray3DI extends WebGL2KernelValueSin this.kernel.setUniform2iv(this.sizeId, this.textureSize); super.updateValue(value); } -} +} \ No newline at end of file diff --git a/src/backend/web-gl2/kernel-value/dynamic-single-input.js b/src/backend/web-gl2/kernel-value/dynamic-single-input.js index de0e707b..570cd59f 100644 --- a/src/backend/web-gl2/kernel-value/dynamic-single-input.js +++ b/src/backend/web-gl2/kernel-value/dynamic-single-input.js @@ -22,4 +22,4 @@ export class WebGL2KernelValueDynamicSingleInput extends WebGL2KernelValueSingle this.kernel.setUniform2iv(this.sizeId, this.textureSize); super.updateValue(value); } -} +} \ No newline at end of file diff --git a/src/backend/web-gl2/kernel-value/dynamic-unsigned-array.js b/src/backend/web-gl2/kernel-value/dynamic-unsigned-array.js index fa91a4b5..b7e00482 100644 --- a/src/backend/web-gl2/kernel-value/dynamic-unsigned-array.js +++ b/src/backend/web-gl2/kernel-value/dynamic-unsigned-array.js @@ -10,4 +10,4 @@ export class WebGL2KernelValueDynamicUnsignedArray extends WebGLKernelValueDynam `uniform ${ variablePrecision } ivec3 ${this.dimensionsId}`, ]); } -} +} \ No newline at end of file diff --git a/src/backend/web-gl2/kernel-value/dynamic-unsigned-input.js b/src/backend/web-gl2/kernel-value/dynamic-unsigned-input.js index 6e144bd3..0675bee8 100644 --- a/src/backend/web-gl2/kernel-value/dynamic-unsigned-input.js +++ b/src/backend/web-gl2/kernel-value/dynamic-unsigned-input.js @@ -10,4 +10,4 @@ export class WebGL2KernelValueDynamicUnsignedInput extends WebGLKernelValueDynam `uniform ${ variablePrecision } ivec3 ${this.dimensionsId}`, ]); } -} +} \ No newline at end of file diff --git a/src/backend/web-gl2/kernel-value/float.js b/src/backend/web-gl2/kernel-value/float.js index e32aca37..94d36154 100644 --- a/src/backend/web-gl2/kernel-value/float.js +++ b/src/backend/web-gl2/kernel-value/float.js @@ -1,3 +1,3 @@ import { WebGLKernelValueFloat } from '../../web-gl/kernel-value/float'; -export class WebGL2KernelValueFloat extends WebGLKernelValueFloat {} +export class WebGL2KernelValueFloat extends WebGLKernelValueFloat {} \ No newline at end of file diff --git a/src/backend/web-gl2/kernel-value/html-image-array.js b/src/backend/web-gl2/kernel-value/html-image-array.js index ece5ef71..a82723c9 100644 --- a/src/backend/web-gl2/kernel-value/html-image-array.js +++ b/src/backend/web-gl2/kernel-value/html-image-array.js @@ -66,4 +66,4 @@ export class WebGL2KernelValueHTMLImageArray extends WebGLKernelArray { } this.kernel.setUniform1i(this.id, this.index); } -} +} \ No newline at end of file diff --git a/src/backend/web-gl2/kernel-value/html-image.js b/src/backend/web-gl2/kernel-value/html-image.js index 8930e2dd..97ece611 100644 --- a/src/backend/web-gl2/kernel-value/html-image.js +++ b/src/backend/web-gl2/kernel-value/html-image.js @@ -10,4 +10,4 @@ export class WebGL2KernelValueHTMLImage extends WebGLKernelValueHTMLImage { `${ variablePrecision } ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`, ]); } -} +} \ No newline at end of file diff --git a/src/backend/web-gl2/kernel-value/html-video.js b/src/backend/web-gl2/kernel-value/html-video.js index 341b31ef..b6abcd7b 100644 --- a/src/backend/web-gl2/kernel-value/html-video.js +++ b/src/backend/web-gl2/kernel-value/html-video.js @@ -1,4 +1,4 @@ import { utils } from '../../../utils'; import { WebGL2KernelValueHTMLImage } from './html-image'; -export class WebGL2KernelValueHTMLVideo extends WebGL2KernelValueHTMLImage {} +export class WebGL2KernelValueHTMLVideo extends WebGL2KernelValueHTMLImage {} \ No newline at end of file diff --git a/src/backend/web-gl2/kernel-value/integer.js b/src/backend/web-gl2/kernel-value/integer.js index cfdaacf0..f59da5c4 100644 --- a/src/backend/web-gl2/kernel-value/integer.js +++ b/src/backend/web-gl2/kernel-value/integer.js @@ -13,4 +13,4 @@ export class WebGL2KernelValueInteger extends WebGLKernelValueInteger { if (this.origin === 'constants') return; this.kernel.setUniform1i(this.id, this.uploadValue = value); } -} +} \ No newline at end of file diff --git a/src/backend/web-gl2/kernel-value/memory-optimized-number-texture.js b/src/backend/web-gl2/kernel-value/memory-optimized-number-texture.js index 56258bf4..60cddd8b 100644 --- a/src/backend/web-gl2/kernel-value/memory-optimized-number-texture.js +++ b/src/backend/web-gl2/kernel-value/memory-optimized-number-texture.js @@ -11,4 +11,4 @@ export class WebGL2KernelValueMemoryOptimizedNumberTexture extends WebGLKernelVa `${ variablePrecision } ivec3 ${dimensionsId} = ivec3(${dimensions[0]}, ${dimensions[1]}, ${dimensions[2]})`, ]); } -} +} \ No newline at end of file diff --git a/src/backend/web-gl2/kernel-value/number-texture.js b/src/backend/web-gl2/kernel-value/number-texture.js index 78c85097..2a1fe4ce 100644 --- a/src/backend/web-gl2/kernel-value/number-texture.js +++ b/src/backend/web-gl2/kernel-value/number-texture.js @@ -11,4 +11,4 @@ export class WebGL2KernelValueNumberTexture extends WebGLKernelValueNumberTextur `${ variablePrecision } ivec3 ${dimensionsId} = ivec3(${dimensions[0]}, ${dimensions[1]}, ${dimensions[2]})`, ]); } -} +} \ No newline at end of file diff --git a/src/backend/web-gl2/kernel-value/single-array.js b/src/backend/web-gl2/kernel-value/single-array.js index e0d1429a..b437cf0e 100644 --- a/src/backend/web-gl2/kernel-value/single-array.js +++ b/src/backend/web-gl2/kernel-value/single-array.js @@ -24,4 +24,4 @@ export class WebGL2KernelValueSingleArray extends WebGLKernelValueSingleArray { gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA32F, this.textureSize[0], this.textureSize[1], 0, gl.RGBA, gl.FLOAT, this.uploadValue); this.kernel.setUniform1i(this.id, this.index); } -} +} \ No newline at end of file diff --git a/src/backend/web-gl2/kernel-value/single-array1d-i.js b/src/backend/web-gl2/kernel-value/single-array1d-i.js index f78c9401..8f1d051c 100644 --- a/src/backend/web-gl2/kernel-value/single-array1d-i.js +++ b/src/backend/web-gl2/kernel-value/single-array1d-i.js @@ -15,4 +15,4 @@ export class WebGL2KernelValueSingleArray1DI extends WebGLKernelValueSingleArray gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA32F, this.textureSize[0], this.textureSize[1], 0, gl.RGBA, gl.FLOAT, this.uploadValue); this.kernel.setUniform1i(this.id, this.index); } -} +} \ No newline at end of file diff --git a/src/backend/web-gl2/kernel-value/single-array2d-i.js b/src/backend/web-gl2/kernel-value/single-array2d-i.js index 7567e47c..88dad13f 100644 --- a/src/backend/web-gl2/kernel-value/single-array2d-i.js +++ b/src/backend/web-gl2/kernel-value/single-array2d-i.js @@ -15,4 +15,4 @@ export class WebGL2KernelValueSingleArray2DI extends WebGLKernelValueSingleArray gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA32F, this.textureSize[0], this.textureSize[1], 0, gl.RGBA, gl.FLOAT, this.uploadValue); this.kernel.setUniform1i(this.id, this.index); } -} +} \ No newline at end of file diff --git a/src/backend/web-gl2/kernel-value/single-array3d-i.js b/src/backend/web-gl2/kernel-value/single-array3d-i.js index fb4bddc2..5fe7d352 100644 --- a/src/backend/web-gl2/kernel-value/single-array3d-i.js +++ b/src/backend/web-gl2/kernel-value/single-array3d-i.js @@ -15,4 +15,4 @@ export class WebGL2KernelValueSingleArray3DI extends WebGLKernelValueSingleArray gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA32F, this.textureSize[0], this.textureSize[1], 0, gl.RGBA, gl.FLOAT, this.uploadValue); this.kernel.setUniform1i(this.id, this.index); } -} +} \ No newline at end of file diff --git a/src/backend/web-gl2/kernel-value/single-input.js b/src/backend/web-gl2/kernel-value/single-input.js index d3139357..1b52721a 100644 --- a/src/backend/web-gl2/kernel-value/single-input.js +++ b/src/backend/web-gl2/kernel-value/single-input.js @@ -20,4 +20,4 @@ export class WebGL2KernelValueSingleInput extends WebGLKernelValueSingleInput { gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA32F, this.textureSize[0], this.textureSize[1], 0, gl.RGBA, gl.FLOAT, this.uploadValue); this.kernel.setUniform1i(this.id, this.index); } -} +} \ No newline at end of file diff --git a/src/backend/web-gl2/kernel-value/unsigned-array.js b/src/backend/web-gl2/kernel-value/unsigned-array.js index 7a5927bb..ac5e5c4d 100644 --- a/src/backend/web-gl2/kernel-value/unsigned-array.js +++ b/src/backend/web-gl2/kernel-value/unsigned-array.js @@ -10,4 +10,4 @@ export class WebGL2KernelValueUnsignedArray extends WebGLKernelValueUnsignedArra `${ variablePrecision } ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`, ]); } -} +} \ No newline at end of file diff --git a/src/backend/web-gl2/kernel-value/unsigned-input.js b/src/backend/web-gl2/kernel-value/unsigned-input.js index 3f43478b..49ccfd41 100644 --- a/src/backend/web-gl2/kernel-value/unsigned-input.js +++ b/src/backend/web-gl2/kernel-value/unsigned-input.js @@ -10,4 +10,4 @@ export class WebGL2KernelValueUnsignedInput extends WebGLKernelValueUnsignedInpu `${ variablePrecision } ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`, ]); } -} +} \ No newline at end of file diff --git a/src/backend/web-gl2/kernel.js b/src/backend/web-gl2/kernel.js index 2b27798a..ec6ce49f 100644 --- a/src/backend/web-gl2/kernel.js +++ b/src/backend/web-gl2/kernel.js @@ -261,13 +261,13 @@ export class WebGL2Kernel extends WebGLKernel { } else { return gl.R32F; } - case 'Array(2)': - return gl.RG32F; - case 'Array(3)': // there is _no_ 3 channel format which is guaranteed to be color-renderable - case 'Array(4)': - return gl.RGBA32F; - default: - throw new Error('Unhandled return type'); + case 'Array(2)': + return gl.RG32F; + case 'Array(3)': // there is _no_ 3 channel format which is guaranteed to be color-renderable + case 'Array(4)': + return gl.RGBA32F; + default: + throw new Error('Unhandled return type'); } } return gl.RGBA32F; @@ -634,4 +634,4 @@ export class WebGL2Kernel extends WebGLKernel { json.settings.threadDim = this.threadDim; return json; } -} +} \ No newline at end of file diff --git a/src/backend/web-gl2/vertex-shader.js b/src/backend/web-gl2/vertex-shader.js index 7e33b18a..8ea12cd7 100644 --- a/src/backend/web-gl2/vertex-shader.js +++ b/src/backend/web-gl2/vertex-shader.js @@ -13,4 +13,4 @@ uniform vec2 ratio; void main(void) { gl_Position = vec4((aPos + vec2(1)) * ratio + vec2(-1), 0, 1); vTexCoord = aTexCoord; -}`; +}`; \ No newline at end of file diff --git a/src/browser.js b/src/browser.js index eca4e6af..18835c04 100644 --- a/src/browser.js +++ b/src/browser.js @@ -27,7 +27,7 @@ GPU.utils = utils GPU.Input = Input GPU.input = input GPU.Texture = Texture -GPU.FunctionBuilder = FunctionBuilder +GPU.FunctionBuilder = FunctionBuilder GPU.FunctionNode = FunctionNode GPU.CPUFunctionNode = CPUFunctionNode GPU.CPUKernel = CPUKernel @@ -44,7 +44,7 @@ GPU.Kernel = Kernel GPU.FunctionTracer = FunctionTracer GPU.plugins = { - mathRandom, + mathRandom, } export default GPU \ No newline at end of file diff --git a/src/gpu.js b/src/gpu.js index ad1fd2bb..879d8071 100644 --- a/src/gpu.js +++ b/src/gpu.js @@ -29,8 +29,8 @@ const internalKernels = { * @param {import('./backend/headless-gl/kernel').HeadlessGLKernel} HeadlessGLKernel */ export function setupNode(HeadlessGLKernel) { - kernelOrder.unshift(HeadlessGLKernel) - internalKernels.headlessgl = HeadlessGLKernel + kernelOrder.unshift(HeadlessGLKernel) + internalKernels.headlessgl = HeadlessGLKernel } let validate = true; @@ -603,4 +603,4 @@ function upgradeDeprecatedCreateKernelSettings(settings) { upgradedSettings.optimizeFloatMemory = Boolean(settings.floatTextures); } return upgradedSettings; -} +} \ No newline at end of file diff --git a/src/index.js b/src/index.js index 54324754..eb199122 100644 --- a/src/index.js +++ b/src/index.js @@ -1,36 +1,71 @@ -export { GPU } from './gpu'; -export { alias } from './alias'; -export { utils } from './utils'; -export { Input, input } from './input'; -export { Texture } from './texture'; -export { FunctionBuilder } from './backend/function-builder'; -export { FunctionNode } from './backend/function-node'; -export { CPUFunctionNode } from './backend/cpu/function-node'; -export { CPUKernel } from './backend/cpu/kernel'; +const { expect } = require('chai'); -export { HeadlessGLKernel } from './backend/headless-gl/kernel'; +const GPU = require('../src/index.js'); -export { WebGLFunctionNode } from './backend/web-gl/function-node'; -export { WebGLKernel } from './backend/web-gl/kernel'; -export { kernelValueMaps as webGLKernelValueMaps } from './backend/web-gl/kernel-value-maps'; +describe('Test Node GPU', () => { + describe('gpu mode', () => { + it('should find and use gpu runner', () => { + const gpu = new GPU({ mode: 'gpu' }); -export { WebGL2FunctionNode } from './backend/web-gl2/function-node'; -export { WebGL2Kernel } from './backend/web-gl2/kernel'; -export { kernelValueMaps as webGL2KernelValueMaps } from './backend/web-gl2/kernel-value-maps'; + const kernel = gpu.createKernel(function() { + return 1; + }).setOutput([1]); -export { GLKernel } from './backend/gl/kernel'; + const result = kernel(); -export { Kernel } from './backend/kernel'; + expect(gpu.runner.constructor).to.equal(GPU.HeadlessGLRunner); + expect(result[0]).to.equal(1); + }); -export { FunctionTracer } from './backend/function-tracer'; + it('supports 2x2 size', () => { + const gpu = new GPU({ mode: 'gpu' }); -import mathRandom from './plugins/math-random-uniformly-distributed'; + const kernel = gpu.createKernel(function() { + return this.thread.x * this.thread.y; + }).setOutput([2, 2]); -export const plugins = { - mathRandom, -} + const result = kernel(); -import { setupNode } from './gpu'; -import { HeadlessGLKernel } from './backend/headless-gl/kernel'; + expect(gpu.runner.constructor).to.equal(GPU.HeadlessGLRunner); + expect(result).to.deep.equal( + [ + Float32Array.from([0, 0]), + Float32Array.from([0, 1]) + ] + ); + }); + }); -setupNode(HeadlessGLKernel) \ No newline at end of file + describe('cpu mode', () => { + it('should find and use gpu runner', () => { + const gpu = new GPU({ mode: 'cpu' }); + + const kernel = gpu.createKernel(function() { + return 1; + }).setOutput([1]); + + const result = kernel(); + + expect(gpu.runner.constructor).to.equal(GPU.CPURunner); + expect(result[0]).to.equal(1); + }); + + it('supports 2x2 size', () => { + const gpu = new GPU({ mode: 'cpu' }); + + const kernel = gpu.createKernel(function() { + return this.thread.x * this.thread.y; + }).setOutput([2, 2]); + + const result = kernel(); + + expect(gpu.runner.constructor).to.equal(GPU.CPURunner); + expect(result).to.deep.equal( + [ + Float32Array.from([0, 0]), + Float32Array.from([0, 1]) + ] + ); + }); + }); +}); \ No newline at end of file diff --git a/src/input.js b/src/input.js index 02010cb6..1f7af4ec 100644 --- a/src/input.js +++ b/src/input.js @@ -47,4 +47,4 @@ export class Input { export function input(value, size) { return new Input(value, size); -} +} \ No newline at end of file diff --git a/src/kernel-run-shortcut.js b/src/kernel-run-shortcut.js index 62635ad4..dc34eb75 100644 --- a/src/kernel-run-shortcut.js +++ b/src/kernel-run-shortcut.js @@ -79,4 +79,4 @@ function bindKernelToShortcut(kernel, shortcut) { } } shortcut.kernel = kernel; -} +} \ No newline at end of file diff --git a/src/texture.js b/src/texture.js index 16b164b3..a3436f49 100644 --- a/src/texture.js +++ b/src/texture.js @@ -65,4 +65,4 @@ export class Texture { clear() { throw new Error(`Not implemented on ${this.constructor.name}`); } -} +} \ No newline at end of file diff --git a/src/utils.js b/src/utils.js index 2fe4c604..726891e7 100644 --- a/src/utils.js +++ b/src/utils.js @@ -668,97 +668,97 @@ export const utils = { } else { return `${ast.kind} ${declarations.join(',')}`; } - case 'VariableDeclarator': - if (ast.init.object && ast.init.object.type === 'ThisExpression') { - const lookup = thisLookup(ast.init.property.name, true); - if (lookup) { - return `${ast.id.name} = ${flatten(ast.init)}`; - } else { - return null; - } - } else { + case 'VariableDeclarator': + if (ast.init.object && ast.init.object.type === 'ThisExpression') { + const lookup = thisLookup(ast.init.property.name, true); + if (lookup) { return `${ast.id.name} = ${flatten(ast.init)}`; + } else { + return null; } - case 'CallExpression': { - if (ast.callee.property.name === 'subarray') { - return `${flatten(ast.callee.object)}.${flatten(ast.callee.property)}(${ast.arguments.map(value => flatten(value)).join(', ')})`; - } - if (ast.callee.object.name === 'gl' || ast.callee.object.name === 'context') { - return `${flatten(ast.callee.object)}.${flatten(ast.callee.property)}(${ast.arguments.map(value => flatten(value)).join(', ')})`; - } - if (ast.callee.object.type === 'ThisExpression') { - functionDependencies.push(findDependency('this', ast.callee.property.name)); - return `${ast.callee.property.name}(${ast.arguments.map(value => flatten(value)).join(', ')})`; - } else if (ast.callee.object.name) { - const foundSource = findDependency(ast.callee.object.name, ast.callee.property.name); - if (foundSource === null) { - // we're not flattening it - return `${ast.callee.object.name}.${ast.callee.property.name}(${ast.arguments.map(value => flatten(value)).join(', ')})`; - } else { - functionDependencies.push(foundSource); - // we're flattening it - return `${ast.callee.property.name}(${ast.arguments.map(value => flatten(value)).join(', ')})`; - } - } else if (ast.callee.object.type === 'MemberExpression') { - return `${flatten(ast.callee.object)}.${ast.callee.property.name}(${ast.arguments.map(value => flatten(value)).join(', ')})`; - } else { - throw new Error('unknown ast.callee'); - } + } else { + return `${ast.id.name} = ${flatten(ast.init)}`; + } + case 'CallExpression': { + if (ast.callee.property.name === 'subarray') { + return `${flatten(ast.callee.object)}.${flatten(ast.callee.property)}(${ast.arguments.map(value => flatten(value)).join(', ')})`; + } + if (ast.callee.object.name === 'gl' || ast.callee.object.name === 'context') { + return `${flatten(ast.callee.object)}.${flatten(ast.callee.property)}(${ast.arguments.map(value => flatten(value)).join(', ')})`; + } + if (ast.callee.object.type === 'ThisExpression') { + functionDependencies.push(findDependency('this', ast.callee.property.name)); + return `${ast.callee.property.name}(${ast.arguments.map(value => flatten(value)).join(', ')})`; + } else if (ast.callee.object.name) { + const foundSource = findDependency(ast.callee.object.name, ast.callee.property.name); + if (foundSource === null) { + // we're not flattening it + return `${ast.callee.object.name}.${ast.callee.property.name}(${ast.arguments.map(value => flatten(value)).join(', ')})`; + } else { + functionDependencies.push(foundSource); + // we're flattening it + return `${ast.callee.property.name}(${ast.arguments.map(value => flatten(value)).join(', ')})`; } - case 'ReturnStatement': - return `return ${flatten(ast.argument)}`; - case 'BinaryExpression': - return `(${flatten(ast.left)}${ast.operator}${flatten(ast.right)})`; - case 'UnaryExpression': - if (ast.prefix) { - return `${ast.operator} ${flatten(ast.argument)}`; - } else { - return `${flatten(ast.argument)} ${ast.operator}`; - } - case 'ExpressionStatement': - return `${flatten(ast.expression)}`; - case 'SequenceExpression': - return `(${flatten(ast.expressions)})`; - case 'ArrowFunctionExpression': - return `(${ast.params.map(flatten).join(', ')}) => ${flatten(ast.body)}`; - case 'Literal': - return ast.raw; - case 'Identifier': - return ast.name; - case 'MemberExpression': - if (ast.object.type === 'ThisExpression') { - return thisLookup(ast.property.name); - } - if (ast.computed) { - return `${flatten(ast.object)}[${flatten(ast.property)}]`; - } - return flatten(ast.object) + '.' + flatten(ast.property); - case 'ThisExpression': - return 'this'; - case 'NewExpression': - return `new ${flatten(ast.callee)}(${ast.arguments.map(value => flatten(value)).join(', ')})`; - case 'ForStatement': - return `for (${flatten(ast.init)};${flatten(ast.test)};${flatten(ast.update)}) ${flatten(ast.body)}`; - case 'AssignmentExpression': - return `${flatten(ast.left)}${ast.operator}${flatten(ast.right)}`; - case 'UpdateExpression': - return `${flatten(ast.argument)}${ast.operator}`; - case 'IfStatement': - return `if (${flatten(ast.test)}) ${flatten(ast.consequent)}`; - case 'ThrowStatement': - return `throw ${flatten(ast.argument)}`; - case 'ObjectPattern': - return ast.properties.map(flatten).join(', '); - case 'ArrayPattern': - return ast.elements.map(flatten).join(', '); - case 'DebuggerStatement': - return 'debugger;'; - case 'ConditionalExpression': - return `${flatten(ast.test)}?${flatten(ast.consequent)}:${flatten(ast.alternate)}`; - case 'Property': - if (ast.kind === 'init') { - return flatten(ast.key); - } + } else if (ast.callee.object.type === 'MemberExpression') { + return `${flatten(ast.callee.object)}.${ast.callee.property.name}(${ast.arguments.map(value => flatten(value)).join(', ')})`; + } else { + throw new Error('unknown ast.callee'); + } + } + case 'ReturnStatement': + return `return ${flatten(ast.argument)}`; + case 'BinaryExpression': + return `(${flatten(ast.left)}${ast.operator}${flatten(ast.right)})`; + case 'UnaryExpression': + if (ast.prefix) { + return `${ast.operator} ${flatten(ast.argument)}`; + } else { + return `${flatten(ast.argument)} ${ast.operator}`; + } + case 'ExpressionStatement': + return `${flatten(ast.expression)}`; + case 'SequenceExpression': + return `(${flatten(ast.expressions)})`; + case 'ArrowFunctionExpression': + return `(${ast.params.map(flatten).join(', ')}) => ${flatten(ast.body)}`; + case 'Literal': + return ast.raw; + case 'Identifier': + return ast.name; + case 'MemberExpression': + if (ast.object.type === 'ThisExpression') { + return thisLookup(ast.property.name); + } + if (ast.computed) { + return `${flatten(ast.object)}[${flatten(ast.property)}]`; + } + return flatten(ast.object) + '.' + flatten(ast.property); + case 'ThisExpression': + return 'this'; + case 'NewExpression': + return `new ${flatten(ast.callee)}(${ast.arguments.map(value => flatten(value)).join(', ')})`; + case 'ForStatement': + return `for (${flatten(ast.init)};${flatten(ast.test)};${flatten(ast.update)}) ${flatten(ast.body)}`; + case 'AssignmentExpression': + return `${flatten(ast.left)}${ast.operator}${flatten(ast.right)}`; + case 'UpdateExpression': + return `${flatten(ast.argument)}${ast.operator}`; + case 'IfStatement': + return `if (${flatten(ast.test)}) ${flatten(ast.consequent)}`; + case 'ThrowStatement': + return `throw ${flatten(ast.argument)}`; + case 'ObjectPattern': + return ast.properties.map(flatten).join(', '); + case 'ArrayPattern': + return ast.elements.map(flatten).join(', '); + case 'DebuggerStatement': + return 'debugger;'; + case 'ConditionalExpression': + return `${flatten(ast.test)}?${flatten(ast.consequent)}:${flatten(ast.alternate)}`; + case 'Property': + if (ast.kind === 'init') { + return flatten(ast.key); + } } throw new Error(`unhandled ast.type of ${ ast.type }`); } @@ -1009,4 +1009,4 @@ const dollarSign = /\$/; const doubleUnderscore = /__/; const singleUnderscore = /_/; -const _systemEndianness = utils.getSystemEndianness(); +const _systemEndianness = utils.getSystemEndianness(); \ No newline at end of file diff --git a/test/features/add-custom-function.js b/test/features/add-custom-function.js index 0f63773d..70e350e0 100644 --- a/test/features/add-custom-function.js +++ b/test/features/add-custom-function.js @@ -7,8 +7,8 @@ function inGPUInstanceSettings(mode) { function customAdder(a, b) { return a + b; } - const gpu = new GPU({mode, functions: [customAdder] }); - const kernel = gpu.createKernel(function (a, b) { + const gpu = new GPU({ mode, functions: [customAdder] }); + const kernel = gpu.createKernel(function(a, b) { return customAdder(a[this.thread.x], b[this.thread.x]); }, { output: [6] @@ -56,7 +56,7 @@ function withGPUAddFunctionMethod(mode) { } const gpu = new GPU({ mode }) .addFunction(customAdder); - const kernel = gpu.createKernel(function (a, b) { + const kernel = gpu.createKernel(function(a, b) { return customAdder(a[this.thread.x], b[this.thread.x]); }, { output: [6] @@ -102,7 +102,7 @@ function inKernelInstanceSettings(mode) { return a + b; } const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function (a, b) { + const kernel = gpu.createKernel(function(a, b) { return customAdder(a[this.thread.x], b[this.thread.x]); }, { output: [6], @@ -151,11 +151,11 @@ function withKernelAddFunctionMethod(mode) { return a + b; } const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function (a, b) { - return customAdder(a[this.thread.x], b[this.thread.x]); - }, { - output: [6] - }) + const kernel = gpu.createKernel(function(a, b) { + return customAdder(a[this.thread.x], b[this.thread.x]); + }, { + output: [6] + }) .addFunction(customAdder); const a = [1, 2, 3, 5, 6, 7]; @@ -196,7 +196,7 @@ test('with Kernel addFunction method cpu', () => { describe('features: add custom function with `this.constants.width` in loop'); function sumAB(mode) { - const gpu = new GPU({mode}); + const gpu = new GPU({ mode }); function customAdder(a, b) { let sum = 0; @@ -208,11 +208,11 @@ function sumAB(mode) { gpu.addFunction(customAdder); - const kernel = gpu.createKernel(function (a, b) { + const kernel = gpu.createKernel(function(a, b) { return customAdder(a, b); }, { output: [6], - constants: {width: 6}, + constants: { width: 6 }, precision: 'unsigned', }); @@ -253,6 +253,7 @@ test('sumAB cpu', () => { }); describe('features: add custom function with `this.output.x` in loop'); + function sumABThisOutputX(mode) { const gpu = new GPU({ mode, functions: [customAdder] }); @@ -267,7 +268,7 @@ function sumABThisOutputX(mode) { const kernel = gpu.createKernel(function(a, b) { return customAdder(a, b); }, { - output : [6], + output: [6], }); assert.ok(kernel !== null, 'function generated test'); @@ -275,7 +276,7 @@ function sumABThisOutputX(mode) { const a = [1, 2, 3, 5, 6, 7]; const b = [1, 1, 1, 1, 1, 1]; - const result = kernel(a,b); + const result = kernel(a, b); const expected = [12, 18, 24, 36, 42, 48]; assert.deepEqual(Array.from(result), expected); @@ -308,6 +309,7 @@ test('sumABThisOutputX cpu', () => { describe('features: add custom private'); + function addCustomPrivate(mode) { const gpu = new GPU({ mode }); @@ -321,7 +323,7 @@ function addCustomPrivate(mode) { } return customAdder(a, b); }, { - output : [6], + output: [6], }); assert.ok(kernel !== null, 'function generated test'); @@ -329,7 +331,7 @@ function addCustomPrivate(mode) { const a = [1, 2, 3, 5, 6, 7]; const b = [1, 1, 1, 1, 1, 1]; - const result = kernel(a,b); + const result = kernel(a, b); const expected = [12, 18, 24, 36, 42, 48]; assert.deepEqual(Array.from(result), expected); @@ -364,6 +366,7 @@ describe('features: setFunctions from array on kernel'); function testSetFunctionsFromArrayOnKernel(mode) { const gpu = new GPU({ mode }); + function custom() { return 1; } @@ -442,8 +445,8 @@ describe('features: setFunctions from array on kernel'); function testAddIGPUFunction(mode) { const gpu = new GPU({ mode }); const kernel = gpu.createKernel(function(value) { - return custom(value); - }) + return custom(value); + }) .setOutput([1]) .addFunction({ name: 'custom', diff --git a/test/features/add-custom-native-function.js b/test/features/add-custom-native-function.js index 7e8d9b45..5c8cd9df 100644 --- a/test/features/add-custom-native-function.js +++ b/test/features/add-custom-native-function.js @@ -18,7 +18,7 @@ function nativeDivide(mode, fn) { const f = gpu.createKernel(function(a, b) { return divide(a[this.thread.x], b[this.thread.x]); }, { - output : [6] + output: [6] }); assert.ok(f !== null, 'function generated test'); @@ -26,11 +26,11 @@ function nativeDivide(mode, fn) { const a = [1, 4, 3, 5, 6, 3]; const b = [4, 2, 6, 1, 2, 3]; - const res = f(a,b); + const res = f(a, b); const exp = [0.25, 2, 0.5, 5, 3, 1]; - for(let i = 0; i < exp.length; ++i) { - assert.equal(res[i], exp[i], 'Result arr idx: '+i); + for (let i = 0; i < exp.length; ++i) { + assert.equal(res[i], exp[i], 'Result arr idx: ' + i); } gpu.destroy(); } @@ -75,20 +75,20 @@ function divideOverride(mode) { }] }); - function divide(a,b) { + function divide(a, b) { return a / b; } const kernel = gpu.createKernel(function(a, b) { return divide(a[this.thread.x], b[this.thread.x]); }, { - output : [6] + output: [6] }); const a = [1, 4, 3, 5, 6, 3]; const b = [4, 2, 6, 1, 2, 3]; - const res = kernel(a,b); + const res = kernel(a, b); const exp = [5, 6, 9, 6, 8, 6]; assert.deepEqual(Array.from(res), exp); @@ -130,20 +130,20 @@ function argumentCasting(mode) { }] }); - function divide(a,b) { + function divide(a, b) { return a / b; } const kernel = gpu.createKernel(function(a, b) { return divide(a[this.thread.x], b[this.thread.x]); }, { - output : [6] + output: [6] }); const a = [1, 4, 3, 5, 6, 3]; const b = [4, 2, 6, 1, 2, 3]; - const res = kernel(a,b); + const res = kernel(a, b); const exp = [5, 6, 9, 6, 8, 6]; assert.deepEqual(Array.from(res), exp); @@ -186,20 +186,20 @@ function mixedArgumentCasting(mode) { }] }); - function divide(a,b) { + function divide(a, b) { return a / b; } const kernel = gpu.createKernel(function(a, b) { return divide(a[this.thread.x], b[this.thread.x]); }, { - output : [6] + output: [6] }); const a = [1, 4, 3, 5, 6, 3]; const b = [4, 2, 6, 1, 2, 3]; - const res = kernel(a,b); + const res = kernel(a, b); const exp = [5, 6, 9, 6, 8, 6]; assert.deepEqual(Array.from(res), exp); @@ -241,20 +241,20 @@ function returnTypeCasting(mode) { }] }); - function divide(a,b) { + function divide(a, b) { return a / b; } const kernel = gpu.createKernel(function(a, b) { return divide(a[this.thread.x], b[this.thread.x]); }, { - output : [6] + output: [6] }); const a = [1, 4, 3, 5, 6, 3]; const b = [4, 2, 6, 1, 2, 3]; - const res = kernel(a,b); + const res = kernel(a, b); const exp = [5, 6, 9, 6, 8, 6]; assert.deepEqual(Array.from(res), exp); @@ -285,7 +285,7 @@ describe('features: Adding nativeFunctions directly on kernel'); function testDirectlyOnKernelViaSettings(nativeFunctions, mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function (v) { + const kernel = gpu.createKernel(function(v) { return native(v[this.thread.x]); }, { output: [1], @@ -296,70 +296,58 @@ function testDirectlyOnKernelViaSettings(nativeFunctions, mode) { } test('via settings auto', () => { - testDirectlyOnKernelViaSettings([ - { - name: 'native', - source: `float native(float value) { + testDirectlyOnKernelViaSettings([{ + name: 'native', + source: `float native(float value) { return 1.0 + value; }` - } - ]) + }]) }); test('via settings gpu', () => { - testDirectlyOnKernelViaSettings([ - { - name: 'native', - source: `float native(float value) { + testDirectlyOnKernelViaSettings([{ + name: 'native', + source: `float native(float value) { return 1.0 + value; }` - } - ], 'gpu') + }], 'gpu') }); (GPU.isWebGLSupported ? test : skip)('via settings webgl', () => { - testDirectlyOnKernelViaSettings([ - { - name: 'native', - source: `float native(float value) { + testDirectlyOnKernelViaSettings([{ + name: 'native', + source: `float native(float value) { return 1.0 + value; }` - } - ], 'webgl') + }], 'webgl') }); (GPU.isWebGL2Supported ? test : skip)('via settings webgl2', () => { - testDirectlyOnKernelViaSettings([ - { - name: 'native', - source: `float native(float value) { + testDirectlyOnKernelViaSettings([{ + name: 'native', + source: `float native(float value) { return 1.0 + value; }` - } - ], 'webgl2') + }], 'webgl2') }); (GPU.isHeadlessGLSupported ? test : skip)('via settings headlessgl', () => { - testDirectlyOnKernelViaSettings([ - { - name: 'native', - source: `float native(float value) { + testDirectlyOnKernelViaSettings([{ + name: 'native', + source: `float native(float value) { return 1.0 + value; }` - } - ], 'headlessgl') + }], 'headlessgl') }); test('via settings cpu', () => { - testDirectlyOnKernelViaSettings([ - { - name: 'native', - source: `function native(value) { + testDirectlyOnKernelViaSettings([{ + name: 'native', + source: `function native(value) { return 1.0 + value; }`, - returnType: 'Float' - } - ], 'cpu') + returnType: 'Float' + }], 'cpu') }); @@ -372,81 +360,69 @@ describe('features: Adding nativeFunctions directly on kernel'); */ function testDirectlyOnKernelViaMethod(nativeFunctions, mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function (v) { - return native(v[this.thread.x]); - }, { - output: [1] - }) + const kernel = gpu.createKernel(function(v) { + return native(v[this.thread.x]); + }, { + output: [1] + }) .setNativeFunctions(nativeFunctions); assert.equal(kernel([1])[0], 2); gpu.destroy(); } test('via method auto', () => { - testDirectlyOnKernelViaMethod([ - { - name: 'native', - source: `float native(float value) { + testDirectlyOnKernelViaMethod([{ + name: 'native', + source: `float native(float value) { return 1.0 + value; }` - } - ]) + }]) }); test('via method gpu', () => { - testDirectlyOnKernelViaMethod([ - { - name: 'native', - source: `float native(float value) { + testDirectlyOnKernelViaMethod([{ + name: 'native', + source: `float native(float value) { return 1.0 + value; }` - } - ], 'gpu') + }], 'gpu') }); (GPU.isWebGLSupported ? test : skip)('via method webgl', () => { - testDirectlyOnKernelViaMethod([ - { - name: 'native', - source: `float native(float value) { + testDirectlyOnKernelViaMethod([{ + name: 'native', + source: `float native(float value) { return 1.0 + value; }` - } - ], 'webgl') + }], 'webgl') }); (GPU.isWebGL2Supported ? test : skip)('via method webgl2', () => { - testDirectlyOnKernelViaMethod([ - { - name: 'native', - source: `float native(float value) { + testDirectlyOnKernelViaMethod([{ + name: 'native', + source: `float native(float value) { return 1.0 + value; }` - } - ], 'webgl2') + }], 'webgl2') }); (GPU.isHeadlessGLSupported ? test : skip)('via method headlessgl', () => { - testDirectlyOnKernelViaMethod([ - { - name: 'native', - source: `float native(float value) { + testDirectlyOnKernelViaMethod([{ + name: 'native', + source: `float native(float value) { return 1.0 + value; }` - } - ], 'headlessgl') + }], 'headlessgl') }); test('via method cpu', () => { - testDirectlyOnKernelViaMethod([ - { - name: 'native', - source: `function native(value) { + testDirectlyOnKernelViaMethod([{ + name: 'native', + source: `function native(value) { return 1.0 + value; }`, - returnType: 'Float' - } - ], 'cpu') + returnType: 'Float' + }], 'cpu') }); @@ -475,7 +451,7 @@ test('gpu', () => { source: `float custom() { return 1.0; }` - },'gpu'); + }, 'gpu'); }); (GPU.isWebGLSupported ? test : skip)('webgl', () => { @@ -484,7 +460,7 @@ test('gpu', () => { source: `float custom() { return 1.0; }` - },'webgl'); + }, 'webgl'); }); (GPU.isWebGL2Supported ? test : skip)('webgl2', () => { @@ -502,7 +478,7 @@ test('gpu', () => { source: `float custom() { return 1.0; }` - },'headlessgl'); + }, 'headlessgl'); }); test('cpu', () => { @@ -512,5 +488,5 @@ test('cpu', () => { return 1.0; }`, returnType: 'Number' - },'cpu'); + }, 'cpu'); }); \ No newline at end of file diff --git a/test/features/add-typed-functions.js b/test/features/add-typed-functions.js index 72ec14ec..0fae969c 100644 --- a/test/features/add-typed-functions.js +++ b/test/features/add-typed-functions.js @@ -2,8 +2,10 @@ const { assert, skip, test, module: describe, only } = require('qunit'); const { GPU } = require('../../src'); describe('features: add typed functions vec2Test'); + function vec2Test(mode) { const gpu = new GPU({ mode }); + function typedFunction() { return [1, 2]; } @@ -11,9 +13,9 @@ function vec2Test(mode) { returnType: 'Array(2)' }); const kernel = gpu.createKernel(function() { - const result = typedFunction(); - return result[0] + result[1]; - }) + const result = typedFunction(); + return result[0] + result[1]; + }) .setOutput([1]); const result = kernel(); @@ -39,8 +41,10 @@ test('Array(2) - gpu', () => { describe('features: add typed functions vec3Test'); + function vec3Test(mode) { const gpu = new GPU({ mode }); + function typedFunction() { return [1, 2, 3]; } @@ -48,9 +52,9 @@ function vec3Test(mode) { returnType: 'Array(3)' }); const kernel = gpu.createKernel(function() { - const result = typedFunction(); - return result[0] + result[1] + result[2]; - }) + const result = typedFunction(); + return result[0] + result[1] + result[2]; + }) .setOutput([1]); const result = kernel(); assert.equal(result[0], 6); @@ -74,8 +78,10 @@ test('Array(3) - gpu', () => { }); describe('features: add typed functions vec4Test'); + function vec4Test(mode) { const gpu = new GPU({ mode }); + function typedFunction() { return [1, 2, 3, 4]; } @@ -83,9 +89,9 @@ function vec4Test(mode) { returnType: 'Array(4)' }); const kernel = gpu.createKernel(function() { - const result = typedFunction(); - return result[0] + result[1] + result[2] + result[3]; - }) + const result = typedFunction(); + return result[0] + result[1] + result[2] + result[3]; + }) .setOutput([1]); const result = kernel(); assert.equal(result[0], 10); @@ -106,4 +112,4 @@ test('Array(4) - gpu', () => { }); (GPU.isHeadlessGLSupported ? test : skip)('Array(4) - headlessgl', () => { vec4Test('headlessgl'); -}); +}); \ No newline at end of file diff --git a/test/features/argument-array-types.js b/test/features/argument-array-types.js index 93a1102d..69b55ee2 100644 --- a/test/features/argument-array-types.js +++ b/test/features/argument-array-types.js @@ -12,7 +12,7 @@ function testSinglePrecisionArray2(mode) { argumentTypes: { value: 'Array(2)' }, precision: 'single', }); - const result = kernel(new Float32Array([1,2])); + const result = kernel(new Float32Array([1, 2])); assert.equal(result[0], 3); gpu.destroy(); } @@ -50,7 +50,7 @@ function testUnsignedPrecisionArray2(mode) { argumentTypes: { value: 'Array(2)' }, precision: 'unsigned', }); - const result = kernel(new Float32Array([1,2])); + const result = kernel(new Float32Array([1, 2])); assert.equal(result[0], 3); gpu.destroy(); } @@ -88,7 +88,7 @@ function testSinglePrecisionArray3(mode) { argumentTypes: { value: 'Array(3)' }, precision: 'single', }); - const result = kernel(new Float32Array([1,2,3])); + const result = kernel(new Float32Array([1, 2, 3])); assert.equal(result[0], 6); gpu.destroy(); } @@ -126,7 +126,7 @@ function testUnsignedPrecisionArray3(mode) { argumentTypes: { value: 'Array(3)' }, precision: 'unsigned', }); - const result = kernel(new Float32Array([1,2,3])); + const result = kernel(new Float32Array([1, 2, 3])); assert.equal(result[0], 6); gpu.destroy(); } @@ -164,7 +164,7 @@ function testSinglePrecisionArray4(mode) { argumentTypes: { value: 'Array(4)' }, precision: 'single', }); - const result = kernel(new Float32Array([1,2,3,4])); + const result = kernel(new Float32Array([1, 2, 3, 4])); assert.equal(result[0], 10); gpu.destroy(); } @@ -202,7 +202,7 @@ function testUnsignedPrecisionArray4(mode) { argumentTypes: { value: 'Array(4)' }, precision: 'unsigned', }); - const result = kernel(new Float32Array([1,2,3,4])); + const result = kernel(new Float32Array([1, 2, 3, 4])); assert.equal(result[0], 10); gpu.destroy(); } @@ -229,4 +229,4 @@ test('unsigned precision Array(4) gpu', () => { test('unsigned precision Array(4) cpu', () => { testUnsignedPrecisionArray4('cpu'); -}); +}); \ No newline at end of file diff --git a/test/features/argument-array1d-types.js b/test/features/argument-array1d-types.js index ce409417..f575a692 100644 --- a/test/features/argument-array1d-types.js +++ b/test/features/argument-array1d-types.js @@ -13,10 +13,10 @@ function testSinglePrecisionArray1D2(mode) { precision: 'single', }); const value = [ - new Float32Array([1,2]), - new Float32Array([3,4]), - new Float32Array([5,6]), - new Float32Array([7,8]), + new Float32Array([1, 2]), + new Float32Array([3, 4]), + new Float32Array([5, 6]), + new Float32Array([7, 8]), ]; const result = kernel(value); assert.deepEqual(result, value); @@ -57,10 +57,10 @@ function testUnsignedPrecisionArray1D2(mode) { precision: 'unsigned', }); const value = [ - new Float32Array([1,2]), - new Float32Array([3,4]), - new Float32Array([5,6]), - new Float32Array([7,8]), + new Float32Array([1, 2]), + new Float32Array([3, 4]), + new Float32Array([5, 6]), + new Float32Array([7, 8]), ]; const result = kernel(value); assert.deepEqual(result, value); @@ -101,10 +101,10 @@ function testSinglePrecisionArray1D3(mode) { precision: 'single', }); const value = [ - new Float32Array([1,2,3]), - new Float32Array([4,5,6]), - new Float32Array([7,8,9]), - new Float32Array([10,11,12]), + new Float32Array([1, 2, 3]), + new Float32Array([4, 5, 6]), + new Float32Array([7, 8, 9]), + new Float32Array([10, 11, 12]), ]; const result = kernel(value); assert.deepEqual(result, value); @@ -145,10 +145,10 @@ function testUnsignedPrecisionArray1D3(mode) { precision: 'unsigned', }); const value = [ - new Float32Array([1,2,3]), - new Float32Array([4,5,6]), - new Float32Array([7,8,9]), - new Float32Array([10,11,12]), + new Float32Array([1, 2, 3]), + new Float32Array([4, 5, 6]), + new Float32Array([7, 8, 9]), + new Float32Array([10, 11, 12]), ]; const result = kernel(value); assert.deepEqual(result, value); @@ -190,10 +190,10 @@ function testUnsignedPrecisionArray1D4(mode) { precision: 'unsigned', }); const value = [ - new Float32Array([1,2,3,4]), - new Float32Array([5,6,7,8]), - new Float32Array([9,10,11,12]), - new Float32Array([13,14,15,16]), + new Float32Array([1, 2, 3, 4]), + new Float32Array([5, 6, 7, 8]), + new Float32Array([9, 10, 11, 12]), + new Float32Array([13, 14, 15, 16]), ]; const result = kernel(value); assert.deepEqual(result, value); @@ -223,4 +223,4 @@ test('fallback unsigned precision Array1D(4) gpu', () => { test('fallback unsigned precision Array1D(4) cpu', () => { testUnsignedPrecisionArray1D4('cpu'); -}); +}); \ No newline at end of file diff --git a/test/features/argument-array2d-types.js b/test/features/argument-array2d-types.js index 44e7e79b..8b4fe3f0 100644 --- a/test/features/argument-array2d-types.js +++ b/test/features/argument-array2d-types.js @@ -14,15 +14,16 @@ function testSinglePrecisionArray2D2(mode) { }); const value = [ [ - new Float32Array([1,2]), - new Float32Array([3,4]), - new Float32Array([5,6]), - new Float32Array([7,8]), - ], [ - new Float32Array([9,10]), - new Float32Array([11,12]), - new Float32Array([13,14]), - new Float32Array([15,16]), + new Float32Array([1, 2]), + new Float32Array([3, 4]), + new Float32Array([5, 6]), + new Float32Array([7, 8]), + ], + [ + new Float32Array([9, 10]), + new Float32Array([11, 12]), + new Float32Array([13, 14]), + new Float32Array([15, 16]), ] ]; const result = kernel(value); @@ -65,15 +66,16 @@ function testUnsignedPrecisionArray2D2(mode) { }); const value = [ [ - new Float32Array([1,2]), - new Float32Array([3,4]), - new Float32Array([5,6]), - new Float32Array([7,8]), - ], [ - new Float32Array([9,10]), - new Float32Array([11,12]), - new Float32Array([13,14]), - new Float32Array([15,16]), + new Float32Array([1, 2]), + new Float32Array([3, 4]), + new Float32Array([5, 6]), + new Float32Array([7, 8]), + ], + [ + new Float32Array([9, 10]), + new Float32Array([11, 12]), + new Float32Array([13, 14]), + new Float32Array([15, 16]), ] ]; const result = kernel(value); @@ -116,15 +118,16 @@ function testSinglePrecisionArray2D3(mode) { }); const value = [ [ - new Float32Array([1,2,3]), - new Float32Array([4,5,6]), - new Float32Array([7,8,9]), - new Float32Array([10,11,12]), - ], [ - new Float32Array([13,14,15]), - new Float32Array([16,17,18]), - new Float32Array([19,20,21]), - new Float32Array([22,23,25]), + new Float32Array([1, 2, 3]), + new Float32Array([4, 5, 6]), + new Float32Array([7, 8, 9]), + new Float32Array([10, 11, 12]), + ], + [ + new Float32Array([13, 14, 15]), + new Float32Array([16, 17, 18]), + new Float32Array([19, 20, 21]), + new Float32Array([22, 23, 25]), ] ]; const result = kernel(value); @@ -167,15 +170,16 @@ function testUnsignedPrecisionArray2D3(mode) { }); const value = [ [ - new Float32Array([1,2,3]), - new Float32Array([4,5,6]), - new Float32Array([7,8,9]), - new Float32Array([10,11,12]), - ], [ - new Float32Array([13,14,15]), - new Float32Array([16,17,18]), - new Float32Array([19,20,21]), - new Float32Array([22,23,25]), + new Float32Array([1, 2, 3]), + new Float32Array([4, 5, 6]), + new Float32Array([7, 8, 9]), + new Float32Array([10, 11, 12]), + ], + [ + new Float32Array([13, 14, 15]), + new Float32Array([16, 17, 18]), + new Float32Array([19, 20, 21]), + new Float32Array([22, 23, 25]), ] ]; const result = kernel(value); @@ -218,15 +222,16 @@ function testSinglePrecisionArray2D4(mode) { }); const value = [ [ - new Float32Array([1,2,3,4]), - new Float32Array([5,6,7,8]), - new Float32Array([9,10,11,12]), - new Float32Array([13,14,15,16]), - ], [ - new Float32Array([17,18,19,20]), - new Float32Array([21,22,23,24]), - new Float32Array([25,26,27,28]), - new Float32Array([29,30,31,32]), + new Float32Array([1, 2, 3, 4]), + new Float32Array([5, 6, 7, 8]), + new Float32Array([9, 10, 11, 12]), + new Float32Array([13, 14, 15, 16]), + ], + [ + new Float32Array([17, 18, 19, 20]), + new Float32Array([21, 22, 23, 24]), + new Float32Array([25, 26, 27, 28]), + new Float32Array([29, 30, 31, 32]), ] ]; const result = kernel(value); @@ -269,15 +274,16 @@ function testUnsignedPrecisionArray2D4(mode) { }); const value = [ [ - new Float32Array([1,2,3,4]), - new Float32Array([5,6,7,8]), - new Float32Array([9,10,11,12]), - new Float32Array([13,14,15,16]), - ], [ - new Float32Array([17,18,19,20]), - new Float32Array([21,22,23,24]), - new Float32Array([25,26,27,28]), - new Float32Array([29,30,31,32]), + new Float32Array([1, 2, 3, 4]), + new Float32Array([5, 6, 7, 8]), + new Float32Array([9, 10, 11, 12]), + new Float32Array([13, 14, 15, 16]), + ], + [ + new Float32Array([17, 18, 19, 20]), + new Float32Array([21, 22, 23, 24]), + new Float32Array([25, 26, 27, 28]), + new Float32Array([29, 30, 31, 32]), ] ]; const result = kernel(value); @@ -307,4 +313,4 @@ test('fallback unsigned precision Array2D(4) gpu', () => { test('fallback unsigned precision Array2D(4) cpu', () => { testUnsignedPrecisionArray2D4('cpu'); -}); +}); \ No newline at end of file diff --git a/test/features/argument-array3d-types.js b/test/features/argument-array3d-types.js index 68e1fe3a..07b05fac 100644 --- a/test/features/argument-array3d-types.js +++ b/test/features/argument-array3d-types.js @@ -8,34 +8,39 @@ function testSinglePrecisionArray3D2(mode) { const kernel = gpu.createKernel(function(value) { return value[this.thread.z][this.thread.y][this.thread.x]; }, { - output: [2,2,3], + output: [2, 2, 3], argumentTypes: { value: 'Array3D(2)' }, precision: 'single', }); const value = [ [ [ - new Float32Array([1,2]), - new Float32Array([3,4]), - ],[ - new Float32Array([5,6]), - new Float32Array([7,8]), - ] - ],[ + new Float32Array([1, 2]), + new Float32Array([3, 4]), + ], + [ + new Float32Array([5, 6]), + new Float32Array([7, 8]), + ] + ], + [ + [ + new Float32Array([9, 10]), + new Float32Array([11, 12]), + ], [ - new Float32Array([9,10]), - new Float32Array([11,12]), - ],[ - new Float32Array([13,14]), - new Float32Array([15,16]), + new Float32Array([13, 14]), + new Float32Array([15, 16]), ] - ],[ + ], + [ + [ + new Float32Array([17, 18]), + new Float32Array([19, 20]), + ], [ - new Float32Array([17,18]), - new Float32Array([19,20]), - ],[ - new Float32Array([21,22]), - new Float32Array([23,24]), + new Float32Array([21, 22]), + new Float32Array([23, 24]), ] ] ]; @@ -73,34 +78,39 @@ function testUnsignedPrecisionArray3D2(mode) { const kernel = gpu.createKernel(function(value) { return value[this.thread.z][this.thread.y][this.thread.x]; }, { - output: [2,2,3], + output: [2, 2, 3], argumentTypes: { value: 'Array2D(2)' }, precision: 'unsigned', }); const value = [ [ [ - new Float32Array([1,2]), - new Float32Array([3,4]), - ],[ - new Float32Array([5,6]), - new Float32Array([7,8]), - ] - ],[ + new Float32Array([1, 2]), + new Float32Array([3, 4]), + ], [ - new Float32Array([9,10]), - new Float32Array([11,12]), - ],[ - new Float32Array([13,14]), - new Float32Array([15,16]), + new Float32Array([5, 6]), + new Float32Array([7, 8]), ] - ],[ + ], + [ + [ + new Float32Array([9, 10]), + new Float32Array([11, 12]), + ], [ - new Float32Array([17,18]), - new Float32Array([19,20]), - ],[ - new Float32Array([21,22]), - new Float32Array([23,24]), + new Float32Array([13, 14]), + new Float32Array([15, 16]), + ] + ], + [ + [ + new Float32Array([17, 18]), + new Float32Array([19, 20]), + ], + [ + new Float32Array([21, 22]), + new Float32Array([23, 24]), ] ] ]; @@ -138,34 +148,39 @@ function testSinglePrecisionArray3D3(mode) { const kernel = gpu.createKernel(function(value) { return value[this.thread.z][this.thread.y][this.thread.x]; }, { - output: [2,2,3], + output: [2, 2, 3], argumentTypes: { value: 'Array3D(3)' }, precision: 'single', }); const value = [ [ [ - new Float32Array([1,2,3]), - new Float32Array([4,5,6]), - ],[ - new Float32Array([7,8,9]), - new Float32Array([10,11,12]), + new Float32Array([1, 2, 3]), + new Float32Array([4, 5, 6]), + ], + [ + new Float32Array([7, 8, 9]), + new Float32Array([10, 11, 12]), ] - ],[ + ], + [ + [ + new Float32Array([13, 14, 15]), + new Float32Array([16, 17, 18]), + ], [ - new Float32Array([13,14,15]), - new Float32Array([16,17,18]), - ],[ - new Float32Array([19,20,21]), - new Float32Array([22,23,24]), + new Float32Array([19, 20, 21]), + new Float32Array([22, 23, 24]), ] - ],[ + ], + [ + [ + new Float32Array([25, 26, 27]), + new Float32Array([28, 29, 30]), + ], [ - new Float32Array([25,26,27]), - new Float32Array([28,29,30]), - ],[ - new Float32Array([31,32,33]), - new Float32Array([34,35,36]), + new Float32Array([31, 32, 33]), + new Float32Array([34, 35, 36]), ] ] ]; @@ -203,34 +218,39 @@ function testUnsignedPrecisionArray3D3(mode) { const kernel = gpu.createKernel(function(value) { return value[this.thread.z][this.thread.y][this.thread.x]; }, { - output: [2,2,3], + output: [2, 2, 3], argumentTypes: { value: 'Array2D(3)' }, precision: 'unsigned', }); const value = [ [ [ - new Float32Array([1,2,3]), - new Float32Array([4,5,6]), - ],[ - new Float32Array([7,8,9]), - new Float32Array([10,11,12]), - ] - ],[ + new Float32Array([1, 2, 3]), + new Float32Array([4, 5, 6]), + ], [ - new Float32Array([13,14,15]), - new Float32Array([16,17,18]), - ],[ - new Float32Array([19,20,21]), - new Float32Array([22,23,24]), + new Float32Array([7, 8, 9]), + new Float32Array([10, 11, 12]), ] - ],[ + ], + [ + [ + new Float32Array([13, 14, 15]), + new Float32Array([16, 17, 18]), + ], [ - new Float32Array([25,26,27]), - new Float32Array([28,29,30]), - ],[ - new Float32Array([31,32,33]), - new Float32Array([34,35,36]), + new Float32Array([19, 20, 21]), + new Float32Array([22, 23, 24]), + ] + ], + [ + [ + new Float32Array([25, 26, 27]), + new Float32Array([28, 29, 30]), + ], + [ + new Float32Array([31, 32, 33]), + new Float32Array([34, 35, 36]), ] ] ]; @@ -268,34 +288,39 @@ function testSinglePrecisionArray3D4(mode) { const kernel = gpu.createKernel(function(value) { return value[this.thread.z][this.thread.y][this.thread.x]; }, { - output: [2,2,3], + output: [2, 2, 3], argumentTypes: { value: 'Array3D(4)' }, precision: 'single', }); const value = [ [ [ - new Float32Array([1,2,3,4]), - new Float32Array([5,6,7,8]), - ],[ - new Float32Array([9,10,11,12]), - new Float32Array([13,14,15,16]), + new Float32Array([1, 2, 3, 4]), + new Float32Array([5, 6, 7, 8]), + ], + [ + new Float32Array([9, 10, 11, 12]), + new Float32Array([13, 14, 15, 16]), ] - ],[ + ], + [ [ - new Float32Array([17,18,19,20]), - new Float32Array([21,22,23,24]), - ],[ - new Float32Array([25,26,27,28]), - new Float32Array([29,30,31,32]), + new Float32Array([17, 18, 19, 20]), + new Float32Array([21, 22, 23, 24]), + ], + [ + new Float32Array([25, 26, 27, 28]), + new Float32Array([29, 30, 31, 32]), ] - ],[ + ], + [ + [ + new Float32Array([33, 34, 35, 36]), + new Float32Array([37, 38, 39, 40]), + ], [ - new Float32Array([33,34,35,36]), - new Float32Array([37,38,39,40]), - ],[ - new Float32Array([41,42,43,44]), - new Float32Array([45,46,47,48]), + new Float32Array([41, 42, 43, 44]), + new Float32Array([45, 46, 47, 48]), ] ] ]; @@ -333,34 +358,39 @@ function testUnsignedPrecisionArray3D4(mode) { const kernel = gpu.createKernel(function(value) { return value[this.thread.z][this.thread.y][this.thread.x]; }, { - output: [2,2,3], + output: [2, 2, 3], argumentTypes: { value: 'Array2D(3)' }, precision: 'unsigned', }); const value = [ [ [ - new Float32Array([1,2,3,4]), - new Float32Array([5,6,7,8]), - ],[ - new Float32Array([9,10,11,12]), - new Float32Array([13,14,15,16]), + new Float32Array([1, 2, 3, 4]), + new Float32Array([5, 6, 7, 8]), + ], + [ + new Float32Array([9, 10, 11, 12]), + new Float32Array([13, 14, 15, 16]), ] - ],[ + ], + [ [ - new Float32Array([17,18,19,20]), - new Float32Array([21,22,23,24]), - ],[ - new Float32Array([25,26,27,28]), - new Float32Array([29,30,31,32]), + new Float32Array([17, 18, 19, 20]), + new Float32Array([21, 22, 23, 24]), + ], + [ + new Float32Array([25, 26, 27, 28]), + new Float32Array([29, 30, 31, 32]), ] - ],[ + ], + [ [ - new Float32Array([33,34,35,36]), - new Float32Array([37,38,39,40]), - ],[ - new Float32Array([41,42,43,44]), - new Float32Array([45,46,47,48]), + new Float32Array([33, 34, 35, 36]), + new Float32Array([37, 38, 39, 40]), + ], + [ + new Float32Array([41, 42, 43, 44]), + new Float32Array([45, 46, 47, 48]), ] ] ]; @@ -391,4 +421,4 @@ test('fallback unsigned precision Array3D(4) gpu', () => { test('fallback unsigned precision Array3D(4) cpu', () => { testUnsignedPrecisionArray3D4('cpu'); -}); +}); \ No newline at end of file diff --git a/test/features/arithmetic-operators.js b/test/features/arithmetic-operators.js index 5215b8af..fc2494df 100644 --- a/test/features/arithmetic-operators.js +++ b/test/features/arithmetic-operators.js @@ -378,4 +378,4 @@ test('decrement early return auto', () => { test('decrement early return cpu', () => { decrementEarlyReturn('cpu'); -}); +}); \ No newline at end of file diff --git a/test/features/assignment-operators.js b/test/features/assignment-operators.js index e18bada0..45c26d0f 100644 --- a/test/features/assignment-operators.js +++ b/test/features/assignment-operators.js @@ -265,4 +265,4 @@ test('exponential equal auto', () => { test('exponential equal cpu', () => { exponentialEqual('cpu'); -}); +}); \ No newline at end of file diff --git a/test/features/basic-math.js b/test/features/basic-math.js index 828aec5d..3571ee5a 100644 --- a/test/features/basic-math.js +++ b/test/features/basic-math.js @@ -8,20 +8,20 @@ function sumABTest(mode) { const f = gpu.createKernel(function(a, b) { return (a[this.thread.x] + b[this.thread.x]); }, { - output : [6], - mode : mode, + output: [6], + mode: mode, }); - assert.ok( f !== null, 'function generated test'); + assert.ok(f !== null, 'function generated test'); const a = [1, 2, 3, 5, 6, 7]; const b = [4, 5, 6, 1, 2, 3]; - const res = f(a,b); + const res = f(a, b); const exp = [5, 7, 9, 6, 8, 10]; - for(let i = 0; i < exp.length; ++i) { - assert.equal(res[i], exp[i], 'Result arr idx: '+i); + for (let i = 0; i < exp.length; ++i) { + assert.equal(res[i], exp[i], 'Result arr idx: ' + i); } gpu.destroy(); } @@ -60,21 +60,21 @@ function multABTest(mode) { sum += a[this.thread.y][2] * b[2][this.thread.x]; return sum; }, { - output : [3, 3] + output: [3, 3] }); assert.ok(f !== null, 'function generated test'); assert.deepEqual(f( - [ - [1, 2, 3], - [4, 5, 6], - [7, 8, 9] - ], - [ - [1, 2, 3], - [4, 5, 6], - [7, 8, 9] - ]).map((object) => { return Array.from(object); }), + [ + [1, 2, 3], + [4, 5, 6], + [7, 8, 9] + ], + [ + [1, 2, 3], + [4, 5, 6], + [7, 8, 9] + ]).map((object) => { return Array.from(object); }), [ [30, 36, 42], [66, 81, 96], @@ -102,5 +102,4 @@ test('multAB gpu', () => { }); test('multAB cpu', () => { multABTest('cpu'); -}); - +}); \ No newline at end of file diff --git a/test/features/bitwise-operators.js b/test/features/bitwise-operators.js index 3d0ac614..f93572b4 100644 --- a/test/features/bitwise-operators.js +++ b/test/features/bitwise-operators.js @@ -6,8 +6,8 @@ describe('feature: bitwise operators'); function testBitwiseAndSinglePrecision(mode) { const gpu = new GPU({ mode }); const kernel = gpu.createKernel(function(v1, v2) { - return v1 & v2; - }) + return v1 & v2; + }) .setOutput([1]) .setPrecision('single'); @@ -47,8 +47,8 @@ test('bitwise AND single precision cpu', () => { function testBitwiseAndUnsignedPrecision(mode) { const gpu = new GPU({ mode }); const kernel = gpu.createKernel(function(v1, v2) { - return v1 & v2; - }) + return v1 & v2; + }) .setOutput([1]) .setPrecision('unsigned'); @@ -88,8 +88,8 @@ test('bitwise AND unsigned precision cpu', () => { function testBitwiseOrSinglePrecision(mode) { const gpu = new GPU({ mode }); const kernel = gpu.createKernel(function(v1, v2) { - return v1 | v2; - }) + return v1 | v2; + }) .setOutput([1]) .setPrecision('single'); @@ -118,7 +118,7 @@ function testBitwiseOrSinglePrecision(mode) { testBitwiseOrSinglePrecision('webgl2'); }); -(GPU.isHeadlessGLSupported && GPU.isSinglePrecisionSupported? test : skip)('bitwise OR single precision headlessgl', () => { +(GPU.isHeadlessGLSupported && GPU.isSinglePrecisionSupported ? test : skip)('bitwise OR single precision headlessgl', () => { testBitwiseOrSinglePrecision('headlessgl'); }); @@ -129,8 +129,8 @@ test('bitwise OR single precision cpu', () => { function testBitwiseOrUnsignedPrecision(mode) { const gpu = new GPU({ mode }); const kernel = gpu.createKernel(function(v1, v2) { - return v1 | v2; - }) + return v1 | v2; + }) .setOutput([1]) .setPrecision('unsigned'); @@ -170,8 +170,8 @@ test('bitwise OR unsigned precision cpu', () => { function testBitwiseXORSinglePrecision(mode) { const gpu = new GPU({ mode }); const kernel = gpu.createKernel(function(v1, v2) { - return v1 ^ v2; - }) + return v1 ^ v2; + }) .setOutput([1]) .setPrecision('single'); @@ -211,8 +211,8 @@ test('bitwise XOR single precision cpu', () => { function testBitwiseXORUnsignedPrecision(mode) { const gpu = new GPU({ mode }); const kernel = gpu.createKernel(function(v1, v2) { - return v1 ^ v2; - }) + return v1 ^ v2; + }) .setOutput([1]) .setPrecision('unsigned'); @@ -252,8 +252,8 @@ test('bitwise XOR unsigned precision cpu', () => { function testBitwiseNotSinglePrecision(mode) { const gpu = new GPU({ mode }); const kernel = gpu.createKernel(function(v1) { - return ~v1; - }) + return ~v1; + }) .setOutput([1]) .setPrecision('single'); @@ -291,8 +291,8 @@ test('bitwise NOT single precision cpu', () => { function testBitwiseNotUnsignedPrecision(mode) { const gpu = new GPU({ mode }); const kernel = gpu.createKernel(function(v1) { - return ~v1; - }) + return ~v1; + }) .setOutput([1]) .setPrecision('unsigned'); @@ -330,8 +330,8 @@ test('bitwise NOT unsigned precision cpu', () => { function testBitwiseZeroFillLeftShiftSinglePrecision(mode) { const gpu = new GPU({ mode }); const kernel = gpu.createKernel(function(v1, v2) { - return v1 << v2; - }) + return v1 << v2; + }) .setOutput([1]) .setPrecision('single'); @@ -371,8 +371,8 @@ test('bitwise zero fill left shift single precision cpu', () => { function testBitwiseZeroFillLeftShiftUnsignedPrecision(mode) { const gpu = new GPU({ mode }); const kernel = gpu.createKernel(function(v1, v2) { - return v1 << v2; - }) + return v1 << v2; + }) .setOutput([1]) .setPrecision('unsigned'); @@ -412,8 +412,8 @@ test('bitwise zero fill left shift unsigned precision cpu', () => { function testBitwiseSignedRightShiftSinglePrecision(mode) { const gpu = new GPU({ mode }); const kernel = gpu.createKernel(function(v1, v2) { - return v1 >> v2; - }) + return v1 >> v2; + }) .setOutput([1]) .setPrecision('single'); @@ -453,8 +453,8 @@ test('bitwise signed fill right shift single precision cpu', () => { function testBitwiseSignedRightShiftUnsignedPrecision(mode) { const gpu = new GPU({ mode }); const kernel = gpu.createKernel(function(v1, v2) { - return v1 >> v2; - }) + return v1 >> v2; + }) .setOutput([1]) .setPrecision('unsigned'); @@ -494,8 +494,8 @@ test('bitwise signed fill right shift unsigned precision cpu', () => { function testBitwiseZeroFillRightShiftSinglePrecision(mode) { const gpu = new GPU({ mode }); const kernel = gpu.createKernel(function(v1, v2) { - return v1 >>> v2; - }) + return v1 >>> v2; + }) .setOutput([1]) .setPrecision('single'); @@ -535,8 +535,8 @@ test('bitwise zero fill right shift single precision cpu', () => { function testBitwiseZeroFillRightShiftUnsignedPrecision(mode) { const gpu = new GPU({ mode }); const kernel = gpu.createKernel(function(v1, v2) { - return v1 >>> v2; - }) + return v1 >>> v2; + }) .setOutput([1]) .setPrecision('unsigned'); @@ -571,4 +571,4 @@ test('bitwise zero fill right shift unsigned precision gpu', () => { test('bitwise zero fill right shift unsigned precision cpu', () => { testBitwiseZeroFillRightShiftUnsignedPrecision('cpu'); -}); +}); \ No newline at end of file diff --git a/test/features/canvas.js b/test/features/canvas.js index e0f26661..4b0635fd 100644 --- a/test/features/canvas.js +++ b/test/features/canvas.js @@ -3,6 +3,7 @@ const { GPU } = require('../../src'); const { greenCanvas } = require('../browser-test-utils'); describe('features: canvas argument'); + function canvasArgumentTest(mode) { const gpu = new GPU({ mode }); const canvas = greenCanvas(mode, 1, 1); @@ -10,7 +11,7 @@ function canvasArgumentTest(mode) { const pixel = canvas[this.thread.y][this.thread.x]; return pixel[1]; }, { - output : [canvas.width, canvas.height] + output: [canvas.width, canvas.height] }); const result = kernel(canvas); assert.equal(result[0][0], 1); @@ -44,7 +45,7 @@ function canvasManuallyDefinedArgumentTest(mode) { const pixel = canvas[this.thread.y][this.thread.x]; return pixel[1]; }, { - output : [canvas.width, canvas.height], + output: [canvas.width, canvas.height], argumentTypes: { canvas: 'HTMLCanvas' } }); const result = kernel(canvas); diff --git a/test/features/clear-textures.js b/test/features/clear-textures.js index 0ca3db60..3edcddd1 100644 --- a/test/features/clear-textures.js +++ b/test/features/clear-textures.js @@ -5,6 +5,7 @@ describe('features: clear textures'); function clearTexture(precision, mode) { const gpu = new GPU({ mode }); + function makeTexture() { return (gpu.createKernel(function() { return this.thread.x; @@ -15,11 +16,11 @@ function clearTexture(precision, mode) { }))(); } const texture = makeTexture(); - assert.deepEqual(texture.toArray(), new Float32Array([0,1,2,3,4])); + assert.deepEqual(texture.toArray(), new Float32Array([0, 1, 2, 3, 4])); texture.clear(); const texture2 = makeTexture(); // put another texture in the way - assert.deepEqual(texture.toArray(), new Float32Array([0,0,0,0,0])); - assert.deepEqual(texture2.toArray(), new Float32Array([0,1,2,3,4])); + assert.deepEqual(texture.toArray(), new Float32Array([0, 0, 0, 0, 0])); + assert.deepEqual(texture2.toArray(), new Float32Array([0, 1, 2, 3, 4])); gpu.destroy(); } diff --git a/test/features/clone-textures.js b/test/features/clone-textures.js index db5d3c8c..b2758dc7 100644 --- a/test/features/clone-textures.js +++ b/test/features/clone-textures.js @@ -5,6 +5,7 @@ describe('features: clone textures'); function copy1DTexture(precision, mode) { const gpu = new GPU({ mode }); + function makeTexture() { return (gpu.createKernel(function() { return this.thread.x; @@ -56,6 +57,7 @@ test('1D unsigned precision auto', () => { function copy2DTexture(precision, mode) { const gpu = new GPU({ mode }); + function makeTexture() { return (gpu.createKernel(function() { return this.thread.x + (this.thread.y * this.output.x); @@ -107,6 +109,7 @@ test('2D unsigned precision auto', () => { function copy3DTexture(precision, mode) { const gpu = new GPU({ mode }); + function makeTexture() { return (gpu.createKernel(function() { return this.thread.x + (this.thread.y * this.output.x) * (this.output.x * this.output.y * this.thread.z); @@ -154,4 +157,4 @@ test('3D unsigned precision auto', () => { (GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('3D single precision headlessgl', () => { copy3DTexture('single', 'headlessgl'); -}); +}); \ No newline at end of file diff --git a/test/features/combine-kernels.js b/test/features/combine-kernels.js index 3db77f89..fec45507 100644 --- a/test/features/combine-kernels.js +++ b/test/features/combine-kernels.js @@ -2,6 +2,7 @@ const { assert, skip, test, module: describe, only } = require('qunit'); const { GPU } = require('../../src'); describe('features: combine kernels'); + function combineKernels(mode) { const gpu = new GPU({ mode }); @@ -17,7 +18,7 @@ function combineKernels(mode) { return kernel2(kernel1(array1, array2), array3); }); - const result = superKernel([1,2,3,4,5], [1,2,3,4,5], [1,2,3,4,5]); + const result = superKernel([1, 2, 3, 4, 5], [1, 2, 3, 4, 5], [1, 2, 3, 4, 5]); assert.deepEqual(Array.from(result), [2, 8, 18, 32, 50]); gpu.destroy() } @@ -62,7 +63,7 @@ function combineKernelsSinglePrecision(mode) { return kernel2(kernel1(array1, array2), array3); }); - const result = superKernel([1,2,3,4,5], [1,2,3,4,5], [1,2,3,4,5]); + const result = superKernel([1, 2, 3, 4, 5], [1, 2, 3, 4, 5], [1, 2, 3, 4, 5]); assert.deepEqual(Array.from(result), [2, 8, 18, 32, 50]); gpu.destroy() } @@ -115,7 +116,7 @@ function combineKernelsOptimizeFloatMemory(mode) { return kernel2(kernel1(array1, array2), array3); }); - const result = superKernel([1,2,3,4,5], [1,2,3,4,5], [1,2,3,4,5]); + const result = superKernel([1, 2, 3, 4, 5], [1, 2, 3, 4, 5], [1, 2, 3, 4, 5]); assert.deepEqual(Array.from(result), [2, 8, 18, 32, 50]); gpu.destroy() } @@ -142,4 +143,4 @@ function combineKernelsOptimizeFloatMemory(mode) { test('combine kernel float textures cpu', () => { combineKernelsOptimizeFloatMemory('cpu'); -}); +}); \ No newline at end of file diff --git a/test/features/constants-array.js b/test/features/constants-array.js index 910d8086..83e22f34 100644 --- a/test/features/constants-array.js +++ b/test/features/constants-array.js @@ -39,4 +39,4 @@ test('gpu', () => { test('arrayConstantTest cpu', () => { feature('cpu'); -}); +}); \ No newline at end of file diff --git a/test/features/constants-bool.js b/test/features/constants-bool.js index 4d9c0bed..1e8fcfa0 100644 --- a/test/features/constants-bool.js +++ b/test/features/constants-bool.js @@ -9,8 +9,7 @@ function boolTrueConstantTest(mode) { const tryConst = gpu.createKernel( function() { return this.constants.bool ? 1 : 0; - }, - { + }, { constants: { bool }, output: [1] }, @@ -51,8 +50,7 @@ function boolFalseConstantTest(mode) { const tryConst = gpu.createKernel( function() { return this.constants.bool ? 1 : 0; - }, - { + }, { constants: { bool }, output: [1] }, @@ -84,4 +82,4 @@ test('false gpu', () => { test('false cpu', () => { boolFalseConstantTest('cpu'); -}); +}); \ No newline at end of file diff --git a/test/features/constants-canvas.js b/test/features/constants-canvas.js index 373f14c0..91641cc4 100644 --- a/test/features/constants-canvas.js +++ b/test/features/constants-canvas.js @@ -3,6 +3,7 @@ const { GPU } = require('../../src'); const { greenCanvas } = require('../browser-test-utils'); describe('features: constants canvas'); + function canvasConstantTest(mode) { const gpu = new GPU({ mode }); const canvas = greenCanvas(mode, 1, 1); @@ -10,8 +11,7 @@ function canvasConstantTest(mode) { function() { const pixel = this.constants.canvas[this.thread.y][this.thread.x]; return pixel.g; - }, - { + }, { constants: { canvas }, output: [1, 1], } @@ -40,4 +40,4 @@ function canvasConstantTest(mode) { (typeof HTMLCanvasElement !== 'undefined' ? test : skip)('cpu', () => { canvasConstantTest('cpu'); -}); +}); \ No newline at end of file diff --git a/test/features/constants-float.js b/test/features/constants-float.js index 16bf7c1c..7b13119f 100644 --- a/test/features/constants-float.js +++ b/test/features/constants-float.js @@ -2,14 +2,14 @@ const { assert, skip, test, module: describe } = require('qunit'); const { GPU } = require('../../src'); describe('features: constants float'); + function floatConstantTest(mode) { const gpu = new GPU({ mode }); const float = 200.01; const tryConst = gpu.createKernel( function() { return this.constants.float; - }, - { + }, { constants: { float }, output: [2] }, @@ -17,8 +17,8 @@ function floatConstantTest(mode) { const result = tryConst(); const match = new Float32Array([200.01, 200.01]); const test = ( - result[0].toFixed(1) === match[0].toFixed(1) - && result[1].toFixed(1) === match[1].toFixed(1) + result[0].toFixed(1) === match[0].toFixed(1) && + result[1].toFixed(1) === match[1].toFixed(1) ); assert.ok(test, 'float constant passed test'); gpu.destroy(); @@ -46,4 +46,4 @@ test('gpu', () => { test('cpu', () => { floatConstantTest('cpu'); -}); +}); \ No newline at end of file diff --git a/test/features/constants-image-array.js b/test/features/constants-image-array.js index f286916b..60b358c5 100644 --- a/test/features/constants-image-array.js +++ b/test/features/constants-image-array.js @@ -2,10 +2,12 @@ const { assert, skip, test, module: describe } = require('qunit'); const { GPU, WebGLKernel } = require('../../src'); describe('features: constants image array'); + function feature(mode, done) { const gpu = new GPU({ mode }); const image = new Image(); const imageArray = [image, image]; + function fn() { const pixel1 = this.constants.imageArray[0][this.thread.y][this.thread.x]; const pixel2 = this.constants.imageArray[1][this.thread.y][this.thread.x]; @@ -66,4 +68,4 @@ function feature(mode, done) { (typeof Image !== 'undefined' ? test : skip)('cpu', t => { feature('cpu', t.async()); -}); +}); \ No newline at end of file diff --git a/test/features/constants-image.js b/test/features/constants-image.js index ae70389c..c66cac93 100644 --- a/test/features/constants-image.js +++ b/test/features/constants-image.js @@ -2,6 +2,7 @@ const { assert, skip, test, module: describe } = require('qunit'); const { GPU } = require('../../src'); describe('features: constants image'); + function imageConstantTest(mode, done) { const gpu = new GPU({ mode }); const image = new Image(); @@ -23,8 +24,7 @@ function imageConstantTest(mode, done) { color = pixel.b; } return 255 * color; - }, - { + }, { constants: { image }, output: [width, height, 3], } @@ -55,4 +55,4 @@ function imageConstantTest(mode, done) { (typeof Image !== 'undefined' ? test : skip)('cpu', t => { imageConstantTest('cpu', t.async()); -}); +}); \ No newline at end of file diff --git a/test/features/constants-integer.js b/test/features/constants-integer.js index b3f20005..71628d03 100644 --- a/test/features/constants-integer.js +++ b/test/features/constants-integer.js @@ -9,8 +9,7 @@ function integerConstantTest(mode) { const tryConst = gpu.createKernel( function() { return this.constants.int; - }, - { + }, { constants: { int } } ).setOutput([2]); @@ -43,4 +42,4 @@ test('gpu', () => { test('cpu', () => { integerConstantTest('cpu'); -}); +}); \ No newline at end of file diff --git a/test/features/constants-texture.js b/test/features/constants-texture.js index 83881603..0410f692 100644 --- a/test/features/constants-texture.js +++ b/test/features/constants-texture.js @@ -2,6 +2,7 @@ const { assert, skip, test, module: describe, only } = require('qunit'); const { GPU } = require('../../src'); describe('features: constants texture 1d'); + function test1D(mode) { const gpu = new GPU({ mode }); const createTexture = gpu @@ -14,8 +15,7 @@ function test1D(mode) { const tryConst = gpu.createKernel( function() { return this.constants.texture[this.thread.x]; - }, - { + }, { constants: { texture } } ).setOutput([2]); @@ -33,15 +33,15 @@ test('gpu', () => { test1D('gpu'); }); -(GPU.isWebGLSupported ? test : skip)('webgl', function () { +(GPU.isWebGLSupported ? test : skip)('webgl', function() { test1D('webgl'); }); -(GPU.isWebGL2Supported ? test : skip)('webgl2', function () { +(GPU.isWebGL2Supported ? test : skip)('webgl2', function() { test1D('webgl2'); }); -(GPU.isHeadlessGLSupported ? test : skip)('headlessgl', function () { +(GPU.isHeadlessGLSupported ? test : skip)('headlessgl', function() { test1D('headlessgl'); }); @@ -52,6 +52,7 @@ test('cpu', () => { describe('features: constants texture 2d'); + function test2D(mode) { const gpu = new GPU({ mode }); const createTexture = gpu @@ -64,8 +65,7 @@ function test2D(mode) { const tryConst = gpu.createKernel( function() { return this.constants.texture[this.thread.y][this.thread.x]; - }, - { + }, { constants: { texture } } ).setOutput([2, 2]); @@ -83,15 +83,15 @@ test('gpu', () => { test2D('gpu'); }); -(GPU.isWebGLSupported ? test : skip)('webgl', function () { +(GPU.isWebGLSupported ? test : skip)('webgl', function() { test2D('webgl'); }); -(GPU.isWebGL2Supported ? test : skip)('webgl2', function () { +(GPU.isWebGL2Supported ? test : skip)('webgl2', function() { test2D('webgl2'); }); -(GPU.isHeadlessGLSupported ? test : skip)('headlessgl', function () { +(GPU.isHeadlessGLSupported ? test : skip)('headlessgl', function() { test2D('headlessgl'); }); @@ -101,6 +101,7 @@ test('cpu', () => { describe('features: constants texture 3d'); + function test3D(mode) { const gpu = new GPU({ mode }); const createTexture = gpu @@ -113,13 +114,15 @@ function test3D(mode) { const tryConst = gpu.createKernel( function() { return this.constants.texture[this.thread.z][this.thread.y][this.thread.x]; - }, - { + }, { constants: { texture } } ).setOutput([2, 2, 2]); const result = tryConst(); - const expected = [[new Float32Array([200, 200]), new Float32Array([200, 200])],[new Float32Array([200, 200]), new Float32Array([200, 200])]]; + const expected = [ + [new Float32Array([200, 200]), new Float32Array([200, 200])], + [new Float32Array([200, 200]), new Float32Array([200, 200])] + ]; assert.deepEqual(result, expected, 'texture constant passed test'); gpu.destroy(); } @@ -132,18 +135,18 @@ test('gpu', () => { test3D('cpu'); }); -(GPU.isWebGLSupported ? test : skip)('webgl', function () { +(GPU.isWebGLSupported ? test : skip)('webgl', function() { test3D('webgl'); }); -(GPU.isWebGL2Supported ? test : skip)('webgl2', function () { +(GPU.isWebGL2Supported ? test : skip)('webgl2', function() { test3D('webgl2'); }); -(GPU.isHeadlessGLSupported ? test : skip)('headlessgl', function () { +(GPU.isHeadlessGLSupported ? test : skip)('headlessgl', function() { test3D('headlessgl'); }); test('cpu', () => { test3D('cpu'); -}); +}); \ No newline at end of file diff --git a/test/features/cpu-with-textures.js b/test/features/cpu-with-textures.js index b5d80233..035dfb1d 100644 --- a/test/features/cpu-with-textures.js +++ b/test/features/cpu-with-textures.js @@ -113,7 +113,10 @@ function cpuWithTexturesArray2WithSinglePrecision(mode) { }); const texture = kernel(); assert.ok(texture.toArray); - assert.deepEqual(texture.toArray().map(value => Array.from(value)), [[0,0], [1,1]]); + assert.deepEqual(texture.toArray().map(value => Array.from(value)), [ + [0, 0], + [1, 1] + ]); const cpu = new GPU({ mode: 'cpu' }); const cpuKernel = cpu.createKernel(function(v) { return v[this.thread.x]; @@ -121,12 +124,18 @@ function cpuWithTexturesArray2WithSinglePrecision(mode) { assert.notOk(cpuKernel.kernel.textureCache); const result = cpuKernel(texture); assert.ok(cpuKernel.kernel.textureCache); - assert.deepEqual(result.map(value => Array.from(value)), [[0,0], [1,1]]); + assert.deepEqual(result.map(value => Array.from(value)), [ + [0, 0], + [1, 1] + ]); let calledTwice = false; texture.toArray = () => { calledTwice = true; }; - assert.deepEqual(cpuKernel(texture).map(value => Array.from(value)), [[0,0], [1,1]]); + assert.deepEqual(cpuKernel(texture).map(value => Array.from(value)), [ + [0, 0], + [1, 1] + ]); assert.equal(calledTwice, false); gpu.destroy(); } @@ -162,7 +171,10 @@ function cpuWithTexturesArray3WithSinglePrecision(mode) { }); const texture = kernel(); assert.ok(texture.toArray); - assert.deepEqual(texture.toArray().map(value => Array.from(value)), [[0,0,0], [1,1,1]]); + assert.deepEqual(texture.toArray().map(value => Array.from(value)), [ + [0, 0, 0], + [1, 1, 1] + ]); const cpu = new GPU({ mode: 'cpu' }); const cpuKernel = cpu.createKernel(function(v) { return v[this.thread.x]; @@ -170,12 +182,18 @@ function cpuWithTexturesArray3WithSinglePrecision(mode) { assert.notOk(cpuKernel.kernel.textureCache); const result = cpuKernel(texture); assert.ok(cpuKernel.kernel.textureCache); - assert.deepEqual(result.map(value => Array.from(value)), [[0,0,0], [1,1,1]]); + assert.deepEqual(result.map(value => Array.from(value)), [ + [0, 0, 0], + [1, 1, 1] + ]); let calledTwice = false; texture.toArray = () => { calledTwice = true; }; - assert.deepEqual(cpuKernel(texture).map(value => Array.from(value)), [[0,0,0], [1,1,1]]); + assert.deepEqual(cpuKernel(texture).map(value => Array.from(value)), [ + [0, 0, 0], + [1, 1, 1] + ]); assert.equal(calledTwice, false); gpu.destroy(); } @@ -211,7 +229,10 @@ function cpuWithTexturesArray4WithSinglePrecision(mode) { }); const texture = kernel(); assert.ok(texture.toArray); - assert.deepEqual(texture.toArray().map(value => Array.from(value)), [[0,0,0,0], [1,1,1,1]]); + assert.deepEqual(texture.toArray().map(value => Array.from(value)), [ + [0, 0, 0, 0], + [1, 1, 1, 1] + ]); const cpu = new GPU({ mode: 'cpu' }); const cpuKernel = cpu.createKernel(function(v) { return v[this.thread.x]; @@ -219,12 +240,18 @@ function cpuWithTexturesArray4WithSinglePrecision(mode) { assert.notOk(cpuKernel.kernel.textureCache); const result = cpuKernel(texture); assert.ok(cpuKernel.kernel.textureCache); - assert.deepEqual(result.map(value => Array.from(value)), [[0,0,0,0], [1,1,1,1]]); + assert.deepEqual(result.map(value => Array.from(value)), [ + [0, 0, 0, 0], + [1, 1, 1, 1] + ]); let calledTwice = false; texture.toArray = () => { calledTwice = true; }; - assert.deepEqual(cpuKernel(texture).map(value => Array.from(value)), [[0,0,0,0], [1,1,1,1]]); + assert.deepEqual(cpuKernel(texture).map(value => Array.from(value)), [ + [0, 0, 0, 0], + [1, 1, 1, 1] + ]); assert.equal(calledTwice, false); gpu.destroy(); } @@ -296,4 +323,4 @@ function cpuWithTexturesNumberWithUnsignedPrecision(mode) { (GPU.isHeadlessGLSupported && GPU.isSinglePrecisionSupported ? test : skip)('number with unsigned precision headlessgl', () => { cpuWithTexturesNumberWithUnsignedPrecision('headlessgl'); -}); +}); \ No newline at end of file diff --git a/test/features/create-kernel-map.js b/test/features/create-kernel-map.js index 5af56cc7..d516b545 100644 --- a/test/features/create-kernel-map.js +++ b/test/features/create-kernel-map.js @@ -2,6 +2,7 @@ const { assert, skip, test, module: describe, only } = require('qunit'); const { GPU, alias } = require('../../src'); describe('features: create kernel map'); + function createPropertyKernels(gpu, output) { function divide(d1, d2) { return d1 / d2; @@ -12,7 +13,7 @@ function createPropertyKernels(gpu, output) { return gpu.createKernelMap({ addResult: adder, divideResult: divide - }, function (k1, k2, k3) { + }, function(k1, k2, k3) { return divide(adder(k1[this.thread.x], k2[this.thread.x]), k3[this.thread.x]); }).setOutput(output); } @@ -21,19 +22,20 @@ function createArrayKernels(gpu, output) { function add(a1, a2) { return a1 + a2; } + function divide(d1, d2) { return d1 / d2; } return gpu.createKernelMap([ add, divide - ], function (k1, k2, k3) { + ], function(k1, k2, k3) { return divide(add(k1[this.thread.x], k2[this.thread.x]), k3[this.thread.x]); }).setOutput(output) } function createKernel(gpu, output) { - return gpu.createKernel(function (a) { + return gpu.createKernel(function(a) { return a[this.thread.x]; }).setOutput(output); } @@ -120,7 +122,7 @@ function createKernelMapObject1Dimension5Length(mode) { const gpu = new GPU({ mode }); const superKernel = createPropertyKernels(gpu, [5]); const kernel = createKernel(gpu, [5]); - const output = superKernel([1,2,3,4,5], [1,2,3,4,5], [1,2,3,4,5]); + const output = superKernel([1, 2, 3, 4, 5], [1, 2, 3, 4, 5], [1, 2, 3, 4, 5]); const result = Array.from(output.result); const addResult = Array.from(kernel(output.addResult)); const divideResult = Array.from(kernel(output.divideResult)); @@ -156,10 +158,10 @@ test('createKernelMap object 1 dimension 5 length cpu', () => { function createKernelMapArrayAuto(mode) { - const gpu = new GPU({mode}); + const gpu = new GPU({ mode }); const superKernel = createArrayKernels(gpu, [5]); const kernel = createKernel(gpu, [5]); - const output = superKernel([1,2,3,4,5], [1,2,3,4,5], [1,2,3,4,5]); + const output = superKernel([1, 2, 3, 4, 5], [1, 2, 3, 4, 5], [1, 2, 3, 4, 5]); const result = Array.from(output.result); const addResult = Array.from(kernel(output[0])); const divideResult = Array.from(kernel(output[1])); @@ -194,6 +196,7 @@ test('createKernelMap array cpu', () => { function createKernelMap3DAuto(mode) { const gpu = new GPU({ mode }); + function saveTarget(value) { return value; } @@ -201,9 +204,9 @@ function createKernelMap3DAuto(mode) { target: saveTarget }, function(value) { return saveTarget(value); - }).setOutput([3,3,3]); + }).setOutput([3, 3, 3]); const result = kernel(1); - const target = createKernel(gpu, [3,3,3])(result.target); + const target = createKernel(gpu, [3, 3, 3])(result.target); assert.equal(result.result.length, 3); assert.equal(result.result[0].length, 3); assert.equal(result.result[0][0].length, 3); @@ -240,8 +243,7 @@ test('createKernelMap 3d cpu', () => { function createKernelMapArray2(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernelMap( - { + const kernel = gpu.createKernelMap({ mapFunc: function mapFunc(mapFuncVal) { return mapFuncVal; } @@ -251,8 +253,7 @@ function createKernelMapArray2(mode) { mapFunc(mapFuncVal); const returnValue = [3, 4]; return returnValue; - }, - { + }, { output: [1], returnType: 'Array(2)', } @@ -289,8 +290,7 @@ test('createKernelMap Array(2) cpu', () => { function createKernelMapArray3(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernelMap( - { + const kernel = gpu.createKernelMap({ mapFunc: function mapFunc(mapFuncVal) { return mapFuncVal; } @@ -300,8 +300,7 @@ function createKernelMapArray3(mode) { mapFunc(mapFuncVal); const returnValue = [4, 5, 6]; return returnValue; - }, - { + }, { output: [1], returnType: 'Array(3)', } @@ -338,8 +337,7 @@ test('createKernelMap Array(3) cpu', () => { function createKernelMapArray4(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernelMap( - { + const kernel = gpu.createKernelMap({ mapFunc: function mapFunc(mapFuncVal) { return mapFuncVal; } @@ -349,8 +347,7 @@ function createKernelMapArray4(mode) { mapFunc(mapFuncVal); const returnValue = [5, 6, 7, 8]; return returnValue; - }, - { + }, { output: [1], returnType: 'Array(4)', } diff --git a/test/features/demo.js b/test/features/demo.js index c31af05c..f4fc86ec 100644 --- a/test/features/demo.js +++ b/test/features/demo.js @@ -9,8 +9,9 @@ function demo(mode) { let b = new Array(matrixSize * matrixSize); a = splitArray(fillArrayRandom(a), matrixSize); b = splitArray(fillArrayRandom(b), matrixSize); + function fillArrayRandom(array) { - for(let i = 0; i < array.length; i++) { + for (let i = 0; i < array.length; i++) { array[i] = Math.random(); } return array; @@ -18,22 +19,22 @@ function demo(mode) { function splitArray(array, part) { const result = []; - for(let i = 0; i < array.length; i += part) { + for (let i = 0; i < array.length; i += part) { result.push(array.slice(i, i + part)); } return result; } const gpu = new GPU({ mode }); const multiplyMatrix = gpu.createKernel(function(a, b) { - let sum = 0; - for (let i = 0; i < 6; i++) { - sum += a[this.thread.y][i] * b[i][this.thread.x]; - } - return sum; - }) + let sum = 0; + for (let i = 0; i < 6; i++) { + sum += a[this.thread.y][i] * b[i][this.thread.x]; + } + return sum; + }) .setOutput([6, 6]); - assert.ok( multiplyMatrix !== null, "function generated test"); + assert.ok(multiplyMatrix !== null, "function generated test"); assert.equal(multiplyMatrix(a, b).length, 6, "basic return function test"); gpu.destroy(); } @@ -46,18 +47,18 @@ test("gpu", () => { demo('gpu'); }); -(GPU.isWebGLSupported ? test : skip)("webgl", function () { +(GPU.isWebGLSupported ? test : skip)("webgl", function() { demo('webgl'); }); -(GPU.isWebGL2Supported ? test : skip)("webgl2", function () { +(GPU.isWebGL2Supported ? test : skip)("webgl2", function() { demo('webgl2'); }); -(GPU.isHeadlessGLSupported ? test : skip)("headlessgl", function () { +(GPU.isHeadlessGLSupported ? test : skip)("headlessgl", function() { demo('headlessgl'); }); test("cpu", () => { demo('cpu'); -}); +}); \ No newline at end of file diff --git a/test/features/destroy.js b/test/features/destroy.js index 2f2a72e0..d6e05356 100644 --- a/test/features/destroy.js +++ b/test/features/destroy.js @@ -182,4 +182,4 @@ test('gpu.kernels is populated and removed by gpu', t => { assert.equal(gpu.kernels.length, 0); done(); }); -}); +}); \ No newline at end of file diff --git a/test/features/dev-mode.js b/test/features/dev-mode.js index 4e2a9ae0..a409cff0 100644 --- a/test/features/dev-mode.js +++ b/test/features/dev-mode.js @@ -36,7 +36,7 @@ test('works with array', () => { const kernel = gpu.createKernel(function(value) { return value[this.thread.x]; }, { output: [4] }); - assert.deepEqual(kernel([1,2,3,4]), new Float32Array([1,2,3,4])); + assert.deepEqual(kernel([1, 2, 3, 4]), new Float32Array([1, 2, 3, 4])); gpu.destroy(); }); @@ -47,12 +47,12 @@ test('works with matrix', () => { }, { output: [4, 2] }); assert.deepEqual(kernel( [ - [1,2,3,4], - [5,6,7,8] + [1, 2, 3, 4], + [5, 6, 7, 8] ] ), [ - new Float32Array([1,2,3,4]), - new Float32Array([5,6,7,8]), + new Float32Array([1, 2, 3, 4]), + new Float32Array([5, 6, 7, 8]), ]); gpu.destroy(); }); @@ -65,21 +65,22 @@ test('works with cube', () => { assert.deepEqual(kernel( [ [ - [1,2,3,4], - [5,6,7,8] + [1, 2, 3, 4], + [5, 6, 7, 8] ], [ - [9,10,11,12], - [13,14,15,16] + [9, 10, 11, 12], + [13, 14, 15, 16] ] ] ), [ [ - new Float32Array([1,2,3,4]), - new Float32Array([5,6,7,8]), - ],[ - new Float32Array([9,10,11,12]), - new Float32Array([13,14,15,16]), + new Float32Array([1, 2, 3, 4]), + new Float32Array([5, 6, 7, 8]), + ], + [ + new Float32Array([9, 10, 11, 12]), + new Float32Array([13, 14, 15, 16]), ] ]); gpu.destroy(); @@ -90,7 +91,7 @@ test('works with input array', () => { const kernel = gpu.createKernel(function(value) { return value[this.thread.x]; }, { output: [4] }); - assert.deepEqual(kernel(input([1,2,3,4], [4])), new Float32Array([1,2,3,4])); + assert.deepEqual(kernel(input([1, 2, 3, 4], [4])), new Float32Array([1, 2, 3, 4])); gpu.destroy(); }); @@ -99,9 +100,9 @@ test('works with input matrix', () => { const kernel = gpu.createKernel(function(value) { return value[this.thread.y][this.thread.x]; }, { output: [4, 2] }); - assert.deepEqual(kernel(input([1,2,3,4,5,6,7,8], [4, 2])), [ - new Float32Array([1,2,3,4]), - new Float32Array([5,6,7,8]), + assert.deepEqual(kernel(input([1, 2, 3, 4, 5, 6, 7, 8], [4, 2])), [ + new Float32Array([1, 2, 3, 4]), + new Float32Array([5, 6, 7, 8]), ]); gpu.destroy(); }); @@ -112,29 +113,31 @@ test('works with input cube', () => { return value[this.thread.z][this.thread.y][this.thread.x]; }, { output: [4, 2, 2] }); assert.deepEqual(kernel( - input([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16], [4,2,2]) + input([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], [4, 2, 2]) ), [ [ - new Float32Array([1,2,3,4]), - new Float32Array([5,6,7,8]), - ],[ - new Float32Array([9,10,11,12]), - new Float32Array([13,14,15,16]), + new Float32Array([1, 2, 3, 4]), + new Float32Array([5, 6, 7, 8]), + ], + [ + new Float32Array([9, 10, 11, 12]), + new Float32Array([13, 14, 15, 16]), ] ]); gpu.destroy(); }); test('works with texture', () => { - const texture = ((new GPU()).createKernel(function (cube) { + const texture = ((new GPU()).createKernel(function(cube) { return cube[this.thread.z][this.thread.y][this.thread.x]; - }, { output: [4,2,2], pipeline: true }))([ + }, { output: [4, 2, 2], pipeline: true }))([ + [ + new Float32Array([1, 2, 3, 4]), + new Float32Array([5, 6, 7, 8]), + ], [ - new Float32Array([1,2,3,4]), - new Float32Array([5,6,7,8]), - ],[ - new Float32Array([9,10,11,12]), - new Float32Array([13,14,15,16]), + new Float32Array([9, 10, 11, 12]), + new Float32Array([13, 14, 15, 16]), ] ]); assert.ok(texture.constructor.name.match('Texture')); @@ -146,11 +149,12 @@ test('works with texture', () => { texture ), [ [ - new Float32Array([1,2,3,4]), - new Float32Array([5,6,7,8]), - ],[ - new Float32Array([9,10,11,12]), - new Float32Array([13,14,15,16]), + new Float32Array([1, 2, 3, 4]), + new Float32Array([5, 6, 7, 8]), + ], + [ + new Float32Array([9, 10, 11, 12]), + new Float32Array([13, 14, 15, 16]), ] ]); gpu.destroy(); @@ -158,6 +162,7 @@ test('works with texture', () => { test('works with adding functions', () => { const gpu = new GPU({ mode: 'dev' }); + function addOne(value) { return value + 1; } @@ -167,4 +172,4 @@ test('works with adding functions', () => { }, { output: [1] }); assert.deepEqual(kernel(1), new Float32Array([2])); gpu.destroy(); -}); +}); \ No newline at end of file diff --git a/test/features/dynamic-arguments.js b/test/features/dynamic-arguments.js index efbe031c..8ef472fc 100644 --- a/test/features/dynamic-arguments.js +++ b/test/features/dynamic-arguments.js @@ -17,9 +17,9 @@ function testHTMLImage(done, mode) { function loaded() { const gpu = new GPU({ mode }); const kernel = gpu.createKernel(function(image) { - const pixel = image[this.thread.y][this.thread.x]; - return (pixel[0] + pixel[1] + pixel[2]) / 3; - }) + const pixel = image[this.thread.y][this.thread.x]; + return (pixel[0] + pixel[1] + pixel[2]) / 3; + }) .setDynamicArguments(true) .setDynamicOutput(true) .setOutput([276, 183]); @@ -61,76 +61,76 @@ function testHTMLImage(done, mode) { function testMemoryOptimizedNumberTexture(mode) { const gpu = new GPU({ mode }); const matrix4X4 = [ - [1,2,3,4], - [5,6,7,8], - [9,10,11,12], - [13,14,15,16], + [1, 2, 3, 4], + [5, 6, 7, 8], + [9, 10, 11, 12], + [13, 14, 15, 16], ]; const texture4X4 = ( gpu.createKernel(function(value) { return value[this.thread.y][this.thread.x]; }) - .setOutput([4, 4]) - .setPrecision('single') - .setOptimizeFloatMemory(true) - .setPipeline(true) + .setOutput([4, 4]) + .setPrecision('single') + .setOptimizeFloatMemory(true) + .setPipeline(true) )(matrix4X4); const matrix3X3 = [ - [1,2,3], - [4,5,6], - [7,8,9] + [1, 2, 3], + [4, 5, 6], + [7, 8, 9] ]; const texture3X3 = ( gpu.createKernel(function(value) { return value[this.thread.y][this.thread.x]; }) - .setOutput([3, 3]) - .setPrecision('single') - .setOptimizeFloatMemory(true) - .setPipeline(true) + .setOutput([3, 3]) + .setPrecision('single') + .setOptimizeFloatMemory(true) + .setPipeline(true) )(matrix3X3); const matrix2X2 = [ - [1,2], - [3,4] + [1, 2], + [3, 4] ]; const texture2X2 = ( gpu.createKernel(function(value) { return value[this.thread.y][this.thread.x]; }) - .setOutput([2, 2]) - .setPrecision('single') - .setOptimizeFloatMemory(true) - .setPipeline(true) + .setOutput([2, 2]) + .setPrecision('single') + .setOptimizeFloatMemory(true) + .setPipeline(true) )(matrix2X2); const kernel = gpu.createKernel(function(texture) { - return texture[this.thread.y][this.thread.x]; - }) + return texture[this.thread.y][this.thread.x]; + }) .setDynamicArguments(true) .setDynamicOutput(true) .setOptimizeFloatMemory(true) - .setOutput([4,4]); + .setOutput([4, 4]); assert.deepEqual(kernel(texture4X4), [ - new Float32Array([1,2,3,4]), - new Float32Array([5,6,7,8]), - new Float32Array([9,10,11,12]), - new Float32Array([13,14,15,16]), + new Float32Array([1, 2, 3, 4]), + new Float32Array([5, 6, 7, 8]), + new Float32Array([9, 10, 11, 12]), + new Float32Array([13, 14, 15, 16]), ]); kernel.setOutput([3, 3]); assert.deepEqual(kernel(texture3X3), [ - new Float32Array([1,2,3]), - new Float32Array([4,5,6]), - new Float32Array([7,8,9]), + new Float32Array([1, 2, 3]), + new Float32Array([4, 5, 6]), + new Float32Array([7, 8, 9]), ]); kernel.setOutput([2, 2]); assert.deepEqual(kernel(texture2X2), [ - new Float32Array([1,2]), - new Float32Array([3,4]), + new Float32Array([1, 2]), + new Float32Array([3, 4]), ]); assert.ok(kernel.kernelArguments[0].constructor.name.match('DynamicMemoryOptimizedNumberTexture')); @@ -161,72 +161,72 @@ function testMemoryOptimizedNumberTexture(mode) { function testNumberTexture(mode) { const gpu = new GPU({ mode }); const matrix4X4 = [ - [1,2,3,4], - [5,6,7,8], - [9,10,11,12], - [13,14,15,16], + [1, 2, 3, 4], + [5, 6, 7, 8], + [9, 10, 11, 12], + [13, 14, 15, 16], ]; const texture4X4 = ( gpu.createKernel(function(value) { return value[this.thread.y][this.thread.x]; }) - .setOutput([4, 4]) - .setPrecision('single') - .setPipeline(true) + .setOutput([4, 4]) + .setPrecision('single') + .setPipeline(true) )(matrix4X4); const matrix3X3 = [ - [1,2,3], - [4,5,6], - [7,8,9] + [1, 2, 3], + [4, 5, 6], + [7, 8, 9] ]; const texture3X3 = ( gpu.createKernel(function(value) { return value[this.thread.y][this.thread.x]; }) - .setOutput([3, 3]) - .setPrecision('single') - .setPipeline(true) + .setOutput([3, 3]) + .setPrecision('single') + .setPipeline(true) )(matrix3X3); const matrix2X2 = [ - [1,2], - [3,4] + [1, 2], + [3, 4] ]; const texture2X2 = ( gpu.createKernel(function(value) { return value[this.thread.y][this.thread.x]; }) - .setOutput([2, 2]) - .setPrecision('single') - .setPipeline(true) + .setOutput([2, 2]) + .setPrecision('single') + .setPipeline(true) )(matrix2X2); const kernel = gpu.createKernel(function(texture) { - return texture[this.thread.y][this.thread.x]; - }) + return texture[this.thread.y][this.thread.x]; + }) .setDynamicArguments(true) .setDynamicOutput(true) - .setOutput([4,4]); + .setOutput([4, 4]); assert.deepEqual(kernel(texture4X4), [ - new Float32Array([1,2,3,4]), - new Float32Array([5,6,7,8]), - new Float32Array([9,10,11,12]), - new Float32Array([13,14,15,16]), + new Float32Array([1, 2, 3, 4]), + new Float32Array([5, 6, 7, 8]), + new Float32Array([9, 10, 11, 12]), + new Float32Array([13, 14, 15, 16]), ]); kernel.setOutput([3, 3]); assert.deepEqual(kernel(texture3X3), [ - new Float32Array([1,2,3]), - new Float32Array([4,5,6]), - new Float32Array([7,8,9]), + new Float32Array([1, 2, 3]), + new Float32Array([4, 5, 6]), + new Float32Array([7, 8, 9]), ]); kernel.setOutput([2, 2]); assert.deepEqual(kernel(texture2X2), [ - new Float32Array([1,2]), - new Float32Array([3,4]), + new Float32Array([1, 2]), + new Float32Array([3, 4]), ]); assert.ok(kernel.kernelArguments[0].constructor.name.match('NumberTexture')); @@ -257,74 +257,74 @@ function testNumberTexture(mode) { function testMixedNumberTexture(mode) { const gpu = new GPU({ mode }); const matrix4X4 = [ - [1,2,3,4], - [5,6,7,8], - [9,10,11,12], - [13,14,15,16], + [1, 2, 3, 4], + [5, 6, 7, 8], + [9, 10, 11, 12], + [13, 14, 15, 16], ]; const texture4X4 = ( gpu.createKernel(function(value) { return value[this.thread.y][this.thread.x]; }) - .setOutput([4, 4]) - .setPrecision('single') - .setOptimizeFloatMemory(true) - .setPipeline(true) + .setOutput([4, 4]) + .setPrecision('single') + .setOptimizeFloatMemory(true) + .setPipeline(true) )(matrix4X4); const matrix3X3 = [ - [1,2,3], - [4,5,6], - [7,8,9] + [1, 2, 3], + [4, 5, 6], + [7, 8, 9] ]; const texture3X3 = ( gpu.createKernel(function(value) { return value[this.thread.y][this.thread.x]; }) - .setOutput([3, 3]) - .setPrecision('single') - .setOptimizeFloatMemory(true) - .setPipeline(true) + .setOutput([3, 3]) + .setPrecision('single') + .setOptimizeFloatMemory(true) + .setPipeline(true) )(matrix3X3); const matrix2X2 = [ - [1,2], - [3,4] + [1, 2], + [3, 4] ]; const texture2X2 = ( gpu.createKernel(function(value) { return value[this.thread.y][this.thread.x]; }) - .setOutput([2, 2]) - .setPrecision('single') - .setPipeline(true) + .setOutput([2, 2]) + .setPrecision('single') + .setPipeline(true) )(matrix2X2); const kernel = gpu.createKernel(function(texture) { - return texture[this.thread.y][this.thread.x]; - }) + return texture[this.thread.y][this.thread.x]; + }) .setDynamicArguments(true) .setDynamicOutput(true) - .setOutput([4,4]); + .setOutput([4, 4]); assert.deepEqual(kernel(texture4X4), [ - new Float32Array([1,2,3,4]), - new Float32Array([5,6,7,8]), - new Float32Array([9,10,11,12]), - new Float32Array([13,14,15,16]), + new Float32Array([1, 2, 3, 4]), + new Float32Array([5, 6, 7, 8]), + new Float32Array([9, 10, 11, 12]), + new Float32Array([13, 14, 15, 16]), ]); kernel.setOutput([3, 3]); assert.deepEqual(kernel(texture3X3), [ - new Float32Array([1,2,3]), - new Float32Array([4,5,6]), - new Float32Array([7,8,9]), + new Float32Array([1, 2, 3]), + new Float32Array([4, 5, 6]), + new Float32Array([7, 8, 9]), ]); kernel.setOutput([2, 2]); assert.deepEqual(kernel(texture2X2), [ - new Float32Array([1,2]), - new Float32Array([3,4]), + new Float32Array([1, 2]), + new Float32Array([3, 4]), ]); assert.ok(kernel.kernelArguments[0].constructor.name.match('NumberTexture')); @@ -362,16 +362,16 @@ function testSingleArray1D2(mode) { dynamicOutput: true }); const expected1 = [ - new Float32Array([1,2]), - new Float32Array([3,4]), + new Float32Array([1, 2]), + new Float32Array([3, 4]), ]; kernel.setOutput([expected1.length]); assert.deepEqual(kernel(expected1), expected1); const expected2 = [ - new Float32Array([1,2]), - new Float32Array([3,4]), - new Float32Array([5,6]), - new Float32Array([7,8]), + new Float32Array([1, 2]), + new Float32Array([3, 4]), + new Float32Array([5, 6]), + new Float32Array([7, 8]), ]; kernel.setOutput([expected2.length]); assert.deepEqual(kernel(expected2), expected2); @@ -412,16 +412,16 @@ function testSingleArray1D3(mode) { dynamicOutput: true }); const expected1 = [ - new Float32Array([1,2,3]), - new Float32Array([4,5,6]), + new Float32Array([1, 2, 3]), + new Float32Array([4, 5, 6]), ]; kernel.setOutput([expected1.length]); assert.deepEqual(kernel(expected1), expected1); const expected2 = [ - new Float32Array([1,2,3]), - new Float32Array([4,5,6]), - new Float32Array([7,8,9]), - new Float32Array([10,11,12]), + new Float32Array([1, 2, 3]), + new Float32Array([4, 5, 6]), + new Float32Array([7, 8, 9]), + new Float32Array([10, 11, 12]), ]; kernel.setOutput([expected2.length]); assert.deepEqual(kernel(expected2), expected2); @@ -462,16 +462,16 @@ function testSingleArray1D4(mode) { dynamicOutput: true }); const expected1 = [ - new Float32Array([1,2,3,4]), - new Float32Array([5,6,7,8]), + new Float32Array([1, 2, 3, 4]), + new Float32Array([5, 6, 7, 8]), ]; kernel.setOutput([expected1.length]); assert.deepEqual(kernel(expected1), expected1); const expected2 = [ - new Float32Array([1,2,3,4]), - new Float32Array([5,6,7,8]), - new Float32Array([9,10,11,12]), - new Float32Array([13,14,15,16]), + new Float32Array([1, 2, 3, 4]), + new Float32Array([5, 6, 7, 8]), + new Float32Array([9, 10, 11, 12]), + new Float32Array([13, 14, 15, 16]), ]; kernel.setOutput([expected2.length]); assert.deepEqual(kernel(expected2), expected2); @@ -513,26 +513,28 @@ function testSingleArray2D2(mode) { }); const expected1 = [ [ - new Float32Array([1,2]), - new Float32Array([3,4]), - ],[ - new Float32Array([5,6]), - new Float32Array([7,8]), + new Float32Array([1, 2]), + new Float32Array([3, 4]), + ], + [ + new Float32Array([5, 6]), + new Float32Array([7, 8]), ] ]; kernel.setOutput([expected1[0].length, expected1.length]); assert.deepEqual(kernel(expected1), expected1); const expected2 = [ [ - new Float32Array([1,2]), - new Float32Array([3,4]), - new Float32Array([5,6]), - new Float32Array([7,8]), - ],[ - new Float32Array([9,10]), - new Float32Array([11,12]), - new Float32Array([13,14]), - new Float32Array([15,16]), + new Float32Array([1, 2]), + new Float32Array([3, 4]), + new Float32Array([5, 6]), + new Float32Array([7, 8]), + ], + [ + new Float32Array([9, 10]), + new Float32Array([11, 12]), + new Float32Array([13, 14]), + new Float32Array([15, 16]), ] ]; kernel.setOutput([expected2[0].length, expected2.length]); @@ -575,26 +577,28 @@ function testSingleArray2D3(mode) { }); const expected1 = [ [ - new Float32Array([1,2,3]), - new Float32Array([4,5,6]), - ],[ - new Float32Array([7,8,9]), - new Float32Array([10,11,12]), + new Float32Array([1, 2, 3]), + new Float32Array([4, 5, 6]), + ], + [ + new Float32Array([7, 8, 9]), + new Float32Array([10, 11, 12]), ] ]; kernel.setOutput([expected1[0].length, expected1.length]); assert.deepEqual(kernel(expected1), expected1); const expected2 = [ [ - new Float32Array([1,2,3]), - new Float32Array([4,5,6]), - new Float32Array([7,8,9]), - new Float32Array([10,11,12]), - ],[ - new Float32Array([13,14,15]), - new Float32Array([16,17,18]), - new Float32Array([19,20,21]), - new Float32Array([22,23,24]), + new Float32Array([1, 2, 3]), + new Float32Array([4, 5, 6]), + new Float32Array([7, 8, 9]), + new Float32Array([10, 11, 12]), + ], + [ + new Float32Array([13, 14, 15]), + new Float32Array([16, 17, 18]), + new Float32Array([19, 20, 21]), + new Float32Array([22, 23, 24]), ] ]; kernel.setOutput([expected2[0].length, expected2.length]); @@ -637,26 +641,28 @@ function testSingleArray2D4(mode) { }); const expected1 = [ [ - new Float32Array([1,2,3,4]), - new Float32Array([5,6,7,8]), - ],[ - new Float32Array([9,10,11,12]), - new Float32Array([13,14,15,16]), + new Float32Array([1, 2, 3, 4]), + new Float32Array([5, 6, 7, 8]), + ], + [ + new Float32Array([9, 10, 11, 12]), + new Float32Array([13, 14, 15, 16]), ] ]; kernel.setOutput([expected1[0].length, expected1.length]); assert.deepEqual(kernel(expected1), expected1); const expected2 = [ [ - new Float32Array([1,2,3,4]), - new Float32Array([5,6,7,8]), - new Float32Array([9,10,11,12]), - new Float32Array([13,14,15,16]), - ],[ - new Float32Array([17,18,19,20]), - new Float32Array([21,22,23,24]), - new Float32Array([25,26,27,28]), - new Float32Array([29,30,31,32]), + new Float32Array([1, 2, 3, 4]), + new Float32Array([5, 6, 7, 8]), + new Float32Array([9, 10, 11, 12]), + new Float32Array([13, 14, 15, 16]), + ], + [ + new Float32Array([17, 18, 19, 20]), + new Float32Array([21, 22, 23, 24]), + new Float32Array([25, 26, 27, 28]), + new Float32Array([29, 30, 31, 32]), ] ]; kernel.setOutput([expected2[0].length, expected2.length]); @@ -700,19 +706,22 @@ function testSingleArray3D2(mode) { const expected1 = [ [ [ - new Float32Array([1,2]), - new Float32Array([3,4]), - ],[ - new Float32Array([5,6]), - new Float32Array([7,8]), + new Float32Array([1, 2]), + new Float32Array([3, 4]), + ], + [ + new Float32Array([5, 6]), + new Float32Array([7, 8]), ] - ],[ + ], + [ [ - new Float32Array([9,10]), - new Float32Array([11,12]), - ],[ - new Float32Array([13,14]), - new Float32Array([15,16]), + new Float32Array([9, 10]), + new Float32Array([11, 12]), + ], + [ + new Float32Array([13, 14]), + new Float32Array([15, 16]), ] ] ]; @@ -721,27 +730,30 @@ function testSingleArray3D2(mode) { const expected2 = [ [ [ - new Float32Array([1,2]), - new Float32Array([3,4]), - new Float32Array([5,6]), - new Float32Array([7,8]), - ],[ - new Float32Array([9,10]), - new Float32Array([11,12]), - new Float32Array([13,14]), - new Float32Array([15,16]), + new Float32Array([1, 2]), + new Float32Array([3, 4]), + new Float32Array([5, 6]), + new Float32Array([7, 8]), + ], + [ + new Float32Array([9, 10]), + new Float32Array([11, 12]), + new Float32Array([13, 14]), + new Float32Array([15, 16]), ] - ],[ + ], + [ [ - new Float32Array([17,18]), - new Float32Array([19,20]), - new Float32Array([21,22]), - new Float32Array([23,24]), - ],[ - new Float32Array([25,26]), - new Float32Array([27,28]), - new Float32Array([29,30]), - new Float32Array([31,32]), + new Float32Array([17, 18]), + new Float32Array([19, 20]), + new Float32Array([21, 22]), + new Float32Array([23, 24]), + ], + [ + new Float32Array([25, 26]), + new Float32Array([27, 28]), + new Float32Array([29, 30]), + new Float32Array([31, 32]), ] ] ]; @@ -786,19 +798,22 @@ function testSingleArray3D3(mode) { const expected1 = [ [ [ - new Float32Array([1,2,3]), - new Float32Array([4,5,6]), - ],[ - new Float32Array([7,8,9]), - new Float32Array([10,11,12]), + new Float32Array([1, 2, 3]), + new Float32Array([4, 5, 6]), + ], + [ + new Float32Array([7, 8, 9]), + new Float32Array([10, 11, 12]), ] - ],[ + ], + [ + [ + new Float32Array([13, 14, 15]), + new Float32Array([16, 17, 18]), + ], [ - new Float32Array([13,14,15]), - new Float32Array([16,17,18]), - ],[ - new Float32Array([19,20,21]), - new Float32Array([22,23,24]), + new Float32Array([19, 20, 21]), + new Float32Array([22, 23, 24]), ] ] ]; @@ -807,27 +822,30 @@ function testSingleArray3D3(mode) { const expected2 = [ [ [ - new Float32Array([1,2,3]), - new Float32Array([4,5,6]), - new Float32Array([7,8,9]), - new Float32Array([10,11,12]), - ],[ - new Float32Array([13,14,15]), - new Float32Array([16,17,18]), - new Float32Array([19,20,21]), - new Float32Array([22,23,24]), + new Float32Array([1, 2, 3]), + new Float32Array([4, 5, 6]), + new Float32Array([7, 8, 9]), + new Float32Array([10, 11, 12]), + ], + [ + new Float32Array([13, 14, 15]), + new Float32Array([16, 17, 18]), + new Float32Array([19, 20, 21]), + new Float32Array([22, 23, 24]), ] - ],[ + ], + [ [ - new Float32Array([25,26,27]), - new Float32Array([28,29,30]), - new Float32Array([31,32,33]), - new Float32Array([34,35,36]), - ],[ - new Float32Array([37,38,39]), - new Float32Array([40,41,42]), - new Float32Array([43,44,45]), - new Float32Array([46,47,48]), + new Float32Array([25, 26, 27]), + new Float32Array([28, 29, 30]), + new Float32Array([31, 32, 33]), + new Float32Array([34, 35, 36]), + ], + [ + new Float32Array([37, 38, 39]), + new Float32Array([40, 41, 42]), + new Float32Array([43, 44, 45]), + new Float32Array([46, 47, 48]), ] ] ]; @@ -872,19 +890,22 @@ function testSingleArray3D4(mode) { const expected1 = [ [ [ - new Float32Array([1,2,3,4]), - new Float32Array([5,6,7,8]), - ],[ - new Float32Array([9,10,11,12]), - new Float32Array([13,14,15,16]), + new Float32Array([1, 2, 3, 4]), + new Float32Array([5, 6, 7, 8]), + ], + [ + new Float32Array([9, 10, 11, 12]), + new Float32Array([13, 14, 15, 16]), ] - ],[ + ], + [ + [ + new Float32Array([17, 18, 19, 20]), + new Float32Array([21, 22, 23, 24]), + ], [ - new Float32Array([17,18,19,20]), - new Float32Array([21,22,23,24]), - ],[ - new Float32Array([25,26,27,28]), - new Float32Array([29,30,31,32]), + new Float32Array([25, 26, 27, 28]), + new Float32Array([29, 30, 31, 32]), ] ] ]; @@ -893,27 +914,30 @@ function testSingleArray3D4(mode) { const expected2 = [ [ [ - new Float32Array([1,2,3,4]), - new Float32Array([5,6,7,8]), - new Float32Array([9,10,11,12]), - new Float32Array([13,14,15,16]), - ],[ - new Float32Array([17,18,19,20]), - new Float32Array([21,22,23,24]), - new Float32Array([25,26,27,28]), - new Float32Array([29,30,31,32]), + new Float32Array([1, 2, 3, 4]), + new Float32Array([5, 6, 7, 8]), + new Float32Array([9, 10, 11, 12]), + new Float32Array([13, 14, 15, 16]), + ], + [ + new Float32Array([17, 18, 19, 20]), + new Float32Array([21, 22, 23, 24]), + new Float32Array([25, 26, 27, 28]), + new Float32Array([29, 30, 31, 32]), ] - ],[ + ], + [ [ - new Float32Array([33,34,35,36]), - new Float32Array([37,38,39,40]), - new Float32Array([41,42,43,44]), - new Float32Array([45,46,47,48]), - ],[ - new Float32Array([49,50,51,52]), - new Float32Array([53,54,56,57]), - new Float32Array([58,59,60,61]), - new Float32Array([62,63,64,65]), + new Float32Array([33, 34, 35, 36]), + new Float32Array([37, 38, 39, 40]), + new Float32Array([41, 42, 43, 44]), + new Float32Array([45, 46, 47, 48]), + ], + [ + new Float32Array([49, 50, 51, 52]), + new Float32Array([53, 54, 56, 57]), + new Float32Array([58, 59, 60, 61]), + new Float32Array([62, 63, 64, 65]), ] ] ]; @@ -949,20 +973,20 @@ test('Single Array3D4 cpu', () => { function testUnsignedPrecisionArray(mode) { const gpu = new GPU({ mode }); const kernel = gpu.createKernel(function(input) { - return input[this.thread.x]; - }) + return input[this.thread.x]; + }) .setPrecision('unsigned') .setDynamicArguments(true) .setDynamicOutput(true) .setOutput([5]); - assert.deepEqual(kernel([1,2,3,4,5]), new Float32Array([1,2,3,4,5])); + assert.deepEqual(kernel([1, 2, 3, 4, 5]), new Float32Array([1, 2, 3, 4, 5])); kernel.setOutput([4]); - assert.deepEqual(kernel([1,2,3,4]), new Float32Array([1,2,3,4])); + assert.deepEqual(kernel([1, 2, 3, 4]), new Float32Array([1, 2, 3, 4])); kernel.setOutput([3]); - assert.deepEqual(kernel([1,2,3]), new Float32Array([1,2,3])); + assert.deepEqual(kernel([1, 2, 3]), new Float32Array([1, 2, 3])); kernel.setOutput([2]); - assert.deepEqual(kernel([1,2]), new Float32Array([1,2])); + assert.deepEqual(kernel([1, 2]), new Float32Array([1, 2])); gpu.destroy(); } @@ -993,20 +1017,20 @@ test('unsigned precision Array cpu', () => { function testSinglePrecisionArray(mode) { const gpu = new GPU({ mode }); const kernel = gpu.createKernel(function(input) { - return input[this.thread.x]; - }) + return input[this.thread.x]; + }) .setPrecision('single') .setDynamicArguments(true) .setDynamicOutput(true) .setOutput([5]); - assert.deepEqual(kernel([1,2,3,4,5]), new Float32Array([1,2,3,4,5])); + assert.deepEqual(kernel([1, 2, 3, 4, 5]), new Float32Array([1, 2, 3, 4, 5])); kernel.setOutput([4]); - assert.deepEqual(kernel([1,2,3,4]), new Float32Array([1,2,3,4])); + assert.deepEqual(kernel([1, 2, 3, 4]), new Float32Array([1, 2, 3, 4])); kernel.setOutput([3]); - assert.deepEqual(kernel([1,2,3]), new Float32Array([1,2,3])); + assert.deepEqual(kernel([1, 2, 3]), new Float32Array([1, 2, 3])); kernel.setOutput([2]); - assert.deepEqual(kernel([1,2]), new Float32Array([1,2])); + assert.deepEqual(kernel([1, 2]), new Float32Array([1, 2])); gpu.destroy(); } @@ -1037,33 +1061,33 @@ test('single precision Array cpu', () => { function testUnsignedPrecisionMatrix(mode) { const gpu = new GPU({ mode }); const kernel = gpu.createKernel(function(input) { - return input[this.thread.y][this.thread.x]; - }) + return input[this.thread.y][this.thread.x]; + }) .setPrecision('unsigned') .setDynamicArguments(true) .setDynamicOutput(true) - .setOutput([4,4]); + .setOutput([4, 4]); let matrix = [ - [1,2,3,4], - [5,6,7,8], - [9,10,11,12], - [13,14,15,16] + [1, 2, 3, 4], + [5, 6, 7, 8], + [9, 10, 11, 12], + [13, 14, 15, 16] ]; assert.deepEqual(kernel(matrix), matrix.map(row => new Float32Array(row))); - kernel.setOutput([3,3]); + kernel.setOutput([3, 3]); matrix = [ - [1,2,3], - [4,5,6], - [7,8,9] + [1, 2, 3], + [4, 5, 6], + [7, 8, 9] ]; assert.deepEqual(kernel(matrix), matrix.map(row => new Float32Array(row))); - kernel.setOutput([2,2]); + kernel.setOutput([2, 2]); matrix = [ - [1,2], - [3,4] + [1, 2], + [3, 4] ]; assert.deepEqual(kernel(matrix), matrix.map(row => new Float32Array(row))); gpu.destroy(); @@ -1096,32 +1120,32 @@ test('unsigned precision Matrix cpu', () => { function testSinglePrecisionMatrix(mode) { const gpu = new GPU({ mode }); const kernel = gpu.createKernel(function(input) { - return input[this.thread.y][this.thread.x]; - }) + return input[this.thread.y][this.thread.x]; + }) .setDynamicArguments(true) .setDynamicOutput(true) - .setOutput([4,4]); + .setOutput([4, 4]); let matrix = [ - [1,2,3,4], - [5,6,7,8], - [9,10,11,12], - [13,14,15,16] + [1, 2, 3, 4], + [5, 6, 7, 8], + [9, 10, 11, 12], + [13, 14, 15, 16] ]; assert.deepEqual(kernel(matrix), matrix.map(row => new Float32Array(row))); - kernel.setOutput([3,3]); + kernel.setOutput([3, 3]); matrix = [ - [1,2,3], - [4,5,6], - [7,8,9] + [1, 2, 3], + [4, 5, 6], + [7, 8, 9] ]; assert.deepEqual(kernel(matrix), matrix.map(row => new Float32Array(row))); - kernel.setOutput([2,2]); + kernel.setOutput([2, 2]); matrix = [ - [1,2], - [3,4] + [1, 2], + [3, 4] ]; assert.deepEqual(kernel(matrix), matrix.map(row => new Float32Array(row))); gpu.destroy(); @@ -1154,46 +1178,46 @@ test('single precision Matrix cpu', () => { function testUnsignedPrecisionInputMatrix(mode) { const gpu = new GPU({ mode }); const kernel = gpu.createKernel(function(input) { - return input[this.thread.y][this.thread.x]; - }) + return input[this.thread.y][this.thread.x]; + }) .setPrecision('unsigned') .setDynamicArguments(true) .setDynamicOutput(true) - .setOutput([4,4]); + .setOutput([4, 4]); let matrix = input([ - 1,2,3,4, - 5,6,7,8, - 9,10,11,12, - 13,14,15,16 + 1, 2, 3, 4, + 5, 6, 7, 8, + 9, 10, 11, 12, + 13, 14, 15, 16 ], [4, 4]); assert.deepEqual(kernel(matrix), [ - new Float32Array([1,2,3,4]), - new Float32Array([5,6,7,8]), - new Float32Array([9,10,11,12]), - new Float32Array([13,14,15,16]), + new Float32Array([1, 2, 3, 4]), + new Float32Array([5, 6, 7, 8]), + new Float32Array([9, 10, 11, 12]), + new Float32Array([13, 14, 15, 16]), ]); - kernel.setOutput([3,3]); + kernel.setOutput([3, 3]); matrix = input([ - 1,2,3, - 4,5,6, - 7,8,9 - ], [3,3]); + 1, 2, 3, + 4, 5, 6, + 7, 8, 9 + ], [3, 3]); assert.deepEqual(kernel(matrix), [ - new Float32Array([1,2,3]), - new Float32Array([4,5,6]), - new Float32Array([7,8,9]) + new Float32Array([1, 2, 3]), + new Float32Array([4, 5, 6]), + new Float32Array([7, 8, 9]) ]); - kernel.setOutput([2,2]); + kernel.setOutput([2, 2]); matrix = input([ - 1,2, - 3,4 - ], [2,2]); + 1, 2, + 3, 4 + ], [2, 2]); assert.deepEqual(kernel(matrix), [ - new Float32Array([1,2]), - new Float32Array([3,4]) + new Float32Array([1, 2]), + new Float32Array([3, 4]) ]); gpu.destroy(); } @@ -1225,45 +1249,45 @@ test('unsigned precision Input Matrix cpu', () => { function testSinglePrecisionInputMatrix(mode) { const gpu = new GPU({ mode }); const kernel = gpu.createKernel(function(input) { - return input[this.thread.y][this.thread.x]; - }) + return input[this.thread.y][this.thread.x]; + }) .setDynamicArguments(true) .setDynamicOutput(true) - .setOutput([4,4]); + .setOutput([4, 4]); let matrix = input([ - 1,2,3,4, - 5,6,7,8, - 9,10,11,12, - 13,14,15,16 + 1, 2, 3, 4, + 5, 6, 7, 8, + 9, 10, 11, 12, + 13, 14, 15, 16 ], [4, 4]); assert.deepEqual(kernel(matrix), [ - new Float32Array([1,2,3,4]), - new Float32Array([5,6,7,8]), - new Float32Array([9,10,11,12]), - new Float32Array([13,14,15,16]) + new Float32Array([1, 2, 3, 4]), + new Float32Array([5, 6, 7, 8]), + new Float32Array([9, 10, 11, 12]), + new Float32Array([13, 14, 15, 16]) ]); - kernel.setOutput([3,3]); + kernel.setOutput([3, 3]); matrix = input([ - 1,2,3, - 4,5,6, - 7,8,9 + 1, 2, 3, + 4, 5, 6, + 7, 8, 9 ], [3, 3]); assert.deepEqual(kernel(matrix), [ - new Float32Array([1,2,3]), - new Float32Array([4,5,6]), - new Float32Array([7,8,9]) + new Float32Array([1, 2, 3]), + new Float32Array([4, 5, 6]), + new Float32Array([7, 8, 9]) ]); - kernel.setOutput([2,2]); + kernel.setOutput([2, 2]); matrix = input([ - 1,2, - 3,4 - ], [2,2]); + 1, 2, + 3, 4 + ], [2, 2]); assert.deepEqual(kernel(matrix), [ - new Float32Array([1,2]), - new Float32Array([3,4]) + new Float32Array([1, 2]), + new Float32Array([3, 4]) ]); gpu.destroy(); } @@ -1290,4 +1314,4 @@ function testSinglePrecisionInputMatrix(mode) { test('single precision Input Matrix cpu', () => { testSinglePrecisionInputMatrix('cpu'); -}); +}); \ No newline at end of file diff --git a/test/features/dynamic-output.js b/test/features/dynamic-output.js index 955c46c6..7028b0f2 100644 --- a/test/features/dynamic-output.js +++ b/test/features/dynamic-output.js @@ -12,13 +12,13 @@ function dynamicOutput1DGrows(mode) { kernel.setOutput([5]); let result = kernel(); assert.equal(result.length, 5); - assert.deepEqual(Array.from(result), [5,6,7,8,9]); + assert.deepEqual(Array.from(result), [5, 6, 7, 8, 9]); assert.deepEqual(Array.from(kernel.output), [5]); kernel.setOutput([10]); result = kernel(); assert.equal(result.length, 10); - assert.deepEqual(Array.from(result), [10,11,12,13,14,15,16,17,18,19]); + assert.deepEqual(Array.from(result), [10, 11, 12, 13, 14, 15, 16, 17, 18, 19]); assert.deepEqual(Array.from(kernel.output), [10]); gpu.destroy(); @@ -58,13 +58,13 @@ function dynamicOutput1DShrinks(mode) { kernel.setOutput([10]); let result = kernel(); assert.equal(result.length, 10); - assert.deepEqual(Array.from(result), [10,11,12,13,14,15,16,17,18,19]); + assert.deepEqual(Array.from(result), [10, 11, 12, 13, 14, 15, 16, 17, 18, 19]); assert.deepEqual(Array.from(kernel.output), [10]); kernel.setOutput([5]); result = kernel(); assert.equal(result.length, 5); - assert.deepEqual(Array.from(result), [5,6,7,8,9]); + assert.deepEqual(Array.from(result), [5, 6, 7, 8, 9]); assert.deepEqual(Array.from(kernel.output), [5]); gpu.destroy(); @@ -108,16 +108,16 @@ function dynamicOutput1DKernelMapGrows(mode) { let result = kernel(); assert.equal(result.result.length, 5); assert.equal(result.result2.length, 5); - assert.deepEqual(Array.from(result.result), [5,6,7,8,9]); - assert.deepEqual(Array.from(result.result2), [5,6,7,8,9]); + assert.deepEqual(Array.from(result.result), [5, 6, 7, 8, 9]); + assert.deepEqual(Array.from(result.result2), [5, 6, 7, 8, 9]); assert.deepEqual(Array.from(kernel.output), [5]); kernel.setOutput([10]); result = kernel(); assert.equal(result.result.length, 10); assert.equal(result.result2.length, 10); - assert.deepEqual(Array.from(result.result), [10,11,12,13,14,15,16,17,18,19]); - assert.deepEqual(Array.from(result.result2), [10,11,12,13,14,15,16,17,18,19]); + assert.deepEqual(Array.from(result.result), [10, 11, 12, 13, 14, 15, 16, 17, 18, 19]); + assert.deepEqual(Array.from(result.result2), [10, 11, 12, 13, 14, 15, 16, 17, 18, 19]); assert.deepEqual(Array.from(kernel.output), [10]); gpu.destroy(); @@ -162,16 +162,16 @@ function dynamicOutput1DKernelMapShrinks(mode) { let result = kernel(); assert.equal(result.result.length, 10); assert.equal(result.result2.length, 10); - assert.deepEqual(Array.from(result.result), [10,11,12,13,14,15,16,17,18,19]); - assert.deepEqual(Array.from(result.result2), [10,11,12,13,14,15,16,17,18,19]); + assert.deepEqual(Array.from(result.result), [10, 11, 12, 13, 14, 15, 16, 17, 18, 19]); + assert.deepEqual(Array.from(result.result2), [10, 11, 12, 13, 14, 15, 16, 17, 18, 19]); assert.deepEqual(Array.from(kernel.output), [10]); kernel.setOutput([5]); result = kernel(); assert.equal(result.result.length, 5); assert.equal(result.result2.length, 5); - assert.deepEqual(Array.from(result.result), [5,6,7,8,9]); - assert.deepEqual(Array.from(result.result2), [5,6,7,8,9]); + assert.deepEqual(Array.from(result.result), [5, 6, 7, 8, 9]); + assert.deepEqual(Array.from(result.result2), [5, 6, 7, 8, 9]); assert.deepEqual(Array.from(kernel.output), [5]); gpu.destroy(); @@ -207,17 +207,24 @@ function dynamicOutput2DGrows(mode) { return this.output.x + this.output.y + this.thread.x + this.thread.y; }, { dynamicOutput: true }); - kernel.setOutput([2,2]); + kernel.setOutput([2, 2]); let result = kernel(); assert.equal(result.length, 2); - assert.deepEqual(result.map(row => Array.from(row)), [[4,5],[5,6]]); - assert.deepEqual(Array.from(kernel.output), [2,2]); + assert.deepEqual(result.map(row => Array.from(row)), [ + [4, 5], + [5, 6] + ]); + assert.deepEqual(Array.from(kernel.output), [2, 2]); - kernel.setOutput([3,3]); + kernel.setOutput([3, 3]); result = kernel(); assert.equal(result.length, 3); - assert.deepEqual(result.map(row => Array.from(row)), [[6,7,8],[7,8,9],[8,9,10]]); - assert.deepEqual(Array.from(kernel.output), [3,3]); + assert.deepEqual(result.map(row => Array.from(row)), [ + [6, 7, 8], + [7, 8, 9], + [8, 9, 10] + ]); + assert.deepEqual(Array.from(kernel.output), [3, 3]); gpu.destroy(); } @@ -253,17 +260,24 @@ function dynamicOutput2DShrinks(mode) { return this.output.x + this.output.y + this.thread.x + this.thread.y; }, { dynamicOutput: true }); - kernel.setOutput([3,3]); + kernel.setOutput([3, 3]); let result = kernel(); assert.equal(result.length, 3); - assert.deepEqual(result.map(row => Array.from(row)), [[6,7,8],[7,8,9],[8,9,10]]); - assert.deepEqual(Array.from(kernel.output), [3,3]); + assert.deepEqual(result.map(row => Array.from(row)), [ + [6, 7, 8], + [7, 8, 9], + [8, 9, 10] + ]); + assert.deepEqual(Array.from(kernel.output), [3, 3]); - kernel.setOutput([2,2]); + kernel.setOutput([2, 2]); result = kernel(); assert.equal(result.length, 2); - assert.deepEqual(result.map(row => Array.from(row)), [[4,5],[5,6]]); - assert.deepEqual(Array.from(kernel.output), [2,2]); + assert.deepEqual(result.map(row => Array.from(row)), [ + [4, 5], + [5, 6] + ]); + assert.deepEqual(Array.from(kernel.output), [2, 2]); gpu.destroy(); } @@ -302,21 +316,35 @@ function dynamicOutput2DKernelMapGrows(mode) { return map(this.output.x + this.output.y + this.thread.x + this.thread.y); }, { dynamicOutput: true }); - kernel.setOutput([2,2]); + kernel.setOutput([2, 2]); let result = kernel(); assert.equal(result.result.length, 2); assert.equal(result.result1.length, 2); - assert.deepEqual(result.result.map(row => Array.from(row)), [[4,5],[5,6]]); - assert.deepEqual(result.result1.map(row => Array.from(row)), [[4,5],[5,6]]); - assert.deepEqual(Array.from(kernel.output), [2,2]); + assert.deepEqual(result.result.map(row => Array.from(row)), [ + [4, 5], + [5, 6] + ]); + assert.deepEqual(result.result1.map(row => Array.from(row)), [ + [4, 5], + [5, 6] + ]); + assert.deepEqual(Array.from(kernel.output), [2, 2]); - kernel.setOutput([3,3]); + kernel.setOutput([3, 3]); result = kernel(); assert.equal(result.result.length, 3); assert.equal(result.result1.length, 3); - assert.deepEqual(result.result.map(row => Array.from(row)), [[6,7,8],[7,8,9],[8,9,10]]); - assert.deepEqual(result.result1.map(row => Array.from(row)), [[6,7,8],[7,8,9],[8,9,10]]); - assert.deepEqual(Array.from(kernel.output), [3,3]); + assert.deepEqual(result.result.map(row => Array.from(row)), [ + [6, 7, 8], + [7, 8, 9], + [8, 9, 10] + ]); + assert.deepEqual(result.result1.map(row => Array.from(row)), [ + [6, 7, 8], + [7, 8, 9], + [8, 9, 10] + ]); + assert.deepEqual(Array.from(kernel.output), [3, 3]); gpu.destroy(); } @@ -356,21 +384,35 @@ function dynamicOutput2DKernelMapShrinks(mode) { return map(this.output.x + this.output.y + this.thread.x + this.thread.y); }, { dynamicOutput: true }); - kernel.setOutput([3,3]); + kernel.setOutput([3, 3]); let result = kernel(); assert.equal(result.result.length, 3); assert.equal(result.result1.length, 3); - assert.deepEqual(result.result.map(row => Array.from(row)), [[6,7,8],[7,8,9],[8,9,10]]); - assert.deepEqual(result.result1.map(row => Array.from(row)), [[6,7,8],[7,8,9],[8,9,10]]); - assert.deepEqual(Array.from(kernel.output), [3,3]); + assert.deepEqual(result.result.map(row => Array.from(row)), [ + [6, 7, 8], + [7, 8, 9], + [8, 9, 10] + ]); + assert.deepEqual(result.result1.map(row => Array.from(row)), [ + [6, 7, 8], + [7, 8, 9], + [8, 9, 10] + ]); + assert.deepEqual(Array.from(kernel.output), [3, 3]); - kernel.setOutput([2,2]); + kernel.setOutput([2, 2]); result = kernel(); assert.equal(result.result.length, 2); assert.equal(result.result1.length, 2); - assert.deepEqual(result.result.map(row => Array.from(row)), [[4,5],[5,6]]); - assert.deepEqual(result.result1.map(row => Array.from(row)), [[4,5],[5,6]]); - assert.deepEqual(Array.from(kernel.output), [2,2]); + assert.deepEqual(result.result.map(row => Array.from(row)), [ + [4, 5], + [5, 6] + ]); + assert.deepEqual(result.result1.map(row => Array.from(row)), [ + [4, 5], + [5, 6] + ]); + assert.deepEqual(Array.from(kernel.output), [2, 2]); gpu.destroy(); } @@ -403,10 +445,10 @@ test('dynamic output 2d shrinks cpu', () => { function dynamicOutput2DGraphicalGrows(mode) { const gpu = new GPU({ mode }); const kernel = gpu.createKernel(function() { - this.color(1,1,1,1); + this.color(1, 1, 1, 1); }, { graphical: true, dynamicOutput: true }); - kernel.setOutput([2,2]); + kernel.setOutput([2, 2]); kernel(); let result = kernel.getPixels(); assert.equal(result.length, 2 * 2 * 4); @@ -416,9 +458,9 @@ function dynamicOutput2DGraphicalGrows(mode) { 255, 255, 255, 255, 255, 255, 255, 255 ]); - assert.deepEqual(Array.from(kernel.output), [2,2]); + assert.deepEqual(Array.from(kernel.output), [2, 2]); - kernel.setOutput([3,3]); + kernel.setOutput([3, 3]); kernel(); result = kernel.getPixels(); assert.equal(result.length, 3 * 3 * 4); @@ -433,7 +475,7 @@ function dynamicOutput2DGraphicalGrows(mode) { 255, 255, 255, 255, 255, 255, 255, 255, ]); - assert.deepEqual(Array.from(kernel.output), [3,3]); + assert.deepEqual(Array.from(kernel.output), [3, 3]); gpu.destroy(); } @@ -466,10 +508,10 @@ test('dynamic output 2d graphical grows gpu', () => { function dynamicOutput2DGraphicalShrinks(mode) { const gpu = new GPU({ mode }); const kernel = gpu.createKernel(function() { - this.color(1,1,1,1); + this.color(1, 1, 1, 1); }, { graphical: true, dynamicOutput: true }); - kernel.setOutput([3,3]); + kernel.setOutput([3, 3]); kernel(); let result = kernel.getPixels(); assert.equal(result.length, 3 * 3 * 4); @@ -484,9 +526,9 @@ function dynamicOutput2DGraphicalShrinks(mode) { 255, 255, 255, 255, 255, 255, 255, 255, ]); - assert.deepEqual(Array.from(kernel.output), [3,3]); + assert.deepEqual(Array.from(kernel.output), [3, 3]); - kernel.setOutput([2,2]); + kernel.setOutput([2, 2]); kernel(); result = kernel.getPixels(); assert.equal(result.length, 2 * 2 * 4); @@ -496,7 +538,7 @@ function dynamicOutput2DGraphicalShrinks(mode) { 255, 255, 255, 255, 255, 255, 255, 255 ]); - assert.deepEqual(Array.from(kernel.output), [2,2]); + assert.deepEqual(Array.from(kernel.output), [2, 2]); gpu.destroy(); } @@ -531,33 +573,42 @@ function dynamicOutput3DGrows(mode) { return this.output.x + this.output.y + this.thread.z + this.thread.x + this.thread.y + this.thread.z; }, { dynamicOutput: true }); - kernel.setOutput([2,2,2]); + kernel.setOutput([2, 2, 2]); let result = kernel(); assert.equal(result.length, 2); - assert.deepEqual(result.map(matrix => matrix.map(row => Array.from(row))), [[[4,5],[5,6]],[[6,7],[7,8]]]); - assert.deepEqual(Array.from(kernel.output), [2,2,2]); + assert.deepEqual(result.map(matrix => matrix.map(row => Array.from(row))), [ + [ + [4, 5], + [5, 6] + ], + [ + [6, 7], + [7, 8] + ] + ]); + assert.deepEqual(Array.from(kernel.output), [2, 2, 2]); - kernel.setOutput([3,3,3]); + kernel.setOutput([3, 3, 3]); result = kernel(); assert.equal(result.length, 3); assert.deepEqual(result.map(matrix => matrix.map(row => Array.from(row))), [ [ - [6,7,8], - [7,8,9], - [8,9,10] + [6, 7, 8], + [7, 8, 9], + [8, 9, 10] ], [ - [8,9,10], - [9,10,11], - [10,11,12] + [8, 9, 10], + [9, 10, 11], + [10, 11, 12] ], [ - [10,11,12], - [11,12,13], - [12,13,14] + [10, 11, 12], + [11, 12, 13], + [12, 13, 14] ] ]); - assert.deepEqual(Array.from(kernel.output), [3,3,3]); + assert.deepEqual(Array.from(kernel.output), [3, 3, 3]); gpu.destroy(); } @@ -593,33 +644,42 @@ function dynamicOutput3DShrinks(mode) { return this.output.x + this.output.y + this.thread.z + this.thread.x + this.thread.y + this.thread.z; }, { dynamicOutput: true }); - kernel.setOutput([3,3,3]); + kernel.setOutput([3, 3, 3]); let result = kernel(); assert.equal(result.length, 3); assert.deepEqual(result.map(matrix => matrix.map(row => Array.from(row))), [ [ - [6,7,8], - [7,8,9], - [8,9,10] + [6, 7, 8], + [7, 8, 9], + [8, 9, 10] ], [ - [8,9,10], - [9,10,11], - [10,11,12] + [8, 9, 10], + [9, 10, 11], + [10, 11, 12] ], [ - [10,11,12], - [11,12,13], - [12,13,14] + [10, 11, 12], + [11, 12, 13], + [12, 13, 14] ] ]); - assert.deepEqual(Array.from(kernel.output), [3,3,3]); + assert.deepEqual(Array.from(kernel.output), [3, 3, 3]); - kernel.setOutput([2,2,2]); + kernel.setOutput([2, 2, 2]); result = kernel(); assert.equal(result.length, 2); - assert.deepEqual(result.map(matrix => matrix.map(row => Array.from(row))), [[[4,5],[5,6]],[[6,7],[7,8]]]); - assert.deepEqual(Array.from(kernel.output), [2,2,2]); + assert.deepEqual(result.map(matrix => matrix.map(row => Array.from(row))), [ + [ + [4, 5], + [5, 6] + ], + [ + [6, 7], + [7, 8] + ] + ]); + assert.deepEqual(Array.from(kernel.output), [2, 2, 2]); gpu.destroy(); } @@ -658,53 +718,71 @@ function dynamicOutput3DKernelMapGrows(mode) { return map(this.output.x + this.output.y + this.thread.z + this.thread.x + this.thread.y + this.thread.z); }, { dynamicOutput: true }); - kernel.setOutput([2,2,2]); + kernel.setOutput([2, 2, 2]); let result = kernel(); assert.equal(result.result.length, 2); assert.equal(result.result1.length, 2); - assert.deepEqual(result.result.map(matrix => matrix.map(row => Array.from(row))), [[[4,5],[5,6]],[[6,7],[7,8]]]); - assert.deepEqual(result.result1.map(matrix => matrix.map(row => Array.from(row))), [[[4,5],[5,6]],[[6,7],[7,8]]]); - assert.deepEqual(Array.from(kernel.output), [2,2,2]); + assert.deepEqual(result.result.map(matrix => matrix.map(row => Array.from(row))), [ + [ + [4, 5], + [5, 6] + ], + [ + [6, 7], + [7, 8] + ] + ]); + assert.deepEqual(result.result1.map(matrix => matrix.map(row => Array.from(row))), [ + [ + [4, 5], + [5, 6] + ], + [ + [6, 7], + [7, 8] + ] + ]); + assert.deepEqual(Array.from(kernel.output), [2, 2, 2]); - kernel.setOutput([3,3,3]); + kernel.setOutput([3, 3, 3]); result = kernel(); assert.equal(result.result.length, 3); assert.equal(result.result1.length, 3); assert.deepEqual(result.result.map(matrix => matrix.map(row => Array.from(row))), [ [ - [6,7,8], - [7,8,9], - [8,9,10] + [6, 7, 8], + [7, 8, 9], + [8, 9, 10] ], [ - [8,9,10], - [9,10,11], - [10,11,12] + [8, 9, 10], + [9, 10, 11], + [10, 11, 12] ], [ - [10,11,12], - [11,12,13], - [12,13,14] + [10, 11, 12], + [11, 12, 13], + [12, 13, 14] ] ]); assert.deepEqual(result.result1.map(matrix => matrix.map(row => Array.from(row))), [ [ - [6,7,8], - [7,8,9], - [8,9,10] + [6, 7, 8], + [7, 8, 9], + [8, 9, 10] ], [ - [8,9,10], - [9,10,11], - [10,11,12] + [8, 9, 10], + [9, 10, 11], + [10, 11, 12] ], [ - [10,11,12], - [11,12,13], - [12,13,14] + [10, 11, 12], + [11, 12, 13], + [12, 13, 14] ] ]); - assert.deepEqual(Array.from(kernel.output), [3,3,3]); + assert.deepEqual(Array.from(kernel.output), [3, 3, 3]); gpu.destroy(); } @@ -744,53 +822,71 @@ function dynamicOutput3DKernelMapShrinks(mode) { return map(this.output.x + this.output.y + this.thread.z + this.thread.x + this.thread.y + this.thread.z); }, { dynamicOutput: true }); - kernel.setOutput([3,3,3]); + kernel.setOutput([3, 3, 3]); let result = kernel(); assert.equal(result.result.length, 3); assert.equal(result.result1.length, 3); assert.deepEqual(result.result.map(matrix => matrix.map(row => Array.from(row))), [ [ - [6,7,8], - [7,8,9], - [8,9,10] + [6, 7, 8], + [7, 8, 9], + [8, 9, 10] ], [ - [8,9,10], - [9,10,11], - [10,11,12] + [8, 9, 10], + [9, 10, 11], + [10, 11, 12] ], [ - [10,11,12], - [11,12,13], - [12,13,14] + [10, 11, 12], + [11, 12, 13], + [12, 13, 14] ] ]); assert.deepEqual(result.result1.map(matrix => matrix.map(row => Array.from(row))), [ [ - [6,7,8], - [7,8,9], - [8,9,10] + [6, 7, 8], + [7, 8, 9], + [8, 9, 10] ], [ - [8,9,10], - [9,10,11], - [10,11,12] + [8, 9, 10], + [9, 10, 11], + [10, 11, 12] ], [ - [10,11,12], - [11,12,13], - [12,13,14] + [10, 11, 12], + [11, 12, 13], + [12, 13, 14] ] ]); - assert.deepEqual(Array.from(kernel.output), [3,3,3]); + assert.deepEqual(Array.from(kernel.output), [3, 3, 3]); - kernel.setOutput([2,2,2]); + kernel.setOutput([2, 2, 2]); result = kernel(); assert.equal(result.result.length, 2); assert.equal(result.result1.length, 2); - assert.deepEqual(result.result.map(matrix => matrix.map(row => Array.from(row))), [[[4,5],[5,6]],[[6,7],[7,8]]]); - assert.deepEqual(result.result1.map(matrix => matrix.map(row => Array.from(row))), [[[4,5],[5,6]],[[6,7],[7,8]]]); - assert.deepEqual(Array.from(kernel.output), [2,2,2]); + assert.deepEqual(result.result.map(matrix => matrix.map(row => Array.from(row))), [ + [ + [4, 5], + [5, 6] + ], + [ + [6, 7], + [7, 8] + ] + ]); + assert.deepEqual(result.result1.map(matrix => matrix.map(row => Array.from(row))), [ + [ + [4, 5], + [5, 6] + ], + [ + [6, 7], + [7, 8] + ] + ]); + assert.deepEqual(Array.from(kernel.output), [2, 2, 2]); gpu.destroy(); } @@ -817,4 +913,4 @@ test('dynamic output 3d kernel map shrinks gpu', () => { test('dynamic output 3d kernel map shrinks cpu', () => { dynamicOutput3DKernelMapShrinks('cpu'); -}); +}); \ No newline at end of file diff --git a/test/features/function-return.js b/test/features/function-return.js index 45988f5c..008b4eea 100644 --- a/test/features/function-return.js +++ b/test/features/function-return.js @@ -3,12 +3,12 @@ const { GPU } = require('../../src'); describe('features: function return'); -function functionReturnFloat( mode ) { +function functionReturnFloat(mode) { const gpu = new GPU({ mode }); const f = gpu.createKernel(function() { return 42; }, { - output : [1] + output: [1] }); assert.equal(f()[0], 42); gpu.destroy(); @@ -39,12 +39,12 @@ test('float cpu', () => { }); -function functionReturnArray2( mode ) { +function functionReturnArray2(mode) { const gpu = new GPU({ mode }); const f = gpu.createKernel(function() { return [42, 43]; }, { - output : [1] + output: [1] }); const result = f(); assert.equal(result[0].constructor, Float32Array); @@ -77,12 +77,12 @@ test('Array(2) cpu', () => { functionReturnArray2('cpu'); }); -function functionReturnArray3( mode ) { +function functionReturnArray3(mode) { const gpu = new GPU({ mode }); const f = gpu.createKernel(function() { return [42, 43, 44]; }, { - output : [1] + output: [1] }); const result = f(); assert.equal(result[0].constructor, Float32Array); @@ -117,12 +117,12 @@ test('Array(3) cpu', () => { }); -function functionReturnArray4( mode ) { +function functionReturnArray4(mode) { const gpu = new GPU({ mode }); const f = gpu.createKernel(function() { return [42, 43, 44, 45]; }, { - output : [1] + output: [1] }); const result = f(); @@ -163,6 +163,7 @@ function functionReturnArray4MemberExpression(mode) { const kernel = gpu.createKernel(function(value) { let pixel = toIntArray4(value[this.thread.y][this.thread.x]); return pixel; + function toIntArray4(pixel) { return [pixel[0] * 255, pixel[1] * 255, pixel[2] * 255, pixel[3] * 255]; } @@ -170,8 +171,12 @@ function functionReturnArray4MemberExpression(mode) { output: [1, 1], argumentTypes: { value: 'Array2D(4)' }, }); - const result = kernel([[[1,1,1,1]]]); - assert.deepEqual(Array.from(result[0][0]), [255,255,255,255]); + const result = kernel([ + [ + [1, 1, 1, 1] + ] + ]); + assert.deepEqual(Array.from(result[0][0]), [255, 255, 255, 255]); gpu.destroy(); } diff --git a/test/features/get-canvas.js b/test/features/get-canvas.js index ef247ad1..1755facb 100644 --- a/test/features/get-canvas.js +++ b/test/features/get-canvas.js @@ -3,7 +3,7 @@ const { GPU } = require('../../src'); describe('get canvas'); -function getCanvasTest(mode ) { +function getCanvasTest(mode) { const gpu = new GPU(); assert.ok(gpu.context === null, 'context is initially null'); @@ -12,22 +12,22 @@ function getCanvasTest(mode ) { const render = gpu.createKernel(function() { this.color(0, 0, 0, 1); }, { - output : [30,30], - mode : mode + output: [30, 30], + mode: mode }).setGraphical(true); assert.ok(render !== null, 'function generated test'); - assert.ok(render.canvas, 'testing for canvas after createKernel' ); - assert.ok(render.context, 'testing for context after createKernel' ); - assert.ok(gpu.canvas, 'testing for canvas after createKernel' ); - assert.ok(gpu.context, 'testing for context after createKernel' ); + assert.ok(render.canvas, 'testing for canvas after createKernel'); + assert.ok(render.context, 'testing for context after createKernel'); + assert.ok(gpu.canvas, 'testing for canvas after createKernel'); + assert.ok(gpu.context, 'testing for context after createKernel'); render(); - assert.ok(render.canvas, 'testing for canvas after render' ); - assert.ok(render.context, 'testing for context after render' ); - assert.ok(gpu.canvas, 'testing for canvas after render' ); - assert.ok(gpu.context, 'testing for context after render' ); + assert.ok(render.canvas, 'testing for canvas after render'); + assert.ok(render.context, 'testing for context after render'); + assert.ok(gpu.canvas, 'testing for canvas after render'); + assert.ok(gpu.context, 'testing for context after render'); assert.equal(render.canvas, gpu.canvas); assert.equal(render.context, gpu.context); @@ -57,4 +57,4 @@ test('gpu', () => { test('cpu', () => { getCanvasTest('cpu'); -}); +}); \ No newline at end of file diff --git a/test/features/get-pixels.js b/test/features/get-pixels.js index 4e15491a..90081fcf 100644 --- a/test/features/get-pixels.js +++ b/test/features/get-pixels.js @@ -12,17 +12,17 @@ function getPixelsStandard(mode) { v[this.thread.y][this.thread.x][2] ); }, { - output: [2,2], + output: [2, 2], graphical: true, }); kernel([ [ - [.02,.04,.06,.08], - [.10,.12,.14,.16] + [.02, .04, .06, .08], + [.10, .12, .14, .16] ], [ - [.18,.20,.22,.24], - [.26,.28,.30,.32] + [.18, .20, .22, .24], + [.26, .28, .30, .32] ] ]); const pixels = Array.from(kernel.getPixels()); @@ -173,17 +173,17 @@ function getPixelsFlipped(mode) { v[this.thread.y][this.thread.x][2] ); }, { - output: [2,2], + output: [2, 2], graphical: true, }); kernel([ [ - [.02,.04,.06,.08], - [.10,.12,.14,.16] + [.02, .04, .06, .08], + [.10, .12, .14, .16] ], [ - [.18,.20,.22,.24], - [.26,.28,.30,.32] + [.18, .20, .22, .24], + [.26, .28, .30, .32] ] ]); const pixels = Array.from(kernel.getPixels(true)); @@ -322,4 +322,4 @@ test('flipped gpu', () => { 76, 255 ]); -}); +}); \ No newline at end of file diff --git a/test/features/if-else.js b/test/features/if-else.js index c082c475..9585a1cc 100644 --- a/test/features/if-else.js +++ b/test/features/if-else.js @@ -2,6 +2,7 @@ const { assert, skip, test, module: describe } = require('qunit'); const { GPU } = require('../../src'); describe('if else boolean'); + function ifElseBooleanTest(mode) { const gpu = new GPU({ mode @@ -15,10 +16,10 @@ function ifElseBooleanTest(mode) { } return result; }, { - output : [1] + output: [1] }); - assert.ok( f !== null, 'function generated test'); + assert.ok(f !== null, 'function generated test'); assert.equal(f()[0], 4, 'basic return function test'); gpu.destroy(); } @@ -49,7 +50,8 @@ test('cpu', () => { describe('if else lookup'); -function ifElseLookupTest( mode ) { + +function ifElseLookupTest(mode) { const gpu = new GPU({ mode }); const f = gpu.createKernel(function(x) { if (x[this.thread.x] > 0) { @@ -58,10 +60,10 @@ function ifElseLookupTest( mode ) { return 1; } }, { - output : [4] + output: [4] }); - assert.ok( f !== null, 'function generated test'); + assert.ok(f !== null, 'function generated test'); assert.deepEqual(Array.from(f([1, 1, 0, 0])), [0, 0, 1, 1], 'basic return function test'); gpu.destroy(); } @@ -91,7 +93,8 @@ test('cpu', () => { }); describe('if else if'); -function ifElseIfTest( mode ) { + +function ifElseIfTest(mode) { const gpu = new GPU({ mode }); const f = gpu.createKernel(function(x) { const v = x[this.thread.x]; @@ -102,7 +105,7 @@ function ifElseIfTest( mode ) { } return 1; }, { - output : [2] + output: [2] }); assert.deepEqual(Array.from(f([-1, 1])), [.5, 0], 'basic return function test'); gpu.destroy(); diff --git a/test/features/image-array.js b/test/features/image-array.js index 023d0ac6..230661c1 100644 --- a/test/features/image-array.js +++ b/test/features/image-array.js @@ -2,6 +2,7 @@ const { assert, skip, test, module: describe, only } = require('qunit'); const { GPU, CPUKernel } = require('../../src'); describe('features: image array'); + function getImages(callback) { const imageSources = [ 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCABbAIoDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwDtjB/vL/wHP8qUBk//AGv8anjEr/7L/wC1z/hUhib+Lb/wHj+dfQOfc893WjK/+8u3/a6f5/OkU7Plb7nZun4Yqx5TJ93/ANB/w4pvkb/67cH8xS5kNW6htpCtRm2b7yv9duf1BNO2/wB75f8AaXj+dO4uVdGBWkI2UpXZ/Ezf72Qf/r1KsS/eXbRzE7Fb/d3Uv/AW/n/KrOyneXRzCKqbX+X/AMd6H8quww76jMKv97/P0qxC2z5W/BvX/wCvWc5aaAONtUDxbKtvLUON9RFvqBGq1JipAlCKzPuocihM06nrFsepNiVDkgKRs4n/AINv+7x/KmeTKn/LVvbdhh/iPzq3HJ/C303difT2PtU+2jna3HzSW5n/AL9PvKrf7uRSM8T/AOsiZf8Aa6/qKumHZ/q/l/2e3/1qbtV/9l/896OdBzLsVBEr/wCrfd/P86Ywli+8m5P5/wBKtPaL97b/AOyn8xTNsqfxbv8AZk4P5iq5gKwVX+aP7v8Ad/wBpEj2fd+51G3t6jB6VK6qn96Dd9Cuf5VG4/iWXa/5girTCxIP++v93r+VPUK/3agllaL5ZEX/AHucfgR0/HFSfvfvSbV9JFbj8Tjp+GKTDke5NspfL/haoVafzPmTcvZl53epA46VaRt393/DPTI7VDdhONiHbs+99z+96fX/ABqZVqbb/eqJJET5V3MvT2B9MmpcriJVjp0UVBbZHuZ4ok/vNz/hUIv7T7v21V/4DgfqKj3nsVYsiOneXTVli8vct1Gyd23KQPyxVT+29MHB1C0z/vCpipS2RSpyeyuUfKn/AIrhW/2vN4+hAUfrSJcT277ZNzJ2aPLAe3DVvgU14ll+WRVb/eXNae27o1VZdUY6ao3/ADyZk6D5GyfXHAx3/KnNqcb/AHopFbt0q81rsj2wttX/AJ5su5fy6j8KhO6L70W3/aVuD+fT86FKD2QOVJ7Rt8yuupx/db7/AF+6w/QrUy3cD/xr/wB9L/LOaZJEv3vs7f8AfJX9QSDVbyf+mUsUq9GVcj+fT2xVpRaIcab2v+BZNxbfd81f93qPyqu/2R/vSqqdmVuP/rfhT992ke1oo2/LP5cGkjWN/mkRWf8A2sqB+GMU1pqCiluQW9xI++NWgliVsDc4BYeuP0/ClS4+zx7Wib5ePlbr+Jx+tPDRyu/z7Zdxxtw2AMDucY46U77b5Ue5pYv9tVz26jB/pVPXoW4puyiPivYn/dq67P7sjBSPT6j3p8vyfeZV7/T15/z+fXOn1LTZZ/IbazbciaFOPx/qKqSXdy8nl2Hn/d5ZWyOuON3GKaotvt6m0MJKT2t67fedLDJE3zM3zc/MzZzjuO1NnuILe3/eN8zNkKq5ZmJyAB3Oa5wJ4it/lWJvK7fKGwPfr/Wov7H1O7f7RLcbZW6qzFcD0yP8MUfV4p+9JWN44CnH3qtVW8tWyxqOptLOvmI3m9Et1+bae+e2ahSy1K4/1zrAjdFVQT/WtLSxY6Z/q5W+0N/E0YbJ7gEdunetq2n1C4j+7Ay/7WVP5ZNVKt7NWgtPMU50qWlKK9WvyT0XzuctZ6TbS3yW0zK0rZKSN82SOcY7cZP4Vq/8I1EON1vx/sf/AF6uXtg1xG3k/u72P50WT2PUH/PXnFU18QQKoEthfrIBhgucA98VDr1Z6wZzTq1amrkzeFLSZozXCcgU1qUmmk1SEQtAv/LNmj/3en5VBI86fet/N/2o8fqDVyirT7jUrbq5nm+g8v8AiXsVkXp6+1RM8cv+p2+zbsEfQdPxP5GrV3brcSRfdV1yQ20Hkdv1P5Uxo28zbG8ay/7K8D684P061onG2hsvZ2utyv5WyPy47hW7/vMce+fWiJInkaHarfxbmYnr1AHIJzzn3qd1kf8Ac/uvvAlmXIb/AOv7fSnppkH3m+ZmxnaoUce3+etHOurHzJLViT2FpcQeXPZfJ1+7nB+oOazDoMtvJ5lle/PtIEMnAxnIHP5fia1xYKnzR7v93eRT/Lb7q3Esbf3ZMOp/E/40o1ZR0i9P69S6eInBcqlp2ev+ZXtNQlidYbuLypePl3AZPsc/596qXl0t7fPpUCSLt5uWXB2L1wMHnPcf1q9cRK8Hk3turRd/Qe4J+6fyrGutMl0+f7bDcSz2rYjkXzCrBeylhzjOBVU1Byvs+na5rh40nJuTs7adrmgkuiW/7mPy1+bDxqpYkHvjB74psWtLFO26KSW328MyZdPw5LD9frVhYrN7RGWw2pt3Iy4baRzkHr9akNnBLI+37/de49x6/wA/rUc0Nea7MZNdE/mWSIru0intLhZEZhsZW3D069vQj3NaCSRuit5mMgHBcAj8O1chPb32j3bzWn325kj/AIJhjrjs3vV3+3NGk+eS3cSNyw9+9TPDSaThqvIajfWJqbqN1V91Lupcpxk2+mFqZmkJppAPzS7qizRmnYRIdr/K1AC+XtX5VqPNKDRYdxQv7xFX+4fvc9SP8DTsyp/DuT9R9PWmj/WbvoPyz/jUgNJjuPR9/wAy0/G/71Q7f4l+V/5/WpFl/hb5W/Q/Q1D8hj1h2f6v/vlun/1qrta7N7W/7p2Uh7duEf6H+E+4/EVcBp/3/lao5mjSLsc9pVxPdR3vk/K0bMGsmwAO3GehOCeuOfrWnDLFcbJFVliZTjdwUx1Xg5GPQ+/pWbqGns2oytC7xy7VeOTqVIHIyTypGePUdQcUmm3Uj3UsckTLKu57iPkkdBuHqcncD1IK9xW00pJzidkoKcXKHT8P815/f3NO5gk8t9v71dvCt1UnsD3z1H/165d7iNXZcKMHGGBz+NdbA2/zVb+HCv8ATkg/1+lYE5fz5N1pEzbjklevNVh52umRSV2y+Gpd1QrThWnKeeS5pM0ykNTYCTdSbqjpafKBJmlBqOlFKwEwNOBqEVIKmwEympAN/wArVCtSCs2UhwLRf7UX5lf8RVlTUK0ltwJVHRTwPTgGoaNER3yr5luzfKrN5b+2eVP/AH0B+dZ0nlJrtr527zZEeEMvthlP5bgfcVpX6hrJlIyPMTj/AIEKxNTZm1OzBJI+XjPq65rSlHm09TqoPX1Vvv2/EtCT+ytZSOT5re4XyQ3XZjkZz2+bH+cVbksJGldlkwCxIFV9SUSW8e4Z4iP6mr8Mj+TH87fdHf2pSm4pS6m0G9Gt+p//2Q==', @@ -11,6 +12,7 @@ function getImages(callback) { ]; const images = []; let finished = 0; + function onload() { finished++; if (finished === imageSources.length) { @@ -34,7 +36,7 @@ function imageArrayTest(mode, done) { this.color(pixel[0], pixel[1], pixel[2], pixel[3]); }, { graphical: true, - output : [138, 91] + output: [138, 91] }); getImages(function(images) { imageKernel(images); @@ -73,4 +75,4 @@ function imageArrayTest(mode, done) { (typeof Image !== 'undefined' ? test : skip)('image array cpu', t => { imageArrayTest('cpu', t.async()); -}); +}); \ No newline at end of file diff --git a/test/features/image.js b/test/features/image.js index 1e7101d9..6f55493f 100644 --- a/test/features/image.js +++ b/test/features/image.js @@ -2,6 +2,7 @@ const { assert, skip, test, module: describe } = require('qunit'); const { GPU } = require('../../src'); describe('image'); + function imageArgumentTest(mode, done) { const gpu = new GPU({ mode }); const image = document.createElement('img'); @@ -12,7 +13,7 @@ function imageArgumentTest(mode, done) { this.color(pixel[0], pixel[1], pixel[2], pixel[3]); }, { graphical: true, - output : [image.width, image.height] + output: [image.width, image.height] }); imageKernel(image); assert.equal(true, true, 'does not throw'); @@ -39,4 +40,4 @@ function imageArgumentTest(mode, done) { (typeof Image !== 'undefined' ? test : skip)('image argument cpu', t => { imageArgumentTest('cpu', t.async()); -}); +}); \ No newline at end of file diff --git a/test/features/infinity.js b/test/features/infinity.js index 6f9ba3e4..1ab4087c 100644 --- a/test/features/infinity.js +++ b/test/features/infinity.js @@ -2,11 +2,12 @@ const { assert, skip, test, module: describe } = require('qunit'); const { GPU } = require('../../src'); describe('infinity'); + function inputWithoutFloat(checks, mode) { const gpu = new GPU({ mode }); checks(gpu.createKernel(function() { - return Infinity; - }, { precision: 'unsigned' }) + return Infinity; + }, { precision: 'unsigned' }) .setOutput([1])()); gpu.destroy(); } @@ -39,8 +40,8 @@ test("Infinity without float gpu", () => { function inputWithFloat(checks, mode) { const gpu = new GPU({ mode }); checks(gpu.createKernel(function() { - return Infinity; - }, { precision: 'single' }) + return Infinity; + }, { precision: 'single' }) .setOutput([1])()); gpu.destroy(); } @@ -57,14 +58,14 @@ function inputWithFloat(checks, mode) { inputWithFloat((v) => assert.deepEqual(v[0], 3.4028234663852886e+38), 'gpu'); }); -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)("Infinity with float webgl", () => { +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)("Infinity with float webgl", () => { inputWithFloat((v) => assert.deepEqual(v[0], 3.4028234663852886e+38), 'webgl'); }); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)("Infinity with float webgl2", () => { +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)("Infinity with float webgl2", () => { inputWithFloat((v) => assert.deepEqual(v[0], 3.4028234663852886e+38), 'webgl2'); }); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)("Infinity with float headlessgl", () => { +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)("Infinity with float headlessgl", () => { inputWithFloat((v) => assert.deepEqual(v[0], 3.4028234663852886e+38), 'headlessgl'); -}); +}); \ No newline at end of file diff --git a/test/features/inject-native.js b/test/features/inject-native.js index ed16d9df..bbd1f257 100644 --- a/test/features/inject-native.js +++ b/test/features/inject-native.js @@ -4,7 +4,7 @@ const { GPU } = require('../../src'); describe('features: inject native'); function gpuAddAB(mode) { - const gpu = new GPU({mode}); + const gpu = new GPU({ mode }); gpu .injectNative(` int customAdder(int a, int b) { @@ -14,7 +14,7 @@ int customAdder(int a, int b) { .addNativeFunction('customAdderLink', `int customAdderLink(int a, int b) { return customAdder(a, b); }`); - const kernel = gpu.createKernel(function (a, b) { + const kernel = gpu.createKernel(function(a, b) { return customAdderLink(a[this.thread.x], b[this.thread.x]); }, { output: [6], @@ -56,10 +56,10 @@ function cpuAddAB(mode) { function customAdder(a, b) { return a + b; } - const gpu = new GPU({mode}); + const gpu = new GPU({ mode }); gpu .injectNative(customAdder.toString()); - const kernel = gpu.createKernel(function (a, b) { + const kernel = gpu.createKernel(function(a, b) { return customAdder(a[this.thread.x], b[this.thread.x]); }, { output: [6], @@ -79,4 +79,4 @@ function cpuAddAB(mode) { test('addAB cpu', () => { cpuAddAB('cpu'); -}); +}); \ No newline at end of file diff --git a/test/features/input.js b/test/features/input.js index 150557b6..42b8bec7 100644 --- a/test/features/input.js +++ b/test/features/input.js @@ -6,15 +6,15 @@ describe('input'); function inputX(mode) { const gpu = new GPU({ mode }); const kernel = gpu.createKernel(function(a) { - return a[this.thread.x]; - }) + return a[this.thread.x]; + }) .setOutput([9]); const a = new Float32Array(9); - a.set([1,2,3,4,5,6,7,8,9]); + a.set([1, 2, 3, 4, 5, 6, 7, 8, 9]); const result = kernel(input(a, [3, 3])); - assert.deepEqual(Array.from(result), [1,2,3,4,5,6,7,8,9]); + assert.deepEqual(Array.from(result), [1, 2, 3, 4, 5, 6, 7, 8, 9]); gpu.destroy(); } @@ -42,18 +42,18 @@ test("inputX cpu", () => { function inputXY(mode) { const gpu = new GPU({ mode }); const kernel = gpu.createKernel(function(a) { - return a[this.thread.y][this.thread.x]; - }) + return a[this.thread.y][this.thread.x]; + }) .setOutput([9]); const a = new Float32Array(9); - a.set([1,2,3,4,5,6,7,8,9]); + a.set([1, 2, 3, 4, 5, 6, 7, 8, 9]); const b = new Float32Array(9); - b.set([1,2,3,4,5,6,7,8,9]); + b.set([1, 2, 3, 4, 5, 6, 7, 8, 9]); const result = kernel(input(a, [3, 3])); - assert.deepEqual(Array.from(result), [1,2,3,4,5,6,7,8,9]); + assert.deepEqual(Array.from(result), [1, 2, 3, 4, 5, 6, 7, 8, 9]); gpu.destroy(); } @@ -84,15 +84,19 @@ test("inputXY cpu", () => { function inputYX(mode) { const gpu = new GPU({ mode }); const kernel = gpu.createKernel(function(a) { - return a[this.thread.y][this.thread.x]; - }) + return a[this.thread.y][this.thread.x]; + }) .setOutput([3, 3]); const a = new Float32Array(9); - a.set([1,2,3,4,5,6,7,8,9]); + a.set([1, 2, 3, 4, 5, 6, 7, 8, 9]); const result = kernel(input(a, [3, 3])); - assert.deepEqual(result.map(function(v) { return Array.from(v); }), [[1,2,3],[4,5,6],[7,8,9]]); + assert.deepEqual(result.map(function(v) { return Array.from(v); }), [ + [1, 2, 3], + [4, 5, 6], + [7, 8, 9] + ]); gpu.destroy(); } @@ -123,15 +127,18 @@ test("inputYX cpu", () => { function inputYXOffset(mode) { const gpu = new GPU({ mode }); const kernel = gpu.createKernel(function(a) { - return a[this.thread.x][this.thread.y]; - }) + return a[this.thread.x][this.thread.y]; + }) .setOutput([8, 2]); const a = new Float32Array(16); - a.set([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]); + a.set([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]); const result = kernel(input(a, [2, 8])); - assert.deepEqual(result.map(function(v) { return Array.from(v); }), [[1,3,5,7,9,11,13,15],[2,4,6,8,10,12,14,16]]); + assert.deepEqual(result.map(function(v) { return Array.from(v); }), [ + [1, 3, 5, 7, 9, 11, 13, 15], + [2, 4, 6, 8, 10, 12, 14, 16] + ]); gpu.destroy(); } @@ -162,14 +169,23 @@ test("inputYXOffset cpu", () => { function inputYXOffsetPlus1(mode) { const gpu = new GPU({ mode }); const kernel = gpu.createKernel(function(a) { - return a[this.thread.x][this.thread.y]; - }) + return a[this.thread.x][this.thread.y]; + }) .setOutput([2, 8]); - const a = new Float32Array([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]); + const a = new Float32Array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]); const result = kernel(input(a, [8, 2])); - assert.deepEqual(result.map(function(v) { return Array.from(v); }), [[1,9],[2,10],[3,11],[4,12],[5,13],[6,14],[7,15],[8,16]]); + assert.deepEqual(result.map(function(v) { return Array.from(v); }), [ + [1, 9], + [2, 10], + [3, 11], + [4, 12], + [5, 13], + [6, 14], + [7, 15], + [8, 16] + ]); gpu.destroy(); } @@ -200,15 +216,40 @@ test("inputYXOffsetPlus1 cpu", () => { function inputZYX(mode) { const gpu = new GPU({ mode }); const kernel = gpu.createKernel(function(a) { - return a[this.thread.z][this.thread.y][this.thread.x]; - }) + return a[this.thread.z][this.thread.y][this.thread.x]; + }) .setOutput([2, 4, 4]); const a = new Float32Array(32); - a.set([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32]); + a.set([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]); const result = kernel(input(a, [2, 4, 4])); - assert.deepEqual(result.map(function(v) { return v.map(function(v) { return Array.from(v); }); }), [[[1,2],[3,4],[5,6],[7,8]],[[9,10],[11,12],[13,14],[15,16]],[[17,18],[19,20],[21,22],[23,24]],[[25,26],[27,28],[29,30],[31,32]]]); + assert.deepEqual(result.map(function(v) { return v.map(function(v) { return Array.from(v); }); }), [ + [ + [1, 2], + [3, 4], + [5, 6], + [7, 8] + ], + [ + [9, 10], + [11, 12], + [13, 14], + [15, 16] + ], + [ + [17, 18], + [19, 20], + [21, 22], + [23, 24] + ], + [ + [25, 26], + [27, 28], + [29, 30], + [31, 32] + ] + ]); gpu.destroy(); } @@ -240,12 +281,12 @@ test("inputZYX cpu", () => { function inputZYXVariables(mode) { const gpu = new GPU({ mode }); const kernel = gpu.createKernel(function(a, x, y, z) { - return a[z][y][x]; - }) + return a[z][y][x]; + }) .setOutput([1]); const a = new Float32Array(32); - a.set([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32]); + a.set([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]); const aInput = input(a, [2, 4, 4]); assert.deepEqual(Array.from(kernel(aInput, 1, 2, 3)), [30]); assert.deepEqual(Array.from(kernel(aInput, 0, 2, 3)), [29]); @@ -282,14 +323,14 @@ test("inputZYXVariables cpu", () => { function inputInt32ArrayX(mode) { const gpu = new GPU({ mode }); const kernel = gpu.createKernel(function(a) { - return a[this.thread.x]; - }) + return a[this.thread.x]; + }) .setPrecision('unsigned') .setOutput([9]); - const a = new Int32Array([1,2,3,4,5,6,7,8,9]); + const a = new Int32Array([1, 2, 3, 4, 5, 6, 7, 8, 9]); const result = kernel(input(a, [3, 3])); - assert.deepEqual(result, new Float32Array([1,2,3,4,5,6,7,8,9])); + assert.deepEqual(result, new Float32Array([1, 2, 3, 4, 5, 6, 7, 8, 9])); gpu.destroy(); } @@ -314,23 +355,23 @@ test("inputInt32ArrayX cpu", () => { }); test('.toArray() with array', () => { - assert.deepEqual(input([1,2,3,4], [4]).toArray(), [1,2,3,4]); + assert.deepEqual(input([1, 2, 3, 4], [4]).toArray(), [1, 2, 3, 4]); }); test('.toArray() with matrix', () => { - assert.deepEqual(input([1,2,3,4,5,6,7,8], [4,2]).toArray(), [new Float32Array([1,2,3,4]), new Float32Array([5,6,7,8])]); + assert.deepEqual(input([1, 2, 3, 4, 5, 6, 7, 8], [4, 2]).toArray(), [new Float32Array([1, 2, 3, 4]), new Float32Array([5, 6, 7, 8])]); }); test('.toArray() with grid', () => { assert.deepEqual( - input([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16], [4,2,2]).toArray(), + input([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], [4, 2, 2]).toArray(), [ [ - new Float32Array([1,2,3,4]), - new Float32Array([5,6,7,8]), + new Float32Array([1, 2, 3, 4]), + new Float32Array([5, 6, 7, 8]), ], [ - new Float32Array([9,10,11,12]), - new Float32Array([13,14,15,16]) + new Float32Array([9, 10, 11, 12]), + new Float32Array([13, 14, 15, 16]) ] ] ); -}); +}); \ No newline at end of file diff --git a/test/features/internally-defined-matrices.js b/test/features/internally-defined-matrices.js index 0e338831..a3387cf7 100644 --- a/test/features/internally-defined-matrices.js +++ b/test/features/internally-defined-matrices.js @@ -5,10 +5,11 @@ describe('features: internally defined matrices'); function testMatrix2(mode) { const gpu = new GPU({ mode }); + function getMatrix() { const matrix = [ - [1,2], - [3,4] + [1, 2], + [3, 4] ]; return matrix; } @@ -51,11 +52,12 @@ test('matrix2 cpu', () => { function testMatrix3(mode) { const gpu = new GPU({ mode }); + function getMatrix() { const matrix = [ - [1,2,3], - [4,5,6], - [7,8,9], + [1, 2, 3], + [4, 5, 6], + [7, 8, 9], ]; return matrix; } @@ -103,12 +105,13 @@ test('matrix3 cpu', () => { function testMatrix4(mode) { const gpu = new GPU({ mode }); + function getMatrix() { const matrix = [ - [1,2,3,4], - [5,6,7,8], - [9,10,11,12], - [13,14,15,16], + [1, 2, 3, 4], + [5, 6, 7, 8], + [9, 10, 11, 12], + [13, 14, 15, 16], ]; return matrix; } @@ -159,4 +162,4 @@ test('matrix4 gpu', () => { test('matrix4 cpu', () => { testMatrix4('cpu'); -}); +}); \ No newline at end of file diff --git a/test/features/json.js b/test/features/json.js index 48bb5d7f..1ad7ce86 100644 --- a/test/features/json.js +++ b/test/features/json.js @@ -4,11 +4,11 @@ const { GPU } = require('../../src'); describe('json serialize'); function testJSONSerialize(mode) { - const gpu = new GPU({mode}); + const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function (value) { + const kernel = gpu.createKernel(function(value) { return value; - }, {output: [1]}); + }, { output: [1] }); kernel(1); @@ -41,4 +41,4 @@ test('gpu', () => { test('cpu', () => { testJSONSerialize('cpu'); -}); +}); \ No newline at end of file diff --git a/test/features/legacy-encoder.js b/test/features/legacy-encoder.js index 8c361264..30a3d863 100644 --- a/test/features/legacy-encoder.js +++ b/test/features/legacy-encoder.js @@ -67,6 +67,7 @@ test('on cpu', () => { function testSubKernelsLegacyEncoderOff(mode) { const gpu = new GPU({ mode }); + function addOne(value) { return value + 1; } @@ -103,6 +104,7 @@ test('subKernels off cpu', () => { function testSubKernelsLegacyEncoderOn(mode) { const gpu = new GPU({ mode }); + function addOne(value) { return value + 1; } @@ -265,4 +267,4 @@ test('WebGL2Kernel.getMainResultSubKernelPackedPixels useLegacyEncoder = true', }); assert.equal(result, ` data1 = legacyEncode32(subKernelResult_subKernel1); `); -}); +}); \ No newline at end of file diff --git a/test/features/loops.js b/test/features/loops.js index 597471a2..e6fffdeb 100644 --- a/test/features/loops.js +++ b/test/features/loops.js @@ -2,6 +2,7 @@ const { assert, skip, test, module: describe, only } = require('qunit'); const { GPU } = require('../../src'); describe('loops - for'); + function forLoopTest(mode) { const gpu = new GPU({ mode }); const f = gpu.createKernel(function(a, b) { @@ -12,15 +13,15 @@ function forLoopTest(mode) { return (a[this.thread.x] + b[this.thread.x] + x); }, { - output : [6] + output: [6] }); - assert.ok( f !== null, 'function generated test'); + assert.ok(f !== null, 'function generated test'); const a = [1, 2, 3, 5, 6, 7]; const b = [4, 5, 6, 1, 2, 3]; - const res = f(a,b); + const res = f(a, b); const exp = [15, 17, 19, 16, 18, 20]; assert.deepEqual(Array.from(res), exp); @@ -53,28 +54,29 @@ test('cpu', () => { describe('loops - for with constant'); + function forWithConstantTest(mode) { const gpu = new GPU({ mode }); const f = gpu.createKernel(function(a, b) { let x = 0; - for(let i = 0; i < this.constants.max; i++) { + for (let i = 0; i < this.constants.max; i++) { x = x + 1; } return (a[this.thread.x] + b[this.thread.x] + x); }, { - output : [6], + output: [6], constants: { max: 10 } }); - assert.ok( f !== null, 'function generated test'); + assert.ok(f !== null, 'function generated test'); const a = [1, 2, 3, 5, 6, 7]; const b = [4, 5, 6, 1, 2, 3]; - const res = f(a,b); + const res = f(a, b); const exp = [15, 17, 19, 16, 18, 20]; assert.deepEqual(Array.from(res), exp); @@ -108,6 +110,7 @@ test('forConstantLoopTest cpu', () => { describe('loops - while'); + function whileLoopTest(mode) { const gpu = new GPU({ mode }); const f = gpu.createKernel(function(a, b) { @@ -119,13 +122,13 @@ function whileLoopTest(mode) { return (a[this.thread.x] + b[this.thread.x] + x); }, { - output : [6] + output: [6] }); const a = [1, 2, 3, 5, 6, 7]; const b = [4, 5, 6, 1, 2, 3]; - const res = f(a,b); + const res = f(a, b); const exp = [15, 17, 19, 16, 18, 20]; assert.deepEqual(Array.from(res), exp); @@ -159,6 +162,7 @@ test('cpu', () => { describe('loops - while with constant'); + function whileWithConstantTest(mode) { const gpu = new GPU({ mode }); const f = gpu.createKernel(function(a, b) { @@ -170,16 +174,16 @@ function whileWithConstantTest(mode) { return (a[this.thread.x] + b[this.thread.x] + x); }, { - output : [6], + output: [6], constants: { max: 10 } }); - assert.ok( f !== null, 'function generated test'); + assert.ok(f !== null, 'function generated test'); const a = [1, 2, 3, 5, 6, 7]; const b = [4, 5, 6, 1, 2, 3]; - const res = f(a,b); + const res = f(a, b); const exp = [15, 17, 19, 16, 18, 20]; assert.deepEqual(Array.from(res), exp); @@ -212,13 +216,14 @@ test('cpu', () => { describe('loops - evil while loop'); -function evilWhileLoopTest(mode ) { + +function evilWhileLoopTest(mode) { function evilWhileKernelFunction(a, b) { let x = 0; let i = 0; //10000000 or 10 million is the approx upper limit on a chrome + GTX 780 - while(i<100) { + while (i < 100) { x = x + 1.0; ++i; } @@ -229,24 +234,24 @@ function evilWhileLoopTest(mode ) { const evil_while_a = [1, 2, 3, 5, 6, 7]; const evil_while_b = [4, 5, 6, 1, 2, 3]; const evil_while_cpuRef = new GPU({ mode: 'cpu' }); - const evil_while_cpuRef_f = evil_while_cpuRef.createKernel(evilWhileKernelFunction, { - output : [6], + const evil_while_cpuRef_f = evil_while_cpuRef.createKernel(evilWhileKernelFunction, { + output: [6], loopMaxIterations: 10000, }); - const evil_while_exp = evil_while_cpuRef_f(evil_while_a,evil_while_b); + const evil_while_exp = evil_while_cpuRef_f(evil_while_a, evil_while_b); const gpu = new GPU({ mode }); const f = gpu.createKernel(evilWhileKernelFunction, { - output : [6] + output: [6] }); - assert.ok( f !== null, 'function generated test'); + assert.ok(f !== null, 'function generated test'); - const res = f(evil_while_a,evil_while_b); + const res = f(evil_while_a, evil_while_b); - for(let i = 0; i < evil_while_exp.length; ++i) { - assert.equal(evil_while_exp[i], res[i], 'Result arr idx: '+i); + for (let i = 0; i < evil_while_exp.length; ++i) { + assert.equal(evil_while_exp[i], res[i], 'Result arr idx: ' + i); } evil_while_cpuRef.destroy(); gpu.destroy(); @@ -277,6 +282,7 @@ test('cpu', () => { }); describe('loops - do while'); + function doWhileLoopTest(mode) { const gpu = new GPU({ mode }); const f = gpu.createKernel(function(a, b) { @@ -288,15 +294,15 @@ function doWhileLoopTest(mode) { } while (i < 10); return (a[this.thread.x] + b[this.thread.x] + x); }, { - output : [6] + output: [6] }); - assert.ok( f !== null, 'function generated test'); + assert.ok(f !== null, 'function generated test'); const a = [1, 2, 3, 5, 6, 7]; const b = [4, 5, 6, 1, 2, 3]; - const res = f(a,b); + const res = f(a, b); const exp = [15, 17, 19, 16, 18, 20]; assert.deepEqual(Array.from(res), exp); gpu.destroy(); @@ -327,6 +333,7 @@ test('cpu', () => { }); describe('loops - do while with constant'); + function doWhileWithConstantLoop(mode) { const gpu = new GPU({ mode }); const f = gpu.createKernel(function(a, b) { @@ -338,16 +345,16 @@ function doWhileWithConstantLoop(mode) { } while (i < this.constants.max); return (a[this.thread.x] + b[this.thread.x] + x); }, { - output : [6], + output: [6], constants: { max: 10 } }); - assert.ok( f !== null, 'function generated test'); + assert.ok(f !== null, 'function generated test'); const a = [1, 2, 3, 5, 6, 7]; const b = [4, 5, 6, 1, 2, 3]; - const res = f(a,b); + const res = f(a, b); const exp = [15, 17, 19, 16, 18, 20]; assert.deepEqual(Array.from(res), exp); gpu.destroy(); @@ -375,4 +382,4 @@ test('gpu', () => { test('cpu', () => { doWhileWithConstantLoop('cpu'); -}); +}); \ No newline at end of file diff --git a/test/features/math-object.js b/test/features/math-object.js index c042dd9b..35c17af8 100644 --- a/test/features/math-object.js +++ b/test/features/math-object.js @@ -4,7 +4,7 @@ const { GPU } = require('../../src'); describe('features: math object'); function mathProps(mode) { - const props = ['E','LN10','LN2','LOG10E','LOG2E','PI','SQRT1_2','SQRT2']; + const props = ['E', 'LN10', 'LN2', 'LOG10E', 'LOG2E', 'PI', 'SQRT1_2', 'SQRT2']; const gpu = new GPU({ mode }); for (let i = 0; i < props.length; i++) { const prop = props[i]; @@ -163,12 +163,12 @@ function sqrtABTest(mode) { const f = gpu.createKernel(function(a, b) { return Math.sqrt(a[this.thread.x] * b[this.thread.x]); }, { - output : [6] + output: [6] }); const a = [3, 4, 5, 6, 7, 8]; const b = [3, 4, 5, 6, 7, 8]; - const res = f(a,b); + const res = f(a, b); const exp = [3, 4, 5, 6, 7, 8]; assert.deepEqual(Array.from(res), exp); @@ -232,6 +232,4 @@ test('random gpu', () => { test('random cpu', () => { mathRandom('cpu'); -}); - - +}); \ No newline at end of file diff --git a/test/features/nested-function.js b/test/features/nested-function.js index 52b830c5..371131a6 100644 --- a/test/features/nested-function.js +++ b/test/features/nested-function.js @@ -6,13 +6,13 @@ describe('nested function'); function nestedSumABTest(mode) { const gpu = new GPU({ mode }); const f = gpu.createKernel(function(a, b) { - function custom_adder(a,b) { - return a+b; + function custom_adder(a, b) { + return a + b; } return custom_adder(a[this.thread.x], b[this.thread.x]); }, { - output : [6] + output: [6] }); assert.ok(f !== null, 'function generated test'); @@ -20,7 +20,7 @@ function nestedSumABTest(mode) { const a = [1, 2, 3, 5, 6, 7]; const b = [4, 5, 6, 1, 2, 3]; - const res = f(a,b); + const res = f(a, b); const exp = [5, 7, 9, 6, 8, 10]; assert.deepEqual(Array.from(res), exp); @@ -90,4 +90,4 @@ test('nested in custom gpu', () => { test('nested in custom cpu', () => { testNestedInCustomFunction('cpu'); -}); +}); \ No newline at end of file diff --git a/test/features/offscreen-canvas.js b/test/features/offscreen-canvas.js index de85ab46..f3206c47 100644 --- a/test/features/offscreen-canvas.js +++ b/test/features/offscreen-canvas.js @@ -1,13 +1,13 @@ if (typeof importScripts !== 'undefined') { // inside Worker importScripts('../../dist/gpu-browser.js'); - onmessage = function (e) { + onmessage = function(e) { const gpu = new GPU({ mode: e.data }); - const a = [1,2,3]; - const b = [3,2,1]; + const a = [1, 2, 3]; + const b = [3, 2, 1]; const kernel = gpu.createKernel(function(a, b) { - return a[this.thread.x] - b[this.thread.x]; - }) + return a[this.thread.x] - b[this.thread.x]; + }) .setOutput([3]); postMessage({ mode: gpu.mode, result: kernel(a, b) }); gpu.destroy(); @@ -18,7 +18,7 @@ if (typeof importScripts !== 'undefined') { function testOffscreenCanvas(mode, done) { const worker = new Worker('features/offscreen-canvas.js'); - worker.onmessage = function (e) { + worker.onmessage = function(e) { const mode = e.data.mode; const result = e.data.result; assert.equal(mode, 'gpu', 'GPU mode used in Worker'); @@ -47,4 +47,4 @@ if (typeof importScripts !== 'undefined') { (GPU.isOffscreenCanvasSupported ? test : skip)('offscreen canvas cpu', t => { testOffscreenCanvas('cpu', t.async()); }); -} +} \ No newline at end of file diff --git a/test/features/optimize-float-memory.js b/test/features/optimize-float-memory.js index b929e3aa..c5bf43a1 100644 --- a/test/features/optimize-float-memory.js +++ b/test/features/optimize-float-memory.js @@ -40,7 +40,10 @@ function whenEnabledCallsCorrectRenderFunction2D(mode) { const result = fn(); assert.equal(fn.TextureConstructor.name, 'GLTextureMemoryOptimized2D'); assert.equal(fn.formatValues, utils.erectMemoryOptimized2DFloat); - assert.deepEqual(result.map(row => Array.from(row)), [[1,1],[1,1]]); + assert.deepEqual(result.map(row => Array.from(row)), [ + [1, 1], + [1, 1] + ]); } (GPU.isSinglePrecisionSupported && GPU.isGPUSupported ? test : skip)('when enabled calls correct render function 2d gpu (GPU ONLY)', () => { @@ -66,7 +69,16 @@ function whenEnabledCallsCorrectRenderFunction3D(mode) { const result = fn(); assert.equal(fn.TextureConstructor.name, 'GLTextureMemoryOptimized3D'); assert.equal(fn.formatValues, utils.erectMemoryOptimized3DFloat); - assert.deepEqual(result.map(matrix => matrix.map(row => Array.from(row))), [[[1,1],[1,1]],[[1,1],[1,1]]]); + assert.deepEqual(result.map(matrix => matrix.map(row => Array.from(row))), [ + [ + [1, 1], + [1, 1] + ], + [ + [1, 1], + [1, 1] + ] + ]); } (GPU.isSinglePrecisionSupported && GPU.isGPUSupported ? test : skip)('when enabled calls correct render function 3d gpu (GPU ONLY)', () => { @@ -84,7 +96,7 @@ function whenEnabledCallsCorrectRenderFunction3D(mode) { function singlePrecision(mode) { const gpu = new GPU({ mode }); - const array = [1,2,3,4,5]; + const array = [1, 2, 3, 4, 5]; const kernel = gpu.createKernel(function(array) { return array[this.thread.x]; }, { @@ -125,9 +137,9 @@ test('single precision cpu', () => { function float2DOutput(mode) { const gpu = new GPU({ mode }); const matrix = [ - [1,2,3,4,5], - [6,7,8,9,10], - [11,12,13,14,15], + [1, 2, 3, 4, 5], + [6, 7, 8, 9, 10], + [11, 12, 13, 14, 15], ]; const kernel = gpu.createKernel(function(matrix) { return matrix[this.thread.y][this.thread.x]; @@ -145,19 +157,19 @@ function float2DOutput(mode) { float2DOutput(); }); -(GPU.isSinglePrecisionSupported && GPU.isGPUSupported ? test : skip)('float 2d output gpu', () => { +(GPU.isSinglePrecisionSupported && GPU.isGPUSupported ? test : skip)('float 2d output gpu', () => { float2DOutput('gpu'); }); -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('float 2d output webgl', () => { +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('float 2d output webgl', () => { float2DOutput('webgl'); }); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('float 2d output webgl2', () => { +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('float 2d output webgl2', () => { float2DOutput('webgl2'); }); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('float 2d output headlessgl', () => { +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('float 2d output headlessgl', () => { float2DOutput('headlessgl'); }); @@ -170,14 +182,14 @@ function float3DOutput(mode) { const gpu = new GPU({ mode }); const cube = [ [ - [1,2,3,4,5], - [6,7,8,9,10], - [11,12,13,14,15], + [1, 2, 3, 4, 5], + [6, 7, 8, 9, 10], + [11, 12, 13, 14, 15], ], [ - [16,17,18,19,20], - [21,22,23,24,25], - [26,27,28,29,30], + [16, 17, 18, 19, 20], + [21, 22, 23, 24, 25], + [26, 27, 28, 29, 30], ] ]; const kernel = gpu.createKernel(function(cube) { @@ -218,7 +230,7 @@ test('float 3d output cpu', () => { function floatPipelineOutput(mode) { const gpu = new GPU({ mode }); - const array = [1,2,3,4,5]; + const array = [1, 2, 3, 4, 5]; const kernel = gpu.createKernel(function(array) { return array[this.thread.x]; }, { @@ -252,9 +264,9 @@ function floatPipelineOutput(mode) { function floatPipeline2DOutput(mode) { const gpu = new GPU({ mode }); const matrix = [ - [1,2,3,4,5], - [6,7,8,9,10], - [11,12,13,14,15], + [1, 2, 3, 4, 5], + [6, 7, 8, 9, 10], + [11, 12, 13, 14, 15], ]; const kernel = gpu.createKernel(function(matrix) { return matrix[this.thread.y][this.thread.x]; @@ -292,14 +304,14 @@ function floatPipeline3DOutput(mode) { const gpu = new GPU({ mode }); const cube = [ [ - [1,2,3,4,5], - [6,7,8,9,10], - [11,12,13,14,15], + [1, 2, 3, 4, 5], + [6, 7, 8, 9, 10], + [11, 12, 13, 14, 15], ], [ - [16,17,18,19,20], - [21,22,23,24,25], - [26,27,28,29,30], + [16, 17, 18, 19, 20], + [21, 22, 23, 24, 25], + [26, 27, 28, 29, 30], ] ]; const kernel = gpu.createKernel(function(cube) { @@ -330,4 +342,4 @@ function floatPipeline3DOutput(mode) { (GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('float pipeline 3d output headlessgl (GPU only)', () => { floatPipeline3DOutput('headlessgl'); -}); +}); \ No newline at end of file diff --git a/test/features/output.js b/test/features/output.js index 17d348e0..1abfad62 100644 --- a/test/features/output.js +++ b/test/features/output.js @@ -5,7 +5,7 @@ describe('features: output'); function outputArray(mode) { const gpu = new GPU({ mode }); - const input = [1,2,3,4,5]; + const input = [1, 2, 3, 4, 5]; const kernel = gpu.createKernel(function(input) { return input[this.thread.x]; }, { output: [5] }); @@ -41,11 +41,11 @@ test('output array cpu', () => { function outputMatrix(mode) { const gpu = new GPU({ mode }); const input = [ - [1,2,3,4,5], - [1,2,3,4,5], - [1,2,3,4,5], - [1,2,3,4,5], - [1,2,3,4,5], + [1, 2, 3, 4, 5], + [1, 2, 3, 4, 5], + [1, 2, 3, 4, 5], + [1, 2, 3, 4, 5], + [1, 2, 3, 4, 5], ]; const kernel = gpu.createKernel(function(input) { return input[this.thread.y][this.thread.x]; @@ -83,39 +83,39 @@ function outputCube(mode) { const gpu = new GPU({ mode }); const input = [ [ - [1,2,3,4,5], - [1,2,3,4,5], - [1,2,3,4,5], - [1,2,3,4,5], - [1,2,3,4,5], + [1, 2, 3, 4, 5], + [1, 2, 3, 4, 5], + [1, 2, 3, 4, 5], + [1, 2, 3, 4, 5], + [1, 2, 3, 4, 5], ], [ - [1,2,3,4,5], - [1,2,3,4,5], - [1,2,3,4,5], - [1,2,3,4,5], - [1,2,3,4,5], + [1, 2, 3, 4, 5], + [1, 2, 3, 4, 5], + [1, 2, 3, 4, 5], + [1, 2, 3, 4, 5], + [1, 2, 3, 4, 5], ], [ - [1,2,3,4,5], - [1,2,3,4,5], - [1,2,3,4,5], - [1,2,3,4,5], - [1,2,3,4,5], + [1, 2, 3, 4, 5], + [1, 2, 3, 4, 5], + [1, 2, 3, 4, 5], + [1, 2, 3, 4, 5], + [1, 2, 3, 4, 5], ], [ - [1,2,3,4,5], - [1,2,3,4,5], - [1,2,3,4,5], - [1,2,3,4,5], - [1,2,3,4,5], + [1, 2, 3, 4, 5], + [1, 2, 3, 4, 5], + [1, 2, 3, 4, 5], + [1, 2, 3, 4, 5], + [1, 2, 3, 4, 5], ], [ - [1,2,3,4,5], - [1,2,3,4,5], - [1,2,3,4,5], - [1,2,3,4,5], - [1,2,3,4,5], + [1, 2, 3, 4, 5], + [1, 2, 3, 4, 5], + [1, 2, 3, 4, 5], + [1, 2, 3, 4, 5], + [1, 2, 3, 4, 5], ] ]; const kernel = gpu.createKernel(function(input) { @@ -198,8 +198,8 @@ test('graphical output array cpu', () => { function outputGraphicalMatrix(mode, canvas, context) { const gpu = new GPU({ mode }); const input = [ - [0.25,.50], - [.75,1], + [0.25, .50], + [.75, 1], ]; const kernel = gpu.createKernel(function(input) { const color = input[this.thread.y][this.thread.x]; @@ -363,7 +363,7 @@ function outputGraphicalCube(mode) { return input[this.thread.x]; }, { canvas: mockCanvas, - output: [5,5,5], + output: [5, 5, 5], graphical: true }); kernel([1]); @@ -393,4 +393,4 @@ test('graphical output array gpu', () => { test('graphical output array cpu', () => { outputGraphicalCube('cpu'); -}); +}); \ No newline at end of file diff --git a/test/features/promise-api.js b/test/features/promise-api.js index f77c6e87..2e9b9249 100644 --- a/test/features/promise-api.js +++ b/test/features/promise-api.js @@ -11,7 +11,7 @@ function promiseApiFunctionReturn(mode, done) { }; const settings = { - output : [1] + output: [1] }; // Setup kernel @@ -21,7 +21,7 @@ function promiseApiFunctionReturn(mode, done) { assert.ok(promiseObj !== null, 'Promise object generated test'); promiseObj .then((res) => { - assert.equal(res[0], 42.0 ); + assert.equal(res[0], 42.0); gpu.destroy(); done(); }) @@ -52,4 +52,4 @@ test('functionReturn gpu', t => { test('functionReturn cpu', t => { promiseApiFunctionReturn('cpu', t.async()); -}); +}); \ No newline at end of file diff --git a/test/features/raw-output.js b/test/features/raw-output.js index 0f73e5f9..002a5ba1 100644 --- a/test/features/raw-output.js +++ b/test/features/raw-output.js @@ -94,4 +94,4 @@ test('raw single precision render output cpu', () => { assert.throws(() => { rawSinglePrecisionRenderOutput('cpu'); }); -}); +}); \ No newline at end of file diff --git a/test/features/read-color-texture.js b/test/features/read-color-texture.js index 40453319..ebe7777e 100644 --- a/test/features/read-color-texture.js +++ b/test/features/read-color-texture.js @@ -6,56 +6,56 @@ describe('features: read color texture'); function colorSyntaxTest(mode) { const gpu = new GPU({ mode }); const createTexture = gpu.createKernel( - function(value) { - this.color( - value[this.thread.y][this.thread.x], - value[this.thread.y][this.thread.x], - value[this.thread.y][this.thread.x], - value[this.thread.y][this.thread.x] - ); - } - ) + function(value) { + this.color( + value[this.thread.y][this.thread.x], + value[this.thread.y][this.thread.x], + value[this.thread.y][this.thread.x], + value[this.thread.y][this.thread.x] + ); + } + ) .setOutput([4, 4]) .setGraphical(true) .setPipeline(true); const readRTexture = gpu.createKernel( - function(texture) { - const pixel = texture[this.thread.y][this.thread.x]; - return pixel.r; - } - ) + function(texture) { + const pixel = texture[this.thread.y][this.thread.x]; + return pixel.r; + } + ) .setOutput([4, 4]); const readGTexture = gpu.createKernel( - function(texture) { - const pixel = texture[this.thread.y][this.thread.x]; - return pixel.g; - } - ) + function(texture) { + const pixel = texture[this.thread.y][this.thread.x]; + return pixel.g; + } + ) .setOutput([4, 4]); const readBTexture = gpu.createKernel( - function(texture) { - const pixel = texture[this.thread.y][this.thread.x]; - return pixel.b; - } - ) + function(texture) { + const pixel = texture[this.thread.y][this.thread.x]; + return pixel.b; + } + ) .setOutput([4, 4]); const readATexture = gpu.createKernel( - function(texture) { - const pixel = texture[this.thread.y][this.thread.x]; - return pixel.a; - } - ) + function(texture) { + const pixel = texture[this.thread.y][this.thread.x]; + return pixel.a; + } + ) .setOutput([4, 4]); const texture = createTexture([ - [.01,.02,.03,.04], - [.05,.06,.07,.08], - [.09,.10,.11,.12], - [.13,.14,.15,.16] + [.01, .02, .03, .04], + [.05, .06, .07, .08], + [.09, .10, .11, .12], + [.13, .14, .15, .16] ]); const resultR = readRTexture(texture); const resultG = readGTexture(texture); @@ -174,4 +174,4 @@ test('colorSyntaxTest (cpu) throws', () => { assert.throws(() => { colorSyntaxTest('cpu'); }); -}); +}); \ No newline at end of file diff --git a/test/features/read-from-texture.js b/test/features/read-from-texture.js index e5e007ae..dbe06e8d 100644 --- a/test/features/read-from-texture.js +++ b/test/features/read-from-texture.js @@ -11,10 +11,10 @@ function readWithoutTextureKernels(mode) { } const kernels = gpu.createKernelMap({ - addResult: add - }, function (a, b) { - return add(a[this.thread.x], b[this.thread.x]); - }) + addResult: add + }, function(a, b) { + return add(a[this.thread.x], b[this.thread.x]); + }) .setOutput([5]); const result = kernels([1, 2, 3, 4, 5], [1, 2, 3, 4, 5]); const nonTextureResult = result.addResult; @@ -45,14 +45,15 @@ function readWithoutTextureKernels(mode) { function readFromTextureKernels(mode) { const gpu = new GPU({ mode }); + function add(m, n) { return m + n; } const kernels = gpu.createKernelMap({ - addResult: add - }, function (a, b) { - return add(a[this.thread.x], b[this.thread.x]); - }) + addResult: add + }, function(a, b) { + return add(a[this.thread.x], b[this.thread.x]); + }) .setPipeline(true) .setOutput([5]); const result = kernels([1, 2, 3, 4, 5], [1, 2, 3, 4, 5]); @@ -80,4 +81,4 @@ function readFromTextureKernels(mode) { (GPU.isHeadlessGLSupported && HeadlessGLKernel.features.kernelMap ? test : skip)('Read from Texture headlessgl', () => { readFromTextureKernels('headlessgl'); -}); +}); \ No newline at end of file diff --git a/test/features/read-image-bitmap.js b/test/features/read-image-bitmap.js index 41205414..78c038f1 100644 --- a/test/features/read-image-bitmap.js +++ b/test/features/read-image-bitmap.js @@ -46,4 +46,4 @@ function readImageBitmap(mode, done) { (typeof Image !== 'undefined' ? test : skip)('readImageBitmap cpu', (assert) => { readImageBitmap('cpu', assert.async()); -}); +}); \ No newline at end of file diff --git a/test/features/read-image-data.js b/test/features/read-image-data.js index 726bf8c2..633a8e51 100644 --- a/test/features/read-image-data.js +++ b/test/features/read-image-data.js @@ -41,4 +41,4 @@ function readImageData(mode) { (typeof ImageData !== 'undefined' ? test : skip)('readImageData cpu', () => { readImageData('cpu'); -}); +}); \ No newline at end of file diff --git a/test/features/read-offscreen-canvas.js b/test/features/read-offscreen-canvas.js index 91b2db39..54563c6a 100644 --- a/test/features/read-offscreen-canvas.js +++ b/test/features/read-offscreen-canvas.js @@ -1,7 +1,7 @@ if (typeof importScripts !== 'undefined') { // inside Worker importScripts('../../dist/gpu-browser.js'); - onmessage = function (e) { + onmessage = function(e) { const gpu = new GPU({ mode: e.data }); const kernel1 = gpu.createKernel(function() { this.color(1, 1, 1, 1); @@ -26,7 +26,7 @@ if (typeof importScripts !== 'undefined') { function testReadOffscreenCanvas(mode, done) { const worker = new Worker('features/read-offscreen-canvas.js'); - worker.onmessage = function (e) { + worker.onmessage = function(e) { const { result } = e.data; if (mode) assert.equal(e.data.mode, mode, 'GPU mode used in Worker'); assert.deepEqual(result, Float32Array.from([4])); @@ -54,4 +54,4 @@ if (typeof importScripts !== 'undefined') { (GPU.isOffscreenCanvasSupported ? test : skip)('read offscreen canvas cpu', t => { testReadOffscreenCanvas('cpu', t.async()); }); -} +} \ No newline at end of file diff --git a/test/features/return-arrays.js b/test/features/return-arrays.js index a6faa7bc..6898caf8 100644 --- a/test/features/return-arrays.js +++ b/test/features/return-arrays.js @@ -9,7 +9,9 @@ function returnArray2FromKernel(mode) { return [1, 2]; }, { output: [1], precision: 'single' }); const result = kernel(); - assert.deepEqual(result.map(v => Array.from(v)), [[1, 2]]); + assert.deepEqual(result.map(v => Array.from(v)), [ + [1, 2] + ]); gpu.destroy(); } @@ -41,12 +43,12 @@ function returnArray2D2FromKernel(mode) { const gpu = new GPU({ mode }); const kernel = gpu.createKernel(function() { return [this.thread.x, this.thread.y]; - }, { output : [3, 7], precision: 'single' }); + }, { output: [3, 7], precision: 'single' }); const res = kernel(); for (let y = 0; y < 7; ++y) { for (let x = 0; x < 3; ++x) { - assert.equal(res[y][x][0], x); - assert.equal(res[y][x][1], y); + assert.equal(res[y][x][0], x); + assert.equal(res[y][x][1], y); } } gpu.destroy(); @@ -78,9 +80,9 @@ test('return Array2D(2) from kernel cpu', () => { function returnArray3D2FromKernel(mode) { const gpu = new GPU({ mode }); -const kernel = gpu.createKernel(function() { + const kernel = gpu.createKernel(function() { return [this.thread.y, this.thread.z]; - }, { output : [3, 5, 7], precision: 'single' }); + }, { output: [3, 5, 7], precision: 'single' }); const res = kernel(); for (let z = 0; z < 7; ++z) { for (let y = 0; y < 5; ++y) { @@ -124,7 +126,9 @@ function returnArray3FromKernel(mode) { return [1, 2, 3]; }, { output: [1], precision: 'single' }); const result = kernel(); - assert.deepEqual(Array.from(result.map(v => Array.from(v))), [[1, 2, 3]]); + assert.deepEqual(Array.from(result.map(v => Array.from(v))), [ + [1, 2, 3] + ]); gpu.destroy(); } @@ -156,13 +160,13 @@ function returnArray2D3FromKernel(mode) { const gpu = new GPU({ mode }); const kernel = gpu.createKernel(function() { return [this.thread.x, this.thread.y, this.thread.x * this.thread.y]; - }, { output : [3, 7] ,precision: 'single' }); + }, { output: [3, 7], precision: 'single' }); const res = kernel(); for (let y = 0; y < 7; ++y) { for (let x = 0; x < 3; ++x) { - assert.equal(res[y][x][0], x); - assert.equal(res[y][x][1], y); - assert.equal(res[y][x][2], x * y); + assert.equal(res[y][x][0], x); + assert.equal(res[y][x][1], y); + assert.equal(res[y][x][2], x * y); } } gpu.destroy(); @@ -196,7 +200,7 @@ function returnArray3D3FromKernel(mode) { const gpu = new GPU({ mode }); const kernel = gpu.createKernel(function() { return [this.thread.x, this.thread.y, this.thread.z]; - }, { output : [3, 5, 7] ,precision: 'single' }); + }, { output: [3, 5, 7], precision: 'single' }); const res = kernel(); for (let z = 0; z < 7; ++z) { for (let y = 0; y < 5; ++y) { @@ -240,7 +244,9 @@ function returnArray4FromKernel(mode) { return [1, 2, 3, 4]; }, { output: [1], precision: 'single' }); const result = kernel(); - assert.deepEqual(result.map(v => Array.from(v)), [[1, 2, 3, 4]]); + assert.deepEqual(result.map(v => Array.from(v)), [ + [1, 2, 3, 4] + ]); gpu.destroy(); } @@ -272,14 +278,14 @@ function returnArray2D4FromKernel(mode) { const gpu = new GPU({ mode }); const kernel = gpu.createKernel(function() { return [this.thread.x, this.thread.y, this.thread.x * this.thread.y, this.thread.x - this.thread.y]; - }, { output : [3, 7], precision: 'single' }); + }, { output: [3, 7], precision: 'single' }); const res = kernel(); for (let y = 0; y < 3; ++y) { for (let x = 0; x < 3; ++x) { - assert.equal(res[y][x][0], x); - assert.equal(res[y][x][1], y); - assert.equal(res[y][x][2], x * y); - assert.equal(res[y][x][3], x - y); + assert.equal(res[y][x][0], x); + assert.equal(res[y][x][1], y); + assert.equal(res[y][x][2], x * y); + assert.equal(res[y][x][3], x - y); } } gpu.destroy(); @@ -313,7 +319,7 @@ function returnArray3D4FromKernel(mode) { const gpu = new GPU({ mode }); const kernel = gpu.createKernel(function() { return [this.thread.x, this.thread.y, this.thread.z, this.thread.x * this.thread.y * this.thread.z]; - }, { output : [3, 5, 7], precision: 'single' }); + }, { output: [3, 5, 7], precision: 'single' }); const res = kernel(); for (let z = 0; z < 7; ++z) { for (let y = 0; y < 5; ++y) { @@ -354,9 +360,10 @@ test('return Array3D(4) from kernel cpu', () => { function returnArray2FromKernelVariables33Length(mode) { const array = [ - 1,2,3,4, 5,6,7,8, 9,10,11,12, 13,14,15,16, - 17,18,19,20, 21,22,23, 24,25,26,27, 28,29,30,31, - 32,33]; + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33 + ]; const sixteen = new Uint16Array(array); const eight = new Uint8Array(array); const gpu = new GPU({ mode }); @@ -364,7 +371,7 @@ function returnArray2FromKernelVariables33Length(mode) { return [v1[this.thread.x], v2[this.thread.x]]; }, { output: [33] }); const result = kernel(sixteen, eight); - assert.deepEqual(result.map(v => Array.from(v)), array.map(v => [v,v])); + assert.deepEqual(result.map(v => Array.from(v)), array.map(v => [v, v])); gpu.destroy(); } @@ -394,7 +401,7 @@ test('return Array(2) from kernel variables 33 in length cpu', () => { function returnArray3FromKernelVariables33Length(mode) { - const array = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33]; + const array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33]; const thirtyTwo = new Float32Array(array); const sixteen = new Uint16Array(array); const eight = new Uint8Array(array); @@ -403,7 +410,7 @@ function returnArray3FromKernelVariables33Length(mode) { return [v1[this.thread.x], v2[this.thread.x], v3[this.thread.x]]; }, { output: [33] }); const result = kernel(thirtyTwo, sixteen, eight); - assert.deepEqual(result.map(v => Array.from(v)), array.map(v => [v,v,v])); + assert.deepEqual(result.map(v => Array.from(v)), array.map(v => [v, v, v])); gpu.destroy(); } @@ -433,7 +440,7 @@ test('return Array(3) from kernel variables 33 in length cpu', () => { function returnArray4FromKernelVariables33Length(mode) { - const array = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33]; + const array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33]; const thirtyTwo = new Float32Array(array); const sixteen = new Uint16Array(array); const eight = new Uint8Array(array); @@ -442,7 +449,7 @@ function returnArray4FromKernelVariables33Length(mode) { return [v1[this.thread.x], v2[this.thread.x], v3[this.thread.x], v4[this.thread.x]]; }, { output: [33] }); const result = kernel(array, thirtyTwo, sixteen, eight); - assert.deepEqual(result.map(v => Array.from(v)), array.map(v => [v,v,v,v])); + assert.deepEqual(result.map(v => Array.from(v)), array.map(v => [v, v, v, v])); gpu.destroy(); } @@ -468,4 +475,4 @@ function returnArray4FromKernelVariables33Length(mode) { test('return Array(4) from kernel variables 33 in length cpu', () => { returnArray4FromKernelVariables33Length('cpu'); -}); +}); \ No newline at end of file diff --git a/test/features/single-precision-textures.js b/test/features/single-precision-textures.js index 7e2624ce..fda2ec70 100644 --- a/test/features/single-precision-textures.js +++ b/test/features/single-precision-textures.js @@ -689,5 +689,4 @@ function testImmutableDoesNotCollideWithKernelTexture(mode) { (GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('immutable does not collide with kernel texture headlessgl', () => { testImmutableDoesNotCollideWithKernelTexture('headlessgl'); -}); - +}); \ No newline at end of file diff --git a/test/features/single-precision.js b/test/features/single-precision.js index 74c11c1b..eed5317f 100644 --- a/test/features/single-precision.js +++ b/test/features/single-precision.js @@ -2,6 +2,7 @@ const { assert, skip, test, module: describe } = require('qunit'); const { GPU } = require('../../src'); describe('features: single precision'); + function singlePrecisionKernel(mode) { const lst = new Float32Array([1, 2, 3, 4, 5, 6, 7, 8]); const gpu = new GPU({ mode }); @@ -37,4 +38,4 @@ test("cpu", () => { (GPU.isHeadlessGLSupported ? test : skip)("headlessgl", () => { singlePrecisionKernel('headlessgl'); -}); +}); \ No newline at end of file diff --git a/test/features/switches.js b/test/features/switches.js index d8b3d2b4..655d25e1 100644 --- a/test/features/switches.js +++ b/test/features/switches.js @@ -7,9 +7,12 @@ function testBasic(mode) { const gpu = new GPU({ mode }); const kernel = gpu.createKernel(function(value) { switch (value) { - case 1: return 1; - case 2: return 2; - case 3: return 3; + case 1: + return 1; + case 2: + return 2; + case 3: + return 3; } return 0; }, { @@ -52,7 +55,8 @@ function testOnlyDefault(mode) { const gpu = new GPU({ mode }); const kernel = gpu.createKernel(function(value) { switch (value) { - default: return 3; + default: + return 3; } }, { argumentTypes: ['Integer'], @@ -93,9 +97,12 @@ function testDefault(mode) { const gpu = new GPU({ mode }); const kernel = gpu.createKernel(function(value) { switch (value) { - case 1: return 1; - case 2: return 2; - default: return 3; + case 1: + return 1; + case 2: + return 2; + default: + return 3; } }, { argumentTypes: ['Integer'], @@ -137,9 +144,12 @@ function testEarlyDefault(mode) { const gpu = new GPU({ mode }); const kernel = gpu.createKernel(function(value) { switch (value) { - default: return 3; - case 1: return 1; - case 2: return 2; + default: + return 3; + case 1: + return 1; + case 2: + return 2; } }, { argumentTypes: ['Integer'], @@ -184,7 +194,8 @@ function testFallThrough(mode) { case 1: case 2: return 1; - default: return 3; + default: + return 3; } }, { argumentTypes: ['Integer'], @@ -219,4 +230,4 @@ test('fall through gpu', () => { test('fall through cpu', () => { testFallThrough('cpu'); -}); +}); \ No newline at end of file diff --git a/test/features/tactic.js b/test/features/tactic.js index 01abb8ce..60f3695e 100644 --- a/test/features/tactic.js +++ b/test/features/tactic.js @@ -6,8 +6,8 @@ describe('internal: tactic'); function speedTest(mode) { const gpu = new GPU({ mode }); const add = gpu.createKernel(function(a, b) { - return a + b; - }) + return a + b; + }) .setOutput([1]) .setTactic('speed'); let addResult = add(0.1, 0.2)[0]; @@ -42,8 +42,8 @@ test('speed cpu', () => { function balancedTest(mode) { const gpu = new GPU({ mode }); const add = gpu.createKernel(function(a, b) { - return a + b; - }) + return a + b; + }) .setOutput([1]) .setTactic('balanced'); let addResult = add(0.1, 0.2)[0]; @@ -78,8 +78,8 @@ test('balanced cpu', () => { function precisionTest(mode) { const gpu = new GPU({ mode }); const add = gpu.createKernel(function(a, b) { - return a + b; - }) + return a + b; + }) .setOutput([1]) .setTactic('precision'); let addResult = add(0.1, 0.2)[0]; @@ -109,4 +109,4 @@ test('precision gpu', () => { test('precision cpu', () => { precisionTest('cpu'); -}); +}); \ No newline at end of file diff --git a/test/features/ternary.js b/test/features/ternary.js index b0caeaba..a1d7473b 100644 --- a/test/features/ternary.js +++ b/test/features/ternary.js @@ -5,6 +5,7 @@ describe('feature: Ternary'); function ternaryTest(mode) { const gpu = new GPU({ mode }); + function ternaryFunction(value) { return (value > 1 ? 1 : 0); } @@ -75,4 +76,4 @@ test('with variable usage gpu', () => { test('with variable usage cpu', () => { ternaryWithVariableUsage('cpu'); -}); +}); \ No newline at end of file diff --git a/test/features/type-management.js b/test/features/type-management.js index 559c8cbe..f108827c 100644 --- a/test/features/type-management.js +++ b/test/features/type-management.js @@ -529,12 +529,12 @@ test('arrays inherited - Array(4) webgl2', () => { array3[1] = array[1] * array2[1]; return array3; }).toString(), { argumentTypes: ['Array(4)', 'Array(4)'], returnType: 'Array(4)', output: [1] }); - assert.equal(node.toString(), 'vec4 inherited(vec4 user_array, vec4 user_array2) {' - + '\nvec4 user_array3=vec4(0.0, 0.0, 0.0, 0.0);' - + '\nuser_array3[0]=user_array[0];' - + '\nuser_array3[1]=(user_array[1]*user_array2[1]);' - + '\nreturn user_array3;' - + '\n}'); + assert.equal(node.toString(), 'vec4 inherited(vec4 user_array, vec4 user_array2) {' + + '\nvec4 user_array3=vec4(0.0, 0.0, 0.0, 0.0);' + + '\nuser_array3[0]=user_array[0];' + + '\nuser_array3[1]=(user_array[1]*user_array2[1]);' + + '\nreturn user_array3;' + + '\n}'); }); test('arrays inherited - Array(4) cpu', () => { const node = new CPUFunctionNode((function inherited(array, array2) { @@ -568,24 +568,36 @@ test('auto detect float, array, array2d, array3d - webgl', () => { returnType: 'Number', output: [1], argumentTypes: ['Integer', 'Array', 'Array2D', 'Array3D'], - constants: { float: 1, int: 1, array: [1], array2d: [[1]], array3d: [[[1]]] }, + constants: { + float: 1, + int: 1, + array: [1], + array2d: [ + [1] + ], + array3d: [ + [ + [1] + ] + ] + }, constantTypes: { float: 'Float', int: 'Integer', array: 'Array', array2d: 'Array2D', array3d: 'Array3D' }, constantBitRatios: { float: 0, int: 0, array: 4, array2d: 4, array3d: 4 }, lookupFunctionArgumentBitRatio: () => 4, }); - assert.equal(node.toString(), 'float advancedUsed(int user_int, sampler2D user_array,ivec2 user_arraySize,ivec3 user_arrayDim, sampler2D user_array2d,ivec2 user_array2dSize,ivec3 user_array2dDim, sampler2D user_array3d,ivec2 user_array3dSize,ivec3 user_array3dDim) {' - + '\nfloat user_allValues=constants_float;' - + '\nuser_allValues+=float(constants_int);' - + '\nuser_allValues+=get32(constants_array, constants_arraySize, constants_arrayDim, 0, 0, threadId.x);' - + '\nuser_allValues+=get32(constants_array2d, constants_array2dSize, constants_array2dDim, 0, threadId.x, threadId.y);' - + '\nuser_allValues+=get32(constants_array3d, constants_array3dSize, constants_array3dDim, threadId.x, threadId.y, threadId.z);' - + '\nuser_allValues+=float(user_int);' - + '\nuser_allValues+=get32(user_array, user_arraySize, user_arrayDim, 0, 0, threadId.x);' - + '\nuser_allValues+=get32(user_array2d, user_array2dSize, user_array2dDim, 0, threadId.x, threadId.y);' - + '\nuser_allValues+=get32(user_array3d, user_array3dSize, user_array3dDim, threadId.x, threadId.y, threadId.z);' - + '\nreturn (user_allValues*random());' - + '\n}'); + assert.equal(node.toString(), 'float advancedUsed(int user_int, sampler2D user_array,ivec2 user_arraySize,ivec3 user_arrayDim, sampler2D user_array2d,ivec2 user_array2dSize,ivec3 user_array2dDim, sampler2D user_array3d,ivec2 user_array3dSize,ivec3 user_array3dDim) {' + + '\nfloat user_allValues=constants_float;' + + '\nuser_allValues+=float(constants_int);' + + '\nuser_allValues+=get32(constants_array, constants_arraySize, constants_arrayDim, 0, 0, threadId.x);' + + '\nuser_allValues+=get32(constants_array2d, constants_array2dSize, constants_array2dDim, 0, threadId.x, threadId.y);' + + '\nuser_allValues+=get32(constants_array3d, constants_array3dSize, constants_array3dDim, threadId.x, threadId.y, threadId.z);' + + '\nuser_allValues+=float(user_int);' + + '\nuser_allValues+=get32(user_array, user_arraySize, user_arrayDim, 0, 0, threadId.x);' + + '\nuser_allValues+=get32(user_array2d, user_array2dSize, user_array2dDim, 0, threadId.x, threadId.y);' + + '\nuser_allValues+=get32(user_array3d, user_array3dSize, user_array3dDim, threadId.x, threadId.y, threadId.z);' + + '\nreturn (user_allValues*random());' + + '\n}'); }); @@ -646,4 +658,4 @@ test('not defined gpu', () => { test('not defined cpu', () => { notDefined('cpu'); -}); +}); \ No newline at end of file diff --git a/test/features/unsigned-precision-textures.js b/test/features/unsigned-precision-textures.js index d873d288..eb384b5f 100644 --- a/test/features/unsigned-precision-textures.js +++ b/test/features/unsigned-precision-textures.js @@ -688,4 +688,4 @@ test('immutable does not collide with kernel texture gpu', () => { (GPU.isHeadlessGLSupported ? test : skip)('immutable does not collide with kernel texture headlessgl', () => { testImmutableDoesNotCollideWithKernelTexture('headlessgl'); -}); +}); \ No newline at end of file diff --git a/test/features/video.js b/test/features/video.js index d6474861..63743a4e 100644 --- a/test/features/video.js +++ b/test/features/video.js @@ -2,12 +2,13 @@ const { assert, skip, test, module: describe } = require('qunit'); const { GPU } = require('../../src'); describe('video'); + function videoArgumentTest(mode, done) { const video = document.createElement('video'); video.src = 'jellyfish.webm'; setTimeout(() => { - const gpu = new GPU({mode}); - const videoKernel = gpu.createKernel(function (a) { + const gpu = new GPU({ mode }); + const videoKernel = gpu.createKernel(function(a) { const pixel = a[this.thread.y][this.thread.x]; return pixel.g * 255; }, { @@ -42,4 +43,4 @@ function videoArgumentTest(mode, done) { (typeof HTMLVideoElement !== 'undefined' ? test : skip)('video argument cpu', t => { videoArgumentTest('cpu', t.async()); -}); +}); \ No newline at end of file diff --git a/test/internal/argument-texture-switching.js b/test/internal/argument-texture-switching.js index eb5a1f8b..e222c9cb 100644 --- a/test/internal/argument-texture-switching.js +++ b/test/internal/argument-texture-switching.js @@ -7,14 +7,14 @@ function testArrayWithoutTypeDefined(mode) { const gpu = new GPU({ mode }); const texture = ( gpu.createKernel(function() { return this.thread.x; }) - .setOutput([10]) - .setPipeline(true) - .setPrecision('single') + .setOutput([10]) + .setPipeline(true) + .setPrecision('single') )(); const expected = texture.toArray(); const kernel = gpu.createKernel(function(value) { - return value[this.thread.x]; - }) + return value[this.thread.x]; + }) .setOutput([10]) .setPipeline(false) .setPrecision('single'); @@ -50,14 +50,14 @@ function testArrayWithTypeDefined(mode) { const gpu = new GPU({ mode }); const texture = ( gpu.createKernel(function() { return this.thread.x; }) - .setOutput([10]) - .setPipeline(true) - .setPrecision('single') + .setOutput([10]) + .setPipeline(true) + .setPrecision('single') )(); const expected = texture.toArray(); const kernel = gpu.createKernel(function(value) { - return value[this.thread.x]; - }) + return value[this.thread.x]; + }) .setArgumentTypes({ value: 'Array' }) @@ -96,14 +96,14 @@ function testArray1D2(mode) { const gpu = new GPU({ mode }); const texture = ( gpu.createKernel(function() { return [this.thread.x, this.thread.x + 1]; }) - .setOutput([10]) - .setPipeline(true) - .setPrecision('single') + .setOutput([10]) + .setPipeline(true) + .setPrecision('single') )(); const expected = texture.toArray(); const kernel = gpu.createKernel(function(value) { - return value[this.thread.x]; - }) + return value[this.thread.x]; + }) .setArgumentTypes({ value: 'Array1D(2)' }) @@ -142,14 +142,14 @@ function testArray1D3(mode) { const gpu = new GPU({ mode }); const texture = ( gpu.createKernel(function() { return [this.thread.x, this.thread.x + 1, this.thread.x + 2]; }) - .setOutput([10]) - .setPipeline(true) - .setPrecision('single') + .setOutput([10]) + .setPipeline(true) + .setPrecision('single') )(); const expected = texture.toArray(); const kernel = gpu.createKernel(function(value) { - return value[this.thread.x]; - }) + return value[this.thread.x]; + }) .setArgumentTypes({ value: 'Array1D(3)' }) @@ -188,14 +188,14 @@ function testArray1D4(mode) { const gpu = new GPU({ mode }); const texture = ( gpu.createKernel(function() { return [this.thread.x, this.thread.x + 1, this.thread.x + 2, this.thread.x + 3]; }) - .setOutput([10]) - .setPipeline(true) - .setPrecision('single') + .setOutput([10]) + .setPipeline(true) + .setPrecision('single') )(); const expected = texture.toArray(); const kernel = gpu.createKernel(function(value) { - return value[this.thread.x]; - }) + return value[this.thread.x]; + }) .setArgumentTypes({ value: 'Array1D(4)' }) @@ -234,14 +234,14 @@ function testArray2D2(mode) { const gpu = new GPU({ mode }); const texture = ( gpu.createKernel(function() { return [this.thread.x, this.thread.y]; }) - .setOutput([10, 10]) - .setPipeline(true) - .setPrecision('single') + .setOutput([10, 10]) + .setPipeline(true) + .setPrecision('single') )(); const expected = texture.toArray(); const kernel = gpu.createKernel(function(value) { - return value[this.thread.y][this.thread.x]; - }) + return value[this.thread.y][this.thread.x]; + }) .setArgumentTypes({ value: 'Array2D(2)' }) @@ -280,14 +280,14 @@ function testArray2D3(mode) { const gpu = new GPU({ mode }); const texture = ( gpu.createKernel(function() { return [this.thread.x, this.thread.y, this.thread.x * this.thread.y]; }) - .setOutput([10, 10]) - .setPipeline(true) - .setPrecision('single') + .setOutput([10, 10]) + .setPipeline(true) + .setPrecision('single') )(); const expected = texture.toArray(); const kernel = gpu.createKernel(function(value) { - return value[this.thread.y][this.thread.x]; - }) + return value[this.thread.y][this.thread.x]; + }) .setArgumentTypes({ value: 'Array2D(3)' }) @@ -333,14 +333,14 @@ function testArray2D4(mode) { this.thread.x / this.thread.y ]; }) - .setOutput([10, 10]) - .setPipeline(true) - .setPrecision('single') + .setOutput([10, 10]) + .setPipeline(true) + .setPrecision('single') )(); const expected = texture.toArray(); const kernel = gpu.createKernel(function(value) { - return value[this.thread.y][this.thread.x]; - }) + return value[this.thread.y][this.thread.x]; + }) .setArgumentTypes({ value: 'Array2D(4)' }) @@ -379,14 +379,14 @@ function testArray3D2(mode) { const gpu = new GPU({ mode }); const texture = ( gpu.createKernel(function() { return [this.thread.x, this.thread.x * this.thread.y * this.thread.z]; }) - .setOutput([10, 10, 10]) - .setPipeline(true) - .setPrecision('single') + .setOutput([10, 10, 10]) + .setPipeline(true) + .setPrecision('single') )(); const expected = texture.toArray(); const kernel = gpu.createKernel(function(value) { - return value[this.thread.z][this.thread.y][this.thread.x]; - }) + return value[this.thread.z][this.thread.y][this.thread.x]; + }) .setArgumentTypes({ value: 'Array3D(2)' }) @@ -425,14 +425,14 @@ function testArray3D3(mode) { const gpu = new GPU({ mode }); const texture = ( gpu.createKernel(function() { return [this.thread.x, this.thread.y, this.thread.z]; }) - .setOutput([10, 10, 10]) - .setPipeline(true) - .setPrecision('single') + .setOutput([10, 10, 10]) + .setPipeline(true) + .setPrecision('single') )(); const expected = texture.toArray(); const kernel = gpu.createKernel(function(value) { - return value[this.thread.z][this.thread.y][this.thread.x]; - }) + return value[this.thread.z][this.thread.y][this.thread.x]; + }) .setArgumentTypes({ value: 'Array3D(3)' }) @@ -478,14 +478,14 @@ function testArray3D4(mode) { this.thread.x * this.thread.y * this.thread.z ]; }) - .setOutput([10, 10, 10]) - .setPipeline(true) - .setPrecision('single') + .setOutput([10, 10, 10]) + .setPipeline(true) + .setPrecision('single') )(); const expected = texture.toArray(); const kernel = gpu.createKernel(function(value) { - return value[this.thread.z][this.thread.y][this.thread.x]; - }) + return value[this.thread.z][this.thread.y][this.thread.x]; + }) .setArgumentTypes({ value: 'Array3D(4)' }) @@ -518,4 +518,4 @@ function testArray3D4(mode) { (GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('Array3D(4) (GPU only) headlessgl', () => { testArray3D4('headlessgl'); -}); +}); \ No newline at end of file diff --git a/test/internal/boolean.js b/test/internal/boolean.js index abb2a9df..84c8647f 100644 --- a/test/internal/boolean.js +++ b/test/internal/boolean.js @@ -283,4 +283,4 @@ test('boolean expression false gpu', () => { test('boolean expression false cpu', () => { booleanExpressionFalse('cpu'); -}); +}); \ No newline at end of file diff --git a/test/internal/casting.js b/test/internal/casting.js index 89635afb..9567e9fa 100644 --- a/test/internal/casting.js +++ b/test/internal/casting.js @@ -5,7 +5,7 @@ describe('internal: casting'); function castingOffsetByThreadXAndOutputX(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function (value) { + const kernel = gpu.createKernel(function(value) { // value will be a number // this.thread.x is an integer // this.output.x is treated as a literal, so can be either integer or float @@ -120,6 +120,7 @@ function handleCastingMixedWithNativeFunctions(mode) { function handleCastingFloat(mode) { const gpu = new GPU({ mode }); + function add(value1, value2) { return value1 + value2; } @@ -153,6 +154,7 @@ function handleCastingFloat(mode) { function handleCastingBeforeReturn(mode) { const gpu = new GPU({ mode }); + function addOne(v) { return v + v; } @@ -177,4 +179,4 @@ function handleCastingBeforeReturn(mode) { (GPU.isHeadlessGLSupported ? test : skip)('handle casting before return headlessgl', () => { handleCastingBeforeReturn('headlessgl'); -}); +}); \ No newline at end of file diff --git a/test/internal/constants-texture-switching.js b/test/internal/constants-texture-switching.js index d00951bc..b05e3aff 100644 --- a/test/internal/constants-texture-switching.js +++ b/test/internal/constants-texture-switching.js @@ -7,14 +7,14 @@ function testArray1D2(mode) { const gpu = new GPU({ mode }); const texture = ( gpu.createKernel(function() { return [this.thread.x, this.thread.x + 1]; }) - .setOutput([10]) - .setPipeline(true) - .setPrecision('single') + .setOutput([10]) + .setPipeline(true) + .setPrecision('single') )(); const expected = texture.toArray(); const kernel = gpu.createKernel(function() { - return this.constants.value[this.thread.x]; - }) + return this.constants.value[this.thread.x]; + }) .setConstants({ value: texture }) @@ -55,14 +55,14 @@ function testArray1D3(mode) { const gpu = new GPU({ mode }); const texture = ( gpu.createKernel(function() { return [this.thread.x, this.thread.x + 1, this.thread.x + 2]; }) - .setOutput([10]) - .setPipeline(true) - .setPrecision('single') + .setOutput([10]) + .setPipeline(true) + .setPrecision('single') )(); const expected = texture.toArray(); const kernel = gpu.createKernel(function() { - return this.constants.value[this.thread.x]; - }) + return this.constants.value[this.thread.x]; + }) .setConstants({ value: texture }) @@ -103,14 +103,14 @@ function testArray1D4(mode) { const gpu = new GPU({ mode }); const texture = ( gpu.createKernel(function() { return [this.thread.x, this.thread.x + 1, this.thread.x + 2, this.thread.x + 3]; }) - .setOutput([10]) - .setPipeline(true) - .setPrecision('single') + .setOutput([10]) + .setPipeline(true) + .setPrecision('single') )(); const expected = texture.toArray(); const kernel = gpu.createKernel(function() { - return this.constants.value[this.thread.x]; - }) + return this.constants.value[this.thread.x]; + }) .setConstants({ value: texture }) @@ -151,14 +151,14 @@ function testArray2D2(mode) { const gpu = new GPU({ mode }); const texture = ( gpu.createKernel(function() { return [this.thread.x, this.thread.y]; }) - .setOutput([10, 10]) - .setPipeline(true) - .setPrecision('single') + .setOutput([10, 10]) + .setPipeline(true) + .setPrecision('single') )(); const expected = texture.toArray(); const kernel = gpu.createKernel(function() { - return this.constants.value[this.thread.y][this.thread.x]; - }) + return this.constants.value[this.thread.y][this.thread.x]; + }) .setConstants({ value: texture }) @@ -199,14 +199,14 @@ function testArray2D3(mode) { const gpu = new GPU({ mode }); const texture = ( gpu.createKernel(function() { return [this.thread.x, this.thread.y, this.thread.x * this.thread.y]; }) - .setOutput([10, 10]) - .setPipeline(true) - .setPrecision('single') + .setOutput([10, 10]) + .setPipeline(true) + .setPrecision('single') )(); const expected = texture.toArray(); const kernel = gpu.createKernel(function() { - return this.constants.value[this.thread.y][this.thread.x]; - }) + return this.constants.value[this.thread.y][this.thread.x]; + }) .setConstants({ value: texture }) @@ -254,14 +254,14 @@ function testArray2D4(mode) { this.thread.x / this.thread.y ]; }) - .setOutput([10, 10]) - .setPipeline(true) - .setPrecision('single') + .setOutput([10, 10]) + .setPipeline(true) + .setPrecision('single') )(); const expected = texture.toArray(); const kernel = gpu.createKernel(function() { - return this.constants.value[this.thread.y][this.thread.x]; - }) + return this.constants.value[this.thread.y][this.thread.x]; + }) .setConstants({ value: texture }) @@ -302,14 +302,14 @@ function testArray3D2(mode) { const gpu = new GPU({ mode }); const texture = ( gpu.createKernel(function() { return [this.thread.x, this.thread.x * this.thread.y * this.thread.z]; }) - .setOutput([10, 10, 10]) - .setPipeline(true) - .setPrecision('single') + .setOutput([10, 10, 10]) + .setPipeline(true) + .setPrecision('single') )(); const expected = texture.toArray(); const kernel = gpu.createKernel(function() { - return this.constants.value[this.thread.z][this.thread.y][this.thread.x]; - }) + return this.constants.value[this.thread.z][this.thread.y][this.thread.x]; + }) .setConstants({ value: texture }) @@ -350,14 +350,14 @@ function testArray3D3(mode) { const gpu = new GPU({ mode }); const texture = ( gpu.createKernel(function() { return [this.thread.x, this.thread.y, this.thread.z]; }) - .setOutput([10, 10, 10]) - .setPipeline(true) - .setPrecision('single') + .setOutput([10, 10, 10]) + .setPipeline(true) + .setPrecision('single') )(); const expected = texture.toArray(); const kernel = gpu.createKernel(function() { - return this.constants.value[this.thread.z][this.thread.y][this.thread.x]; - }) + return this.constants.value[this.thread.z][this.thread.y][this.thread.x]; + }) .setConstants({ value: texture }) @@ -405,14 +405,14 @@ function testArray3D4(mode) { this.thread.x * this.thread.y * this.thread.z ]; }) - .setOutput([10, 10, 10]) - .setPipeline(true) - .setPrecision('single') + .setOutput([10, 10, 10]) + .setPipeline(true) + .setPrecision('single') )(); const expected = texture.toArray(); const kernel = gpu.createKernel(function() { - return this.constants.value[this.thread.z][this.thread.y][this.thread.x]; - }) + return this.constants.value[this.thread.z][this.thread.y][this.thread.x]; + }) .setConstants({ value: texture }) @@ -447,4 +447,4 @@ function testArray3D4(mode) { (GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('Array3D(4) (GPU only) headlessgl', () => { testArray3D4('headlessgl'); -}); +}); \ No newline at end of file diff --git a/test/internal/constructor-features.js b/test/internal/constructor-features.js index be654879..6ca1e094 100644 --- a/test/internal/constructor-features.js +++ b/test/internal/constructor-features.js @@ -31,4 +31,4 @@ function channelCount(mode) { (GPU.isHeadlessGLSupported ? test : skip)('channelCount headlessgl', () => { channelCount('headlessgl'); -}); +}); \ No newline at end of file diff --git a/test/internal/context-inheritance.js b/test/internal/context-inheritance.js index 01f7ce4e..7a2604fc 100644 --- a/test/internal/context-inheritance.js +++ b/test/internal/context-inheritance.js @@ -8,9 +8,9 @@ describe('internal: context inheritance'); const context = canvas.getContext('webgl'); const gpu = new GPU({ context: context }); const simpleKernel = gpu.createKernel(function() { - return 1 + 1; + return 1 + 1; }, { - output: [1] + output: [1] }); assert.equal(simpleKernel()[0], 2); assert.equal(gpu.Kernel, WebGLKernel); @@ -32,7 +32,7 @@ describe('internal: context inheritance'); gpu.destroy(); }); (GPU.isHeadlessGLSupported ? test : skip)('headlessgl', () => { - const context = require('gl')(1,1); + const context = require('gl')(1, 1); const gpu = new GPU({ context: context }); const simpleKernel = gpu.createKernel(function() { return 1 + 1; @@ -43,4 +43,4 @@ describe('internal: context inheritance'); assert.equal(gpu.Kernel, HeadlessGLKernel); assert.equal(simpleKernel.context, context); gpu.destroy(); -}); +}); \ No newline at end of file diff --git a/test/internal/deep-types.js b/test/internal/deep-types.js index 5fa1cd43..1cecad79 100644 --- a/test/internal/deep-types.js +++ b/test/internal/deep-types.js @@ -6,6 +6,7 @@ describe('internal: deep types'); function oneLayerDeepFloat(mode) { const gpu = new GPU({ mode }); + function childFunction(childFunctionArgument1) { return childFunctionArgument1 + 1; } @@ -37,9 +38,11 @@ function oneLayerDeepFloat(mode) { function twoLayerDeepFloat(mode) { const gpu = new GPU({ mode }); + function child1Function(child1FunctionArgument1) { return child2Function(child1FunctionArgument1); } + function child2Function(child2FunctionArgument1) { return child2FunctionArgument1 + 1; } @@ -74,9 +77,11 @@ function twoLayerDeepFloat(mode) { function twoArgumentLayerDeepFloat(mode) { const gpu = new GPU({ mode }); + function child1Function(child1FunctionArgument1) { return child1FunctionArgument1 + 1; } + function child2Function(child2FunctionArgument1) { return child2FunctionArgument1 + 1; } @@ -113,12 +118,15 @@ function twoArgumentLayerDeepFloat(mode) { function threeLayerDeepFloat(mode) { const gpu = new GPU({ mode }); + function child1Function(child1FunctionArgument1) { return child2Function(child1FunctionArgument1); } + function child2Function(child2FunctionArgument1) { return child3Function(child2FunctionArgument1 + 1); } + function child3Function(child3FunctionArgument1) { return child3FunctionArgument1 + 1; } @@ -156,12 +164,15 @@ function threeLayerDeepFloat(mode) { function threeArgumentLayerDeepFloat(mode) { const gpu = new GPU({ mode }); + function child1Function(child1FunctionArgument1) { return child1FunctionArgument1 + 1; } + function child2Function(child2FunctionArgument1) { return child2FunctionArgument1 + 1; } + function child3Function(child3FunctionArgument1) { return child3FunctionArgument1 + 1; } @@ -202,12 +213,15 @@ function threeArgumentLayerDeepNumberTexture1(mode) { const texture = gpu.createKernel(function() { return 1.5; }, { output: [1], pipeline: true, precision: 'single' })(); + function child1Function(child1FunctionArgument1) { return child1FunctionArgument1 + 1; } + function child2Function(child2FunctionArgument1) { return child2FunctionArgument1 + 1; } + function child3Function(child3FunctionArgument1) { return child3FunctionArgument1[this.thread.x] + 1; } @@ -245,6 +259,7 @@ function threeArgumentLayerDeepNumberTexture1(mode) { function circlicalLogic(mode) { const gpu = new GPU({ mode }); + function child1Function(child1FunctionArgument1) { return child1Function(child1FunctionArgument1); } @@ -270,6 +285,7 @@ function circlicalLogic(mode) { function arrayTexture1(mode) { const gpu = new GPU({ mode }); + function addOne(functionValue) { return functionValue[this.thread.x] + 1; } @@ -293,34 +309,35 @@ function arrayTexture1(mode) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported ? test : skip)('ArrayTexture(1) auto', ()=> { +(GPU.isSinglePrecisionSupported ? test : skip)('ArrayTexture(1) auto', () => { arrayTexture1(); }); -(GPU.isSinglePrecisionSupported ? test : skip)('ArrayTexture(1) gpu', ()=> { +(GPU.isSinglePrecisionSupported ? test : skip)('ArrayTexture(1) gpu', () => { arrayTexture1('gpu'); }); -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('ArrayTexture(1) webgl', ()=> { +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('ArrayTexture(1) webgl', () => { arrayTexture1('webgl'); }); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('ArrayTexture(1) webgl2', ()=> { +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('ArrayTexture(1) webgl2', () => { arrayTexture1('webgl2'); }); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('ArrayTexture(1) headlessgl', ()=> { +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('ArrayTexture(1) headlessgl', () => { arrayTexture1('headlessgl'); }); -(GPU.isSinglePrecisionSupported ? test : skip)('ArrayTexture(1) cpu', ()=> { +(GPU.isSinglePrecisionSupported ? test : skip)('ArrayTexture(1) cpu', () => { arrayTexture1('cpu'); }); function arrayTexture2(mode) { const gpu = new GPU({ mode }); + function addOne(functionValue) { const declaredValue = functionValue[this.thread.x]; return declaredValue[0] + 1 + declaredValue[1] + 1; } gpu.addFunction(addOne); const texture1 = gpu.createKernel(function() { - return [1,2]; + return [1, 2]; }, { output: [1], precision: 'single', @@ -338,36 +355,37 @@ function arrayTexture2(mode) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported ? test : skip)('ArrayTexture(2) auto', ()=> { +(GPU.isSinglePrecisionSupported ? test : skip)('ArrayTexture(2) auto', () => { arrayTexture2(); }); -(GPU.isSinglePrecisionSupported ? test : skip)('ArrayTexture(2) gpu', ()=> { +(GPU.isSinglePrecisionSupported ? test : skip)('ArrayTexture(2) gpu', () => { arrayTexture2('gpu'); }); -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('ArrayTexture(2) webgl', ()=> { +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('ArrayTexture(2) webgl', () => { arrayTexture2('webgl'); }); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('ArrayTexture(2) webgl2', ()=> { +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('ArrayTexture(2) webgl2', () => { arrayTexture2('webgl2'); }); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('ArrayTexture(2) headlessgl', ()=> { +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('ArrayTexture(2) headlessgl', () => { arrayTexture2('headlessgl'); }); -(GPU.isSinglePrecisionSupported ? test : skip)('ArrayTexture(2) cpu', ()=> { +(GPU.isSinglePrecisionSupported ? test : skip)('ArrayTexture(2) cpu', () => { arrayTexture2('cpu'); }); function arrayTexture3(mode) { const gpu = new GPU({ mode }); + function addOne(functionValue) { const declaredValue = functionValue[this.thread.x]; - return declaredValue[0] + 1 - + declaredValue[1] + 1 - + declaredValue[2] + 1; + return declaredValue[0] + 1 + + declaredValue[1] + 1 + + declaredValue[2] + 1; } gpu.addFunction(addOne); const texture1 = gpu.createKernel(function() { - return [1,2,3]; + return [1, 2, 3]; }, { output: [1], precision: 'single', @@ -385,37 +403,38 @@ function arrayTexture3(mode) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported ? test : skip)('ArrayTexture(3) auto', ()=> { +(GPU.isSinglePrecisionSupported ? test : skip)('ArrayTexture(3) auto', () => { arrayTexture3(); }); -(GPU.isSinglePrecisionSupported ? test : skip)('ArrayTexture(3) gpu', ()=> { +(GPU.isSinglePrecisionSupported ? test : skip)('ArrayTexture(3) gpu', () => { arrayTexture3('gpu'); }); -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('ArrayTexture(3) webgl', ()=> { +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('ArrayTexture(3) webgl', () => { arrayTexture3('webgl'); }); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('ArrayTexture(3) webgl2', ()=> { +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('ArrayTexture(3) webgl2', () => { arrayTexture3('webgl2'); }); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('ArrayTexture(3) headlessgl', ()=> { +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('ArrayTexture(3) headlessgl', () => { arrayTexture3('headlessgl'); }); -(GPU.isSinglePrecisionSupported ? test : skip)('ArrayTexture(3) cpu', ()=> { +(GPU.isSinglePrecisionSupported ? test : skip)('ArrayTexture(3) cpu', () => { arrayTexture3('cpu'); }); function arrayTexture4(mode) { const gpu = new GPU({ mode }); + function addOne(functionValue) { const declaredValue = functionValue[this.thread.x]; - return declaredValue[0] + 1 - + declaredValue[1] + 1 - + declaredValue[2] + 1 - + declaredValue[3] + 1; + return declaredValue[0] + 1 + + declaredValue[1] + 1 + + declaredValue[2] + 1 + + declaredValue[3] + 1; } gpu.addFunction(addOne); const texture1 = gpu.createKernel(function() { - return [1,2,3,4]; + return [1, 2, 3, 4]; }, { output: [1], precision: 'single', @@ -433,36 +452,40 @@ function arrayTexture4(mode) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported ? test : skip)('ArrayTexture(4) auto', ()=> { +(GPU.isSinglePrecisionSupported ? test : skip)('ArrayTexture(4) auto', () => { arrayTexture4(); }); -(GPU.isSinglePrecisionSupported ? test : skip)('ArrayTexture(4) gpu', ()=> { +(GPU.isSinglePrecisionSupported ? test : skip)('ArrayTexture(4) gpu', () => { arrayTexture4('gpu'); }); -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('ArrayTexture(4) webgl', ()=> { +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('ArrayTexture(4) webgl', () => { arrayTexture4('webgl'); }); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('ArrayTexture(4) webgl2', ()=> { +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('ArrayTexture(4) webgl2', () => { arrayTexture4('webgl2'); }); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('ArrayTexture(4) headlessgl', ()=> { +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('ArrayTexture(4) headlessgl', () => { arrayTexture4('headlessgl'); }); -(GPU.isSinglePrecisionSupported ? test : skip)('ArrayTexture(4) cpu', ()=> { +(GPU.isSinglePrecisionSupported ? test : skip)('ArrayTexture(4) cpu', () => { arrayTexture4('cpu'); }); function testTortureTest(mode) { const gpu = new GPU({ mode }); + function addFloatArray(addFloatArrayArgument1, addFloatArrayArgument2) { return addFloatArrayArgument1 + addFloatArrayArgument2[this.thread.x]; } + function addArrayFloat(addArrayFloatArgument1, addArrayFloatArgument2) { return addArrayFloatArgument1[this.thread.x] + addArrayFloatArgument2; } + function addArrayArray(addArrayArrayArgument1, addArrayArrayArgument2) { return addArrayArrayArgument1[this.thread.x] + addArrayArrayArgument2[this.thread.x]; } + function addFloatFloat(addFloatFloatArgument1, addFloatFloatArgument2) { return addFloatFloatArgument1 + addFloatFloatArgument2; } @@ -477,9 +500,9 @@ function testTortureTest(mode) { sinon.spy(FunctionBuilder.prototype, 'lookupReturnType'); try { - const kernel = gpu.createKernel(function (v1, v2, v3, v4, v5) { + const kernel = gpu.createKernel(function(v1, v2, v3, v4, v5) { return addFloatFloat(v4, addArrayFloat(v3, addFloatArray(addArrayArray(v1, v5), v2))); - }, {output: [1]}); + }, { output: [1] }); const result = kernel([1], texture, [3], 4, new Float32Array([5])); assert.equal(result[0], 1 + 2 + 3 + 4 + 5); @@ -530,16 +553,18 @@ test('torture test cpu', () => { function testKernelMap(mode) { const gpu = new GPU({ mode }); + function calc1(v1, v2) { return v2[this.thread.x] - v1; } + function calc2(v1, v2) { return v1 * v2; } const kernelMap = gpu.createKernelMap({ calc1, calc2, - }, function (outputs, targets) { + }, function(outputs, targets) { const output = outputs[this.thread.x]; return calc2(calc1(output, targets), output); }, { output: [1], pipeline: true }); @@ -564,4 +589,4 @@ function testKernelMap(mode) { (GPU.isHeadlessGLSupported ? test : skip)('kernel map headlessgl', () => { testKernelMap('headlessgl'); -}); +}); \ No newline at end of file diff --git a/test/internal/deprecated.js b/test/internal/deprecated.js index f5c2848b..82600f80 100644 --- a/test/internal/deprecated.js +++ b/test/internal/deprecated.js @@ -95,4 +95,4 @@ test('Kernel.setOutputToTexture', () => { const kernel = new Kernel(`function() {}`); kernel.setOutputToTexture(true); assert.equal(kernel.pipeline, true); -}); +}); \ No newline at end of file diff --git a/test/internal/different-texture-cloning.js b/test/internal/different-texture-cloning.js index e45d5eee..9e494438 100644 --- a/test/internal/different-texture-cloning.js +++ b/test/internal/different-texture-cloning.js @@ -5,6 +5,7 @@ describe('internal: different texture cloning'); function testArrayThenArray1D4(mode) { const gpu = new GPU({ mode }); + function createTextureOf(value, type) { return (gpu.createKernel(function(value) { return value[this.thread.x]; @@ -16,11 +17,13 @@ function testArrayThenArray1D4(mode) { } const arrayTexture = createTextureOf([1], 'Array'); const arrayTextureClone = arrayTexture.clone(); - const array4Texture = createTextureOf([[1,2,3,4]], 'Array1D(4)'); + const array4Texture = createTextureOf([ + [1, 2, 3, 4] + ], 'Array1D(4)'); const array4TextureClone = array4Texture.clone(); assert.notEqual(arrayTextureClone, array4TextureClone); assert.deepEqual(arrayTextureClone.toArray(), new Float32Array([1])); - assert.deepEqual(array4TextureClone.toArray(), [new Float32Array([1,2,3,4])]); + assert.deepEqual(array4TextureClone.toArray(), [new Float32Array([1, 2, 3, 4])]); gpu.destroy(); } @@ -42,6 +45,7 @@ test('Array then Array1D(4) auto', () => { function testArray1D4ThenArray(mode) { const gpu = new GPU({ mode }); + function createTextureOf(value, type) { return (gpu.createKernel(function(value) { return value[this.thread.x]; @@ -51,12 +55,14 @@ function testArray1D4ThenArray(mode) { argumentTypes: { value: type } }))(value); } - const array4Texture = createTextureOf([[1,2,3,4]], 'Array1D(4)'); + const array4Texture = createTextureOf([ + [1, 2, 3, 4] + ], 'Array1D(4)'); const array4TextureClone = array4Texture.clone(); const arrayTexture = createTextureOf([1], 'Array'); const arrayTextureClone = arrayTexture.clone(); assert.notEqual(array4TextureClone, arrayTextureClone); - assert.deepEqual(array4TextureClone.toArray(), [new Float32Array([1,2,3,4])]); + assert.deepEqual(array4TextureClone.toArray(), [new Float32Array([1, 2, 3, 4])]); assert.deepEqual(arrayTextureClone.toArray(), new Float32Array([1])); gpu.destroy(); } @@ -75,4 +81,4 @@ test('Array1D(4) then Array auto', () => { (GPU.isHeadlessGLSupported ? test : skip)('Array1D(4) then Array headlessgl', () => { testArray1D4ThenArray('headlessgl'); -}); +}); \ No newline at end of file diff --git a/test/internal/function-builder.js b/test/internal/function-builder.js index 7755507a..c1978be5 100644 --- a/test/internal/function-builder.js +++ b/test/internal/function-builder.js @@ -75,21 +75,21 @@ test('webglString: 3 layer test cpu', () => { ); assert.equal( - builder.getStringFromFunctionNames(['layerOne','layerTwo']), + builder.getStringFromFunctionNames(['layerOne', 'layerTwo']), 'function layerOne() {\nreturn 42;\n}\nfunction layerTwo() {\nreturn (layerOne()*2);\n}' ); assert.equal( builder.getString('layerTwo'), - builder.getStringFromFunctionNames(['layerOne','layerTwo']) + builder.getStringFromFunctionNames(['layerOne', 'layerTwo']) ); assert.equal( - builder.getStringFromFunctionNames(['layerOne','layerTwo','layerThree']), + builder.getStringFromFunctionNames(['layerOne', 'layerTwo', 'layerThree']), 'function layerOne() {\nreturn 42;\n}\nfunction layerTwo() {\nreturn (layerOne()*2);\n}\nfunction layerThree() {\nreturn (layerTwo()*2);\n}' ); assert.equal( builder.getString('layerThree'), - builder.getStringFromFunctionNames(['layerOne','layerTwo','layerThree']) + builder.getStringFromFunctionNames(['layerOne', 'layerTwo', 'layerThree']) ); assert.equal( builder.getString(null), @@ -109,21 +109,21 @@ test('webglString: 3 layer test webgl', () => { ); assert.equal( - builder.getStringFromFunctionNames(['layerOne','layerTwo']), + builder.getStringFromFunctionNames(['layerOne', 'layerTwo']), 'float layerOne() {\nreturn 42.0;\n}\nfloat layerTwo() {\nreturn (layerOne()*2.0);\n}' ); assert.equal( builder.getString('layerTwo'), - builder.getStringFromFunctionNames(['layerOne','layerTwo']) + builder.getStringFromFunctionNames(['layerOne', 'layerTwo']) ); assert.equal( - builder.getStringFromFunctionNames(['layerOne','layerTwo','layerThree']), + builder.getStringFromFunctionNames(['layerOne', 'layerTwo', 'layerThree']), 'float layerOne() {\nreturn 42.0;\n}\nfloat layerTwo() {\nreturn (layerOne()*2.0);\n}\nfloat layerThree() {\nreturn (layerTwo()*2.0);\n}' ); assert.equal( builder.getString('layerThree'), - builder.getStringFromFunctionNames(['layerOne','layerTwo','layerThree']) + builder.getStringFromFunctionNames(['layerOne', 'layerTwo', 'layerThree']) ); assert.equal( builder.getString(null), @@ -145,24 +145,24 @@ test('webglString: 3 layer test webgl2', () => { ); assert.equal( - builder.getStringFromFunctionNames(['layerOne','layerTwo']), + builder.getStringFromFunctionNames(['layerOne', 'layerTwo']), 'float layerOne() {\nreturn 42.0;\n}\nfloat layerTwo() {\nreturn (layerOne()*2.0);\n}' ); assert.equal( builder.getString('layerTwo'), - builder.getStringFromFunctionNames(['layerOne','layerTwo']) + builder.getStringFromFunctionNames(['layerOne', 'layerTwo']) ); assert.equal( - builder.getStringFromFunctionNames(['layerOne','layerTwo','layerThree']), + builder.getStringFromFunctionNames(['layerOne', 'layerTwo', 'layerThree']), 'float layerOne() {\nreturn 42.0;\n}\nfloat layerTwo() {\nreturn (layerOne()*2.0);\n}\nfloat layerThree() {\nreturn (layerTwo()*2.0);\n}' ); assert.equal( builder.getString('layerThree'), - builder.getStringFromFunctionNames(['layerOne','layerTwo','layerThree']) + builder.getStringFromFunctionNames(['layerOne', 'layerTwo', 'layerThree']) ); assert.equal( builder.getString(null), builder.getString('layerThree') ); -}); +}); \ No newline at end of file diff --git a/test/internal/function-composition.js b/test/internal/function-composition.js index a65cc81d..02b116f6 100644 --- a/test/internal/function-composition.js +++ b/test/internal/function-composition.js @@ -11,26 +11,26 @@ function functionCompositionReturnValuesTest(mode) { return left[this.thread.x] + right[this.thread.x]; } return add(oneToFour, fourToOne); - }, { output: [4] })([1,2,3,4], [4,3,2,1]); + }, { output: [4] })([1, 2, 3, 4], [4, 3, 2, 1]); } test('auto', () => { - assert.deepEqual(Array.from(functionCompositionReturnValuesTest()), [5,5,5,5]); + assert.deepEqual(Array.from(functionCompositionReturnValuesTest()), [5, 5, 5, 5]); }); test('gpu', () => { - assert.deepEqual(Array.from(functionCompositionReturnValuesTest('gpu')), [5,5,5,5]); + assert.deepEqual(Array.from(functionCompositionReturnValuesTest('gpu')), [5, 5, 5, 5]); }); (GPU.isWebGLSupported ? test : skip)('webgl', () => { - assert.deepEqual(Array.from(functionCompositionReturnValuesTest('webgl')), [5,5,5,5]); + assert.deepEqual(Array.from(functionCompositionReturnValuesTest('webgl')), [5, 5, 5, 5]); }); (GPU.isWebGL2Supported ? test : skip)('webgl2', () => { - assert.deepEqual(Array.from(functionCompositionReturnValuesTest('webgl2')), [5,5,5,5]); + assert.deepEqual(Array.from(functionCompositionReturnValuesTest('webgl2')), [5, 5, 5, 5]); }); (GPU.isHeadlessGLSupported ? test : skip)('headlessgl', () => { - assert.deepEqual(Array.from(functionCompositionReturnValuesTest('headlessgl')), [5,5,5,5]); + assert.deepEqual(Array.from(functionCompositionReturnValuesTest('headlessgl')), [5, 5, 5, 5]); }); test('cpu', () => { - assert.deepEqual(Array.from(functionCompositionReturnValuesTest('cpu')), [5,5,5,5]); + assert.deepEqual(Array.from(functionCompositionReturnValuesTest('cpu')), [5, 5, 5, 5]); }); @@ -55,22 +55,22 @@ function functionCompositionFunctionNode(FunctionNode) { } test('CPUFunctionNode', () => { - assert.equal(functionCompositionFunctionNode(CPUFunctionNode), 'function kernel() {' - + '\n' - + '\nreturn inner();' - + '\n}'); + assert.equal(functionCompositionFunctionNode(CPUFunctionNode), 'function kernel() {' + + '\n' + + '\nreturn inner();' + + '\n}'); }); test('WebGLFunctionNode', () => { - assert.equal(functionCompositionFunctionNode(WebGLFunctionNode), 'float kernel() {' - + '\n' - + '\nreturn inner();' - + '\n}'); + assert.equal(functionCompositionFunctionNode(WebGLFunctionNode), 'float kernel() {' + + '\n' + + '\nreturn inner();' + + '\n}'); }); test('WebGL2FunctionNode', () => { - assert.equal(functionCompositionFunctionNode(WebGL2FunctionNode), 'float kernel() {' - + '\n' - + '\nreturn inner();' - + '\n}'); + assert.equal(functionCompositionFunctionNode(WebGL2FunctionNode), 'float kernel() {' + + '\n' + + '\nreturn inner();' + + '\n}'); }); describe('internal: number function composition FunctionBuilder'); @@ -95,28 +95,28 @@ function numberFunctionCompositionFunctionBuilder(FunctionNode) { } test('CPUFunctionNode', () => { - assert.equal(numberFunctionCompositionFunctionBuilder(CPUFunctionNode), 'function inner() {' - + '\nreturn 1;' - + '\n}' - + '\nresultX[x] = inner();\ncontinue;'); + assert.equal(numberFunctionCompositionFunctionBuilder(CPUFunctionNode), 'function inner() {' + + '\nreturn 1;' + + '\n}' + + '\nresultX[x] = inner();\ncontinue;'); }); test('WebGLFunctionNode', () => { - assert.equal(numberFunctionCompositionFunctionBuilder(WebGLFunctionNode), 'float inner() {' - + '\nreturn 1.0;' - + '\n}' - + '\nvoid kernel() {' - + '\n' - + '\nkernelResult = inner();return;' - + '\n}'); + assert.equal(numberFunctionCompositionFunctionBuilder(WebGLFunctionNode), 'float inner() {' + + '\nreturn 1.0;' + + '\n}' + + '\nvoid kernel() {' + + '\n' + + '\nkernelResult = inner();return;' + + '\n}'); }); test('WebGL2FunctionNode', () => { - assert.equal(numberFunctionCompositionFunctionBuilder(WebGL2FunctionNode), 'float inner() {' - + '\nreturn 1.0;' - + '\n}' - + '\nvoid kernel() {' - + '\n' - + '\nkernelResult = inner();return;' - + '\n}'); + assert.equal(numberFunctionCompositionFunctionBuilder(WebGL2FunctionNode), 'float inner() {' + + '\nreturn 1.0;' + + '\n}' + + '\nvoid kernel() {' + + '\n' + + '\nkernelResult = inner();return;' + + '\n}'); }); describe('internal: Array(2) function composition FunctionBuilder'); @@ -141,26 +141,26 @@ function array2FunctionCompositionFunctionBuilder(FunctionNode) { } test('CPUFunctionNode', () => { - assert.equal(array2FunctionCompositionFunctionBuilder(CPUFunctionNode), 'function inner() {' - + '\nreturn new Float32Array([1, 2, 3, 4]);' - + '\n}' - + '\nresultX[x] = inner()[0];\ncontinue;'); + assert.equal(array2FunctionCompositionFunctionBuilder(CPUFunctionNode), 'function inner() {' + + '\nreturn new Float32Array([1, 2, 3, 4]);' + + '\n}' + + '\nresultX[x] = inner()[0];\ncontinue;'); }); test('WebGLFunctionNode', () => { - assert.equal(array2FunctionCompositionFunctionBuilder(WebGLFunctionNode), 'vec4 inner() {' - + '\nreturn vec4(1.0, 2.0, 3.0, 4.0);' - + '\n}' - + '\nvoid kernel() {' - + '\n' - + '\nkernelResult = inner()[0];return;' - + '\n}'); + assert.equal(array2FunctionCompositionFunctionBuilder(WebGLFunctionNode), 'vec4 inner() {' + + '\nreturn vec4(1.0, 2.0, 3.0, 4.0);' + + '\n}' + + '\nvoid kernel() {' + + '\n' + + '\nkernelResult = inner()[0];return;' + + '\n}'); }); test('WebGL2FunctionNode', () => { - assert.equal(array2FunctionCompositionFunctionBuilder(WebGL2FunctionNode), 'vec4 inner() {' - + '\nreturn vec4(1.0, 2.0, 3.0, 4.0);' - + '\n}' - + '\nvoid kernel() {' - + '\n' - + '\nkernelResult = inner()[0];return;' - + '\n}'); -}); + assert.equal(array2FunctionCompositionFunctionBuilder(WebGL2FunctionNode), 'vec4 inner() {' + + '\nreturn vec4(1.0, 2.0, 3.0, 4.0);' + + '\n}' + + '\nvoid kernel() {' + + '\n' + + '\nkernelResult = inner()[0];return;' + + '\n}'); +}); \ No newline at end of file diff --git a/test/internal/function-node.js b/test/internal/function-node.js index fba0fc39..f0cf478c 100644 --- a/test/internal/function-node.js +++ b/test/internal/function-node.js @@ -16,9 +16,9 @@ test('hello_world: just return magic 42 cpu', () => { assert.equal( node.toString(), - 'function hello_world() {' - + '\nreturn 42;' - + '\n}', + 'function hello_world() {' + + '\nreturn 42;' + + '\n}', 'function conversion check' ); }); @@ -35,9 +35,9 @@ test('hello_world: just return magic 42 webgl', () => { assert.equal( node.toString(), - 'float hello_world() {' - + '\nreturn 42.0;' - + '\n}', + 'float hello_world() {' + + '\nreturn 42.0;' + + '\n}', 'function conversion check' ); }); @@ -54,9 +54,9 @@ test('hello_world: just return magic 42 webgl2', () => { assert.equal( node.toString(), - 'float hello_world() {' - + '\nreturn 42.0;' - + '\n}', + 'float hello_world() {' + + '\nreturn 42.0;' + + '\n}', 'function conversion check' ); }); @@ -71,8 +71,7 @@ test('hello_inner: call a function inside a function cpu', () => { const node = new CPUFunctionNode( (function() { return inner(); - }).toString(), - { + }).toString(), { name: 'hello_inner', output: [1], lookupReturnType: () => 'Number', @@ -84,13 +83,13 @@ test('hello_inner: call a function inside a function cpu', () => { assert.equal( node.toString(), - 'function hello_inner() {' - + '\nreturn inner();' - + '\n}', + 'function hello_inner() {' + + '\nreturn inner();' + + '\n}', 'function conversion check' ); - assert.deepEqual(node.calledFunctions, ['inner'] ); + assert.deepEqual(node.calledFunctions, ['inner']); }); test('hello_inner: call a function inside a function webgl', () => { @@ -114,13 +113,13 @@ test('hello_inner: call a function inside a function webgl', () => { assert.equal( node.toString(), - 'float hello_inner() {' - + '\nreturn inner();' - + '\n}', + 'float hello_inner() {' + + '\nreturn inner();' + + '\n}', 'function conversion check' ); - assert.deepEqual(node.calledFunctions, ['inner'] ); + assert.deepEqual(node.calledFunctions, ['inner']); }); /// Test creation of function, that calls another function @@ -145,13 +144,13 @@ test('hello_inner: call a function inside a function webgl2', () => { assert.equal( node.toString(), - 'float hello_inner() {' - + '\nreturn inner();' - + '\n}', + 'float hello_inner() {' + + '\nreturn inner();' + + '\n}', 'function conversion check' ); - assert.deepEqual(node.calledFunctions, ['inner'] ); + assert.deepEqual(node.calledFunctions, ['inner']); }); /// Test creation of function, that calls another function, with ARGS @@ -160,8 +159,7 @@ test('Math.round implementation: A function with arguments cpu', () => { const node = new CPUFunctionNode( (function(a) { return Math.floor(a + 0.5); - }).toString(), - { + }).toString(), { name: 'foo', output: [1], argumentTypes: ['Number'], @@ -174,9 +172,9 @@ test('Math.round implementation: A function with arguments cpu', () => { assert.equal( node.toString(), - 'function foo(user_a) {' - + '\nreturn Math.floor((user_a+0.5));' - + '\n}', + 'function foo(user_a) {' + + '\nreturn Math.floor((user_a+0.5));' + + '\n}', 'function conversion check' ); @@ -199,13 +197,13 @@ test('Math.round implementation: A function with arguments webgl', () => { assert.equal( node.toString(), - 'float foo(float user_a) {' - + '\nreturn floor((user_a+0.5));' - + '\n}', + 'float foo(float user_a) {' + + '\nreturn floor((user_a+0.5));' + + '\n}', 'function conversion check' ); - assert.deepEqual(node.calledFunctions, ['floor'] ); + assert.deepEqual(node.calledFunctions, ['floor']); }); test('Math.round implementation: A function with arguments webgl2', () => { @@ -224,20 +222,20 @@ test('Math.round implementation: A function with arguments webgl2', () => { assert.equal( node.toString(), - 'float foo(float user_a) {' - + '\nreturn floor((user_a+0.5));' - + '\n}', + 'float foo(float user_a) {' + + '\nreturn floor((user_a+0.5));' + + '\n}', 'function conversion check' ); - assert.deepEqual(node.calledFunctions, ['floor'] ); + assert.deepEqual(node.calledFunctions, ['floor']); }); /// Test creation of function, that calls another function, with ARGS -test('Two arguments test webgl', function(assert){ +test('Two arguments test webgl', function(assert) { const node = new WebGLFunctionNode( - (function(a,b) { - return a+b; + (function(a, b) { + return a + b; }).toString(), { name: 'add_together', output: [1], @@ -249,17 +247,17 @@ test('Two arguments test webgl', function(assert){ assert.equal( node.toString(), - 'float add_together(float user_a, float user_b) {' - + '\nreturn (user_a+user_b);' - + '\n}', + 'float add_together(float user_a, float user_b) {' + + '\nreturn (user_a+user_b);' + + '\n}', 'function conversion check' ); }); -test('Two arguments test webgl2', function(assert){ +test('Two arguments test webgl2', function(assert) { const node = new WebGL2FunctionNode( - (function(a,b) { - return a+b; + (function(a, b) { + return a + b; }).toString(), { name: 'add_together', output: [1], @@ -271,9 +269,9 @@ test('Two arguments test webgl2', function(assert){ assert.equal( node.toString(), - 'float add_together(float user_a, float user_b) {' - + '\nreturn (user_a+user_b);' - + '\n}', + 'float add_together(float user_a, float user_b) {' + + '\nreturn (user_a+user_b);' + + '\n}', 'function conversion check' ); }); @@ -307,4 +305,4 @@ test('Automatic naming support webgl2', () => { const node = new WebGL2FunctionNode(hello_world.toString(), { output: [1] }); assert.notEqual(node, null, 'class creation check'); assert.equal(node.name, 'hello_world'); -}); +}); \ No newline at end of file diff --git a/test/internal/function-return-type-detection.js b/test/internal/function-return-type-detection.js index f8bd462a..60406d87 100644 --- a/test/internal/function-return-type-detection.js +++ b/test/internal/function-return-type-detection.js @@ -5,6 +5,7 @@ describe('internal: Function return type detection'); function canDetectNumberFromAddedFunction(mode) { const gpu = new GPU({ mode }); + function number() { return 1; } @@ -46,6 +47,7 @@ test('can detect Number cpu', () => { function canDetectArray2FromAddedFunction(mode) { const gpu = new GPU({ mode }); + function array2() { return [1, 2]; } @@ -88,6 +90,7 @@ test('can detect Array(2) cpu', () => { function canDetectArray3FromAddedFunction(mode) { const gpu = new GPU({ mode }); + function array2() { return [1, 2, 3]; } @@ -130,6 +133,7 @@ test('can detect Array(3) cpu', () => { function canDetectArray4FromAddedFunction(mode) { const gpu = new GPU({ mode }); + function array2() { return [1, 2, 3, 4]; } @@ -167,4 +171,4 @@ test('can detect Array(4) gpu', () => { test('can detect Array(4) cpu', () => { canDetectArray4FromAddedFunction('cpu'); -}); +}); \ No newline at end of file diff --git a/test/internal/function-tracer.js b/test/internal/function-tracer.js index a3608f16..8142d59e 100644 --- a/test/internal/function-tracer.js +++ b/test/internal/function-tracer.js @@ -326,13 +326,11 @@ test('works with Identifier', () => { FunctionTracer.prototype.scan.call(mockInstance, mockAst); assert.ok(mockGetDeclaration.called); assert.equal(mockGetDeclaration.args[0][0], 'x'); - assert.deepEqual(mockInstance.identifiers, [ - { - context: mockInstance.currentContext, - ast: mockAst, - declaration: 123 - } - ]); + assert.deepEqual(mockInstance.identifiers, [{ + context: mockInstance.currentContext, + ast: mockAst, + declaration: 123 + }]); assert.equal(mockIsState.args[0][0], 'trackIdentifiers'); }); @@ -423,12 +421,10 @@ test('works with CallExpression', () => { FunctionTracer.prototype.scan.call(mockInstance, mockAst); assert.ok(called); assert.equal(calledArguments, mockArguments); - assert.deepEqual(mockInstance.functionCalls, [ - { - context: mockCurrentContext, - ast: mockAst - } - ]); + assert.deepEqual(mockInstance.functionCalls, [{ + context: mockCurrentContext, + ast: mockAst + }]); }); test('works with ArrayExpression', () => { @@ -536,4 +532,4 @@ test('can handle direct arrays', () => { }; FunctionTracer.prototype.scan.call(mockInstance, asts); assert.deepEqual(calledAsts, asts); -}); +}); \ No newline at end of file diff --git a/test/internal/gpu-methods.js b/test/internal/gpu-methods.js index b9acb266..2753b6c8 100644 --- a/test/internal/gpu-methods.js +++ b/test/internal/gpu-methods.js @@ -7,7 +7,9 @@ test('.createKernelMap() object map with settings', () => { const gpu = new GPU(); let source = null; let settings = null; + function bob() {} + function tom() {} class MockKernel { constructor(_source, _settings) { @@ -34,8 +36,7 @@ test('.createKernelMap() object map with settings', () => { assert.equal(settings.nativeFunctions, gpu.nativeFunctions); assert.equal(settings.gpu, gpu); assert.equal(settings.validate, true); - assert.deepEqual(kernel.subKernels, [ - { + assert.deepEqual(kernel.subKernels, [{ name: 'bob', source: bob.toString(), property: 'bobResult' @@ -52,7 +53,9 @@ test('.createKernelMap() array map with settings', () => { const gpu = new GPU(); let source = null; let settings = null; + function bob() {} + function tom() {} class MockKernel { constructor(_source, _settings) { @@ -76,8 +79,7 @@ test('.createKernelMap() array map with settings', () => { assert.equal(settings.nativeFunctions, gpu.nativeFunctions); assert.equal(settings.gpu, gpu); assert.equal(settings.validate, true); - assert.deepEqual(kernel.subKernels, [ - { + assert.deepEqual(kernel.subKernels, [{ name: 'bob', source: bob.toString(), property: 0 @@ -88,4 +90,4 @@ test('.createKernelMap() array map with settings', () => { property: 1 } ]); -}); +}); \ No newline at end of file diff --git a/test/internal/implied-else.js b/test/internal/implied-else.js index 9eae23b7..2f2d556a 100644 --- a/test/internal/implied-else.js +++ b/test/internal/implied-else.js @@ -75,4 +75,4 @@ test('handles implied else gpu', () => { test('handles implied else cpu', () => { handlesImpliedElse('cpu'); -}); +}); \ No newline at end of file diff --git a/test/internal/kernel.js b/test/internal/kernel.js index ec0475e1..164a0c2d 100644 --- a/test/internal/kernel.js +++ b/test/internal/kernel.js @@ -320,7 +320,7 @@ test('functionToIFunction with function', () => { test('functionToIFunction with function and argumentTypes array', () => { const fn = function name(a, b) {}; - const argumentTypes = ['number','string']; + const argumentTypes = ['number', 'string']; const result = Kernel.prototype.functionToIGPUFunction(fn, { argumentTypes }); assert.deepEqual(result, { name: 'name', @@ -351,4 +351,4 @@ test('functionToIGPUFunction with function and returnType', () => { argumentTypes: [], returnType: 'string', }); -}); +}); \ No newline at end of file diff --git a/test/internal/loop-int.js b/test/internal/loop-int.js index d9322a7e..f2636b38 100644 --- a/test/internal/loop-int.js +++ b/test/internal/loop-int.js @@ -68,7 +68,9 @@ test('loop int constant output webgl2', () => { const output = gpu.createKernel(kernel, { constants: { max: 3 }, output: [1] - })([[1,2,3]]); + })([ + [1, 2, 3] + ]); assert.equal( output, @@ -89,7 +91,9 @@ test('loop int constant output webgl2', () => { const output = gpu.createKernel(kernel, { constants: { max: 3 }, output: [1] - })([[1,2,3]]); + })([ + [1, 2, 3] + ]); assert.equal( output, @@ -110,7 +114,9 @@ test('loop int constant output webgl2', () => { const output = gpu.createKernel(kernel, { constants: { max: 3 }, output: [1] - })([[1,2,3]]); + })([ + [1, 2, 3] + ]); assert.equal( output, @@ -178,7 +184,9 @@ test('loop int literal output webgl2', () => { return sum; } const gpu = new GPU({ mode: 'webgl' }); - const output = gpu.createKernel(kernel, { output: [1] })([[1,2,3]]); + const output = gpu.createKernel(kernel, { output: [1] })([ + [1, 2, 3] + ]); assert.equal( output, 6 @@ -195,7 +203,9 @@ test('loop int literal output webgl2', () => { return sum; } const gpu = new GPU({ mode: 'webgl2' }); - const output = gpu.createKernel(kernel, { output: [1] })([[1,2,3]]); + const output = gpu.createKernel(kernel, { output: [1] })([ + [1, 2, 3] + ]); assert.equal( output, 6 @@ -212,7 +222,9 @@ test('loop int literal output webgl2', () => { return sum; } const gpu = new GPU({ mode: 'headlessgl' }); - const output = gpu.createKernel(kernel, { output: [1] })([[1,2,3]]); + const output = gpu.createKernel(kernel, { output: [1] })([ + [1, 2, 3] + ]); assert.equal( output, 6 @@ -285,7 +297,9 @@ test('loop int parameter output webgl2', () => { return sum; } const gpu = new GPU({ mode: 'webgl' }); - const output = gpu.createKernel(kernel, { output: [1] })(3, [[1,2,3]]); + const output = gpu.createKernel(kernel, { output: [1] })(3, [ + [1, 2, 3] + ]); assert.equal( output, 6 @@ -302,7 +316,9 @@ test('loop int parameter output webgl2', () => { return sum; } const gpu = new GPU({ mode: 'webgl2' }); - const output = gpu.createKernel(kernel, { output: [1] })(3, [[1,2,3]]); + const output = gpu.createKernel(kernel, { output: [1] })(3, [ + [1, 2, 3] + ]); assert.equal( output, 6 @@ -319,7 +335,9 @@ test('loop int parameter output webgl2', () => { return sum; } const gpu = new GPU({ mode: 'headlessgl' }); - const output = gpu.createKernel(kernel, { output: [1] })(3, [[1,2,3]]); + const output = gpu.createKernel(kernel, { output: [1] })(3, [ + [1, 2, 3] + ]); assert.equal( output, 6 @@ -339,7 +357,9 @@ test('loop int parameter output webgl2', () => { const output = gpu.createKernel(kernel, { dynamicOutput: true, output: [1], - })([[3]]); + })([ + [3] + ]); assert.deepEqual( Array.from(output), @@ -360,7 +380,9 @@ test('loop int parameter output webgl2', () => { const output = gpu.createKernel(kernel, { dynamicOutput: true, output: [1] - })([[3]]); + })([ + [3] + ]); assert.deepEqual( Array.from(output), @@ -381,11 +403,13 @@ test('loop int parameter output webgl2', () => { const output = gpu.createKernel(kernel, { dynamicOutput: true, output: [1], - })([[3]]); + })([ + [3] + ]); assert.deepEqual( Array.from(output), [3] ); gpu.destroy(); -}); +}); \ No newline at end of file diff --git a/test/internal/loop-max.js b/test/internal/loop-max.js index eb11fa76..b97464da 100644 --- a/test/internal/loop-max.js +++ b/test/internal/loop-max.js @@ -62,7 +62,7 @@ test('loop max output webgl2', () => { }); (GPU.isWebGLSupported ? test : skip)('loop max webgl', () => { - const gpu = new GPU({mode: 'webgl'}); + const gpu = new GPU({ mode: 'webgl' }); const add = gpu.createKernel(function(a, b) { let sum = 0; for (let i = 0; i < a; i++) { @@ -71,7 +71,9 @@ test('loop max output webgl2', () => { return sum; }).setOutput([1]); - const output = add(1, [[1]]); + const output = add(1, [ + [1] + ]); assert.equal( output[0], 1 @@ -80,7 +82,7 @@ test('loop max output webgl2', () => { }); (GPU.isWebGL2Supported ? test : skip)('loop max webgl2', () => { - const gpu = new GPU({mode: 'webgl2'}); + const gpu = new GPU({ mode: 'webgl2' }); const add = gpu.createKernel(function(a, b) { let sum = 0; for (let i = 0; i < a; i++) { @@ -89,7 +91,9 @@ test('loop max output webgl2', () => { return sum; }).setOutput([1]); - const output = add(1, [[1]]); + const output = add(1, [ + [1] + ]); assert.equal( output[0], 1 @@ -100,19 +104,20 @@ test('loop max output webgl2', () => { (GPU.isHeadlessGLSupported ? test : skip)('loop max headlessgl', () => { const gpu = new GPU({ mode: 'headlessgl' }); const add = gpu.createKernel(function(a, b) { - let sum = 0; - for (let i = 0; i < a; i++) { - sum += b[this.thread.x][i]; - } - return sum; - }) + let sum = 0; + for (let i = 0; i < a; i++) { + sum += b[this.thread.x][i]; + } + return sum; + }) .setOutput([1]); - const output = add(1, [[1]]); + const output = add(1, [ + [1] + ]); assert.equal( output[0], 1 ); gpu.destroy(); -}); - +}); \ No newline at end of file diff --git a/test/internal/math.random.js b/test/internal/math.random.js index d7df0d11..39900819 100644 --- a/test/internal/math.random.js +++ b/test/internal/math.random.js @@ -17,10 +17,10 @@ function mathRandomUnique(mode) { gpu.addNativeFunction('getSeed', `highp float getSeed() { return randomSeedShift; }`); - const kernel = gpu.createKernel(function () { + const kernel = gpu.createKernel(function() { const v = Math.random(); return getSeed(); - }, {output: [1]}); + }, { output: [1] }); const results = []; for (let i = 0; i < checkCount; i++) { const result = kernel(); @@ -109,4 +109,4 @@ test('never above 1 every time gpu', () => { test('never above 1 every time cpu', () => { mathRandomNeverAboveOne('cpu'); -}); +}); \ No newline at end of file diff --git a/test/internal/matrix-multiply-precision.js b/test/internal/matrix-multiply-precision.js index 13327dea..ced12124 100644 --- a/test/internal/matrix-multiply-precision.js +++ b/test/internal/matrix-multiply-precision.js @@ -199,4 +199,4 @@ test('512x512 single precision cpu', () => { test('10x512 single precision cpu', () => { test10x512Matrix('precision', 'cpu'); -}); +}); \ No newline at end of file diff --git a/test/internal/mixed-memory-optimize.js b/test/internal/mixed-memory-optimize.js index 00b527cf..fc1b5c23 100644 --- a/test/internal/mixed-memory-optimize.js +++ b/test/internal/mixed-memory-optimize.js @@ -5,8 +5,8 @@ describe('internal: mixed memory optimize'); function getOffKernel(gpu) { return gpu.createKernel(function(value) { - return value[this.thread.x]; - }) // getFloatFromSampler2D + return value[this.thread.x]; + }) // getFloatFromSampler2D .setPrecision('single') .setOutput([10]) .setPipeline(true) @@ -15,8 +15,8 @@ function getOffKernel(gpu) { function getOnKernel(gpu) { return gpu.createKernel(function(value) { - return value[this.thread.x]; - }) // getMemoryOptimized32 + return value[this.thread.x]; + }) // getMemoryOptimized32 .setPrecision('single') .setOutput([10]) .setPipeline(true) @@ -27,7 +27,7 @@ function offOnOff(mode) { const gpu = new GPU({ mode }); const offKernel = getOffKernel(gpu); const onKernel = getOnKernel(gpu); - const value = [1,2,3,4,5,6,7,8,9,10]; + const value = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; const textureResult = offKernel(value); assert.deepEqual(Array.from(textureResult.toArray()), value); assert.deepEqual(Array.from(onKernel(offKernel(value)).toArray()), value); @@ -67,7 +67,7 @@ function onOffOn(mode) { const gpu = new GPU({ mode }); const onKernel = getOnKernel(gpu); const offKernel = getOffKernel(gpu); - const value = [1,2,3,4,5,6,7,8,9,10]; + const value = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; const textureResult1 = onKernel(value); const textureResult2 = offKernel(onKernel(value)); @@ -107,4 +107,4 @@ test('on off on cpu', () => { assert.throws(() => { onOffOn('cpu'); }); -}); +}); \ No newline at end of file diff --git a/test/internal/modes.js b/test/internal/modes.js index 997c9770..c18730e7 100644 --- a/test/internal/modes.js +++ b/test/internal/modes.js @@ -57,6 +57,5 @@ test('modes cpu', () => { }); (GPU.isHeadlessGLSupported ? test : skip)('modes headlessgl', () => { const gpu = new GPU({ mode: 'headlessgl' }); - assert.equal(gpu.Kernel, HeadlessGLKernel - ); -}); + assert.equal(gpu.Kernel, HeadlessGLKernel); +}); \ No newline at end of file diff --git a/test/internal/overloading.js b/test/internal/overloading.js index 209d3df1..b413d523 100644 --- a/test/internal/overloading.js +++ b/test/internal/overloading.js @@ -26,4 +26,4 @@ test('with Han', () => { gpu.destroy(); } assert.ok(1); -}); +}); \ No newline at end of file diff --git a/test/internal/precision.js b/test/internal/precision.js index e3f06cec..bf2ff6f6 100644 --- a/test/internal/precision.js +++ b/test/internal/precision.js @@ -4,7 +4,7 @@ const { GPU } = require('../../src'); describe('internal: precision'); (GPU.isWebGLSupported ? test : skip)('WebGL Decimal Precision', () => { - const gpu = new GPU({mode: 'webgl'}); + const gpu = new GPU({ mode: 'webgl' }); const add = gpu.createKernel(function(a, b) { return a + b; }).setOutput([1]); @@ -25,7 +25,7 @@ describe('internal: precision'); }); (GPU.isWebGL2Supported ? test : skip)('WebGL2 Decimal Precision', () => { - const gpu = new GPU({mode: 'webgl2'}); + const gpu = new GPU({ mode: 'webgl2' }); const add = gpu.createKernel(function(a, b) { return a + b; }).setOutput([1]); @@ -46,7 +46,7 @@ describe('internal: precision'); }); (GPU.isHeadlessGLSupported ? test : skip)('HeadlessGL Decimal Precision', () => { - const gpu = new GPU({mode: 'headlessgl'}); + const gpu = new GPU({ mode: 'headlessgl' }); const add = gpu.createKernel(function(a, b) { return a + b; }).setOutput([1]); @@ -64,4 +64,4 @@ describe('internal: precision'); addResult = newAddResult; } gpu.destroy(); -}); +}); \ No newline at end of file diff --git a/test/internal/recycling.js b/test/internal/recycling.js index 68f9d92c..6d4c455a 100644 --- a/test/internal/recycling.js +++ b/test/internal/recycling.js @@ -70,12 +70,13 @@ test('immutable unsigned precision kernel gpu', () => { function testImmutableMappedKernelTextureRecycling(precision, mode) { const gpu = new GPU({ mode }); + function oneOff(value) { return value; } const kernel = gpu.createKernelMap({ oneOffValue: oneOff - },function(value1, value2) { + }, function(value1, value2) { oneOff(value2[0] - 1); return value1[0] + 1; }, { @@ -207,7 +208,7 @@ test('immutable single precision texture delete gpu', t => { }); test('immutable unsigned precision texture delete auto', t => { - testImmutableTextureDelete('unsigned', t.async() ); + testImmutableTextureDelete('unsigned', t.async()); }); test('immutable unsigned precision texture delete gpu', t => { @@ -300,10 +301,11 @@ test('immutable single precision kernel.texture does not leak gpu', t => { function testImmutableKernelMappedTexturesDoesNotLeak(precision, done, mode) { const gpu = new GPU({ mode }); + function saveValue(value) { return value; } - const toTextures = gpu.createKernelMap([saveValue],function(value1, value2) { + const toTextures = gpu.createKernelMap([saveValue], function(value1, value2) { saveValue(value1[this.thread.x]); return value2[this.thread.x]; }, { @@ -644,7 +646,7 @@ const gpuError = new Error('Source and destination textures are the same. Use i const cpuError = new Error('Source and destination arrays are the same. Use immutable = true'); test('single precision same source and destination from result mutable throws auto', () => { - testSameSourceDestinationFromResultThrows(gpuError,'single'); + testSameSourceDestinationFromResultThrows(gpuError, 'single'); }); test('single precision same source and destination from result mutable throws gpu', () => { @@ -802,12 +804,13 @@ test('output texture is cloned when recompiling gpu', () => { function testMappedOutputTextureIsClonedWhenRecompiling(mode) { const gpu = new GPU({ mode }); + function setValue(value) { return value * 10; } const kernel = gpu.createKernelMap({ value: setValue, - },function(value1, value2) { + }, function(value1, value2) { setValue(value2[this.thread.x]); return value1[this.thread.x] + 1; }, { output: [1], immutable: true, pipeline: true }); diff --git a/test/internal/texture-index.js b/test/internal/texture-index.js index 1f5af264..cadd111d 100644 --- a/test/internal/texture-index.js +++ b/test/internal/texture-index.js @@ -2,6 +2,7 @@ const { assert, skip, test, module: describe, only } = require('qunit'); const { GPU } = require('../../src'); describe('internal: texture index'); + function createKernelWithNumberConstants(mode) { const gpu = new GPU({ mode }); const kernel = gpu.createKernel(function() { @@ -109,9 +110,11 @@ test('createKernel with number constants & array arguments auto', () => { function createKernelMapWithArrayConstantsAndTextureArguments(mode) { const gpu = new GPU({ mode }); + function calcValue1(v) { return v; } + function calcValue2(v) { return v; } @@ -153,4 +156,4 @@ test('createKernelMap with array constants & texture arguments auto', () => { }); (GPU.isHeadlessGLSupported ? test : skip)('createKernelMap with array constants & texture arguments headlessgl', () => { createKernelMapWithArrayConstantsAndTextureArguments('headlessgl'); -}); +}); \ No newline at end of file diff --git a/test/internal/underscores.js b/test/internal/underscores.js index b231709c..07c676c9 100644 --- a/test/internal/underscores.js +++ b/test/internal/underscores.js @@ -213,5 +213,4 @@ test('texture constant gpu', () => { }); (GPU.isHeadlessGLSupported ? test : skip)('texture constant headlessgl', () => { testTextureConstant('headlessgl'); -}); - +}); \ No newline at end of file diff --git a/test/internal/utils.js b/test/internal/utils.js index c18c8b03..8d36b10f 100644 --- a/test/internal/utils.js +++ b/test/internal/utils.js @@ -5,11 +5,11 @@ describe('internal: utils'); test('systemEndianness not null', () => { assert.ok(utils.systemEndianness() !== null, 'not null check'); - assert.ok(utils.systemEndianness() === 'LE' || utils.systemEndianness() === 'BE', 'value = ' + utils.systemEndianness()); + assert.ok(utils.systemEndianness() === 'LE' || utils.systemEndianness() === 'BE', 'value = ' + utils.systemEndianness()); }); test('isFunction', () => { - assert.ok(utils.isFunction(function() { })); + assert.ok(utils.isFunction(function() {})); assert.notOk(utils.isFunction({})); }); @@ -23,39 +23,71 @@ test('getFunctionName_fromString', () => { }); test('getParamNames_fromString', () => { - assert.deepEqual(['a','b','c'], utils.getArgumentNamesFromString('function test(a,b,c) { }')); + assert.deepEqual(['a', 'b', 'c'], utils.getArgumentNamesFromString('function test(a,b,c) { }')); }); test('closestSquareDimensions 2', () => { - assert.deepEqual(Array.from(utils.closestSquareDimensions(2)), [1,2]); + assert.deepEqual(Array.from(utils.closestSquareDimensions(2)), [1, 2]); }); test('closestSquareDimensions 5', () => { - assert.deepEqual(Array.from(utils.closestSquareDimensions(5)), [2,3]); + assert.deepEqual(Array.from(utils.closestSquareDimensions(5)), [2, 3]); }); test('closestSquareDimensions 6', () => { - assert.deepEqual(Array.from(utils.closestSquareDimensions(6)), [2,3]); + assert.deepEqual(Array.from(utils.closestSquareDimensions(6)), [2, 3]); }); test('closestSquareDimensions 7', () => { - assert.deepEqual(Array.from(utils.closestSquareDimensions(7)), [4,2]); + assert.deepEqual(Array.from(utils.closestSquareDimensions(7)), [4, 2]); }); test('getDimensions Array of 6, padded', () => { - assert.deepEqual(Array.from(utils.getDimensions(new Array(6).fill(1), true)), [6,1,1]); + assert.deepEqual(Array.from(utils.getDimensions(new Array(6).fill(1), true)), [6, 1, 1]); }); test('getDimensions Array of 6,1,1, padded', () => { - assert.deepEqual(Array.from(utils.getDimensions([[[1,1,1,1,1,1]]], true)), [6,1,1]); + assert.deepEqual(Array.from(utils.getDimensions([ + [ + [1, 1, 1, 1, 1, 1] + ] + ], true)), [6, 1, 1]); }); test('getDimensions Array of 1,6,1, padded', () => { - assert.deepEqual(Array.from(utils.getDimensions([[[1],[1],[1],[1],[1],[1]]], true)), [1,6,1]); + assert.deepEqual(Array.from(utils.getDimensions([ + [ + [1], + [1], + [1], + [1], + [1], + [1] + ] + ], true)), [1, 6, 1]); }); test('getDimensions Array of 1,1,6, padded', () => { - assert.deepEqual(Array.from(utils.getDimensions([[[1]],[[1]],[[1]],[[1]],[[1]],[[1]]], true)), [1,1,6]); + assert.deepEqual(Array.from(utils.getDimensions([ + [ + [1] + ], + [ + [1] + ], + [ + [1] + ], + [ + [1] + ], + [ + [1] + ], + [ + [1] + ] + ], true)), [1, 1, 6]); }); test('getMemoryOptimizedFloatTextureSize [6,1,1], bitRatio 4', () => { @@ -133,411 +165,414 @@ test('getKernelTextureSize for [1,2] output, optimizeFloatMemory = true, and pre const textureSize = utils.getKernelTextureSize({ optimizeFloatMemory: true, precision: 'unsigned', - }, [1,2]); - assert.deepEqual(textureSize, new Int32Array([1,2])); + }, [1, 2]); + assert.deepEqual(textureSize, new Int32Array([1, 2])); }); test('getKernelTextureSize for [2,3] output, optimizeFloatMemory = true, and precision = "unsigned"', () => { const textureSize = utils.getKernelTextureSize({ optimizeFloatMemory: true, precision: 'unsigned', - }, [2,3]); - assert.deepEqual(textureSize, new Int32Array([2,3])); + }, [2, 3]); + assert.deepEqual(textureSize, new Int32Array([2, 3])); }); test('getKernelTextureSize for [4,2] output, optimizeFloatMemory = true, and precision = "unsigned"', () => { const textureSize = utils.getKernelTextureSize({ optimizeFloatMemory: true, precision: 'unsigned', - }, [4,2]); - assert.deepEqual(textureSize, new Int32Array([4,2])); + }, [4, 2]); + assert.deepEqual(textureSize, new Int32Array([4, 2])); }); test('getKernelTextureSize for [6,1,1] output, optimizeFloatMemory = true, and precision = "unsigned"', () => { const textureSize = utils.getKernelTextureSize({ optimizeFloatMemory: true, precision: 'unsigned', - }, [6,1,1]); - assert.deepEqual(textureSize, new Int32Array([2,3])); + }, [6, 1, 1]); + assert.deepEqual(textureSize, new Int32Array([2, 3])); }); test('getKernelTextureSize for [1,6,1] output, optimizeFloatMemory = true, and precision = "unsigned"', () => { const textureSize = utils.getKernelTextureSize({ optimizeFloatMemory: true, precision: 'unsigned', - }, [1,6,1]); - assert.deepEqual(textureSize, new Int32Array([1,6])); + }, [1, 6, 1]); + assert.deepEqual(textureSize, new Int32Array([1, 6])); }); test('getKernelTextureSize for [1,1,6] output, optimizeFloatMemory = true, and precision = "unsigned"', () => { const textureSize = utils.getKernelTextureSize({ optimizeFloatMemory: true, precision: 'unsigned', - }, [1,1,6]); - assert.deepEqual(textureSize, new Int32Array([2,3])); + }, [1, 1, 6]); + assert.deepEqual(textureSize, new Int32Array([2, 3])); }); test('getKernelTextureSize for [1,2] output, optimizeFloatMemory = true, and precision = "single"', () => { const textureSize = utils.getKernelTextureSize({ optimizeFloatMemory: true, precision: 'single', - }, [1,2]); - assert.deepEqual(textureSize, new Int32Array([1,1])); + }, [1, 2]); + assert.deepEqual(textureSize, new Int32Array([1, 1])); }); test('getKernelTextureSize for [2,3] output, optimizeFloatMemory = true, and precision = "single"', () => { const textureSize = utils.getKernelTextureSize({ optimizeFloatMemory: true, precision: 'single', - }, [2,3]); - assert.deepEqual(textureSize, new Int32Array([1,2])); + }, [2, 3]); + assert.deepEqual(textureSize, new Int32Array([1, 2])); }); test('getKernelTextureSize for [4,2] output, optimizeFloatMemory = true, and precision = "single"', () => { const textureSize = utils.getKernelTextureSize({ optimizeFloatMemory: true, precision: 'single', - }, [4,2]); - assert.deepEqual(textureSize, new Int32Array([1,2])); + }, [4, 2]); + assert.deepEqual(textureSize, new Int32Array([1, 2])); }); test('getKernelTextureSize for [6,1,1] output, optimizeFloatMemory = true, and precision = "single"', () => { const textureSize = utils.getKernelTextureSize({ optimizeFloatMemory: true, precision: 'single', - }, [6,1,1]); - assert.deepEqual(textureSize, new Int32Array([1,2])); + }, [6, 1, 1]); + assert.deepEqual(textureSize, new Int32Array([1, 2])); }); test('getKernelTextureSize for [1,6,1] output, optimizeFloatMemory = true, and precision = "single"', () => { const textureSize = utils.getKernelTextureSize({ optimizeFloatMemory: true, precision: 'single', - }, [1,6,1]); - assert.deepEqual(textureSize, new Int32Array([1,2])); + }, [1, 6, 1]); + assert.deepEqual(textureSize, new Int32Array([1, 2])); }); test('getKernelTextureSize for [1,1,6] output, optimizeFloatMemory = true, and precision = "single"', () => { const textureSize = utils.getKernelTextureSize({ optimizeFloatMemory: true, precision: 'single', - }, [1,1,6]); - assert.deepEqual(textureSize, new Int32Array([1,2])); + }, [1, 1, 6]); + assert.deepEqual(textureSize, new Int32Array([1, 2])); }); test('erectPackedFloat', () => { - const array = new Float32Array([0,1,2,3,4,5,0,0]); + const array = new Float32Array([0, 1, 2, 3, 4, 5, 0, 0]); const result = utils.erectPackedFloat(array, 6); - assert.deepEqual(result, new Float32Array([0,1,2,3,4,5])); + assert.deepEqual(result, new Float32Array([0, 1, 2, 3, 4, 5])); }); test('erect2DPackedFloat', () => { - const array = new Float32Array([0,1,2,3,4,5,6,7,8,0,0,0,0]); + const array = new Float32Array([0, 1, 2, 3, 4, 5, 6, 7, 8, 0, 0, 0, 0]); const result = utils.erect2DPackedFloat(array, 3, 3); assert.deepEqual(result, [ - new Float32Array([0,1,2]), - new Float32Array([3,4,5]), - new Float32Array([6,7,8]) + new Float32Array([0, 1, 2]), + new Float32Array([3, 4, 5]), + new Float32Array([6, 7, 8]) ]); }); test('erect3DPackedFloat', () => { - const array = new Float32Array([0,1,2,3,4,5,6,7,0,0,0,0,0]); + const array = new Float32Array([0, 1, 2, 3, 4, 5, 6, 7, 0, 0, 0, 0, 0]); const result = utils.erect3DPackedFloat(array, 2, 2, 2); assert.deepEqual(result, [ [ - new Float32Array([0,1]), - new Float32Array([2,3]), - ],[ - new Float32Array([4,5]), - new Float32Array([6,7]), + new Float32Array([0, 1]), + new Float32Array([2, 3]), + ], + [ + new Float32Array([4, 5]), + new Float32Array([6, 7]), ] ]); }); test('erectMemoryOptimizedFloat', () => { - const array = new Float32Array([0,1,2,3,4,5,0,0]); + const array = new Float32Array([0, 1, 2, 3, 4, 5, 0, 0]); const result = utils.erectMemoryOptimizedFloat(array, 6); - assert.deepEqual(result, new Float32Array([0,1,2,3,4,5])); + assert.deepEqual(result, new Float32Array([0, 1, 2, 3, 4, 5])); }); test('erectMemoryOptimized2DFloat', () => { - const array = new Float32Array([0,1,2,3,4,5,6,7,8,0,0,0,0]); + const array = new Float32Array([0, 1, 2, 3, 4, 5, 6, 7, 8, 0, 0, 0, 0]); const result = utils.erectMemoryOptimized2DFloat(array, 3, 3); assert.deepEqual(result, [ - new Float32Array([0,1,2]), - new Float32Array([3,4,5]), - new Float32Array([6,7,8]) + new Float32Array([0, 1, 2]), + new Float32Array([3, 4, 5]), + new Float32Array([6, 7, 8]) ]); }); test('erectMemoryOptimized3DFloat', () => { - const array = new Float32Array([0,1,2,3,4,5,6,7,0,0,0,0,0]); + const array = new Float32Array([0, 1, 2, 3, 4, 5, 6, 7, 0, 0, 0, 0, 0]); const result = utils.erectMemoryOptimized3DFloat(array, 2, 2, 2); assert.deepEqual(result, [ [ - new Float32Array([0,1]), - new Float32Array([2,3]), - ],[ - new Float32Array([4,5]), - new Float32Array([6,7]), + new Float32Array([0, 1]), + new Float32Array([2, 3]), + ], + [ + new Float32Array([4, 5]), + new Float32Array([6, 7]), ] ]); }); test('erectFloat', () => { const array = new Float32Array([ - 0,0,0,0, - 1,0,0,0, - 2,0,0,0, - 3,0,0,0, - 4,0,0,0, - 5,0,0,0 + 0, 0, 0, 0, + 1, 0, 0, 0, + 2, 0, 0, 0, + 3, 0, 0, 0, + 4, 0, 0, 0, + 5, 0, 0, 0 ]); const result = utils.erectFloat(array, 6); - assert.deepEqual(result, new Float32Array([0,1,2,3,4,5])); + assert.deepEqual(result, new Float32Array([0, 1, 2, 3, 4, 5])); }); test('erect2DFloat', () => { const array = new Float32Array([ - 0,0,0,0, - 1,0,0,0, - 2,0,0,0, - 3,0,0,0, - 4,0,0,0, - 5,0,0,0, - 6,0,0,0, - 7,0,0,0, - 8,0,0,0, - 0,0,0,0 + 0, 0, 0, 0, + 1, 0, 0, 0, + 2, 0, 0, 0, + 3, 0, 0, 0, + 4, 0, 0, 0, + 5, 0, 0, 0, + 6, 0, 0, 0, + 7, 0, 0, 0, + 8, 0, 0, 0, + 0, 0, 0, 0 ]); const result = utils.erect2DFloat(array, 3, 3); assert.deepEqual(result, [ - new Float32Array([0,1,2]), - new Float32Array([3,4,5]), - new Float32Array([6,7,8]) + new Float32Array([0, 1, 2]), + new Float32Array([3, 4, 5]), + new Float32Array([6, 7, 8]) ]); }); test('erect3DFloat', () => { const array = new Float32Array([ - 0,0,0,0, - 1,0,0,0, - 2,0,0,0, - 3,0,0,0, - 4,0,0,0, - 5,0,0,0, - 6,0,0,0, - 7,0,0,0, - 0,0,0,0 + 0, 0, 0, 0, + 1, 0, 0, 0, + 2, 0, 0, 0, + 3, 0, 0, 0, + 4, 0, 0, 0, + 5, 0, 0, 0, + 6, 0, 0, 0, + 7, 0, 0, 0, + 0, 0, 0, 0 ]); const result = utils.erect3DFloat(array, 2, 2, 2); assert.deepEqual(result, [ [ - new Float32Array([0,1]), - new Float32Array([2,3]), - ],[ - new Float32Array([4,5]), - new Float32Array([6,7]), + new Float32Array([0, 1]), + new Float32Array([2, 3]), + ], + [ + new Float32Array([4, 5]), + new Float32Array([6, 7]), ] ]); }); test('erectArray2', () => { const array = new Float32Array([ - 0,1,0,0, - 2,3,0,0, - 4,5,0,0, - 6,7,0,0 + 0, 1, 0, 0, + 2, 3, 0, 0, + 4, 5, 0, 0, + 6, 7, 0, 0 ]); const result = utils.erectArray2(array, 4); assert.deepEqual(result, [ - new Float32Array([0,1]), - new Float32Array([2,3]), - new Float32Array([4,5]), - new Float32Array([6,7]), + new Float32Array([0, 1]), + new Float32Array([2, 3]), + new Float32Array([4, 5]), + new Float32Array([6, 7]), ]); }); test('erect2DArray2', () => { const array = new Float32Array([ - 0,1,0,0, - 2,3,0,0, - 4,5,0,0, - 6,7,0,0 + 0, 1, 0, 0, + 2, 3, 0, 0, + 4, 5, 0, 0, + 6, 7, 0, 0 ]); const result = utils.erect2DArray2(array, 2, 2); assert.deepEqual(result, [ [ - new Float32Array([0,1]), - new Float32Array([2,3]), + new Float32Array([0, 1]), + new Float32Array([2, 3]), ], [ - new Float32Array([4,5]), - new Float32Array([6,7]), + new Float32Array([4, 5]), + new Float32Array([6, 7]), ] ]); }); test('erect3DArray2', () => { const array = new Float32Array([ - 0,1,0,0, - 2,3,0,0, - 4,5,0,0, - 6,7,0,0, - 8,9,0,0, - 10,11,0,0, - 12,13,0,0, - 14,15,0,0, + 0, 1, 0, 0, + 2, 3, 0, 0, + 4, 5, 0, 0, + 6, 7, 0, 0, + 8, 9, 0, 0, + 10, 11, 0, 0, + 12, 13, 0, 0, + 14, 15, 0, 0, ]); const result = utils.erect3DArray2(array, 2, 2, 2); assert.deepEqual(result, [ [ [ - new Float32Array([0,1]), - new Float32Array([2,3]), + new Float32Array([0, 1]), + new Float32Array([2, 3]), ], [ - new Float32Array([4,5]), - new Float32Array([6,7]), + new Float32Array([4, 5]), + new Float32Array([6, 7]), ] ], [ [ - new Float32Array([8,9]), - new Float32Array([10,11]), + new Float32Array([8, 9]), + new Float32Array([10, 11]), ], [ - new Float32Array([12,13]), - new Float32Array([14,15]), + new Float32Array([12, 13]), + new Float32Array([14, 15]), ] ] ]); }); test('erectArray3', () => { const array = new Float32Array([ - 0,1,2,0, - 3,4,5,0, - 6,7,8,0, - 9,10,11,0 + 0, 1, 2, 0, + 3, 4, 5, 0, + 6, 7, 8, 0, + 9, 10, 11, 0 ]); const result = utils.erectArray3(array, 4); assert.deepEqual(result, [ - new Float32Array([0,1,2]), - new Float32Array([3,4,5]), - new Float32Array([6,7,8]), - new Float32Array([9,10,11]), + new Float32Array([0, 1, 2]), + new Float32Array([3, 4, 5]), + new Float32Array([6, 7, 8]), + new Float32Array([9, 10, 11]), ]); }); test('erect2DArray3', () => { const array = new Float32Array([ - 0,1,2,0, - 3,4,5,0, - 6,7,8,0, - 9,10,11,0, + 0, 1, 2, 0, + 3, 4, 5, 0, + 6, 7, 8, 0, + 9, 10, 11, 0, ]); const result = utils.erect2DArray3(array, 2, 2); assert.deepEqual(result, [ [ - new Float32Array([0,1,2]), - new Float32Array([3,4,5]), + new Float32Array([0, 1, 2]), + new Float32Array([3, 4, 5]), ], [ - new Float32Array([6,7,8]), - new Float32Array([9,10,11]), + new Float32Array([6, 7, 8]), + new Float32Array([9, 10, 11]), ] ]); }); test('erect3DArray3', () => { const array = new Float32Array([ - 0,1,2,0, - 3,4,5,0, - 6,7,8,0, - 9,10,11,0, - 12,13,14,0, - 15,16,17,0, - 18,19,20,0, - 21,22,23,0, + 0, 1, 2, 0, + 3, 4, 5, 0, + 6, 7, 8, 0, + 9, 10, 11, 0, + 12, 13, 14, 0, + 15, 16, 17, 0, + 18, 19, 20, 0, + 21, 22, 23, 0, ]); const result = utils.erect3DArray3(array, 2, 2, 2); assert.deepEqual(result, [ [ [ - new Float32Array([0,1,2]), - new Float32Array([3,4,5]), + new Float32Array([0, 1, 2]), + new Float32Array([3, 4, 5]), ], [ - new Float32Array([6,7,8]), - new Float32Array([9,10,11]), + new Float32Array([6, 7, 8]), + new Float32Array([9, 10, 11]), ] ], [ [ - new Float32Array([12,13,14]), - new Float32Array([15,16,17]), + new Float32Array([12, 13, 14]), + new Float32Array([15, 16, 17]), ], [ - new Float32Array([18,19,20]), - new Float32Array([21,22,23]), + new Float32Array([18, 19, 20]), + new Float32Array([21, 22, 23]), ] ] ]); }); test('erectArray4', () => { const array = new Float32Array([ - 0,1,2,3, - 4,5,6,7, - 8,9,10,11, - 12,13,14,15, + 0, 1, 2, 3, + 4, 5, 6, 7, + 8, 9, 10, 11, + 12, 13, 14, 15, ]); const result = utils.erectArray4(array, 4); assert.deepEqual(result, [ - new Float32Array([0,1,2,3]), - new Float32Array([4,5,6,7]), - new Float32Array([8,9,10,11]), - new Float32Array([12,13,14,15]), + new Float32Array([0, 1, 2, 3]), + new Float32Array([4, 5, 6, 7]), + new Float32Array([8, 9, 10, 11]), + new Float32Array([12, 13, 14, 15]), ]); }); test('erect2DArray4', () => { const array = new Float32Array([ - 0,1,2,3, - 4,5,6,7, - 8,9,10,11, - 12,13,14,15, + 0, 1, 2, 3, + 4, 5, 6, 7, + 8, 9, 10, 11, + 12, 13, 14, 15, ]); const result = utils.erect2DArray4(array, 2, 2); assert.deepEqual(result, [ [ - new Float32Array([0,1,2,3]), - new Float32Array([4,5,6,7]), + new Float32Array([0, 1, 2, 3]), + new Float32Array([4, 5, 6, 7]), ], [ - new Float32Array([8,9,10,11]), - new Float32Array([12,13,14,15]), + new Float32Array([8, 9, 10, 11]), + new Float32Array([12, 13, 14, 15]), ] ]); }); test('erect3DArray4', () => { const array = new Float32Array([ - 0,1,2,3, - 4,5,6,7, - 8,9,10,11, - 12,13,14,15, - 16,17,18,19, - 20,21,22,23, - 24,25,26,27, - 28,29,30,31, + 0, 1, 2, 3, + 4, 5, 6, 7, + 8, 9, 10, 11, + 12, 13, 14, 15, + 16, 17, 18, 19, + 20, 21, 22, 23, + 24, 25, 26, 27, + 28, 29, 30, 31, ]); const result = utils.erect3DArray4(array, 2, 2, 2); assert.deepEqual(result, [ [ [ - new Float32Array([0,1,2,3]), - new Float32Array([4,5,6,7]), + new Float32Array([0, 1, 2, 3]), + new Float32Array([4, 5, 6, 7]), ], [ - new Float32Array([8,9,10,11]), - new Float32Array([12,13,14,15]), + new Float32Array([8, 9, 10, 11]), + new Float32Array([12, 13, 14, 15]), ] ], [ [ - new Float32Array([16,17,18,19]), - new Float32Array([20,21,22,23]), + new Float32Array([16, 17, 18, 19]), + new Float32Array([20, 21, 22, 23]), ], [ - new Float32Array([24,25,26,27]), - new Float32Array([28,29,30,31]), + new Float32Array([24, 25, 26, 27]), + new Float32Array([28, 29, 30, 31]), ] ] ]); @@ -591,7 +626,7 @@ test('proper getMinifySafeName usage with arrow function', () => { test('proper getMinifySafeName usage with regular function', () => { function n() {} - const safeName = utils.getMinifySafeName(function () { + const safeName = utils.getMinifySafeName(function() { return n; }); assert.equal(safeName, 'n'); diff --git a/test/issues/114-create-kernel-map-run-second-time.js b/test/issues/114-create-kernel-map-run-second-time.js index 7d15c517..265d3ed8 100644 --- a/test/issues/114-create-kernel-map-run-second-time.js +++ b/test/issues/114-create-kernel-map-run-second-time.js @@ -2,16 +2,18 @@ const { assert, skip, test, module: describe } = require('qunit'); const { GPU } = require('../../src'); describe('issue # 114'); + function secondKernelMap(mode) { const gpu = new GPU({ mode }); const A = [1, 2, 3, 4, 5]; const B = [1, 2, 3, 4, 5]; - function add(a,b){ + + function add(a, b) { return a + b; } const kernels = gpu.createKernelMap([add], function(a, b) { - return add(a[this.thread.x], b[this.thread.x]); - }) + return add(a[this.thread.x], b[this.thread.x]); + }) .setOutput([5]); const E = kernels(A, B).result; @@ -37,4 +39,4 @@ function secondKernelMap(mode) { }); (GPU.isHeadlessGLSupported && GPU.isKernelMapSupported ? test : skip)("Issue #114 - run createKernelMap the second time headlessgl", () => { secondKernelMap('headlessgl'); -}); +}); \ No newline at end of file diff --git a/test/issues/116-multiple-kernels-run-again.js b/test/issues/116-multiple-kernels-run-again.js index a3bd4a22..8221b8fe 100644 --- a/test/issues/116-multiple-kernels-run-again.js +++ b/test/issues/116-multiple-kernels-run-again.js @@ -10,16 +10,16 @@ function multipleKernels(mode) { const sizes = [2, 5, 1]; - function add(a, b, x){ + function add(a, b, x) { return a[x] + b[x]; } const layerForward = []; - for (let i = 0; i < 2; i++) { - const kernels = gpu.createKernelMap([add],function(a, b){ - return add(a,b, this.thread.x); - }) + for (let i = 0; i < 2; i++) { + const kernels = gpu.createKernelMap([add], function(a, b) { + return add(a, b, this.thread.x); + }) .setOutput([sizes[i + 1]]); // First: 5. Second: 1. layerForward.push(kernels); @@ -57,4 +57,4 @@ function multipleKernels(mode) { test("Issue #116 - multiple kernels run again cpu", () => { multipleKernels('cpu'); -}); +}); \ No newline at end of file diff --git a/test/issues/130-typed-array.js b/test/issues/130-typed-array.js index ab79483e..f332ff58 100644 --- a/test/issues/130-typed-array.js +++ b/test/issues/130-typed-array.js @@ -2,11 +2,12 @@ const { assert, skip, test, module: describe } = require('qunit'); const { GPU } = require('../../src'); describe('issue #130'); + function typedArrays(mode) { const gpu = new GPU({ mode }); const kernel = gpu.createKernel(function(changes) { - return changes[this.thread.y][this.thread.x]; - }) + return changes[this.thread.y][this.thread.x]; + }) .setOutput([2, 1]); const values = [new Float32Array(2)]; @@ -40,4 +41,4 @@ test("Issue #130 - typed array gpu", () => { test("Issue #130 - typed array cpu", () => { typedArrays('cpu'); -}); +}); \ No newline at end of file diff --git a/test/issues/147-missing-constant.js b/test/issues/147-missing-constant.js index f6d8a5d9..409c1f35 100644 --- a/test/issues/147-missing-constant.js +++ b/test/issues/147-missing-constant.js @@ -5,13 +5,14 @@ describe('issue #147'); function missingConstant(mode) { const gpu = new GPU({ mode }); + function getPi() { return this.constants.pi; } gpu.addFunction(getPi); const kernel = gpu.createKernel(function() { - return getPi(); - }) + return getPi(); + }) .setOutput([1]) .setConstants({ pi: Math.PI }); @@ -42,4 +43,4 @@ test("Issue #147 - missing constant gpu", () => { test("Issue #147 - missing constant cpu", () => { missingConstant('cpu'); -}); +}); \ No newline at end of file diff --git a/test/issues/152-for-vars.js b/test/issues/152-for-vars.js index af1eef22..2ac0f6af 100644 --- a/test/issues/152-for-vars.js +++ b/test/issues/152-for-vars.js @@ -7,12 +7,12 @@ function forVars(mode) { const gpu = new GPU({ mode }); const kernel = gpu.createKernel(function() { - let sum = 0; - for (let i = 0; i < 2; i++) { - sum += i; - } - return sum; - }) + let sum = 0; + for (let i = 0; i < 2; i++) { + sum += i; + } + return sum; + }) .setOutput([1, 1]); const result = kernel(); @@ -43,4 +43,4 @@ test('Issue #152 - for vars gpu', () => { (GPU.isHeadlessGLSupported ? test : skip)('Issue #152 - for vars headlessgl', () => { forVars('headlessgl'); -}); +}); \ No newline at end of file diff --git a/test/issues/159-3d.js b/test/issues/159-3d.js index 4f4f66ca..5296799e 100644 --- a/test/issues/159-3d.js +++ b/test/issues/159-3d.js @@ -4,12 +4,13 @@ describe('issue # 159'); (function() { const { GPU } = require('../../src'); + function threeD(mode) { const gpu = new GPU({ mode }); const kernel = gpu.createKernel(function(grid) { - return grid[this.thread.y][this.thread.x]; - }) + return grid[this.thread.y][this.thread.x]; + }) .setOutput([5, 5]); //This would cause the above to fail @@ -18,19 +19,19 @@ describe('issue # 159'); .build(); const result = kernel([ - [0,1,2,3,4], - [1,2,3,4,5], - [2,3,4,5,6], - [3,4,5,6,7], - [4,5,6,7,8] + [0, 1, 2, 3, 4], + [1, 2, 3, 4, 5], + [2, 3, 4, 5, 6], + [3, 4, 5, 6, 7], + [4, 5, 6, 7, 8] ]); assert.equal(result.length, 5); assert.deepEqual(result.map(function(v) { return Array.from(v); }), [ - [0,1,2,3,4], - [1,2,3,4,5], - [2,3,4,5,6], - [3,4,5,6,7], - [4,5,6,7,8] + [0, 1, 2, 3, 4], + [1, 2, 3, 4, 5], + [2, 3, 4, 5, 6], + [3, 4, 5, 6, 7], + [4, 5, 6, 7, 8] ]); gpu.destroy(); } @@ -58,4 +59,4 @@ describe('issue # 159'); test('Issue #159 - for vars cpu', () => { threeD('cpu'); }); -})(); +})(); \ No newline at end of file diff --git a/test/issues/174-webgl-context-warning.js b/test/issues/174-webgl-context-warning.js index b9329011..c4598dc9 100644 --- a/test/issues/174-webgl-context-warning.js +++ b/test/issues/174-webgl-context-warning.js @@ -3,7 +3,11 @@ const { GPU } = require('../../src'); describe('issue # 174'); -const input = [[0, 1, 2], [3, 4, 5], [6, 7, 8]]; +const input = [ + [0, 1, 2], + [3, 4, 5], + [6, 7, 8] +]; // recursive! function manyKernels(mode, kernelCount, t) { @@ -42,4 +46,4 @@ function manyKernels(mode, kernelCount, t) { (GPU.isWebGL2Supported ? test : skip)('Issue #174 - webgl context leak webgl2', t => { manyKernels('webgl2', 10, t); -}); +}); \ No newline at end of file diff --git a/test/issues/195-read-from-texture2d.js b/test/issues/195-read-from-texture2d.js index 00e1e68f..4908bdd6 100644 --- a/test/issues/195-read-from-texture2d.js +++ b/test/issues/195-read-from-texture2d.js @@ -2,22 +2,23 @@ const { assert, skip, test, module: describe } = require('qunit'); const { GPU } = require('../../src'); describe('issue #195'); + function makeKernel(gpu) { - return gpu.createKernel(function(a){ - return a[this.thread.y][this.thread.x]; - }) + return gpu.createKernel(function(a) { + return a[this.thread.y][this.thread.x]; + }) .setOutput([matrixSize, matrixSize]); } function splitArray(array, part) { const result = []; - for(let i = 0; i < array.length; i += part) { + for (let i = 0; i < array.length; i += part) { result.push(array.slice(i, i + part)); } return result; } -const matrixSize = 4; +const matrixSize = 4; const A = splitArray(Array.apply(null, Array(matrixSize * matrixSize)).map((_, i) => i), matrixSize); function readFromTexture(mode) { @@ -53,5 +54,4 @@ test("Issue #195 Read from Texture 2D (GPU only) gpu", () => { (GPU.isHeadlessGLSupported ? test : skip)("Issue #195 Read from Texture 2D (GPU Only) headlessgl", () => { readFromTexture('headlessgl'); -}); - +}); \ No newline at end of file diff --git a/test/issues/207-same-function-reuse.js b/test/issues/207-same-function-reuse.js index c117ada9..9706aa1f 100644 --- a/test/issues/207-same-function-reuse.js +++ b/test/issues/207-same-function-reuse.js @@ -7,22 +7,24 @@ function sameFunctionReuse(mode) { const gpu = new GPU({ mode }); const kernel = gpu.createKernel(function(kernelArg1, kernelArg2) { - function someFun1(someFun1Arg1, someFun1Arg2) { - return customAdder(someFun1Arg1, someFun1Arg2); - } - function someFun2(someFun2Arg1, someFun2Arg2) { - return customAdder(someFun2Arg1, someFun2Arg2); - } - function customAdder(customAdderArg1, customAdderArg2) { - return customAdderArg1 + customAdderArg2; - } - return someFun1(1, 2) + someFun2(kernelArg1[this.thread.x], kernelArg2[this.thread.x]); - }) + function someFun1(someFun1Arg1, someFun1Arg2) { + return customAdder(someFun1Arg1, someFun1Arg2); + } + + function someFun2(someFun2Arg1, someFun2Arg2) { + return customAdder(someFun2Arg1, someFun2Arg2); + } + + function customAdder(customAdderArg1, customAdderArg2) { + return customAdderArg1 + customAdderArg2; + } + return someFun1(1, 2) + someFun2(kernelArg1[this.thread.x], kernelArg2[this.thread.x]); + }) .setOutput([6]); const a = [1, 2, 3, 5, 6, 7]; const b = [4, 5, 6, 1, 2, 3]; - const result = kernel(a,b); + const result = kernel(a, b); assert.deepEqual(Array.from(result), [8, 10, 12, 9, 11, 13]); gpu.destroy(); } @@ -49,4 +51,4 @@ test('Issue #207 - same function reuse gpu', () => { test('Issue #207 - same function reuse cpu', () => { sameFunctionReuse('cpu'); -}); +}); \ No newline at end of file diff --git a/test/issues/212-funky-function-support.js b/test/issues/212-funky-function-support.js index de65e5e3..54d94acf 100644 --- a/test/issues/212-funky-function-support.js +++ b/test/issues/212-funky-function-support.js @@ -14,15 +14,15 @@ function funky(mode) { .setOutput([2, 2]); const result = kernel([ - [0,1], - [1,2] + [0, 1], + [1, 2] ], [ - [0,1], - [1,2] + [0, 1], + [1, 2] ]); assert.deepEqual(result.map((v) => Array.from(v)), [ - [0,2], - [2,4] + [0, 2], + [2, 4] ]); gpu.destroy(); } @@ -49,4 +49,4 @@ test('Issue #212 - funky function support gpu', () => { test('Issue #212 - funky function support cpu', () => { funky('cpu'); -}); +}); \ No newline at end of file diff --git a/test/issues/233-kernel-map-single-precision.js b/test/issues/233-kernel-map-single-precision.js index c82ac744..29eb225b 100644 --- a/test/issues/233-kernel-map-single-precision.js +++ b/test/issues/233-kernel-map-single-precision.js @@ -9,13 +9,13 @@ function kernelMapSinglePrecision(mode) { const lst = [1, 2, 3, 4, 5, 6, 7]; const gpu = new GPU({ mode }); const kernels = gpu.createKernelMap({ - stepA: function (x) { + stepA: function(x) { return x * x; }, - stepB: function (x) { + stepB: function(x) { return x + 1; } - }, function (lst) { + }, function(lst) { const val = lst[this.thread.x]; stepA(val); @@ -71,29 +71,29 @@ test('Issue #233 - kernel map with single precision cpu', () => { function kernelMapSinglePrecision2D(mode) { const lst = [ - [1,2,3], - [4,5,6], - [7,8,9] + [1, 2, 3], + [4, 5, 6], + [7, 8, 9] ]; const stepAExpected = [ - [1,4,9], - [16,25,36], - [49,64,81], + [1, 4, 9], + [16, 25, 36], + [49, 64, 81], ]; const stepBExpected = [ - [2,3,4], - [5,6,7], - [8,9,10] + [2, 3, 4], + [5, 6, 7], + [8, 9, 10] ]; const gpu = new GPU({ mode }); const kernels = gpu.createKernelMap({ - stepA: function (x) { + stepA: function(x) { return x * x; }, - stepB: function (x) { + stepB: function(x) { return x + 1; } - }, function (lst) { + }, function(lst) { const val = lst[this.thread.y][this.thread.x]; stepA(val); @@ -153,49 +153,49 @@ test('Issue #233 - kernel map with single precision 2d cpu', () => { function kernelMapSinglePrecision3D(mode) { const lst = [ [ - [1,2,3], - [4,5,6], - [7,8,9] + [1, 2, 3], + [4, 5, 6], + [7, 8, 9] ], [ - [10,11,12], - [13,14,15], - [16,17,18] + [10, 11, 12], + [13, 14, 15], + [16, 17, 18] ] ]; const stepAExpected = [ [ - [1,4,9], - [16,25,36], - [49,64,81], + [1, 4, 9], + [16, 25, 36], + [49, 64, 81], ], [ - [100,121,144], - [169,196,225], - [256,289,324], + [100, 121, 144], + [169, 196, 225], + [256, 289, 324], ] ]; const stepBExpected = [ [ - [2,3,4], - [5,6,7], - [8,9,10] + [2, 3, 4], + [5, 6, 7], + [8, 9, 10] ], [ - [11,12,13], - [14,15,16], - [17,18,19] + [11, 12, 13], + [14, 15, 16], + [17, 18, 19] ] ]; const gpu = new GPU({ mode }); const kernels = gpu.createKernelMap({ - stepA: function (x) { + stepA: function(x) { return x * x; }, - stepB: function (x) { + stepB: function(x) { return x + 1; } - }, function (lst) { + }, function(lst) { const val = lst[this.thread.z][this.thread.y][this.thread.x]; stepA(val); @@ -254,4 +254,4 @@ function kernelMapSinglePrecision3D(mode) { test('Issue #233 - kernel map with single precision 3d cpu', () => { kernelMapSinglePrecision3D('cpu'); -}); +}); \ No newline at end of file diff --git a/test/issues/241-CPU-vs-GPU-maps-output-differently.js b/test/issues/241-CPU-vs-GPU-maps-output-differently.js index 2297a178..1b270ea5 100644 --- a/test/issues/241-CPU-vs-GPU-maps-output-differently.js +++ b/test/issues/241-CPU-vs-GPU-maps-output-differently.js @@ -5,7 +5,12 @@ describe('issue #241'); // this is actually equiv to // return this.thread.y * 3 + this.thread.x; -const input = [[0, 1, 2], [3, 4, 5], [6, 7, 8]]; +const input = [ + [0, 1, 2], + [3, 4, 5], + [6, 7, 8] +]; + function buildIndexTestKernel(mode) { const gpu = new GPU({ mode }); const kernel = gpu.createKernel(function(inp) { @@ -40,4 +45,4 @@ test('Issue #241 small 2d array input output test gpu', () => { test('Issue #241 small 2d array input output test cpu', () => { buildIndexTestKernel('cpu'); -}); +}); \ No newline at end of file diff --git a/test/issues/259-atan2.js b/test/issues/259-atan2.js index b4366d19..e51b44ee 100644 --- a/test/issues/259-atan2.js +++ b/test/issues/259-atan2.js @@ -36,4 +36,4 @@ test('Issue #259 atan2 - gpu', () => { test('Issue #259 atan2 - cpu', () => { buildAtan2KernelResult('cpu'); -}); +}); \ No newline at end of file diff --git a/test/issues/263-to-string.js b/test/issues/263-to-string.js index f811e017..80554b33 100644 --- a/test/issues/263-to-string.js +++ b/test/issues/263-to-string.js @@ -36,4 +36,4 @@ function toString(mode, context, canvas) { test('Issue #263 toString single function - cpu', () => { toString('cpu'); -}); +}); \ No newline at end of file diff --git a/test/issues/267-immutable-sub-kernels.js b/test/issues/267-immutable-sub-kernels.js index eda40838..76d2f4c6 100644 --- a/test/issues/267-immutable-sub-kernels.js +++ b/test/issues/267-immutable-sub-kernels.js @@ -5,7 +5,7 @@ describe('issue #267 kernel'); function immutableKernelWithoutFloats(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function (v) { + const kernel = gpu.createKernel(function(v) { return v[this.thread.x] + 1; }, { output: [1], @@ -54,7 +54,7 @@ test('Issue #267 immutable kernel output without floats - gpu', () => { function immutableKernelWithFloats(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function (v) { + const kernel = gpu.createKernel(function(v) { return v[this.thread.x] + 1; }, { output: [1], @@ -109,16 +109,14 @@ function immutableSubKernelsWithoutFloats(mode) { } const gpu = new GPU({ mode }); - const kernel = gpu.createKernelMap( - { + const kernel = gpu.createKernelMap({ valueOutput1: value1, valueOutput2: value2 }, - function (a, b) { + function(a, b) { value1(a[this.thread.x]); return value2(b[this.thread.x]); - }, - { + }, { output: [1], immutable: true, pipeline: true, @@ -166,6 +164,7 @@ function immutableSubKernelsWithoutFloats(mode) { describe('issue #267 sub kernels mixed'); + function immutableKernelsMixedWithoutFloats(mode) { function value1(value) { return value + 10; @@ -176,16 +175,14 @@ function immutableKernelsMixedWithoutFloats(mode) { } const gpu = new GPU({ mode }); - const kernel = gpu.createKernelMap( - { + const kernel = gpu.createKernelMap({ valueOutput1: value1, valueOutput2: value2, }, - function (a, b) { + function(a, b) { value1(a[this.thread.x]); return value2(b[this.thread.x]) + 100; - }, - { + }, { output: [1], immutable: true, pipeline: true, @@ -242,4 +239,4 @@ function immutableKernelsMixedWithoutFloats(mode) { test('Issue #267 immutable kernel & sub-kernel output without floats - cpu', () => { immutableKernelsMixedWithoutFloats('cpu'); -}); +}); \ No newline at end of file diff --git a/test/issues/270-cache.js b/test/issues/270-cache.js index d08a6e80..47c17ba7 100644 --- a/test/issues/270-cache.js +++ b/test/issues/270-cache.js @@ -13,4 +13,4 @@ test('Issue #270 WebGlKernel getUniformLocation caches falsey - gpu', () => { const kernel = new WebGLKernel('function() {}', { canvas, context }); kernel.programUniformLocationCache.test = false; assert.equal(kernel.getUniformLocation('test'), false); -}); +}); \ No newline at end of file diff --git a/test/issues/279-wrong-canvas-size.js b/test/issues/279-wrong-canvas-size.js index ea072def..8d2a73fa 100644 --- a/test/issues/279-wrong-canvas-size.js +++ b/test/issues/279-wrong-canvas-size.js @@ -4,20 +4,21 @@ const { GPU } = require('../../src'); describe('issue #279'); const WIDTH = 600; -const HEIGHT = 400; +const HEIGHT = 400; + function wrongCanvasSizeOptimized(mode) { const gpu = new GPU({ mode }); const initMatrix = gpu.createKernel(function(value) { - return value; - }) + return value; + }) .setOptimizeFloatMemory(true) .setOutput([WIDTH, HEIGHT]); const render = gpu.createKernel(function(matrix) { - const i = matrix[this.thread.y][this.thread.x]; - this.color(i, i, i, 1); - }) + const i = matrix[this.thread.y][this.thread.x]; + this.color(i, i, i, 1); + }) .setOutput([WIDTH, HEIGHT]) .setGraphical(true); @@ -54,15 +55,15 @@ function wrongCanvasSizeUnoptimized(mode) { const gpu = new GPU({ mode }); const initMatrix = gpu.createKernel(function(value) { - return value; - }) + return value; + }) .setOptimizeFloatMemory(false) .setOutput([WIDTH, HEIGHT]); const render = gpu.createKernel(function(matrix) { - const i = matrix[this.thread.y][this.thread.x]; - this.color(i, i, i, 1); - }) + const i = matrix[this.thread.y][this.thread.x]; + this.color(i, i, i, 1); + }) .setOutput([WIDTH, HEIGHT]) .setGraphical(true); @@ -92,4 +93,4 @@ test('Issue #279 wrong canvas size unoptimized - gpu', () => { (GPU.isHeadlessGLSupported ? test : skip)('Issue #279 wrong canvas size unoptimized - headlessgl', () => { wrongCanvasSizeUnoptimized('headlessgl'); -}); +}); \ No newline at end of file diff --git a/test/issues/300-nested-array-index.js b/test/issues/300-nested-array-index.js index c20d59cf..b3ecc439 100644 --- a/test/issues/300-nested-array-index.js +++ b/test/issues/300-nested-array-index.js @@ -9,14 +9,14 @@ function nestedArrayIndex(mode) { // these 2 should be equivalent const broken = gpu1.createKernel(function(input, lookup) { - return lookup[input[this.thread.x]]; - }) + return lookup[input[this.thread.x]]; + }) .setOutput([1]); const working = gpu2.createKernel(function(input, lookup) { - const idx = input[this.thread.x]; - return lookup[idx]; - }) + const idx = input[this.thread.x]; + return lookup[idx]; + }) .setOutput([1]); assert.equal(broken([2], [7, 13, 19, 23])[0], 19); @@ -48,4 +48,4 @@ test('Issue #300 nested array index - gpu', () => { test('Issue #300 nested array index - cpu', () => { nestedArrayIndex('cpu'); -}); +}); \ No newline at end of file diff --git a/test/issues/31-nested-var-declare-test.js b/test/issues/31-nested-var-declare-test.js index f87deb41..a5632e5c 100644 --- a/test/issues/31-nested-var-declare-test.js +++ b/test/issues/31-nested-var-declare-test.js @@ -8,9 +8,9 @@ function nestedVarRedeclareFunction() { let result = 0; // outer loop limit is effectively skipped in CPU - for(let i=0; i<10; ++i) { + for (let i = 0; i < 10; ++i) { // inner loop limit should be higher, to avoid infinite loops - for(i=0; i<20; ++i) { + for (i = 0; i < 20; ++i) { result += 1; } } @@ -90,9 +90,9 @@ function nestedVarDeclareFunction() { let result = 0.0; // outer loop limit is effectively skipped in CPU - for(let i=0; i<10; ++i) { + for (let i = 0; i < 10; ++i) { // inner loop limit should be higher, to avoid infinite loops - for(let i=0; i<20; ++i) { + for (let i = 0; i < 20; ++i) { result += 1; } } @@ -100,10 +100,10 @@ function nestedVarDeclareFunction() { return result; } -function nestedVarDeclareTest(mode ) { +function nestedVarDeclareTest(mode) { const gpu = new GPU({ mode }); const f = gpu.createKernel(nestedVarDeclareFunction, { - output : [1] + output: [1] }); assert.equal(f(), 200, 'basic return function test'); @@ -141,15 +141,16 @@ test('Issue #31 - nestedVarDeclare : AST handling webgl', () => { assert.equal( builder.getStringFromFunctionNames(['nestedVarDeclareFunction']), - 'float nestedVarDeclareFunction() {' - + '\nfloat user_result=0.0;' - + '\nfor (int user_i=0;(user_i<10);++user_i){' - + '\nfor (int user_i=0;(user_i<20);++user_i){' //<-- Note: don't do this in real life! - + '\nuser_result+=1.0;}' - + '\n}' - + '\n' - + '\nreturn user_result;' - + '\n}' + 'float nestedVarDeclareFunction() {' + + '\nfloat user_result=0.0;' + + '\nfor (int user_i=0;(user_i<10);++user_i){' + + '\nfor (int user_i=0;(user_i<20);++user_i){' //<-- Note: don't do this in real life! + + + '\nuser_result+=1.0;}' + + '\n}' + + '\n' + + '\nreturn user_result;' + + '\n}' ); }); @@ -160,15 +161,16 @@ test('Issue #31 - nestedVarDeclare : AST handling webgl2', () => { assert.equal( builder.getStringFromFunctionNames(['nestedVarDeclareFunction']), - 'float nestedVarDeclareFunction() {' - + '\nfloat user_result=0.0;' - + '\nfor (int user_i=0;(user_i<10);++user_i){' - + '\nfor (int user_i=0;(user_i<20);++user_i){' //<-- Note: don't do this in real life! - + '\nuser_result+=1.0;}' - + '\n}' - + '\n' - + '\nreturn user_result;' - + '\n}' + 'float nestedVarDeclareFunction() {' + + '\nfloat user_result=0.0;' + + '\nfor (int user_i=0;(user_i<10);++user_i){' + + '\nfor (int user_i=0;(user_i<20);++user_i){' //<-- Note: don't do this in real life! + + + '\nuser_result+=1.0;}' + + '\n}' + + '\n' + + '\nreturn user_result;' + + '\n}' ); }); @@ -179,14 +181,14 @@ test('Issue #31 - nestedVarDeclare : AST handling cpu', () => { assert.equal( builder.getStringFromFunctionNames(['nestedVarDeclareFunction']), - 'function nestedVarDeclareFunction() {' - + '\nlet user_result=0;' - + '\nfor (let user_i=0;(user_i<10);++user_i){' - + '\nfor (let user_i=0;(user_i<20);++user_i){' - + '\nuser_result+=1;}' - + '\n}' - + '\n' - + '\nreturn user_result;' - + '\n}' + 'function nestedVarDeclareFunction() {' + + '\nlet user_result=0;' + + '\nfor (let user_i=0;(user_i<10);++user_i){' + + '\nfor (let user_i=0;(user_i<20);++user_i){' + + '\nuser_result+=1;}' + + '\n}' + + '\n' + + '\nreturn user_result;' + + '\n}' ); -}); +}); \ No newline at end of file diff --git a/test/issues/313-variable-lookup.js b/test/issues/313-variable-lookup.js index e1dd00e9..f04944be 100644 --- a/test/issues/313-variable-lookup.js +++ b/test/issues/313-variable-lookup.js @@ -5,7 +5,7 @@ describe('issue #313'); function variableLookup(mode) { function mult2(scale) { - return 2*scale; + return 2 * scale; } const gpu = new GPU({ @@ -14,13 +14,13 @@ function variableLookup(mode) { }); const render1 = gpu.createKernel(function(input) { - return (mult2(input) + mult2(input*2) + mult2(input*1)) // RIGHT - }) + return (mult2(input) + mult2(input * 2) + mult2(input * 1)) // RIGHT + }) .setOutput([1]); const render2 = gpu.createKernel(function(input) { - return (mult2(input) + mult2(input*2) + mult2(input)); // WRONG - }) + return (mult2(input) + mult2(input * 2) + mult2(input)); // WRONG + }) .setOutput([1]); assert.equal(render1(1)[0], 8, 'render1 equals 8'); @@ -44,4 +44,4 @@ test('Issue #313 Mismatch argument lookup - gpu', () => { }); test('Issue #313 Mismatch argument lookup - cpu', () => { variableLookup('cpu'); -}); +}); \ No newline at end of file diff --git a/test/issues/314-large-input-array-addressing.js b/test/issues/314-large-input-array-addressing.js index 27882652..ce13f133 100644 --- a/test/issues/314-large-input-array-addressing.js +++ b/test/issues/314-large-input-array-addressing.js @@ -7,22 +7,23 @@ describe('issue #314'); // after this fix max addressing is 2^31 which is the max a int32 can handle // run out of heap before being able to create a butter that big! // wanted to use uints but caused more problems than it solved -const DATA_MAX = (GPU.isHeadlessGLSupported ? HeadlessGLKernel : WebGLKernel).features.maxTextureSize*8; +const DATA_MAX = (GPU.isHeadlessGLSupported ? HeadlessGLKernel : WebGLKernel).features.maxTextureSize * 8; const divisor = 100; const data = new Uint16Array(DATA_MAX); let v = 0; -for (let i = 0; i < DATA_MAX/divisor; i++) { +for (let i = 0; i < DATA_MAX / divisor; i++) { for (let j = 0; j < divisor; j++) { - data[i*divisor + j] = v++; + data[i * divisor + j] = v++; } } + function buildLargeArrayAddressKernel(mode) { const gpu = new GPU({ mode }); const largeArrayAddressKernel = gpu.createKernel(function(data) { - return data[this.thread.x]; - }, { - precision: 'unsigned', - }) + return data[this.thread.x]; + }, { + precision: 'unsigned', + }) .setOutput([DATA_MAX]); const result = largeArrayAddressKernel(data); @@ -56,4 +57,4 @@ test('Issue #314 Large array addressing - gpu', () => { }); (GPU.isHeadlessGLSupported ? test : skip)('Issue #314 Large array addressing - headlessgl', () => { buildLargeArrayAddressKernel('headlessgl'); -}); +}); \ No newline at end of file diff --git a/test/issues/335-missing-z-index-issue.js b/test/issues/335-missing-z-index-issue.js index e27d1666..4390027b 100644 --- a/test/issues/335-missing-z-index-issue.js +++ b/test/issues/335-missing-z-index-issue.js @@ -7,11 +7,15 @@ function missingZIndexIssue(mode) { const gpu = new GPU({ mode }); const kernel = gpu.createKernel(function(value) { - return value[this.thread.z][this.thread.y][this.thread.x]; - }) + return value[this.thread.z][this.thread.y][this.thread.x]; + }) .setOutput([1, 1, undefined]); - kernel([[[1]]]); + kernel([ + [ + [1] + ] + ]); gpu.destroy(); } @@ -43,4 +47,4 @@ test('Issue #335 Missing z index issue cpu', () => { assert.throws(() => { missingZIndexIssue('cpu'); }); -}); +}); \ No newline at end of file diff --git a/test/issues/346-uint8array-converted.js b/test/issues/346-uint8array-converted.js index 99b749c0..ea285cd3 100644 --- a/test/issues/346-uint8array-converted.js +++ b/test/issues/346-uint8array-converted.js @@ -11,11 +11,12 @@ for (let i = 0; i < DATA_MAX; i++) { uint8data[i] = Math.random() * 255; uint16data[i] = Math.random() * 255 * 255; } + function buildUintArrayInputKernel(mode, data) { const gpu = new GPU({ mode }); const largeArrayAddressKernel = gpu.createKernel(function(data) { - return data[this.thread.x]; - }, { precision: 'unsigned' }) + return data[this.thread.x]; + }, { precision: 'unsigned' }) .setOutput([DATA_MAX]); const result = largeArrayAddressKernel(data); @@ -53,4 +54,4 @@ function buildUintArrayInputKernel(mode, data) { (GPU.isHeadlessGLSupported ? test : skip)('Issue #346 uint16 input array - headlessgl', () => { buildUintArrayInputKernel('headlessgl', uint16data); -}); +}); \ No newline at end of file diff --git a/test/issues/349-division-by-factors-of-3.js b/test/issues/349-division-by-factors-of-3.js index 72462ea0..a0311ff2 100644 --- a/test/issues/349-division-by-factors-of-3.js +++ b/test/issues/349-division-by-factors-of-3.js @@ -4,8 +4,8 @@ const { GPU } = require('../../src'); describe('issue #349 divide by 3'); function testDivideByThree(mode) { - const gpu = new GPU({mode}); - const k = gpu.createKernel(function (v1, v2) { + const gpu = new GPU({ mode }); + const k = gpu.createKernel(function(v1, v2) { return v1 / v2; }, { output: [1], @@ -41,6 +41,7 @@ test('Issue #349 - divide by three cpu', () => { describe('issue #349 divide by random numbers'); + function someRandomWholeNumberDivisions(mode) { const DATA_MAX = 1024 * 1024; const dividendData = new Float32Array(DATA_MAX); @@ -52,8 +53,8 @@ function someRandomWholeNumberDivisions(mode) { expectedResults[i] = parseInt(Math.random() * maxWholeNumberRepresentation + 1, 10); dividendData[i] = divisorData[i] * expectedResults[i]; } - const gpu = new GPU({mode}); - const k = gpu.createKernel(function (v1, v2) { + const gpu = new GPU({ mode }); + const k = gpu.createKernel(function(v1, v2) { return v1[this.thread.x] / v2[this.thread.x]; }, { output: [DATA_MAX], @@ -93,8 +94,9 @@ test('Issue #349 - some random whole number divisions cpu', () => { describe('issue #349 disable integer division bug'); + function testDisableFixIntegerDivisionBug(mode) { - const gpu = new GPU({mode}); + const gpu = new GPU({ mode }); const idFix = gpu.createKernel(function(v1, v2) { return v1 / v2; }, { precision: 'single', output: [1] }); @@ -110,11 +112,11 @@ function testDisableFixIntegerDivisionBug(mode) { if (!gpu.Kernel.features.isIntegerDivisionAccurate) { assert.ok( ( - idFix(6, 3)[0] === 2 - && idFix(6030401, 3991)[0] === 1511 + idFix(6, 3)[0] === 2 && + idFix(6030401, 3991)[0] === 1511 ) && ( - idDixOff(6, 3)[0] !== 2 - || idDixOff(6030401, 3991)[0] !== 1511 + idDixOff(6, 3)[0] !== 2 || + idDixOff(6030401, 3991)[0] !== 1511 ), "when bug is present should show bug!"); } else { assert.ok(idFix(6, 3)[0] === 2 && idDixOff(6, 3)[0] === 2, "when bug isn't present should not show bug!"); @@ -129,7 +131,7 @@ function testDisableFixIntegerDivisionBug(mode) { testDisableFixIntegerDivisionBug('gpu'); }); -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('Issue #349 - test disable fix integer division bug webgl', () => { +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('Issue #349 - test disable fix integer division bug webgl', () => { testDisableFixIntegerDivisionBug('webgl'); }); @@ -143,4 +145,4 @@ function testDisableFixIntegerDivisionBug(mode) { test('Issue #349 - test disable fix integer division bug cpu', () => { testDisableFixIntegerDivisionBug('cpu'); -}); +}); \ No newline at end of file diff --git a/test/issues/357-modulus-issue.js b/test/issues/357-modulus-issue.js index 96b0cd48..0fabdeb8 100644 --- a/test/issues/357-modulus-issue.js +++ b/test/issues/357-modulus-issue.js @@ -5,7 +5,7 @@ describe('issue #357'); // complimentary tests in features/arithmetic-operators.js & features/assignment-operators.js function testModKernel(mode) { - const gpu = new GPU({mode}); + const gpu = new GPU({ mode }); const nValues = 100; const myFunc3 = gpu.createKernel(function(x) { @@ -33,5 +33,4 @@ function testModKernel(mode) { (GPU.isHeadlessGLSupported ? test : skip)('Issue #357 - modulus issue headlessgl', () => { testModKernel('headlessgl'); -}); - +}); \ No newline at end of file diff --git a/test/issues/359-addfunction-params-wrong.js b/test/issues/359-addfunction-params-wrong.js index 02186d74..010fa001 100644 --- a/test/issues/359-addfunction-params-wrong.js +++ b/test/issues/359-addfunction-params-wrong.js @@ -4,10 +4,12 @@ const { GPU } = require('../../src'); describe('issue #359'); function testAddFunctionKernel(mode) { - const gpu = new GPU({mode}); + const gpu = new GPU({ mode }); + function clcC(xx) { return Math.abs(xx); } + function intermediate(c1) { return clcC(c1); } @@ -36,4 +38,4 @@ function testAddFunctionKernel(mode) { (GPU.isHeadlessGLSupported ? test : skip)('Issue #359 - addFunction calls addFunction issue headlessgl', () => { testAddFunctionKernel('headlessgl') -}); +}); \ No newline at end of file diff --git a/test/issues/378-only-first-iteration.js b/test/issues/378-only-first-iteration.js index 39c5053b..4e92d2e2 100644 --- a/test/issues/378-only-first-iteration.js +++ b/test/issues/378-only-first-iteration.js @@ -7,12 +7,12 @@ function testOnlyFirstIterationSafari(mode) { const gpu = new GPU({ mode: mode }); const conflictingName = 0.4; const kernel = gpu.createKernel(function(iter) { - let sum = 0; - for(let i=2; i { testOnlyFirstIterationSafari('headlessgl'); -}); +}); \ No newline at end of file diff --git a/test/issues/382-bad-constant.js b/test/issues/382-bad-constant.js index aa711ce5..da861f96 100644 --- a/test/issues/382-bad-constant.js +++ b/test/issues/382-bad-constant.js @@ -7,8 +7,8 @@ function testModKernel(mode) { const gpu = new GPU({ mode: mode }); const conflictingName = 0.4; const kernel = gpu.createKernel(function(a, conflictingName) { - return a[this.thread.x] + this.constants.conflictingName + conflictingName; - }) + return a[this.thread.x] + this.constants.conflictingName + conflictingName; + }) .setOutput([1]) .setConstants({ conflictingName: conflictingName @@ -30,4 +30,4 @@ function testModKernel(mode) { (GPU.isHeadlessGLSupported ? test : skip)('Issue #382 - bad constant headlessgl', () => { testModKernel('headlessgl'); -}); +}); \ No newline at end of file diff --git a/test/issues/390-thread-assignment.js b/test/issues/390-thread-assignment.js index b4626a94..eeb85b7a 100644 --- a/test/issues/390-thread-assignment.js +++ b/test/issues/390-thread-assignment.js @@ -10,12 +10,12 @@ test('Issue #390 - thread assignment webgl', function(assert) { const sum = x + y; return sum; }.toString(), { output: [1], returnType: 'Number' }); - assert.equal(node.toString(), 'float assignThreadToVar() {' - + '\nfloat user_x=float(threadId.x);' - + '\nfloat user_y=float(threadId.y);' - + '\nfloat user_sum=(user_x+user_y);' - + '\nreturn user_sum;' - + '\n}'); + assert.equal(node.toString(), 'float assignThreadToVar() {' + + '\nfloat user_x=float(threadId.x);' + + '\nfloat user_y=float(threadId.y);' + + '\nfloat user_sum=(user_x+user_y);' + + '\nreturn user_sum;' + + '\n}'); const { x, y, sum } = node.contexts[1]; assert.equal(x.name, 'x'); assert.equal(x.valueType, 'Number'); @@ -32,12 +32,12 @@ test('Issue #390 - thread assignment webgl2', function(assert) { const sum = x + y; return sum; }.toString(), { output: [1], returnType: 'Number' }); - assert.equal(node.toString(), 'float assignThreadToVar() {' - + '\nfloat user_x=float(threadId.x);' - + '\nfloat user_y=float(threadId.y);' - + '\nfloat user_sum=(user_x+user_y);' - + '\nreturn user_sum;' - + '\n}'); + assert.equal(node.toString(), 'float assignThreadToVar() {' + + '\nfloat user_x=float(threadId.x);' + + '\nfloat user_y=float(threadId.y);' + + '\nfloat user_sum=(user_x+user_y);' + + '\nreturn user_sum;' + + '\n}'); const { x, y, sum } = node.contexts[1]; assert.equal(x.name, 'x'); assert.equal(x.valueType, 'Number'); @@ -54,12 +54,12 @@ test('Issue #390 - thread assignment cpu', function(assert) { const sum = x + y; return sum; }.toString(), { output: [1] }); - assert.equal(node.toString(), 'function assignThreadToVar() {' - + '\nconst user_x=_this.thread.x;' - + '\nconst user_y=_this.thread.y;' - + '\nconst user_sum=(user_x+user_y);' - + '\nreturn user_sum;' - + '\n}'); + assert.equal(node.toString(), 'function assignThreadToVar() {' + + '\nconst user_x=_this.thread.x;' + + '\nconst user_y=_this.thread.y;' + + '\nconst user_sum=(user_x+user_y);' + + '\nreturn user_sum;' + + '\n}'); const { x, y, z, sum } = node.contexts[1]; assert.equal(x.name, 'x'); assert.equal(x.valueType, 'Integer'); @@ -78,15 +78,15 @@ test('Issue #390 (related) - output assignment webgl', function(assert) { const sum = x + y + z; return sum; }.toString(), { - output: [1,2,3] + output: [1, 2, 3] }); - assert.equal(node.toString(), 'float assignThreadToVar() {' - + '\nfloat user_x=1.0;' - + '\nfloat user_y=2.0;' - + '\nfloat user_z=3.0;' - + '\nfloat user_sum=((user_x+user_y)+user_z);' - + '\nreturn user_sum;' - + '\n}'); + assert.equal(node.toString(), 'float assignThreadToVar() {' + + '\nfloat user_x=1.0;' + + '\nfloat user_y=2.0;' + + '\nfloat user_z=3.0;' + + '\nfloat user_sum=((user_x+user_y)+user_z);' + + '\nreturn user_sum;' + + '\n}'); const { x, y, z, sum } = node.contexts[1]; assert.equal(x.name, 'x'); assert.equal(x.valueType, 'Number'); @@ -106,15 +106,15 @@ test('Issue #390 (related) - output assignment webgl2', function(assert) { const sum = x + y + z; return sum; }.toString(), { - output: [1,2,3] + output: [1, 2, 3] }); - assert.equal(node.toString(), 'float assignThreadToVar() {' - + '\nfloat user_x=1.0;' - + '\nfloat user_y=2.0;' - + '\nfloat user_z=3.0;' - + '\nfloat user_sum=((user_x+user_y)+user_z);' - + '\nreturn user_sum;' - + '\n}'); + assert.equal(node.toString(), 'float assignThreadToVar() {' + + '\nfloat user_x=1.0;' + + '\nfloat user_y=2.0;' + + '\nfloat user_z=3.0;' + + '\nfloat user_sum=((user_x+user_y)+user_z);' + + '\nreturn user_sum;' + + '\n}'); const context = node.contexts[1]; const { x, y, z, sum } = context; assert.equal(x.name, 'x'); @@ -135,15 +135,15 @@ test('Issue #390 (related) - output assignment cpu', function(assert) { const sum = x + y + z; return sum; }`, { - output: [1,2,3] + output: [1, 2, 3] }); - assert.equal(node.toString(), 'function assignThreadToVar() {' - + '\nconst user_x=outputX;' - + '\nconst user_y=outputY;' - + '\nconst user_z=outputZ;' - + '\nconst user_sum=((user_x+user_y)+user_z);' - + '\nreturn user_sum;' - + '\n}'); + assert.equal(node.toString(), 'function assignThreadToVar() {' + + '\nconst user_x=outputX;' + + '\nconst user_y=outputY;' + + '\nconst user_z=outputZ;' + + '\nconst user_sum=((user_x+user_y)+user_z);' + + '\nreturn user_sum;' + + '\n}'); const context = node.contexts[1]; const { x, y, z, sum } = context; assert.equal(context['@contextType'], 'const/let'); @@ -159,5 +159,4 @@ test('Issue #390 (related) - output assignment cpu', function(assert) { assert.equal(sum.name, 'sum'); assert.equal(sum.valueType, 'Number'); -}); - +}); \ No newline at end of file diff --git a/test/issues/396-combine-kernels-example.js b/test/issues/396-combine-kernels-example.js index 3e381431..762e10f6 100644 --- a/test/issues/396-combine-kernels-example.js +++ b/test/issues/396-combine-kernels-example.js @@ -17,7 +17,7 @@ function combineKernelsExample(mode) { return multiply(add(a, b), c); }); - const result = superKernel([1,2,3,4,5],[1,2,3,4,5],[1,2,3,4,5]); + const result = superKernel([1, 2, 3, 4, 5], [1, 2, 3, 4, 5], [1, 2, 3, 4, 5]); assert.deepEqual(Array.from(result), [2, 8, 18, @@ -49,4 +49,4 @@ test('gpu', () => { test('cpu', () => { combineKernelsExample('cpu'); -}); +}); \ No newline at end of file diff --git a/test/issues/399-double-definition.js b/test/issues/399-double-definition.js index 515836c9..54603f37 100644 --- a/test/issues/399-double-definition.js +++ b/test/issues/399-double-definition.js @@ -57,4 +57,4 @@ function doubleDefinitionSinglePrecision(mode) { (GPU.isHeadlessGLSupported && GPU.isSinglePrecisionSupported ? test : skip)('Issue #399 - double definition single precision headlessgl', () => { doubleDefinitionSinglePrecision('headlessgl') -}); +}); \ No newline at end of file diff --git a/test/issues/401-cpu-canvas-check.js b/test/issues/401-cpu-canvas-check.js index 42efea53..2b8a9b81 100644 --- a/test/issues/401-cpu-canvas-check.js +++ b/test/issues/401-cpu-canvas-check.js @@ -5,18 +5,18 @@ describe('issue #401'); test('Issue #401 - cpu no canvas graphical', function(assert) { assert.throws(function() { - CPUKernel.prototype.build.apply({ - setupConstants: function() {}, - setupArguments: function() {}, - validateSettings: function() {}, - getKernelString: function() {}, - translateSource: function() {}, - buildSignature: function() {}, - graphical: true, - output: [1], - canvas: null - }, []); - }, + CPUKernel.prototype.build.apply({ + setupConstants: function() {}, + setupArguments: function() {}, + validateSettings: function() {}, + getKernelString: function() {}, + translateSource: function() {}, + buildSignature: function() {}, + graphical: true, + output: [1], + canvas: null + }, []); + }, new Error('no canvas available for using graphical output'), 'throws when canvas is not available and using graphical output'); }); @@ -34,4 +34,4 @@ test('Issue #401 - cpu no canvas', function(assert) { canvas: null }, []); assert.equal(true, true, 'ok when canvas is not available and not using graphical output'); -}); +}); \ No newline at end of file diff --git a/test/issues/410-if-statement.js b/test/issues/410-if-statement.js index 1aad96a6..da0f86f3 100644 --- a/test/issues/410-if-statement.js +++ b/test/issues/410-if-statement.js @@ -6,12 +6,12 @@ describe('issue #410 - if statement when unsigned on NVidia'); function ifStatement(mode) { const gpu = new GPU({ mode }); const kernel = gpu.createKernel(function(a) { - const paramDenom = a[this.thread.x][1] - a[this.thread.x][0]; - if(paramDenom === 0) { - return 100; - } - return 200; - }) + const paramDenom = a[this.thread.x][1] - a[this.thread.x][0]; + if (paramDenom === 0) { + return 100; + } + return 200; + }) .setPrecision('unsigned') .setOutput([2]); @@ -23,7 +23,7 @@ function ifStatement(mode) { ] ); - assert.deepEqual(Array.from(result), [100,200]); + assert.deepEqual(Array.from(result), [100, 200]); gpu.destroy(); } @@ -49,4 +49,4 @@ test('gpu', () => { test('cpu', () => { ifStatement('cpu'); -}); +}); \ No newline at end of file diff --git a/test/issues/422-warnings.js b/test/issues/422-warnings.js index 71a31c7f..9ae7d806 100644 --- a/test/issues/422-warnings.js +++ b/test/issues/422-warnings.js @@ -8,7 +8,7 @@ function warnings(mode) { const kernel = gpu.createKernel(function(a, b) { return a[this.thread.x] + b[this.thread.x]; }).setOutput([10]); - assert.deepEqual(Array.from(kernel([0,1,2,3,4,5,6,7,8,9], [0,1,2,3,4,5,6,7,8,9])), [0,2,4,6,8,10,12,14,16,18]); + assert.deepEqual(Array.from(kernel([0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9])), [0, 2, 4, 6, 8, 10, 12, 14, 16, 18]); gpu.destroy(); } @@ -34,4 +34,4 @@ test('gpu', () => { test('cpu', () => { warnings('cpu'); -}); +}); \ No newline at end of file diff --git a/test/issues/470-modulus-wrong.js b/test/issues/470-modulus-wrong.js index 0f9c0e7f..9363c5fa 100644 --- a/test/issues/470-modulus-wrong.js +++ b/test/issues/470-modulus-wrong.js @@ -50,4 +50,4 @@ test('gpu', () => { test('cpu', () => { testModulusWrong('cpu'); -}); +}); \ No newline at end of file diff --git a/test/issues/471-canvas-issue.js b/test/issues/471-canvas-issue.js index c5030bce..c7e32612 100644 --- a/test/issues/471-canvas-issue.js +++ b/test/issues/471-canvas-issue.js @@ -4,9 +4,9 @@ const { GPU } = require('../../src'); describe('issue #471 - canvas issue'); function testCanvasIssue(mode) { - const gpu = new GPU({mode}); + const gpu = new GPU({ mode }); const render = gpu - .createKernel(function () { + .createKernel(function() { this.color(0, 0, 0, 1); }) .setOutput([200, 200]) @@ -36,4 +36,4 @@ function testCanvasIssue(mode) { (GPU.isCanvasSupported ? test : skip)('cpu', () => { testCanvasIssue('cpu'); -}); +}); \ No newline at end of file diff --git a/test/issues/472-compilation-issue.js b/test/issues/472-compilation-issue.js index 19eeef70..01bee502 100644 --- a/test/issues/472-compilation-issue.js +++ b/test/issues/472-compilation-issue.js @@ -21,10 +21,10 @@ function testCompilationIssue(mode) { graphical: true, }); render(new Uint8ClampedArray([ - 230,233,240,255, - 231,234,241,255, - 232,235,242,255, - 233,236,243,255 + 230, 233, 240, 255, + 231, 234, 241, 255, + 232, 235, 242, 255, + 233, 236, 243, 255 ]), 14 * Math.sin(Date.now() / 400)); assert.equal(render.getPixels().length, 2 * 2 * 4); gpu.destroy(); @@ -52,4 +52,4 @@ test('gpu', () => { (GPU.isCanvasSupported ? test : skip)('cpu', () => { testCompilationIssue('cpu'); -}); +}); \ No newline at end of file diff --git a/test/issues/473-4-pixels.js b/test/issues/473-4-pixels.js index fb4ffd94..5db53fdb 100644 --- a/test/issues/473-4-pixels.js +++ b/test/issues/473-4-pixels.js @@ -8,8 +8,7 @@ function testOnly4PixelsAreShownRGBStaticOutput(mode) { const render = gpu.createKernel( function() { this.color(1, 1, 1); - }, - { + }, { output: [20, 20], graphical: true, } @@ -52,8 +51,7 @@ function testOnly4PixelsAreShownRGBAStaticOutput(mode) { const render = gpu.createKernel( function() { this.color(1, 1, 1, 1); - }, - { + }, { output: [20, 20], graphical: true, } @@ -96,8 +94,7 @@ function testOnly4PixelsAreShownRGBDynamicOutput(mode) { const render = gpu.createKernel( function() { this.color(1, 1, 1); - }, - { + }, { output: [20, 20], graphical: true, dynamicOutput: true, @@ -148,8 +145,7 @@ function testOnly4PixelsAreShownRGBADynamicOutput(mode) { const render = gpu.createKernel( function() { this.color(1, 1, 1, 1); - }, - { + }, { output: [20, 20], graphical: true, dynamicOutput: true, @@ -193,4 +189,4 @@ test('rgba dynamic output gpu', () => { (GPU.isCanvasSupported ? test : skip)('rgba dynamic output cpu', () => { testOnly4PixelsAreShownRGBADynamicOutput('cpu'); -}); +}); \ No newline at end of file diff --git a/test/issues/487-dynamic-arguments.js b/test/issues/487-dynamic-arguments.js index 3c68bb72..8d9f2e0d 100644 --- a/test/issues/487-dynamic-arguments.js +++ b/test/issues/487-dynamic-arguments.js @@ -4,20 +4,20 @@ const { GPU } = require('../../src'); describe('issue #487 - pipeline dynamic arguments'); function testPipelineDynamicArguments(mode) { - const gpu = new GPU({mode: mode}); + const gpu = new GPU({ mode: mode }); - const kernel = gpu.createKernel(function (w) { - return this.thread.x + this.thread.y * w; - }) + const kernel = gpu.createKernel(function(w) { + return this.thread.x + this.thread.y * w; + }) .setPipeline(true) .setDynamicOutput(true); - const sumRow = gpu.createKernel(function (texture, w) { - let sum = 0; - for (let i = 0; i < w; i++) - sum = sum + texture[this.thread.x][i]; - return sum; - }) + const sumRow = gpu.createKernel(function(texture, w) { + let sum = 0; + for (let i = 0; i < w; i++) + sum = sum + texture[this.thread.x][i]; + return sum; + }) .setDynamicArguments(true) .setDynamicOutput(true); @@ -56,4 +56,4 @@ test('(GPU only) gpu', () => { (GPU.isHeadlessGLSupported ? test : skip)('(GPU only) headlessgl', () => { testPipelineDynamicArguments('headlessgl'); -}); +}); \ No newline at end of file diff --git a/test/issues/493-strange-literal.js b/test/issues/493-strange-literal.js index 089032ac..7353b6fe 100644 --- a/test/issues/493-strange-literal.js +++ b/test/issues/493-strange-literal.js @@ -5,6 +5,7 @@ describe('issue #493 - strange literal'); function testStrangeLiteral(mode) { const gpu = new GPU({ mode }); + function kernelFunction(array) { const xFactor = (1 - 0) * this.constants.x + this.thread.x * this.constants.y; const yFactor = (1 - .5) * this.constants.x + this.thread.x * this.constants.y; @@ -16,15 +17,19 @@ function testStrangeLiteral(mode) { } const kernel1 = gpu.createKernel(kernelFunction) .setArgumentTypes({ array: 'Array1D(2)' }) - .setConstants({ x: 1, y: 1}) + .setConstants({ x: 1, y: 1 }) .setOutput([1]); - assert.deepEqual(kernel1([[1,2]]), [new Float32Array([1,4])]); + assert.deepEqual(kernel1([ + [1, 2] + ]), [new Float32Array([1, 4])]); const kernel2 = gpu.createKernel(kernelFunction) .setStrictIntegers(true) .setArgumentTypes({ array: 'Array1D(2)' }) - .setConstants({ x: 1, y: 1}) + .setConstants({ x: 1, y: 1 }) .setOutput([1]); - assert.deepEqual(kernel2([[1,2]]), [new Float32Array([1,4])]); + assert.deepEqual(kernel2([ + [1, 2] + ]), [new Float32Array([1, 4])]); gpu.destroy(); } @@ -50,4 +55,4 @@ test('gpu', () => { test('cpu', () => { testStrangeLiteral('cpu'); -}); +}); \ No newline at end of file diff --git a/test/issues/500-sticky-arrays.js b/test/issues/500-sticky-arrays.js index db4859db..5a092797 100644 --- a/test/issues/500-sticky-arrays.js +++ b/test/issues/500-sticky-arrays.js @@ -5,6 +5,7 @@ describe('issue #500 - strange literal'); function testStickyArrays(mode) { const gpu = new GPU({ mode }); + function processImage(image) { return image[0]; } @@ -13,7 +14,7 @@ function testStickyArrays(mode) { return [processImage(image1), processImage(image2), processImage(image3)]; }, { output: [1] }); - assert.deepEqual(kernel([1], [2], [3]), [new Float32Array([1,2,3])]); + assert.deepEqual(kernel([1], [2], [3]), [new Float32Array([1, 2, 3])]); } test('auto', () => { @@ -38,4 +39,4 @@ test('gpu', () => { test('cpu', () => { testStickyArrays('cpu'); -}); +}); \ No newline at end of file diff --git a/test/issues/519-sanitize-names.js b/test/issues/519-sanitize-names.js index 12a72961..6d72d198 100644 --- a/test/issues/519-sanitize-names.js +++ b/test/issues/519-sanitize-names.js @@ -5,7 +5,7 @@ describe('issue #519 - sanitize names'); function testSanitizeNames(mode) { const gpu = new GPU({ mode }); - const kernel1 = gpu.createKernel(function (value__$, value__, value$, _) { + const kernel1 = gpu.createKernel(function(value__$, value__, value$, _) { return value__$ + value__ + value$ + _ + 1; }, { output: [1] diff --git a/test/issues/556-minify-for-loop.js b/test/issues/556-minify-for-loop.js index c4031475..9abaf801 100644 --- a/test/issues/556-minify-for-loop.js +++ b/test/issues/556-minify-for-loop.js @@ -7,8 +7,7 @@ const source = 'function w(t,e){for(var r=0,i=0;i { test('cpu', () => { testRewrittenArrays('cpu'); -}); +}); \ No newline at end of file diff --git a/test/issues/91-create-kernel-map-array.js b/test/issues/91-create-kernel-map-array.js index fd42645e..e93a3891 100644 --- a/test/issues/91-create-kernel-map-array.js +++ b/test/issues/91-create-kernel-map-array.js @@ -2,6 +2,7 @@ const { assert, skip, test, module: describe } = require('qunit'); const { GPU, HeadlessGLKernel, WebGLKernel, WebGL2Kernel, CPUKernel } = require('../../src'); describe('issue #91'); + function getResult(mode) { const A = [ [1, 2], @@ -25,14 +26,14 @@ function getResult(mode) { } const kernels = gpu.createKernelMap({ - multiplyResult: multiply - }, function (a, b) { - return multiply(b, a, this.thread.y, this.thread.x); - }) + multiplyResult: multiply + }, function(a, b) { + return multiply(b, a, this.thread.y, this.thread.x); + }) .setOutput([2, 2]); const result = kernels(A, B).result; - assert.deepEqual(Array.from(result[0]), [21,32]); - assert.deepEqual(Array.from(result[1]), [9,14]); + assert.deepEqual(Array.from(result[0]), [21, 32]); + assert.deepEqual(Array.from(result[1]), [9, 14]); gpu.destroy(); return kernels; } @@ -57,4 +58,4 @@ function getResult(mode) { test("Issue #91 - type detection cpu", () => { const kernel = getResult('cpu'); assert.equal(kernel.kernel.constructor, CPUKernel, 'kernel type is wrong'); -}); +}); \ No newline at end of file diff --git a/test/issues/96-param-names.js b/test/issues/96-param-names.js index 7ac7054f..a354901d 100644 --- a/test/issues/96-param-names.js +++ b/test/issues/96-param-names.js @@ -26,15 +26,15 @@ function getResult(mode) { } const kernels = gpu.createKernelMap({ - multiplyResult: multiply - }, function (a, b) { - return multiply(b, a, this.thread.y, this.thread.x); - }) + multiplyResult: multiply + }, function(a, b) { + return multiply(b, a, this.thread.y, this.thread.x); + }) .setOutput([B.length, A.length]); const result = kernels(A, B).result; - assert.deepEqual(Array.from(result[0]), [2,2,2]); - assert.deepEqual(Array.from(result[1]), [2,2,2]); + assert.deepEqual(Array.from(result[0]), [2, 2, 2]); + assert.deepEqual(Array.from(result[1]), [2, 2, 2]); assert.deepEqual(result.length, 2); gpu.destroy(); return result; @@ -56,4 +56,4 @@ function getResult(mode) { }); test("Issue #96 - param names cpu", () => { getResult('cpu'); -}); +}); \ No newline at end of file From d8ade9ba1cbba604801c778495c6c0e50f4e42f0 Mon Sep 17 00:00:00 2001 From: 17097231932 <17097231932@163.com> Date: Sun, 29 Jan 2023 12:15:25 +0800 Subject: [PATCH 04/11] extract the test builder to standalone file then we can remove gulp and other unused dependcies --- gulpfile.js | 29 - package.json | 15 +- pnpm-lock.yaml | 3956 ++-------------------------------------- scripts/build-tests.js | 29 + test/all-template.html | 52 +- test/all.html | 626 +++---- 6 files changed, 509 insertions(+), 4198 deletions(-) delete mode 100644 gulpfile.js create mode 100644 scripts/build-tests.js diff --git a/gulpfile.js b/gulpfile.js deleted file mode 100644 index 081d4484..00000000 --- a/gulpfile.js +++ /dev/null @@ -1,29 +0,0 @@ -const fs = require('fs'); -const gulp = require('gulp'); -const rename = require('gulp-rename'); -const replace = require('gulp-replace'); -const path = require('path'); -const { readDirDeepSync } = require('read-dir-deep'); - -gulp.task('build-tests', () => { - const folder = 'test'; - const testFile = 'all.html'; - try { - fs.unlinkSync(`${folder}/${testFile}`); - } catch (e) {} - const rootPath = path.resolve(process.cwd(), folder); - const warning = '\n'; - const files = readDirDeepSync(rootPath, { - patterns: [ - '**/*.js' - ], - ignore: [ - '*.js' - ] - }) - .map(file => file.replace(/^test\//, '')); - return gulp.src(`${folder}/all-template.html`) - .pipe(replace('{{test-files}}', warning + files.map(file => ``).join('\n'))) - .pipe(rename(testFile)) - .pipe(gulp.dest(folder)); -}); \ No newline at end of file diff --git a/package.json b/package.json index cd382d70..82254c11 100644 --- a/package.json +++ b/package.json @@ -21,8 +21,7 @@ "acorn": "^7.1.1", "gl": "^5.0.3", "gl-wiretap": "^0.6.2", - "gpu-mock.js": "^1.3.0", - "webgpu": "^0.1.16" + "gpu-mock.js": "^1.3.0" }, "devDependencies": { "@rollup/plugin-commonjs": "^24.0.1", @@ -30,19 +29,8 @@ "@rollup/plugin-replace": "^5.0.2", "@rollup/plugin-terser": "^0.4.0", "benchmark": "^2.1.4", - "browser-sync": "^2.26.7", - "browserify": "^17.0.0", "c8": "^7.12.0", - "gulp": "^4.0.0", - "gulp-concat": "^2.6.0", - "gulp-header": "^1.7.1", - "gulp-jsbeautifier": "^2.1.0", - "gulp-rename": "^1.2.2", - "gulp-replace": "^1.0.0", - "gulp-strip-comments": "^2.4.5", - "gulp-uglify-es": "^3.0.0", "js-beautify": "^1.14.7", - "merge-stream": "^1.0.1", "qunit": "^2.9.1", "read-dir-deep": "^7.0.1", "rollup": "^3.12.0", @@ -52,6 +40,7 @@ }, "scripts": { "test": "qunit test/issues test/internal test/features", + "test:browser": "node scripts/build-tests.js", "coverage": "c8 qunit test/issues test/internal test/features", "lint": "js-beautify --config .jsbeautify -f *.js src/**/*.js test/**/*.js", "build": "rollup -c --bundleConfigAsCjs" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2e22bfff..cd588a0a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -7,36 +7,23 @@ specifiers: '@rollup/plugin-terser': ^0.4.0 acorn: ^7.1.1 benchmark: ^2.1.4 - browser-sync: ^2.26.7 - browserify: ^17.0.0 c8: ^7.12.0 gl: ^5.0.3 gl-wiretap: ^0.6.2 gpu-mock.js: ^1.3.0 - gulp: ^4.0.0 - gulp-concat: ^2.6.0 - gulp-header: ^1.7.1 - gulp-jsbeautifier: ^2.1.0 - gulp-rename: ^1.2.2 - gulp-replace: ^1.0.0 - gulp-strip-comments: ^2.4.5 - gulp-uglify-es: ^3.0.0 js-beautify: ^1.14.7 - merge-stream: ^1.0.1 qunit: ^2.9.1 read-dir-deep: ^7.0.1 rollup: ^3.12.0 sinon: ^7.3.2 vinyl-buffer: ^1.0.0 vinyl-source-stream: ^2.0.0 - webgpu: ^0.1.16 dependencies: acorn: 7.4.1 gl: 5.0.3 gl-wiretap: 0.6.2 gpu-mock.js: 1.3.1 - webgpu: 0.1.16 devDependencies: '@rollup/plugin-commonjs': 24.0.1_rollup@3.12.0 @@ -44,19 +31,8 @@ devDependencies: '@rollup/plugin-replace': 5.0.2_rollup@3.12.0 '@rollup/plugin-terser': 0.4.0_rollup@3.12.0 benchmark: 2.1.4 - browser-sync: 2.27.11 - browserify: 17.0.0 c8: 7.12.0 - gulp: 4.0.2 - gulp-concat: 2.6.1 - gulp-header: 1.8.12 - gulp-jsbeautifier: 2.1.2 - gulp-rename: 1.4.0 - gulp-replace: 1.1.4 - gulp-strip-comments: 2.5.2 - gulp-uglify-es: 3.0.0 js-beautify: 1.14.7 - merge-stream: 1.0.1 qunit: 2.19.4 read-dir-deep: 7.0.1 rollup: 3.12.0 @@ -259,33 +235,15 @@ packages: resolution: {integrity: sha512-sXXKG+uL9IrKqViTtao2Ws6dy0znu9sOaP1di/jKGW1M6VssO8vlpXCQcpZ+jisQ1tTFAC5Jo/EOzFbggBagFQ==} dev: true - /@socket.io/component-emitter/3.1.0: - resolution: {integrity: sha512-+9jVqKhRSpsc591z5vX+X5Yyw+he/HCB4iQ/RYxw35CEPaY1gnsNE43nf9n9AaYjAQrTiI/mOwKUKdUs9vf7Xg==} - dev: true - /@tootallnate/once/2.0.0: resolution: {integrity: sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==} engines: {node: '>= 10'} dev: false - /@types/cookie/0.4.1: - resolution: {integrity: sha512-XW/Aa8APYr6jSVVA1y/DEIZX0/GMKLEVekNG727R8cs56ahETkRAy/3DR7+fJyh7oUgGwNQaRfXCun0+KbWY7Q==} - dev: true - - /@types/cors/2.8.13: - resolution: {integrity: sha512-RG8AStHlUiV5ysZQKq97copd2UmVYw3/pRMLefISZ3S1hK104Cwm7iLQ3fTKx+lsUH2CE8FlLaYeEA2LSeqYUA==} - dependencies: - '@types/node': 18.11.18 - dev: true - /@types/estree/1.0.0: resolution: {integrity: sha512-WulqXMDUTYAXCjZnk6JtIHPigp55cVtDgDrO2gHRwhyJto21+1zbVCtOYB2L1F9w4qCQ0rOGWBnBe0FNTiEJIQ==} dev: true - /@types/expect/1.20.4: - resolution: {integrity: sha512-Q5Vn3yjTDyCMV50TB6VRIbQNxSE4OmZR86VSbGaNpfUolm0iePBB4KdEEHmxoY5sT2+2DIvXW0rvMDP2nHZ4Mg==} - dev: true - /@types/glob/7.2.0: resolution: {integrity: sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==} dependencies: @@ -309,49 +267,14 @@ packages: resolution: {integrity: sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==} dev: true - /@types/vinyl/2.0.7: - resolution: {integrity: sha512-4UqPv+2567NhMQuMLdKAyK4yzrfCqwaTt6bLhHEs8PFcxbHILsrxaY63n4wgE/BRLDWDQeI+WcTmkXKExh9hQg==} - dependencies: - '@types/expect': 1.20.4 - '@types/node': 18.11.18 - dev: true - - /JSONStream/1.3.5: - resolution: {integrity: sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==} - hasBin: true - dependencies: - jsonparse: 1.3.1 - through: 2.3.8 - dev: true - /abbrev/1.1.1: resolution: {integrity: sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==} - /accepts/1.3.8: - resolution: {integrity: sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==} - engines: {node: '>= 0.6'} - dependencies: - mime-types: 2.1.35 - negotiator: 0.6.3 - dev: true - - /acorn-node/1.8.2: - resolution: {integrity: sha512-8mt+fslDufLYntIoPAaIMUe/lrbrehIiwmR3t2k9LljIzoigEPF27eLk2hy8zSGzmR/ogr7zbRKINMo1u0yh5A==} - dependencies: - acorn: 7.4.1 - acorn-walk: 7.2.0 - xtend: 4.0.2 - dev: true - - /acorn-walk/7.2.0: - resolution: {integrity: sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA==} - engines: {node: '>=0.4.0'} - dev: true - /acorn/7.4.1: resolution: {integrity: sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==} engines: {node: '>=0.4.0'} hasBin: true + dev: false /acorn/8.8.2: resolution: {integrity: sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==} @@ -387,48 +310,10 @@ packages: indent-string: 4.0.0 dev: false - /ansi-colors/1.1.0: - resolution: {integrity: sha512-SFKX67auSNoVR38N3L+nvsPjOE0bybKTYbkf5tRvushrAPQ9V75huw0ZxBkKVeRU9kqH3d6HA4xTckbwZ4ixmA==} - engines: {node: '>=0.10.0'} - dependencies: - ansi-wrap: 0.1.0 - dev: true - - /ansi-cyan/0.1.1: - resolution: {integrity: sha512-eCjan3AVo/SxZ0/MyIYRtkpxIu/H3xZN7URr1vXVrISxeyz8fUFz0FJziamK4sS8I+t35y4rHg1b2PklyBe/7A==} - engines: {node: '>=0.10.0'} - dependencies: - ansi-wrap: 0.1.0 - dev: true - - /ansi-gray/0.1.1: - resolution: {integrity: sha512-HrgGIZUl8h2EHuZaU9hTR/cU5nhKxpVE1V6kdGsQ8e4zirElJ5fvtfc8N7Q1oq1aatO275i8pUFUCpNWCAnVWw==} - engines: {node: '>=0.10.0'} - dependencies: - ansi-wrap: 0.1.0 - dev: true - - /ansi-red/0.1.1: - resolution: {integrity: sha512-ewaIr5y+9CUTGFwZfpECUbFlGcC0GCw1oqR9RI6h1gQCd9Aj2GxSckCnPsVJnmfMZbwFYE+leZGASgkWl06Jow==} - engines: {node: '>=0.10.0'} - dependencies: - ansi-wrap: 0.1.0 - dev: true - - /ansi-regex/2.1.1: - resolution: {integrity: sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==} - engines: {node: '>=0.10.0'} - dev: true - /ansi-regex/5.0.1: resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} engines: {node: '>=8'} - /ansi-styles/2.2.1: - resolution: {integrity: sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA==} - engines: {node: '>=0.10.0'} - dev: true - /ansi-styles/4.3.0: resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} engines: {node: '>=8'} @@ -436,43 +321,10 @@ packages: color-convert: 2.0.1 dev: true - /ansi-wrap/0.1.0: - resolution: {integrity: sha512-ZyznvL8k/FZeQHr2T6LzcJ/+vBApDnMNZvfVFy3At0knswWd6rJ3/0Hhmpu8oqa6C92npmozs890sX9Dl6q+Qw==} - engines: {node: '>=0.10.0'} - dev: true - - /anymatch/2.0.0: - resolution: {integrity: sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==} - dependencies: - micromatch: 3.1.10 - normalize-path: 2.1.1 - transitivePeerDependencies: - - supports-color - dev: true - - /anymatch/3.1.3: - resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} - engines: {node: '>= 8'} - dependencies: - normalize-path: 3.0.0 - picomatch: 2.3.1 - dev: true - - /append-buffer/1.0.2: - resolution: {integrity: sha512-WLbYiXzD3y/ATLZFufV/rZvWdZOs+Z/+5v1rBZ463Jn398pa6kcde27cvozYnBoxXblGZTFfoPpsaEw0orU5BA==} - engines: {node: '>=0.10.0'} - dependencies: - buffer-equal: 1.0.1 - dev: true - /aproba/2.0.0: resolution: {integrity: sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==} dev: false - /archy/1.0.0: - resolution: {integrity: sha512-Xg+9RwCg/0p32teKdGMPTPnVXKD0w3DfHnFTficozsAgsvq2XenPJq/MYpzzQ/v8zrOyJn6Ds39VA4JIDwFfqw==} - dev: true - /are-we-there-yet/3.0.1: resolution: {integrity: sha512-QZW4EDmGwlYur0Yyf/b2uGucHQMa8aFUP7eu9ddR73vvhFyt4V0Vl3QHPcTNJ8l6qYOBdxgXdnBXQrHilfRQBg==} engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} @@ -481,215 +333,21 @@ packages: readable-stream: 3.6.0 dev: false - /arr-diff/1.1.0: - resolution: {integrity: sha512-OQwDZUqYaQwyyhDJHThmzId8daf4/RFNLaeh3AevmSeZ5Y7ug4Ga/yKc6l6kTZOBW781rCj103ZuTh8GAsB3+Q==} - engines: {node: '>=0.10.0'} - dependencies: - arr-flatten: 1.1.0 - array-slice: 0.2.3 - dev: true - - /arr-diff/4.0.0: - resolution: {integrity: sha512-YVIQ82gZPGBebQV/a8dar4AitzCQs0jjXwMPZllpXMaGjXPYVUawSxQrRsjhjupyVxEvbHgUmIhKVlND+j02kA==} - engines: {node: '>=0.10.0'} - dev: true - - /arr-filter/1.1.2: - resolution: {integrity: sha512-A2BETWCqhsecSvCkWAeVBFLH6sXEUGASuzkpjL3GR1SlL/PWL6M3J8EAAld2Uubmh39tvkJTqC9LeLHCUKmFXA==} - engines: {node: '>=0.10.0'} - dependencies: - make-iterator: 1.0.1 - dev: true - - /arr-flatten/1.1.0: - resolution: {integrity: sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==} - engines: {node: '>=0.10.0'} - dev: true - - /arr-map/2.0.2: - resolution: {integrity: sha512-tVqVTHt+Q5Xb09qRkbu+DidW1yYzz5izWS2Xm2yFm7qJnmUfz4HPzNxbHkdRJbz2lrqI7S+z17xNYdFcBBO8Hw==} - engines: {node: '>=0.10.0'} - dependencies: - make-iterator: 1.0.1 - dev: true - - /arr-union/2.1.0: - resolution: {integrity: sha512-t5db90jq+qdgk8aFnxEkjqta0B/GHrM1pxzuuZz2zWsOXc5nKu3t+76s/PQBA8FTcM/ipspIH9jWG4OxCBc2eA==} - engines: {node: '>=0.10.0'} - dev: true - - /arr-union/3.1.0: - resolution: {integrity: sha512-sKpyeERZ02v1FeCZT8lrfJq5u6goHCtpTAzPwJYe7c8SPFOboNjNg1vz2L4VTn9T4PQxEx13TbXLmYUcS6Ug7Q==} - engines: {node: '>=0.10.0'} - dev: true - - /array-each/1.0.1: - resolution: {integrity: sha512-zHjL5SZa68hkKHBFBK6DJCTtr9sfTCPCaph/L7tMSLcTFgy+zX7E+6q5UArbtOtMBCtxdICpfTCspRse+ywyXA==} - engines: {node: '>=0.10.0'} - dev: true - /array-from/2.1.1: resolution: {integrity: sha512-GQTc6Uupx1FCavi5mPzBvVT7nEOeWMmUA9P95wpfpW1XwMSKs+KaymD5C2Up7KAUKg/mYwbsUYzdZWcoajlNZg==} dev: true - /array-initial/1.1.0: - resolution: {integrity: sha512-BC4Yl89vneCYfpLrs5JU2aAu9/a+xWbeKhvISg9PT7eWFB9UlRvI+rKEtk6mgxWr3dSkk9gQ8hCrdqt06NXPdw==} - engines: {node: '>=0.10.0'} - dependencies: - array-slice: 1.1.0 - is-number: 4.0.0 - dev: true - - /array-last/1.3.0: - resolution: {integrity: sha512-eOCut5rXlI6aCOS7Z7kCplKRKyiFQ6dHFBem4PwlwKeNFk2/XxTrhRh5T9PyaEWGy/NHTZWbY+nsZlNFJu9rYg==} - engines: {node: '>=0.10.0'} - dependencies: - is-number: 4.0.0 - dev: true - - /array-slice/0.2.3: - resolution: {integrity: sha512-rlVfZW/1Ph2SNySXwR9QYkChp8EkOEiTMO5Vwx60usw04i4nWemkm9RXmQqgkQFaLHsqLuADvjp6IfgL9l2M8Q==} - engines: {node: '>=0.10.0'} - dev: true - - /array-slice/1.1.0: - resolution: {integrity: sha512-B1qMD3RBP7O8o0H2KbrXDyB0IccejMF15+87Lvlor12ONPRHP6gTjXMNkt/d3ZuOGbAe66hFmaCfECI24Ufp6w==} - engines: {node: '>=0.10.0'} - dev: true - - /array-sort/1.0.0: - resolution: {integrity: sha512-ihLeJkonmdiAsD7vpgN3CRcx2J2S0TiYW+IS/5zHBI7mKUq3ySvBdzzBfD236ubDBQFiiyG3SWCPc+msQ9KoYg==} - engines: {node: '>=0.10.0'} - dependencies: - default-compare: 1.0.0 - get-value: 2.0.6 - kind-of: 5.1.0 - dev: true - /array-union/2.1.0: resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==} engines: {node: '>=8'} dev: true - /array-unique/0.3.2: - resolution: {integrity: sha512-SleRWjh9JUud2wH1hPs9rZBZ33H6T9HOiL0uwGnGx9FpE6wKGyfWugmbkEOIs6qWrZhg0LWeLziLrEwQJhs5mQ==} - engines: {node: '>=0.10.0'} - dev: true - - /asn1.js/5.4.1: - resolution: {integrity: sha512-+I//4cYPccV8LdmBLiX8CYvf9Sp3vQsrqu2QNXRcrbiWvcx/UdlFiqUJJzxRQxgsZmvhXhn4cSKeSmoFjVdupA==} - dependencies: - bn.js: 4.12.0 - inherits: 2.0.4 - minimalistic-assert: 1.0.1 - safer-buffer: 2.1.2 - dev: true - - /assert/1.5.0: - resolution: {integrity: sha512-EDsgawzwoun2CZkCgtxJbv392v4nbk9XDD06zI+kQYoBM/3RBWLlEyJARDOmhAAosBjWACEkKL6S+lIZtcAubA==} - dependencies: - object-assign: 4.1.1 - util: 0.10.3 - dev: true - - /assign-symbols/1.0.0: - resolution: {integrity: sha512-Q+JC7Whu8HhmTdBph/Tq59IoRtoy6KAm5zzPv00WdujX82lbAL8K7WVjne7vdCsAmbF4AYaDOPyO3k0kl8qIrw==} - engines: {node: '>=0.10.0'} - dev: true - - /async-done/1.3.2: - resolution: {integrity: sha512-uYkTP8dw2og1tu1nmza1n1CMW0qb8gWWlwqMmLb7MhBVs4BXrFziT6HXUd+/RlRA/i4H9AkofYloUbs1fwMqlw==} - engines: {node: '>= 0.10'} - dependencies: - end-of-stream: 1.4.4 - once: 1.4.0 - process-nextick-args: 2.0.1 - stream-exhaust: 1.0.2 - dev: true - - /async-each-series/0.1.1: - resolution: {integrity: sha512-p4jj6Fws4Iy2m0iCmI2am2ZNZCgbdgE+P8F/8csmn2vx7ixXrO2zGcuNsD46X5uZSVecmkEy/M06X2vG8KD6dQ==} - engines: {node: '>=0.8.0'} - dev: true - - /async-each/1.0.4: - resolution: {integrity: sha512-qL5v0vnRtD4rxlrzLz3WMnMfTvTrMf3IK1xFCF0Q5vqXJkULhM13gO2ynE8RZMjE+bPcH0AUHgcd5BU1FtO1tA==} - dev: true - - /async-settle/1.0.0: - resolution: {integrity: sha512-VPXfB4Vk49z1LHHodrEQ6Xf7W4gg1w0dAPROHngx7qgDjqmIQ+fXmwgGXTW/ITLai0YLSvWepJOP9EVpMnEAcw==} - engines: {node: '>= 0.10'} - dependencies: - async-done: 1.3.2 - dev: true - - /async/2.6.4: - resolution: {integrity: sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA==} - dependencies: - lodash: 4.17.21 - dev: true - - /atob/2.1.2: - resolution: {integrity: sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==} - engines: {node: '>= 4.5.0'} - hasBin: true - dev: true - - /available-typed-arrays/1.0.5: - resolution: {integrity: sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==} - engines: {node: '>= 0.4'} - dev: true - - /axios/0.21.4_debug@4.3.2: - resolution: {integrity: sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==} - dependencies: - follow-redirects: 1.15.2_debug@4.3.2 - transitivePeerDependencies: - - debug - dev: true - - /bach/1.2.0: - resolution: {integrity: sha512-bZOOfCb3gXBXbTFXq3OZtGR88LwGeJvzu6szttaIzymOTS4ZttBNOWSv7aLZja2EMycKtRYV0Oa8SNKH/zkxvg==} - engines: {node: '>= 0.10'} - dependencies: - arr-filter: 1.1.2 - arr-flatten: 1.1.0 - arr-map: 2.0.2 - array-each: 1.0.1 - array-initial: 1.1.0 - array-last: 1.3.0 - async-done: 1.3.2 - async-settle: 1.0.0 - now-and-later: 2.0.1 - dev: true - /balanced-match/1.0.2: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} - /base/0.11.2: - resolution: {integrity: sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==} - engines: {node: '>=0.10.0'} - dependencies: - cache-base: 1.0.1 - class-utils: 0.3.6 - component-emitter: 1.3.0 - define-property: 1.0.0 - isobject: 3.0.1 - mixin-deep: 1.3.2 - pascalcase: 0.1.1 - dev: true - /base64-js/1.5.1: resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} - - /base64id/2.0.0: - resolution: {integrity: sha512-lGe34o6EHj9y3Kts9R4ZYs/Gr+6N7MCaMlIFA3F1R2O5/m7K06AxfSeO5530PEERE6/WyEg3lsuyw4GHlPZHog==} - engines: {node: ^4.5.0 || >= 5.9} - dev: true - - /batch/0.6.1: - resolution: {integrity: sha512-x+VAiMRL6UPkx+kudNvxTl6hB2XNNCG2r+7wixVfIYwu/2HKRXimwQyaumLjMveWvT2Hkd/cAJw+QBMfJ/EKVw==} - dev: true + dev: false /benchmark/2.1.4: resolution: {integrity: sha512-l9MlfN4M1K/H2fbhfMy3B7vJd6AGKJVQn2h6Sg/Yx+KckoUA7ewS5Vv6TjSq18ooE1kS9hhAlQRH3AkXIh/aOQ==} @@ -698,25 +356,11 @@ packages: platform: 1.3.6 dev: true - /binary-extensions/1.13.1: - resolution: {integrity: sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==} - engines: {node: '>=0.10.0'} - dev: true - - /binary-extensions/2.2.0: - resolution: {integrity: sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==} - engines: {node: '>=8'} - dev: true - - /binaryextensions/2.3.0: - resolution: {integrity: sha512-nAihlQsYGyc5Bwq6+EsubvANYGExeJKHDO3RjnvwU042fawQTQfM3Kxn7IHUXQOz4bzfwsGYYHGSvXyW4zOGLg==} - engines: {node: '>=0.8'} - dev: true - /bindings/1.5.0: resolution: {integrity: sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==} dependencies: file-uri-to-path: 1.0.0 + dev: false /bit-twiddle/1.0.2: resolution: {integrity: sha512-B9UhK0DKFZhoTFcfvAzhqsjStvGJp9vYWf3+6SNTtdSQnvIgfkHbgHrg/e4+TH71N2GDu8tpmCVoyfrL1d7ntA==} @@ -737,14 +381,6 @@ packages: readable-stream: 3.6.0 dev: false - /bn.js/4.12.0: - resolution: {integrity: sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==} - dev: true - - /bn.js/5.2.1: - resolution: {integrity: sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==} - dev: true - /brace-expansion/1.1.11: resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} dependencies: @@ -756,24 +392,6 @@ packages: dependencies: balanced-match: 1.0.2 - /braces/2.3.2: - resolution: {integrity: sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==} - engines: {node: '>=0.10.0'} - dependencies: - arr-flatten: 1.1.0 - array-unique: 0.3.2 - extend-shallow: 2.0.1 - fill-range: 4.0.0 - isobject: 3.0.1 - repeat-element: 1.1.4 - snapdragon: 0.8.2 - snapdragon-node: 2.1.1 - split-string: 3.1.0 - to-regex: 3.0.2 - transitivePeerDependencies: - - supports-color - dev: true - /braces/3.0.2: resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==} engines: {node: '>=8'} @@ -781,377 +399,66 @@ packages: fill-range: 7.0.1 dev: true - /brorand/1.1.0: - resolution: {integrity: sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==} + /buffer-from/1.1.2: + resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==} dev: true - /browser-pack/6.1.0: - resolution: {integrity: sha512-erYug8XoqzU3IfcU8fUgyHqyOXqIE4tUTTQ+7mqUjQlvnXkOO6OlT9c/ZoJVHYoAaqGxr09CN53G7XIsO4KtWA==} - hasBin: true + /buffer/5.7.1: + resolution: {integrity: sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==} dependencies: - JSONStream: 1.3.5 - combine-source-map: 0.8.0 - defined: 1.0.1 - safe-buffer: 5.2.1 - through2: 2.0.5 - umd: 3.0.3 - dev: true + base64-js: 1.5.1 + ieee754: 1.2.1 + dev: false - /browser-resolve/2.0.0: - resolution: {integrity: sha512-7sWsQlYL2rGLy2IWm8WL8DCTJvYLc/qlOnsakDac87SOoCd16WLsaAMdCiAqsTNHIe+SXfaqyxyo6THoWqs8WQ==} - dependencies: - resolve: 1.22.1 + /builtin-modules/3.3.0: + resolution: {integrity: sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==} + engines: {node: '>=6'} dev: true - /browser-sync-client/2.27.11: - resolution: {integrity: sha512-okMNfD2NasL/XD1/BclP3onXjhahisk3e/kTQ5HPDT/lLqdBqNDd6QFcjI5I1ak7na2hxKQSLjryql+7fp5gKQ==} - engines: {node: '>=8.0.0'} + /c8/7.12.0: + resolution: {integrity: sha512-CtgQrHOkyxr5koX1wEUmN/5cfDa2ckbHRA4Gy5LAL0zaCFtVWJS5++n+w4/sr2GWGerBxgTjpKeDclk/Qk6W/A==} + engines: {node: '>=10.12.0'} + hasBin: true dependencies: - etag: 1.8.1 - fresh: 0.5.2 - mitt: 1.2.0 - rxjs: 5.5.12 - typescript: 4.9.4 + '@bcoe/v8-coverage': 0.2.3 + '@istanbuljs/schema': 0.1.3 + find-up: 5.0.0 + foreground-child: 2.0.0 + istanbul-lib-coverage: 3.2.0 + istanbul-lib-report: 3.0.0 + istanbul-reports: 3.1.5 + rimraf: 3.0.2 + test-exclude: 6.0.0 + v8-to-istanbul: 9.0.1 + yargs: 16.2.0 + yargs-parser: 20.2.9 dev: true - /browser-sync-ui/2.27.11: - resolution: {integrity: sha512-1T/Y8Pp1R68aUL7zVSFq0nxtr258xWd/nTasCAHX2M6EsGaswVOFtXsw3bKqsr35z+J+LfVfOdz1HFLYKxdgrA==} + /cacache/16.1.3: + resolution: {integrity: sha512-/+Emcj9DAXxX4cwlLmRI9c166RuL3w30zp4R7Joiv2cQTtTtA+jeuCAjH3ZlGnYS3tKENSrKhAzVVP9GVyzeYQ==} + engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} dependencies: - async-each-series: 0.1.1 - connect-history-api-fallback: 1.6.0 - immutable: 3.8.2 - server-destroy: 1.0.1 - socket.io-client: 4.5.4 - stream-throttle: 0.1.3 + '@npmcli/fs': 2.1.2 + '@npmcli/move-file': 2.0.1 + chownr: 2.0.0 + fs-minipass: 2.1.0 + glob: 8.1.0 + infer-owner: 1.0.4 + lru-cache: 7.14.1 + minipass: 3.3.6 + minipass-collect: 1.0.2 + minipass-flush: 1.0.5 + minipass-pipeline: 1.2.4 + mkdirp: 1.0.4 + p-map: 4.0.0 + promise-inflight: 1.0.1 + rimraf: 3.0.2 + ssri: 9.0.1 + tar: 6.1.13 + unique-filename: 2.0.1 transitivePeerDependencies: - - bufferutil - - supports-color - - utf-8-validate - dev: true - - /browser-sync/2.27.11: - resolution: {integrity: sha512-U5f9u97OYJH66T0MGWWzG9rOQTW6ZmDMj97vsmtqwNS03JAwdLVES8eel2lD3rvAqQCNAFqaJ74NMacBI57vJg==} - engines: {node: '>= 8.0.0'} - hasBin: true - dependencies: - browser-sync-client: 2.27.11 - browser-sync-ui: 2.27.11 - bs-recipes: 1.3.4 - bs-snippet-injector: 2.0.1 - chokidar: 3.5.3 - connect: 3.6.6 - connect-history-api-fallback: 1.6.0 - dev-ip: 1.0.1 - easy-extender: 2.3.4 - eazy-logger: 3.1.0 - etag: 1.8.1 - fresh: 0.5.2 - fs-extra: 3.0.1 - http-proxy: 1.18.1 - immutable: 3.8.2 - localtunnel: 2.0.2 - micromatch: 4.0.5 - opn: 5.3.0 - portscanner: 2.2.0 - qs: 6.11.0 - raw-body: 2.5.1 - resp-modifier: 6.0.2 - rx: 4.1.0 - send: 0.16.2 - serve-index: 1.9.1 - serve-static: 1.13.2 - server-destroy: 1.0.1 - socket.io: 4.5.4 - ua-parser-js: 1.0.2 - yargs: 17.6.2 - transitivePeerDependencies: - - bufferutil - - debug - - supports-color - - utf-8-validate - dev: true - - /browserify-aes/1.2.0: - resolution: {integrity: sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==} - dependencies: - buffer-xor: 1.0.3 - cipher-base: 1.0.4 - create-hash: 1.2.0 - evp_bytestokey: 1.0.3 - inherits: 2.0.4 - safe-buffer: 5.2.1 - dev: true - - /browserify-cipher/1.0.1: - resolution: {integrity: sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==} - dependencies: - browserify-aes: 1.2.0 - browserify-des: 1.0.2 - evp_bytestokey: 1.0.3 - dev: true - - /browserify-des/1.0.2: - resolution: {integrity: sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==} - dependencies: - cipher-base: 1.0.4 - des.js: 1.0.1 - inherits: 2.0.4 - safe-buffer: 5.2.1 - dev: true - - /browserify-rsa/4.1.0: - resolution: {integrity: sha512-AdEER0Hkspgno2aR97SAf6vi0y0k8NuOpGnVH3O99rcA5Q6sh8QxcngtHuJ6uXwnfAXNM4Gn1Gb7/MV1+Ymbog==} - dependencies: - bn.js: 5.2.1 - randombytes: 2.1.0 - dev: true - - /browserify-sign/4.2.1: - resolution: {integrity: sha512-/vrA5fguVAKKAVTNJjgSm1tRQDHUU6DbwO9IROu/0WAzC8PKhucDSh18J0RMvVeHAn5puMd+QHC2erPRNf8lmg==} - dependencies: - bn.js: 5.2.1 - browserify-rsa: 4.1.0 - create-hash: 1.2.0 - create-hmac: 1.1.7 - elliptic: 6.5.4 - inherits: 2.0.4 - parse-asn1: 5.1.6 - readable-stream: 3.6.0 - safe-buffer: 5.2.1 - dev: true - - /browserify-zlib/0.2.0: - resolution: {integrity: sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==} - dependencies: - pako: 1.0.11 - dev: true - - /browserify/17.0.0: - resolution: {integrity: sha512-SaHqzhku9v/j6XsQMRxPyBrSP3gnwmE27gLJYZgMT2GeK3J0+0toN+MnuNYDfHwVGQfLiMZ7KSNSIXHemy905w==} - engines: {node: '>= 0.8'} - hasBin: true - dependencies: - JSONStream: 1.3.5 - assert: 1.5.0 - browser-pack: 6.1.0 - browser-resolve: 2.0.0 - browserify-zlib: 0.2.0 - buffer: 5.2.1 - cached-path-relative: 1.1.0 - concat-stream: 1.6.2 - console-browserify: 1.2.0 - constants-browserify: 1.0.0 - crypto-browserify: 3.12.0 - defined: 1.0.1 - deps-sort: 2.0.1 - domain-browser: 1.2.0 - duplexer2: 0.1.4 - events: 3.3.0 - glob: 7.2.3 - has: 1.0.3 - htmlescape: 1.1.1 - https-browserify: 1.0.0 - inherits: 2.0.4 - insert-module-globals: 7.2.1 - labeled-stream-splicer: 2.0.2 - mkdirp-classic: 0.5.3 - module-deps: 6.2.3 - os-browserify: 0.3.0 - parents: 1.0.1 - path-browserify: 1.0.1 - process: 0.11.10 - punycode: 1.4.1 - querystring-es3: 0.2.1 - read-only-stream: 2.0.0 - readable-stream: 2.3.7 - resolve: 1.22.1 - shasum-object: 1.0.0 - shell-quote: 1.7.4 - stream-browserify: 3.0.0 - stream-http: 3.2.0 - string_decoder: 1.3.0 - subarg: 1.0.0 - syntax-error: 1.4.0 - through2: 2.0.5 - timers-browserify: 1.4.2 - tty-browserify: 0.0.1 - url: 0.11.0 - util: 0.12.5 - vm-browserify: 1.1.2 - xtend: 4.0.2 - dev: true - - /bs-recipes/1.3.4: - resolution: {integrity: sha512-BXvDkqhDNxXEjeGM8LFkSbR+jzmP/CYpCiVKYn+soB1dDldeU15EBNDkwVXndKuX35wnNUaPd0qSoQEAkmQtMw==} - dev: true - - /bs-snippet-injector/2.0.1: - resolution: {integrity: sha512-4u8IgB+L9L+S5hknOj3ddNSb42436gsnGm1AuM15B7CdbkpQTyVWgIM5/JUBiKiRwGOR86uo0Lu/OsX+SAlJmw==} - dev: true - - /buffer-equal/1.0.1: - resolution: {integrity: sha512-QoV3ptgEaQpvVwbXdSO39iqPQTCxSF7A5U99AxbHYqUdCizL/lH2Z0A2y6nbZucxMEOtNyZfG2s6gsVugGpKkg==} - engines: {node: '>=0.4'} - dev: true - - /buffer-from/1.1.2: - resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==} - dev: true - - /buffer-xor/1.0.3: - resolution: {integrity: sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ==} - dev: true - - /buffer/5.2.1: - resolution: {integrity: sha512-c+Ko0loDaFfuPWiL02ls9Xd3GO3cPVmUobQ6t3rXNUk304u6hGq+8N/kFi+QEIKhzK3uwolVhLzszmfLmMLnqg==} - dependencies: - base64-js: 1.5.1 - ieee754: 1.2.1 - dev: true - - /buffer/5.7.1: - resolution: {integrity: sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==} - dependencies: - base64-js: 1.5.1 - ieee754: 1.2.1 - dev: false - - /builtin-modules/3.3.0: - resolution: {integrity: sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==} - engines: {node: '>=6'} - dev: true - - /builtin-status-codes/3.0.0: - resolution: {integrity: sha512-HpGFw18DgFWlncDfjTa2rcQ4W88O1mC8e8yZ2AvQY5KDaktSTwo+KRf6nHK6FRI5FyRyb/5T6+TSxfP7QyGsmQ==} - dev: true - - /bytes/3.1.2: - resolution: {integrity: sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==} - engines: {node: '>= 0.8'} - dev: true - - /c8/7.12.0: - resolution: {integrity: sha512-CtgQrHOkyxr5koX1wEUmN/5cfDa2ckbHRA4Gy5LAL0zaCFtVWJS5++n+w4/sr2GWGerBxgTjpKeDclk/Qk6W/A==} - engines: {node: '>=10.12.0'} - hasBin: true - dependencies: - '@bcoe/v8-coverage': 0.2.3 - '@istanbuljs/schema': 0.1.3 - find-up: 5.0.0 - foreground-child: 2.0.0 - istanbul-lib-coverage: 3.2.0 - istanbul-lib-report: 3.0.0 - istanbul-reports: 3.1.5 - rimraf: 3.0.2 - test-exclude: 6.0.0 - v8-to-istanbul: 9.0.1 - yargs: 16.2.0 - yargs-parser: 20.2.9 - dev: true - - /cacache/16.1.3: - resolution: {integrity: sha512-/+Emcj9DAXxX4cwlLmRI9c166RuL3w30zp4R7Joiv2cQTtTtA+jeuCAjH3ZlGnYS3tKENSrKhAzVVP9GVyzeYQ==} - engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} - dependencies: - '@npmcli/fs': 2.1.2 - '@npmcli/move-file': 2.0.1 - chownr: 2.0.0 - fs-minipass: 2.1.0 - glob: 8.1.0 - infer-owner: 1.0.4 - lru-cache: 7.14.1 - minipass: 3.3.6 - minipass-collect: 1.0.2 - minipass-flush: 1.0.5 - minipass-pipeline: 1.2.4 - mkdirp: 1.0.4 - p-map: 4.0.0 - promise-inflight: 1.0.1 - rimraf: 3.0.2 - ssri: 9.0.1 - tar: 6.1.13 - unique-filename: 2.0.1 - transitivePeerDependencies: - - bluebird - dev: false - - /cache-base/1.0.1: - resolution: {integrity: sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==} - engines: {node: '>=0.10.0'} - dependencies: - collection-visit: 1.0.0 - component-emitter: 1.3.0 - get-value: 2.0.6 - has-value: 1.0.0 - isobject: 3.0.1 - set-value: 2.0.1 - to-object-path: 0.3.0 - union-value: 1.0.1 - unset-value: 1.0.0 - dev: true - - /cached-path-relative/1.1.0: - resolution: {integrity: sha512-WF0LihfemtesFcJgO7xfOoOcnWzY/QHR4qeDqV44jPU3HTI54+LnfXK3SA27AVVGCdZFgjjFFaqUA9Jx7dMJZA==} - dev: true - - /call-bind/1.0.2: - resolution: {integrity: sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==} - dependencies: - function-bind: 1.1.1 - get-intrinsic: 1.2.0 - dev: true - - /camelcase/3.0.0: - resolution: {integrity: sha512-4nhGqUkc4BqbBBB4Q6zLuD7lzzrHYrjKGeYaEji/3tFR5VdJu9v+LilhGIVe8wxEJPPOeWo7eg8dwY13TZ1BNg==} - engines: {node: '>=0.10.0'} - dev: true - - /chalk/1.1.3: - resolution: {integrity: sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A==} - engines: {node: '>=0.10.0'} - dependencies: - ansi-styles: 2.2.1 - escape-string-regexp: 1.0.5 - has-ansi: 2.0.0 - strip-ansi: 3.0.1 - supports-color: 2.0.0 - dev: true - - /chokidar/2.1.8: - resolution: {integrity: sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg==} - deprecated: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies - dependencies: - anymatch: 2.0.0 - async-each: 1.0.4 - braces: 2.3.2 - glob-parent: 3.1.0 - inherits: 2.0.4 - is-binary-path: 1.0.1 - is-glob: 4.0.3 - normalize-path: 3.0.0 - path-is-absolute: 1.0.1 - readdirp: 2.2.1 - upath: 1.2.0 - optionalDependencies: - fsevents: 1.2.13 - transitivePeerDependencies: - - supports-color - dev: true - - /chokidar/3.5.3: - resolution: {integrity: sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==} - engines: {node: '>= 8.10.0'} - dependencies: - anymatch: 3.1.3 - braces: 3.0.2 - glob-parent: 5.1.2 - is-binary-path: 2.1.0 - is-glob: 4.0.3 - normalize-path: 3.0.0 - readdirp: 3.6.0 - optionalDependencies: - fsevents: 2.3.2 - dev: true + - bluebird + dev: false /chownr/1.1.4: resolution: {integrity: sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==} @@ -1162,36 +469,11 @@ packages: engines: {node: '>=10'} dev: false - /cipher-base/1.0.4: - resolution: {integrity: sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==} - dependencies: - inherits: 2.0.4 - safe-buffer: 5.2.1 - dev: true - - /class-utils/0.3.6: - resolution: {integrity: sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==} - engines: {node: '>=0.10.0'} - dependencies: - arr-union: 3.1.0 - define-property: 0.2.5 - isobject: 3.0.1 - static-extend: 0.1.2 - dev: true - /clean-stack/2.2.0: resolution: {integrity: sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==} engines: {node: '>=6'} dev: false - /cliui/3.2.0: - resolution: {integrity: sha512-0yayqDxWQbqk3ojkYqUKqaAQ6AfNKeKWRNA8kR0WXzAsdHpP4BIaOmMAG87JGuO6qcobyW4GjxHd9PmhEd+T9w==} - dependencies: - string-width: 1.0.2 - strip-ansi: 3.0.1 - wrap-ansi: 2.1.0 - dev: true - /cliui/7.0.4: resolution: {integrity: sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==} dependencies: @@ -1200,15 +482,6 @@ packages: wrap-ansi: 7.0.0 dev: true - /cliui/8.0.1: - resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} - engines: {node: '>=12'} - dependencies: - string-width: 4.2.3 - strip-ansi: 6.0.1 - wrap-ansi: 7.0.0 - dev: true - /clone-buffer/1.0.0: resolution: {integrity: sha512-KLLTJWrvwIP+OPfMn0x2PheDEP20RPUcGXj/ERegTgdmPEZylALQldygiqrPPu8P45uNuPs7ckmReLY6v/iA5g==} engines: {node: '>= 0.10'} @@ -1231,28 +504,6 @@ packages: readable-stream: 2.3.7 dev: true - /code-point-at/1.1.0: - resolution: {integrity: sha512-RpAVKQA5T63xEj6/giIbUEtZwJ4UFIc3ZtvEkiaUERylqe8xb5IvqcgOurZLahv93CLKfxcw5YI+DZcUBRyLXA==} - engines: {node: '>=0.10.0'} - dev: true - - /collection-map/1.0.0: - resolution: {integrity: sha512-5D2XXSpkOnleOI21TG7p3T0bGAsZ/XknZpKBmGYyluO8pw4zA3K8ZlrBIbC4FXg3m6z/RNFiUFfT2sQK01+UHA==} - engines: {node: '>=0.10.0'} - dependencies: - arr-map: 2.0.2 - for-own: 1.0.0 - make-iterator: 1.0.1 - dev: true - - /collection-visit/1.0.0: - resolution: {integrity: sha512-lNkKvzEeMBBjUGHZ+q6z9pSJla0KWAQPvtzhEV9+iGyQYG+pBpl7xKDhxoNSOZH2hhv0v5k0y2yAM4o4SjoSkw==} - engines: {node: '>=0.10.0'} - dependencies: - map-visit: 1.0.0 - object-visit: 1.0.1 - dev: true - /color-convert/2.0.1: resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} engines: {node: '>=7.0.0'} @@ -1267,15 +518,7 @@ packages: /color-support/1.1.3: resolution: {integrity: sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==} hasBin: true - - /combine-source-map/0.8.0: - resolution: {integrity: sha512-UlxQ9Vw0b/Bt/KYwCFqdEwsQ1eL8d1gibiFb7lxQJFdvTgc2hIZi6ugsg+kyhzhPV+QEpUiEIwInIAIrgoEkrg==} - dependencies: - convert-source-map: 1.1.3 - inline-source-map: 0.6.2 - lodash.memoize: 3.0.4 - source-map: 0.5.7 - dev: true + dev: false /commander/2.20.3: resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==} @@ -1290,29 +533,9 @@ packages: resolution: {integrity: sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==} dev: true - /component-emitter/1.3.0: - resolution: {integrity: sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==} - dev: true - /concat-map/0.0.1: resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} - /concat-stream/1.6.2: - resolution: {integrity: sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==} - engines: {'0': node >= 0.8} - dependencies: - buffer-from: 1.1.2 - inherits: 2.0.4 - readable-stream: 2.3.7 - typedarray: 0.0.6 - dev: true - - /concat-with-sourcemaps/1.1.0: - resolution: {integrity: sha512-4gEjHJFT9e+2W/77h/DS5SGUgwDaOwprX8L/gl5+3ixnzkVJJsZWDSelmN3Oilw3LNDZjZV0yqH1hLG3k6nghg==} - dependencies: - source-map: 0.6.1 - dev: true - /config-chain/1.1.13: resolution: {integrity: sha512-qj+f8APARXHrM0hraqXYb2/bOVSV4PvJQlNZ/DVj0QrmNM2q2euizkeuVckQ57J+W0mRH6Hvi+k50M4Jul2VRQ==} dependencies: @@ -1320,99 +543,17 @@ packages: proto-list: 1.2.4 dev: true - /connect-history-api-fallback/1.6.0: - resolution: {integrity: sha512-e54B99q/OUoH64zYYRf3HBP5z24G38h5D3qXu23JGRoigpX5Ss4r9ZnDk3g0Z8uQC2x2lPaJ+UlWBc1ZWBWdLg==} - engines: {node: '>=0.8'} - dev: true - - /connect/3.6.6: - resolution: {integrity: sha512-OO7axMmPpu/2XuX1+2Yrg0ddju31B6xLZMWkJ5rYBu4YRmRVlOjvlY6kw2FJKiAzyxGwnrDUAG4s1Pf0sbBMCQ==} - engines: {node: '>= 0.10.0'} - dependencies: - debug: 2.6.9 - finalhandler: 1.1.0 - parseurl: 1.3.3 - utils-merge: 1.0.1 - transitivePeerDependencies: - - supports-color - dev: true - - /console-browserify/1.2.0: - resolution: {integrity: sha512-ZMkYO/LkF17QvCPqM0gxw8yUzigAOZOSWSHg91FH6orS7vcEj5dVZTidN2fQ14yBSdg97RqhSNwLUXInd52OTA==} - dev: true - /console-control-strings/1.1.0: resolution: {integrity: sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==} dev: false - /constants-browserify/1.0.0: - resolution: {integrity: sha512-xFxOwqIzR/e1k1gLiWEophSCMqXcwVHIH7akf7b/vxcUeGunlj3hvZaaqxwHsTgn+IndtkQJgSztIDWeumWJDQ==} - dev: true - - /convert-source-map/1.1.3: - resolution: {integrity: sha512-Y8L5rp6jo+g9VEPgvqNfEopjTR4OTYct8lXlS8iVQdmnjDvbdbzYe9rjtFCB9egC86JoNCU61WRY+ScjkZpnIg==} - dev: true - /convert-source-map/1.9.0: resolution: {integrity: sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==} dev: true - /cookie/0.4.2: - resolution: {integrity: sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==} - engines: {node: '>= 0.6'} - dev: true - - /copy-descriptor/0.1.1: - resolution: {integrity: sha512-XgZ0pFcakEUlbwQEVNg3+QAis1FyTL3Qel9FYy8pSkQqoG3PNoT0bOCQtOXcOkur21r2Eq2kI+IE+gsmAEVlYw==} - engines: {node: '>=0.10.0'} - dev: true - - /copy-props/2.0.5: - resolution: {integrity: sha512-XBlx8HSqrT0ObQwmSzM7WE5k8FxTV75h1DX1Z3n6NhQ/UYYAvInWYmG06vFt7hQZArE2fuO62aihiWIVQwh1sw==} - dependencies: - each-props: 1.3.2 - is-plain-object: 5.0.0 - dev: true - /core-util-is/1.0.3: resolution: {integrity: sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==} - /cors/2.8.5: - resolution: {integrity: sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==} - engines: {node: '>= 0.10'} - dependencies: - object-assign: 4.1.1 - vary: 1.1.2 - dev: true - - /create-ecdh/4.0.4: - resolution: {integrity: sha512-mf+TCx8wWc9VpuxfP2ht0iSISLZnt0JgWlrOKZiNqyUZWnjIaCIVNQArMHnCZKfEYRg6IM7A+NeJoN8gf/Ws0A==} - dependencies: - bn.js: 4.12.0 - elliptic: 6.5.4 - dev: true - - /create-hash/1.2.0: - resolution: {integrity: sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==} - dependencies: - cipher-base: 1.0.4 - inherits: 2.0.4 - md5.js: 1.3.5 - ripemd160: 2.0.2 - sha.js: 2.4.11 - dev: true - - /create-hmac/1.1.7: - resolution: {integrity: sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==} - dependencies: - cipher-base: 1.0.4 - create-hash: 1.2.0 - inherits: 2.0.4 - ripemd160: 2.0.2 - safe-buffer: 5.2.1 - sha.js: 2.4.11 - dev: true - /cross-spawn/7.0.3: resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==} engines: {node: '>= 8'} @@ -1422,83 +563,17 @@ packages: which: 2.0.2 dev: true - /crypto-browserify/3.12.0: - resolution: {integrity: sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==} - dependencies: - browserify-cipher: 1.0.1 - browserify-sign: 4.2.1 - create-ecdh: 4.0.4 - create-hash: 1.2.0 - create-hmac: 1.1.7 - diffie-hellman: 5.0.3 - inherits: 2.0.4 - pbkdf2: 3.1.2 - public-encrypt: 4.0.3 - randombytes: 2.1.0 - randomfill: 1.0.4 - dev: true - - /d/1.0.1: - resolution: {integrity: sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==} - dependencies: - es5-ext: 0.10.62 - type: 1.2.0 - dev: true - - /dash-ast/1.0.0: - resolution: {integrity: sha512-Vy4dx7gquTeMcQR/hDkYLGUnwVil6vk4FOOct+djUnHOUWt+zJPJAaRIXaAFkPXtJjvlY7o3rfRu0/3hpnwoUA==} - dev: true - - /debug/2.6.9: - resolution: {integrity: sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true - dependencies: - ms: 2.0.0 - dev: true - - /debug/4.3.2: - resolution: {integrity: sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==} - engines: {node: '>=6.0'} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true - dependencies: - ms: 2.1.2 - dev: true - /debug/4.3.4: resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} engines: {node: '>=6.0'} peerDependencies: supports-color: '*' peerDependenciesMeta: - supports-color: - optional: true - dependencies: - ms: 2.1.2 - - /decamelize/1.2.0: - resolution: {integrity: sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==} - engines: {node: '>=0.10.0'} - dev: true - - /decode-uri-component/0.2.2: - resolution: {integrity: sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ==} - engines: {node: '>=0.10'} - dev: true - - /decomment/0.9.5: - resolution: {integrity: sha512-h0TZ8t6Dp49duwyDHo3iw67mnh9/UpFiSSiOb5gDK1sqoXzrfX/SQxIUQd2R2QEiSnqib0KF2fnKnGfAhAs6lg==} - engines: {node: '>=6.4', npm: '>=2.15'} + supports-color: + optional: true dependencies: - esprima: 4.0.1 - dev: true + ms: 2.1.2 + dev: false /decompress-response/6.0.0: resolution: {integrity: sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==} @@ -1510,58 +585,13 @@ packages: /deep-extend/0.6.0: resolution: {integrity: sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==} engines: {node: '>=4.0.0'} + dev: false /deepmerge/4.2.2: resolution: {integrity: sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==} engines: {node: '>=0.10.0'} dev: true - /default-compare/1.0.0: - resolution: {integrity: sha512-QWfXlM0EkAbqOCbD/6HjdwT19j7WCkMyiRhWilc4H9/5h/RzTF9gv5LYh1+CmDV5d1rki6KAWLtQale0xt20eQ==} - engines: {node: '>=0.10.0'} - dependencies: - kind-of: 5.1.0 - dev: true - - /default-resolution/2.0.0: - resolution: {integrity: sha512-2xaP6GiwVwOEbXCGoJ4ufgC76m8cj805jrghScewJC2ZDsb9U0b4BIrba+xt/Uytyd0HvQ6+WymSRTfnYj59GQ==} - engines: {node: '>= 0.10'} - dev: true - - /define-properties/1.1.4: - resolution: {integrity: sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA==} - engines: {node: '>= 0.4'} - dependencies: - has-property-descriptors: 1.0.0 - object-keys: 1.1.1 - dev: true - - /define-property/0.2.5: - resolution: {integrity: sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA==} - engines: {node: '>=0.10.0'} - dependencies: - is-descriptor: 0.1.6 - dev: true - - /define-property/1.0.0: - resolution: {integrity: sha512-cZTYKFWspt9jZsMscWo8sc/5lbPC9Q0N5nBLgb+Yd915iL3udB1uFgS3B8YCx66UVHq018DAVFoee7x+gxggeA==} - engines: {node: '>=0.10.0'} - dependencies: - is-descriptor: 1.0.2 - dev: true - - /define-property/2.0.2: - resolution: {integrity: sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==} - engines: {node: '>=0.10.0'} - dependencies: - is-descriptor: 1.0.2 - isobject: 3.0.1 - dev: true - - /defined/1.0.1: - resolution: {integrity: sha512-hsBd2qSVCRE+5PmNdHt1uzyrFu5d3RwmFDKzyNZMFq/EwDNJF7Ee5+D5oEKF0hU6LhtoUF1macFvOe4AskQC1Q==} - dev: true - /delegates/1.0.0: resolution: {integrity: sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==} dev: false @@ -1569,72 +599,18 @@ packages: /depd/1.1.2: resolution: {integrity: sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==} engines: {node: '>= 0.6'} - - /depd/2.0.0: - resolution: {integrity: sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==} - engines: {node: '>= 0.8'} - dev: true - - /deps-sort/2.0.1: - resolution: {integrity: sha512-1orqXQr5po+3KI6kQb9A4jnXT1PBwggGl2d7Sq2xsnOeI9GPcE/tGcF9UiSZtZBM7MukY4cAh7MemS6tZYipfw==} - hasBin: true - dependencies: - JSONStream: 1.3.5 - shasum-object: 1.0.0 - subarg: 1.0.0 - through2: 2.0.5 - dev: true - - /des.js/1.0.1: - resolution: {integrity: sha512-Q0I4pfFrv2VPd34/vfLrFOoRmlYj3OV50i7fskps1jZWK1kApMWWT9G6RRUeYedLcBDIhnSDaUvJMb3AhUlaEA==} - dependencies: - inherits: 2.0.4 - minimalistic-assert: 1.0.1 - dev: true - - /destroy/1.0.4: - resolution: {integrity: sha512-3NdhDuEXnfun/z7x9GOElY49LoqVHoGScmOKwmxhsS8N5Y+Z8KyPPDnaSzqWgYt/ji4mqwfTS34Htrk0zPIXVg==} - dev: true - - /detect-file/1.0.0: - resolution: {integrity: sha512-DtCOLG98P007x7wiiOmfI0fi3eIKyWiLTGJ2MDnVi/E04lWGbf+JzrRHMm0rgIIZJGtHpKpbVgLWHrv8xXpc3Q==} - engines: {node: '>=0.10.0'} - dev: true + dev: false /detect-libc/2.0.1: resolution: {integrity: sha512-463v3ZeIrcWtdgIg6vI6XUncguvr2TnGl4SzDXinkt9mSLpBJKXT3mW6xT3VQdDN11+WVs29pgvivTc4Lp8v+w==} engines: {node: '>=8'} dev: false - /detective/5.2.1: - resolution: {integrity: sha512-v9XE1zRnz1wRtgurGu0Bs8uHKFSTdteYZNbIPFVhUZ39L/S79ppMpdmVOZAnoz1jfEFodc48n6MX483Xo3t1yw==} - engines: {node: '>=0.8.0'} - hasBin: true - dependencies: - acorn-node: 1.8.2 - defined: 1.0.1 - minimist: 1.2.7 - dev: true - - /dev-ip/1.0.1: - resolution: {integrity: sha512-LmVkry/oDShEgSZPNgqCIp2/TlqtExeGmymru3uCELnfyjY11IzpAproLYs+1X88fXO6DBoYP3ul2Xo2yz2j6A==} - engines: {node: '>= 0.8.0'} - hasBin: true - dev: true - /diff/3.5.0: resolution: {integrity: sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==} engines: {node: '>=0.3.1'} dev: true - /diffie-hellman/5.0.3: - resolution: {integrity: sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==} - dependencies: - bn.js: 4.12.0 - miller-rabin: 4.0.1 - randombytes: 2.1.0 - dev: true - /dir-glob/3.0.1: resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==} engines: {node: '>=8'} @@ -1642,51 +618,6 @@ packages: path-type: 4.0.0 dev: true - /dlv/1.1.3: - resolution: {integrity: sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==} - dev: true - - /domain-browser/1.2.0: - resolution: {integrity: sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA==} - engines: {node: '>=0.4', npm: '>=1.2'} - dev: true - - /duplexer2/0.1.4: - resolution: {integrity: sha512-asLFVfWWtJ90ZyOUHMqk7/S2w2guQKxUI2itj3d92ADHhxUSbCMGi1f1cBcJ7xM1To+pE/Khbwo1yuNbMEPKeA==} - dependencies: - readable-stream: 2.3.7 - dev: true - - /duplexify/3.7.1: - resolution: {integrity: sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g==} - dependencies: - end-of-stream: 1.4.4 - inherits: 2.0.4 - readable-stream: 2.3.7 - stream-shift: 1.0.1 - dev: true - - /each-props/1.3.2: - resolution: {integrity: sha512-vV0Hem3zAGkJAyU7JSjixeU66rwdynTAa1vofCrSA5fEln+m67Az9CcnkVD776/fsN/UjIWmBDoNRS6t6G9RfA==} - dependencies: - is-plain-object: 2.0.4 - object.defaults: 1.1.0 - dev: true - - /easy-extender/2.3.4: - resolution: {integrity: sha512-8cAwm6md1YTiPpOvDULYJL4ZS6WfM5/cTeVVh4JsvyYZAoqlRVUpHL9Gr5Fy7HA6xcSZicUia3DeAgO3Us8E+Q==} - engines: {node: '>= 4.0.0'} - dependencies: - lodash: 4.17.21 - dev: true - - /eazy-logger/3.1.0: - resolution: {integrity: sha512-/snsn2JqBtUSSstEl4R0RKjkisGHAhvYj89i7r3ytNUKW12y178KDZwXLXIgwDqLW6E/VRMT9qfld7wvFae8bQ==} - engines: {node: '>= 0.8.0'} - dependencies: - tfunk: 4.0.0 - dev: true - /editorconfig/0.15.3: resolution: {integrity: sha512-M9wIMFx96vq0R4F+gRpY3o2exzb8hEj/n9S8unZtHSvYjibBp/iMufSzvmOcV/laG0ZtuTVGtiJggPOSW2r93g==} hasBin: true @@ -1697,30 +628,9 @@ packages: sigmund: 1.0.1 dev: true - /ee-first/1.1.1: - resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==} - dev: true - - /elliptic/6.5.4: - resolution: {integrity: sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==} - dependencies: - bn.js: 4.12.0 - brorand: 1.1.0 - hash.js: 1.1.7 - hmac-drbg: 1.0.1 - inherits: 2.0.4 - minimalistic-assert: 1.0.1 - minimalistic-crypto-utils: 1.0.1 - dev: true - /emoji-regex/8.0.0: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} - /encodeurl/1.0.2: - resolution: {integrity: sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==} - engines: {node: '>= 0.8'} - dev: true - /encoding/0.1.13: resolution: {integrity: sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==} requiresBuild: true @@ -1733,45 +643,7 @@ packages: resolution: {integrity: sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==} dependencies: once: 1.4.0 - - /engine.io-client/6.2.3: - resolution: {integrity: sha512-aXPtgF1JS3RuuKcpSrBtimSjYvrbhKW9froICH4s0F3XQWLxsKNxqzG39nnvQZQnva4CMvUK63T7shevxRyYHw==} - dependencies: - '@socket.io/component-emitter': 3.1.0 - debug: 4.3.4 - engine.io-parser: 5.0.6 - ws: 8.2.3 - xmlhttprequest-ssl: 2.0.0 - transitivePeerDependencies: - - bufferutil - - supports-color - - utf-8-validate - dev: true - - /engine.io-parser/5.0.6: - resolution: {integrity: sha512-tjuoZDMAdEhVnSFleYPCtdL2GXwVTGtNjoeJd9IhIG3C1xs9uwxqRNEu5WpnDZCaozwVlK/nuQhpodhXSIMaxw==} - engines: {node: '>=10.0.0'} - dev: true - - /engine.io/6.2.1: - resolution: {integrity: sha512-ECceEFcAaNRybd3lsGQKas3ZlMVjN3cyWwMP25D2i0zWfyiytVbTpRPa34qrr+FHddtpBVOmq4H/DCv1O0lZRA==} - engines: {node: '>=10.0.0'} - dependencies: - '@types/cookie': 0.4.1 - '@types/cors': 2.8.13 - '@types/node': 18.11.18 - accepts: 1.3.8 - base64id: 2.0.0 - cookie: 0.4.2 - cors: 2.8.5 - debug: 4.3.4 - engine.io-parser: 5.0.6 - ws: 8.2.3 - transitivePeerDependencies: - - bufferutil - - supports-color - - utf-8-validate - dev: true + dev: false /env-paths/2.2.1: resolution: {integrity: sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==} @@ -1782,176 +654,20 @@ packages: resolution: {integrity: sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==} dev: false - /error-ex/1.3.2: - resolution: {integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==} - dependencies: - is-arrayish: 0.2.1 - dev: true - - /es5-ext/0.10.62: - resolution: {integrity: sha512-BHLqn0klhEpnOKSrzn/Xsz2UIW8j+cGmo9JLzr8BiUapV8hPL9+FliFqjwr9ngW7jWdnxv6eO+/LqyhJVqgrjA==} - engines: {node: '>=0.10'} - requiresBuild: true - dependencies: - es6-iterator: 2.0.3 - es6-symbol: 3.1.3 - next-tick: 1.1.0 - dev: true - - /es6-iterator/2.0.3: - resolution: {integrity: sha512-zw4SRzoUkd+cl+ZoE15A9o1oQd920Bb0iOJMQkQhl3jNc03YqVjAhG7scf9C5KWRU/R13Orf588uCC6525o02g==} - dependencies: - d: 1.0.1 - es5-ext: 0.10.62 - es6-symbol: 3.1.3 - dev: true - - /es6-symbol/3.1.3: - resolution: {integrity: sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==} - dependencies: - d: 1.0.1 - ext: 1.7.0 - dev: true - - /es6-weak-map/2.0.3: - resolution: {integrity: sha512-p5um32HOTO1kP+w7PRnB+5lQ43Z6muuMuIMffvDN8ZB4GcnjLBV6zGStpbASIMk4DCAvEaamhe2zhyCb/QXXsA==} - dependencies: - d: 1.0.1 - es5-ext: 0.10.62 - es6-iterator: 2.0.3 - es6-symbol: 3.1.3 - dev: true - /escalade/3.1.1: resolution: {integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==} engines: {node: '>=6'} dev: true - /escape-html/1.0.3: - resolution: {integrity: sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==} - dev: true - - /escape-string-regexp/1.0.5: - resolution: {integrity: sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==} - engines: {node: '>=0.8.0'} - dev: true - - /esprima/4.0.1: - resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} - engines: {node: '>=4'} - hasBin: true - dev: true - /estree-walker/2.0.2: resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} dev: true - /etag/1.8.1: - resolution: {integrity: sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==} - engines: {node: '>= 0.6'} - dev: true - - /eventemitter3/4.0.7: - resolution: {integrity: sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==} - dev: true - - /events/3.3.0: - resolution: {integrity: sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==} - engines: {node: '>=0.8.x'} - dev: true - - /evp_bytestokey/1.0.3: - resolution: {integrity: sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==} - dependencies: - md5.js: 1.3.5 - safe-buffer: 5.2.1 - dev: true - - /expand-brackets/2.1.4: - resolution: {integrity: sha512-w/ozOKR9Obk3qoWeY/WDi6MFta9AoMR+zud60mdnbniMcBxRuFJyDt2LdX/14A1UABeqk+Uk+LDfUpvoGKppZA==} - engines: {node: '>=0.10.0'} - dependencies: - debug: 2.6.9 - define-property: 0.2.5 - extend-shallow: 2.0.1 - posix-character-classes: 0.1.1 - regex-not: 1.0.2 - snapdragon: 0.8.2 - to-regex: 3.0.2 - transitivePeerDependencies: - - supports-color - dev: true - /expand-template/2.0.3: resolution: {integrity: sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==} engines: {node: '>=6'} dev: false - /expand-tilde/2.0.2: - resolution: {integrity: sha512-A5EmesHW6rfnZ9ysHQjPdJRni0SRar0tjtG5MNtm9n5TUvsYU8oozprtRD4AqHxcZWWlVuAmQo2nWKfN9oyjTw==} - engines: {node: '>=0.10.0'} - dependencies: - homedir-polyfill: 1.0.3 - dev: true - - /ext/1.7.0: - resolution: {integrity: sha512-6hxeJYaL110a9b5TEJSj0gojyHQAmA2ch5Os+ySCiA1QGdS697XWY1pzsrSjqA9LDEEgdB/KypIlR59RcLuHYw==} - dependencies: - type: 2.7.2 - dev: true - - /extend-shallow/1.1.4: - resolution: {integrity: sha512-L7AGmkO6jhDkEBBGWlLtftA80Xq8DipnrRPr0pyi7GQLXkaq9JYA4xF4z6qnadIC6euiTDKco0cGSU9muw+WTw==} - engines: {node: '>=0.10.0'} - dependencies: - kind-of: 1.1.0 - dev: true - - /extend-shallow/2.0.1: - resolution: {integrity: sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==} - engines: {node: '>=0.10.0'} - dependencies: - is-extendable: 0.1.1 - dev: true - - /extend-shallow/3.0.2: - resolution: {integrity: sha512-BwY5b5Ql4+qZoefgMj2NUmx+tehVTH/Kf4k1ZEtOHNFcm2wSxMRo992l6X3TIgni2eZVTZ85xMOjF31fwZAj6Q==} - engines: {node: '>=0.10.0'} - dependencies: - assign-symbols: 1.0.0 - is-extendable: 1.0.1 - dev: true - - /extend/3.0.2: - resolution: {integrity: sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==} - dev: true - - /extglob/2.0.4: - resolution: {integrity: sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==} - engines: {node: '>=0.10.0'} - dependencies: - array-unique: 0.3.2 - define-property: 1.0.0 - expand-brackets: 2.1.4 - extend-shallow: 2.0.1 - fragment-cache: 0.2.1 - regex-not: 1.0.2 - snapdragon: 0.8.2 - to-regex: 3.0.2 - transitivePeerDependencies: - - supports-color - dev: true - - /fancy-log/1.3.3: - resolution: {integrity: sha512-k9oEhlyc0FrVh25qYuSELjr8oxsCoc4/LEZfg2iJJrfEk/tZL9bCoJE47gqAvI2m/AUjluCS4+3I0eTx8n3AEw==} - engines: {node: '>= 0.10'} - dependencies: - ansi-gray: 0.1.1 - color-support: 1.1.3 - parse-node-version: 1.0.1 - time-stamp: 1.1.0 - dev: true - /fast-glob/3.2.12: resolution: {integrity: sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==} engines: {node: '>=8.6.0'} @@ -1963,14 +679,6 @@ packages: micromatch: 4.0.5 dev: true - /fast-levenshtein/1.1.4: - resolution: {integrity: sha512-Ia0sQNrMPXXkqVFt6w6M1n1oKo3NfKs+mvaV811Jwir7vAk9a6PVV9VPYf6X3BU97QiLEmuW3uXH9u87zDFfdw==} - dev: true - - /fast-safe-stringify/2.1.1: - resolution: {integrity: sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==} - dev: true - /fastq/1.15.0: resolution: {integrity: sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==} dependencies: @@ -1979,16 +687,7 @@ packages: /file-uri-to-path/1.0.0: resolution: {integrity: sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==} - - /fill-range/4.0.0: - resolution: {integrity: sha512-VcpLTWqWDiTerugjj8e3+esbg+skS3M9e54UuR3iCeIDMXCLTsAH8hTSzDQU/X6/6t3eYkOKoZSef2PlU6U1XQ==} - engines: {node: '>=0.10.0'} - dependencies: - extend-shallow: 2.0.1 - is-number: 3.0.0 - repeat-string: 1.6.1 - to-regex-range: 2.1.1 - dev: true + dev: false /fill-range/7.0.1: resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==} @@ -1997,29 +696,6 @@ packages: to-regex-range: 5.0.1 dev: true - /finalhandler/1.1.0: - resolution: {integrity: sha512-ejnvM9ZXYzp6PUPUyQBMBf0Co5VX2gr5H2VQe2Ui2jWXNlxv+PYZo8wpAymJNJdLsG1R4p+M4aynF8KuoUEwRw==} - engines: {node: '>= 0.8'} - dependencies: - debug: 2.6.9 - encodeurl: 1.0.2 - escape-html: 1.0.3 - on-finished: 2.3.0 - parseurl: 1.3.3 - statuses: 1.3.1 - unpipe: 1.0.0 - transitivePeerDependencies: - - supports-color - dev: true - - /find-up/1.1.2: - resolution: {integrity: sha512-jvElSjyuo4EMQGoTwo1uJU5pQMwTW5lS1x05zzfJuTIyLR3zwO27LYrxNg+dlvKpGOuGy/MzBdXh80g0ve5+HA==} - engines: {node: '>=0.10.0'} - dependencies: - path-exists: 2.1.0 - pinkie-promise: 2.0.1 - dev: true - /find-up/5.0.0: resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==} engines: {node: '>=10'} @@ -2028,83 +704,6 @@ packages: path-exists: 4.0.0 dev: true - /findup-sync/2.0.0: - resolution: {integrity: sha512-vs+3unmJT45eczmcAZ6zMJtxN3l/QXeccaXQx5cu/MeJMhewVfoWZqibRkOxPnmoR59+Zy5hjabfQc6JLSah4g==} - engines: {node: '>= 0.10'} - dependencies: - detect-file: 1.0.0 - is-glob: 3.1.0 - micromatch: 3.1.10 - resolve-dir: 1.0.1 - transitivePeerDependencies: - - supports-color - dev: true - - /findup-sync/3.0.0: - resolution: {integrity: sha512-YbffarhcicEhOrm4CtrwdKBdCuz576RLdhJDsIfvNtxUuhdRet1qZcsMjqbePtAseKdAnDyM/IyXbu7PRPRLYg==} - engines: {node: '>= 0.10'} - dependencies: - detect-file: 1.0.0 - is-glob: 4.0.3 - micromatch: 3.1.10 - resolve-dir: 1.0.1 - transitivePeerDependencies: - - supports-color - dev: true - - /fined/1.2.0: - resolution: {integrity: sha512-ZYDqPLGxDkDhDZBjZBb+oD1+j0rA4E0pXY50eplAAOPg2N/gUBSSk5IM1/QhPfyVo19lJ+CvXpqfvk+b2p/8Ng==} - engines: {node: '>= 0.10'} - dependencies: - expand-tilde: 2.0.2 - is-plain-object: 2.0.4 - object.defaults: 1.1.0 - object.pick: 1.3.0 - parse-filepath: 1.0.2 - dev: true - - /flagged-respawn/1.0.1: - resolution: {integrity: sha512-lNaHNVymajmk0OJMBn8fVUAU1BtDeKIqKoVhk4xAALB57aALg6b4W0MfJ/cUE0g9YBXy5XhSlPIpYIJ7HaY/3Q==} - engines: {node: '>= 0.10'} - dev: true - - /flush-write-stream/1.1.1: - resolution: {integrity: sha512-3Z4XhFZ3992uIq0XOqb9AreonueSYphE6oYbpt5+3u06JWklbsPkNv3ZKkP9Bz/r+1MWCaMoSQ28P85+1Yc77w==} - dependencies: - inherits: 2.0.4 - readable-stream: 2.3.7 - dev: true - - /follow-redirects/1.15.2_debug@4.3.2: - resolution: {integrity: sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==} - engines: {node: '>=4.0'} - peerDependencies: - debug: '*' - peerDependenciesMeta: - debug: - optional: true - dependencies: - debug: 4.3.2 - dev: true - - /for-each/0.3.3: - resolution: {integrity: sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==} - dependencies: - is-callable: 1.2.7 - dev: true - - /for-in/1.0.2: - resolution: {integrity: sha512-7EwmXrOjyL+ChxMhmG5lnW9MPt1aIeZEwKhQzoBUdTV0N3zuwWDZYVJatDvZ2OyzPUvdIAZDsCetk3coyMfcnQ==} - engines: {node: '>=0.10.0'} - dev: true - - /for-own/1.0.0: - resolution: {integrity: sha512-0OABksIGrxKK8K4kynWkQ7y1zounQxP+CWnyclVwj81KW3vlLlGUx57DKGcP/LH216GzqnstnPocF16Nxs0Ycg==} - engines: {node: '>=0.10.0'} - dependencies: - for-in: 1.0.2 - dev: true - /foreground-child/2.0.0: resolution: {integrity: sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==} engines: {node: '>=8.0.0'} @@ -2113,60 +712,20 @@ packages: signal-exit: 3.0.7 dev: true - /fragment-cache/0.2.1: - resolution: {integrity: sha512-GMBAbW9antB8iZRHLoGw0b3HANt57diZYFO/HL1JGIC1MjKrdmhxvrJbupnVvpys0zsz7yBApXdQyfepKly2kA==} - engines: {node: '>=0.10.0'} - dependencies: - map-cache: 0.2.2 - dev: true - - /fresh/0.5.2: - resolution: {integrity: sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==} - engines: {node: '>= 0.6'} - dev: true - /fs-constants/1.0.0: resolution: {integrity: sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==} dev: false - /fs-extra/3.0.1: - resolution: {integrity: sha512-V3Z3WZWVUYd8hoCL5xfXJCaHWYzmtwW5XWYSlLgERi8PWd8bx1kUHUk8L1BT57e49oKnDDD180mjfrHc1yA9rg==} - dependencies: - graceful-fs: 4.2.10 - jsonfile: 3.0.1 - universalify: 0.1.2 - dev: true - /fs-minipass/2.1.0: resolution: {integrity: sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==} engines: {node: '>= 8'} dependencies: - minipass: 3.3.6 - dev: false - - /fs-mkdirp-stream/1.0.0: - resolution: {integrity: sha512-+vSd9frUnapVC2RZYfL3FCB2p3g4TBhaUmrsWlSudsGdnxIuUvBB2QM1VZeBtc49QFwrp+wQLrDs3+xxDgI5gQ==} - engines: {node: '>= 0.10'} - dependencies: - graceful-fs: 4.2.10 - through2: 2.0.5 - dev: true + minipass: 3.3.6 + dev: false /fs.realpath/1.0.0: resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} - /fsevents/1.2.13: - resolution: {integrity: sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==} - engines: {node: '>= 4.0'} - os: [darwin] - deprecated: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2. - requiresBuild: true - dependencies: - bindings: 1.5.0 - nan: 2.17.0 - dev: true - optional: true - /fsevents/2.3.2: resolution: {integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==} engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} @@ -2193,32 +752,11 @@ packages: wide-align: 1.1.5 dev: false - /get-assigned-identifiers/1.2.0: - resolution: {integrity: sha512-mBBwmeGTrxEMO4pMaaf/uUEFHnYtwr8FTe8Y/mer4rcV/bye0qGm6pw1bGZFGStxC5O76c5ZAVBGnqHmOaJpdQ==} - dev: true - - /get-caller-file/1.0.3: - resolution: {integrity: sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==} - dev: true - /get-caller-file/2.0.5: resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} engines: {node: 6.* || 8.* || >= 10.*} dev: true - /get-intrinsic/1.2.0: - resolution: {integrity: sha512-L049y6nFOuom5wGyRc3/gdTLO94dySVKRACj1RmJZBQXlbTMhtNIgkWkUHq+jYmZvKf14EW1EoJnnjbmoHij0Q==} - dependencies: - function-bind: 1.1.1 - has: 1.0.3 - has-symbols: 1.0.3 - dev: true - - /get-value/2.0.6: - resolution: {integrity: sha512-Ln0UQDlxH1BapMu3GPtf7CuYNwRZf2gwCuPqbyG6pB8WfmFpzqcy4xtAaAMUhnNqjMKTiCPZG2oMT3YSx8U2NA==} - engines: {node: '>=0.10.0'} - dev: true - /github-from-package/0.0.0: resolution: {integrity: sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==} dev: false @@ -2244,13 +782,6 @@ packages: - supports-color dev: false - /glob-parent/3.1.0: - resolution: {integrity: sha512-E8Ak/2+dZY6fnzlR7+ueWvhsH1SjHr4jjss4YS/h4py44jY9MhK/VFdaZJAWDz6BbL21KeteKxFSFpq8OS5gVA==} - dependencies: - is-glob: 3.1.0 - path-dirname: 1.0.2 - dev: true - /glob-parent/5.1.2: resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} engines: {node: '>= 6'} @@ -2258,37 +789,6 @@ packages: is-glob: 4.0.3 dev: true - /glob-stream/6.1.0: - resolution: {integrity: sha512-uMbLGAP3S2aDOHUDfdoYcdIePUCfysbAd0IAoWVZbeGU/oNQ8asHVSshLDJUPWxfzj8zsCG7/XeHPHTtow0nsw==} - engines: {node: '>= 0.10'} - dependencies: - extend: 3.0.2 - glob: 7.2.3 - glob-parent: 3.1.0 - is-negated-glob: 1.0.0 - ordered-read-streams: 1.0.1 - pumpify: 1.5.1 - readable-stream: 2.3.7 - remove-trailing-separator: 1.1.0 - to-absolute-glob: 2.0.2 - unique-stream: 2.3.1 - dev: true - - /glob-watcher/5.0.5: - resolution: {integrity: sha512-zOZgGGEHPklZNjZQaZ9f41i7F2YwE+tS5ZHrDhbBCk3stwahn5vQxnFmBJZHoYdusR6R1bLSXeGUy/BhctwKzw==} - engines: {node: '>= 0.10'} - dependencies: - anymatch: 2.0.0 - async-done: 1.3.2 - chokidar: 2.1.8 - is-negated-glob: 1.0.0 - just-debounce: 1.1.0 - normalize-path: 3.0.0 - object.defaults: 1.1.0 - transitivePeerDependencies: - - supports-color - dev: true - /glob/7.2.3: resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} dependencies: @@ -2309,26 +809,6 @@ packages: minimatch: 5.1.6 once: 1.4.0 - /global-modules/1.0.0: - resolution: {integrity: sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==} - engines: {node: '>=0.10.0'} - dependencies: - global-prefix: 1.0.2 - is-windows: 1.0.2 - resolve-dir: 1.0.1 - dev: true - - /global-prefix/1.0.2: - resolution: {integrity: sha512-5lsx1NUDHtSjfg0eHlmYvZKv8/nVqX4ckFbM+FrGcQ+04KWcWFo9P5MxPZYSzUvyzmdTbI7Eix8Q4IbELDqzKg==} - engines: {node: '>=0.10.0'} - dependencies: - expand-tilde: 2.0.2 - homedir-polyfill: 1.0.3 - ini: 1.3.8 - is-windows: 1.0.2 - which: 1.3.1 - dev: true - /globalyzer/0.1.0: resolution: {integrity: sha512-40oNTM9UfG6aBmuKxk/giHn5nQ8RVz/SS4Ir6zgzOv9/qC3kKZ9v4etGTcJbEl/NyVQH7FGU7d+X1egr57Md2Q==} dev: true @@ -2351,25 +831,12 @@ packages: resolution: {integrity: sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==} dev: true - /glogg/1.0.2: - resolution: {integrity: sha512-5mwUoSuBk44Y4EshyiqcH95ZntbDdTQqA3QYSrxmzj28Ai0vXBGMH1ApSANH14j2sIRtqCEyg6PfsuP7ElOEDA==} - engines: {node: '>= 0.10'} - dependencies: - sparkles: 1.0.1 - dev: true - /glsl-tokenizer/2.1.5: resolution: {integrity: sha512-XSZEJ/i4dmz3Pmbnpsy3cKh7cotvFlBiZnDOwnj/05EwNp2XrhQ4XKJxT7/pDt4kp4YcpRSKz8eTV7S+mwV6MA==} dependencies: through2: 0.6.5 dev: false - /gopd/1.0.1: - resolution: {integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==} - dependencies: - get-intrinsic: 1.2.0 - dev: true - /gpu-mock.js/1.3.1: resolution: {integrity: sha512-+lbp8rQ0p1nTa6Gk6HoLiw4yM6JTpql82U+nCF3sZbX4FJWP9PzzF1018dW8K+pbmqRmhLHbn6Bjc6i6tgUpbA==} peerDependencies: @@ -2378,125 +845,7 @@ packages: /graceful-fs/4.2.10: resolution: {integrity: sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==} - - /gulp-cli/2.3.0: - resolution: {integrity: sha512-zzGBl5fHo0EKSXsHzjspp3y5CONegCm8ErO5Qh0UzFzk2y4tMvzLWhoDokADbarfZRL2pGpRp7yt6gfJX4ph7A==} - engines: {node: '>= 0.10'} - hasBin: true - dependencies: - ansi-colors: 1.1.0 - archy: 1.0.0 - array-sort: 1.0.0 - color-support: 1.1.3 - concat-stream: 1.6.2 - copy-props: 2.0.5 - fancy-log: 1.3.3 - gulplog: 1.0.0 - interpret: 1.4.0 - isobject: 3.0.1 - liftoff: 3.1.0 - matchdep: 2.0.0 - mute-stdout: 1.0.1 - pretty-hrtime: 1.0.3 - replace-homedir: 1.0.0 - semver-greatest-satisfied-range: 1.1.0 - v8flags: 3.2.0 - yargs: 7.1.2 - transitivePeerDependencies: - - supports-color - dev: true - - /gulp-concat/2.6.1: - resolution: {integrity: sha512-a2scActrQrDBpBbR3WUZGyGS1JEPLg5PZJdIa7/Bi3GuKAmPYDK6SFhy/NZq5R8KsKKFvtfR0fakbUCcKGCCjg==} - engines: {node: '>= 0.10'} - dependencies: - concat-with-sourcemaps: 1.1.0 - through2: 2.0.5 - vinyl: 2.2.1 - dev: true - - /gulp-header/1.8.12: - resolution: {integrity: sha512-lh9HLdb53sC7XIZOYzTXM4lFuXElv3EVkSDhsd7DoJBj7hm+Ni7D3qYbb+Rr8DuM8nRanBvkVO9d7askreXGnQ==} - deprecated: Removed event-stream from gulp-header - dependencies: - concat-with-sourcemaps: 1.1.0 - lodash.template: 4.5.0 - through2: 2.0.5 - dev: true - - /gulp-jsbeautifier/2.1.2: - resolution: {integrity: sha512-tZUk4c11zF8xzCCTOEmktxGitv/H2vpAcflZNVU8nxL+G5XxQyLJUJVUKylz7/dax+FXb3YwQYByaJ+yxmo8iw==} - engines: {node: '>=0.10.0'} - dependencies: - chalk: 1.1.3 - fancy-log: 1.3.3 - js-beautify: 1.14.7 - lodash: 4.17.21 - plugin-error: 0.1.2 - rc: 1.2.8 - through2: 2.0.5 - dev: true - - /gulp-rename/1.4.0: - resolution: {integrity: sha512-swzbIGb/arEoFK89tPY58vg3Ok1bw+d35PfUNwWqdo7KM4jkmuGA78JiDNqR+JeZFaeeHnRg9N7aihX3YPmsyg==} - engines: {node: '>=4'} - dev: true - - /gulp-replace/1.1.4: - resolution: {integrity: sha512-SVSF7ikuWKhpAW4l4wapAqPPSToJoiNKsbDoUnRrSgwZHH7lH8pbPeQj1aOVYQrbZKhfSVBxVW+Py7vtulRktw==} - engines: {node: '>=10'} - dependencies: - '@types/node': 18.11.18 - '@types/vinyl': 2.0.7 - istextorbinary: 3.3.0 - replacestream: 4.0.3 - yargs-parser: 21.1.1 - dev: true - - /gulp-strip-comments/2.5.2: - resolution: {integrity: sha512-lb1bW7rsPWDD8f4ZPSguDvmCdjKmjr5HR4yZb9ros3sLl5AfW7oUj8KzY9/VRisT7dG8dL7hVHzNpQEVxfwZGQ==} - dependencies: - decomment: 0.9.5 - plugin-error: 0.1.2 - through2: 2.0.5 - dev: true - - /gulp-uglify-es/3.0.0: - resolution: {integrity: sha512-dQ3czMFFojNgCajcrYl0oa98+YayaQ8kXRdaacpZRZ3iw2sdVURfdt8y8Ki1ogZGQqw8BUawnB7V6NkanxqnDg==} - dependencies: - o-stream: 0.3.0 - plugin-error: 1.0.1 - terser: 5.16.1 - vinyl: 2.2.1 - vinyl-sourcemaps-apply: 0.2.1 - dev: true - - /gulp/4.0.2: - resolution: {integrity: sha512-dvEs27SCZt2ibF29xYgmnwwCYZxdxhQ/+LFWlbAW8y7jt68L/65402Lz3+CKy0Ov4rOs+NERmDq7YlZaDqUIfA==} - engines: {node: '>= 0.10'} - hasBin: true - dependencies: - glob-watcher: 5.0.5 - gulp-cli: 2.3.0 - undertaker: 1.3.0 - vinyl-fs: 3.0.3 - transitivePeerDependencies: - - supports-color - dev: true - - /gulplog/1.0.0: - resolution: {integrity: sha512-hm6N8nrm3Y08jXie48jsC55eCZz9mnb4OirAStEk2deqeyhXU3C1otDVh+ccttMuc1sBi6RX6ZJ720hs9RCvgw==} - engines: {node: '>= 0.10'} - dependencies: - glogg: 1.0.2 - dev: true - - /has-ansi/2.0.0: - resolution: {integrity: sha512-C8vBJ8DwUCx19vhm7urhTuUsr4/IyP6l4VzNQDv+ryHQObW3TTTp9yB68WpYgRe2bbaGuZ/se74IqFeVnMnLZg==} - engines: {node: '>=0.10.0'} - dependencies: - ansi-regex: 2.1.1 - dev: true + dev: false /has-flag/3.0.0: resolution: {integrity: sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==} @@ -2508,59 +857,10 @@ packages: engines: {node: '>=8'} dev: true - /has-property-descriptors/1.0.0: - resolution: {integrity: sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==} - dependencies: - get-intrinsic: 1.2.0 - dev: true - - /has-symbols/1.0.3: - resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==} - engines: {node: '>= 0.4'} - dev: true - - /has-tostringtag/1.0.0: - resolution: {integrity: sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==} - engines: {node: '>= 0.4'} - dependencies: - has-symbols: 1.0.3 - dev: true - /has-unicode/2.0.1: resolution: {integrity: sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==} dev: false - /has-value/0.3.1: - resolution: {integrity: sha512-gpG936j8/MzaeID5Yif+577c17TxaDmhuyVgSwtnL/q8UUTySg8Mecb+8Cf1otgLoD7DDH75axp86ER7LFsf3Q==} - engines: {node: '>=0.10.0'} - dependencies: - get-value: 2.0.6 - has-values: 0.1.4 - isobject: 2.1.0 - dev: true - - /has-value/1.0.0: - resolution: {integrity: sha512-IBXk4GTsLYdQ7Rvt+GRBrFSVEkmuOUy4re0Xjd9kJSUQpnTrWR4/y9RpfexN9vkAPMFuQoeWKwqzPozRTlasGw==} - engines: {node: '>=0.10.0'} - dependencies: - get-value: 2.0.6 - has-values: 1.0.0 - isobject: 3.0.1 - dev: true - - /has-values/0.1.4: - resolution: {integrity: sha512-J8S0cEdWuQbqD9//tlZxiMuMNmxB8PlEwvYwuxsTmR1G5RXUePEX/SJn7aD0GMLieuZYSwNH0cQuJGwnYunXRQ==} - engines: {node: '>=0.10.0'} - dev: true - - /has-values/1.0.0: - resolution: {integrity: sha512-ODYZC64uqzmtfGMEAX/FvZiRyWLpAC3vYnNunURUnkGVTS+mI0smVsWaPydRBsE3g+ok7h960jChO8mFcWlHaQ==} - engines: {node: '>=0.10.0'} - dependencies: - is-number: 3.0.0 - kind-of: 4.0.0 - dev: true - /has/1.0.3: resolution: {integrity: sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==} engines: {node: '>= 0.4.0'} @@ -2568,75 +868,14 @@ packages: function-bind: 1.1.1 dev: true - /hash-base/3.1.0: - resolution: {integrity: sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==} - engines: {node: '>=4'} - dependencies: - inherits: 2.0.4 - readable-stream: 3.6.0 - safe-buffer: 5.2.1 - dev: true - - /hash.js/1.1.7: - resolution: {integrity: sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==} - dependencies: - inherits: 2.0.4 - minimalistic-assert: 1.0.1 - dev: true - - /hmac-drbg/1.0.1: - resolution: {integrity: sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg==} - dependencies: - hash.js: 1.1.7 - minimalistic-assert: 1.0.1 - minimalistic-crypto-utils: 1.0.1 - dev: true - - /homedir-polyfill/1.0.3: - resolution: {integrity: sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==} - engines: {node: '>=0.10.0'} - dependencies: - parse-passwd: 1.0.0 - dev: true - - /hosted-git-info/2.8.9: - resolution: {integrity: sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==} - dev: true - /html-escaper/2.0.2: resolution: {integrity: sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==} dev: true - /htmlescape/1.1.1: - resolution: {integrity: sha512-eVcrzgbR4tim7c7soKQKtxa/kQM4TzjnlU83rcZ9bHU6t31ehfV7SktN6McWgwPWg+JYMA/O3qpGxBvFq1z2Jg==} - engines: {node: '>=0.10'} - dev: true - /http-cache-semantics/4.1.1: resolution: {integrity: sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==} dev: false - /http-errors/1.6.3: - resolution: {integrity: sha512-lks+lVC8dgGyh97jxvxeYTWQFvh4uw4yC12gVl63Cg30sjPX4wuGcdkICVXDAESr6OJGjqGA8Iz5mkeN6zlD7A==} - engines: {node: '>= 0.6'} - dependencies: - depd: 1.1.2 - inherits: 2.0.3 - setprototypeof: 1.1.0 - statuses: 1.4.0 - dev: true - - /http-errors/2.0.0: - resolution: {integrity: sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==} - engines: {node: '>= 0.8'} - dependencies: - depd: 2.0.0 - inherits: 2.0.4 - setprototypeof: 1.2.0 - statuses: 2.0.1 - toidentifier: 1.0.1 - dev: true - /http-proxy-agent/5.0.0: resolution: {integrity: sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==} engines: {node: '>= 6'} @@ -2648,21 +887,6 @@ packages: - supports-color dev: false - /http-proxy/1.18.1: - resolution: {integrity: sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==} - engines: {node: '>=8.0.0'} - dependencies: - eventemitter3: 4.0.7 - follow-redirects: 1.15.2_debug@4.3.2 - requires-port: 1.0.0 - transitivePeerDependencies: - - debug - dev: true - - /https-browserify/1.0.0: - resolution: {integrity: sha512-J+FkSdyD+0mA0N+81tMotaRMfSL9SGi+xpD3T6YApKsc3bGSXJlfXri3VyFOeYkfLRQisDk1W+jIFFKBeUBbBg==} - dev: true - /https-proxy-agent/5.0.1: resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==} engines: {node: '>= 6'} @@ -2679,13 +903,6 @@ packages: ms: 2.1.3 dev: false - /iconv-lite/0.4.24: - resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} - engines: {node: '>=0.10.0'} - dependencies: - safer-buffer: 2.1.2 - dev: true - /iconv-lite/0.6.3: resolution: {integrity: sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==} engines: {node: '>=0.10.0'} @@ -2694,140 +911,44 @@ packages: dev: false optional: true - /ieee754/1.2.1: - resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} - - /ignore/5.2.4: - resolution: {integrity: sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==} - engines: {node: '>= 4'} - dev: true - - /immutable/3.8.2: - resolution: {integrity: sha512-15gZoQ38eYjEjxkorfbcgBKBL6R7T459OuK+CpcWt7O3KF4uPCx2tD0uFETlUDIyo+1789crbMhTvQBSR5yBMg==} - engines: {node: '>=0.10.0'} - dev: true - - /imurmurhash/0.1.4: - resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} - engines: {node: '>=0.8.19'} - dev: false - - /indent-string/4.0.0: - resolution: {integrity: sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==} - engines: {node: '>=8'} - dev: false - - /infer-owner/1.0.4: - resolution: {integrity: sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A==} - dev: false - - /inflight/1.0.6: - resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} - dependencies: - once: 1.4.0 - wrappy: 1.0.2 - - /inherits/2.0.1: - resolution: {integrity: sha512-8nWq2nLTAwd02jTqJExUYFSD/fKq6VH9Y/oG2accc/kdI0V98Bag8d5a4gi3XHz73rDWa2PvTtvcWYquKqSENA==} - dev: true - - /inherits/2.0.3: - resolution: {integrity: sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw==} - dev: true - - /inherits/2.0.4: - resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} - - /ini/1.3.8: - resolution: {integrity: sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==} - - /inline-source-map/0.6.2: - resolution: {integrity: sha512-0mVWSSbNDvedDWIN4wxLsdPM4a7cIPcpyMxj3QZ406QRwQ6ePGB1YIHxVPjqpcUGbWQ5C+nHTwGNWAGvt7ggVA==} - dependencies: - source-map: 0.5.7 - dev: true - - /insert-module-globals/7.2.1: - resolution: {integrity: sha512-ufS5Qq9RZN+Bu899eA9QCAYThY+gGW7oRkmb0vC93Vlyu/CFGcH0OYPEjVkDXA5FEbTt1+VWzdoOD3Ny9N+8tg==} - hasBin: true - dependencies: - JSONStream: 1.3.5 - acorn-node: 1.8.2 - combine-source-map: 0.8.0 - concat-stream: 1.6.2 - is-buffer: 1.1.6 - path-is-absolute: 1.0.1 - process: 0.11.10 - through2: 2.0.5 - undeclared-identifiers: 1.1.3 - xtend: 4.0.2 - dev: true - - /interpret/1.4.0: - resolution: {integrity: sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==} - engines: {node: '>= 0.10'} - dev: true - - /invert-kv/1.0.0: - resolution: {integrity: sha512-xgs2NH9AE66ucSq4cNG1nhSFghr5l6tdL15Pk+jl46bmmBapgoaY/AacXyaDznAqmGL99TiLSQgO/XazFSKYeQ==} - engines: {node: '>=0.10.0'} - dev: true - - /ip/2.0.0: - resolution: {integrity: sha512-WKa+XuLG1A1R0UWhl2+1XQSi+fZWMsYKffMZTTYsiZaUD8k2yDAj5atimTUD2TZkyCkNEeYE5NhFZmupOGtjYQ==} - dev: false - - /is-absolute/1.0.0: - resolution: {integrity: sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA==} - engines: {node: '>=0.10.0'} - dependencies: - is-relative: 1.0.0 - is-windows: 1.0.2 - dev: true - - /is-accessor-descriptor/0.1.6: - resolution: {integrity: sha512-e1BM1qnDbMRG3ll2U9dSK0UMHuWOs3pY3AtcFsmvwPtKL3MML/Q86i+GilLfvqEs4GW+ExB91tQ3Ig9noDIZ+A==} - engines: {node: '>=0.10.0'} - dependencies: - kind-of: 3.2.2 - dev: true - - /is-accessor-descriptor/1.0.0: - resolution: {integrity: sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==} - engines: {node: '>=0.10.0'} - dependencies: - kind-of: 6.0.3 - dev: true - - /is-arguments/1.1.1: - resolution: {integrity: sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.2 - has-tostringtag: 1.0.0 - dev: true + /ieee754/1.2.1: + resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} + dev: false - /is-arrayish/0.2.1: - resolution: {integrity: sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==} + /ignore/5.2.4: + resolution: {integrity: sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==} + engines: {node: '>= 4'} dev: true - /is-binary-path/1.0.1: - resolution: {integrity: sha512-9fRVlXc0uCxEDj1nQzaWONSpbTfx0FmJfzHF7pwlI8DkWGoHBBea4Pg5Ky0ojwwxQmnSifgbKkI06Qv0Ljgj+Q==} - engines: {node: '>=0.10.0'} - dependencies: - binary-extensions: 1.13.1 - dev: true + /imurmurhash/0.1.4: + resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} + engines: {node: '>=0.8.19'} + dev: false - /is-binary-path/2.1.0: - resolution: {integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==} + /indent-string/4.0.0: + resolution: {integrity: sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==} engines: {node: '>=8'} + dev: false + + /infer-owner/1.0.4: + resolution: {integrity: sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A==} + dev: false + + /inflight/1.0.6: + resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} dependencies: - binary-extensions: 2.2.0 - dev: true + once: 1.4.0 + wrappy: 1.0.2 - /is-buffer/1.1.6: - resolution: {integrity: sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==} - dev: true + /inherits/2.0.4: + resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} + + /ini/1.3.8: + resolution: {integrity: sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==} + + /ip/2.0.0: + resolution: {integrity: sha512-WKa+XuLG1A1R0UWhl2+1XQSi+fZWMsYKffMZTTYsiZaUD8k2yDAj5atimTUD2TZkyCkNEeYE5NhFZmupOGtjYQ==} + dev: false /is-builtin-module/3.2.0: resolution: {integrity: sha512-phDA4oSGt7vl1n5tJvTWooWWAsXLY+2xCnxNqvKhGEzujg+A43wPlPOyDg3C8XQHN+6k/JTQWJ/j0dQh/qr+Hw==} @@ -2836,91 +957,21 @@ packages: builtin-modules: 3.3.0 dev: true - /is-callable/1.2.7: - resolution: {integrity: sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==} - engines: {node: '>= 0.4'} - dev: true - /is-core-module/2.11.0: resolution: {integrity: sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw==} dependencies: has: 1.0.3 dev: true - /is-data-descriptor/0.1.4: - resolution: {integrity: sha512-+w9D5ulSoBNlmw9OHn3U2v51SyoCd0he+bB3xMl62oijhrspxowjU+AIcDY0N3iEJbUEkB15IlMASQsxYigvXg==} - engines: {node: '>=0.10.0'} - dependencies: - kind-of: 3.2.2 - dev: true - - /is-data-descriptor/1.0.0: - resolution: {integrity: sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==} - engines: {node: '>=0.10.0'} - dependencies: - kind-of: 6.0.3 - dev: true - - /is-descriptor/0.1.6: - resolution: {integrity: sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==} - engines: {node: '>=0.10.0'} - dependencies: - is-accessor-descriptor: 0.1.6 - is-data-descriptor: 0.1.4 - kind-of: 5.1.0 - dev: true - - /is-descriptor/1.0.2: - resolution: {integrity: sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==} - engines: {node: '>=0.10.0'} - dependencies: - is-accessor-descriptor: 1.0.0 - is-data-descriptor: 1.0.0 - kind-of: 6.0.3 - dev: true - - /is-extendable/0.1.1: - resolution: {integrity: sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==} - engines: {node: '>=0.10.0'} - dev: true - - /is-extendable/1.0.1: - resolution: {integrity: sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==} - engines: {node: '>=0.10.0'} - dependencies: - is-plain-object: 2.0.4 - dev: true - /is-extglob/2.1.1: resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} engines: {node: '>=0.10.0'} dev: true - /is-fullwidth-code-point/1.0.0: - resolution: {integrity: sha512-1pqUqRjkhPJ9miNq9SwMfdvi6lBJcd6eFxvfaivQhaH3SgisfiuudvFntdKOmxuee/77l+FPjKrQjWvmPjWrRw==} - engines: {node: '>=0.10.0'} - dependencies: - number-is-nan: 1.0.1 - dev: true - /is-fullwidth-code-point/3.0.0: resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} engines: {node: '>=8'} - /is-generator-function/1.0.10: - resolution: {integrity: sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==} - engines: {node: '>= 0.4'} - dependencies: - has-tostringtag: 1.0.0 - dev: true - - /is-glob/3.1.0: - resolution: {integrity: sha512-UFpDDrPgM6qpnFNI+rh/p3bUaq9hKLZN8bMUWzxmcnZVS3omf4IPK+BrewlnWjO1WmUsMYuSjKh4UJuV4+Lqmw==} - engines: {node: '>=0.10.0'} - dependencies: - is-extglob: 2.1.1 - dev: true - /is-glob/4.0.3: resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} engines: {node: '>=0.10.0'} @@ -2936,29 +987,6 @@ packages: resolution: {integrity: sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g==} dev: true - /is-negated-glob/1.0.0: - resolution: {integrity: sha512-czXVVn/QEmgvej1f50BZ648vUI+em0xqMq2Sn+QncCLN4zj1UAxlT+kw/6ggQTOaZPd1HqKQGEqbpQVtJucWug==} - engines: {node: '>=0.10.0'} - dev: true - - /is-number-like/1.0.8: - resolution: {integrity: sha512-6rZi3ezCyFcn5L71ywzz2bS5b2Igl1En3eTlZlvKjpz1n3IZLAYMbKYAIQgFmEu0GENg92ziU/faEOA/aixjbA==} - dependencies: - lodash.isfinite: 3.3.2 - dev: true - - /is-number/3.0.0: - resolution: {integrity: sha512-4cboCqIpliH+mAvFNegjZQ4kgKc3ZUhQVr3HvWbSh5q3WH2v82ct+T2Y1hdU5Gdtorx/cLifQjqCbL7bpznLTg==} - engines: {node: '>=0.10.0'} - dependencies: - kind-of: 3.2.2 - dev: true - - /is-number/4.0.0: - resolution: {integrity: sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==} - engines: {node: '>=0.10.0'} - dev: true - /is-number/7.0.0: resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} engines: {node: '>=0.12.0'} @@ -2981,68 +1009,12 @@ packages: engines: {node: '>=8'} dev: true - /is-plain-object/2.0.4: - resolution: {integrity: sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==} - engines: {node: '>=0.10.0'} - dependencies: - isobject: 3.0.1 - dev: true - - /is-plain-object/5.0.0: - resolution: {integrity: sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==} - engines: {node: '>=0.10.0'} - dev: true - /is-reference/1.2.1: resolution: {integrity: sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==} dependencies: '@types/estree': 1.0.0 dev: true - /is-relative/1.0.0: - resolution: {integrity: sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA==} - engines: {node: '>=0.10.0'} - dependencies: - is-unc-path: 1.0.0 - dev: true - - /is-typed-array/1.1.10: - resolution: {integrity: sha512-PJqgEHiWZvMpaFZ3uTc8kHPM4+4ADTlDniuQL7cU/UDA0Ql7F70yGfHph3cLNe+c9toaigv+DFzTJKhc2CtO6A==} - engines: {node: '>= 0.4'} - dependencies: - available-typed-arrays: 1.0.5 - call-bind: 1.0.2 - for-each: 0.3.3 - gopd: 1.0.1 - has-tostringtag: 1.0.0 - dev: true - - /is-unc-path/1.0.0: - resolution: {integrity: sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ==} - engines: {node: '>=0.10.0'} - dependencies: - unc-path-regex: 0.1.2 - dev: true - - /is-utf8/0.2.1: - resolution: {integrity: sha512-rMYPYvCzsXywIsldgLaSoPlw5PfoB/ssr7hY4pLfcodrA5M/eArza1a9VmTiNIBNMjOGr1Ow9mTyU2o69U6U9Q==} - dev: true - - /is-valid-glob/1.0.0: - resolution: {integrity: sha512-AhiROmoEFDSsjx8hW+5sGwgKVIORcXnrlAx/R0ZSeaPw70Vw0CqkGBBhHGL58Uox2eXnU1AnvXJl1XlyedO5bA==} - engines: {node: '>=0.10.0'} - dev: true - - /is-windows/1.0.2: - resolution: {integrity: sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==} - engines: {node: '>=0.10.0'} - dev: true - - /is-wsl/1.1.0: - resolution: {integrity: sha512-gfygJYZ2gLTDlmbWMI0CE2MwnFzSN/2SZfkMlItC4K/JBlsWVDB0bO6XhqcY13YXE7iMcAJnzTCJjPiTeJJ0Mw==} - engines: {node: '>=4'} - dev: true - /isarray/0.0.1: resolution: {integrity: sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==} @@ -3053,18 +1025,6 @@ packages: /isexe/2.0.0: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} - /isobject/2.1.0: - resolution: {integrity: sha512-+OUdGJlgjOBZDfxnDjYYG6zp487z0JGNQq3cYQYg5f5hKR+syHMsaztzGeml/4kGG55CSpKSpWTY+jYGgsHLgA==} - engines: {node: '>=0.10.0'} - dependencies: - isarray: 1.0.0 - dev: true - - /isobject/3.0.1: - resolution: {integrity: sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==} - engines: {node: '>=0.10.0'} - dev: true - /istanbul-lib-coverage/3.2.0: resolution: {integrity: sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==} engines: {node: '>=8'} @@ -3087,14 +1047,6 @@ packages: istanbul-lib-report: 3.0.0 dev: true - /istextorbinary/3.3.0: - resolution: {integrity: sha512-Tvq1W6NAcZeJ8op+Hq7tdZ434rqnMx4CCZ7H0ff83uEloDvVbqAwaMTZcafKGJT0VHkYzuXUiCY4hlXQg6WfoQ==} - engines: {node: '>=8'} - dependencies: - binaryextensions: 2.3.0 - textextensions: 3.3.0 - dev: true - /js-beautify/1.14.7: resolution: {integrity: sha512-5SOX1KXPFKx+5f6ZrPsIPEY7NwKeQz47n3jm2i+XeHx9MoRsfQenlOP13FQhWvg8JRS0+XLO6XYUQ2GX+q+T9A==} engines: {node: '>=10'} @@ -3106,138 +1058,10 @@ packages: nopt: 6.0.0 dev: true - /json-stable-stringify-without-jsonify/1.0.1: - resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==} - dev: true - - /jsonfile/3.0.1: - resolution: {integrity: sha512-oBko6ZHlubVB5mRFkur5vgYR1UyqX+S6Y/oCfLhqNdcc2fYFlDpIoNc7AfKS1KOGcnNAkvsr0grLck9ANM815w==} - optionalDependencies: - graceful-fs: 4.2.10 - dev: true - - /jsonparse/1.3.1: - resolution: {integrity: sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg==} - engines: {'0': node >= 0.2.0} - dev: true - - /just-debounce/1.1.0: - resolution: {integrity: sha512-qpcRocdkUmf+UTNBYx5w6dexX5J31AKK1OmPwH630a83DdVVUIngk55RSAiIGpQyoH0dlr872VHfPjnQnK1qDQ==} - dev: true - /just-extend/4.2.1: resolution: {integrity: sha512-g3UB796vUFIY90VIv/WX3L2c8CS2MdWUww3CNrYmqza1Fg0DURc2K/O4YrnklBdQarSJ/y8JnJYDGc+1iumQjg==} dev: true - /kind-of/1.1.0: - resolution: {integrity: sha512-aUH6ElPnMGon2/YkxRIigV32MOpTVcoXQ1Oo8aYn40s+sJ3j+0gFZsT8HKDcxNy7Fi9zuquWtGaGAahOdv5p/g==} - engines: {node: '>=0.10.0'} - dev: true - - /kind-of/3.2.2: - resolution: {integrity: sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==} - engines: {node: '>=0.10.0'} - dependencies: - is-buffer: 1.1.6 - dev: true - - /kind-of/4.0.0: - resolution: {integrity: sha512-24XsCxmEbRwEDbz/qz3stgin8TTzZ1ESR56OMCN0ujYg+vRutNSiOj9bHH9u85DKgXguraugV5sFuvbD4FW/hw==} - engines: {node: '>=0.10.0'} - dependencies: - is-buffer: 1.1.6 - dev: true - - /kind-of/5.1.0: - resolution: {integrity: sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==} - engines: {node: '>=0.10.0'} - dev: true - - /kind-of/6.0.3: - resolution: {integrity: sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==} - engines: {node: '>=0.10.0'} - dev: true - - /labeled-stream-splicer/2.0.2: - resolution: {integrity: sha512-Ca4LSXFFZUjPScRaqOcFxneA0VpKZr4MMYCljyQr4LIewTLb3Y0IUTIsnBBsVubIeEfxeSZpSjSsRM8APEQaAw==} - dependencies: - inherits: 2.0.4 - stream-splicer: 2.0.1 - dev: true - - /last-run/1.1.1: - resolution: {integrity: sha512-U/VxvpX4N/rFvPzr3qG5EtLKEnNI0emvIQB3/ecEwv+8GHaUKbIB8vxv1Oai5FAF0d0r7LXHhLLe5K/yChm5GQ==} - engines: {node: '>= 0.10'} - dependencies: - default-resolution: 2.0.0 - es6-weak-map: 2.0.3 - dev: true - - /lazystream/1.0.1: - resolution: {integrity: sha512-b94GiNHQNy6JNTrt5w6zNyffMrNkXZb3KTkCZJb2V1xaEGCk093vkZ2jk3tpaeP33/OiXC+WvK9AxUebnf5nbw==} - engines: {node: '>= 0.6.3'} - dependencies: - readable-stream: 2.3.7 - dev: true - - /lcid/1.0.0: - resolution: {integrity: sha512-YiGkH6EnGrDGqLMITnGjXtGmNtjoXw9SVUzcaos8RBi7Ps0VBylkq+vOcY9QE5poLasPCR849ucFUkl0UzUyOw==} - engines: {node: '>=0.10.0'} - dependencies: - invert-kv: 1.0.0 - dev: true - - /lead/1.0.0: - resolution: {integrity: sha512-IpSVCk9AYvLHo5ctcIXxOBpMWUe+4TKN3VPWAKUbJikkmsGp0VrSM8IttVc32D6J4WUsiPE6aEFRNmIoF/gdow==} - engines: {node: '>= 0.10'} - dependencies: - flush-write-stream: 1.1.1 - dev: true - - /liftoff/3.1.0: - resolution: {integrity: sha512-DlIPlJUkCV0Ips2zf2pJP0unEoT1kwYhiiPUGF3s/jtxTCjziNLoiVVh+jqWOWeFi6mmwQ5fNxvAUyPad4Dfog==} - engines: {node: '>= 0.8'} - dependencies: - extend: 3.0.2 - findup-sync: 3.0.0 - fined: 1.2.0 - flagged-respawn: 1.0.1 - is-plain-object: 2.0.4 - object.map: 1.0.1 - rechoir: 0.6.2 - resolve: 1.22.1 - transitivePeerDependencies: - - supports-color - dev: true - - /limiter/1.1.5: - resolution: {integrity: sha512-FWWMIEOxz3GwUI4Ts/IvgVy6LPvoMPgjMdQ185nN6psJyBJ4yOpzqm695/h5umdLJg2vW3GR5iG11MAkR2AzJA==} - dev: true - - /load-json-file/1.1.0: - resolution: {integrity: sha512-cy7ZdNRXdablkXYNI049pthVeXFurRyb9+hA/dZzerZ0pGTx42z+y+ssxBaVV2l70t1muq5IdKhn4UtcoGUY9A==} - engines: {node: '>=0.10.0'} - dependencies: - graceful-fs: 4.2.10 - parse-json: 2.2.0 - pify: 2.3.0 - pinkie-promise: 2.0.1 - strip-bom: 2.0.0 - dev: true - - /localtunnel/2.0.2: - resolution: {integrity: sha512-n418Cn5ynvJd7m/N1d9WVJISLJF/ellZnfsLnx8WBWGzxv/ntNcFkJ1o6se5quUhCplfLGBNL5tYHiq5WF3Nug==} - engines: {node: '>=8.3.0'} - hasBin: true - dependencies: - axios: 0.21.4_debug@4.3.2 - debug: 4.3.2 - openurl: 1.1.1 - yargs: 17.1.1 - transitivePeerDependencies: - - supports-color - dev: true - /locate-path/6.0.0: resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==} engines: {node: '>=10'} @@ -3245,31 +1069,6 @@ packages: p-locate: 5.0.0 dev: true - /lodash._reinterpolate/3.0.0: - resolution: {integrity: sha512-xYHt68QRoYGjeeM/XOE1uJtvXQAgvszfBhjV4yvsQH0u2i9I6cI6c6/eG4Hh3UAOVn0y/xAXwmTzEay49Q//HA==} - dev: true - - /lodash.isfinite/3.3.2: - resolution: {integrity: sha512-7FGG40uhC8Mm633uKW1r58aElFlBlxCrg9JfSi3P6aYiWmfiWF0PgMd86ZUsxE5GwWPdHoS2+48bwTh2VPkIQA==} - dev: true - - /lodash.memoize/3.0.4: - resolution: {integrity: sha512-eDn9kqrAmVUC1wmZvlQ6Uhde44n+tXpqPrN8olQJbttgh0oKclk+SF54P47VEGE9CEiMeRwAP8BaM7UHvBkz2A==} - dev: true - - /lodash.template/4.5.0: - resolution: {integrity: sha512-84vYFxIkmidUiFxidA/KjjH9pAycqW+h980j7Fuz5qxRtO9pgB7MDFTdys1N7A5mcucRiDyEq4fusljItR1T/A==} - dependencies: - lodash._reinterpolate: 3.0.0 - lodash.templatesettings: 4.2.0 - dev: true - - /lodash.templatesettings/4.2.0: - resolution: {integrity: sha512-stgLz+i3Aa9mZgnjr/O+v9ruKZsPsndy7qPZOchbqk2cnTU1ZaldKK+v7m54WoKIyxiuMZTKT2H81F8BeAc3ZQ==} - dependencies: - lodash._reinterpolate: 3.0.0 - dev: true - /lodash/4.17.21: resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} dev: true @@ -3342,108 +1141,17 @@ packages: - supports-color dev: false - /make-iterator/1.0.1: - resolution: {integrity: sha512-pxiuXh0iVEq7VM7KMIhs5gxsfxCux2URptUQaXo4iZZJxBAzTPOLE2BumO5dbfVYq/hBJFBR/a1mFDmOx5AGmw==} - engines: {node: '>=0.10.0'} - dependencies: - kind-of: 6.0.3 - dev: true - - /map-cache/0.2.2: - resolution: {integrity: sha512-8y/eV9QQZCiyn1SprXSrCmqJN0yNRATe+PO8ztwqrvrbdRLA3eYJF0yaR0YayLWkMbsQSKWS9N2gPcGEc4UsZg==} - engines: {node: '>=0.10.0'} - dev: true - - /map-visit/1.0.0: - resolution: {integrity: sha512-4y7uGv8bd2WdM9vpQsiQNo41Ln1NvhvDRuVt0k2JZQ+ezN2uaQes7lZeZ+QQUHOLQAtDaBJ+7wCbi+ab/KFs+w==} - engines: {node: '>=0.10.0'} - dependencies: - object-visit: 1.0.1 - dev: true - - /matchdep/2.0.0: - resolution: {integrity: sha512-LFgVbaHIHMqCRuCZyfCtUOq9/Lnzhi7Z0KFUE2fhD54+JN2jLh3hC02RLkqauJ3U4soU6H1J3tfj/Byk7GoEjA==} - engines: {node: '>= 0.10.0'} - dependencies: - findup-sync: 2.0.0 - micromatch: 3.1.10 - resolve: 1.22.1 - stack-trace: 0.0.10 - transitivePeerDependencies: - - supports-color - dev: true - - /md5.js/1.3.5: - resolution: {integrity: sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==} - dependencies: - hash-base: 3.1.0 - inherits: 2.0.4 - safe-buffer: 5.2.1 - dev: true - - /merge-stream/1.0.1: - resolution: {integrity: sha512-e6RM36aegd4f+r8BZCcYXlO2P3H6xbUM6ktL2Xmf45GAOit9bI4z6/3VU7JwllVO1L7u0UDSg/EhzQ5lmMLolA==} - dependencies: - readable-stream: 2.3.7 - dev: true - /merge2/1.4.1: resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} engines: {node: '>= 8'} dev: true - /micromatch/3.1.10: - resolution: {integrity: sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==} - engines: {node: '>=0.10.0'} - dependencies: - arr-diff: 4.0.0 - array-unique: 0.3.2 - braces: 2.3.2 - define-property: 2.0.2 - extend-shallow: 3.0.2 - extglob: 2.0.4 - fragment-cache: 0.2.1 - kind-of: 6.0.3 - nanomatch: 1.2.13 - object.pick: 1.3.0 - regex-not: 1.0.2 - snapdragon: 0.8.2 - to-regex: 3.0.2 - transitivePeerDependencies: - - supports-color - dev: true - /micromatch/4.0.5: resolution: {integrity: sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==} engines: {node: '>=8.6'} dependencies: - braces: 3.0.2 - picomatch: 2.3.1 - dev: true - - /miller-rabin/4.0.1: - resolution: {integrity: sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==} - hasBin: true - dependencies: - bn.js: 4.12.0 - brorand: 1.1.0 - dev: true - - /mime-db/1.52.0: - resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} - engines: {node: '>= 0.6'} - dev: true - - /mime-types/2.1.35: - resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} - engines: {node: '>= 0.6'} - dependencies: - mime-db: 1.52.0 - dev: true - - /mime/1.4.1: - resolution: {integrity: sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ==} - hasBin: true + braces: 3.0.2 + picomatch: 2.3.1 dev: true /mimic-response/3.1.0: @@ -3451,14 +1159,6 @@ packages: engines: {node: '>=10'} dev: false - /minimalistic-assert/1.0.1: - resolution: {integrity: sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==} - dev: true - - /minimalistic-crypto-utils/1.0.1: - resolution: {integrity: sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==} - dev: true - /minimatch/3.1.2: resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} dependencies: @@ -3472,6 +1172,7 @@ packages: /minimist/1.2.7: resolution: {integrity: sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==} + dev: false /minipass-collect/1.0.2: resolution: {integrity: sha512-6T6lH0H8OG9kITm/Jm6tdooIbogG9e0tLgpY6mphXSm/A9u8Nq1ryBG+Qspiub9LjWlBPsPS3tWQ/Botq4FdxA==} @@ -3534,20 +1235,9 @@ packages: yallist: 4.0.0 dev: false - /mitt/1.2.0: - resolution: {integrity: sha512-r6lj77KlwqLhIUku9UWYes7KJtsczvolZkzp8hbaDPPaE24OmWl5s539Mytlj22siEQKosZ26qCBgda2PKwoJw==} - dev: true - - /mixin-deep/1.3.2: - resolution: {integrity: sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==} - engines: {node: '>=0.10.0'} - dependencies: - for-in: 1.0.2 - is-extendable: 1.0.1 - dev: true - /mkdirp-classic/0.5.3: resolution: {integrity: sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==} + dev: false /mkdirp/1.0.4: resolution: {integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==} @@ -3555,65 +1245,17 @@ packages: hasBin: true dev: false - /module-deps/6.2.3: - resolution: {integrity: sha512-fg7OZaQBcL4/L+AK5f4iVqf9OMbCclXfy/znXRxTVhJSeW5AIlS9AwheYwDaXM3lVW7OBeaeUEY3gbaC6cLlSA==} - engines: {node: '>= 0.8.0'} - hasBin: true - dependencies: - JSONStream: 1.3.5 - browser-resolve: 2.0.0 - cached-path-relative: 1.1.0 - concat-stream: 1.6.2 - defined: 1.0.1 - detective: 5.2.1 - duplexer2: 0.1.4 - inherits: 2.0.4 - parents: 1.0.1 - readable-stream: 2.3.7 - resolve: 1.22.1 - stream-combiner2: 1.1.1 - subarg: 1.0.0 - through2: 2.0.5 - xtend: 4.0.2 - dev: true - - /ms/2.0.0: - resolution: {integrity: sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==} - dev: true - /ms/2.1.2: resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} + dev: false /ms/2.1.3: resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} dev: false - /mute-stdout/1.0.1: - resolution: {integrity: sha512-kDcwXR4PS7caBpuRYYBUz9iVixUk3anO3f5OYFiIPwK/20vCzKCHyKoulbiDY1S53zD2bxUpxN/IJ+TnXjfvxg==} - engines: {node: '>= 0.10'} - dev: true - /nan/2.17.0: resolution: {integrity: sha512-2ZTgtl0nJsO0KQCjEpxcIr5D+Yv90plTitZt9JBfQvVJDS5seMl3FOvsh3+9CoYWXf/1l5OaZzzF6nDm4cagaQ==} - - /nanomatch/1.2.13: - resolution: {integrity: sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==} - engines: {node: '>=0.10.0'} - dependencies: - arr-diff: 4.0.0 - array-unique: 0.3.2 - define-property: 2.0.2 - extend-shallow: 3.0.2 - fragment-cache: 0.2.1 - is-windows: 1.0.2 - kind-of: 6.0.3 - object.pick: 1.3.0 - regex-not: 1.0.2 - snapdragon: 0.8.2 - to-regex: 3.0.2 - transitivePeerDependencies: - - supports-color - dev: true + dev: false /napi-build-utils/1.0.2: resolution: {integrity: sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg==} @@ -3622,10 +1264,7 @@ packages: /negotiator/0.6.3: resolution: {integrity: sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==} engines: {node: '>= 0.6'} - - /next-tick/1.1.0: - resolution: {integrity: sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==} - dev: true + dev: false /nise/1.5.3: resolution: {integrity: sha512-Ymbac/94xeIrMf59REBPOv0thr+CJVFMhrlAkW/gjCIE58BGQdCj0x7KRCb3yz+Ga2Rz3E9XXSvUyyxqqhjQAQ==} @@ -3676,34 +1315,6 @@ packages: dependencies: abbrev: 1.1.1 - /normalize-package-data/2.5.0: - resolution: {integrity: sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==} - dependencies: - hosted-git-info: 2.8.9 - resolve: 1.22.1 - semver: 5.7.1 - validate-npm-package-license: 3.0.4 - dev: true - - /normalize-path/2.1.1: - resolution: {integrity: sha512-3pKJwH184Xo/lnH6oyP1q2pMd7HcypqqmRs91/6/i2CGtWwIKGCkOOMTm/zXbgTEWHw1uNpNi/igc3ePOYHb6w==} - engines: {node: '>=0.10.0'} - dependencies: - remove-trailing-separator: 1.1.0 - dev: true - - /normalize-path/3.0.0: - resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} - engines: {node: '>=0.10.0'} - dev: true - - /now-and-later/2.0.1: - resolution: {integrity: sha512-KGvQ0cB70AQfg107Xvs/Fbu+dGmZoTRJp2TaPwcwQm3/7PteUyN2BCgk8KBMPGBUXZdVwyWS8fDCGFygBm19UQ==} - engines: {node: '>= 0.10'} - dependencies: - once: 1.4.0 - dev: true - /npmlog/6.0.2: resolution: {integrity: sha512-/vBvz5Jfr9dT/aFWd0FIRf+T/Q2WBsLENygUaFUqstqsycmZAP/t5BvFJTK0viFmSUxiUKTUplWy5vt+rvKIxg==} engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} @@ -3714,128 +1325,11 @@ packages: set-blocking: 2.0.0 dev: false - /number-is-nan/1.0.1: - resolution: {integrity: sha512-4jbtZXNAsfZbAHiiqjLPBiCl16dES1zI4Hpzzxw61Tk+loF+sBDBKx1ICKKKwIqQ7M0mFn1TmkN7euSncWgHiQ==} - engines: {node: '>=0.10.0'} - dev: true - - /o-stream/0.3.0: - resolution: {integrity: sha512-gbzl6qCJZ609x/M2t25HqCYQagFzWYCtQ84jcuObGr+V8D1Am4EVubkF4J+XFs6ukfiv96vNeiBb8FrbbMZYiQ==} - dev: true - - /object-assign/4.1.1: - resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} - engines: {node: '>=0.10.0'} - dev: true - - /object-copy/0.1.0: - resolution: {integrity: sha512-79LYn6VAb63zgtmAteVOWo9Vdj71ZVBy3Pbse+VqxDpEP83XuujMrGqHIwAXJ5I/aM0zU7dIyIAhifVTPrNItQ==} - engines: {node: '>=0.10.0'} - dependencies: - copy-descriptor: 0.1.1 - define-property: 0.2.5 - kind-of: 3.2.2 - dev: true - - /object-inspect/1.12.3: - resolution: {integrity: sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==} - dev: true - - /object-keys/1.1.1: - resolution: {integrity: sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==} - engines: {node: '>= 0.4'} - dev: true - - /object-visit/1.0.1: - resolution: {integrity: sha512-GBaMwwAVK9qbQN3Scdo0OyvgPW7l3lnaVMj84uTOZlswkX0KpF6fyDBJhtTthf7pymztoN36/KEr1DyhF96zEA==} - engines: {node: '>=0.10.0'} - dependencies: - isobject: 3.0.1 - dev: true - - /object.assign/4.1.4: - resolution: {integrity: sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.2 - define-properties: 1.1.4 - has-symbols: 1.0.3 - object-keys: 1.1.1 - dev: true - - /object.defaults/1.1.0: - resolution: {integrity: sha512-c/K0mw/F11k4dEUBMW8naXUuBuhxRCfG7W+yFy8EcijU/rSmazOUd1XAEEe6bC0OuXY4HUKjTJv7xbxIMqdxrA==} - engines: {node: '>=0.10.0'} - dependencies: - array-each: 1.0.1 - array-slice: 1.1.0 - for-own: 1.0.0 - isobject: 3.0.1 - dev: true - - /object.map/1.0.1: - resolution: {integrity: sha512-3+mAJu2PLfnSVGHwIWubpOFLscJANBKuB/6A4CxBstc4aqwQY0FWcsppuy4jU5GSB95yES5JHSI+33AWuS4k6w==} - engines: {node: '>=0.10.0'} - dependencies: - for-own: 1.0.0 - make-iterator: 1.0.1 - dev: true - - /object.pick/1.3.0: - resolution: {integrity: sha512-tqa/UMy/CCoYmj+H5qc07qvSL9dqcs/WZENZ1JbtWBlATP+iVOe778gE6MSijnyCnORzDuX6hU+LA4SZ09YjFQ==} - engines: {node: '>=0.10.0'} - dependencies: - isobject: 3.0.1 - dev: true - - /object.reduce/1.0.1: - resolution: {integrity: sha512-naLhxxpUESbNkRqc35oQ2scZSJueHGQNUfMW/0U37IgN6tE2dgDWg3whf+NEliy3F/QysrO48XKUz/nGPe+AQw==} - engines: {node: '>=0.10.0'} - dependencies: - for-own: 1.0.0 - make-iterator: 1.0.1 - dev: true - - /on-finished/2.3.0: - resolution: {integrity: sha512-ikqdkGAAyf/X/gPhXGvfgAytDZtDbr+bkNUJ0N9h5MI/dmdgCs3l6hoHrcUv41sRKew3jIwrp4qQDXiK99Utww==} - engines: {node: '>= 0.8'} - dependencies: - ee-first: 1.1.1 - dev: true - /once/1.4.0: resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} dependencies: wrappy: 1.0.2 - /openurl/1.1.1: - resolution: {integrity: sha512-d/gTkTb1i1GKz5k3XE3XFV/PxQ1k45zDqGP2OA7YhgsaLoqm6qRvARAZOFer1fcXritWlGBRCu/UgeS4HAnXAA==} - dev: true - - /opn/5.3.0: - resolution: {integrity: sha512-bYJHo/LOmoTd+pfiYhfZDnf9zekVJrY+cnS2a5F2x+w5ppvTqObojTP7WiFG+kVZs9Inw+qQ/lw7TroWwhdd2g==} - engines: {node: '>=4'} - dependencies: - is-wsl: 1.1.0 - dev: true - - /ordered-read-streams/1.0.1: - resolution: {integrity: sha512-Z87aSjx3r5c0ZB7bcJqIgIRX5bxR7A4aSzvIbaxd0oTkWBCOoKfuGHiKj60CHVUgg1Phm5yMZzBdt8XqRs73Mw==} - dependencies: - readable-stream: 2.3.7 - dev: true - - /os-browserify/0.3.0: - resolution: {integrity: sha512-gjcpUc3clBf9+210TRaDWbf+rZZZEshZ+DlXMRCeAjp0xhTrnQsKHypIy1J3d5hKdUzj69t708EHtU8P6bUn0A==} - dev: true - - /os-locale/1.4.0: - resolution: {integrity: sha512-PRT7ZORmwu2MEFt4/fv3Q+mEfN4zetKxufQrkShY2oGvUms9r8otu5HfdyIFHkYXjO7laNsoVGmM2MANfuTA8g==} - engines: {node: '>=0.10.0'} - dependencies: - lcid: 1.0.0 - dev: true - /p-limit/3.1.0: resolution: {integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==} engines: {node: '>=10'} @@ -3857,77 +1351,6 @@ packages: aggregate-error: 3.1.0 dev: false - /pako/1.0.11: - resolution: {integrity: sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==} - dev: true - - /parents/1.0.1: - resolution: {integrity: sha512-mXKF3xkoUt5td2DoxpLmtOmZvko9VfFpwRwkKDHSNvgmpLAeBo18YDhcPbBzJq+QLCHMbGOfzia2cX4U+0v9Mg==} - dependencies: - path-platform: 0.11.15 - dev: true - - /parse-asn1/5.1.6: - resolution: {integrity: sha512-RnZRo1EPU6JBnra2vGHj0yhp6ebyjBZpmUCLHWiFhxlzvBCCpAuZ7elsBp1PVAbQN0/04VD/19rfzlBSwLstMw==} - dependencies: - asn1.js: 5.4.1 - browserify-aes: 1.2.0 - evp_bytestokey: 1.0.3 - pbkdf2: 3.1.2 - safe-buffer: 5.2.1 - dev: true - - /parse-filepath/1.0.2: - resolution: {integrity: sha512-FwdRXKCohSVeXqwtYonZTXtbGJKrn+HNyWDYVcp5yuJlesTwNH4rsmRZ+GrKAPJ5bLpRxESMeS+Rl0VCHRvB2Q==} - engines: {node: '>=0.8'} - dependencies: - is-absolute: 1.0.0 - map-cache: 0.2.2 - path-root: 0.1.1 - dev: true - - /parse-json/2.2.0: - resolution: {integrity: sha512-QR/GGaKCkhwk1ePQNYDRKYZ3mwU9ypsKhB0XyFnLQdomyEqk3e8wpW3V5Jp88zbxK4n5ST1nqo+g9juTpownhQ==} - engines: {node: '>=0.10.0'} - dependencies: - error-ex: 1.3.2 - dev: true - - /parse-node-version/1.0.1: - resolution: {integrity: sha512-3YHlOa/JgH6Mnpr05jP9eDG254US9ek25LyIxZlDItp2iJtwyaXQb57lBYLdT3MowkUFYEV2XXNAYIPlESvJlA==} - engines: {node: '>= 0.10'} - dev: true - - /parse-passwd/1.0.0: - resolution: {integrity: sha512-1Y1A//QUXEZK7YKz+rD9WydcE1+EuPr6ZBgKecAB8tmoW6UFv0NREVJe1p+jRxtThkcbbKkfwIbWJe/IeE6m2Q==} - engines: {node: '>=0.10.0'} - dev: true - - /parseurl/1.3.3: - resolution: {integrity: sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==} - engines: {node: '>= 0.8'} - dev: true - - /pascalcase/0.1.1: - resolution: {integrity: sha512-XHXfu/yOQRy9vYOtUDVMN60OEJjW013GoObG1o+xwQTpB9eYJX/BjXMsdW13ZDPruFhYYn0AG22w0xgQMwl3Nw==} - engines: {node: '>=0.10.0'} - dev: true - - /path-browserify/1.0.1: - resolution: {integrity: sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==} - dev: true - - /path-dirname/1.0.2: - resolution: {integrity: sha512-ALzNPpyNq9AqXMBjeymIjFDAkAFH06mHJH/cSBHAgU0s4vfpBn6b2nf8tiRLvagKD8RbTpq2FKTBg7cl9l3c7Q==} - dev: true - - /path-exists/2.1.0: - resolution: {integrity: sha512-yTltuKuhtNeFJKa1PiRzfLAU5182q1y4Eb4XCJ3PBqyzEDkAZRzBrKKBct682ls9reBVHf9udYLN5Nd+K1B9BQ==} - engines: {node: '>=0.10.0'} - dependencies: - pinkie-promise: 2.0.1 - dev: true - /path-exists/4.0.0: resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} engines: {node: '>=8'} @@ -3946,23 +1369,6 @@ packages: resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} dev: true - /path-platform/0.11.15: - resolution: {integrity: sha512-Y30dB6rab1A/nfEKsZxmr01nUotHX0c/ZiIAsCTatEe1CmS5Pm5He7fZ195bPT7RdquoaL8lLxFCMQi/bS7IJg==} - engines: {node: '>= 0.8.0'} - dev: true - - /path-root-regex/0.1.2: - resolution: {integrity: sha512-4GlJ6rZDhQZFE0DPVKh0e9jmZ5egZfxTkp7bcRDuPlJXbAwhxcl2dINPUAsjLdejqaLsCeg8axcLjIbvBjN4pQ==} - engines: {node: '>=0.10.0'} - dev: true - - /path-root/0.1.1: - resolution: {integrity: sha512-QLcPegTHF11axjfojBIoDygmS2E3Lf+8+jI6wOVmNVenrKSo3mFdSGiIgdSHenczw3wPtlVMQaFVwGmM7BJdtg==} - engines: {node: '>=0.10.0'} - dependencies: - path-root-regex: 0.1.2 - dev: true - /path-sort2/1.0.0: resolution: {integrity: sha512-OwUzmr3+avyEANhpUkUv+nlwAM/sCX5y9Ylok8fj3OK3SmLclq7jyEoqSL5qi+5bJAOskWGZPtdtjnoRGy5lxA==} dev: true @@ -3973,91 +1379,20 @@ packages: isarray: 0.0.1 dev: true - /path-type/1.1.0: - resolution: {integrity: sha512-S4eENJz1pkiQn9Znv33Q+deTOKmbl+jj1Fl+qiP/vYezj+S8x+J3Uo0ISrx/QoEvIlOaDWJhPaRd1flJ9HXZqg==} - engines: {node: '>=0.10.0'} - dependencies: - graceful-fs: 4.2.10 - pify: 2.3.0 - pinkie-promise: 2.0.1 - dev: true - /path-type/4.0.0: resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==} engines: {node: '>=8'} dev: true - /pbkdf2/3.1.2: - resolution: {integrity: sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA==} - engines: {node: '>=0.12'} - dependencies: - create-hash: 1.2.0 - create-hmac: 1.1.7 - ripemd160: 2.0.2 - safe-buffer: 5.2.1 - sha.js: 2.4.11 - dev: true - /picomatch/2.3.1: resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} engines: {node: '>=8.6'} dev: true - /pify/2.3.0: - resolution: {integrity: sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==} - engines: {node: '>=0.10.0'} - dev: true - - /pinkie-promise/2.0.1: - resolution: {integrity: sha512-0Gni6D4UcLTbv9c57DfxDGdr41XfgUjqWZu492f0cIGr16zDU06BWP/RAEvOuo7CQ0CNjHaLlM59YJJFm3NWlw==} - engines: {node: '>=0.10.0'} - dependencies: - pinkie: 2.0.4 - dev: true - - /pinkie/2.0.4: - resolution: {integrity: sha512-MnUuEycAemtSaeFSjXKW/aroV7akBbY+Sv+RkyqFjgAe73F+MR0TBWKBRDkmfWq/HiFmdavfZ1G7h4SPZXaCSg==} - engines: {node: '>=0.10.0'} - dev: true - /platform/1.3.6: resolution: {integrity: sha512-fnWVljUchTro6RiCFvCXBbNhJc2NijN7oIQxbwsyL0buWJPG85v81ehlHI9fXrJsMNgTofEoWIQeClKpgxFLrg==} dev: true - /plugin-error/0.1.2: - resolution: {integrity: sha512-WzZHcm4+GO34sjFMxQMqZbsz3xiNEgonCskQ9v+IroMmYgk/tas8dG+Hr2D6IbRPybZ12oWpzE/w3cGJ6FJzOw==} - engines: {node: '>=0.10.0'} - dependencies: - ansi-cyan: 0.1.1 - ansi-red: 0.1.1 - arr-diff: 1.1.0 - arr-union: 2.1.0 - extend-shallow: 1.1.4 - dev: true - - /plugin-error/1.0.1: - resolution: {integrity: sha512-L1zP0dk7vGweZME2i+EeakvUNqSrdiI3F91TwEoYiGrAfUXmVv6fJIq4g82PAXxNsWOp0J7ZqQy/3Szz0ajTxA==} - engines: {node: '>= 0.10'} - dependencies: - ansi-colors: 1.1.0 - arr-diff: 4.0.0 - arr-union: 3.1.0 - extend-shallow: 3.0.2 - dev: true - - /portscanner/2.2.0: - resolution: {integrity: sha512-IFroCz/59Lqa2uBvzK3bKDbDDIEaAY8XJ1jFxcLWTqosrsc32//P4VuSB2vZXoHiHqOmx8B5L5hnKOxL/7FlPw==} - engines: {node: '>=0.4', npm: '>=1.0.0'} - dependencies: - async: 2.6.4 - is-number-like: 1.0.8 - dev: true - - /posix-character-classes/0.1.1: - resolution: {integrity: sha512-xTgYBc3fuo7Yt7JbiuFxSYGToMoz8fLoE6TC9Wx1P/u+LfeThMOAqmuyECnlBaaJb+u1m9hHiXUEtwW4OzfUJg==} - engines: {node: '>=0.10.0'} - dev: true - /prebuild-install/7.1.1: resolution: {integrity: sha512-jAXscXWMcCK8GgCoHOfIr0ODh5ai8mj63L2nWrjuAgXE6tDyYGnx4/8o/rCgU+B4JSyZBKbeZqzhtwtC3ovxjw==} engines: {node: '>=10'} @@ -4077,20 +1412,10 @@ packages: tunnel-agent: 0.6.0 dev: false - /pretty-hrtime/1.0.3: - resolution: {integrity: sha512-66hKPCr+72mlfiSjlEB1+45IjXSqvVAIy6mocupoww4tBFE9R9IhwwUGoI4G++Tc9Aq+2rxOt0RFU6gPcrte0A==} - engines: {node: '>= 0.8'} - dev: true - /process-nextick-args/2.0.1: resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==} dev: true - /process/0.11.10: - resolution: {integrity: sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==} - engines: {node: '>= 0.6.0'} - dev: true - /promise-inflight/1.0.1: resolution: {integrity: sha512-6zWPyEOFaQBJYcGMHBKTKJ3u6TBsnMFOIZSa6ce1e/ZrrsOlnHRHbabMjLiBYKp+n44X9eUI6VUPaukCXHuG4g==} peerDependencies: @@ -4116,24 +1441,6 @@ packages: resolution: {integrity: sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ==} dev: true - /public-encrypt/4.0.3: - resolution: {integrity: sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==} - dependencies: - bn.js: 4.12.0 - browserify-rsa: 4.1.0 - create-hash: 1.2.0 - parse-asn1: 5.1.6 - randombytes: 2.1.0 - safe-buffer: 5.2.1 - dev: true - - /pump/2.0.1: - resolution: {integrity: sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==} - dependencies: - end-of-stream: 1.4.4 - once: 1.4.0 - dev: true - /pump/3.0.0: resolution: {integrity: sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==} dependencies: @@ -4141,40 +1448,6 @@ packages: once: 1.4.0 dev: false - /pumpify/1.5.1: - resolution: {integrity: sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ==} - dependencies: - duplexify: 3.7.1 - inherits: 2.0.4 - pump: 2.0.1 - dev: true - - /punycode/1.3.2: - resolution: {integrity: sha512-RofWgt/7fL5wP1Y7fxE7/EmTLzQVnB0ycyibJ0OOHIlJqTNzglYFxVwETOcIoJqJmpDXJ9xImDv+Fq34F/d4Dw==} - dev: true - - /punycode/1.4.1: - resolution: {integrity: sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ==} - dev: true - - /qs/6.11.0: - resolution: {integrity: sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==} - engines: {node: '>=0.6'} - dependencies: - side-channel: 1.0.4 - dev: true - - /querystring-es3/0.2.1: - resolution: {integrity: sha512-773xhDQnZBMFobEiztv8LIl70ch5MSF/jUQVlhwFyBILqq96anmoctVIYz+ZRp0qbCKATTn6ev02M3r7Ga5vqA==} - engines: {node: '>=0.4.x'} - dev: true - - /querystring/0.2.0: - resolution: {integrity: sha512-X/xY82scca2tau62i9mDyU9K+I+djTMUsvwf7xnUX5GLvVzgJybOJf4Y6o9Zx3oJK/LSXg5tTZBjwzqVPaPO2g==} - engines: {node: '>=0.4.x'} - deprecated: The querystring API is considered Legacy. new code should use the URLSearchParams API instead. - dev: true - /queue-microtask/1.2.3: resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} dev: true @@ -4195,28 +1468,6 @@ packages: safe-buffer: 5.2.1 dev: true - /randomfill/1.0.4: - resolution: {integrity: sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==} - dependencies: - randombytes: 2.1.0 - safe-buffer: 5.2.1 - dev: true - - /range-parser/1.2.1: - resolution: {integrity: sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==} - engines: {node: '>= 0.6'} - dev: true - - /raw-body/2.5.1: - resolution: {integrity: sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==} - engines: {node: '>= 0.8'} - dependencies: - bytes: 3.1.2 - http-errors: 2.0.0 - iconv-lite: 0.4.24 - unpipe: 1.0.0 - dev: true - /rc/1.2.8: resolution: {integrity: sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==} hasBin: true @@ -4225,39 +1476,17 @@ packages: ini: 1.3.8 minimist: 1.2.7 strip-json-comments: 2.0.1 + dev: false /read-dir-deep/7.0.1: resolution: {integrity: sha512-w99fvgqJm3cJ5Vb7b3oGKRDnm/m11q7w5LQ9uBCXe+repIEf1rFtkXLlPAxNrSwlp4skyPyvKd4DNNiIuc0geg==} engines: {node: '>=8.9.0'} dependencies: - globby: 10.0.2 - is-path-cwd: 2.2.0 - is-path-in-cwd: 3.0.0 - path-sort2: 1.0.0 - slash: 3.0.0 - dev: true - - /read-only-stream/2.0.0: - resolution: {integrity: sha512-3ALe0bjBVZtkdWKIcThYpQCLbBMd/+Tbh2CDSrAIDO3UsZ4Xs+tnyjv2MjCOMMgBG+AsUOeuP1cgtY1INISc8w==} - dependencies: - readable-stream: 2.3.7 - dev: true - - /read-pkg-up/1.0.1: - resolution: {integrity: sha512-WD9MTlNtI55IwYUS27iHh9tK3YoIVhxis8yKhLpTqWtml739uXc9NWTpxoHkfZf3+DkCCsXox94/VWZniuZm6A==} - engines: {node: '>=0.10.0'} - dependencies: - find-up: 1.1.2 - read-pkg: 1.1.0 - dev: true - - /read-pkg/1.1.0: - resolution: {integrity: sha512-7BGwRHqt4s/uVbuyoeejRn4YmFnYZiFl4AuaeXHlgZf3sONF0SOGlxs2Pw8g6hCKupo08RafIO5YXFNOKTfwsQ==} - engines: {node: '>=0.10.0'} - dependencies: - load-json-file: 1.1.0 - normalize-package-data: 2.5.0 - path-type: 1.1.0 + globby: 10.0.2 + is-path-cwd: 2.2.0 + is-path-in-cwd: 3.0.0 + path-sort2: 1.0.0 + slash: 3.0.0 dev: true /readable-stream/1.0.34: @@ -4288,126 +1517,22 @@ packages: inherits: 2.0.4 string_decoder: 1.3.0 util-deprecate: 1.0.2 - - /readdirp/2.2.1: - resolution: {integrity: sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==} - engines: {node: '>=0.10'} - dependencies: - graceful-fs: 4.2.10 - micromatch: 3.1.10 - readable-stream: 2.3.7 - transitivePeerDependencies: - - supports-color - dev: true - - /readdirp/3.6.0: - resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==} - engines: {node: '>=8.10.0'} - dependencies: - picomatch: 2.3.1 - dev: true - - /rechoir/0.6.2: - resolution: {integrity: sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw==} - engines: {node: '>= 0.10'} - dependencies: - resolve: 1.22.1 - dev: true - - /regex-not/1.0.2: - resolution: {integrity: sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==} - engines: {node: '>=0.10.0'} - dependencies: - extend-shallow: 3.0.2 - safe-regex: 1.1.0 - dev: true - - /remove-bom-buffer/3.0.0: - resolution: {integrity: sha512-8v2rWhaakv18qcvNeli2mZ/TMTL2nEyAKRvzo1WtnZBl15SHyEhrCu2/xKlJyUFKHiHgfXIyuY6g2dObJJycXQ==} - engines: {node: '>=0.10.0'} - dependencies: - is-buffer: 1.1.6 - is-utf8: 0.2.1 - dev: true - - /remove-bom-stream/1.2.0: - resolution: {integrity: sha512-wigO8/O08XHb8YPzpDDT+QmRANfW6vLqxfaXm1YXhnFf3AkSLyjfG3GEFg4McZkmgL7KvCj5u2KczkvSP6NfHA==} - engines: {node: '>= 0.10'} - dependencies: - remove-bom-buffer: 3.0.0 - safe-buffer: 5.2.1 - through2: 2.0.5 - dev: true + dev: false /remove-trailing-separator/1.1.0: resolution: {integrity: sha512-/hS+Y0u3aOfIETiaiirUFwDBDzmXPvO+jAfKTitUngIPzdKc6Z0LoFjM/CK5PL4C+eKwHohlHAb6H0VFfmmUsw==} dev: true - /repeat-element/1.1.4: - resolution: {integrity: sha512-LFiNfRcSu7KK3evMyYOuCzv3L10TW7yC1G2/+StMjK8Y6Vqd2MG7r/Qjw4ghtuCOjFvlnms/iMmLqpvW/ES/WQ==} - engines: {node: '>=0.10.0'} - dev: true - - /repeat-string/1.6.1: - resolution: {integrity: sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w==} - engines: {node: '>=0.10'} - dev: true - /replace-ext/1.0.1: resolution: {integrity: sha512-yD5BHCe7quCgBph4rMQ+0KkIRKwWCrHDOX1p1Gp6HwjPM5kVoCdKGNhN7ydqqsX6lJEnQDKZ/tFMiEdQ1dvPEw==} engines: {node: '>= 0.10'} dev: true - /replace-homedir/1.0.0: - resolution: {integrity: sha512-CHPV/GAglbIB1tnQgaiysb8H2yCy8WQ7lcEwQ/eT+kLj0QHV8LnJW0zpqpE7RSkrMSRoa+EBoag86clf7WAgSg==} - engines: {node: '>= 0.10'} - dependencies: - homedir-polyfill: 1.0.3 - is-absolute: 1.0.0 - remove-trailing-separator: 1.1.0 - dev: true - - /replacestream/4.0.3: - resolution: {integrity: sha512-AC0FiLS352pBBiZhd4VXB1Ab/lh0lEgpP+GGvZqbQh8a5cmXVoTe5EX/YeTFArnp4SRGTHh1qCHu9lGs1qG8sA==} - dependencies: - escape-string-regexp: 1.0.5 - object-assign: 4.1.1 - readable-stream: 2.3.7 - dev: true - /require-directory/2.1.1: resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} engines: {node: '>=0.10.0'} dev: true - /require-main-filename/1.0.1: - resolution: {integrity: sha512-IqSUtOVP4ksd1C/ej5zeEh/BIP2ajqpn8c5x+q99gvcIG/Qf0cud5raVnE/Dwd0ua9TXYDoDc0RE5hBSdz22Ug==} - dev: true - - /requires-port/1.0.0: - resolution: {integrity: sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==} - dev: true - - /resolve-dir/1.0.1: - resolution: {integrity: sha512-R7uiTjECzvOsWSfdM0QKFNBVFcK27aHOUwdvK53BcW8zqnGdYp0Fbj82cy54+2A4P2tFM22J5kRfe1R+lM/1yg==} - engines: {node: '>=0.10.0'} - dependencies: - expand-tilde: 2.0.2 - global-modules: 1.0.0 - dev: true - - /resolve-options/1.1.0: - resolution: {integrity: sha512-NYDgziiroVeDC29xq7bp/CacZERYsA9bXYd1ZmcJlF3BcrZv5pTb4NG7SjdyKDnXZ84aC4vo2u6sNKIA1LCu/A==} - engines: {node: '>= 0.10'} - dependencies: - value-or-function: 3.0.0 - dev: true - - /resolve-url/0.2.1: - resolution: {integrity: sha512-ZuF55hVUQaaczgOIwqWzkEcEidmlD/xl44x1UZnhOXcYuFN2S6+rcxpG+C1N3So0wvNI3DmJICUFfu2SxhBmvg==} - deprecated: https://github.com/lydell/resolve-url#deprecated - dev: true - /resolve/1.22.1: resolution: {integrity: sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==} hasBin: true @@ -4417,21 +1542,6 @@ packages: supports-preserve-symlinks-flag: 1.0.0 dev: true - /resp-modifier/6.0.2: - resolution: {integrity: sha512-U1+0kWC/+4ncRFYqQWTx/3qkfE6a4B/h3XXgmXypfa0SPZ3t7cbbaFk297PjQS/yov24R18h6OZe6iZwj3NSLw==} - engines: {node: '>= 0.8.0'} - dependencies: - debug: 2.6.9 - minimatch: 3.1.2 - transitivePeerDependencies: - - supports-color - dev: true - - /ret/0.1.15: - resolution: {integrity: sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==} - engines: {node: '>=0.12'} - dev: true - /retry/0.12.0: resolution: {integrity: sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==} engines: {node: '>= 4'} @@ -4448,13 +1558,6 @@ packages: dependencies: glob: 7.2.3 - /ripemd160/2.0.2: - resolution: {integrity: sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==} - dependencies: - hash-base: 3.1.0 - inherits: 2.0.4 - dev: true - /rollup/3.12.0: resolution: {integrity: sha512-4MZ8kA2HNYahIjz63rzrMMRvDqQDeS9LoriJvMuV0V6zIGysP36e9t4yObUfwdT9h/szXoHQideICftcdZklWg==} engines: {node: '>=14.18.0', npm: '>=8.0.0'} @@ -4469,17 +1572,6 @@ packages: queue-microtask: 1.2.3 dev: true - /rx/4.1.0: - resolution: {integrity: sha512-CiaiuN6gapkdl+cZUr67W6I8jquN4lkak3vtIsIWCl4XIPP8ffsoyN6/+PuGXnQy8Cu8W2y9Xxh31Rq4M6wUug==} - dev: true - - /rxjs/5.5.12: - resolution: {integrity: sha512-xx2itnL5sBbqeeiVgNPVuQQ1nC8Jp2WfNJhXWHmElW9YmrpS9UVnNzhP3EH3HFqexO5Tlp8GhYY+WEcqcVMvGw==} - engines: {npm: '>=2.0.0'} - dependencies: - symbol-observable: 1.0.1 - dev: true - /safe-buffer/5.1.2: resolution: {integrity: sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==} dev: true @@ -4487,21 +1579,10 @@ packages: /safe-buffer/5.2.1: resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} - /safe-regex/1.1.0: - resolution: {integrity: sha512-aJXcif4xnaNUzvUuC5gcb46oTS7zvg4jpMTnuqtrEPlR3vFr4pxtdTwaF1Qs3Enjn9HK+ZlwQui+a7z0SywIzg==} - dependencies: - ret: 0.1.15 - dev: true - /safer-buffer/2.1.2: resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} - - /semver-greatest-satisfied-range/1.1.0: - resolution: {integrity: sha512-Ny/iyOzSSa8M5ML46IAx3iXc6tfOsYU2R4AXi2UpHk60Zrgyq6eqPj/xiOfS0rRl/iiQ/rdJkVjw/5cdUyCntQ==} - engines: {node: '>= 0.10'} - dependencies: - sver-compat: 1.5.0 - dev: true + dev: false + optional: true /semver/5.7.1: resolution: {integrity: sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==} @@ -4521,98 +1602,15 @@ packages: lru-cache: 6.0.0 dev: false - /send/0.16.2: - resolution: {integrity: sha512-E64YFPUssFHEFBvpbbjr44NCLtI1AohxQ8ZSiJjQLskAdKuriYEP6VyGEsRDH8ScozGpkaX1BGvhanqCwkcEZw==} - engines: {node: '>= 0.8.0'} - dependencies: - debug: 2.6.9 - depd: 1.1.2 - destroy: 1.0.4 - encodeurl: 1.0.2 - escape-html: 1.0.3 - etag: 1.8.1 - fresh: 0.5.2 - http-errors: 1.6.3 - mime: 1.4.1 - ms: 2.0.0 - on-finished: 2.3.0 - range-parser: 1.2.1 - statuses: 1.4.0 - transitivePeerDependencies: - - supports-color - dev: true - /serialize-javascript/6.0.1: resolution: {integrity: sha512-owoXEFjWRllis8/M1Q+Cw5k8ZH40e3zhp/ovX+Xr/vi1qj6QesbyXXViFbpNvWvPNAD62SutwEXavefrLJWj7w==} dependencies: randombytes: 2.1.0 dev: true - /serve-index/1.9.1: - resolution: {integrity: sha512-pXHfKNP4qujrtteMrSBb0rc8HJ9Ms/GrXwcUtUtD5s4ewDJI8bT3Cz2zTVRMKtri49pLx2e0Ya8ziP5Ya2pZZw==} - engines: {node: '>= 0.8.0'} - dependencies: - accepts: 1.3.8 - batch: 0.6.1 - debug: 2.6.9 - escape-html: 1.0.3 - http-errors: 1.6.3 - mime-types: 2.1.35 - parseurl: 1.3.3 - transitivePeerDependencies: - - supports-color - dev: true - - /serve-static/1.13.2: - resolution: {integrity: sha512-p/tdJrO4U387R9oMjb1oj7qSMaMfmOyd4j9hOFoxZe2baQszgHcSWjuya/CiT5kgZZKRudHNOA0pYXOl8rQ5nw==} - engines: {node: '>= 0.8.0'} - dependencies: - encodeurl: 1.0.2 - escape-html: 1.0.3 - parseurl: 1.3.3 - send: 0.16.2 - transitivePeerDependencies: - - supports-color - dev: true - - /server-destroy/1.0.1: - resolution: {integrity: sha512-rb+9B5YBIEzYcD6x2VKidaa+cqYBJQKnU4oe4E3ANwRRN56yk/ua1YCJT1n21NTS8w6CcOclAKNP3PhdCXKYtQ==} - dev: true - /set-blocking/2.0.0: resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} - - /set-value/2.0.1: - resolution: {integrity: sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==} - engines: {node: '>=0.10.0'} - dependencies: - extend-shallow: 2.0.1 - is-extendable: 0.1.1 - is-plain-object: 2.0.4 - split-string: 3.1.0 - dev: true - - /setprototypeof/1.1.0: - resolution: {integrity: sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==} - dev: true - - /setprototypeof/1.2.0: - resolution: {integrity: sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==} - dev: true - - /sha.js/2.4.11: - resolution: {integrity: sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==} - hasBin: true - dependencies: - inherits: 2.0.4 - safe-buffer: 5.2.1 - dev: true - - /shasum-object/1.0.0: - resolution: {integrity: sha512-Iqo5rp/3xVi6M4YheapzZhhGPVs0yZwHj7wvwQ1B9z8H6zk+FEnI7y3Teq7qwnekfEhu8WmG2z0z4iWZaxLWVg==} - dependencies: - fast-safe-stringify: 2.1.1 - dev: true + dev: false /shebang-command/2.0.0: resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} @@ -4626,18 +1624,6 @@ packages: engines: {node: '>=8'} dev: true - /shell-quote/1.7.4: - resolution: {integrity: sha512-8o/QEhSSRb1a5i7TFR0iM4G16Z0vYB2OQVs4G3aAFXjn3T6yEx8AZxy1PgDF7I00LZHYA3WxaSYIf5e5sAX8Rw==} - dev: true - - /side-channel/1.0.4: - resolution: {integrity: sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==} - dependencies: - call-bind: 1.0.2 - get-intrinsic: 1.2.0 - object-inspect: 1.12.3 - dev: true - /sigmund/1.0.1: resolution: {integrity: sha512-fCvEXfh6NWpm+YSuY2bpXb/VIihqWA6hLsgboC+0nl71Q7N7o2eaCW8mJa/NLvQhs6jpd3VZV4UiUQlV6+lc8g==} dev: true @@ -4647,6 +1633,7 @@ packages: /simple-concat/1.0.1: resolution: {integrity: sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==} + dev: false /simple-get/4.0.1: resolution: {integrity: sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==} @@ -4682,258 +1669,44 @@ packages: resolution: {integrity: sha512-V21+XeNni+tTyiST1MHsa84AQhT1aFZipzPpOFAVB8DkHzwJyjjAmt9bgwnuZiZWnIbMo2duE29wybxv/7HWUw==} dev: true - /snapdragon-node/2.1.1: - resolution: {integrity: sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==} - engines: {node: '>=0.10.0'} - dependencies: - define-property: 1.0.0 - isobject: 3.0.1 - snapdragon-util: 3.0.1 - dev: true - - /snapdragon-util/3.0.1: - resolution: {integrity: sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==} - engines: {node: '>=0.10.0'} - dependencies: - kind-of: 3.2.2 - dev: true - - /snapdragon/0.8.2: - resolution: {integrity: sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==} - engines: {node: '>=0.10.0'} - dependencies: - base: 0.11.2 - debug: 2.6.9 - define-property: 0.2.5 - extend-shallow: 2.0.1 - map-cache: 0.2.2 - source-map: 0.5.7 - source-map-resolve: 0.5.3 - use: 3.1.1 - transitivePeerDependencies: - - supports-color - dev: true - - /socket.io-adapter/2.4.0: - resolution: {integrity: sha512-W4N+o69rkMEGVuk2D/cvca3uYsvGlMwsySWV447y99gUPghxq42BxqLNMndb+a1mm/5/7NeXVQS7RLa2XyXvYg==} - dev: true - - /socket.io-client/4.5.4: - resolution: {integrity: sha512-ZpKteoA06RzkD32IbqILZ+Cnst4xewU7ZYK12aS1mzHftFFjpoMz69IuhP/nL25pJfao/amoPI527KnuhFm01g==} - engines: {node: '>=10.0.0'} - dependencies: - '@socket.io/component-emitter': 3.1.0 - debug: 4.3.4 - engine.io-client: 6.2.3 - socket.io-parser: 4.2.2 - transitivePeerDependencies: - - bufferutil - - supports-color - - utf-8-validate - dev: true - - /socket.io-parser/4.2.2: - resolution: {integrity: sha512-DJtziuKypFkMMHCm2uIshOYC7QaylbtzQwiMYDuCKy3OPkjLzu4B2vAhTlqipRHHzrI0NJeBAizTK7X+6m1jVw==} - engines: {node: '>=10.0.0'} - dependencies: - '@socket.io/component-emitter': 3.1.0 - debug: 4.3.4 - transitivePeerDependencies: - - supports-color - dev: true - - /socket.io/4.5.4: - resolution: {integrity: sha512-m3GC94iK9MfIEeIBfbhJs5BqFibMtkRk8ZpKwG2QwxV0m/eEhPIV4ara6XCF1LWNAus7z58RodiZlAH71U3EhQ==} - engines: {node: '>=10.0.0'} - dependencies: - accepts: 1.3.8 - base64id: 2.0.0 - debug: 4.3.4 - engine.io: 6.2.1 - socket.io-adapter: 2.4.0 - socket.io-parser: 4.2.2 - transitivePeerDependencies: - - bufferutil - - supports-color - - utf-8-validate - dev: true - /socks-proxy-agent/7.0.0: resolution: {integrity: sha512-Fgl0YPZ902wEsAyiQ+idGd1A7rSFx/ayC1CQVMw5P+EQx2V0SgpGtf6OKFhVjPflPUl9YMmEOnmfjCdMUsygww==} engines: {node: '>= 10'} dependencies: agent-base: 6.0.2 - debug: 4.3.4 - socks: 2.7.1 - transitivePeerDependencies: - - supports-color - dev: false - - /socks/2.7.1: - resolution: {integrity: sha512-7maUZy1N7uo6+WVEX6psASxtNlKaNVMlGQKkG/63nEDdLOWNbiUMoLK7X4uYoLhQstau72mLgfEWcXcwsaHbYQ==} - engines: {node: '>= 10.13.0', npm: '>= 3.0.0'} - dependencies: - ip: 2.0.0 - smart-buffer: 4.2.0 - dev: false - - /source-map-resolve/0.5.3: - resolution: {integrity: sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==} - deprecated: See https://github.com/lydell/source-map-resolve#deprecated - dependencies: - atob: 2.1.2 - decode-uri-component: 0.2.2 - resolve-url: 0.2.1 - source-map-url: 0.4.1 - urix: 0.1.0 - dev: true - - /source-map-support/0.5.21: - resolution: {integrity: sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==} - dependencies: - buffer-from: 1.1.2 - source-map: 0.6.1 - dev: true - - /source-map-url/0.4.1: - resolution: {integrity: sha512-cPiFOTLUKvJFIg4SKVScy4ilPPW6rFgMgfuZJPNoDuMs3nC1HbMUycBoJw77xFIp6z1UJQJOfx6C9GMH80DiTw==} - deprecated: See https://github.com/lydell/source-map-url#deprecated - dev: true - - /source-map/0.5.7: - resolution: {integrity: sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==} - engines: {node: '>=0.10.0'} - dev: true - - /source-map/0.6.1: - resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==} - engines: {node: '>=0.10.0'} - dev: true - - /sparkles/1.0.1: - resolution: {integrity: sha512-dSO0DDYUahUt/0/pD/Is3VIm5TGJjludZ0HVymmhYF6eNA53PVLhnUk0znSYbH8IYBuJdCE+1luR22jNLMaQdw==} - engines: {node: '>= 0.10'} - dev: true - - /spdx-correct/3.1.1: - resolution: {integrity: sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==} - dependencies: - spdx-expression-parse: 3.0.1 - spdx-license-ids: 3.0.12 - dev: true - - /spdx-exceptions/2.3.0: - resolution: {integrity: sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==} - dev: true - - /spdx-expression-parse/3.0.1: - resolution: {integrity: sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==} - dependencies: - spdx-exceptions: 2.3.0 - spdx-license-ids: 3.0.12 - dev: true - - /spdx-license-ids/3.0.12: - resolution: {integrity: sha512-rr+VVSXtRhO4OHbXUiAF7xW3Bo9DuuF6C5jH+q/x15j2jniycgKbxU09Hr0WqlSLUs4i4ltHGXqTe7VHclYWyA==} - dev: true - - /split-string/3.1.0: - resolution: {integrity: sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==} - engines: {node: '>=0.10.0'} - dependencies: - extend-shallow: 3.0.2 - dev: true - - /ssri/9.0.1: - resolution: {integrity: sha512-o57Wcn66jMQvfHG1FlYbWeZWW/dHZhJXjpIcTfXldXEk5nz5lStPo3mK0OJQfGR3RbZUlbISexbljkJzuEj/8Q==} - engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} - dependencies: - minipass: 3.3.6 - dev: false - - /stack-trace/0.0.10: - resolution: {integrity: sha512-KGzahc7puUKkzyMt+IqAep+TVNbKP+k2Lmwhub39m1AsTSkaDutx56aDCo+HLDzf/D26BIHTJWNiTG1KAJiQCg==} - dev: true - - /static-extend/0.1.2: - resolution: {integrity: sha512-72E9+uLc27Mt718pMHt9VMNiAL4LMsmDbBva8mxWUCkT07fSzEGMYUCk0XWY6lp0j6RBAG4cJ3mWuZv2OE3s0g==} - engines: {node: '>=0.10.0'} - dependencies: - define-property: 0.2.5 - object-copy: 0.1.0 - dev: true - - /statuses/1.3.1: - resolution: {integrity: sha512-wuTCPGlJONk/a1kqZ4fQM2+908lC7fa7nPYpTC1EhnvqLX/IICbeP1OZGDtA374trpSq68YubKUMo8oRhN46yg==} - engines: {node: '>= 0.6'} - dev: true - - /statuses/1.4.0: - resolution: {integrity: sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew==} - engines: {node: '>= 0.6'} - dev: true - - /statuses/2.0.1: - resolution: {integrity: sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==} - engines: {node: '>= 0.8'} - dev: true - - /stream-browserify/3.0.0: - resolution: {integrity: sha512-H73RAHsVBapbim0tU2JwwOiXUj+fikfiaoYAKHF3VJfA0pe2BCzkhAHBlLG6REzE+2WNZcxOXjK7lkso+9euLA==} - dependencies: - inherits: 2.0.4 - readable-stream: 3.6.0 - dev: true - - /stream-combiner2/1.1.1: - resolution: {integrity: sha512-3PnJbYgS56AeWgtKF5jtJRT6uFJe56Z0Hc5Ngg/6sI6rIt8iiMBTa9cvdyFfpMQjaVHr8dusbNeFGIIonxOvKw==} - dependencies: - duplexer2: 0.1.4 - readable-stream: 2.3.7 - dev: true - - /stream-exhaust/1.0.2: - resolution: {integrity: sha512-b/qaq/GlBK5xaq1yrK9/zFcyRSTNxmcZwFLGSTG0mXgZl/4Z6GgiyYOXOvY7N3eEvFRAG1bkDRz5EPGSvPYQlw==} - dev: true - - /stream-http/3.2.0: - resolution: {integrity: sha512-Oq1bLqisTyK3TSCXpPbT4sdeYNdmyZJv1LxpEm2vu1ZhK89kSE5YXwZc3cWk0MagGaKriBh9mCFbVGtO+vY29A==} - dependencies: - builtin-status-codes: 3.0.0 - inherits: 2.0.4 - readable-stream: 3.6.0 - xtend: 4.0.2 - dev: true - - /stream-shift/1.0.1: - resolution: {integrity: sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==} - dev: true + debug: 4.3.4 + socks: 2.7.1 + transitivePeerDependencies: + - supports-color + dev: false - /stream-splicer/2.0.1: - resolution: {integrity: sha512-Xizh4/NPuYSyAXyT7g8IvdJ9HJpxIGL9PjyhtywCZvvP0OPIdqyrr4dMikeuvY8xahpdKEBlBTySe583totajg==} + /socks/2.7.1: + resolution: {integrity: sha512-7maUZy1N7uo6+WVEX6psASxtNlKaNVMlGQKkG/63nEDdLOWNbiUMoLK7X4uYoLhQstau72mLgfEWcXcwsaHbYQ==} + engines: {node: '>= 10.13.0', npm: '>= 3.0.0'} dependencies: - inherits: 2.0.4 - readable-stream: 2.3.7 - dev: true + ip: 2.0.0 + smart-buffer: 4.2.0 + dev: false - /stream-throttle/0.1.3: - resolution: {integrity: sha512-889+B9vN9dq7/vLbGyuHeZ6/ctf5sNuGWsDy89uNxkFTAgzy0eK7+w5fL3KLNRTkLle7EgZGvHUphZW0Q26MnQ==} - engines: {node: '>= 0.10.0'} - hasBin: true + /source-map-support/0.5.21: + resolution: {integrity: sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==} dependencies: - commander: 2.20.3 - limiter: 1.1.5 + buffer-from: 1.1.2 + source-map: 0.6.1 dev: true - /string-width/1.0.2: - resolution: {integrity: sha512-0XsVpQLnVCXHJfyEs8tC0zpTVIr5PKKsQtkT29IwupnPTjtPmQ3xT/4yCREF9hYkV/3M3kzcUTSAZT6a6h81tw==} + /source-map/0.6.1: + resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==} engines: {node: '>=0.10.0'} - dependencies: - code-point-at: 1.1.0 - is-fullwidth-code-point: 1.0.0 - strip-ansi: 3.0.1 dev: true + /ssri/9.0.1: + resolution: {integrity: sha512-o57Wcn66jMQvfHG1FlYbWeZWW/dHZhJXjpIcTfXldXEk5nz5lStPo3mK0OJQfGR3RbZUlbISexbljkJzuEj/8Q==} + engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} + dependencies: + minipass: 3.3.6 + dev: false + /string-width/4.2.3: resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} engines: {node: '>=8'} @@ -4956,13 +1729,7 @@ packages: resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} dependencies: safe-buffer: 5.2.1 - - /strip-ansi/3.0.1: - resolution: {integrity: sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==} - engines: {node: '>=0.10.0'} - dependencies: - ansi-regex: 2.1.1 - dev: true + dev: false /strip-ansi/6.0.1: resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} @@ -4970,27 +1737,10 @@ packages: dependencies: ansi-regex: 5.0.1 - /strip-bom/2.0.0: - resolution: {integrity: sha512-kwrX1y7czp1E69n2ajbG65mIo9dqvJ+8aBQXOGVxqwvNbsXdFM6Lq37dLAY3mknUwru8CfcCbfOLL/gMo+fi3g==} - engines: {node: '>=0.10.0'} - dependencies: - is-utf8: 0.2.1 - dev: true - /strip-json-comments/2.0.1: resolution: {integrity: sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==} engines: {node: '>=0.10.0'} - - /subarg/1.0.0: - resolution: {integrity: sha512-RIrIdRY0X1xojthNcVtgT9sjpOGagEUKpZdgBUi054OEPFo282yg+zE+t1Rj3+RqKq2xStL7uUHhY+AjbC4BXg==} - dependencies: - minimist: 1.2.7 - dev: true - - /supports-color/2.0.0: - resolution: {integrity: sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g==} - engines: {node: '>=0.8.0'} - dev: true + dev: false /supports-color/5.5.0: resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==} @@ -5011,24 +1761,6 @@ packages: engines: {node: '>= 0.4'} dev: true - /sver-compat/1.5.0: - resolution: {integrity: sha512-aFTHfmjwizMNlNE6dsGmoAM4lHjL0CyiobWaFiXWSlD7cIxshW422Nb8KbXCmR6z+0ZEPY+daXJrDyh/vuwTyg==} - dependencies: - es6-iterator: 2.0.3 - es6-symbol: 3.1.3 - dev: true - - /symbol-observable/1.0.1: - resolution: {integrity: sha512-Kb3PrPYz4HanVF1LVGuAdW6LoVgIwjUYJGzFe7NDrBLCN4lsV/5J0MFurV+ygS4bRVwrCEt2c7MQ1R2a72oJDw==} - engines: {node: '>=0.10.0'} - dev: true - - /syntax-error/1.4.0: - resolution: {integrity: sha512-YPPlu67mdnHGTup2A8ff7BC2Pjq0e0Yp/IyTFN03zWO0RcK07uLcbi7C2KpGR2FvWbaB0+bfE27a+sBKebSo7w==} - dependencies: - acorn-node: 1.8.2 - dev: true - /tar-fs/2.1.1: resolution: {integrity: sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==} dependencies: @@ -5081,29 +1813,6 @@ packages: minimatch: 3.1.2 dev: true - /textextensions/3.3.0: - resolution: {integrity: sha512-mk82dS8eRABNbeVJrEiN5/UMSCliINAuz8mkUwH4SwslkNP//gbEzlWNS5au0z5Dpx40SQxzqZevZkn+WYJ9Dw==} - engines: {node: '>=8'} - dev: true - - /tfunk/4.0.0: - resolution: {integrity: sha512-eJQ0dGfDIzWNiFNYFVjJ+Ezl/GmwHaFTBTjrtqNPW0S7cuVDBrZrmzUz6VkMeCR4DZFqhd4YtLwsw3i2wYHswQ==} - dependencies: - chalk: 1.1.3 - dlv: 1.1.3 - dev: true - - /through/2.3.8: - resolution: {integrity: sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==} - dev: true - - /through2-filter/3.0.0: - resolution: {integrity: sha512-jaRjI2WxN3W1V8/FMZ9HKIBXixtiqs3SQSX4/YGIiP3gL6djW48VoZq9tDqeCWs3MT8YY5wb/zli8VW8snY1CA==} - dependencies: - through2: 2.0.5 - xtend: 4.0.2 - dev: true - /through2/0.6.5: resolution: {integrity: sha512-RkK/CCESdTKQZHdmKICijdKKsCRVHs5KsLZ6pACAmF/1GPUQhonHSXWNERctxEp7RmvjdNbZTL5z9V7nSCXKcg==} dependencies: @@ -5118,18 +1827,6 @@ packages: xtend: 4.0.2 dev: true - /time-stamp/1.1.0: - resolution: {integrity: sha512-gLCeArryy2yNTRzTGKbZbloctj64jkZ57hj5zdraXue6aFgd6PmvVtEyiUU+hvU0v7q08oVv8r8ev0tRo6bvgw==} - engines: {node: '>=0.10.0'} - dev: true - - /timers-browserify/1.4.2: - resolution: {integrity: sha512-PIxwAupJZiYU4JmVZYwXp9FKsHMXb5h0ZEFyuXTAn8WLHOlcij+FEcbrvDsom1o5dr1YggEtFbECvGCW2sT53Q==} - engines: {node: '>=0.6.0'} - dependencies: - process: 0.11.10 - dev: true - /tiny-glob/0.2.9: resolution: {integrity: sha512-g/55ssRPUjShh+xkfx9UPDXqhckHEsHr4Vd9zX55oSdGZc/MD0m3sferOkwWtp98bv+kcVfEHtRJgBVJzelrzg==} dependencies: @@ -5137,29 +1834,6 @@ packages: globrex: 0.1.2 dev: true - /to-absolute-glob/2.0.2: - resolution: {integrity: sha512-rtwLUQEwT8ZeKQbyFJyomBRYXyE16U5VKuy0ftxLMK/PZb2fkOsg5r9kHdauuVDbsNdIBoC/HCthpidamQFXYA==} - engines: {node: '>=0.10.0'} - dependencies: - is-absolute: 1.0.0 - is-negated-glob: 1.0.0 - dev: true - - /to-object-path/0.3.0: - resolution: {integrity: sha512-9mWHdnGRuh3onocaHzukyvCZhzvr6tiflAy/JRFXcJX0TjgfWA9pk9t8CMbzmBE4Jfw58pXbkngtBtqYxzNEyg==} - engines: {node: '>=0.10.0'} - dependencies: - kind-of: 3.2.2 - dev: true - - /to-regex-range/2.1.1: - resolution: {integrity: sha512-ZZWNfCjUokXXDGXFpZehJIkZqq91BcULFq/Pi7M5i4JnxXdhMKAK682z8bCW3o8Hj1wuuzoKcW3DfVzaP6VuNg==} - engines: {node: '>=0.10.0'} - dependencies: - is-number: 3.0.0 - repeat-string: 1.6.1 - dev: true - /to-regex-range/5.0.1: resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} engines: {node: '>=8.0'} @@ -5167,32 +1841,6 @@ packages: is-number: 7.0.0 dev: true - /to-regex/3.0.2: - resolution: {integrity: sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==} - engines: {node: '>=0.10.0'} - dependencies: - define-property: 2.0.2 - extend-shallow: 3.0.2 - regex-not: 1.0.2 - safe-regex: 1.1.0 - dev: true - - /to-through/2.0.0: - resolution: {integrity: sha512-+QIz37Ly7acM4EMdw2PRN389OneM5+d844tirkGp4dPKzI5OE72V9OsbFp+CIYJDahZ41ZV05hNtcPAQUAm9/Q==} - engines: {node: '>= 0.10'} - dependencies: - through2: 2.0.5 - dev: true - - /toidentifier/1.0.1: - resolution: {integrity: sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==} - engines: {node: '>=0.6'} - dev: true - - /tty-browserify/0.0.1: - resolution: {integrity: sha512-C3TaO7K81YvjCgQH9Q1S3R3P3BtN3RIM8n+OvX4il1K1zgE8ZhI0op7kClgkxtutIE8hQrcrHBXvIheqKUUCxw==} - dev: true - /tunnel-agent/0.6.0: resolution: {integrity: sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==} dependencies: @@ -5204,80 +1852,6 @@ packages: engines: {node: '>=4'} dev: true - /type/1.2.0: - resolution: {integrity: sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==} - dev: true - - /type/2.7.2: - resolution: {integrity: sha512-dzlvlNlt6AXU7EBSfpAscydQ7gXB+pPGsPnfJnZpiNJBDj7IaJzQlBZYGdEi4R9HmPdBv2XmWJ6YUtoTa7lmCw==} - dev: true - - /typedarray/0.0.6: - resolution: {integrity: sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==} - dev: true - - /typescript/4.9.4: - resolution: {integrity: sha512-Uz+dTXYzxXXbsFpM86Wh3dKCxrQqUcVMxwU54orwlJjOpO3ao8L7j5lH+dWfTwgCwIuM9GQ2kvVotzYJMXTBZg==} - engines: {node: '>=4.2.0'} - hasBin: true - dev: true - - /ua-parser-js/1.0.2: - resolution: {integrity: sha512-00y/AXhx0/SsnI51fTc0rLRmafiGOM4/O+ny10Ps7f+j/b8p/ZY11ytMgznXkOVo4GQ+KwQG5UQLkLGirsACRg==} - dev: true - - /umd/3.0.3: - resolution: {integrity: sha512-4IcGSufhFshvLNcMCV80UnQVlZ5pMOC8mvNPForqwA4+lzYQuetTESLDQkeLmihq8bRcnpbQa48Wb8Lh16/xow==} - hasBin: true - dev: true - - /unc-path-regex/0.1.2: - resolution: {integrity: sha512-eXL4nmJT7oCpkZsHZUOJo8hcX3GbsiDOa0Qu9F646fi8dT3XuSVopVqAcEiVzSKKH7UoDti23wNX3qGFxcW5Qg==} - engines: {node: '>=0.10.0'} - dev: true - - /undeclared-identifiers/1.1.3: - resolution: {integrity: sha512-pJOW4nxjlmfwKApE4zvxLScM/njmwj/DiUBv7EabwE4O8kRUy+HIwxQtZLBPll/jx1LJyBcqNfB3/cpv9EZwOw==} - hasBin: true - dependencies: - acorn-node: 1.8.2 - dash-ast: 1.0.0 - get-assigned-identifiers: 1.2.0 - simple-concat: 1.0.1 - xtend: 4.0.2 - dev: true - - /undertaker-registry/1.0.1: - resolution: {integrity: sha512-UR1khWeAjugW3548EfQmL9Z7pGMlBgXteQpr1IZeZBtnkCJQJIJ1Scj0mb9wQaPvUZ9Q17XqW6TIaPchJkyfqw==} - engines: {node: '>= 0.10'} - dev: true - - /undertaker/1.3.0: - resolution: {integrity: sha512-/RXwi5m/Mu3H6IHQGww3GNt1PNXlbeCuclF2QYR14L/2CHPz3DFZkvB5hZ0N/QUkiXWCACML2jXViIQEQc2MLg==} - engines: {node: '>= 0.10'} - dependencies: - arr-flatten: 1.1.0 - arr-map: 2.0.2 - bach: 1.2.0 - collection-map: 1.0.0 - es6-weak-map: 2.0.3 - fast-levenshtein: 1.1.4 - last-run: 1.1.1 - object.defaults: 1.1.0 - object.reduce: 1.0.1 - undertaker-registry: 1.0.1 - dev: true - - /union-value/1.0.1: - resolution: {integrity: sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==} - engines: {node: '>=0.10.0'} - dependencies: - arr-union: 3.1.0 - get-value: 2.0.6 - is-extendable: 0.1.1 - set-value: 2.0.1 - dev: true - /unique-filename/2.0.1: resolution: {integrity: sha512-ODWHtkkdx3IAR+veKxFV+VBkUMcN+FaqzUUd7IZzt+0zhDZFPFxhlqwPF3YQvMHx1TD0tdgYl+kuPnJ8E6ql7A==} engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} @@ -5292,77 +1866,9 @@ packages: imurmurhash: 0.1.4 dev: false - /unique-stream/2.3.1: - resolution: {integrity: sha512-2nY4TnBE70yoxHkDli7DMazpWiP7xMdCYqU2nBRO0UB+ZpEkGsSija7MvmvnZFUeC+mrgiUfcHSr3LmRFIg4+A==} - dependencies: - json-stable-stringify-without-jsonify: 1.0.1 - through2-filter: 3.0.0 - dev: true - - /universalify/0.1.2: - resolution: {integrity: sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==} - engines: {node: '>= 4.0.0'} - dev: true - - /unpipe/1.0.0: - resolution: {integrity: sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==} - engines: {node: '>= 0.8'} - dev: true - - /unset-value/1.0.0: - resolution: {integrity: sha512-PcA2tsuGSF9cnySLHTLSh2qrQiJ70mn+r+Glzxv2TWZblxsxCC52BDlZoPCsz7STd9pN7EZetkWZBAvk4cgZdQ==} - engines: {node: '>=0.10.0'} - dependencies: - has-value: 0.3.1 - isobject: 3.0.1 - dev: true - - /upath/1.2.0: - resolution: {integrity: sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg==} - engines: {node: '>=4'} - dev: true - - /urix/0.1.0: - resolution: {integrity: sha512-Am1ousAhSLBeB9cG/7k7r2R0zj50uDRlZHPGbazid5s9rlF1F/QKYObEKSIunSjIOkJZqwRRLpvewjEkM7pSqg==} - deprecated: Please see https://github.com/lydell/urix#deprecated - dev: true - - /url/0.11.0: - resolution: {integrity: sha512-kbailJa29QrtXnxgq+DdCEGlbTeYM2eJUxsz6vjZavrCYPMIFHMKQmSKYAIuUK2i7hgPm28a8piX5NTUtM/LKQ==} - dependencies: - punycode: 1.3.2 - querystring: 0.2.0 - dev: true - - /use/3.1.1: - resolution: {integrity: sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==} - engines: {node: '>=0.10.0'} - dev: true - /util-deprecate/1.0.2: resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} - /util/0.10.3: - resolution: {integrity: sha512-5KiHfsmkqacuKjkRkdV7SsfDJ2EGiPsK92s2MhNSY0craxjTdKTtqKsJaCWp4LW33ZZ0OPUv1WO/TFvNQRiQxQ==} - dependencies: - inherits: 2.0.1 - dev: true - - /util/0.12.5: - resolution: {integrity: sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA==} - dependencies: - inherits: 2.0.4 - is-arguments: 1.1.1 - is-generator-function: 1.0.10 - is-typed-array: 1.1.10 - which-typed-array: 1.1.9 - dev: true - - /utils-merge/1.0.1: - resolution: {integrity: sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==} - engines: {node: '>= 0.4.0'} - dev: true - /v8-to-istanbul/9.0.1: resolution: {integrity: sha512-74Y4LqY74kLE6IFyIjPtkSTWzUZmj8tdHT9Ii/26dvQ6K9Dl2NbEfj0XgU2sHCtKgt5VupqhlO/5aWuqS+IY1w==} engines: {node: '>=10.12.0'} @@ -5372,30 +1878,6 @@ packages: convert-source-map: 1.9.0 dev: true - /v8flags/3.2.0: - resolution: {integrity: sha512-mH8etigqMfiGWdeXpaaqGfs6BndypxusHHcv2qSHyZkGEznCd/qAXCWWRzeowtL54147cktFOC4P5y+kl8d8Jg==} - engines: {node: '>= 0.10'} - dependencies: - homedir-polyfill: 1.0.3 - dev: true - - /validate-npm-package-license/3.0.4: - resolution: {integrity: sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==} - dependencies: - spdx-correct: 3.1.1 - spdx-expression-parse: 3.0.1 - dev: true - - /value-or-function/3.0.0: - resolution: {integrity: sha512-jdBB2FrWvQC/pnPtIqcLsMaQgjhdb6B7tk1MMyTKapox+tQZbdRP4uLxu/JY0t7fbfDCUMnuelzEYv5GsxHhdg==} - engines: {node: '>= 0.10'} - dev: true - - /vary/1.1.2: - resolution: {integrity: sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==} - engines: {node: '>= 0.8'} - dev: true - /vinyl-buffer/1.0.1: resolution: {integrity: sha512-LRBE2/g3C1hSHL2k/FynSZcVTRhEw8sb08oKGt/0hukZXwrh2m8nfy+r5yLhGEk7eFFuclhyIuPct/Bxlxk6rg==} dependencies: @@ -5403,29 +1885,6 @@ packages: through2: 2.0.5 dev: true - /vinyl-fs/3.0.3: - resolution: {integrity: sha512-vIu34EkyNyJxmP0jscNzWBSygh7VWhqun6RmqVfXePrOwi9lhvRs//dOaGOTRUQr4tx7/zd26Tk5WeSVZitgng==} - engines: {node: '>= 0.10'} - dependencies: - fs-mkdirp-stream: 1.0.0 - glob-stream: 6.1.0 - graceful-fs: 4.2.10 - is-valid-glob: 1.0.0 - lazystream: 1.0.1 - lead: 1.0.0 - object.assign: 4.1.4 - pumpify: 1.5.1 - readable-stream: 2.3.7 - remove-bom-buffer: 3.0.0 - remove-bom-stream: 1.2.0 - resolve-options: 1.1.0 - through2: 2.0.5 - to-through: 2.0.0 - value-or-function: 3.0.0 - vinyl: 2.2.1 - vinyl-sourcemap: 1.1.0 - dev: true - /vinyl-source-stream/2.0.0: resolution: {integrity: sha512-Y5f1wRGajOfYukhv8biIGA7iZiY8UOIc3zJ6zcUNIbRG1BVuXzBsfSfe7MUJTttVkuy64k/pGQtJdd/aIt+hbw==} dependencies: @@ -5433,25 +1892,6 @@ packages: vinyl: 2.2.1 dev: true - /vinyl-sourcemap/1.1.0: - resolution: {integrity: sha512-NiibMgt6VJGJmyw7vtzhctDcfKch4e4n9TBeoWlirb7FMg9/1Ov9k+A5ZRAtywBpRPiyECvQRQllYM8dECegVA==} - engines: {node: '>= 0.10'} - dependencies: - append-buffer: 1.0.2 - convert-source-map: 1.9.0 - graceful-fs: 4.2.10 - normalize-path: 2.1.1 - now-and-later: 2.0.1 - remove-bom-buffer: 3.0.0 - vinyl: 2.2.1 - dev: true - - /vinyl-sourcemaps-apply/0.2.1: - resolution: {integrity: sha512-+oDh3KYZBoZC8hfocrbrxbLUeaYtQK7J5WU5Br9VqWqmCll3tFJqKp97GC9GmMsVIL0qnx2DgEDVxdo5EZ5sSw==} - dependencies: - source-map: 0.5.7 - dev: true - /vinyl/2.2.1: resolution: {integrity: sha512-LII3bXRFBZLlezoG5FfZVcXflZgWP/4dCwKtxd5ky9+LOtM4CS3bIRQsmR1KMnMW07jpE8fqR2lcxPZ+8sJIcw==} engines: {node: '>= 0.10'} @@ -5464,38 +1904,6 @@ packages: replace-ext: 1.0.1 dev: true - /vm-browserify/1.1.2: - resolution: {integrity: sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==} - dev: true - - /webgpu/0.1.16: - resolution: {integrity: sha512-KAXn/f8lnL8o4B718zzdfi1l0nEWQpuoWlC1L5WM/svAbeHjShCEI0l5ZcZBEEUm9FF3ZTgRjWk8iwbJfnGKTA==} - engines: {node: '>= 13.0.0'} - dev: false - - /which-module/1.0.0: - resolution: {integrity: sha512-F6+WgncZi/mJDrammbTuHe1q0R5hOXv/mBaiNA2TCNT/LTHusX0V+CJnj9XT8ki5ln2UZyyddDgHfCzyrOH7MQ==} - dev: true - - /which-typed-array/1.1.9: - resolution: {integrity: sha512-w9c4xkx6mPidwp7180ckYWfMmvxpjlZuIudNtDf4N/tTAUB8VJbX25qZoAsrtGuYNnGw3pa0AXgbGKRB8/EceA==} - engines: {node: '>= 0.4'} - dependencies: - available-typed-arrays: 1.0.5 - call-bind: 1.0.2 - for-each: 0.3.3 - gopd: 1.0.1 - has-tostringtag: 1.0.0 - is-typed-array: 1.1.10 - dev: true - - /which/1.3.1: - resolution: {integrity: sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==} - hasBin: true - dependencies: - isexe: 2.0.0 - dev: true - /which/2.0.2: resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} engines: {node: '>= 8'} @@ -5509,14 +1917,6 @@ packages: string-width: 4.2.3 dev: false - /wrap-ansi/2.1.0: - resolution: {integrity: sha512-vAaEaDM946gbNpH5pLVNR+vX2ht6n0Bt3GXwVB1AuAqZosOvHNF3P7wDnh8KLkSqgUh0uh77le7Owgoz+Z9XBw==} - engines: {node: '>=0.10.0'} - dependencies: - string-width: 1.0.2 - strip-ansi: 3.0.1 - dev: true - /wrap-ansi/7.0.0: resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} engines: {node: '>=10'} @@ -5529,32 +1929,10 @@ packages: /wrappy/1.0.2: resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} - /ws/8.2.3: - resolution: {integrity: sha512-wBuoj1BDpC6ZQ1B7DWQBYVLphPWkm8i9Y0/3YdHjHKHiohOJ1ws+3OccDWtH+PoC9DZD5WOTrJvNbWvjS6JWaA==} - engines: {node: '>=10.0.0'} - peerDependencies: - bufferutil: ^4.0.1 - utf-8-validate: ^5.0.2 - peerDependenciesMeta: - bufferutil: - optional: true - utf-8-validate: - optional: true - dev: true - - /xmlhttprequest-ssl/2.0.0: - resolution: {integrity: sha512-QKxVRxiRACQcVuQEYFsI1hhkrMlrXHPegbbd1yn9UHOmRxY+si12nQYzri3vbzt8VdTTRviqcKxcyllFas5z2A==} - engines: {node: '>=0.4.0'} - dev: true - /xtend/4.0.2: resolution: {integrity: sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==} engines: {node: '>=0.4'} - /y18n/3.2.2: - resolution: {integrity: sha512-uGZHXkHnhF0XeeAPgnKfPv1bgKAYyVvmNL1xlKsPYZPaIHxGti2hHqvOCQv71XMsLxu1QjergkqogUnms5D3YQ==} - dev: true - /y18n/5.0.8: resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} engines: {node: '>=10'} @@ -5573,18 +1951,6 @@ packages: engines: {node: '>=10'} dev: true - /yargs-parser/21.1.1: - resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} - engines: {node: '>=12'} - dev: true - - /yargs-parser/5.0.1: - resolution: {integrity: sha512-wpav5XYiddjXxirPoCTUPbqM0PXvJ9hiBMvuJgInvo4/lAOTZzUprArw17q2O1P2+GHhbBr18/iQwjL5Z9BqfA==} - dependencies: - camelcase: 3.0.0 - object.assign: 4.1.4 - dev: true - /yargs/16.2.0: resolution: {integrity: sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==} engines: {node: '>=10'} @@ -5598,50 +1964,6 @@ packages: yargs-parser: 20.2.9 dev: true - /yargs/17.1.1: - resolution: {integrity: sha512-c2k48R0PwKIqKhPMWjeiF6y2xY/gPMUlro0sgxqXpbOIohWiLNXWslsootttv7E1e73QPAMQSg5FeySbVcpsPQ==} - engines: {node: '>=12'} - dependencies: - cliui: 7.0.4 - escalade: 3.1.1 - get-caller-file: 2.0.5 - require-directory: 2.1.1 - string-width: 4.2.3 - y18n: 5.0.8 - yargs-parser: 20.2.9 - dev: true - - /yargs/17.6.2: - resolution: {integrity: sha512-1/9UrdHjDZc0eOU0HxOHoS78C69UD3JRMvzlJ7S79S2nTaWRA/whGCTV8o9e/N/1Va9YIV7Q4sOxD8VV4pCWOw==} - engines: {node: '>=12'} - dependencies: - cliui: 8.0.1 - escalade: 3.1.1 - get-caller-file: 2.0.5 - require-directory: 2.1.1 - string-width: 4.2.3 - y18n: 5.0.8 - yargs-parser: 21.1.1 - dev: true - - /yargs/7.1.2: - resolution: {integrity: sha512-ZEjj/dQYQy0Zx0lgLMLR8QuaqTihnxirir7EwUHp1Axq4e3+k8jXU5K0VLbNvedv1f4EWtBonDIZm0NUr+jCcA==} - dependencies: - camelcase: 3.0.0 - cliui: 3.2.0 - decamelize: 1.2.0 - get-caller-file: 1.0.3 - os-locale: 1.4.0 - read-pkg-up: 1.0.1 - require-directory: 2.1.1 - require-main-filename: 1.0.1 - set-blocking: 2.0.0 - string-width: 1.0.2 - which-module: 1.0.0 - y18n: 3.2.2 - yargs-parser: 5.0.1 - dev: true - /yocto-queue/0.1.0: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} diff --git a/scripts/build-tests.js b/scripts/build-tests.js new file mode 100644 index 00000000..dc428e4a --- /dev/null +++ b/scripts/build-tests.js @@ -0,0 +1,29 @@ +const fs = require('fs'); +const path = require('path'); +const { readDirDeepSync } = require('read-dir-deep'); + +const folder = 'test'; +const testFile = 'all.html'; + +try { + fs.unlinkSync(`${folder}/${testFile}`); +} catch (e) {} + +const rootPath = path.resolve(process.cwd(), folder); +const warning = '\n '; +const tags = readDirDeepSync(rootPath, { + patterns: [ + '**/*.js' + ], + ignore: [ + '*.js' + ] + }) + .map(file => './' + file.replace(/^test\//, '')) + .map(file => ``) + .join('\n '); + +const template = fs.readFileSync(`${folder}/all-template.html`, 'utf-8') +const text = template.replace('{{test-files}}', warning + tags) + +fs.writeFileSync(`${folder}/${testFile}`, text, 'utf-8') \ No newline at end of file diff --git a/test/all-template.html b/test/all-template.html index a605e8e7..6e1afb75 100644 --- a/test/all-template.html +++ b/test/all-template.html @@ -10,32 +10,32 @@ -
-
- - - - -{{test-files}} + window.process = { + cwd: () => { + return '../..'; + } + }; + window.require = (module) => { + if (module.match(/[.][.]\/src$/)) return browserGPU; + if (module === 'sinon') return sinon; + if (module === 'qunit') return QUnit; + if (module === 'acorn') return acorn; + if (module.match(/[.][.]\/browser-test-utils$/)) return browserTestUtils; + throw new Error('cannot find ' + module); + }; + + + + + {{test-files}} diff --git a/test/all.html b/test/all.html index 460fd639..4333257b 100644 --- a/test/all.html +++ b/test/all.html @@ -10,319 +10,319 @@ -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + window.process = { + cwd: () => { + return '../..'; + } + }; + window.require = (module) => { + if (module.match(/[.][.]\/src$/)) return browserGPU; + if (module === 'sinon') return sinon; + if (module === 'qunit') return QUnit; + if (module === 'acorn') return acorn; + if (module.match(/[.][.]\/browser-test-utils$/)) return browserTestUtils; + throw new Error('cannot find ' + module); + }; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 5f4a8240c24ad53f2937170ec9b33b84fa9098e8 Mon Sep 17 00:00:00 2001 From: 17097231932 <17097231932@163.com> Date: Sun, 29 Jan 2023 12:32:18 +0800 Subject: [PATCH 05/11] switch to modern formatter -- prettier --- .jsbeautify | 27 - .prettierrc | 18 + package.json | 4 +- pnpm-lock.yaml | 69 +- rollup.config.js | 42 +- scripts/build-tests.js | 16 +- src/alias.js | 6 +- src/backend/cpu/function-node.js | 59 +- src/backend/cpu/kernel-string.js | 48 +- src/backend/cpu/kernel.js | 112 +- src/backend/function-builder.js | 206 ++-- src/backend/function-node.js | 240 ++-- src/backend/function-tracer.js | 12 +- src/backend/gl/kernel-string.js | 102 +- src/backend/gl/kernel.js | 73 +- src/backend/gl/texture/array-2-float-2d.js | 2 +- src/backend/gl/texture/array-2-float-3d.js | 2 +- src/backend/gl/texture/array-2-float.js | 2 +- src/backend/gl/texture/array-3-float-2d.js | 2 +- src/backend/gl/texture/array-3-float-3d.js | 2 +- src/backend/gl/texture/array-3-float.js | 2 +- src/backend/gl/texture/array-4-float-2d.js | 2 +- src/backend/gl/texture/array-4-float-3d.js | 2 +- src/backend/gl/texture/array-4-float.js | 2 +- src/backend/gl/texture/float-2d.js | 2 +- src/backend/gl/texture/float-3d.js | 2 +- src/backend/gl/texture/float.js | 10 +- src/backend/gl/texture/graphical.js | 2 +- src/backend/gl/texture/index.js | 6 +- src/backend/gl/texture/memory-optimized-2d.js | 2 +- src/backend/gl/texture/memory-optimized-3d.js | 2 +- src/backend/gl/texture/memory-optimized.js | 2 +- src/backend/gl/texture/unsigned-2d.js | 2 +- src/backend/gl/texture/unsigned-3d.js | 2 +- src/backend/gl/texture/unsigned.js | 10 +- src/backend/headless-gl/kernel.js | 13 +- src/backend/kernel-value.js | 21 +- src/backend/kernel.js | 64 +- src/backend/web-gl/fragment-shader.js | 2 +- src/backend/web-gl/function-node.js | 112 +- src/backend/web-gl/kernel-value-maps.js | 120 +- src/backend/web-gl/kernel-value/array.js | 2 +- src/backend/web-gl/kernel-value/array2.js | 4 +- src/backend/web-gl/kernel-value/array3.js | 4 +- src/backend/web-gl/kernel-value/array4.js | 4 +- src/backend/web-gl/kernel-value/boolean.js | 4 +- .../web-gl/kernel-value/dynamic-html-image.js | 8 +- .../web-gl/kernel-value/dynamic-html-video.js | 2 +- ...dynamic-memory-optimized-number-texture.js | 8 +- .../kernel-value/dynamic-number-texture.js | 8 +- .../kernel-value/dynamic-single-array.js | 8 +- .../kernel-value/dynamic-single-array1d-i.js | 8 +- .../kernel-value/dynamic-single-array2d-i.js | 8 +- .../kernel-value/dynamic-single-array3d-i.js | 8 +- .../kernel-value/dynamic-single-input.js | 8 +- .../kernel-value/dynamic-unsigned-array.js | 8 +- .../kernel-value/dynamic-unsigned-input.js | 8 +- src/backend/web-gl/kernel-value/float.js | 4 +- src/backend/web-gl/kernel-value/html-image.js | 10 +- src/backend/web-gl/kernel-value/html-video.js | 2 +- src/backend/web-gl/kernel-value/index.js | 2 +- src/backend/web-gl/kernel-value/integer.js | 6 +- .../memory-optimized-number-texture.js | 10 +- .../web-gl/kernel-value/number-texture.js | 10 +- .../web-gl/kernel-value/single-array.js | 13 +- .../web-gl/kernel-value/single-array1d-i.js | 13 +- .../web-gl/kernel-value/single-array2d-i.js | 13 +- .../web-gl/kernel-value/single-array3d-i.js | 13 +- .../web-gl/kernel-value/single-input.js | 13 +- .../web-gl/kernel-value/unsigned-array.js | 14 +- .../web-gl/kernel-value/unsigned-input.js | 14 +- src/backend/web-gl/kernel.js | 313 ++--- src/backend/web-gl/vertex-shader.js | 2 +- src/backend/web-gl2/fragment-shader.js | 2 +- src/backend/web-gl2/function-node.js | 8 +- src/backend/web-gl2/kernel-value-maps.js | 120 +- src/backend/web-gl2/kernel-value/array2.js | 2 +- src/backend/web-gl2/kernel-value/array3.js | 2 +- src/backend/web-gl2/kernel-value/array4.js | 2 +- src/backend/web-gl2/kernel-value/boolean.js | 2 +- .../kernel-value/dynamic-html-image-array.js | 8 +- .../kernel-value/dynamic-html-image.js | 8 +- .../kernel-value/dynamic-html-video.js | 2 +- ...dynamic-memory-optimized-number-texture.js | 8 +- .../kernel-value/dynamic-number-texture.js | 8 +- .../kernel-value/dynamic-single-array.js | 8 +- .../kernel-value/dynamic-single-array1d-i.js | 8 +- .../kernel-value/dynamic-single-array2d-i.js | 8 +- .../kernel-value/dynamic-single-array3d-i.js | 8 +- .../kernel-value/dynamic-single-input.js | 8 +- .../kernel-value/dynamic-unsigned-array.js | 8 +- .../kernel-value/dynamic-unsigned-input.js | 8 +- src/backend/web-gl2/kernel-value/float.js | 2 +- .../web-gl2/kernel-value/html-image-array.js | 35 +- .../web-gl2/kernel-value/html-image.js | 8 +- .../web-gl2/kernel-value/html-video.js | 2 +- src/backend/web-gl2/kernel-value/integer.js | 8 +- .../memory-optimized-number-texture.js | 8 +- .../web-gl2/kernel-value/number-texture.js | 8 +- .../web-gl2/kernel-value/single-array.js | 8 +- .../web-gl2/kernel-value/single-array1d-i.js | 2 +- .../web-gl2/kernel-value/single-array2d-i.js | 2 +- .../web-gl2/kernel-value/single-array3d-i.js | 2 +- .../web-gl2/kernel-value/single-input.js | 8 +- .../web-gl2/kernel-value/unsigned-array.js | 8 +- .../web-gl2/kernel-value/unsigned-input.js | 8 +- src/backend/web-gl2/kernel.js | 171 +-- src/backend/web-gl2/vertex-shader.js | 2 +- src/browser.js | 44 +- src/gpu.js | 52 +- src/index.d.ts | 260 +--- src/index.js | 48 +- src/input.js | 13 +- src/kernel-run-shortcut.js | 18 +- src/plugins/math-random-triangle-noise.js | 6 +- .../math-random-uniformly-distributed.js | 6 +- src/texture.js | 14 +- src/utils.js | 237 ++-- test/all-template.html | 72 +- test/all.html | 646 +++++----- test/benchmark-faster.js | 16 +- test/benchmark.js | 12 +- test/browser-test-utils.js | 19 +- test/features/add-custom-function.js | 149 ++- test/features/add-custom-native-function.js | 406 ++++--- test/features/add-typed-functions.js | 18 +- test/features/argument-array-types.js | 104 +- test/features/argument-array1d-types.js | 122 +- test/features/argument-array2d-types.js | 188 ++- test/features/argument-array3d-types.js | 296 ++--- test/features/arithmetic-operators.js | 133 ++- test/features/assignment-operators.js | 92 +- test/features/basic-math.js | 53 +- test/features/bitwise-operators.js | 44 +- test/features/boolean-from-expression.js | 13 +- test/features/canvas.js | 34 +- test/features/clear-textures.js | 29 +- test/features/clone-textures.js | 53 +- test/features/combine-kernels.js | 98 +- test/features/constants-array.js | 17 +- test/features/constants-bool.js | 21 +- test/features/constants-canvas.js | 7 +- test/features/constants-float.js | 16 +- test/features/constants-image-array.js | 6 +- test/features/constants-image.js | 11 +- test/features/constants-integer.js | 21 +- test/features/constants-texture.js | 82 +- test/features/cpu-with-textures.js | 259 ++-- test/features/create-kernel-map.js | 80 +- test/features/demo.js | 21 +- test/features/destroy.js | 91 +- test/features/destructured-assignment.js | 37 +- test/features/dev-mode.js | 190 +-- test/features/dynamic-arguments.js | 700 ++++------- test/features/dynamic-output.js | 683 ++++++----- test/features/function-return.js | 85 +- test/features/get-canvas.js | 19 +- test/features/get-pixels.js | 291 +---- test/features/if-else.js | 72 +- test/features/image-array.js | 25 +- test/features/image.js | 21 +- test/features/infinity.js | 79 +- test/features/inject-native.js | 48 +- test/features/input.js | 245 ++-- test/features/internally-defined-matrices.js | 31 +- test/features/json.js | 11 +- test/features/legacy-encoder.js | 208 ++-- test/features/loops.js | 159 +-- test/features/math-object.js | 54 +- test/features/nested-function.js | 30 +- test/features/offscreen-canvas.js | 9 +- test/features/optimize-float-memory.js | 216 ++-- test/features/output.js | 205 ++-- test/features/promise-api.js | 10 +- test/features/raw-output.js | 33 +- test/features/read-color-texture.js | 68 +- test/features/read-from-texture.js | 30 +- test/features/read-image-bitmap.js | 31 +- test/features/read-image-data.js | 17 +- test/features/read-offscreen-canvas.js | 36 +- test/features/return-arrays.js | 152 ++- test/features/single-precision-textures.js | 358 +++--- test/features/single-precision.js | 29 +- test/features/switches.js | 132 ++- test/features/tactic.js | 11 +- test/features/ternary.js | 15 +- test/features/to-string/as-file.js | 11 +- .../precision/single/arguments/array.js | 25 +- .../precision/single/arguments/array2.js | 25 +- .../precision/single/arguments/array2d.js | 29 +- .../precision/single/arguments/array2d2.js | 51 +- .../precision/single/arguments/array2d3.js | 53 +- .../precision/single/arguments/array3.js | 25 +- .../precision/single/arguments/array3d.js | 31 +- .../precision/single/arguments/array4.js | 25 +- .../precision/single/arguments/boolean.js | 19 +- .../precision/single/arguments/float.js | 21 +- .../precision/single/arguments/html-canvas.js | 30 +- .../single/arguments/html-image-array.js | 68 +- .../precision/single/arguments/html-image.js | 37 +- .../precision/single/arguments/html-video.js | 32 +- .../precision/single/arguments/input.js | 31 +- .../precision/single/arguments/integer.js | 21 +- .../memory-optimized-number-texture.js | 65 +- .../single/arguments/number-texture.js | 65 +- .../precision/single/constants/array.js | 37 +- .../precision/single/constants/array2.js | 37 +- .../precision/single/constants/array2d.js | 35 +- .../precision/single/constants/array3.js | 37 +- .../precision/single/constants/array3d.js | 38 +- .../precision/single/constants/array4.js | 37 +- .../precision/single/constants/boolean.js | 46 +- .../precision/single/constants/float.js | 25 +- .../precision/single/constants/html-canvas.js | 29 +- .../single/constants/html-image-array.js | 81 +- .../precision/single/constants/html-image.js | 38 +- .../precision/single/constants/input.js | 37 +- .../precision/single/constants/integer.js | 25 +- .../memory-optimized-number-texture.js | 67 +- .../single/constants/number-texture.js | 71 +- .../to-string/precision/single/graphical.js | 33 +- .../single/kernel-map/array/array.js | 24 +- .../single/kernel-map/array/array2d.js | 34 +- .../single/kernel-map/array/array3d.js | 44 +- .../array/memory-optimized-number-texture.js | 28 +- .../single/kernel-map/array/number-texture.js | 26 +- .../single/kernel-map/object/array.js | 24 +- .../single/kernel-map/object/array2d.js | 34 +- .../single/kernel-map/object/array3d.js | 46 +- .../object/memory-optimized-number-texture.js | 28 +- .../kernel-map/object/number-texture.js | 26 +- .../precision/single/returns/array.js | 19 +- .../precision/single/returns/array2d.js | 24 +- .../precision/single/returns/array3d.js | 28 +- .../precision/single/returns/texture.js | 21 +- .../precision/unsigned/arguments/array.js | 25 +- .../precision/unsigned/arguments/array2.js | 25 +- .../precision/unsigned/arguments/array2d.js | 29 +- .../precision/unsigned/arguments/array3.js | 25 +- .../precision/unsigned/arguments/array3d.js | 31 +- .../precision/unsigned/arguments/array4.js | 25 +- .../precision/unsigned/arguments/boolean.js | 19 +- .../precision/unsigned/arguments/float.js | 21 +- .../unsigned/arguments/html-canvas.js | 30 +- .../unsigned/arguments/html-image-array.js | 68 +- .../unsigned/arguments/html-image.js | 37 +- .../unsigned/arguments/html-video.js | 32 +- .../precision/unsigned/arguments/input.js | 31 +- .../precision/unsigned/arguments/integer.js | 21 +- .../memory-optimized-number-texture.js | 65 +- .../unsigned/arguments/number-texture.js | 65 +- .../precision/unsigned/constants/array.js | 37 +- .../precision/unsigned/constants/array2.js | 37 +- .../precision/unsigned/constants/array2d.js | 35 +- .../precision/unsigned/constants/array3.js | 37 +- .../precision/unsigned/constants/array3d.js | 38 +- .../precision/unsigned/constants/array4.js | 37 +- .../precision/unsigned/constants/boolean.js | 46 +- .../precision/unsigned/constants/float.js | 25 +- .../unsigned/constants/html-canvas.js | 29 +- .../unsigned/constants/html-image-array.js | 81 +- .../unsigned/constants/html-image.js | 46 +- .../precision/unsigned/constants/input.js | 37 +- .../precision/unsigned/constants/integer.js | 25 +- .../memory-optimized-number-texture.js | 67 +- .../unsigned/constants/number-texture.js | 71 +- .../to-string/precision/unsigned/graphical.js | 33 +- .../unsigned/kernel-map/array/array.js | 24 +- .../unsigned/kernel-map/array/array2d.js | 34 +- .../unsigned/kernel-map/array/array3d.js | 44 +- .../array/memory-optimized-number-texture.js | 28 +- .../kernel-map/array/number-texture.js | 26 +- .../unsigned/kernel-map/object/array.js | 24 +- .../unsigned/kernel-map/object/array2d.js | 34 +- .../unsigned/kernel-map/object/array3d.js | 44 +- .../object/memory-optimized-number-texture.js | 28 +- .../kernel-map/object/number-texture.js | 26 +- .../precision/unsigned/returns/array.js | 19 +- .../precision/unsigned/returns/array2d.js | 24 +- .../precision/unsigned/returns/array3d.js | 28 +- .../precision/unsigned/returns/texture.js | 21 +- test/features/type-management.js | 1047 +++++++++++------ test/features/unsigned-precision-textures.js | 358 +++--- test/features/video.js | 21 +- test/index.js | 47 +- test/internal/argument-texture-switching.js | 164 +-- test/internal/backend/cpu-kernel.js | 2 +- test/internal/backend/function-node/isSafe.js | 25 +- .../function-node/isSafeDependencies.js | 50 +- test/internal/backend/gl-kernel.js | 75 +- .../backend/headless-gl/kernel/index.js | 4 +- .../function-node/astBinaryExpression.js | 511 ++++---- .../web-gl/function-node/astCallExpression.js | 120 +- .../web-gl/function-node/astForStatement.js | 273 ++--- .../function-node/astVariableDeclaration.js | 310 +++-- .../backend/web-gl/function-node/contexts.js | 126 +- .../firstAvailableTypeFromAst.js | 179 ++- .../function-node/getVariableSignature.js | 25 +- .../web-gl/function-node/getVariableType.js | 210 ++-- .../web-gl/kernel-value/dynamic-html-image.js | 73 +- ...dynamic-memory-optimized-number-texture.js | 79 +- .../kernel-value/dynamic-number-texture.js | 79 +- .../kernel-value/dynamic-single-array.js | 12 +- .../kernel-value/dynamic-single-array1d-i.js | 17 +- .../kernel-value/dynamic-single-array2d-i.js | 19 +- .../kernel-value/dynamic-single-array3d-i.js | 21 +- .../kernel-value/dynamic-single-input.js | 81 +- .../kernel-value/dynamic-unsigned-array.js | 12 +- .../kernel-value/dynamic-unsigned-input.js | 56 +- .../backend/web-gl/kernel-value/html-image.js | 69 +- .../memory-optimized-number-texture.js | 104 +- .../web-gl/kernel-value/number-texture.js | 104 +- .../web-gl/kernel-value/single-array.js | 6 +- .../web-gl/kernel-value/single-array1d-i.js | 8 +- .../web-gl/kernel-value/single-array2d-i.js | 8 +- .../web-gl/kernel-value/single-array3d-i.js | 8 +- .../web-gl/kernel-value/single-input.js | 48 +- .../web-gl/kernel-value/unsigned-array.js | 8 +- .../web-gl/kernel-value/unsigned-input.js | 48 +- test/internal/backend/web-gl/kernel/index.js | 4 +- .../backend/web-gl/kernel/setupArguments.js | 836 ++++++------- .../backend/web-gl/kernel/setupConstants.js | 836 ++++++------- .../kernel-value/dynamic-html-image-array.js | 26 +- .../kernel-value/dynamic-single-array.js | 12 +- .../kernel-value/dynamic-single-input.js | 81 +- .../web-gl2/kernel-value/html-image-array.js | 6 +- .../web-gl2/kernel-value/single-input.js | 48 +- test/internal/backend/web-gl2/kernel/index.js | 4 +- .../backend/web-gl2/kernel/setupArguments.js | 836 ++++++------- .../backend/web-gl2/kernel/setupConstants.js | 836 ++++++------- test/internal/boolean.js | 135 ++- test/internal/casting.js | 116 +- test/internal/constants-texture-switching.js | 156 +-- test/internal/constructor-features.js | 11 +- test/internal/context-inheritance.js | 41 +- test/internal/deep-types.js | 255 ++-- test/internal/deprecated.js | 22 +- test/internal/different-texture-cloning.js | 44 +- test/internal/function-builder.js | 127 +- test/internal/function-composition.js | 134 +-- test/internal/function-node.js | 163 +-- .../function-return-type-detection.js | 48 +- test/internal/function-tracer.js | 231 ++-- test/internal/gpu-methods.js | 26 +- test/internal/implied-else.js | 32 +- test/internal/kernel-run-shortcut.js | 19 +- test/internal/kernel.js | 54 +- test/internal/loop-int.js | 188 +-- test/internal/loop-max.js | 144 +-- test/internal/math.random.js | 38 +- test/internal/matrix-multiply-precision.js | 59 +- test/internal/mixed-memory-optimize.js | 9 +- test/internal/modes.js | 2 +- test/internal/overloading.js | 34 +- test/internal/precision.js | 50 +- test/internal/recycling.js | 350 +++--- test/internal/texture-index.js | 64 +- test/internal/underscores.js | 115 +- test/internal/utils.js | 484 +++----- .../114-create-kernel-map-run-second-time.js | 15 +- test/issues/116-multiple-kernels-run-again.js | 17 +- test/issues/130-typed-array.js | 17 +- test/issues/147-missing-constant.js | 17 +- test/issues/152-for-vars.js | 5 +- test/issues/159-3d.js | 33 +- test/issues/174-webgl-context-warning.js | 36 +- test/issues/195-read-from-texture2d.js | 33 +- test/issues/207-same-function-reuse.js | 5 +- test/issues/212-funky-function-support.js | 37 +- .../issues/233-kernel-map-single-precision.js | 214 ++-- .../241-CPU-vs-GPU-maps-output-differently.js | 19 +- test/issues/259-atan2.js | 15 +- test/issues/263-to-string.js | 15 +- test/issues/267-immutable-sub-kernels.js | 61 +- test/issues/270-cache.js | 4 +- test/issues/279-wrong-canvas-size.js | 15 +- test/issues/300-nested-array-index.js | 8 +- test/issues/31-nested-var-declare-test.js | 94 +- test/issues/313-variable-lookup.js | 14 +- .../314-large-input-array-addressing.js | 18 +- test/issues/335-missing-z-index-issue.js | 11 +- test/issues/346-uint8array-converted.js | 14 +- test/issues/349-division-by-factors-of-3.js | 73 +- test/issues/357-modulus-issue.js | 10 +- test/issues/359-addfunction-params-wrong.js | 21 +- test/issues/378-only-first-iteration.js | 7 +- test/issues/382-bad-constant.js | 7 +- test/issues/390-thread-assignment.js | 158 ++- test/issues/396-combine-kernels-example.js | 31 +- test/issues/399-double-definition.js | 56 +- test/issues/401-cpu-canvas-check.js | 62 +- test/issues/410-if-statement.js | 16 +- test/issues/422-warnings.js | 10 +- test/issues/470-modulus-wrong.js | 19 +- test/issues/471-canvas-issue.js | 4 +- test/issues/472-compilation-issue.js | 11 +- test/issues/473-4-pixels.js | 22 +- test/issues/487-dynamic-arguments.js | 11 +- test/issues/493-strange-literal.js | 28 +- test/issues/500-sticky-arrays.js | 11 +- test/issues/519-sanitize-names.js | 15 +- test/issues/553-permanent-flip.js | 24 +- test/issues/556-minify-for-loop.js | 39 +- test/issues/560-minification-madness.js | 47 +- test/issues/564-boolean.js | 14 +- test/issues/567-wrong-modulus.js | 79 +- test/issues/585-inaccurate-lookups.js | 15 +- test/issues/586-unable-to-resize.js | 29 +- test/issues/608-rewritten-arrays.js | 89 +- test/issues/91-create-kernel-map-array.js | 32 +- test/issues/96-param-names.js | 32 +- test/test-utils.js | 68 +- 412 files changed, 13366 insertions(+), 13606 deletions(-) delete mode 100644 .jsbeautify create mode 100644 .prettierrc diff --git a/.jsbeautify b/.jsbeautify deleted file mode 100644 index d3d45dee..00000000 --- a/.jsbeautify +++ /dev/null @@ -1,27 +0,0 @@ -{ - "indent_size": 2, - "indent_char": " ", - "indent_with_tabs": false, - "editorconfig": false, - "eol": "\n", - "end_with_newline": false, - "indent_level": 0, - "preserve_newlines": true, - "max_preserve_newlines": 10, - "space_in_paren": false, - "space_in_empty_paren": false, - "jslint_happy": false, - "space_after_anon_function": false, - "space_after_named_function": false, - "brace_style": "preserve-inline", - "unindent_chained_methods": false, - "break_chained_methods": false, - "keep_array_indentation": false, - "unescape_strings": false, - "wrap_line_length": 0, - "e4x": false, - "comma_first": false, - "operator_position": "before-newline", - "indent_empty_lines": false, - "templating": ["auto"] -} \ No newline at end of file diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 00000000..a49d667a --- /dev/null +++ b/.prettierrc @@ -0,0 +1,18 @@ +{ + "arrowParens": "avoid", + "bracketSpacing": true, + "endOfLine": "lf", + "htmlWhitespaceSensitivity": "css", + "insertPragma": false, + "jsxSingleQuote": false, + "printWidth": 10e3, + "proseWrap": "preserve", + "quoteProps": "as-needed", + "requirePragma": false, + "semi": true, + "singleQuote": true, + "tabWidth": 2, + "trailingComma": "es5", + "useTabs": false, + "vueIndentScriptAndStyle": false +} diff --git a/package.json b/package.json index 82254c11..589ee1eb 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "@rollup/plugin-terser": "^0.4.0", "benchmark": "^2.1.4", "c8": "^7.12.0", - "js-beautify": "^1.14.7", + "prettier": "^2.8.3", "qunit": "^2.9.1", "read-dir-deep": "^7.0.1", "rollup": "^3.12.0", @@ -42,7 +42,7 @@ "test": "qunit test/issues test/internal test/features", "test:browser": "node scripts/build-tests.js", "coverage": "c8 qunit test/issues test/internal test/features", - "lint": "js-beautify --config .jsbeautify -f *.js src/**/*.js test/**/*.js", + "lint": "prettier -w *.js *.json src test scripts", "build": "rollup -c --bundleConfigAsCjs" }, "repository": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index cd588a0a..117d0390 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -11,7 +11,7 @@ specifiers: gl: ^5.0.3 gl-wiretap: ^0.6.2 gpu-mock.js: ^1.3.0 - js-beautify: ^1.14.7 + prettier: ^2.8.3 qunit: ^2.9.1 read-dir-deep: ^7.0.1 rollup: ^3.12.0 @@ -32,7 +32,7 @@ devDependencies: '@rollup/plugin-terser': 0.4.0_rollup@3.12.0 benchmark: 2.1.4 c8: 7.12.0 - js-beautify: 1.14.7 + prettier: 2.8.3 qunit: 2.19.4 read-dir-deep: 7.0.1 rollup: 3.12.0 @@ -269,6 +269,7 @@ packages: /abbrev/1.1.1: resolution: {integrity: sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==} + dev: false /acorn/7.4.1: resolution: {integrity: sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==} @@ -536,13 +537,6 @@ packages: /concat-map/0.0.1: resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} - /config-chain/1.1.13: - resolution: {integrity: sha512-qj+f8APARXHrM0hraqXYb2/bOVSV4PvJQlNZ/DVj0QrmNM2q2euizkeuVckQ57J+W0mRH6Hvi+k50M4Jul2VRQ==} - dependencies: - ini: 1.3.8 - proto-list: 1.2.4 - dev: true - /console-control-strings/1.1.0: resolution: {integrity: sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==} dev: false @@ -618,16 +612,6 @@ packages: path-type: 4.0.0 dev: true - /editorconfig/0.15.3: - resolution: {integrity: sha512-M9wIMFx96vq0R4F+gRpY3o2exzb8hEj/n9S8unZtHSvYjibBp/iMufSzvmOcV/laG0ZtuTVGtiJggPOSW2r93g==} - hasBin: true - dependencies: - commander: 2.20.3 - lru-cache: 4.1.5 - semver: 5.7.1 - sigmund: 1.0.1 - dev: true - /emoji-regex/8.0.0: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} @@ -945,6 +929,7 @@ packages: /ini/1.3.8: resolution: {integrity: sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==} + dev: false /ip/2.0.0: resolution: {integrity: sha512-WKa+XuLG1A1R0UWhl2+1XQSi+fZWMsYKffMZTTYsiZaUD8k2yDAj5atimTUD2TZkyCkNEeYE5NhFZmupOGtjYQ==} @@ -1047,17 +1032,6 @@ packages: istanbul-lib-report: 3.0.0 dev: true - /js-beautify/1.14.7: - resolution: {integrity: sha512-5SOX1KXPFKx+5f6ZrPsIPEY7NwKeQz47n3jm2i+XeHx9MoRsfQenlOP13FQhWvg8JRS0+XLO6XYUQ2GX+q+T9A==} - engines: {node: '>=10'} - hasBin: true - dependencies: - config-chain: 1.1.13 - editorconfig: 0.15.3 - glob: 8.1.0 - nopt: 6.0.0 - dev: true - /just-extend/4.2.1: resolution: {integrity: sha512-g3UB796vUFIY90VIv/WX3L2c8CS2MdWUww3CNrYmqza1Fg0DURc2K/O4YrnklBdQarSJ/y8JnJYDGc+1iumQjg==} dev: true @@ -1083,13 +1057,6 @@ packages: '@sinonjs/commons': 1.8.6 dev: true - /lru-cache/4.1.5: - resolution: {integrity: sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==} - dependencies: - pseudomap: 1.0.2 - yallist: 2.1.2 - dev: true - /lru-cache/6.0.0: resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==} engines: {node: '>=10'} @@ -1314,6 +1281,7 @@ packages: hasBin: true dependencies: abbrev: 1.1.1 + dev: false /npmlog/6.0.2: resolution: {integrity: sha512-/vBvz5Jfr9dT/aFWd0FIRf+T/Q2WBsLENygUaFUqstqsycmZAP/t5BvFJTK0viFmSUxiUKTUplWy5vt+rvKIxg==} @@ -1412,6 +1380,12 @@ packages: tunnel-agent: 0.6.0 dev: false + /prettier/2.8.3: + resolution: {integrity: sha512-tJ/oJ4amDihPoufT5sM0Z1SKEuKay8LfVAMlbbhnnkvt6BUserZylqo2PN+p9KeljLr0OHa2rXHU1T8reeoTrw==} + engines: {node: '>=10.13.0'} + hasBin: true + dev: true + /process-nextick-args/2.0.1: resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==} dev: true @@ -1433,14 +1407,6 @@ packages: retry: 0.12.0 dev: false - /proto-list/1.2.4: - resolution: {integrity: sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==} - dev: true - - /pseudomap/1.0.2: - resolution: {integrity: sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ==} - dev: true - /pump/3.0.0: resolution: {integrity: sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==} dependencies: @@ -1584,11 +1550,6 @@ packages: dev: false optional: true - /semver/5.7.1: - resolution: {integrity: sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==} - hasBin: true - dev: true - /semver/6.3.0: resolution: {integrity: sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==} hasBin: true @@ -1624,10 +1585,6 @@ packages: engines: {node: '>=8'} dev: true - /sigmund/1.0.1: - resolution: {integrity: sha512-fCvEXfh6NWpm+YSuY2bpXb/VIihqWA6hLsgboC+0nl71Q7N7o2eaCW8mJa/NLvQhs6jpd3VZV4UiUQlV6+lc8g==} - dev: true - /signal-exit/3.0.7: resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} @@ -1938,10 +1895,6 @@ packages: engines: {node: '>=10'} dev: true - /yallist/2.1.2: - resolution: {integrity: sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A==} - dev: true - /yallist/4.0.0: resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} dev: false diff --git a/rollup.config.js b/rollup.config.js index a29fc1dd..67f11f65 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,12 +1,12 @@ -import { defineConfig } from 'rollup' -import replace from '@rollup/plugin-replace' -import resolve from '@rollup/plugin-node-resolve' -import commonjs from '@rollup/plugin-commonjs' -import terser from '@rollup/plugin-terser' +import { defineConfig } from 'rollup'; +import replace from '@rollup/plugin-replace'; +import resolve from '@rollup/plugin-node-resolve'; +import commonjs from '@rollup/plugin-commonjs'; +import terser from '@rollup/plugin-terser'; -import fs from 'fs' +import fs from 'fs'; -const pkg = JSON.parse(fs.readFileSync('./package.json', 'utf-8')) +const pkg = JSON.parse(fs.readFileSync('./package.json', 'utf-8')); const banner = `/** * ${pkg.name} * ${pkg.homepage} @@ -20,12 +20,12 @@ const banner = `/** * The MIT License * * Copyright (c) ${new Date().getFullYear()} gpu.js Team -*/` +*/`; function buildBrowser(isCore) { function makeOutput(minify) { - const coreExt = isCore ? '-core' : '' - const ext = minify ? '.min.js' : '.js' + const coreExt = isCore ? '-core' : ''; + const ext = minify ? '.min.js' : '.js'; return { banner, file: './dist/gpu-browser' + coreExt + ext, @@ -34,9 +34,9 @@ function buildBrowser(isCore) { plugins: minify ? [terser()] : [], sourcemap: true, globals: { - acorn: 'acorn' - } - } + acorn: 'acorn', + }, + }; } return defineConfig({ @@ -47,23 +47,17 @@ function buildBrowser(isCore) { replace({ 'process.version': false, preventAssignment: true, - }) - ], - output: [ - makeOutput(false), - makeOutput(true), + }), ], + output: [makeOutput(false), makeOutput(true)], onwarn(msg, warn) { if (!/Circular/.test(msg)) { - warn(msg) + warn(msg); } }, external: isCore ? ['acron'] : [], - }) + }); } -export default [ - buildBrowser(true), - buildBrowser(false) -] \ No newline at end of file +export default [buildBrowser(true), buildBrowser(false)]; diff --git a/scripts/build-tests.js b/scripts/build-tests.js index dc428e4a..97fa30d9 100644 --- a/scripts/build-tests.js +++ b/scripts/build-tests.js @@ -12,18 +12,14 @@ try { const rootPath = path.resolve(process.cwd(), folder); const warning = '\n '; const tags = readDirDeepSync(rootPath, { - patterns: [ - '**/*.js' - ], - ignore: [ - '*.js' - ] - }) + patterns: ['**/*.js'], + ignore: ['*.js'], +}) .map(file => './' + file.replace(/^test\//, '')) .map(file => ``) .join('\n '); -const template = fs.readFileSync(`${folder}/all-template.html`, 'utf-8') -const text = template.replace('{{test-files}}', warning + tags) +const template = fs.readFileSync(`${folder}/all-template.html`, 'utf-8'); +const text = template.replace('{{test-files}}', warning + tags); -fs.writeFileSync(`${folder}/${testFile}`, text, 'utf-8') \ No newline at end of file +fs.writeFileSync(`${folder}/${testFile}`, text, 'utf-8'); diff --git a/src/alias.js b/src/alias.js index 8c453ef9..6437070b 100644 --- a/src/alias.js +++ b/src/alias.js @@ -8,7 +8,7 @@ import { utils } from './utils'; */ export function alias(name, source) { const fnString = source.toString(); - return new Function(`return function ${ name } (${ utils.getArgumentNamesFromString(fnString).join(', ') }) { - ${ utils.getFunctionBodyFromString(fnString) } + return new Function(`return function ${name} (${utils.getArgumentNamesFromString(fnString).join(', ')}) { + ${utils.getFunctionBodyFromString(fnString)} }`)(); -} \ No newline at end of file +} diff --git a/src/backend/cpu/function-node.js b/src/backend/cpu/function-node.js index 50bde8cd..26508839 100644 --- a/src/backend/cpu/function-node.js +++ b/src/backend/cpu/function-node.js @@ -13,7 +13,6 @@ export class CPUFunctionNode extends FunctionNode { * @returns {Array} the append retArr */ astFunction(ast, retArr) { - // Setup function return type and name if (!this.isRootKernel) { retArr.push('function'); @@ -69,10 +68,10 @@ export class CPUFunctionNode extends FunctionNode { retArr.push(this.followingReturnStatement); retArr.push('continue;\n'); } else if (this.isSubKernel) { - retArr.push(`subKernelResult_${ this.name } = `); + retArr.push(`subKernelResult_${this.name} = `); this.astGeneric(ast.argument, retArr); retArr.push(';'); - retArr.push(`return subKernelResult_${ this.name };`); + retArr.push(`return subKernelResult_${this.name};`); } else { retArr.push('return '); this.astGeneric(ast.argument, retArr); @@ -88,13 +87,9 @@ export class CPUFunctionNode extends FunctionNode { * @returns {Array} the append retArr */ astLiteral(ast, retArr) { - // Reject non numeric literals if (isNaN(ast.value)) { - throw this.astErrorOutput( - 'Non-numeric literal not supported : ' + ast.value, - ast - ); + throw this.astErrorOutput('Non-numeric literal not supported : ' + ast.value, ast); } retArr.push(ast.value); @@ -125,10 +120,7 @@ export class CPUFunctionNode extends FunctionNode { */ astIdentifierExpression(idtNode, retArr) { if (idtNode.type !== 'Identifier') { - throw this.astErrorOutput( - 'IdentifierExpression - not an Identifier', - idtNode - ); + throw this.astErrorOutput('IdentifierExpression - not an Identifier', idtNode); } switch (idtNode.name) { @@ -227,10 +219,7 @@ export class CPUFunctionNode extends FunctionNode { */ astWhileStatement(whileNode, retArr) { if (whileNode.type !== 'WhileStatement') { - throw this.astErrorOutput( - 'Invalid while statement', - whileNode - ); + throw this.astErrorOutput('Invalid while statement', whileNode); } retArr.push('for (let i = 0; i < LOOP_MAX; i++) {'); @@ -254,10 +243,7 @@ export class CPUFunctionNode extends FunctionNode { */ astDoWhileStatement(doWhileNode, retArr) { if (doWhileNode.type !== 'DoWhileStatement') { - throw this.astErrorOutput( - 'Invalid while statement', - doWhileNode - ); + throw this.astErrorOutput('Invalid while statement', doWhileNode); } retArr.push('for (let i = 0; i < LOOP_MAX; i++) {'); @@ -270,7 +256,6 @@ export class CPUFunctionNode extends FunctionNode { retArr.push('}\n'); return retArr; - } /** @@ -368,7 +353,6 @@ export class CPUFunctionNode extends FunctionNode { } } return retArr; - } astSwitchStatement(ast, retArr) { @@ -414,19 +398,10 @@ export class CPUFunctionNode extends FunctionNode { * @returns {Array} the append retArr */ astMemberExpression(mNode, retArr) { - const { - signature, - type, - property, - xProperty, - yProperty, - zProperty, - name, - origin - } = this.getMemberExpressionDetails(mNode); + const { signature, type, property, xProperty, yProperty, zProperty, name, origin } = this.getMemberExpressionDetails(mNode); switch (signature) { case 'this.thread.value': - retArr.push(`_this.thread.${ name }`); + retArr.push(`_this.thread.${name}`); return retArr; case 'this.output.value': switch (name) { @@ -455,16 +430,16 @@ export class CPUFunctionNode extends FunctionNode { } switch (property) { case 'r': - retArr.push(`user_${ name }[0]`); + retArr.push(`user_${name}[0]`); return retArr; case 'g': - retArr.push(`user_${ name }[1]`); + retArr.push(`user_${name}[1]`); return retArr; case 'b': - retArr.push(`user_${ name }[2]`); + retArr.push(`user_${name}[2]`); return retArr; case 'a': - retArr.push(`user_${ name }[3]`); + retArr.push(`user_${name}[3]`); return retArr; } break; @@ -532,14 +507,14 @@ export class CPUFunctionNode extends FunctionNode { isInput = this.isInput(name); size = isInput ? this.argumentSizes[this.argumentNames.indexOf(name)] : null; } - retArr.push(`${ markupName }`); + retArr.push(`${markupName}`); if (zProperty && yProperty) { if (isInput) { retArr.push('[('); this.astGeneric(zProperty, retArr); - retArr.push(`*${ this.dynamicArguments ? '(outputY * outputX)' : size[1] * size[0] })+(`); + retArr.push(`*${this.dynamicArguments ? '(outputY * outputX)' : size[1] * size[0]})+(`); this.astGeneric(yProperty, retArr); - retArr.push(`*${ this.dynamicArguments ? 'outputX' : size[0] })+`); + retArr.push(`*${this.dynamicArguments ? 'outputX' : size[0]})+`); this.astGeneric(xProperty, retArr); retArr.push(']'); } else { @@ -557,7 +532,7 @@ export class CPUFunctionNode extends FunctionNode { if (isInput) { retArr.push('[('); this.astGeneric(yProperty, retArr); - retArr.push(`*${ this.dynamicArguments ? 'outputX' : size[0] })+`); + retArr.push(`*${this.dynamicArguments ? 'outputX' : size[0]})+`); this.astGeneric(xProperty, retArr); retArr.push(']'); } else { @@ -661,4 +636,4 @@ export class CPUFunctionNode extends FunctionNode { retArr.push('debugger;'); return retArr; } -} \ No newline at end of file +} diff --git a/src/backend/cpu/kernel-string.js b/src/backend/cpu/kernel-string.js index 3e933c6c..b67f4b16 100644 --- a/src/backend/cpu/kernel-string.js +++ b/src/backend/cpu/kernel-string.js @@ -23,7 +23,7 @@ function constantsToString(constants, types) { break; } } - return `{ ${ results.join() } }`; + return `{ ${results.join()} }`; } export function cpuKernelString(cpuKernel, name) { @@ -33,26 +33,16 @@ export function cpuKernelString(cpuKernel, name) { const useFunctionKeyword = !/^function/.test(cpuKernel.color.toString()); - header.push( - ' const { context, canvas, constants: incomingConstants } = settings;', - ` const output = new Int32Array(${JSON.stringify(Array.from(cpuKernel.output))});`, - ` const _constantTypes = ${JSON.stringify(cpuKernel.constantTypes)};`, - ` const _constants = ${constantsToString(cpuKernel.constants, cpuKernel.constantTypes)};` - ); + header.push(' const { context, canvas, constants: incomingConstants } = settings;', ` const output = new Int32Array(${JSON.stringify(Array.from(cpuKernel.output))});`, ` const _constantTypes = ${JSON.stringify(cpuKernel.constantTypes)};`, ` const _constants = ${constantsToString(cpuKernel.constants, cpuKernel.constantTypes)};`); - thisProperties.push( - ' constants: _constants,', - ' context,', - ' output,', - ' thread: {x: 0, y: 0, z: 0},' - ); + thisProperties.push(' constants: _constants,', ' context,', ' output,', ' thread: {x: 0, y: 0, z: 0},'); if (cpuKernel.graphical) { header.push(` const _imageData = context.createImageData(${cpuKernel.output[0]}, ${cpuKernel.output[1]});`); header.push(` const _colorData = new Uint8ClampedArray(${cpuKernel.output[0]} * ${cpuKernel.output[1]} * 4);`); const colorFn = utils.flattenFunctionToString((useFunctionKeyword ? 'function ' : '') + cpuKernel.color.toString(), { - thisLookup: (propertyName) => { + thisLookup: propertyName => { switch (propertyName) { case '_colorData': return '_colorData'; @@ -67,11 +57,11 @@ export function cpuKernelString(cpuKernel, name) { }, findDependency: (object, name) => { return null; - } + }, }); const getPixelsFn = utils.flattenFunctionToString((useFunctionKeyword ? 'function ' : '') + cpuKernel.getPixels.toString(), { - thisLookup: (propertyName) => { + thisLookup: propertyName => { switch (propertyName) { case '_colorData': return '_colorData'; @@ -86,18 +76,12 @@ export function cpuKernelString(cpuKernel, name) { }, findDependency: () => { return null; - } + }, }); - thisProperties.push( - ' _imageData,', - ' _colorData,', - ` color: ${colorFn},` - ); + thisProperties.push(' _imageData,', ' _colorData,', ` color: ${colorFn},`); - beforeReturn.push( - ` kernel.getPixels = ${getPixelsFn};` - ); + beforeReturn.push(` kernel.getPixels = ${getPixelsFn};`); } const constantTypes = []; @@ -114,14 +98,14 @@ export function cpuKernelString(cpuKernel, name) { } return null; }, - thisLookup: (propertyName) => { + thisLookup: propertyName => { switch (propertyName) { case 'canvas': return; case 'context': return 'context'; } - } + }, }); beforeReturn.push(flattenedImageTo3DArray); thisProperties.push(` _mediaTo2DArray,`); @@ -131,7 +115,7 @@ export function cpuKernelString(cpuKernel, name) { findDependency: (object, name) => { return null; }, - thisLookup: (propertyName) => { + thisLookup: propertyName => { switch (propertyName) { case 'canvas': return 'settings.canvas'; @@ -139,14 +123,14 @@ export function cpuKernelString(cpuKernel, name) { return 'settings.context'; } throw new Error('unhandled thisLookup'); - } + }, }); beforeReturn.push(flattenedImageTo2DArray); thisProperties.push(` _mediaTo2DArray,`); } return `function(settings) { -${ header.join('\n') } +${header.join('\n')} for (const p in _constantTypes) { if (!_constantTypes.hasOwnProperty(p)) continue; const type = _constantTypes[p]; @@ -175,7 +159,7 @@ ${ header.join('\n') } ${cpuKernel._kernelString} }) .apply({ ${thisProperties.join('\n')} }); - ${ beforeReturn.join('\n') } + ${beforeReturn.join('\n')} return kernel; }`; -} \ No newline at end of file +} diff --git a/src/backend/cpu/kernel.js b/src/backend/cpu/kernel.js index 97051663..2b3720b5 100644 --- a/src/backend/cpu/kernel.js +++ b/src/backend/cpu/kernel.js @@ -15,7 +15,7 @@ export class CPUKernel extends Kernel { static get features() { return Object.freeze({ kernelMap: true, - isIntegerDivisionAccurate: true + isIntegerDivisionAccurate: true, }); } static get isSupported() { @@ -58,7 +58,7 @@ export class CPUKernel extends Kernel { this.thread = { x: 0, y: 0, - z: 0 + z: 0, }; this.translatedSources = null; } @@ -114,10 +114,8 @@ export class CPUKernel extends Kernel { if (this.subKernels) { const followingReturnStatement = []; for (let i = 0; i < this.subKernels.length; i++) { - const { - name - } = this.subKernels[i]; - followingReturnStatement.push(this.output.length > 1 ? `resultX_${ name }[x] = subKernelResult_${ name };\n` : `result_${ name }[x] = subKernelResult_${ name };\n`); + const { name } = this.subKernels[i]; + followingReturnStatement.push(this.output.length > 1 ? `resultX_${name}[x] = subKernelResult_${name};\n` : `result_${name}[x] = subKernelResult_${name};\n`); } this.followingReturnStatement = followingReturnStatement.join(''); } @@ -143,10 +141,7 @@ export class CPUKernel extends Kernel { this.translateSource(); if (this.graphical) { - const { - canvas, - output - } = this; + const { canvas, output } = this; if (!canvas) { throw new Error('no canvas available for using graphical output'); } @@ -213,9 +208,7 @@ export class CPUKernel extends Kernel { if (this._kernelString !== null) return this._kernelString; let kernelThreadString = null; - let { - translatedSources - } = this; + let { translatedSources } = this; if (translatedSources.length > 1) { translatedSources = translatedSources.filter(fn => { if (/^function/.test(fn)) return fn; @@ -225,18 +218,18 @@ export class CPUKernel extends Kernel { } else { kernelThreadString = translatedSources.shift(); } - return this._kernelString = ` const LOOP_MAX = ${ this._getLoopMaxString() }; - ${ this.injectedNative || '' } + return (this._kernelString = ` const LOOP_MAX = ${this._getLoopMaxString()}; + ${this.injectedNative || ''} const _this = this; - ${ this._resultKernelHeader() } - ${ this._processConstants() } - return (${ this.argumentNames.map(argumentName => 'user_' + argumentName).join(', ') }) => { - ${ this._prependedString.join('') } - ${ this._earlyThrows() } - ${ this._processArguments() } - ${ this.graphical ? this._graphicalKernelBody(kernelThreadString) : this._resultKernelBody(kernelThreadString) } - ${ translatedSources.length > 0 ? translatedSources.join('\n') : '' } - };`; + ${this._resultKernelHeader()} + ${this._processConstants()} + return (${this.argumentNames.map(argumentName => 'user_' + argumentName).join(', ')}) => { + ${this._prependedString.join('')} + ${this._earlyThrows()} + ${this._processArguments()} + ${this.graphical ? this._graphicalKernelBody(kernelThreadString) : this._resultKernelBody(kernelThreadString)} + ${translatedSources.length > 0 ? translatedSources.join('\n') : ''} + };`); } /** @@ -251,11 +244,7 @@ export class CPUKernel extends Kernel { * @returns {String} result */ _getLoopMaxString() { - return ( - this.loopMaxIterations ? - ` ${ parseInt(this.loopMaxIterations) };` : - ' 1000;' - ); + return this.loopMaxIterations ? ` ${parseInt(this.loopMaxIterations)};` : ' 1000;'; } _processConstants() { @@ -373,7 +362,7 @@ export class CPUKernel extends Kernel { const imageArray = new Array(height); let index = 0; for (let y = height - 1; y >= 0; y--) { - const row = imageArray[y] = new Array(width); + const row = (imageArray[y] = new Array(width)); for (let x = 0; x < width; x++) { const pixel = new Float32Array(4); pixel[0] = pixelsData[index++] / 255; // r @@ -445,7 +434,7 @@ export class CPUKernel extends Kernel { return ` this._imageData.data.set(this._colorData); this.context.putImageData(this._imageData, 0, 0); - return;` + return;`; } _getKernelResultTypeConstructorString() { @@ -463,7 +452,7 @@ export class CPUKernel extends Kernel { if (this.graphical) { return 'Float32Array'; } - throw new Error(`unhandled returnType ${ this.returnType }`); + throw new Error(`unhandled returnType ${this.returnType}`); } } @@ -471,13 +460,13 @@ export class CPUKernel extends Kernel { const constructorString = this._getKernelResultTypeConstructorString(); return ` const outputX = _this.output[0]; const result = new ${constructorString}(outputX); - ${ this._mapSubKernels(subKernel => `const result_${ subKernel.name } = new ${constructorString}(outputX);\n`).join(' ') } - ${ this._mapSubKernels(subKernel => `let subKernelResult_${ subKernel.name };\n`).join(' ') } + ${this._mapSubKernels(subKernel => `const result_${subKernel.name} = new ${constructorString}(outputX);\n`).join(' ')} + ${this._mapSubKernels(subKernel => `let subKernelResult_${subKernel.name};\n`).join(' ')} for (let x = 0; x < outputX; x++) { this.thread.x = x; this.thread.y = 0; this.thread.z = 0; - ${ kernelString } + ${kernelString} }`; } @@ -485,8 +474,8 @@ export class CPUKernel extends Kernel { const constructorString = this._getKernelResultTypeConstructorString(); return ` const outputX = _this.output[0]; const result = new ${constructorString}(outputX); - ${ this._mapSubKernels(subKernel => `const result_${ subKernel.name } = new ${constructorString}(outputX);\n`).join(' ') } - ${ this._mapSubKernels(subKernel => `let subKernelResult_${ subKernel.name };\n`).join(' ') }`; + ${this._mapSubKernels(subKernel => `const result_${subKernel.name} = new ${constructorString}(outputX);\n`).join(' ')} + ${this._mapSubKernels(subKernel => `let subKernelResult_${subKernel.name};\n`).join(' ')}`; } _resultMutableKernel1DLoop(kernelString) { @@ -495,7 +484,7 @@ export class CPUKernel extends Kernel { this.thread.x = x; this.thread.y = 0; this.thread.z = 0; - ${ kernelString } + ${kernelString} }`; } @@ -504,16 +493,16 @@ export class CPUKernel extends Kernel { return ` const outputX = _this.output[0]; const outputY = _this.output[1]; const result = new Array(outputY); - ${ this._mapSubKernels(subKernel => `const result_${ subKernel.name } = new Array(outputY);\n`).join(' ') } - ${ this._mapSubKernels(subKernel => `let subKernelResult_${ subKernel.name };\n`).join(' ') } + ${this._mapSubKernels(subKernel => `const result_${subKernel.name} = new Array(outputY);\n`).join(' ')} + ${this._mapSubKernels(subKernel => `let subKernelResult_${subKernel.name};\n`).join(' ')} for (let y = 0; y < outputY; y++) { this.thread.z = 0; this.thread.y = y; const resultX = result[y] = new ${constructorString}(outputX); - ${ this._mapSubKernels(subKernel => `const resultX_${ subKernel.name } = result_${subKernel.name}[y] = new ${constructorString}(outputX);\n`).join('') } + ${this._mapSubKernels(subKernel => `const resultX_${subKernel.name} = result_${subKernel.name}[y] = new ${constructorString}(outputX);\n`).join('')} for (let x = 0; x < outputX; x++) { this.thread.x = x; - ${ kernelString } + ${kernelString} } }`; } @@ -523,11 +512,11 @@ export class CPUKernel extends Kernel { return ` const outputX = _this.output[0]; const outputY = _this.output[1]; const result = new Array(outputY); - ${ this._mapSubKernels(subKernel => `const result_${ subKernel.name } = new Array(outputY);\n`).join(' ') } - ${ this._mapSubKernels(subKernel => `let subKernelResult_${ subKernel.name };\n`).join(' ') } + ${this._mapSubKernels(subKernel => `const result_${subKernel.name} = new Array(outputY);\n`).join(' ')} + ${this._mapSubKernels(subKernel => `let subKernelResult_${subKernel.name};\n`).join(' ')} for (let y = 0; y < outputY; y++) { const resultX = result[y] = new ${constructorString}(outputX); - ${ this._mapSubKernels(subKernel => `const resultX_${ subKernel.name } = result_${subKernel.name}[y] = new ${constructorString}(outputX);\n`).join('') } + ${this._mapSubKernels(subKernel => `const resultX_${subKernel.name} = result_${subKernel.name}[y] = new ${constructorString}(outputX);\n`).join('')} }`; } @@ -539,10 +528,10 @@ export class CPUKernel extends Kernel { this.thread.z = 0; this.thread.y = y; const resultX = result[y]; - ${ this._mapSubKernels(subKernel => `const resultX_${ subKernel.name } = result_${subKernel.name}[y] = new ${constructorString}(outputX);\n`).join('') } + ${this._mapSubKernels(subKernel => `const resultX_${subKernel.name} = result_${subKernel.name}[y] = new ${constructorString}(outputX);\n`).join('')} for (let x = 0; x < outputX; x++) { this.thread.x = x; - ${ kernelString } + ${kernelString} } }`; } @@ -555,7 +544,7 @@ export class CPUKernel extends Kernel { this.thread.y = y; for (let x = 0; x < outputX; x++) { this.thread.x = x; - ${ kernelString } + ${kernelString} } }`; } @@ -566,19 +555,19 @@ export class CPUKernel extends Kernel { const outputY = _this.output[1]; const outputZ = _this.output[2]; const result = new Array(outputZ); - ${ this._mapSubKernels(subKernel => `const result_${ subKernel.name } = new Array(outputZ);\n`).join(' ') } - ${ this._mapSubKernels(subKernel => `let subKernelResult_${ subKernel.name };\n`).join(' ') } + ${this._mapSubKernels(subKernel => `const result_${subKernel.name} = new Array(outputZ);\n`).join(' ')} + ${this._mapSubKernels(subKernel => `let subKernelResult_${subKernel.name};\n`).join(' ')} for (let z = 0; z < outputZ; z++) { this.thread.z = z; const resultY = result[z] = new Array(outputY); - ${ this._mapSubKernels(subKernel => `const resultY_${ subKernel.name } = result_${subKernel.name}[z] = new Array(outputY);\n`).join(' ') } + ${this._mapSubKernels(subKernel => `const resultY_${subKernel.name} = result_${subKernel.name}[z] = new Array(outputY);\n`).join(' ')} for (let y = 0; y < outputY; y++) { this.thread.y = y; const resultX = resultY[y] = new ${constructorString}(outputX); - ${ this._mapSubKernels(subKernel => `const resultX_${ subKernel.name } = resultY_${subKernel.name}[y] = new ${constructorString}(outputX);\n`).join(' ') } + ${this._mapSubKernels(subKernel => `const resultX_${subKernel.name} = resultY_${subKernel.name}[y] = new ${constructorString}(outputX);\n`).join(' ')} for (let x = 0; x < outputX; x++) { this.thread.x = x; - ${ kernelString } + ${kernelString} } } }`; @@ -590,14 +579,14 @@ export class CPUKernel extends Kernel { const outputY = _this.output[1]; const outputZ = _this.output[2]; const result = new Array(outputZ); - ${ this._mapSubKernels(subKernel => `const result_${ subKernel.name } = new Array(outputZ);\n`).join(' ') } - ${ this._mapSubKernels(subKernel => `let subKernelResult_${ subKernel.name };\n`).join(' ') } + ${this._mapSubKernels(subKernel => `const result_${subKernel.name} = new Array(outputZ);\n`).join(' ')} + ${this._mapSubKernels(subKernel => `let subKernelResult_${subKernel.name};\n`).join(' ')} for (let z = 0; z < outputZ; z++) { const resultY = result[z] = new Array(outputY); - ${ this._mapSubKernels(subKernel => `const resultY_${ subKernel.name } = result_${subKernel.name}[z] = new Array(outputY);\n`).join(' ') } + ${this._mapSubKernels(subKernel => `const resultY_${subKernel.name} = result_${subKernel.name}[z] = new Array(outputY);\n`).join(' ')} for (let y = 0; y < outputY; y++) { const resultX = resultY[y] = new ${constructorString}(outputX); - ${ this._mapSubKernels(subKernel => `const resultX_${ subKernel.name } = resultY_${subKernel.name}[y] = new ${constructorString}(outputX);\n`).join(' ') } + ${this._mapSubKernels(subKernel => `const resultX_${subKernel.name} = resultY_${subKernel.name}[y] = new ${constructorString}(outputX);\n`).join(' ')} } }`; } @@ -614,7 +603,7 @@ export class CPUKernel extends Kernel { const resultX = resultY[y]; for (let x = 0; x < outputX; x++) { this.thread.x = x; - ${ kernelString } + ${kernelString} } } }`; @@ -626,13 +615,12 @@ export class CPUKernel extends Kernel { } return `\n return { result: result, - ${ this.subKernels.map(subKernel => `${ subKernel.property }: result_${ subKernel.name }`).join(',\n ') } + ${this.subKernels.map(subKernel => `${subKernel.property}: result_${subKernel.name}`).join(',\n ')} };`; } _mapSubKernels(fn) { - return this.subKernels === null ? [''] : - this.subKernels.map(fn); + return this.subKernels === null ? [''] : this.subKernels.map(fn); } destroy(removeCanvasReference) { @@ -666,4 +654,4 @@ export class CPUKernel extends Kernel { hasPrependString(value) { return this._prependedString.indexOf(value) > -1; } -} \ No newline at end of file +} diff --git a/src/backend/function-builder.js b/src/backend/function-builder.js index 055ed86d..06724d76 100644 --- a/src/backend/function-builder.js +++ b/src/backend/function-builder.js @@ -13,29 +13,7 @@ export class FunctionBuilder { * @static */ static fromKernel(kernel, FunctionNode, extraNodeOptions) { - const { - kernelArguments, - kernelConstants, - argumentNames, - argumentSizes, - argumentBitRatios, - constants, - constantBitRatios, - debug, - loopMaxIterations, - nativeFunctions, - output, - optimizeFloatMemory, - precision, - plugins, - source, - subKernels, - functions, - leadingReturnStatement, - followingReturnStatement, - dynamicArguments, - dynamicOutput, - } = kernel; + const { kernelArguments, kernelConstants, argumentNames, argumentSizes, argumentBitRatios, constants, constantBitRatios, debug, loopMaxIterations, nativeFunctions, output, optimizeFloatMemory, precision, plugins, source, subKernels, functions, leadingReturnStatement, followingReturnStatement, dynamicArguments, dynamicOutput } = kernel; const argumentTypes = new Array(kernelArguments.length); const constantTypes = {}; @@ -61,7 +39,7 @@ export class FunctionBuilder { return functionBuilder.lookupReturnType(functionName, ast, requestingNode); }; - const lookupFunctionArgumentTypes = (functionName) => { + const lookupFunctionArgumentTypes = functionName => { return functionBuilder.lookupFunctionArgumentTypes(functionName); }; @@ -90,11 +68,32 @@ export class FunctionBuilder { for (let i = 0; i < ast.params.length; i++) { argumentNames.push(ast.params[i].name); } - const nestedFunction = new FunctionNode(source, Object.assign({}, nodeOptions, { - returnType: null, - ast, - name: ast.id.name, - argumentNames, + const nestedFunction = new FunctionNode( + source, + Object.assign({}, nodeOptions, { + returnType: null, + ast, + name: ast.id.name, + argumentNames, + lookupReturnType, + lookupFunctionArgumentTypes, + lookupFunctionArgumentName, + lookupFunctionArgumentBitRatio, + needsArgumentType, + assignArgumentType, + triggerImplyArgumentType, + triggerImplyArgumentBitRatio, + onFunctionCall, + }) + ); + nestedFunction.traceFunctionAST(ast); + functionBuilder.addFunctionNode(nestedFunction); + }; + + const nodeOptions = Object.assign( + { + isRootKernel: false, + onNestedFunction, lookupReturnType, lookupFunctionArgumentTypes, lookupFunctionArgumentName, @@ -104,35 +103,20 @@ export class FunctionBuilder { triggerImplyArgumentType, triggerImplyArgumentBitRatio, onFunctionCall, - })); - nestedFunction.traceFunctionAST(ast); - functionBuilder.addFunctionNode(nestedFunction); - }; - - const nodeOptions = Object.assign({ - isRootKernel: false, - onNestedFunction, - lookupReturnType, - lookupFunctionArgumentTypes, - lookupFunctionArgumentName, - lookupFunctionArgumentBitRatio, - needsArgumentType, - assignArgumentType, - triggerImplyArgumentType, - triggerImplyArgumentBitRatio, - onFunctionCall, - optimizeFloatMemory, - precision, - constants, - constantTypes, - constantBitRatios, - debug, - loopMaxIterations, - output, - plugins, - dynamicArguments, - dynamicOutput, - }, extraNodeOptions || {}); + optimizeFloatMemory, + precision, + constants, + constantTypes, + constantBitRatios, + debug, + loopMaxIterations, + output, + plugins, + dynamicArguments, + dynamicOutput, + }, + extraNodeOptions || {} + ); const rootNodeOptions = Object.assign({}, nodeOptions, { isRootKernel: true, @@ -153,38 +137,44 @@ export class FunctionBuilder { let functionNodes = null; if (functions) { - functionNodes = functions.map((fn) => new FunctionNode(fn.source, { - returnType: fn.returnType, - argumentTypes: fn.argumentTypes, - output, - plugins, - constants, - constantTypes, - constantBitRatios, - optimizeFloatMemory, - precision, - lookupReturnType, - lookupFunctionArgumentTypes, - lookupFunctionArgumentName, - lookupFunctionArgumentBitRatio, - needsArgumentType, - assignArgumentType, - triggerImplyArgumentType, - triggerImplyArgumentBitRatio, - onFunctionCall, - onNestedFunction, - })); + functionNodes = functions.map( + fn => + new FunctionNode(fn.source, { + returnType: fn.returnType, + argumentTypes: fn.argumentTypes, + output, + plugins, + constants, + constantTypes, + constantBitRatios, + optimizeFloatMemory, + precision, + lookupReturnType, + lookupFunctionArgumentTypes, + lookupFunctionArgumentName, + lookupFunctionArgumentBitRatio, + needsArgumentType, + assignArgumentType, + triggerImplyArgumentType, + triggerImplyArgumentBitRatio, + onFunctionCall, + onNestedFunction, + }) + ); } let subKernelNodes = null; if (subKernels) { - subKernelNodes = subKernels.map((subKernel) => { + subKernelNodes = subKernels.map(subKernel => { const { name, source } = subKernel; - return new FunctionNode(source, Object.assign({}, nodeOptions, { - name, - isSubKernel: true, - isRootKernel: false, - })); + return new FunctionNode( + source, + Object.assign({}, nodeOptions, { + name, + isSubKernel: true, + isRootKernel: false, + }) + ); }); } @@ -193,7 +183,7 @@ export class FunctionBuilder { rootNode, functionNodes, nativeFunctions, - subKernelNodes + subKernelNodes, }); return functionBuilder; @@ -372,19 +362,21 @@ export class FunctionBuilder { } toJSON() { - return this.traceFunctionCalls(this.rootNode.name).reverse().map(name => { - const nativeIndex = this.nativeFunctions.indexOf(name); - if (nativeIndex > -1) { - return { - name, - source: this.nativeFunctions[nativeIndex].source - }; - } else if (this.functionMap[name]) { - return this.functionMap[name].toJSON(); - } else { - throw new Error(`function ${ name } not found`); - } - }); + return this.traceFunctionCalls(this.rootNode.name) + .reverse() + .map(name => { + const nativeIndex = this.nativeFunctions.indexOf(name); + if (nativeIndex > -1) { + return { + name, + source: this.nativeFunctions[nativeIndex].source, + }; + } else if (this.functionMap[name]) { + return this.functionMap[name].toJSON(); + } else { + throw new Error(`function ${name} not found`); + } + }); } fromJSON(jsonFunctionNodes, FunctionNode) { @@ -410,7 +402,7 @@ export class FunctionBuilder { lookupReturnType(functionName, ast, requestingNode) { if (ast.type !== 'CallExpression') { - throw new Error(`expected ast type of "CallExpression", but is ${ ast.type }`); + throw new Error(`expected ast type of "CallExpression", but is ${ast.type}`); } if (this._isNativeFunction(functionName)) { return this._lookupNativeFunctionReturnType(functionName); @@ -430,12 +422,12 @@ export class FunctionBuilder { this.lookupChain.push({ name: requestingNode.name, ast: args[i], - requestingNode + requestingNode, }); node.argumentTypes[j] = requestingNode.getType(args[j]); this.lookupChain.pop(); } - return node.returnType = node.getType(node.getJsAST()); + return (node.returnType = node.getType(node.getJsAST())); } throw new Error('circlical logic detected!'); @@ -445,11 +437,11 @@ export class FunctionBuilder { this.lookupChain.push({ name: requestingNode.name, ast, - requestingNode + requestingNode, }); const type = node.getType(node.getJsAST()); this.lookupChain.pop(); - return node.returnType = type; + return (node.returnType = type); } } @@ -489,7 +481,7 @@ export class FunctionBuilder { if (nativeFunction) { return nativeFunction.returnType; } - throw new Error(`Native function ${ functionName } not found`); + throw new Error(`Native function ${functionName} not found`); } lookupFunctionArgumentTypes(functionName) { @@ -603,7 +595,7 @@ export class FunctionBuilder { } } if (!called) { - throw new Error(`SubKernel ${ subKernelNode.name } never called by kernel`); + throw new Error(`SubKernel ${subKernelNode.name} never called by kernel`); } return subKernelNode.returnType || subKernelNode.getType(subKernelNode.getJsAST()); } @@ -620,4 +612,4 @@ export class FunctionBuilder { } return result; } -} \ No newline at end of file +} diff --git a/src/backend/function-node.js b/src/backend/function-node.js index 54046c50..06333476 100644 --- a/src/backend/function-node.js +++ b/src/backend/function-node.js @@ -20,9 +20,7 @@ export class FunctionNode { settings = settings || {}; this.source = source; this.ast = null; - this.name = typeof source === 'string' ? settings.isRootKernel ? - 'kernel' : - (settings.name || utils.getFunctionNameFromString(source)) : null; + this.name = typeof source === 'string' ? (settings.isRootKernel ? 'kernel' : settings.name || utils.getFunctionNameFromString(source)) : null; this.calledFunctions = []; this.constants = {}; this.constantTypes = {}; @@ -47,7 +45,7 @@ export class FunctionNode { this.optimizeFloatMemory = null; this.precision = null; this.loopMaxIterations = null; - this.argumentNames = (typeof this.source === 'string' ? utils.getArgumentNamesFromString(this.source) : null); + this.argumentNames = typeof this.source === 'string' ? utils.getArgumentNamesFromString(this.source) : null; this.argumentTypes = []; this.argumentSizes = []; this.argumentBitRatios = null; @@ -90,7 +88,7 @@ export class FunctionNode { } if (this.argumentTypes.length > 0 && this.argumentTypes.length !== this.argumentNames.length) { - throw new Error(`argumentTypes count of ${ this.argumentTypes.length } exceeds ${ this.argumentNames.length }`); + throw new Error(`argumentTypes count of ${this.argumentTypes.length} exceeds ${this.argumentNames.length}`); } if (this.output.length < 1) { @@ -117,7 +115,7 @@ export class FunctionNode { popState(state) { if (this.state !== state) { - throw new Error(`Cannot popState ${ state } when in ${ this.state }`); + throw new Error(`Cannot popState ${state} when in ${this.state}`); } this.states.pop(); } @@ -155,11 +153,7 @@ export class FunctionNode { return this.astMemberExpressionUnroll(ast.property); } - return ( - this.astMemberExpressionUnroll(ast.object) + - '.' + - this.astMemberExpressionUnroll(ast.property) - ); + return this.astMemberExpressionUnroll(ast.object) + '.' + this.astMemberExpressionUnroll(ast.property); } } @@ -189,7 +183,7 @@ export class FunctionNode { } if (typeof this.source === 'object') { this.traceFunctionAST(this.source); - return this.ast = this.source; + return (this.ast = this.source); } inParser = inParser || acorn; @@ -197,9 +191,11 @@ export class FunctionNode { throw new Error('Missing JS to AST parser'); } - const ast = Object.freeze(inParser.parse(`const parser_${ this.name } = ${ this.source };`, { - locations: true - })); + const ast = Object.freeze( + inParser.parse(`const parser_${this.name} = ${this.source};`, { + locations: true, + }) + ); // take out the function object, outside the var declarations const functionAST = ast.body[0].declarations[0].init; this.traceFunctionAST(functionAST); @@ -208,7 +204,7 @@ export class FunctionNode { throw new Error('Failed to parse JS code'); } - return this.ast = functionAST; + return (this.ast = functionAST); } traceFunctionAST(ast) { @@ -302,7 +298,7 @@ export class FunctionNode { */ getLookupType(type) { if (!typeLookupMap.hasOwnProperty(type)) { - throw new Error(`unknown typeLookupMap ${ type }`); + throw new Error(`unknown typeLookupMap ${type}`); } return typeLookupMap[type]; } @@ -316,12 +312,12 @@ export class FunctionNode { return type; } } - throw new Error(`Type for constant "${ constantName }" not declared`); + throw new Error(`Type for constant "${constantName}" not declared`); } toString() { if (this._string) return this._string; - return this._string = this.astGeneric(this.getJsAST(), []).join('').trim(); + return (this._string = this.astGeneric(this.getJsAST(), []).join('').trim()); } toJSON() { @@ -345,7 +341,7 @@ export class FunctionNode { return { ast: this.ast, - settings + settings, }; } @@ -369,7 +365,7 @@ export class FunctionNode { case 'Array(4)': return `Matrix(${ast.elements.length})`; } - return `Array(${ ast.elements.length })`; + return `Array(${ast.elements.length})`; case 'Literal': const literalKey = this.astKey(ast); if (this.literalTypes[literalKey]) { @@ -409,7 +405,7 @@ export class FunctionNode { this.inferArgumentTypesIfNeeded(functionName, ast.arguments); return this.lookupReturnType(functionName, ast, this); } - throw this.astErrorOutput(`Unhandled getType Type "${ ast.type }"`, ast); + throw this.astErrorOutput(`Unhandled getType Type "${ast.type}"`, ast); case 'LogicalExpression': return 'Boolean'; case 'BinaryExpression': @@ -567,7 +563,7 @@ export class FunctionNode { case 'SequenceExpression': return this.getType(ast.expressions[ast.expressions.length - 1]); default: - throw this.astErrorOutput(`Unhandled getType Type "${ ast.type }"`, ast); + throw this.astErrorOutput(`Unhandled getType Type "${ast.type}"`, ast); } } @@ -592,70 +588,13 @@ export class FunctionNode { } isAstMathVariable(ast) { - const mathProperties = [ - 'E', - 'PI', - 'SQRT2', - 'SQRT1_2', - 'LN2', - 'LN10', - 'LOG2E', - 'LOG10E', - ]; - return ast.type === 'MemberExpression' && - ast.object && ast.object.type === 'Identifier' && - ast.object.name === 'Math' && - ast.property && - ast.property.type === 'Identifier' && - mathProperties.indexOf(ast.property.name) > -1; + const mathProperties = ['E', 'PI', 'SQRT2', 'SQRT1_2', 'LN2', 'LN10', 'LOG2E', 'LOG10E']; + return ast.type === 'MemberExpression' && ast.object && ast.object.type === 'Identifier' && ast.object.name === 'Math' && ast.property && ast.property.type === 'Identifier' && mathProperties.indexOf(ast.property.name) > -1; } isAstMathFunction(ast) { - const mathFunctions = [ - 'abs', - 'acos', - 'acosh', - 'asin', - 'asinh', - 'atan', - 'atan2', - 'atanh', - 'cbrt', - 'ceil', - 'clz32', - 'cos', - 'cosh', - 'expm1', - 'exp', - 'floor', - 'fround', - 'imul', - 'log', - 'log2', - 'log10', - 'log1p', - 'max', - 'min', - 'pow', - 'random', - 'round', - 'sign', - 'sin', - 'sinh', - 'sqrt', - 'tan', - 'tanh', - 'trunc', - ]; - return ast.type === 'CallExpression' && - ast.callee && - ast.callee.type === 'MemberExpression' && - ast.callee.object && - ast.callee.object.type === 'Identifier' && - ast.callee.object.name === 'Math' && - ast.callee.property && - ast.callee.property.type === 'Identifier' && - mathFunctions.indexOf(ast.callee.property.name) > -1; + const mathFunctions = ['abs', 'acos', 'acosh', 'asin', 'asinh', 'atan', 'atan2', 'atanh', 'cbrt', 'ceil', 'clz32', 'cos', 'cosh', 'expm1', 'exp', 'floor', 'fround', 'imul', 'log', 'log2', 'log10', 'log1p', 'max', 'min', 'pow', 'random', 'round', 'sign', 'sin', 'sinh', 'sqrt', 'tan', 'tanh', 'trunc']; + return ast.type === 'CallExpression' && ast.callee && ast.callee.type === 'MemberExpression' && ast.callee.object && ast.callee.object.type === 'Identifier' && ast.callee.object.name === 'Math' && ast.callee.property && ast.callee.property.type === 'Identifier' && mathFunctions.indexOf(ast.callee.property.name) > -1; } isAstVariable(ast) { @@ -702,7 +641,7 @@ export class FunctionNode { dependencies.push({ origin: 'literal', value: ast.value, - isSafe: isNotSafe === true ? false : ast.value > -Infinity && ast.value < Infinity && !isNaN(ast.value) + isSafe: isNotSafe === true ? false : ast.value > -Infinity && ast.value < Infinity && !isNaN(ast.value), }); break; case 'VariableDeclarator': @@ -731,7 +670,7 @@ export class FunctionNode { return this.getDependencies(ast.argument, dependencies); case 'BinaryExpression': case 'LogicalExpression': - isNotSafe = (ast.operator === '/' || ast.operator === '*'); + isNotSafe = ast.operator === '/' || ast.operator === '*'; this.getDependencies(ast.left, dependencies, isNotSafe); this.getDependencies(ast.right, dependencies, isNotSafe); return dependencies; @@ -792,14 +731,14 @@ export class FunctionNode { case 'SequenceExpression': return this.getDependencies(ast.expressions, dependencies, isNotSafe); default: - throw this.astErrorOutput(`Unhandled type ${ ast.type } in getDependencies`, ast); + throw this.astErrorOutput(`Unhandled type ${ast.type} in getDependencies`, ast); } return dependencies; } getVariableSignature(ast, returnRawValue) { if (!this.isAstVariable(ast)) { - throw new Error(`ast of type "${ ast.type }" is not a variable signature`); + throw new Error(`ast of type "${ast.type}" is not a variable signature`); } if (ast.type === 'Identifier') { return 'value'; @@ -812,17 +751,9 @@ export class FunctionNode { } else if (ast.type === 'ThisExpression') { signature.unshift('this'); } else if (ast.property && ast.property.name) { - if ( - ast.property.name === 'x' || - ast.property.name === 'y' || - ast.property.name === 'z' - ) { + if (ast.property.name === 'x' || ast.property.name === 'y' || ast.property.name === 'z') { signature.unshift(returnRawValue ? '.' + ast.property.name : '.value'); - } else if ( - ast.property.name === 'constants' || - ast.property.name === 'thread' || - ast.property.name === 'output' - ) { + } else if (ast.property.name === 'constants' || ast.property.name === 'thread' || ast.property.name === 'output') { signature.unshift('.' + ast.property.name); } else { signature.unshift(returnRawValue ? '.' + ast.property.name : '.value'); @@ -844,26 +775,7 @@ export class FunctionNode { return signatureString; } - const allowedExpressions = [ - 'value', - 'value[]', - 'value[][]', - 'value[][][]', - 'value[][][][]', - 'value.value', - 'value.thread.value', - 'this.thread.value', - 'this.output.value', - 'this.constants.value', - 'this.constants.value[]', - 'this.constants.value[][]', - 'this.constants.value[][][]', - 'this.constants.value[][][][]', - 'fn()[]', - 'fn()[][]', - 'fn()[][][]', - '[][]', - ]; + const allowedExpressions = ['value', 'value[]', 'value[][]', 'value[][][]', 'value[][][][]', 'value.value', 'value.thread.value', 'this.thread.value', 'this.output.value', 'this.constants.value', 'this.constants.value[]', 'this.constants.value[][]', 'this.constants.value[][][]', 'this.constants.value[][][][]', 'fn()[]', 'fn()[][]', 'fn()[][][]', '[][]']; if (allowedExpressions.indexOf(signatureString) > -1) { return signatureString; } @@ -969,7 +881,7 @@ export class FunctionNode { const leadingSource = this.source.substr(ast.start); const splitLines = leadingSource.split(/\n/); const lineBefore = splitLines.length > 0 ? splitLines[splitLines.length - 1] : 0; - return new Error(`${error} on line ${ splitLines.length }, position ${ lineBefore.length }:\n ${ debugString }`); + return new Error(`${error} on line ${splitLines.length}, position ${lineBefore.length}:\n ${debugString}`); } astDebuggerStatement(arrNode, retArr) { @@ -997,7 +909,7 @@ export class FunctionNode { * @returns {String[]} */ astFunction(ast, retArr) { - throw new Error(`"astFunction" not defined on ${ this.constructor.name }`); + throw new Error(`"astFunction" not defined on ${this.constructor.name}`); } /** @@ -1206,7 +1118,7 @@ export class FunctionNode { */ getMemberExpressionDetails(ast) { if (ast.type !== 'MemberExpression') { - throw this.astErrorOutput(`Expression ${ ast.type } not a MemberExpression`, ast); + throw this.astErrorOutput(`Expression ${ast.type} not a MemberExpression`, ast); } let name = null; let type = null; @@ -1219,8 +1131,8 @@ export class FunctionNode { case 'this.output.value': return { signature: variableSignature, - type: 'Integer', - name: ast.property.name + type: 'Integer', + name: ast.property.name, }; case 'value[]': if (typeof ast.object.name !== 'string') { @@ -1230,9 +1142,9 @@ export class FunctionNode { return { name, origin: 'user', - signature: variableSignature, - type: this.getVariableType(ast.object), - xProperty: ast.property + signature: variableSignature, + type: this.getVariableType(ast.object), + xProperty: ast.property, }; case 'value[][]': if (typeof ast.object.object.name !== 'string') { @@ -1242,10 +1154,10 @@ export class FunctionNode { return { name, origin: 'user', - signature: variableSignature, - type: this.getVariableType(ast.object.object), - yProperty: ast.object.property, - xProperty: ast.property, + signature: variableSignature, + type: this.getVariableType(ast.object.object), + yProperty: ast.object.property, + xProperty: ast.property, }; case 'value[][][]': if (typeof ast.object.object.object.name !== 'string') { @@ -1255,11 +1167,11 @@ export class FunctionNode { return { name, origin: 'user', - signature: variableSignature, - type: this.getVariableType(ast.object.object.object), - zProperty: ast.object.object.property, - yProperty: ast.object.property, - xProperty: ast.property, + signature: variableSignature, + type: this.getVariableType(ast.object.object.object), + zProperty: ast.object.object.property, + yProperty: ast.object.property, + xProperty: ast.property, }; case 'value[][][][]': if (typeof ast.object.object.object.object.name !== 'string') { @@ -1269,11 +1181,11 @@ export class FunctionNode { return { name, origin: 'user', - signature: variableSignature, - type: this.getVariableType(ast.object.object.object.object), - zProperty: ast.object.object.property, - yProperty: ast.object.property, - xProperty: ast.property, + signature: variableSignature, + type: this.getVariableType(ast.object.object.object.object), + zProperty: ast.object.object.property, + yProperty: ast.object.property, + xProperty: ast.property, }; case 'value.value': if (typeof ast.property.name !== 'string') { @@ -1297,9 +1209,9 @@ export class FunctionNode { return { name, property: ast.property.name, - origin: 'user', - signature: variableSignature, - type: 'Number' + origin: 'user', + signature: variableSignature, + type: 'Number', }; default: throw this.astErrorOutput('Unexpected expression', ast); @@ -1317,7 +1229,7 @@ export class FunctionNode { name, type, origin: 'constants', - signature: variableSignature, + signature: variableSignature, }; case 'this.constants.value[]': if (typeof ast.object.property.name !== 'string') { @@ -1332,8 +1244,8 @@ export class FunctionNode { name, type, origin: 'constants', - signature: variableSignature, - xProperty: ast.property, + signature: variableSignature, + xProperty: ast.property, }; case 'this.constants.value[][]': { if (typeof ast.object.object.property.name !== 'string') { @@ -1377,7 +1289,7 @@ export class FunctionNode { case '[][]': return { signature: variableSignature, - property: ast.property, + property: ast.property, }; default: throw this.astErrorOutput('Unexpected expression', ast); @@ -1456,28 +1368,28 @@ export class FunctionNode { } const typeLookupMap = { - 'Number': 'Number', - 'Float': 'Float', - 'Integer': 'Integer', - 'Array': 'Number', + Number: 'Number', + Float: 'Float', + Integer: 'Integer', + Array: 'Number', 'Array(2)': 'Number', 'Array(3)': 'Number', 'Array(4)': 'Number', 'Matrix(2)': 'Number', 'Matrix(3)': 'Number', 'Matrix(4)': 'Number', - 'Array2D': 'Number', - 'Array3D': 'Number', - 'Input': 'Number', - 'HTMLCanvas': 'Array(4)', - 'OffscreenCanvas': 'Array(4)', - 'HTMLImage': 'Array(4)', - 'ImageBitmap': 'Array(4)', - 'ImageData': 'Array(4)', - 'HTMLVideo': 'Array(4)', - 'HTMLImageArray': 'Array(4)', - 'NumberTexture': 'Number', - 'MemoryOptimizedNumberTexture': 'Number', + Array2D: 'Number', + Array3D: 'Number', + Input: 'Number', + HTMLCanvas: 'Array(4)', + OffscreenCanvas: 'Array(4)', + HTMLImage: 'Array(4)', + ImageBitmap: 'Array(4)', + ImageData: 'Array(4)', + HTMLVideo: 'Array(4)', + HTMLImageArray: 'Array(4)', + NumberTexture: 'Number', + MemoryOptimizedNumberTexture: 'Number', 'Array1D(2)': 'Array(2)', 'Array1D(3)': 'Array(3)', 'Array1D(4)': 'Array(4)', @@ -1491,4 +1403,4 @@ const typeLookupMap = { 'ArrayTexture(2)': 'Array(2)', 'ArrayTexture(3)': 'Array(3)', 'ArrayTexture(4)': 'Array(4)', -}; \ No newline at end of file +}; diff --git a/src/backend/function-tracer.js b/src/backend/function-tracer.js index 35195bd4..f63129b8 100644 --- a/src/backend/function-tracer.js +++ b/src/backend/function-tracer.js @@ -7,7 +7,7 @@ function last(array) { const states = { trackIdentifiers: 'trackIdentifiers', memberExpression: 'memberExpression', - inForLoopInit: 'inForLoopInit' + inForLoopInit: 'inForLoopInit', }; export class FunctionTracer { @@ -86,7 +86,7 @@ export class FunctionTracer { } getIdentifiers(run) { - const trackedIdentifiers = this.trackedIdentifiers = []; + const trackedIdentifiers = (this.trackedIdentifiers = []); this.pushState(states.trackIdentifiers); run(); this.trackedIdentifiers = null; @@ -102,11 +102,7 @@ export class FunctionTracer { const { currentContext, currentFunctionContext, runningContexts } = this; const declaration = currentContext[name] || currentFunctionContext[name] || null; - if ( - !declaration && - currentContext === currentFunctionContext && - runningContexts.length > 0 - ) { + if (!declaration && currentContext === currentFunctionContext && runningContexts.length > 0) { const previousRunningContext = runningContexts[runningContexts.length - 2]; if (previousRunningContext[name]) { return previousRunningContext[name]; @@ -304,4 +300,4 @@ export class FunctionTracer { throw new Error(`unhandled type "${ast.type}"`); } } -} \ No newline at end of file +} diff --git a/src/backend/gl/kernel-string.js b/src/backend/gl/kernel-string.js index ea5e7519..46099816 100644 --- a/src/backend/gl/kernel-string.js +++ b/src/backend/gl/kernel-string.js @@ -2,7 +2,8 @@ import { glWiretap } from 'gl-wiretap'; import { utils } from '../../utils'; function toStringWithoutUtils(fn) { - return fn.toString() + return fn + .toString() .replace('=>', '') .replace(/^function /, '') .replace(/utils[.]/g, '/*utils.*/'); @@ -21,21 +22,23 @@ export function glKernelString(Kernel, args, originKernel, setupContextString, d if (!originKernel.built) { originKernel.build.apply(originKernel, args); } - args = args ? Array.from(args).map(arg => { - switch (typeof arg) { - case 'boolean': - return new Boolean(arg); - case 'number': - return new Number(arg); - default: - return arg; - } - }) : null; + args = args + ? Array.from(args).map(arg => { + switch (typeof arg) { + case 'boolean': + return new Boolean(arg); + case 'number': + return new Number(arg); + default: + return arg; + } + }) + : null; const uploadedValues = []; const postResult = []; const context = glWiretap(originKernel.context, { useTrackablePrimitives: true, - onReadPixels: (targetName) => { + onReadPixels: targetName => { if (kernel.subKernels) { if (!subKernelsResultVariableSetup) { postResult.push(` const result = { result: ${getRenderString(targetName, kernel)} };`); @@ -55,7 +58,7 @@ export function glKernelString(Kernel, args, originKernel, setupContextString, d postResult.push(` return null;`); } }, - onUnrecognizedArgumentLookup: (argument) => { + onUnrecognizedArgumentLookup: argument => { const argumentName = findKernelValue(argument, kernel.kernelArguments, [], context, uploadedValues); if (argumentName) { return argumentName; @@ -65,31 +68,11 @@ export function glKernelString(Kernel, args, originKernel, setupContextString, d return constantName; } return null; - } + }, }); let subKernelsResultVariableSetup = false; let subKernelsResultIndex = 0; - const { - source, - canvas, - output, - pipeline, - graphical, - loopMaxIterations, - constants, - optimizeFloatMemory, - precision, - fixIntegerDivisionAccuracy, - functions, - nativeFunctions, - subKernels, - immutable, - argumentTypes, - constantTypes, - kernelArguments, - kernelConstants, - tactic, - } = originKernel; + const { source, canvas, output, pipeline, graphical, loopMaxIterations, constants, optimizeFloatMemory, precision, fixIntegerDivisionAccuracy, functions, nativeFunctions, subKernels, immutable, argumentTypes, constantTypes, kernelArguments, kernelConstants, tactic } = originKernel; const kernel = new Kernel(source, { canvas, context, @@ -123,7 +106,7 @@ export function glKernelString(Kernel, args, originKernel, setupContextString, d case 'Boolean': case 'Number': case 'Float': - // non-primitives + // non-primitives case 'Array': case 'Array(2)': case 'Array(3)': @@ -170,9 +153,7 @@ export function glKernelString(Kernel, args, originKernel, setupContextString, d result.push(`function ${toStringWithoutUtils(utils.flatten4dArrayTo)}`); result.push(`function ${toStringWithoutUtils(utils.isArray)}`); if (kernel.renderOutput !== kernel.renderTexture && kernel.formatValues) { - result.push( - ` const renderOutput = function ${toStringWithoutUtils(kernel.formatValues)};` - ); + result.push(` const renderOutput = function ${toStringWithoutUtils(kernel.formatValues)};`); } result.push('/** end of injected functions **/'); result.push(` const innerKernel = function (${kernel.kernelArguments.map(kernelArgument => kernelArgument.varName).join(', ')}) {`); @@ -197,9 +178,9 @@ export function glKernelString(Kernel, args, originKernel, setupContextString, d const textureName = context.getContextVariableName(kernel.texture.texture); result.push(` return { result: { - texture: ${ textureName }, - type: '${ results.result.type }', - toArray: ${ getToArrayString(results.result, textureName, framebufferName) } + texture: ${textureName}, + type: '${results.result.type}', + toArray: ${getToArrayString(results.result, textureName, framebufferName)} },`); const { subKernels, mappedTextures } = kernel; for (let i = 0; i < subKernels.length; i++) { @@ -209,9 +190,9 @@ export function glKernelString(Kernel, args, originKernel, setupContextString, d const subKernelTextureName = context.getContextVariableName(texture.texture); result.push(` ${subKernel.property}: { - texture: ${ subKernelTextureName }, - type: '${ subKernelResult.type }', - toArray: ${ getToArrayString(subKernelResult, subKernelTextureName, framebufferName) } + texture: ${subKernelTextureName}, + type: '${subKernelResult.type}', + toArray: ${getToArrayString(subKernelResult, subKernelTextureName, framebufferName)} },`); } result.push(` };`); @@ -219,13 +200,13 @@ export function glKernelString(Kernel, args, originKernel, setupContextString, d const rendered = kernel.renderOutput(); const textureName = context.getContextVariableName(kernel.texture.texture); result.push(` return { - texture: ${ textureName }, - type: '${ rendered.type }', - toArray: ${ getToArrayString(rendered, textureName, framebufferName) } + texture: ${textureName}, + type: '${rendered.type}', + toArray: ${getToArrayString(rendered, textureName, framebufferName)} };`); } } - result.push(` ${destroyContextString ? '\n' + destroyContextString + ' ': ''}`); + result.push(` ${destroyContextString ? '\n' + destroyContextString + ' ' : ''}`); result.push(postResult.join('\n')); result.push(' };'); if (kernel.graphical) { @@ -235,7 +216,7 @@ export function glKernelString(Kernel, args, originKernel, setupContextString, d result.push(' return innerKernel;'); let constantsUpload = []; - kernelConstants.forEach((kernelConstant) => { + kernelConstants.forEach(kernelConstant => { constantsUpload.push(`${kernelConstant.getStringValueHandler()}`); }); return `function kernel(settings) { @@ -261,29 +242,29 @@ function getRenderString(targetName, kernel) { function getGetPixelsString(kernel) { const getPixels = kernel.getPixels.toString(); const useFunctionKeyword = !/^function/.test(getPixels); - return utils.flattenFunctionToString(`${useFunctionKeyword ? 'function ' : ''}${ getPixels }`, { + return utils.flattenFunctionToString(`${useFunctionKeyword ? 'function ' : ''}${getPixels}`, { findDependency: (object, name) => { if (object === 'utils') { return `const ${name} = ${utils[name].toString()};`; } return null; }, - thisLookup: (property) => { + thisLookup: property => { if (property === 'context') { return null; } if (kernel.hasOwnProperty(property)) { return JSON.stringify(kernel[property]); } - throw new Error(`unhandled thisLookup ${ property }`); - } + throw new Error(`unhandled thisLookup ${property}`); + }, }); } function getToArrayString(kernelResult, textureName, framebufferName) { const toArray = kernelResult.toArray.toString(); const useFunctionKeyword = !/^function/.test(toArray); - const flattenedFunctions = utils.flattenFunctionToString(`${useFunctionKeyword ? 'function ' : ''}${ toArray }`, { + const flattenedFunctions = utils.flattenFunctionToString(`${useFunctionKeyword ? 'function ' : ''}${toArray}`, { findDependency: (object, name) => { if (object === 'utils') { return `const ${name} = ${utils[name].toString()};`; @@ -307,8 +288,8 @@ function getToArrayString(kernelResult, textureName, framebufferName) { if (kernelResult.hasOwnProperty(property)) { return JSON.stringify(kernelResult[property]); } - throw new Error(`unhandled thisLookup ${ property }`); - } + throw new Error(`unhandled thisLookup ${property}`); + }, }); return `() => { function framebuffer() { return ${framebufferName}; }; @@ -334,10 +315,7 @@ function findKernelValue(argument, kernelValues, values, context, uploadedValues case 'number': return null; } - if ( - typeof HTMLImageElement !== 'undefined' && - argument instanceof HTMLImageElement - ) { + if (typeof HTMLImageElement !== 'undefined' && argument instanceof HTMLImageElement) { for (let i = 0; i < kernelValues.length; i++) { const kernelValue = kernelValues[i]; if (kernelValue.type !== 'HTMLImageArray' && kernelValue) continue; @@ -359,4 +337,4 @@ function findKernelValue(argument, kernelValues, values, context, uploadedValues return variable; } return null; -} \ No newline at end of file +} diff --git a/src/backend/gl/kernel.js b/src/backend/gl/kernel.js index c387dc55..7f833704 100644 --- a/src/backend/gl/kernel.js +++ b/src/backend/gl/kernel.js @@ -64,7 +64,7 @@ export class GLKernel extends Kernel { }); const args = [ [6, 6030401], - [3, 3991] + [3, 3991], ]; kernel.build.apply(kernel, args); kernel.run.apply(kernel, args); @@ -88,9 +88,7 @@ export class GLKernel extends Kernel { precision: 'unsigned', tactic: 'speed', }); - const args = [ - [0, 1, 2, 3] - ]; + const args = [[0, 1, 2, 3]]; kernel.build.apply(kernel, args); kernel.run.apply(kernel, args); const result = kernel.renderOutput(); @@ -102,14 +100,14 @@ export class GLKernel extends Kernel { * @abstract */ static get testCanvas() { - throw new Error(`"testCanvas" not defined on ${ this.name }`); + throw new Error(`"testCanvas" not defined on ${this.name}`); } /** * @abstract */ static get testContext() { - throw new Error(`"testContext" not defined on ${ this.name }`); + throw new Error(`"testContext" not defined on ${this.name}`); } static getFeatures() { @@ -137,7 +135,7 @@ export class GLKernel extends Kernel { * @abstract */ static setupFeatureChecks() { - throw new Error(`"setupFeatureChecks" not defined on ${ this.name }`); + throw new Error(`"setupFeatureChecks" not defined on ${this.name}`); } static getSignature(kernel, argumentTypes) { @@ -298,11 +296,7 @@ export class GLKernel extends Kernel { static combineKernels(combinedKernel, lastKernel) { combinedKernel.apply(null, arguments); - const { - texSize, - context, - threadDim - } = lastKernel.texSize; + const { texSize, context, threadDim } = lastKernel.texSize; let result; if (lastKernel.precision === 'single') { const w = texSize[0]; @@ -323,7 +317,7 @@ export class GLKernel extends Kernel { return utils.splitArray(result, lastKernel.output[0]); } else if (lastKernel.output.length === 3) { const cube = utils.splitArray(result, lastKernel.output[0] * lastKernel.output[1]); - return cube.map(function(x) { + return cube.map(function (x) { return utils.splitArray(x, lastKernel.output[0]); }); } @@ -368,7 +362,7 @@ export class GLKernel extends Kernel { pickRenderStrategy(args) { if (this.graphical) { this.renderRawOutput = this.readPackedPixelsToUint8Array; - this.transferValues = (pixels) => pixels; + this.transferValues = pixels => pixels; this.TextureConstructor = GLTextureGraphical; return null; } @@ -670,7 +664,7 @@ export class GLKernel extends Kernel { case 'Array(4)': return this.getMainResultArray4Texture(); default: - throw new Error(`unhandled returnType type ${ this.returnType }`); + throw new Error(`unhandled returnType type ${this.returnType}`); } } @@ -766,23 +760,19 @@ export class GLKernel extends Kernel { } getMainResultNumberTexture() { - return utils.linesToString(this.getMainResultKernelNumberTexture()) + - utils.linesToString(this.getMainResultSubKernelNumberTexture()); + return utils.linesToString(this.getMainResultKernelNumberTexture()) + utils.linesToString(this.getMainResultSubKernelNumberTexture()); } getMainResultArray2Texture() { - return utils.linesToString(this.getMainResultKernelArray2Texture()) + - utils.linesToString(this.getMainResultSubKernelArray2Texture()); + return utils.linesToString(this.getMainResultKernelArray2Texture()) + utils.linesToString(this.getMainResultSubKernelArray2Texture()); } getMainResultArray3Texture() { - return utils.linesToString(this.getMainResultKernelArray3Texture()) + - utils.linesToString(this.getMainResultSubKernelArray3Texture()); + return utils.linesToString(this.getMainResultKernelArray3Texture()) + utils.linesToString(this.getMainResultSubKernelArray3Texture()); } getMainResultArray4Texture() { - return utils.linesToString(this.getMainResultKernelArray4Texture()) + - utils.linesToString(this.getMainResultSubKernelArray4Texture()); + return utils.linesToString(this.getMainResultKernelArray4Texture()) + utils.linesToString(this.getMainResultSubKernelArray4Texture()); } /** @@ -819,10 +809,7 @@ export class GLKernel extends Kernel { } readPackedPixelsToUint8Array() { if (this.precision !== 'unsigned') throw new Error('Requires this.precision to be "unsigned"'); - const { - texSize, - context: gl - } = this; + const { texSize, context: gl } = this; const result = new Uint8Array(texSize[0] * texSize[1] * 4); gl.readPixels(0, 0, texSize[0], texSize[1], gl.RGBA, gl.UNSIGNED_BYTE, result); return result; @@ -834,10 +821,7 @@ export class GLKernel extends Kernel { readFloatPixelsToFloat32Array() { if (this.precision !== 'single') throw new Error('Requires this.precision to be "single"'); - const { - texSize, - context: gl - } = this; + const { texSize, context: gl } = this; const w = texSize[0]; const h = texSize[1]; const result = new Float32Array(w * h * 4); @@ -851,10 +835,7 @@ export class GLKernel extends Kernel { * @return {Uint8ClampedArray} */ getPixels(flip) { - const { - context: gl, - output - } = this; + const { context: gl, output } = this; const [width, height] = output; const pixels = new Uint8Array(width * height * 4); gl.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, pixels); @@ -901,10 +882,13 @@ export class GLKernel extends Kernel { throw new Error('Resizing a kernel with dynamicOutput: false is not possible'); } const newThreadDim = [newOutput[0], newOutput[1] || 1, newOutput[2] || 1]; - const newTexSize = utils.getKernelTextureSize({ - optimizeFloatMemory: this.optimizeFloatMemory, - precision: this.precision, - }, newThreadDim); + const newTexSize = utils.getKernelTextureSize( + { + optimizeFloatMemory: this.optimizeFloatMemory, + precision: this.precision, + }, + newThreadDim + ); const oldTexSize = this.texSize; if (oldTexSize) { const oldPrecision = this.getVariablePrecisionString(oldTexSize, this.tactic); @@ -916,7 +900,7 @@ export class GLKernel extends Kernel { this.switchKernels({ type: 'outputPrecisionMismatch', precision: newPrecision, - needed: output + needed: output, }); return; } @@ -950,12 +934,7 @@ export class GLKernel extends Kernel { return this; } renderValues() { - return this.formatValues( - this.transferValues(), - this.output[0], - this.output[1], - this.output[2] - ); + return this.formatValues(this.transferValues(), this.output[0], this.output[1], this.output[2]); } switchKernels(reason) { if (this.switchingKernels) { @@ -1052,4 +1031,4 @@ const typeMap = { vec2: 'Array(2)', vec3: 'Array(3)', vec4: 'Array(4)', -}; \ No newline at end of file +}; diff --git a/src/backend/gl/texture/array-2-float-2d.js b/src/backend/gl/texture/array-2-float-2d.js index b4745fe0..7fb9f80f 100644 --- a/src/backend/gl/texture/array-2-float-2d.js +++ b/src/backend/gl/texture/array-2-float-2d.js @@ -9,4 +9,4 @@ export class GLTextureArray2Float2D extends GLTextureFloat { toArray() { return utils.erect2DArray2(this.renderValues(), this.output[0], this.output[1]); } -} \ No newline at end of file +} diff --git a/src/backend/gl/texture/array-2-float-3d.js b/src/backend/gl/texture/array-2-float-3d.js index e07ba4de..25510f93 100644 --- a/src/backend/gl/texture/array-2-float-3d.js +++ b/src/backend/gl/texture/array-2-float-3d.js @@ -9,4 +9,4 @@ export class GLTextureArray2Float3D extends GLTextureFloat { toArray() { return utils.erect3DArray2(this.renderValues(), this.output[0], this.output[1], this.output[2]); } -} \ No newline at end of file +} diff --git a/src/backend/gl/texture/array-2-float.js b/src/backend/gl/texture/array-2-float.js index 8750e414..7fe7442f 100644 --- a/src/backend/gl/texture/array-2-float.js +++ b/src/backend/gl/texture/array-2-float.js @@ -9,4 +9,4 @@ export class GLTextureArray2Float extends GLTextureFloat { toArray() { return utils.erectArray2(this.renderValues(), this.output[0], this.output[1]); } -} \ No newline at end of file +} diff --git a/src/backend/gl/texture/array-3-float-2d.js b/src/backend/gl/texture/array-3-float-2d.js index e35e504b..b4e72b52 100644 --- a/src/backend/gl/texture/array-3-float-2d.js +++ b/src/backend/gl/texture/array-3-float-2d.js @@ -9,4 +9,4 @@ export class GLTextureArray3Float2D extends GLTextureFloat { toArray() { return utils.erect2DArray3(this.renderValues(), this.output[0], this.output[1]); } -} \ No newline at end of file +} diff --git a/src/backend/gl/texture/array-3-float-3d.js b/src/backend/gl/texture/array-3-float-3d.js index 5e258cc5..b4cdbaf3 100644 --- a/src/backend/gl/texture/array-3-float-3d.js +++ b/src/backend/gl/texture/array-3-float-3d.js @@ -9,4 +9,4 @@ export class GLTextureArray3Float3D extends GLTextureFloat { toArray() { return utils.erect3DArray3(this.renderValues(), this.output[0], this.output[1], this.output[2]); } -} \ No newline at end of file +} diff --git a/src/backend/gl/texture/array-3-float.js b/src/backend/gl/texture/array-3-float.js index 570869a8..01fe4fe0 100644 --- a/src/backend/gl/texture/array-3-float.js +++ b/src/backend/gl/texture/array-3-float.js @@ -9,4 +9,4 @@ export class GLTextureArray3Float extends GLTextureFloat { toArray() { return utils.erectArray3(this.renderValues(), this.output[0]); } -} \ No newline at end of file +} diff --git a/src/backend/gl/texture/array-4-float-2d.js b/src/backend/gl/texture/array-4-float-2d.js index 21609cde..9a1df32c 100644 --- a/src/backend/gl/texture/array-4-float-2d.js +++ b/src/backend/gl/texture/array-4-float-2d.js @@ -9,4 +9,4 @@ export class GLTextureArray4Float2D extends GLTextureFloat { toArray() { return utils.erect2DArray4(this.renderValues(), this.output[0], this.output[1]); } -} \ No newline at end of file +} diff --git a/src/backend/gl/texture/array-4-float-3d.js b/src/backend/gl/texture/array-4-float-3d.js index 6a414b77..1c6496cc 100644 --- a/src/backend/gl/texture/array-4-float-3d.js +++ b/src/backend/gl/texture/array-4-float-3d.js @@ -9,4 +9,4 @@ export class GLTextureArray4Float3D extends GLTextureFloat { toArray() { return utils.erect3DArray4(this.renderValues(), this.output[0], this.output[1], this.output[2]); } -} \ No newline at end of file +} diff --git a/src/backend/gl/texture/array-4-float.js b/src/backend/gl/texture/array-4-float.js index f24f9daa..443ea12d 100644 --- a/src/backend/gl/texture/array-4-float.js +++ b/src/backend/gl/texture/array-4-float.js @@ -9,4 +9,4 @@ export class GLTextureArray4Float extends GLTextureFloat { toArray() { return utils.erectArray4(this.renderValues(), this.output[0]); } -} \ No newline at end of file +} diff --git a/src/backend/gl/texture/float-2d.js b/src/backend/gl/texture/float-2d.js index d74a3b3f..3ec329af 100644 --- a/src/backend/gl/texture/float-2d.js +++ b/src/backend/gl/texture/float-2d.js @@ -9,4 +9,4 @@ export class GLTextureFloat2D extends GLTextureFloat { toArray() { return utils.erect2DFloat(this.renderValues(), this.output[0], this.output[1]); } -} \ No newline at end of file +} diff --git a/src/backend/gl/texture/float-3d.js b/src/backend/gl/texture/float-3d.js index 93b13dd4..2d29a43e 100644 --- a/src/backend/gl/texture/float-3d.js +++ b/src/backend/gl/texture/float-3d.js @@ -9,4 +9,4 @@ export class GLTextureFloat3D extends GLTextureFloat { toArray() { return utils.erect3DFloat(this.renderValues(), this.output[0], this.output[1], this.output[2]); } -} \ No newline at end of file +} diff --git a/src/backend/gl/texture/float.js b/src/backend/gl/texture/float.js index 160d596f..68214993 100644 --- a/src/backend/gl/texture/float.js +++ b/src/backend/gl/texture/float.js @@ -13,13 +13,7 @@ export class GLTextureFloat extends GLTexture { const gl = this.context; const size = this.size; gl.bindFramebuffer(gl.FRAMEBUFFER, this.framebuffer()); - gl.framebufferTexture2D( - gl.FRAMEBUFFER, - gl.COLOR_ATTACHMENT0, - gl.TEXTURE_2D, - this.texture, - 0 - ); + gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.texture, 0); const result = new Float32Array(size[0] * size[1] * 4); gl.readPixels(0, 0, size[0], size[1], gl.RGBA, gl.FLOAT, result); return result; @@ -31,4 +25,4 @@ export class GLTextureFloat extends GLTexture { toArray() { return utils.erectFloat(this.renderValues(), this.output[0]); } -} \ No newline at end of file +} diff --git a/src/backend/gl/texture/graphical.js b/src/backend/gl/texture/graphical.js index 0a68edf4..b49ec466 100644 --- a/src/backend/gl/texture/graphical.js +++ b/src/backend/gl/texture/graphical.js @@ -8,4 +8,4 @@ export class GLTextureGraphical extends GLTextureUnsigned { toArray() { return this.renderValues(); } -} \ No newline at end of file +} diff --git a/src/backend/gl/texture/index.js b/src/backend/gl/texture/index.js index 68084ab1..f9fe6de1 100644 --- a/src/backend/gl/texture/index.js +++ b/src/backend/gl/texture/index.js @@ -11,7 +11,7 @@ export class GLTexture extends Texture { * @abstract */ get textureType() { - throw new Error(`"textureType" not implemented on ${ this.name }`); + throw new Error(`"textureType" not implemented on ${this.name}`); } clone() { @@ -71,7 +71,7 @@ export class GLTexture extends Texture { if (this.texture._refs) { this.texture._refs--; const gl = this.context; - const target = this.texture = gl.createTexture(); + const target = (this.texture = gl.createTexture()); selectTexture(gl, target); const size = this.size; target._refs = 1; @@ -120,4 +120,4 @@ function selectTexture(gl, texture) { gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST); gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST); -} \ No newline at end of file +} diff --git a/src/backend/gl/texture/memory-optimized-2d.js b/src/backend/gl/texture/memory-optimized-2d.js index 463d350e..e2e8db68 100644 --- a/src/backend/gl/texture/memory-optimized-2d.js +++ b/src/backend/gl/texture/memory-optimized-2d.js @@ -9,4 +9,4 @@ export class GLTextureMemoryOptimized2D extends GLTextureFloat { toArray() { return utils.erectMemoryOptimized2DFloat(this.renderValues(), this.output[0], this.output[1]); } -} \ No newline at end of file +} diff --git a/src/backend/gl/texture/memory-optimized-3d.js b/src/backend/gl/texture/memory-optimized-3d.js index 665df2c5..8935f702 100644 --- a/src/backend/gl/texture/memory-optimized-3d.js +++ b/src/backend/gl/texture/memory-optimized-3d.js @@ -9,4 +9,4 @@ export class GLTextureMemoryOptimized3D extends GLTextureFloat { toArray() { return utils.erectMemoryOptimized3DFloat(this.renderValues(), this.output[0], this.output[1], this.output[2]); } -} \ No newline at end of file +} diff --git a/src/backend/gl/texture/memory-optimized.js b/src/backend/gl/texture/memory-optimized.js index 865629d5..56088acb 100644 --- a/src/backend/gl/texture/memory-optimized.js +++ b/src/backend/gl/texture/memory-optimized.js @@ -9,4 +9,4 @@ export class GLTextureMemoryOptimized extends GLTextureFloat { toArray() { return utils.erectMemoryOptimizedFloat(this.renderValues(), this.output[0]); } -} \ No newline at end of file +} diff --git a/src/backend/gl/texture/unsigned-2d.js b/src/backend/gl/texture/unsigned-2d.js index ee273cfc..59dcbc74 100644 --- a/src/backend/gl/texture/unsigned-2d.js +++ b/src/backend/gl/texture/unsigned-2d.js @@ -9,4 +9,4 @@ export class GLTextureUnsigned2D extends GLTextureUnsigned { toArray() { return utils.erect2DPackedFloat(this.renderValues(), this.output[0], this.output[1]); } -} \ No newline at end of file +} diff --git a/src/backend/gl/texture/unsigned-3d.js b/src/backend/gl/texture/unsigned-3d.js index 00ba913a..c72b6364 100644 --- a/src/backend/gl/texture/unsigned-3d.js +++ b/src/backend/gl/texture/unsigned-3d.js @@ -9,4 +9,4 @@ export class GLTextureUnsigned3D extends GLTextureUnsigned { toArray() { return utils.erect3DPackedFloat(this.renderValues(), this.output[0], this.output[1], this.output[2]); } -} \ No newline at end of file +} diff --git a/src/backend/gl/texture/unsigned.js b/src/backend/gl/texture/unsigned.js index d8632944..ff401371 100644 --- a/src/backend/gl/texture/unsigned.js +++ b/src/backend/gl/texture/unsigned.js @@ -12,13 +12,7 @@ export class GLTextureUnsigned extends GLTexture { renderRawOutput() { const { context: gl } = this; gl.bindFramebuffer(gl.FRAMEBUFFER, this.framebuffer()); - gl.framebufferTexture2D( - gl.FRAMEBUFFER, - gl.COLOR_ATTACHMENT0, - gl.TEXTURE_2D, - this.texture, - 0 - ); + gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.texture, 0); const result = new Uint8Array(this.size[0] * this.size[1] * 4); gl.readPixels(0, 0, this.size[0], this.size[1], gl.RGBA, gl.UNSIGNED_BYTE, result); return result; @@ -30,4 +24,4 @@ export class GLTextureUnsigned extends GLTexture { toArray() { return utils.erectPackedFloat(this.renderValues(), this.output[0]); } -} \ No newline at end of file +} diff --git a/src/backend/headless-gl/kernel.js b/src/backend/headless-gl/kernel.js index 87fd5839..f01d74a6 100644 --- a/src/backend/headless-gl/kernel.js +++ b/src/backend/headless-gl/kernel.js @@ -20,9 +20,10 @@ export class HeadlessGLKernel extends WebGLKernel { testCanvas = null; testExtensions = null; if (typeof getContext !== 'function') return; - try { // just in case, edge cases + try { + // just in case, edge cases testContext = getContext(2, 2, { - preserveDrawingBuffer: true + preserveDrawingBuffer: true, }); if (!testContext || !testContext.getExtension) return; testExtensions = { @@ -57,9 +58,7 @@ export class HeadlessGLKernel extends WebGLKernel { } static getChannelCount() { - return testExtensions.WEBGL_draw_buffers ? - testContext.getParameter(testExtensions.WEBGL_draw_buffers.MAX_DRAW_BUFFERS_WEBGL) : - 1; + return testExtensions.WEBGL_draw_buffers ? testContext.getParameter(testExtensions.WEBGL_draw_buffers.MAX_DRAW_BUFFERS_WEBGL) : 1; } static getMaxTextureSize() { @@ -84,7 +83,7 @@ export class HeadlessGLKernel extends WebGLKernel { initContext() { return getContext(2, 2, { - preserveDrawingBuffer: true + preserveDrawingBuffer: true, }); } @@ -138,4 +137,4 @@ export class HeadlessGLKernel extends WebGLKernel { } return this; } -} \ No newline at end of file +} diff --git a/src/backend/kernel-value.js b/src/backend/kernel-value.js index bd0ccf1e..7c37f9d2 100644 --- a/src/backend/kernel-value.js +++ b/src/backend/kernel-value.js @@ -7,18 +7,7 @@ export class KernelValue { * @param {IKernelValueSettings} settings */ constructor(value, settings) { - const { - name, - kernel, - context, - checkContext, - onRequestContextHandle, - onUpdateValueMismatch, - origin, - strictIntegers, - type, - tactic, - } = settings; + const { name, kernel, context, checkContext, onRequestContextHandle, onUpdateValueMismatch, origin, strictIntegers, type, tactic } = settings; if (!name) { throw new Error('name not set'); } @@ -29,7 +18,7 @@ export class KernelValue { throw new Error('origin not set'); } if (origin !== 'user' && origin !== 'constants') { - throw new Error(`origin must be "user" or "constants" value is "${ origin }"`); + throw new Error(`origin must be "user" or "constants" value is "${origin}"`); } if (!onRequestContextHandle) { throw new Error('onRequestContextHandle is not set'); @@ -57,10 +46,10 @@ export class KernelValue { } getSource() { - throw new Error(`"getSource" not defined on ${ this.constructor.name }`); + throw new Error(`"getSource" not defined on ${this.constructor.name}`); } updateValue(value) { - throw new Error(`"updateValue" not defined on ${ this.constructor.name }`); + throw new Error(`"updateValue" not defined on ${this.constructor.name}`); } -} \ No newline at end of file +} diff --git a/src/backend/kernel.js b/src/backend/kernel.js index 6c53787f..6bc37f0d 100644 --- a/src/backend/kernel.js +++ b/src/backend/kernel.js @@ -6,7 +6,7 @@ export class Kernel { * @type {Boolean} */ static get isSupported() { - throw new Error(`"isSupported" not implemented on ${ this.name }`); + throw new Error(`"isSupported" not implemented on ${this.name}`); } /** @@ -14,7 +14,7 @@ export class Kernel { * @returns {Boolean} */ static isContextMatch(context) { - throw new Error(`"isContextMatch" not implemented on ${ this.name }`); + throw new Error(`"isContextMatch" not implemented on ${this.name}`); } /** @@ -22,23 +22,23 @@ export class Kernel { * Used internally to populate the kernel.feature, which is a getter for the output of this value */ static getFeatures() { - throw new Error(`"getFeatures" not implemented on ${ this.name }`); + throw new Error(`"getFeatures" not implemented on ${this.name}`); } static destroyContext(context) { - throw new Error(`"destroyContext" called on ${ this.name }`); + throw new Error(`"destroyContext" called on ${this.name}`); } static nativeFunctionArguments() { - throw new Error(`"nativeFunctionArguments" called on ${ this.name }`); + throw new Error(`"nativeFunctionArguments" called on ${this.name}`); } static nativeFunctionReturnType() { - throw new Error(`"nativeFunctionReturnType" called on ${ this.name }`); + throw new Error(`"nativeFunctionReturnType" called on ${this.name}`); } static combineKernels() { - throw new Error(`"combineKernels" called on ${ this.name }`); + throw new Error(`"combineKernels" called on ${this.name}`); } /** @@ -71,7 +71,6 @@ export class Kernel { this.kernelConstants = null; this.forceUploadKernelConstants = null; - /** * The function source * @type {String|IKernelJSON} @@ -273,7 +272,7 @@ export class Kernel { * @abstract */ build() { - throw new Error(`"build" not defined on ${ this.constructor.name }`); + throw new Error(`"build" not defined on ${this.constructor.name}`); } /** @@ -283,7 +282,7 @@ export class Kernel { * @abstract */ run() { - throw new Error(`"run" not defined on ${ this.constructor.name }`) + throw new Error(`"run" not defined on ${this.constructor.name}`); } /** @@ -291,7 +290,7 @@ export class Kernel { * @return {Object} */ initCanvas() { - throw new Error(`"initCanvas" not defined on ${ this.constructor.name }`); + throw new Error(`"initCanvas" not defined on ${this.constructor.name}`); } /** @@ -299,7 +298,7 @@ export class Kernel { * @return {Object} */ initContext() { - throw new Error(`"initContext" not defined on ${ this.constructor.name }`); + throw new Error(`"initContext" not defined on ${this.constructor.name}`); } /** @@ -308,7 +307,7 @@ export class Kernel { * @abstract */ initPlugins(settings) { - throw new Error(`"initPlugins" not defined on ${ this.constructor.name }`); + throw new Error(`"initPlugins" not defined on ${this.constructor.name}`); } /** @@ -337,16 +336,14 @@ export class Kernel { * @param {IGPUFunctionSettings} [settings] */ addNativeFunction(name, source, settings = {}) { - const { argumentTypes, argumentNames } = settings.argumentTypes ? - splitArgumentTypes(settings.argumentTypes) : - this.constructor.nativeFunctionArguments(source) || {}; + const { argumentTypes, argumentNames } = settings.argumentTypes ? splitArgumentTypes(settings.argumentTypes) : this.constructor.nativeFunctionArguments(source) || {}; this.nativeFunctions.push({ name, source, settings, argumentTypes, argumentNames, - returnType: settings.returnType || this.constructor.nativeFunctionReturnType(source) + returnType: settings.returnType || this.constructor.nativeFunctionReturnType(source), }); return this; } @@ -367,14 +364,14 @@ export class Kernel { const type = argType === 'Integer' ? 'Number' : argType; this.argumentTypes.push(type); this.kernelArguments.push({ - type + type, }); } } } else { for (let i = 0; i < this.argumentTypes.length; i++) { this.kernelArguments.push({ - type: this.argumentTypes[i] + type: this.argumentTypes[i], }); } } @@ -411,12 +408,12 @@ export class Kernel { this.constantTypes[name] = type; this.kernelConstants.push({ name, - type + type, }); } else { this.kernelConstants.push({ name, - type: this.constantTypes[name] + type: this.constantTypes[name], }); } this.constantBitRatios[name] = this.getBitRatio(this.constants[name]); @@ -713,7 +710,7 @@ export class Kernel { for (const p in argumentTypes) { if (!argumentTypes.hasOwnProperty(p)) continue; const argumentIndex = this.argumentNames.indexOf(p); - if (argumentIndex === -1) throw new Error(`unable to find argument ${ p }`); + if (argumentIndex === -1) throw new Error(`unable to find argument ${p}`); this.argumentTypes[argumentIndex] = argumentTypes[p]; } } @@ -732,7 +729,7 @@ export class Kernel { requestFallback(args) { if (!this.onRequestFallback) { - throw new Error(`"onRequestFallback" not defined on ${ this.constructor.name }`); + throw new Error(`"onRequestFallback" not defined on ${this.constructor.name}`); } this.fallbackRequested = true; return this.onRequestFallback(args); @@ -743,7 +740,7 @@ export class Kernel { * @abstract */ validateSettings() { - throw new Error(`"validateSettings" not defined on ${ this.constructor.name }`); + throw new Error(`"validateSettings" not defined on ${this.constructor.name}`); } /** @@ -768,7 +765,7 @@ export class Kernel { * @param {Boolean} [removeCanvasReferences] remove any associated canvas references */ destroy(removeCanvasReferences) { - throw new Error(`"destroy" called on ${ this.constructor.name }`); + throw new Error(`"destroy" called on ${this.constructor.name}`); } /** @@ -805,7 +802,7 @@ export class Kernel { * @returns {Uint8ClampedArray} */ getPixels(flip) { - throw new Error(`"getPixels" called on ${ this.constructor.name }`); + throw new Error(`"getPixels" called on ${this.constructor.name}`); } checkOutput() { @@ -813,7 +810,7 @@ export class Kernel { if (this.output.length < 1) throw new Error('kernel.output is empty, needs at least 1 value'); for (let i = 0; i < this.output.length; i++) { if (isNaN(this.output[i]) || this.output[i] < 1) { - throw new Error(`${ this.constructor.name }.output[${ i }] incorrectly defined as \`${ this.output[i] }\`, needs to be numeric, and greater than 0`); + throw new Error(`${this.constructor.name}.output[${i}] incorrectly defined as \`${this.output[i]}\`, needs to be numeric, and greater than 0`); } } } @@ -823,7 +820,7 @@ export class Kernel { * @param {String} value */ prependString(value) { - throw new Error(`"prependString" called on ${ this.constructor.name }`); + throw new Error(`"prependString" called on ${this.constructor.name}`); } /** @@ -832,7 +829,7 @@ export class Kernel { * @return Boolean */ hasPrependString(value) { - throw new Error(`"hasPrependString" called on ${ this.constructor.name }`); + throw new Error(`"hasPrependString" called on ${this.constructor.name}`); } /** @@ -848,7 +845,7 @@ export class Kernel { constants: this.constants, pluginNames: this.plugins ? this.plugins.map(plugin => plugin.name) : null, returnType: this.returnType, - } + }, }; } @@ -895,7 +892,7 @@ export class Kernel { * @abstract */ static getSignature(kernel, argumentTypes) { - throw new Error(`"getSignature" not implemented on ${ this.name }`); + throw new Error(`"getSignature" not implemented on ${this.name}`); } /** @@ -912,8 +909,7 @@ export class Kernel { if (Array.isArray(settings.argumentTypes)) { argumentTypes = settings.argumentTypes; } else if (typeof settings.argumentTypes === 'object') { - argumentTypes = utils.getArgumentNamesFromString(sourceString) - .map(name => settings.argumentTypes[name]) || []; + argumentTypes = utils.getArgumentNamesFromString(sourceString).map(name => settings.argumentTypes[name]) || []; } else { argumentTypes = settings.argumentTypes || []; } @@ -942,4 +938,4 @@ function splitArgumentTypes(argumentTypesObject) { argumentTypes.push(argumentTypesObject[argumentName]); } return { argumentTypes, argumentNames }; -} \ No newline at end of file +} diff --git a/src/backend/web-gl/fragment-shader.js b/src/backend/web-gl/fragment-shader.js index 1ec9745f..29123690 100644 --- a/src/backend/web-gl/fragment-shader.js +++ b/src/backend/web-gl/fragment-shader.js @@ -489,4 +489,4 @@ __KERNEL__; void main(void) { index = int(vTexCoord.s * float(uTexSize.x)) + int(vTexCoord.t * float(uTexSize.y)) * uTexSize.x; __MAIN_RESULT__; -}`; \ No newline at end of file +}`; diff --git a/src/backend/web-gl/function-node.js b/src/backend/web-gl/function-node.js index d336766a..0314d2e6 100644 --- a/src/backend/web-gl/function-node.js +++ b/src/backend/web-gl/function-node.js @@ -195,13 +195,13 @@ export class WebGLFunctionNode extends FunctionNode { } if (this.isRootKernel) { - retArr.push(`kernelResult = ${ result.join('') };`); + retArr.push(`kernelResult = ${result.join('')};`); retArr.push('return;'); } else if (this.isSubKernel) { - retArr.push(`subKernelResult_${ this.name } = ${ result.join('') };`); - retArr.push(`return subKernelResult_${ this.name };`); + retArr.push(`subKernelResult_${this.name} = ${result.join('')};`); + retArr.push(`return subKernelResult_${this.name};`); } else { - retArr.push(`return ${ result.join('') };`); + retArr.push(`return ${result.join('')};`); } return retArr; } @@ -217,10 +217,7 @@ export class WebGLFunctionNode extends FunctionNode { astLiteral(ast, retArr) { // Reject non numeric literals if (isNaN(ast.value)) { - throw this.astErrorOutput( - 'Non-numeric literal not supported : ' + ast.value, - ast - ); + throw this.astErrorOutput('Non-numeric literal not supported : ' + ast.value, ast); } const key = this.astKey(ast); @@ -328,7 +325,7 @@ export class WebGLFunctionNode extends FunctionNode { case 'Integer & Float': case 'Integer & Number': - if (ast.operator === '>' || ast.operator === '<' && ast.right.type === 'Literal') { + if (ast.operator === '>' || (ast.operator === '<' && ast.right.type === 'Literal')) { // if right value is actually a float, don't loose that information, cast left to right rather than the usual right to left if (!Number.isInteger(ast.right.value)) { this.pushState('building-float'); @@ -743,7 +740,6 @@ export class WebGLFunctionNode extends FunctionNode { return retArr; } - /** * @desc Parses the abstract syntax tree for *Assignment* Expression * @param {Object} assNode - An ast Node @@ -838,7 +834,7 @@ export class WebGLFunctionNode extends FunctionNode { } const markupType = typeMap[type]; if (!markupType) { - throw this.astErrorOutput(`Markup type ${ type } not handled`, varDecNode); + throw this.astErrorOutput(`Markup type ${type} not handled`, varDecNode); } const declarationResult = []; if (actualType === 'Integer' && type === 'Integer') { @@ -1039,16 +1035,7 @@ export class WebGLFunctionNode extends FunctionNode { * @returns {Array} the append retArr */ astMemberExpression(mNode, retArr) { - const { - property, - name, - signature, - origin, - type, - xProperty, - yProperty, - zProperty - } = this.getMemberExpressionDetails(mNode); + const { property, name, signature, origin, type, xProperty, yProperty, zProperty } = this.getMemberExpressionDetails(mNode); switch (signature) { case 'value.thread.value': case 'this.thread.value': @@ -1126,16 +1113,16 @@ export class WebGLFunctionNode extends FunctionNode { const cleanName = utils.sanitizeName(name); switch (property) { case 'r': - retArr.push(`user_${ cleanName }.r`); + retArr.push(`user_${cleanName}.r`); return retArr; case 'g': - retArr.push(`user_${ cleanName }.g`); + retArr.push(`user_${cleanName}.g`); return retArr; case 'b': - retArr.push(`user_${ cleanName }.b`); + retArr.push(`user_${cleanName}.b`); return retArr; case 'a': - retArr.push(`user_${ cleanName }.a`); + retArr.push(`user_${cleanName}.a`); return retArr; } break; @@ -1145,7 +1132,7 @@ export class WebGLFunctionNode extends FunctionNode { case 'Array(2)': case 'Array(3)': case 'Array(4)': - retArr.push(`constants_${ utils.sanitizeName(name) }`); + retArr.push(`constants_${utils.sanitizeName(name)}`); return retArr; } } @@ -1206,43 +1193,43 @@ export class WebGLFunctionNode extends FunctionNode { retArr.push(']'); break; case 'HTMLImageArray': - retArr.push(`getImage3D(${ markupName }, ${ markupName }Size, ${ markupName }Dim, `); + retArr.push(`getImage3D(${markupName}, ${markupName}Size, ${markupName}Dim, `); this.memberExpressionXYZ(xProperty, yProperty, zProperty, retArr); retArr.push(')'); break; case 'ArrayTexture(1)': - retArr.push(`getFloatFromSampler2D(${ markupName }, ${ markupName }Size, ${ markupName }Dim, `); + retArr.push(`getFloatFromSampler2D(${markupName}, ${markupName}Size, ${markupName}Dim, `); this.memberExpressionXYZ(xProperty, yProperty, zProperty, retArr); retArr.push(')'); break; case 'Array1D(2)': case 'Array2D(2)': case 'Array3D(2)': - retArr.push(`getMemoryOptimizedVec2(${ markupName }, ${ markupName }Size, ${ markupName }Dim, `); + retArr.push(`getMemoryOptimizedVec2(${markupName}, ${markupName}Size, ${markupName}Dim, `); this.memberExpressionXYZ(xProperty, yProperty, zProperty, retArr); retArr.push(')'); break; case 'ArrayTexture(2)': - retArr.push(`getVec2FromSampler2D(${ markupName }, ${ markupName }Size, ${ markupName }Dim, `); + retArr.push(`getVec2FromSampler2D(${markupName}, ${markupName}Size, ${markupName}Dim, `); this.memberExpressionXYZ(xProperty, yProperty, zProperty, retArr); retArr.push(')'); break; case 'Array1D(3)': case 'Array2D(3)': case 'Array3D(3)': - retArr.push(`getMemoryOptimizedVec3(${ markupName }, ${ markupName }Size, ${ markupName }Dim, `); + retArr.push(`getMemoryOptimizedVec3(${markupName}, ${markupName}Size, ${markupName}Dim, `); this.memberExpressionXYZ(xProperty, yProperty, zProperty, retArr); retArr.push(')'); break; case 'ArrayTexture(3)': - retArr.push(`getVec3FromSampler2D(${ markupName }, ${ markupName }Size, ${ markupName }Dim, `); + retArr.push(`getVec3FromSampler2D(${markupName}, ${markupName}Size, ${markupName}Dim, `); this.memberExpressionXYZ(xProperty, yProperty, zProperty, retArr); retArr.push(')'); break; case 'Array1D(4)': case 'Array2D(4)': case 'Array3D(4)': - retArr.push(`getMemoryOptimizedVec4(${ markupName }, ${ markupName }Size, ${ markupName }Dim, `); + retArr.push(`getMemoryOptimizedVec4(${markupName}, ${markupName}Size, ${markupName}Dim, `); this.memberExpressionXYZ(xProperty, yProperty, zProperty, retArr); retArr.push(')'); break; @@ -1253,7 +1240,7 @@ export class WebGLFunctionNode extends FunctionNode { case 'ImageBitmap': case 'ImageData': case 'HTMLVideo': - retArr.push(`getVec4FromSampler2D(${ markupName }, ${ markupName }Size, ${ markupName }Dim, `); + retArr.push(`getVec4FromSampler2D(${markupName}, ${markupName}Size, ${markupName}Dim, `); this.memberExpressionXYZ(xProperty, yProperty, zProperty, retArr); retArr.push(')'); break; @@ -1273,10 +1260,7 @@ export class WebGLFunctionNode extends FunctionNode { this.memberExpressionXYZ(xProperty, yProperty, zProperty, retArr); retArr.push(')'); } else { - const bitRatio = (origin === 'user' ? - this.lookupFunctionArgumentBitRatio(this.name, name) : - this.constantBitRatios[name] - ); + const bitRatio = origin === 'user' ? this.lookupFunctionArgumentBitRatio(this.name, name) : this.constantBitRatios[name]; switch (bitRatio) { case 1: retArr.push(`get8(${markupName}, ${markupName}Size, ${markupName}Dim, `); @@ -1296,7 +1280,7 @@ export class WebGLFunctionNode extends FunctionNode { } break; case 'MemoryOptimizedNumberTexture': - retArr.push(`getMemoryOptimized32(${ markupName }, ${ markupName }Size, ${ markupName }Dim, `); + retArr.push(`getMemoryOptimized32(${markupName}, ${markupName}Size, ${markupName}Dim, `); this.memberExpressionXYZ(xProperty, yProperty, zProperty, retArr); retArr.push(')'); break; @@ -1309,7 +1293,7 @@ export class WebGLFunctionNode extends FunctionNode { } break; default: - throw new Error(`unhandled member expression "${ type }"`); + throw new Error(`unhandled member expression "${type}"`); } return retArr; } @@ -1461,7 +1445,7 @@ export class WebGLFunctionNode extends FunctionNode { } else if (argument.type === 'ArrayExpression' || argument.type === 'MemberExpression' || argument.type === 'CallExpression') { this.astGeneric(argument, retArr); } else { - throw this.astErrorOutput(`Unhandled argument type ${ argument.type }`, ast); + throw this.astErrorOutput(`Unhandled argument type ${argument.type}`, ast); } continue; } @@ -1480,7 +1464,7 @@ export class WebGLFunctionNode extends FunctionNode { case 'Array': case 'Input': if (targetType === argumentType) { - if (argument.type !== 'Identifier') throw this.astErrorOutput(`Unhandled argument type ${ argument.type }`, ast); + if (argument.type !== 'Identifier') throw this.astErrorOutput(`Unhandled argument type ${argument.type}`, ast); this.triggerImplyArgumentBitRatio(this.name, argument.name, functionName, i); const name = utils.sanitizeName(argument.name); retArr.push(`user_${name},user_${name}Size,user_${name}Dim`); @@ -1488,7 +1472,7 @@ export class WebGLFunctionNode extends FunctionNode { } break; } - throw this.astErrorOutput(`Unhandled argument combination of ${ argumentType } and ${ targetType } for argument named "${ argument.name }"`, ast); + throw this.astErrorOutput(`Unhandled argument combination of ${argumentType} and ${targetType} for argument named "${argument.name}"`, ast); } } // Close arguments space @@ -1522,7 +1506,7 @@ export class WebGLFunctionNode extends FunctionNode { retArr.push(', '); } const subNode = arrNode.elements[i]; - this.astGeneric(subNode, retArr) + this.astGeneric(subNode, retArr); } retArr.push(')'); @@ -1566,37 +1550,37 @@ export class WebGLFunctionNode extends FunctionNode { } const typeMap = { - 'Array': 'sampler2D', + Array: 'sampler2D', 'Array(2)': 'vec2', 'Array(3)': 'vec3', 'Array(4)': 'vec4', 'Matrix(2)': 'mat2', 'Matrix(3)': 'mat3', 'Matrix(4)': 'mat4', - 'Array2D': 'sampler2D', - 'Array3D': 'sampler2D', - 'Boolean': 'bool', - 'Float': 'float', - 'Input': 'sampler2D', - 'Integer': 'int', - 'Number': 'float', - 'LiteralInteger': 'float', - 'NumberTexture': 'sampler2D', - 'MemoryOptimizedNumberTexture': 'sampler2D', + Array2D: 'sampler2D', + Array3D: 'sampler2D', + Boolean: 'bool', + Float: 'float', + Input: 'sampler2D', + Integer: 'int', + Number: 'float', + LiteralInteger: 'float', + NumberTexture: 'sampler2D', + MemoryOptimizedNumberTexture: 'sampler2D', 'ArrayTexture(1)': 'sampler2D', 'ArrayTexture(2)': 'sampler2D', 'ArrayTexture(3)': 'sampler2D', 'ArrayTexture(4)': 'sampler2D', - 'HTMLVideo': 'sampler2D', - 'HTMLCanvas': 'sampler2D', - 'OffscreenCanvas': 'sampler2D', - 'HTMLImage': 'sampler2D', - 'ImageBitmap': 'sampler2D', - 'ImageData': 'sampler2D', - 'HTMLImageArray': 'sampler2DArray', + HTMLVideo: 'sampler2D', + HTMLCanvas: 'sampler2D', + OffscreenCanvas: 'sampler2D', + HTMLImage: 'sampler2D', + ImageBitmap: 'sampler2D', + ImageData: 'sampler2D', + HTMLImageArray: 'sampler2DArray', }; const operatorMap = { '===': '==', - '!==': '!=' -}; \ No newline at end of file + '!==': '!=', +}; diff --git a/src/backend/web-gl/kernel-value-maps.js b/src/backend/web-gl/kernel-value-maps.js index 78e016a9..66b9ca3d 100644 --- a/src/backend/web-gl/kernel-value-maps.js +++ b/src/backend/web-gl/kernel-value-maps.js @@ -42,10 +42,10 @@ import { WebGLKernelValueDynamicUnsignedArray } from './kernel-value/dynamic-uns export const kernelValueMaps = { unsigned: { dynamic: { - 'Boolean': WebGLKernelValueBoolean, - 'Integer': WebGLKernelValueInteger, - 'Float': WebGLKernelValueFloat, - 'Array': WebGLKernelValueDynamicUnsignedArray, + Boolean: WebGLKernelValueBoolean, + Integer: WebGLKernelValueInteger, + Float: WebGLKernelValueFloat, + Array: WebGLKernelValueDynamicUnsignedArray, 'Array(2)': WebGLKernelValueArray2, 'Array(3)': WebGLKernelValueArray3, 'Array(4)': WebGLKernelValueArray4, @@ -58,26 +58,26 @@ export const kernelValueMaps = { 'Array3D(2)': false, 'Array3D(3)': false, 'Array3D(4)': false, - 'Input': WebGLKernelValueDynamicUnsignedInput, - 'NumberTexture': WebGLKernelValueDynamicNumberTexture, + Input: WebGLKernelValueDynamicUnsignedInput, + NumberTexture: WebGLKernelValueDynamicNumberTexture, 'ArrayTexture(1)': WebGLKernelValueDynamicNumberTexture, 'ArrayTexture(2)': WebGLKernelValueDynamicNumberTexture, 'ArrayTexture(3)': WebGLKernelValueDynamicNumberTexture, 'ArrayTexture(4)': WebGLKernelValueDynamicNumberTexture, - 'MemoryOptimizedNumberTexture': WebGLKernelValueDynamicMemoryOptimizedNumberTexture, - 'HTMLCanvas': WebGLKernelValueDynamicHTMLImage, - 'OffscreenCanvas': WebGLKernelValueDynamicHTMLImage, - 'HTMLImage': WebGLKernelValueDynamicHTMLImage, - 'ImageBitmap': WebGLKernelValueDynamicHTMLImage, - 'ImageData': WebGLKernelValueDynamicHTMLImage, - 'HTMLImageArray': false, - 'HTMLVideo': WebGLKernelValueDynamicHTMLVideo, + MemoryOptimizedNumberTexture: WebGLKernelValueDynamicMemoryOptimizedNumberTexture, + HTMLCanvas: WebGLKernelValueDynamicHTMLImage, + OffscreenCanvas: WebGLKernelValueDynamicHTMLImage, + HTMLImage: WebGLKernelValueDynamicHTMLImage, + ImageBitmap: WebGLKernelValueDynamicHTMLImage, + ImageData: WebGLKernelValueDynamicHTMLImage, + HTMLImageArray: false, + HTMLVideo: WebGLKernelValueDynamicHTMLVideo, }, static: { - 'Boolean': WebGLKernelValueBoolean, - 'Float': WebGLKernelValueFloat, - 'Integer': WebGLKernelValueInteger, - 'Array': WebGLKernelValueUnsignedArray, + Boolean: WebGLKernelValueBoolean, + Float: WebGLKernelValueFloat, + Integer: WebGLKernelValueInteger, + Array: WebGLKernelValueUnsignedArray, 'Array(2)': WebGLKernelValueArray2, 'Array(3)': WebGLKernelValueArray3, 'Array(4)': WebGLKernelValueArray4, @@ -90,28 +90,28 @@ export const kernelValueMaps = { 'Array3D(2)': false, 'Array3D(3)': false, 'Array3D(4)': false, - 'Input': WebGLKernelValueUnsignedInput, - 'NumberTexture': WebGLKernelValueNumberTexture, + Input: WebGLKernelValueUnsignedInput, + NumberTexture: WebGLKernelValueNumberTexture, 'ArrayTexture(1)': WebGLKernelValueNumberTexture, 'ArrayTexture(2)': WebGLKernelValueNumberTexture, 'ArrayTexture(3)': WebGLKernelValueNumberTexture, 'ArrayTexture(4)': WebGLKernelValueNumberTexture, - 'MemoryOptimizedNumberTexture': WebGLKernelValueMemoryOptimizedNumberTexture, - 'HTMLCanvas': WebGLKernelValueHTMLImage, - 'OffscreenCanvas': WebGLKernelValueHTMLImage, - 'HTMLImage': WebGLKernelValueHTMLImage, - 'ImageBitmap': WebGLKernelValueHTMLImage, - 'ImageData': WebGLKernelValueHTMLImage, - 'HTMLImageArray': false, - 'HTMLVideo': WebGLKernelValueHTMLVideo, - } + MemoryOptimizedNumberTexture: WebGLKernelValueMemoryOptimizedNumberTexture, + HTMLCanvas: WebGLKernelValueHTMLImage, + OffscreenCanvas: WebGLKernelValueHTMLImage, + HTMLImage: WebGLKernelValueHTMLImage, + ImageBitmap: WebGLKernelValueHTMLImage, + ImageData: WebGLKernelValueHTMLImage, + HTMLImageArray: false, + HTMLVideo: WebGLKernelValueHTMLVideo, + }, }, single: { dynamic: { - 'Boolean': WebGLKernelValueBoolean, - 'Integer': WebGLKernelValueInteger, - 'Float': WebGLKernelValueFloat, - 'Array': WebGLKernelValueDynamicSingleArray, + Boolean: WebGLKernelValueBoolean, + Integer: WebGLKernelValueInteger, + Float: WebGLKernelValueFloat, + Array: WebGLKernelValueDynamicSingleArray, 'Array(2)': WebGLKernelValueArray2, 'Array(3)': WebGLKernelValueArray3, 'Array(4)': WebGLKernelValueArray4, @@ -124,26 +124,26 @@ export const kernelValueMaps = { 'Array3D(2)': WebGLKernelValueDynamicSingleArray3DI, 'Array3D(3)': WebGLKernelValueDynamicSingleArray3DI, 'Array3D(4)': WebGLKernelValueDynamicSingleArray3DI, - 'Input': WebGLKernelValueDynamicSingleInput, - 'NumberTexture': WebGLKernelValueDynamicNumberTexture, + Input: WebGLKernelValueDynamicSingleInput, + NumberTexture: WebGLKernelValueDynamicNumberTexture, 'ArrayTexture(1)': WebGLKernelValueDynamicNumberTexture, 'ArrayTexture(2)': WebGLKernelValueDynamicNumberTexture, 'ArrayTexture(3)': WebGLKernelValueDynamicNumberTexture, 'ArrayTexture(4)': WebGLKernelValueDynamicNumberTexture, - 'MemoryOptimizedNumberTexture': WebGLKernelValueDynamicMemoryOptimizedNumberTexture, - 'HTMLCanvas': WebGLKernelValueDynamicHTMLImage, - 'OffscreenCanvas': WebGLKernelValueDynamicHTMLImage, - 'HTMLImage': WebGLKernelValueDynamicHTMLImage, - 'ImageBitmap': WebGLKernelValueDynamicHTMLImage, - 'ImageData': WebGLKernelValueDynamicHTMLImage, - 'HTMLImageArray': false, - 'HTMLVideo': WebGLKernelValueDynamicHTMLVideo, + MemoryOptimizedNumberTexture: WebGLKernelValueDynamicMemoryOptimizedNumberTexture, + HTMLCanvas: WebGLKernelValueDynamicHTMLImage, + OffscreenCanvas: WebGLKernelValueDynamicHTMLImage, + HTMLImage: WebGLKernelValueDynamicHTMLImage, + ImageBitmap: WebGLKernelValueDynamicHTMLImage, + ImageData: WebGLKernelValueDynamicHTMLImage, + HTMLImageArray: false, + HTMLVideo: WebGLKernelValueDynamicHTMLVideo, }, static: { - 'Boolean': WebGLKernelValueBoolean, - 'Float': WebGLKernelValueFloat, - 'Integer': WebGLKernelValueInteger, - 'Array': WebGLKernelValueSingleArray, + Boolean: WebGLKernelValueBoolean, + Float: WebGLKernelValueFloat, + Integer: WebGLKernelValueInteger, + Array: WebGLKernelValueSingleArray, 'Array(2)': WebGLKernelValueArray2, 'Array(3)': WebGLKernelValueArray3, 'Array(4)': WebGLKernelValueArray4, @@ -156,21 +156,21 @@ export const kernelValueMaps = { 'Array3D(2)': WebGLKernelValueSingleArray3DI, 'Array3D(3)': WebGLKernelValueSingleArray3DI, 'Array3D(4)': WebGLKernelValueSingleArray3DI, - 'Input': WebGLKernelValueSingleInput, - 'NumberTexture': WebGLKernelValueNumberTexture, + Input: WebGLKernelValueSingleInput, + NumberTexture: WebGLKernelValueNumberTexture, 'ArrayTexture(1)': WebGLKernelValueNumberTexture, 'ArrayTexture(2)': WebGLKernelValueNumberTexture, 'ArrayTexture(3)': WebGLKernelValueNumberTexture, 'ArrayTexture(4)': WebGLKernelValueNumberTexture, - 'MemoryOptimizedNumberTexture': WebGLKernelValueMemoryOptimizedNumberTexture, - 'HTMLCanvas': WebGLKernelValueHTMLImage, - 'OffscreenCanvas': WebGLKernelValueHTMLImage, - 'HTMLImage': WebGLKernelValueHTMLImage, - 'ImageBitmap': WebGLKernelValueHTMLImage, - 'ImageData': WebGLKernelValueHTMLImage, - 'HTMLImageArray': false, - 'HTMLVideo': WebGLKernelValueHTMLVideo, - } + MemoryOptimizedNumberTexture: WebGLKernelValueMemoryOptimizedNumberTexture, + HTMLCanvas: WebGLKernelValueHTMLImage, + OffscreenCanvas: WebGLKernelValueHTMLImage, + HTMLImage: WebGLKernelValueHTMLImage, + ImageBitmap: WebGLKernelValueHTMLImage, + ImageData: WebGLKernelValueHTMLImage, + HTMLImageArray: false, + HTMLVideo: WebGLKernelValueHTMLVideo, + }, }, }; @@ -191,7 +191,7 @@ export function lookupKernelValueType(type, dynamic, precision, value) { if (types[type] === false) { return null; } else if (types[type] === undefined) { - throw new Error(`Could not find a KernelValue for ${ type }`); + throw new Error(`Could not find a KernelValue for ${type}`); } return types[type]; -} \ No newline at end of file +} diff --git a/src/backend/web-gl/kernel-value/array.js b/src/backend/web-gl/kernel-value/array.js index 3c3a2106..7c2b4e66 100644 --- a/src/backend/web-gl/kernel-value/array.js +++ b/src/backend/web-gl/kernel-value/array.js @@ -83,4 +83,4 @@ export class WebGLKernelArray extends WebGLKernelValue { } this.context.deleteTexture(this.texture); } -} \ No newline at end of file +} diff --git a/src/backend/web-gl/kernel-value/array2.js b/src/backend/web-gl/kernel-value/array2.js index 080f56a5..20ed558c 100644 --- a/src/backend/web-gl/kernel-value/array2.js +++ b/src/backend/web-gl/kernel-value/array2.js @@ -20,6 +20,6 @@ export class WebGLKernelValueArray2 extends WebGLKernelValue { updateValue(value) { if (this.origin === 'constants') return; - this.kernel.setUniform2fv(this.id, this.uploadValue = value); + this.kernel.setUniform2fv(this.id, (this.uploadValue = value)); } -} \ No newline at end of file +} diff --git a/src/backend/web-gl/kernel-value/array3.js b/src/backend/web-gl/kernel-value/array3.js index ebc06e30..346e2d3a 100644 --- a/src/backend/web-gl/kernel-value/array3.js +++ b/src/backend/web-gl/kernel-value/array3.js @@ -20,6 +20,6 @@ export class WebGLKernelValueArray3 extends WebGLKernelValue { updateValue(value) { if (this.origin === 'constants') return; - this.kernel.setUniform3fv(this.id, this.uploadValue = value); + this.kernel.setUniform3fv(this.id, (this.uploadValue = value)); } -} \ No newline at end of file +} diff --git a/src/backend/web-gl/kernel-value/array4.js b/src/backend/web-gl/kernel-value/array4.js index 83cef99e..0ae91897 100644 --- a/src/backend/web-gl/kernel-value/array4.js +++ b/src/backend/web-gl/kernel-value/array4.js @@ -20,6 +20,6 @@ export class WebGLKernelValueArray4 extends WebGLKernelValue { updateValue(value) { if (this.origin === 'constants') return; - this.kernel.setUniform4fv(this.id, this.uploadValue = value); + this.kernel.setUniform4fv(this.id, (this.uploadValue = value)); } -} \ No newline at end of file +} diff --git a/src/backend/web-gl/kernel-value/boolean.js b/src/backend/web-gl/kernel-value/boolean.js index 5f05fbd1..3c487b01 100644 --- a/src/backend/web-gl/kernel-value/boolean.js +++ b/src/backend/web-gl/kernel-value/boolean.js @@ -18,6 +18,6 @@ export class WebGLKernelValueBoolean extends WebGLKernelValue { updateValue(value) { if (this.origin === 'constants') return; - this.kernel.setUniform1i(this.id, this.uploadValue = value); + this.kernel.setUniform1i(this.id, (this.uploadValue = value)); } -} \ No newline at end of file +} diff --git a/src/backend/web-gl/kernel-value/dynamic-html-image.js b/src/backend/web-gl/kernel-value/dynamic-html-image.js index 8a1e0189..47bdd870 100644 --- a/src/backend/web-gl/kernel-value/dynamic-html-image.js +++ b/src/backend/web-gl/kernel-value/dynamic-html-image.js @@ -3,11 +3,7 @@ import { WebGLKernelValueHTMLImage } from './html-image'; export class WebGLKernelValueDynamicHTMLImage extends WebGLKernelValueHTMLImage { getSource() { - return utils.linesToString([ - `uniform sampler2D ${this.id}`, - `uniform ivec2 ${this.sizeId}`, - `uniform ivec3 ${this.dimensionsId}`, - ]); + return utils.linesToString([`uniform sampler2D ${this.id}`, `uniform ivec2 ${this.sizeId}`, `uniform ivec3 ${this.dimensionsId}`]); } updateValue(value) { @@ -19,4 +15,4 @@ export class WebGLKernelValueDynamicHTMLImage extends WebGLKernelValueHTMLImage this.kernel.setUniform2iv(this.sizeId, this.textureSize); super.updateValue(value); } -} \ No newline at end of file +} diff --git a/src/backend/web-gl/kernel-value/dynamic-html-video.js b/src/backend/web-gl/kernel-value/dynamic-html-video.js index 7f9b7f3d..2a8e1b0f 100644 --- a/src/backend/web-gl/kernel-value/dynamic-html-video.js +++ b/src/backend/web-gl/kernel-value/dynamic-html-video.js @@ -1,3 +1,3 @@ import { WebGLKernelValueDynamicHTMLImage } from './dynamic-html-image'; -export class WebGLKernelValueDynamicHTMLVideo extends WebGLKernelValueDynamicHTMLImage {} \ No newline at end of file +export class WebGLKernelValueDynamicHTMLVideo extends WebGLKernelValueDynamicHTMLImage {} diff --git a/src/backend/web-gl/kernel-value/dynamic-memory-optimized-number-texture.js b/src/backend/web-gl/kernel-value/dynamic-memory-optimized-number-texture.js index 6a51c334..ca7f0252 100644 --- a/src/backend/web-gl/kernel-value/dynamic-memory-optimized-number-texture.js +++ b/src/backend/web-gl/kernel-value/dynamic-memory-optimized-number-texture.js @@ -3,11 +3,7 @@ import { WebGLKernelValueMemoryOptimizedNumberTexture } from './memory-optimized export class WebGLKernelValueDynamicMemoryOptimizedNumberTexture extends WebGLKernelValueMemoryOptimizedNumberTexture { getSource() { - return utils.linesToString([ - `uniform sampler2D ${this.id}`, - `uniform ivec2 ${this.sizeId}`, - `uniform ivec3 ${this.dimensionsId}`, - ]); + return utils.linesToString([`uniform sampler2D ${this.id}`, `uniform ivec2 ${this.sizeId}`, `uniform ivec3 ${this.dimensionsId}`]); } updateValue(inputTexture) { @@ -18,4 +14,4 @@ export class WebGLKernelValueDynamicMemoryOptimizedNumberTexture extends WebGLKe this.kernel.setUniform2iv(this.sizeId, this.textureSize); super.updateValue(inputTexture); } -} \ No newline at end of file +} diff --git a/src/backend/web-gl/kernel-value/dynamic-number-texture.js b/src/backend/web-gl/kernel-value/dynamic-number-texture.js index f5e8cd9f..047ed53a 100644 --- a/src/backend/web-gl/kernel-value/dynamic-number-texture.js +++ b/src/backend/web-gl/kernel-value/dynamic-number-texture.js @@ -3,11 +3,7 @@ import { WebGLKernelValueNumberTexture } from './number-texture'; export class WebGLKernelValueDynamicNumberTexture extends WebGLKernelValueNumberTexture { getSource() { - return utils.linesToString([ - `uniform sampler2D ${this.id}`, - `uniform ivec2 ${this.sizeId}`, - `uniform ivec3 ${this.dimensionsId}`, - ]); + return utils.linesToString([`uniform sampler2D ${this.id}`, `uniform ivec2 ${this.sizeId}`, `uniform ivec3 ${this.dimensionsId}`]); } updateValue(value) { @@ -18,4 +14,4 @@ export class WebGLKernelValueDynamicNumberTexture extends WebGLKernelValueNumber this.kernel.setUniform2iv(this.sizeId, this.textureSize); super.updateValue(value); } -} \ No newline at end of file +} diff --git a/src/backend/web-gl/kernel-value/dynamic-single-array.js b/src/backend/web-gl/kernel-value/dynamic-single-array.js index dffdd077..41abba36 100644 --- a/src/backend/web-gl/kernel-value/dynamic-single-array.js +++ b/src/backend/web-gl/kernel-value/dynamic-single-array.js @@ -3,11 +3,7 @@ import { WebGLKernelValueSingleArray } from './single-array'; export class WebGLKernelValueDynamicSingleArray extends WebGLKernelValueSingleArray { getSource() { - return utils.linesToString([ - `uniform sampler2D ${this.id}`, - `uniform ivec2 ${this.sizeId}`, - `uniform ivec3 ${this.dimensionsId}`, - ]); + return utils.linesToString([`uniform sampler2D ${this.id}`, `uniform ivec2 ${this.sizeId}`, `uniform ivec3 ${this.dimensionsId}`]); } updateValue(value) { @@ -20,4 +16,4 @@ export class WebGLKernelValueDynamicSingleArray extends WebGLKernelValueSingleAr this.kernel.setUniform2iv(this.sizeId, this.textureSize); super.updateValue(value); } -} \ No newline at end of file +} diff --git a/src/backend/web-gl/kernel-value/dynamic-single-array1d-i.js b/src/backend/web-gl/kernel-value/dynamic-single-array1d-i.js index b3ebb370..d05ff219 100644 --- a/src/backend/web-gl/kernel-value/dynamic-single-array1d-i.js +++ b/src/backend/web-gl/kernel-value/dynamic-single-array1d-i.js @@ -3,11 +3,7 @@ import { WebGLKernelValueSingleArray1DI } from './single-array1d-i'; export class WebGLKernelValueDynamicSingleArray1DI extends WebGLKernelValueSingleArray1DI { getSource() { - return utils.linesToString([ - `uniform sampler2D ${this.id}`, - `uniform ivec2 ${this.sizeId}`, - `uniform ivec3 ${this.dimensionsId}`, - ]); + return utils.linesToString([`uniform sampler2D ${this.id}`, `uniform ivec2 ${this.sizeId}`, `uniform ivec3 ${this.dimensionsId}`]); } updateValue(value) { @@ -16,4 +12,4 @@ export class WebGLKernelValueDynamicSingleArray1DI extends WebGLKernelValueSingl this.kernel.setUniform2iv(this.sizeId, this.textureSize); super.updateValue(value); } -} \ No newline at end of file +} diff --git a/src/backend/web-gl/kernel-value/dynamic-single-array2d-i.js b/src/backend/web-gl/kernel-value/dynamic-single-array2d-i.js index 4a72d0a7..d47e31a8 100644 --- a/src/backend/web-gl/kernel-value/dynamic-single-array2d-i.js +++ b/src/backend/web-gl/kernel-value/dynamic-single-array2d-i.js @@ -3,11 +3,7 @@ import { WebGLKernelValueSingleArray2DI } from './single-array2d-i'; export class WebGLKernelValueDynamicSingleArray2DI extends WebGLKernelValueSingleArray2DI { getSource() { - return utils.linesToString([ - `uniform sampler2D ${this.id}`, - `uniform ivec2 ${this.sizeId}`, - `uniform ivec3 ${this.dimensionsId}`, - ]); + return utils.linesToString([`uniform sampler2D ${this.id}`, `uniform ivec2 ${this.sizeId}`, `uniform ivec3 ${this.dimensionsId}`]); } updateValue(value) { @@ -16,4 +12,4 @@ export class WebGLKernelValueDynamicSingleArray2DI extends WebGLKernelValueSingl this.kernel.setUniform2iv(this.sizeId, this.textureSize); super.updateValue(value); } -} \ No newline at end of file +} diff --git a/src/backend/web-gl/kernel-value/dynamic-single-array3d-i.js b/src/backend/web-gl/kernel-value/dynamic-single-array3d-i.js index 6d7bcfd6..aa358d32 100644 --- a/src/backend/web-gl/kernel-value/dynamic-single-array3d-i.js +++ b/src/backend/web-gl/kernel-value/dynamic-single-array3d-i.js @@ -3,11 +3,7 @@ import { WebGLKernelValueSingleArray3DI } from './single-array3d-i'; export class WebGLKernelValueDynamicSingleArray3DI extends WebGLKernelValueSingleArray3DI { getSource() { - return utils.linesToString([ - `uniform sampler2D ${this.id}`, - `uniform ivec2 ${this.sizeId}`, - `uniform ivec3 ${this.dimensionsId}`, - ]); + return utils.linesToString([`uniform sampler2D ${this.id}`, `uniform ivec2 ${this.sizeId}`, `uniform ivec3 ${this.dimensionsId}`]); } updateValue(value) { @@ -16,4 +12,4 @@ export class WebGLKernelValueDynamicSingleArray3DI extends WebGLKernelValueSingl this.kernel.setUniform2iv(this.sizeId, this.textureSize); super.updateValue(value); } -} \ No newline at end of file +} diff --git a/src/backend/web-gl/kernel-value/dynamic-single-input.js b/src/backend/web-gl/kernel-value/dynamic-single-input.js index beefa23a..26767940 100644 --- a/src/backend/web-gl/kernel-value/dynamic-single-input.js +++ b/src/backend/web-gl/kernel-value/dynamic-single-input.js @@ -3,11 +3,7 @@ import { WebGLKernelValueSingleInput } from './single-input'; export class WebGLKernelValueDynamicSingleInput extends WebGLKernelValueSingleInput { getSource() { - return utils.linesToString([ - `uniform sampler2D ${this.id}`, - `uniform ivec2 ${this.sizeId}`, - `uniform ivec3 ${this.dimensionsId}`, - ]); + return utils.linesToString([`uniform sampler2D ${this.id}`, `uniform ivec2 ${this.sizeId}`, `uniform ivec3 ${this.dimensionsId}`]); } updateValue(value) { @@ -21,4 +17,4 @@ export class WebGLKernelValueDynamicSingleInput extends WebGLKernelValueSingleIn this.kernel.setUniform2iv(this.sizeId, this.textureSize); super.updateValue(value); } -} \ No newline at end of file +} diff --git a/src/backend/web-gl/kernel-value/dynamic-unsigned-array.js b/src/backend/web-gl/kernel-value/dynamic-unsigned-array.js index 25a23232..febe30de 100644 --- a/src/backend/web-gl/kernel-value/dynamic-unsigned-array.js +++ b/src/backend/web-gl/kernel-value/dynamic-unsigned-array.js @@ -3,11 +3,7 @@ import { WebGLKernelValueUnsignedArray } from './unsigned-array'; export class WebGLKernelValueDynamicUnsignedArray extends WebGLKernelValueUnsignedArray { getSource() { - return utils.linesToString([ - `uniform sampler2D ${this.id}`, - `uniform ivec2 ${this.sizeId}`, - `uniform ivec3 ${this.dimensionsId}`, - ]); + return utils.linesToString([`uniform sampler2D ${this.id}`, `uniform ivec2 ${this.sizeId}`, `uniform ivec3 ${this.dimensionsId}`]); } updateValue(value) { @@ -22,4 +18,4 @@ export class WebGLKernelValueDynamicUnsignedArray extends WebGLKernelValueUnsign this.kernel.setUniform2iv(this.sizeId, this.textureSize); super.updateValue(value); } -} \ No newline at end of file +} diff --git a/src/backend/web-gl/kernel-value/dynamic-unsigned-input.js b/src/backend/web-gl/kernel-value/dynamic-unsigned-input.js index 8d2d266e..6cc36c50 100644 --- a/src/backend/web-gl/kernel-value/dynamic-unsigned-input.js +++ b/src/backend/web-gl/kernel-value/dynamic-unsigned-input.js @@ -3,11 +3,7 @@ import { WebGLKernelValueUnsignedInput } from './unsigned-input'; export class WebGLKernelValueDynamicUnsignedInput extends WebGLKernelValueUnsignedInput { getSource() { - return utils.linesToString([ - `uniform sampler2D ${this.id}`, - `uniform ivec2 ${this.sizeId}`, - `uniform ivec3 ${this.dimensionsId}`, - ]); + return utils.linesToString([`uniform sampler2D ${this.id}`, `uniform ivec2 ${this.sizeId}`, `uniform ivec3 ${this.dimensionsId}`]); } updateValue(value) { @@ -23,4 +19,4 @@ export class WebGLKernelValueDynamicUnsignedInput extends WebGLKernelValueUnsign this.kernel.setUniform2iv(this.sizeId, this.textureSize); super.updateValue(value); } -} \ No newline at end of file +} diff --git a/src/backend/web-gl/kernel-value/float.js b/src/backend/web-gl/kernel-value/float.js index 99908556..6591c1b4 100644 --- a/src/backend/web-gl/kernel-value/float.js +++ b/src/backend/web-gl/kernel-value/float.js @@ -21,6 +21,6 @@ export class WebGLKernelValueFloat extends WebGLKernelValue { updateValue(value) { if (this.origin === 'constants') return; - this.kernel.setUniform1f(this.id, this.uploadValue = value); + this.kernel.setUniform1f(this.id, (this.uploadValue = value)); } -} \ No newline at end of file +} diff --git a/src/backend/web-gl/kernel-value/html-image.js b/src/backend/web-gl/kernel-value/html-image.js index 6aad2a85..9777d34b 100644 --- a/src/backend/web-gl/kernel-value/html-image.js +++ b/src/backend/web-gl/kernel-value/html-image.js @@ -16,11 +16,7 @@ export class WebGLKernelValueHTMLImage extends WebGLKernelArray { } getSource() { - return utils.linesToString([ - `uniform sampler2D ${this.id}`, - `ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`, - `ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`, - ]); + return utils.linesToString([`uniform sampler2D ${this.id}`, `ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`, `ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`]); } updateValue(inputImage) { @@ -32,7 +28,7 @@ export class WebGLKernelValueHTMLImage extends WebGLKernelArray { gl.activeTexture(this.contextHandle); gl.bindTexture(gl.TEXTURE_2D, this.texture); gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true); - gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, this.uploadValue = inputImage); + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, (this.uploadValue = inputImage)); this.kernel.setUniform1i(this.id, this.index); } -} \ No newline at end of file +} diff --git a/src/backend/web-gl/kernel-value/html-video.js b/src/backend/web-gl/kernel-value/html-video.js index 050c19e6..f6febe4e 100644 --- a/src/backend/web-gl/kernel-value/html-video.js +++ b/src/backend/web-gl/kernel-value/html-video.js @@ -1,3 +1,3 @@ import { WebGLKernelValueHTMLImage } from './html-image'; -export class WebGLKernelValueHTMLVideo extends WebGLKernelValueHTMLImage {} \ No newline at end of file +export class WebGLKernelValueHTMLVideo extends WebGLKernelValueHTMLImage {} diff --git a/src/backend/web-gl/kernel-value/index.js b/src/backend/web-gl/kernel-value/index.js index 28a4afa6..c9ca7945 100644 --- a/src/backend/web-gl/kernel-value/index.js +++ b/src/backend/web-gl/kernel-value/index.js @@ -59,4 +59,4 @@ export class WebGLKernelValue extends KernelValue { } destroy() {} -} \ No newline at end of file +} diff --git a/src/backend/web-gl/kernel-value/integer.js b/src/backend/web-gl/kernel-value/integer.js index 925c2cbe..3c75cad3 100644 --- a/src/backend/web-gl/kernel-value/integer.js +++ b/src/backend/web-gl/kernel-value/integer.js @@ -10,13 +10,13 @@ export class WebGLKernelValueInteger extends WebGLKernelValue { } getSource(value) { if (this.origin === 'constants') { - return `const int ${this.id} = ${ parseInt(value) };\n`; + return `const int ${this.id} = ${parseInt(value)};\n`; } return `uniform int ${this.id};\n`; } updateValue(value) { if (this.origin === 'constants') return; - this.kernel.setUniform1i(this.id, this.uploadValue = value); + this.kernel.setUniform1i(this.id, (this.uploadValue = value)); } -} \ No newline at end of file +} diff --git a/src/backend/web-gl/kernel-value/memory-optimized-number-texture.js b/src/backend/web-gl/kernel-value/memory-optimized-number-texture.js index de17b87e..84f615b1 100644 --- a/src/backend/web-gl/kernel-value/memory-optimized-number-texture.js +++ b/src/backend/web-gl/kernel-value/memory-optimized-number-texture.js @@ -23,11 +23,7 @@ export class WebGLKernelValueMemoryOptimizedNumberTexture extends WebGLKernelArr } getSource() { - return utils.linesToString([ - `uniform sampler2D ${this.id}`, - `ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`, - `ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`, - ]); + return utils.linesToString([`uniform sampler2D ${this.id}`, `ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`, `ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`]); } /** @@ -61,7 +57,7 @@ export class WebGLKernelValueMemoryOptimizedNumberTexture extends WebGLKernelArr } gl.activeTexture(this.contextHandle); - gl.bindTexture(gl.TEXTURE_2D, this.uploadValue = inputTexture.texture); + gl.bindTexture(gl.TEXTURE_2D, (this.uploadValue = inputTexture.texture)); this.kernel.setUniform1i(this.id, this.index); } -} \ No newline at end of file +} diff --git a/src/backend/web-gl/kernel-value/number-texture.js b/src/backend/web-gl/kernel-value/number-texture.js index c7c55468..5eded24a 100644 --- a/src/backend/web-gl/kernel-value/number-texture.js +++ b/src/backend/web-gl/kernel-value/number-texture.js @@ -24,11 +24,7 @@ export class WebGLKernelValueNumberTexture extends WebGLKernelArray { } getSource() { - return utils.linesToString([ - `uniform sampler2D ${this.id}`, - `ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`, - `ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`, - ]); + return utils.linesToString([`uniform sampler2D ${this.id}`, `ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`, `ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`]); } /** @@ -63,7 +59,7 @@ export class WebGLKernelValueNumberTexture extends WebGLKernelArray { } gl.activeTexture(this.contextHandle); - gl.bindTexture(gl.TEXTURE_2D, this.uploadValue = inputTexture.texture); + gl.bindTexture(gl.TEXTURE_2D, (this.uploadValue = inputTexture.texture)); this.kernel.setUniform1i(this.id, this.index); } -} \ No newline at end of file +} diff --git a/src/backend/web-gl/kernel-value/single-array.js b/src/backend/web-gl/kernel-value/single-array.js index a7a29bb0..ec4c985c 100644 --- a/src/backend/web-gl/kernel-value/single-array.js +++ b/src/backend/web-gl/kernel-value/single-array.js @@ -13,18 +13,11 @@ export class WebGLKernelValueSingleArray extends WebGLKernelArray { } getStringValueHandler() { - return utils.linesToString([ - `const uploadValue_${this.name} = new Float32Array(${this.uploadArrayLength})`, - `flattenTo(${this.varName}, uploadValue_${this.name})`, - ]); + return utils.linesToString([`const uploadValue_${this.name} = new Float32Array(${this.uploadArrayLength})`, `flattenTo(${this.varName}, uploadValue_${this.name})`]); } getSource() { - return utils.linesToString([ - `uniform sampler2D ${this.id}`, - `ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`, - `ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`, - ]); + return utils.linesToString([`uniform sampler2D ${this.id}`, `ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`, `ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`]); } updateValue(value) { @@ -40,4 +33,4 @@ export class WebGLKernelValueSingleArray extends WebGLKernelArray { gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, this.textureSize[0], this.textureSize[1], 0, gl.RGBA, gl.FLOAT, this.uploadValue); this.kernel.setUniform1i(this.id, this.index); } -} \ No newline at end of file +} diff --git a/src/backend/web-gl/kernel-value/single-array1d-i.js b/src/backend/web-gl/kernel-value/single-array1d-i.js index 9c89e24f..12518d0e 100644 --- a/src/backend/web-gl/kernel-value/single-array1d-i.js +++ b/src/backend/web-gl/kernel-value/single-array1d-i.js @@ -18,18 +18,11 @@ export class WebGLKernelValueSingleArray1DI extends WebGLKernelArray { } getStringValueHandler() { - return utils.linesToString([ - `const uploadValue_${this.name} = new Float32Array(${this.uploadArrayLength})`, - `flattenTo(${this.varName}, uploadValue_${this.name})`, - ]); + return utils.linesToString([`const uploadValue_${this.name} = new Float32Array(${this.uploadArrayLength})`, `flattenTo(${this.varName}, uploadValue_${this.name})`]); } getSource() { - return utils.linesToString([ - `uniform sampler2D ${this.id}`, - `ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`, - `ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`, - ]); + return utils.linesToString([`uniform sampler2D ${this.id}`, `ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`, `ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`]); } updateValue(value) { @@ -45,4 +38,4 @@ export class WebGLKernelValueSingleArray1DI extends WebGLKernelArray { gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, this.textureSize[0], this.textureSize[1], 0, gl.RGBA, gl.FLOAT, this.uploadValue); this.kernel.setUniform1i(this.id, this.index); } -} \ No newline at end of file +} diff --git a/src/backend/web-gl/kernel-value/single-array2d-i.js b/src/backend/web-gl/kernel-value/single-array2d-i.js index 2a28861f..20b24bf3 100644 --- a/src/backend/web-gl/kernel-value/single-array2d-i.js +++ b/src/backend/web-gl/kernel-value/single-array2d-i.js @@ -18,18 +18,11 @@ export class WebGLKernelValueSingleArray2DI extends WebGLKernelArray { } getStringValueHandler() { - return utils.linesToString([ - `const uploadValue_${this.name} = new Float32Array(${this.uploadArrayLength})`, - `flattenTo(${this.varName}, uploadValue_${this.name})`, - ]); + return utils.linesToString([`const uploadValue_${this.name} = new Float32Array(${this.uploadArrayLength})`, `flattenTo(${this.varName}, uploadValue_${this.name})`]); } getSource() { - return utils.linesToString([ - `uniform sampler2D ${this.id}`, - `ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`, - `ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`, - ]); + return utils.linesToString([`uniform sampler2D ${this.id}`, `ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`, `ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`]); } updateValue(value) { @@ -45,4 +38,4 @@ export class WebGLKernelValueSingleArray2DI extends WebGLKernelArray { gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, this.textureSize[0], this.textureSize[1], 0, gl.RGBA, gl.FLOAT, this.uploadValue); this.kernel.setUniform1i(this.id, this.index); } -} \ No newline at end of file +} diff --git a/src/backend/web-gl/kernel-value/single-array3d-i.js b/src/backend/web-gl/kernel-value/single-array3d-i.js index 13b721bf..b6b0a4ce 100644 --- a/src/backend/web-gl/kernel-value/single-array3d-i.js +++ b/src/backend/web-gl/kernel-value/single-array3d-i.js @@ -18,18 +18,11 @@ export class WebGLKernelValueSingleArray3DI extends WebGLKernelArray { } getStringValueHandler() { - return utils.linesToString([ - `const uploadValue_${this.name} = new Float32Array(${this.uploadArrayLength})`, - `flattenTo(${this.varName}, uploadValue_${this.name})`, - ]); + return utils.linesToString([`const uploadValue_${this.name} = new Float32Array(${this.uploadArrayLength})`, `flattenTo(${this.varName}, uploadValue_${this.name})`]); } getSource() { - return utils.linesToString([ - `uniform sampler2D ${this.id}`, - `ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`, - `ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`, - ]); + return utils.linesToString([`uniform sampler2D ${this.id}`, `ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`, `ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`]); } updateValue(value) { @@ -45,4 +38,4 @@ export class WebGLKernelValueSingleArray3DI extends WebGLKernelArray { gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, this.textureSize[0], this.textureSize[1], 0, gl.RGBA, gl.FLOAT, this.uploadValue); this.kernel.setUniform1i(this.id, this.index); } -} \ No newline at end of file +} diff --git a/src/backend/web-gl/kernel-value/single-input.js b/src/backend/web-gl/kernel-value/single-input.js index 00c794fc..18e0c4ee 100644 --- a/src/backend/web-gl/kernel-value/single-input.js +++ b/src/backend/web-gl/kernel-value/single-input.js @@ -14,18 +14,11 @@ export class WebGLKernelValueSingleInput extends WebGLKernelArray { } getStringValueHandler() { - return utils.linesToString([ - `const uploadValue_${this.name} = new Float32Array(${this.uploadArrayLength})`, - `flattenTo(${this.varName}.value, uploadValue_${this.name})`, - ]); + return utils.linesToString([`const uploadValue_${this.name} = new Float32Array(${this.uploadArrayLength})`, `flattenTo(${this.varName}.value, uploadValue_${this.name})`]); } getSource() { - return utils.linesToString([ - `uniform sampler2D ${this.id}`, - `ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`, - `ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`, - ]); + return utils.linesToString([`uniform sampler2D ${this.id}`, `ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`, `ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`]); } updateValue(input) { @@ -41,4 +34,4 @@ export class WebGLKernelValueSingleInput extends WebGLKernelArray { gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, this.textureSize[0], this.textureSize[1], 0, gl.RGBA, gl.FLOAT, this.uploadValue); this.kernel.setUniform1i(this.id, this.index); } -} \ No newline at end of file +} diff --git a/src/backend/web-gl/kernel-value/unsigned-array.js b/src/backend/web-gl/kernel-value/unsigned-array.js index 42b83f6a..8c1158e0 100644 --- a/src/backend/web-gl/kernel-value/unsigned-array.js +++ b/src/backend/web-gl/kernel-value/unsigned-array.js @@ -15,19 +15,11 @@ export class WebGLKernelValueUnsignedArray extends WebGLKernelArray { } getStringValueHandler() { - return utils.linesToString([ - `const preUploadValue_${this.name} = new ${this.TranserArrayType.name}(${this.uploadArrayLength})`, - `const uploadValue_${this.name} = new Uint8Array(preUploadValue_${this.name}.buffer)`, - `flattenTo(${this.varName}, preUploadValue_${this.name})`, - ]); + return utils.linesToString([`const preUploadValue_${this.name} = new ${this.TranserArrayType.name}(${this.uploadArrayLength})`, `const uploadValue_${this.name} = new Uint8Array(preUploadValue_${this.name}.buffer)`, `flattenTo(${this.varName}, preUploadValue_${this.name})`]); } getSource() { - return utils.linesToString([ - `uniform sampler2D ${this.id}`, - `ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`, - `ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`, - ]); + return utils.linesToString([`uniform sampler2D ${this.id}`, `ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`, `ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`]); } updateValue(value) { @@ -43,4 +35,4 @@ export class WebGLKernelValueUnsignedArray extends WebGLKernelArray { gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, this.textureSize[0], this.textureSize[1], 0, gl.RGBA, gl.UNSIGNED_BYTE, this.uploadValue); this.kernel.setUniform1i(this.id, this.index); } -} \ No newline at end of file +} diff --git a/src/backend/web-gl/kernel-value/unsigned-input.js b/src/backend/web-gl/kernel-value/unsigned-input.js index 100ffe40..8a9eaa62 100644 --- a/src/backend/web-gl/kernel-value/unsigned-input.js +++ b/src/backend/web-gl/kernel-value/unsigned-input.js @@ -16,19 +16,11 @@ export class WebGLKernelValueUnsignedInput extends WebGLKernelArray { } getStringValueHandler() { - return utils.linesToString([ - `const preUploadValue_${this.name} = new ${this.TranserArrayType.name}(${this.uploadArrayLength})`, - `const uploadValue_${this.name} = new Uint8Array(preUploadValue_${this.name}.buffer)`, - `flattenTo(${this.varName}.value, preUploadValue_${this.name})`, - ]); + return utils.linesToString([`const preUploadValue_${this.name} = new ${this.TranserArrayType.name}(${this.uploadArrayLength})`, `const uploadValue_${this.name} = new Uint8Array(preUploadValue_${this.name}.buffer)`, `flattenTo(${this.varName}.value, preUploadValue_${this.name})`]); } getSource() { - return utils.linesToString([ - `uniform sampler2D ${this.id}`, - `ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`, - `ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`, - ]); + return utils.linesToString([`uniform sampler2D ${this.id}`, `ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`, `ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`]); } updateValue(input) { @@ -44,4 +36,4 @@ export class WebGLKernelValueUnsignedInput extends WebGLKernelArray { gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, this.textureSize[0], this.textureSize[1], 0, gl.RGBA, gl.UNSIGNED_BYTE, this.uploadValue); this.kernel.setUniform1i(this.id, this.index); } -} \ No newline at end of file +} diff --git a/src/backend/web-gl/kernel.js b/src/backend/web-gl/kernel.js index 1468df4a..b12993d4 100644 --- a/src/backend/web-gl/kernel.js +++ b/src/backend/web-gl/kernel.js @@ -26,7 +26,6 @@ const plugins = [mrud]; const canvases = []; const maxTexSizes = {}; - /** * @desc Kernel Implementation for WebGL. *

This builds the shaders and runs them on the GPU, @@ -89,9 +88,7 @@ export class WebGLKernel extends GLKernel { } static getChannelCount() { - return testExtensions.WEBGL_draw_buffers ? - testContext.getParameter(testExtensions.WEBGL_draw_buffers.MAX_DRAW_BUFFERS_WEBGL) : - 1; + return testExtensions.WEBGL_draw_buffers ? testContext.getParameter(testExtensions.WEBGL_draw_buffers.MAX_DRAW_BUFFERS_WEBGL) : 1; } static getMaxTextureSize() { @@ -199,7 +196,7 @@ export class WebGLKernel extends GLKernel { const settings = { alpha: false, depth: false, - antialias: false + antialias: false, }; return this.canvas.getContext('webgl', settings) || this.canvas.getContext('experimental-webgl', settings); } @@ -222,7 +219,8 @@ export class WebGLKernel extends GLKernel { } } else if (typeof source === 'object') { // `source` is from object, json - if (settings.pluginNames) { //TODO: in context of JSON support, pluginNames may not exist here + if (settings.pluginNames) { + //TODO: in context of JSON support, pluginNames may not exist here for (let i = 0; i < plugins.length; i++) { const plugin = plugins[i]; const usePlugin = settings.pluginNames.some(pluginName => pluginName === plugin.name); @@ -251,10 +249,13 @@ export class WebGLKernel extends GLKernel { */ validateSettings(args) { if (!this.validate) { - this.texSize = utils.getKernelTextureSize({ - optimizeFloatMemory: this.optimizeFloatMemory, - precision: this.precision, - }, this.output); + this.texSize = utils.getKernelTextureSize( + { + optimizeFloatMemory: this.optimizeFloatMemory, + precision: this.precision, + }, + this.output + ); return; } @@ -319,10 +320,13 @@ export class WebGLKernel extends GLKernel { this.precision = 'single'; } - this.texSize = utils.getKernelTextureSize({ - optimizeFloatMemory: this.optimizeFloatMemory, - precision: this.precision, - }, this.output); + this.texSize = utils.getKernelTextureSize( + { + optimizeFloatMemory: this.optimizeFloatMemory, + precision: this.precision, + }, + this.output + ); this.checkTextureSize(); } @@ -373,10 +377,10 @@ export class WebGLKernel extends GLKernel { const onRequestIndex = () => { return this.constantTextureCount + textureIndexes++; }; - const onUpdateValueMismatch = (constructor) => { + const onUpdateValueMismatch = constructor => { this.switchKernels({ type: 'argumentMismatch', - needed: constructor + needed: constructor, }); }; const onRequestContextHandle = () => { @@ -464,7 +468,7 @@ export class WebGLKernel extends GLKernel { }, onRequestContextHandle: () => { return gl.TEXTURE0 + this.constantTextureCount++; - } + }, }); this.constantBitRatios[name] = kernelValue.bitRatio; this.kernelConstants.push(kernelValue); @@ -500,7 +504,7 @@ export class WebGLKernel extends GLKernel { canvas.width = this.maxTexSize[0]; canvas.height = this.maxTexSize[1]; } - const threadDim = this.threadDim = Array.from(this.output); + const threadDim = (this.threadDim = Array.from(this.output)); while (threadDim.length < 3) { threadDim.push(1); } @@ -529,7 +533,7 @@ export class WebGLKernel extends GLKernel { throw new Error('Error compiling fragment shader: ' + gl.getShaderInfoLog(fragShader)); } - const program = this.program = gl.createProgram(); + const program = (this.program = gl.createProgram()); gl.attachShader(program, vertShader); gl.attachShader(program, fragShader); gl.linkProgram(program); @@ -538,16 +542,8 @@ export class WebGLKernel extends GLKernel { this.framebuffer.height = texSize[1]; this.rawValueFramebuffers = {}; - const vertices = new Float32Array([-1, -1, - 1, -1, -1, 1, - 1, 1 - ]); - const texCoords = new Float32Array([ - 0, 0, - 1, 0, - 0, 1, - 1, 1 - ]); + const vertices = new Float32Array([-1, -1, 1, -1, -1, 1, 1, 1]); + const texCoords = new Float32Array([0, 0, 1, 0, 0, 1, 1, 1]); const texCoordOffset = vertices.byteLength; @@ -578,10 +574,7 @@ export class WebGLKernel extends GLKernel { } this._setupOutputTexture(); - if ( - this.subKernels !== null && - this.subKernels.length > 0 - ) { + if (this.subKernels !== null && this.subKernels.length > 0) { this._mappedTextureSwitched = {}; this._setupSubOutputTextures(); } @@ -591,7 +584,7 @@ export class WebGLKernel extends GLKernel { translateSource() { const functionBuilder = FunctionBuilder.fromKernel(this, WebGLFunctionNode, { - fixIntegerDivisionAccuracy: this.fixIntegerDivisionAccuracy + fixIntegerDivisionAccuracy: this.fixIntegerDivisionAccuracy, }); this.translatedSource = functionBuilder.getPrototypeString('kernel'); this.setupReturnTypes(functionBuilder); @@ -786,16 +779,18 @@ export class WebGLKernel extends GLKernel { } gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0 + i + 1, gl.TEXTURE_2D, texture, 0); - this.mappedTextures.push(new this.TextureConstructor({ - texture, - size: texSize, - dimensions: this.threadDim, - output: this.output, - context: this.context, - internalFormat: this.getInternalFormat(), - textureFormat: this.getTextureFormat(), - kernel: this, - })); + this.mappedTextures.push( + new this.TextureConstructor({ + texture, + size: texSize, + dimensions: this.threadDim, + output: this.output, + context: this.context, + internalFormat: this.getInternalFormat(), + textureFormat: this.getTextureFormat(), + kernel: this, + }) + ); } } @@ -826,10 +821,7 @@ export class WebGLKernel extends GLKernel { setUniform2f(name, value1, value2) { if (this.uniform2fCache.hasOwnProperty(name)) { const cache = this.uniform2fCache[name]; - if ( - value1 === cache[0] && - value2 === cache[1] - ) { + if (value1 === cache[0] && value2 === cache[1]) { return; } } @@ -841,10 +833,7 @@ export class WebGLKernel extends GLKernel { setUniform2fv(name, value) { if (this.uniform2fvCache.hasOwnProperty(name)) { const cache = this.uniform2fvCache[name]; - if ( - value[0] === cache[0] && - value[1] === cache[1] - ) { + if (value[0] === cache[0] && value[1] === cache[1]) { return; } } @@ -856,10 +845,7 @@ export class WebGLKernel extends GLKernel { setUniform2iv(name, value) { if (this.uniform2ivCache.hasOwnProperty(name)) { const cache = this.uniform2ivCache[name]; - if ( - value[0] === cache[0] && - value[1] === cache[1] - ) { + if (value[0] === cache[0] && value[1] === cache[1]) { return; } } @@ -871,11 +857,7 @@ export class WebGLKernel extends GLKernel { setUniform3fv(name, value) { if (this.uniform3fvCache.hasOwnProperty(name)) { const cache = this.uniform3fvCache[name]; - if ( - value[0] === cache[0] && - value[1] === cache[1] && - value[2] === cache[2] - ) { + if (value[0] === cache[0] && value[1] === cache[1] && value[2] === cache[2]) { return; } } @@ -887,11 +869,7 @@ export class WebGLKernel extends GLKernel { setUniform3iv(name, value) { if (this.uniform3ivCache.hasOwnProperty(name)) { const cache = this.uniform3ivCache[name]; - if ( - value[0] === cache[0] && - value[1] === cache[1] && - value[2] === cache[2] - ) { + if (value[0] === cache[0] && value[1] === cache[1] && value[2] === cache[2]) { return; } } @@ -903,12 +881,7 @@ export class WebGLKernel extends GLKernel { setUniform4fv(name, value) { if (this.uniform4fvCache.hasOwnProperty(name)) { const cache = this.uniform4fvCache[name]; - if ( - value[0] === cache[0] && - value[1] === cache[1] && - value[2] === cache[2] && - value[3] === cache[3] - ) { + if (value[0] === cache[0] && value[1] === cache[1] && value[2] === cache[2] && value[3] === cache[3]) { return; } } @@ -920,12 +893,7 @@ export class WebGLKernel extends GLKernel { setUniform4iv(name, value) { if (this.uniform4ivCache.hasOwnProperty(name)) { const cache = this.uniform4ivCache[name]; - if ( - value[0] === cache[0] && - value[1] === cache[1] && - value[2] === cache[2] && - value[3] === cache[3] - ) { + if (value[0] === cache[0] && value[1] === cache[1] && value[2] === cache[2] && value[3] === cache[3]) { return; } } @@ -943,7 +911,7 @@ export class WebGLKernel extends GLKernel { if (this.programUniformLocationCache.hasOwnProperty(name)) { return this.programUniformLocationCache[name]; } - return this.programUniformLocationCache[name] = this.context.getUniformLocation(this.program, name); + return (this.programUniformLocationCache[name] = this.context.getUniformLocation(this.program, name)); } /** @@ -997,11 +965,7 @@ export class WebGLKernel extends GLKernel { * @returns {String} result */ _getHeaderString() { - return ( - this.subKernels !== null ? - '#extension GL_EXT_draw_buffers : require\n' : - '' - ); + return this.subKernels !== null ? '#extension GL_EXT_draw_buffers : require\n' : ''; } /** @@ -1009,16 +973,12 @@ export class WebGLKernel extends GLKernel { * @returns {String} result */ _getLoopMaxString() { - return ( - this.loopMaxIterations ? - ` ${parseInt(this.loopMaxIterations)};\n` : - ' 1000;\n' - ); + return this.loopMaxIterations ? ` ${parseInt(this.loopMaxIterations)};\n` : ' 1000;\n'; } _getPluginsString() { if (!this.plugins) return '\n'; - return this.plugins.map(plugin => plugin.source && this.source.match(plugin.functionMatch) ? plugin.source : '').join('\n'); + return this.plugins.map(plugin => (plugin.source && this.source.match(plugin.functionMatch) ? plugin.source : '')).join('\n'); } /** @@ -1029,15 +989,9 @@ export class WebGLKernel extends GLKernel { const result = []; const { threadDim, texSize } = this; if (this.dynamicOutput) { - result.push( - 'uniform ivec3 uOutputDim', - 'uniform ivec2 uTexSize' - ); + result.push('uniform ivec3 uOutputDim', 'uniform ivec2 uTexSize'); } else { - result.push( - `ivec3 uOutputDim = ivec3(${threadDim[0]}, ${threadDim[1]}, ${threadDim[2]})`, - `ivec2 uTexSize = ivec2(${texSize[0]}, ${texSize[1]})` - ); + result.push(`ivec3 uOutputDim = ivec3(${threadDim[0]}, ${threadDim[1]}, ${threadDim[2]})`, `ivec2 uTexSize = ivec2(${texSize[0]}, ${texSize[1]})`); } return utils.linesToString(result); } @@ -1060,11 +1014,7 @@ export class WebGLKernel extends GLKernel { * @returns {String} result */ _getDecode32EndiannessString() { - return ( - this.endianness === 'LE' ? - '' : - ' texel.rgba = texel.abgr;\n' - ); + return this.endianness === 'LE' ? '' : ' texel.rgba = texel.abgr;\n'; } /** @@ -1072,11 +1022,7 @@ export class WebGLKernel extends GLKernel { * @returns {String} result */ _getEncode32EndiannessString() { - return ( - this.endianness === 'LE' ? - '' : - ' texel.rgba = texel.abgr;\n' - ); + return this.endianness === 'LE' ? '' : ' texel.rgba = texel.abgr;\n'; } /** @@ -1084,8 +1030,8 @@ export class WebGLKernel extends GLKernel { * @returns {String} result */ _getDivideWithIntegerCheckString() { - return this.fixIntegerDivisionAccuracy ? - `float divWithIntCheck(float x, float y) { + return this.fixIntegerDivisionAccuracy + ? `float divWithIntCheck(float x, float y) { if (floor(x) == x && floor(y) == y && integerMod(x, y) == 0.0) { return float(int(x) / int(y)); } @@ -1104,8 +1050,8 @@ float integerCorrectionModulo(float number, float divisor) { divisor = abs(divisor); } return number - (divisor * floor(divWithIntCheck(number, divisor))); -}` : - ''; +}` + : ''; } /** @@ -1169,7 +1115,7 @@ float integerCorrectionModulo(float number, float divisor) { if (this.graphical) { return 'float kernelResult'; } else { - throw new Error(`unrecognized output type "${ this.returnType }"`); + throw new Error(`unrecognized output type "${this.returnType}"`); } } } @@ -1187,32 +1133,22 @@ float integerCorrectionModulo(float number, float divisor) { case 'Integer': for (let i = 0; i < subKernels.length; i++) { const subKernel = subKernels[i]; - result.push( - subKernel.returnType === 'Integer' ? - `int subKernelResult_${ subKernel.name } = 0` : - `float subKernelResult_${ subKernel.name } = 0.0` - ); + result.push(subKernel.returnType === 'Integer' ? `int subKernelResult_${subKernel.name} = 0` : `float subKernelResult_${subKernel.name} = 0.0`); } break; case 'Array(2)': for (let i = 0; i < subKernels.length; i++) { - result.push( - `vec2 subKernelResult_${ subKernels[i].name }` - ); + result.push(`vec2 subKernelResult_${subKernels[i].name}`); } break; case 'Array(3)': for (let i = 0; i < subKernels.length; i++) { - result.push( - `vec3 subKernelResult_${ subKernels[i].name }` - ); + result.push(`vec3 subKernelResult_${subKernels[i].name}`); } break; case 'Array(4)': for (let i = 0; i < subKernels.length; i++) { - result.push( - `vec4 subKernelResult_${ subKernels[i].name }` - ); + result.push(`vec4 subKernelResult_${subKernels[i].name}`); } break; } @@ -1222,11 +1158,7 @@ float integerCorrectionModulo(float number, float divisor) { } getMainResultGraphical() { - return utils.linesToString([ - ' threadId = indexTo3D(index, uOutputDim)', - ' kernel()', - ' gl_FragColor = actualColor', - ]); + return utils.linesToString([' threadId = indexTo3D(index, uOutputDim)', ' kernel()', ' gl_FragColor = actualColor']); } getMainResultPackedPixels() { @@ -1235,8 +1167,7 @@ float integerCorrectionModulo(float number, float divisor) { case 'Number': case 'Integer': case 'Float': - return this.getMainResultKernelPackedPixels() + - this.getMainResultSubKernelPackedPixels(); + return this.getMainResultKernelPackedPixels() + this.getMainResultSubKernelPackedPixels(); default: throw new Error(`packed output only usable with Numbers, "${this.returnType}" specified`); } @@ -1246,11 +1177,7 @@ float integerCorrectionModulo(float number, float divisor) { * @return {String} */ getMainResultKernelPackedPixels() { - return utils.linesToString([ - ' threadId = indexTo3D(index, uOutputDim)', - ' kernel()', - ` gl_FragData[0] = ${this.useLegacyEncoder ? 'legacyEncode32' : 'encode32'}(kernelResult)` - ]); + return utils.linesToString([' threadId = indexTo3D(index, uOutputDim)', ' kernel()', ` gl_FragData[0] = ${this.useLegacyEncoder ? 'legacyEncode32' : 'encode32'}(kernelResult)`]); } /** @@ -1262,22 +1189,16 @@ float integerCorrectionModulo(float number, float divisor) { for (let i = 0; i < this.subKernels.length; i++) { const subKernel = this.subKernels[i]; if (subKernel.returnType === 'Integer') { - result.push( - ` gl_FragData[${i + 1}] = ${this.useLegacyEncoder ? 'legacyEncode32' : 'encode32'}(float(subKernelResult_${this.subKernels[i].name}))` - ); + result.push(` gl_FragData[${i + 1}] = ${this.useLegacyEncoder ? 'legacyEncode32' : 'encode32'}(float(subKernelResult_${this.subKernels[i].name}))`); } else { - result.push( - ` gl_FragData[${i + 1}] = ${this.useLegacyEncoder ? 'legacyEncode32' : 'encode32'}(subKernelResult_${this.subKernels[i].name})` - ); + result.push(` gl_FragData[${i + 1}] = ${this.useLegacyEncoder ? 'legacyEncode32' : 'encode32'}(subKernelResult_${this.subKernels[i].name})`); } } return utils.linesToString(result); } getMainResultMemoryOptimizedFloats() { - const result = [ - ' index *= 4', - ]; + const result = [' index *= 4']; switch (this.returnType) { case 'Number': @@ -1301,11 +1222,7 @@ float integerCorrectionModulo(float number, float divisor) { } getMainResultKernelMemoryOptimizedFloats(result, channel) { - result.push( - ' threadId = indexTo3D(index, uOutputDim)', - ' kernel()', - ` gl_FragData[0].${channel} = kernelResult` - ); + result.push(' threadId = indexTo3D(index, uOutputDim)', ' kernel()', ` gl_FragData[0].${channel} = kernelResult`); } getMainResultSubKernelMemoryOptimizedFloats(result, channel) { @@ -1313,23 +1230,15 @@ float integerCorrectionModulo(float number, float divisor) { for (let i = 0; i < this.subKernels.length; i++) { const subKernel = this.subKernels[i]; if (subKernel.returnType === 'Integer') { - result.push( - ` gl_FragData[${i + 1}].${channel} = float(subKernelResult_${this.subKernels[i].name})` - ); + result.push(` gl_FragData[${i + 1}].${channel} = float(subKernelResult_${this.subKernels[i].name})`); } else { - result.push( - ` gl_FragData[${i + 1}].${channel} = subKernelResult_${this.subKernels[i].name}` - ); + result.push(` gl_FragData[${i + 1}].${channel} = subKernelResult_${this.subKernels[i].name}`); } } } getMainResultKernelNumberTexture() { - return [ - ' threadId = indexTo3D(index, uOutputDim)', - ' kernel()', - ' gl_FragData[0][0] = kernelResult', - ]; + return [' threadId = indexTo3D(index, uOutputDim)', ' kernel()', ' gl_FragData[0][0] = kernelResult']; } getMainResultSubKernelNumberTexture() { @@ -1338,68 +1247,42 @@ float integerCorrectionModulo(float number, float divisor) { for (let i = 0; i < this.subKernels.length; ++i) { const subKernel = this.subKernels[i]; if (subKernel.returnType === 'Integer') { - result.push( - ` gl_FragData[${i + 1}][0] = float(subKernelResult_${subKernel.name})` - ); + result.push(` gl_FragData[${i + 1}][0] = float(subKernelResult_${subKernel.name})`); } else { - result.push( - ` gl_FragData[${i + 1}][0] = subKernelResult_${subKernel.name}` - ); + result.push(` gl_FragData[${i + 1}][0] = subKernelResult_${subKernel.name}`); } } return result; } getMainResultKernelArray2Texture() { - return [ - ' threadId = indexTo3D(index, uOutputDim)', - ' kernel()', - ' gl_FragData[0][0] = kernelResult[0]', - ' gl_FragData[0][1] = kernelResult[1]', - ]; + return [' threadId = indexTo3D(index, uOutputDim)', ' kernel()', ' gl_FragData[0][0] = kernelResult[0]', ' gl_FragData[0][1] = kernelResult[1]']; } getMainResultSubKernelArray2Texture() { const result = []; if (!this.subKernels) return result; for (let i = 0; i < this.subKernels.length; ++i) { - result.push( - ` gl_FragData[${i + 1}][0] = subKernelResult_${this.subKernels[i].name}[0]`, - ` gl_FragData[${i + 1}][1] = subKernelResult_${this.subKernels[i].name}[1]` - ); + result.push(` gl_FragData[${i + 1}][0] = subKernelResult_${this.subKernels[i].name}[0]`, ` gl_FragData[${i + 1}][1] = subKernelResult_${this.subKernels[i].name}[1]`); } return result; } getMainResultKernelArray3Texture() { - return [ - ' threadId = indexTo3D(index, uOutputDim)', - ' kernel()', - ' gl_FragData[0][0] = kernelResult[0]', - ' gl_FragData[0][1] = kernelResult[1]', - ' gl_FragData[0][2] = kernelResult[2]', - ]; + return [' threadId = indexTo3D(index, uOutputDim)', ' kernel()', ' gl_FragData[0][0] = kernelResult[0]', ' gl_FragData[0][1] = kernelResult[1]', ' gl_FragData[0][2] = kernelResult[2]']; } getMainResultSubKernelArray3Texture() { const result = []; if (!this.subKernels) return result; for (let i = 0; i < this.subKernels.length; ++i) { - result.push( - ` gl_FragData[${i + 1}][0] = subKernelResult_${this.subKernels[i].name}[0]`, - ` gl_FragData[${i + 1}][1] = subKernelResult_${this.subKernels[i].name}[1]`, - ` gl_FragData[${i + 1}][2] = subKernelResult_${this.subKernels[i].name}[2]` - ); + result.push(` gl_FragData[${i + 1}][0] = subKernelResult_${this.subKernels[i].name}[0]`, ` gl_FragData[${i + 1}][1] = subKernelResult_${this.subKernels[i].name}[1]`, ` gl_FragData[${i + 1}][2] = subKernelResult_${this.subKernels[i].name}[2]`); } return result; } getMainResultKernelArray4Texture() { - return [ - ' threadId = indexTo3D(index, uOutputDim)', - ' kernel()', - ' gl_FragData[0] = kernelResult', - ]; + return [' threadId = indexTo3D(index, uOutputDim)', ' kernel()', ' gl_FragData[0] = kernelResult']; } getMainResultSubKernelArray4Texture() { @@ -1412,41 +1295,25 @@ float integerCorrectionModulo(float number, float divisor) { for (let i = 0; i < this.subKernels.length; ++i) { const subKernel = this.subKernels[i]; if (subKernel.returnType === 'Integer') { - result.push( - ` gl_FragData[${i + 1}] = float(subKernelResult_${this.subKernels[i].name})` - ); + result.push(` gl_FragData[${i + 1}] = float(subKernelResult_${this.subKernels[i].name})`); } else { - result.push( - ` gl_FragData[${i + 1}] = subKernelResult_${this.subKernels[i].name}` - ); + result.push(` gl_FragData[${i + 1}] = subKernelResult_${this.subKernels[i].name}`); } } break; case 'Array(2)': for (let i = 0; i < this.subKernels.length; ++i) { - result.push( - ` gl_FragData[${i + 1}][0] = subKernelResult_${this.subKernels[i].name}[0]`, - ` gl_FragData[${i + 1}][1] = subKernelResult_${this.subKernels[i].name}[1]` - ); + result.push(` gl_FragData[${i + 1}][0] = subKernelResult_${this.subKernels[i].name}[0]`, ` gl_FragData[${i + 1}][1] = subKernelResult_${this.subKernels[i].name}[1]`); } break; case 'Array(3)': for (let i = 0; i < this.subKernels.length; ++i) { - result.push( - ` gl_FragData[${i + 1}][0] = subKernelResult_${this.subKernels[i].name}[0]`, - ` gl_FragData[${i + 1}][1] = subKernelResult_${this.subKernels[i].name}[1]`, - ` gl_FragData[${i + 1}][2] = subKernelResult_${this.subKernels[i].name}[2]` - ); + result.push(` gl_FragData[${i + 1}][0] = subKernelResult_${this.subKernels[i].name}[0]`, ` gl_FragData[${i + 1}][1] = subKernelResult_${this.subKernels[i].name}[1]`, ` gl_FragData[${i + 1}][2] = subKernelResult_${this.subKernels[i].name}[2]`); } break; case 'Array(4)': for (let i = 0; i < this.subKernels.length; ++i) { - result.push( - ` gl_FragData[${i + 1}][0] = subKernelResult_${this.subKernels[i].name}[0]`, - ` gl_FragData[${i + 1}][1] = subKernelResult_${this.subKernels[i].name}[1]`, - ` gl_FragData[${i + 1}][2] = subKernelResult_${this.subKernels[i].name}[2]`, - ` gl_FragData[${i + 1}][3] = subKernelResult_${this.subKernels[i].name}[3]` - ); + result.push(` gl_FragData[${i + 1}][0] = subKernelResult_${this.subKernels[i].name}[0]`, ` gl_FragData[${i + 1}][1] = subKernelResult_${this.subKernels[i].name}[1]`, ` gl_FragData[${i + 1}][2] = subKernelResult_${this.subKernels[i].name}[2]`, ` gl_FragData[${i + 1}][3] = subKernelResult_${this.subKernels[i].name}[3]`); } break; } @@ -1479,7 +1346,7 @@ float integerCorrectionModulo(float number, float divisor) { if (this.compiledFragmentShader !== null) { return this.compiledFragmentShader; } - return this.compiledFragmentShader = this.replaceArtifacts(this.constructor.fragmentShader, this._getFragShaderArtifactMap(args)); + return (this.compiledFragmentShader = this.replaceArtifacts(this.constructor.fragmentShader, this._getFragShaderArtifactMap(args))); } /** @@ -1491,16 +1358,14 @@ float integerCorrectionModulo(float number, float divisor) { if (this.compiledVertexShader !== null) { return this.compiledVertexShader; } - return this.compiledVertexShader = this.replaceArtifacts(this.constructor.vertexShader, this._getVertShaderArtifactMap(args)); + return (this.compiledVertexShader = this.replaceArtifacts(this.constructor.vertexShader, this._getVertShaderArtifactMap(args))); } /** * @desc Returns the *pre-compiled* Kernel as a JS Object String, that can be reused. */ toString() { - const setupContextString = utils.linesToString([ - `const gl = context`, - ]); + const setupContextString = utils.linesToString([`const gl = context`]); return glKernelString(this.constructor, arguments, this, setupContextString); } @@ -1600,4 +1465,4 @@ float integerCorrectionModulo(float number, float divisor) { json.settings.threadDim = this.threadDim; return json; } -} \ No newline at end of file +} diff --git a/src/backend/web-gl/vertex-shader.js b/src/backend/web-gl/vertex-shader.js index 22b07f8b..9e350c36 100644 --- a/src/backend/web-gl/vertex-shader.js +++ b/src/backend/web-gl/vertex-shader.js @@ -12,4 +12,4 @@ uniform vec2 ratio; void main(void) { gl_Position = vec4((aPos + vec2(1)) * ratio + vec2(-1), 0, 1); vTexCoord = aTexCoord; -}`; \ No newline at end of file +}`; diff --git a/src/backend/web-gl2/fragment-shader.js b/src/backend/web-gl2/fragment-shader.js index 8d1c5962..1716fc4c 100644 --- a/src/backend/web-gl2/fragment-shader.js +++ b/src/backend/web-gl2/fragment-shader.js @@ -445,4 +445,4 @@ __KERNEL__; void main(void) { index = int(vTexCoord.s * float(uTexSize.x)) + int(vTexCoord.t * float(uTexSize.y)) * uTexSize.x; __MAIN_RESULT__; -}`; \ No newline at end of file +}`; diff --git a/src/backend/web-gl2/function-node.js b/src/backend/web-gl2/function-node.js index 10a48fe3..deaa7cd8 100644 --- a/src/backend/web-gl2/function-node.js +++ b/src/backend/web-gl2/function-node.js @@ -8,7 +8,6 @@ import { WebGLFunctionNode } from '../web-gl/function-node'; * @returns the converted webGL function string */ export class WebGL2FunctionNode extends WebGLFunctionNode { - /** * @desc Parses the abstract syntax tree for *identifier* expression * @param {Object} idtNode - An ast Node @@ -17,10 +16,7 @@ export class WebGL2FunctionNode extends WebGLFunctionNode { */ astIdentifierExpression(idtNode, retArr) { if (idtNode.type !== 'Identifier') { - throw this.astErrorOutput( - 'IdentifierExpression - not an Identifier', - idtNode - ); + throw this.astErrorOutput('IdentifierExpression - not an Identifier', idtNode); } const type = this.getType(idtNode); @@ -40,4 +36,4 @@ export class WebGL2FunctionNode extends WebGLFunctionNode { return retArr; } -} \ No newline at end of file +} diff --git a/src/backend/web-gl2/kernel-value-maps.js b/src/backend/web-gl2/kernel-value-maps.js index 0d8944b9..655fdf68 100644 --- a/src/backend/web-gl2/kernel-value-maps.js +++ b/src/backend/web-gl2/kernel-value-maps.js @@ -45,10 +45,10 @@ import { WebGL2KernelValueDynamicUnsignedArray } from './kernel-value/dynamic-un export const kernelValueMaps = { unsigned: { dynamic: { - 'Boolean': WebGL2KernelValueBoolean, - 'Integer': WebGL2KernelValueInteger, - 'Float': WebGL2KernelValueFloat, - 'Array': WebGL2KernelValueDynamicUnsignedArray, + Boolean: WebGL2KernelValueBoolean, + Integer: WebGL2KernelValueInteger, + Float: WebGL2KernelValueFloat, + Array: WebGL2KernelValueDynamicUnsignedArray, 'Array(2)': WebGL2KernelValueArray2, 'Array(3)': WebGL2KernelValueArray3, 'Array(4)': WebGL2KernelValueArray4, @@ -61,26 +61,26 @@ export const kernelValueMaps = { 'Array3D(2)': false, 'Array3D(3)': false, 'Array3D(4)': false, - 'Input': WebGL2KernelValueDynamicUnsignedInput, - 'NumberTexture': WebGL2KernelValueDynamicNumberTexture, + Input: WebGL2KernelValueDynamicUnsignedInput, + NumberTexture: WebGL2KernelValueDynamicNumberTexture, 'ArrayTexture(1)': WebGL2KernelValueDynamicNumberTexture, 'ArrayTexture(2)': WebGL2KernelValueDynamicNumberTexture, 'ArrayTexture(3)': WebGL2KernelValueDynamicNumberTexture, 'ArrayTexture(4)': WebGL2KernelValueDynamicNumberTexture, - 'MemoryOptimizedNumberTexture': WebGL2KernelValueDynamicMemoryOptimizedNumberTexture, - 'HTMLCanvas': WebGL2KernelValueDynamicHTMLImage, - 'OffscreenCanvas': WebGL2KernelValueDynamicHTMLImage, - 'HTMLImage': WebGL2KernelValueDynamicHTMLImage, - 'ImageBitmap': WebGL2KernelValueDynamicHTMLImage, - 'ImageData': WebGL2KernelValueDynamicHTMLImage, - 'HTMLImageArray': WebGL2KernelValueDynamicHTMLImageArray, - 'HTMLVideo': WebGL2KernelValueDynamicHTMLVideo, + MemoryOptimizedNumberTexture: WebGL2KernelValueDynamicMemoryOptimizedNumberTexture, + HTMLCanvas: WebGL2KernelValueDynamicHTMLImage, + OffscreenCanvas: WebGL2KernelValueDynamicHTMLImage, + HTMLImage: WebGL2KernelValueDynamicHTMLImage, + ImageBitmap: WebGL2KernelValueDynamicHTMLImage, + ImageData: WebGL2KernelValueDynamicHTMLImage, + HTMLImageArray: WebGL2KernelValueDynamicHTMLImageArray, + HTMLVideo: WebGL2KernelValueDynamicHTMLVideo, }, static: { - 'Boolean': WebGL2KernelValueBoolean, - 'Float': WebGL2KernelValueFloat, - 'Integer': WebGL2KernelValueInteger, - 'Array': WebGL2KernelValueUnsignedArray, + Boolean: WebGL2KernelValueBoolean, + Float: WebGL2KernelValueFloat, + Integer: WebGL2KernelValueInteger, + Array: WebGL2KernelValueUnsignedArray, 'Array(2)': WebGL2KernelValueArray2, 'Array(3)': WebGL2KernelValueArray3, 'Array(4)': WebGL2KernelValueArray4, @@ -93,28 +93,28 @@ export const kernelValueMaps = { 'Array3D(2)': false, 'Array3D(3)': false, 'Array3D(4)': false, - 'Input': WebGL2KernelValueUnsignedInput, - 'NumberTexture': WebGL2KernelValueNumberTexture, + Input: WebGL2KernelValueUnsignedInput, + NumberTexture: WebGL2KernelValueNumberTexture, 'ArrayTexture(1)': WebGL2KernelValueNumberTexture, 'ArrayTexture(2)': WebGL2KernelValueNumberTexture, 'ArrayTexture(3)': WebGL2KernelValueNumberTexture, 'ArrayTexture(4)': WebGL2KernelValueNumberTexture, - 'MemoryOptimizedNumberTexture': WebGL2KernelValueDynamicMemoryOptimizedNumberTexture, - 'HTMLCanvas': WebGL2KernelValueHTMLImage, - 'OffscreenCanvas': WebGL2KernelValueHTMLImage, - 'HTMLImage': WebGL2KernelValueHTMLImage, - 'ImageBitmap': WebGL2KernelValueHTMLImage, - 'ImageData': WebGL2KernelValueHTMLImage, - 'HTMLImageArray': WebGL2KernelValueHTMLImageArray, - 'HTMLVideo': WebGL2KernelValueHTMLVideo, - } + MemoryOptimizedNumberTexture: WebGL2KernelValueDynamicMemoryOptimizedNumberTexture, + HTMLCanvas: WebGL2KernelValueHTMLImage, + OffscreenCanvas: WebGL2KernelValueHTMLImage, + HTMLImage: WebGL2KernelValueHTMLImage, + ImageBitmap: WebGL2KernelValueHTMLImage, + ImageData: WebGL2KernelValueHTMLImage, + HTMLImageArray: WebGL2KernelValueHTMLImageArray, + HTMLVideo: WebGL2KernelValueHTMLVideo, + }, }, single: { dynamic: { - 'Boolean': WebGL2KernelValueBoolean, - 'Integer': WebGL2KernelValueInteger, - 'Float': WebGL2KernelValueFloat, - 'Array': WebGL2KernelValueDynamicSingleArray, + Boolean: WebGL2KernelValueBoolean, + Integer: WebGL2KernelValueInteger, + Float: WebGL2KernelValueFloat, + Array: WebGL2KernelValueDynamicSingleArray, 'Array(2)': WebGL2KernelValueArray2, 'Array(3)': WebGL2KernelValueArray3, 'Array(4)': WebGL2KernelValueArray4, @@ -127,26 +127,26 @@ export const kernelValueMaps = { 'Array3D(2)': WebGL2KernelValueDynamicSingleArray3DI, 'Array3D(3)': WebGL2KernelValueDynamicSingleArray3DI, 'Array3D(4)': WebGL2KernelValueDynamicSingleArray3DI, - 'Input': WebGL2KernelValueDynamicSingleInput, - 'NumberTexture': WebGL2KernelValueDynamicNumberTexture, + Input: WebGL2KernelValueDynamicSingleInput, + NumberTexture: WebGL2KernelValueDynamicNumberTexture, 'ArrayTexture(1)': WebGL2KernelValueDynamicNumberTexture, 'ArrayTexture(2)': WebGL2KernelValueDynamicNumberTexture, 'ArrayTexture(3)': WebGL2KernelValueDynamicNumberTexture, 'ArrayTexture(4)': WebGL2KernelValueDynamicNumberTexture, - 'MemoryOptimizedNumberTexture': WebGL2KernelValueDynamicMemoryOptimizedNumberTexture, - 'HTMLCanvas': WebGL2KernelValueDynamicHTMLImage, - 'OffscreenCanvas': WebGL2KernelValueDynamicHTMLImage, - 'HTMLImage': WebGL2KernelValueDynamicHTMLImage, - 'ImageBitmap': WebGL2KernelValueDynamicHTMLImage, - 'ImageData': WebGL2KernelValueDynamicHTMLImage, - 'HTMLImageArray': WebGL2KernelValueDynamicHTMLImageArray, - 'HTMLVideo': WebGL2KernelValueDynamicHTMLVideo, + MemoryOptimizedNumberTexture: WebGL2KernelValueDynamicMemoryOptimizedNumberTexture, + HTMLCanvas: WebGL2KernelValueDynamicHTMLImage, + OffscreenCanvas: WebGL2KernelValueDynamicHTMLImage, + HTMLImage: WebGL2KernelValueDynamicHTMLImage, + ImageBitmap: WebGL2KernelValueDynamicHTMLImage, + ImageData: WebGL2KernelValueDynamicHTMLImage, + HTMLImageArray: WebGL2KernelValueDynamicHTMLImageArray, + HTMLVideo: WebGL2KernelValueDynamicHTMLVideo, }, static: { - 'Boolean': WebGL2KernelValueBoolean, - 'Float': WebGL2KernelValueFloat, - 'Integer': WebGL2KernelValueInteger, - 'Array': WebGL2KernelValueSingleArray, + Boolean: WebGL2KernelValueBoolean, + Float: WebGL2KernelValueFloat, + Integer: WebGL2KernelValueInteger, + Array: WebGL2KernelValueSingleArray, 'Array(2)': WebGL2KernelValueArray2, 'Array(3)': WebGL2KernelValueArray3, 'Array(4)': WebGL2KernelValueArray4, @@ -159,21 +159,21 @@ export const kernelValueMaps = { 'Array3D(2)': WebGL2KernelValueSingleArray3DI, 'Array3D(3)': WebGL2KernelValueSingleArray3DI, 'Array3D(4)': WebGL2KernelValueSingleArray3DI, - 'Input': WebGL2KernelValueSingleInput, - 'NumberTexture': WebGL2KernelValueNumberTexture, + Input: WebGL2KernelValueSingleInput, + NumberTexture: WebGL2KernelValueNumberTexture, 'ArrayTexture(1)': WebGL2KernelValueNumberTexture, 'ArrayTexture(2)': WebGL2KernelValueNumberTexture, 'ArrayTexture(3)': WebGL2KernelValueNumberTexture, 'ArrayTexture(4)': WebGL2KernelValueNumberTexture, - 'MemoryOptimizedNumberTexture': WebGL2KernelValueMemoryOptimizedNumberTexture, - 'HTMLCanvas': WebGL2KernelValueHTMLImage, - 'OffscreenCanvas': WebGL2KernelValueHTMLImage, - 'HTMLImage': WebGL2KernelValueHTMLImage, - 'ImageBitmap': WebGL2KernelValueHTMLImage, - 'ImageData': WebGL2KernelValueHTMLImage, - 'HTMLImageArray': WebGL2KernelValueHTMLImageArray, - 'HTMLVideo': WebGL2KernelValueHTMLVideo, - } + MemoryOptimizedNumberTexture: WebGL2KernelValueMemoryOptimizedNumberTexture, + HTMLCanvas: WebGL2KernelValueHTMLImage, + OffscreenCanvas: WebGL2KernelValueHTMLImage, + HTMLImage: WebGL2KernelValueHTMLImage, + ImageBitmap: WebGL2KernelValueHTMLImage, + ImageData: WebGL2KernelValueHTMLImage, + HTMLImageArray: WebGL2KernelValueHTMLImageArray, + HTMLVideo: WebGL2KernelValueHTMLVideo, + }, }, }; @@ -194,7 +194,7 @@ export function lookupKernelValueType(type, dynamic, precision, value) { if (types[type] === false) { return null; } else if (types[type] === undefined) { - throw new Error(`Could not find a KernelValue for ${ type }`); + throw new Error(`Could not find a KernelValue for ${type}`); } return types[type]; -} \ No newline at end of file +} diff --git a/src/backend/web-gl2/kernel-value/array2.js b/src/backend/web-gl2/kernel-value/array2.js index 3b1ecb87..a8872d86 100644 --- a/src/backend/web-gl2/kernel-value/array2.js +++ b/src/backend/web-gl2/kernel-value/array2.js @@ -1,3 +1,3 @@ import { WebGLKernelValueArray2 } from '../../web-gl/kernel-value/array2'; -export class WebGL2KernelValueArray2 extends WebGLKernelValueArray2 {} \ No newline at end of file +export class WebGL2KernelValueArray2 extends WebGLKernelValueArray2 {} diff --git a/src/backend/web-gl2/kernel-value/array3.js b/src/backend/web-gl2/kernel-value/array3.js index b8b61b38..98bd819a 100644 --- a/src/backend/web-gl2/kernel-value/array3.js +++ b/src/backend/web-gl2/kernel-value/array3.js @@ -1,3 +1,3 @@ import { WebGLKernelValueArray3 } from '../../web-gl/kernel-value/array3'; -export class WebGL2KernelValueArray3 extends WebGLKernelValueArray3 {} \ No newline at end of file +export class WebGL2KernelValueArray3 extends WebGLKernelValueArray3 {} diff --git a/src/backend/web-gl2/kernel-value/array4.js b/src/backend/web-gl2/kernel-value/array4.js index 094830b9..1481a098 100644 --- a/src/backend/web-gl2/kernel-value/array4.js +++ b/src/backend/web-gl2/kernel-value/array4.js @@ -1,3 +1,3 @@ import { WebGLKernelValueArray4 } from '../../web-gl/kernel-value/array4'; -export class WebGL2KernelValueArray4 extends WebGLKernelValueArray4 {} \ No newline at end of file +export class WebGL2KernelValueArray4 extends WebGLKernelValueArray4 {} diff --git a/src/backend/web-gl2/kernel-value/boolean.js b/src/backend/web-gl2/kernel-value/boolean.js index 61cdf0f5..b77933a0 100644 --- a/src/backend/web-gl2/kernel-value/boolean.js +++ b/src/backend/web-gl2/kernel-value/boolean.js @@ -1,3 +1,3 @@ import { WebGLKernelValueBoolean } from '../../web-gl/kernel-value/boolean'; -export class WebGL2KernelValueBoolean extends WebGLKernelValueBoolean {} \ No newline at end of file +export class WebGL2KernelValueBoolean extends WebGLKernelValueBoolean {} diff --git a/src/backend/web-gl2/kernel-value/dynamic-html-image-array.js b/src/backend/web-gl2/kernel-value/dynamic-html-image-array.js index 069c744a..b202c640 100644 --- a/src/backend/web-gl2/kernel-value/dynamic-html-image-array.js +++ b/src/backend/web-gl2/kernel-value/dynamic-html-image-array.js @@ -4,11 +4,7 @@ import { WebGL2KernelValueHTMLImageArray } from './html-image-array'; export class WebGL2KernelValueDynamicHTMLImageArray extends WebGL2KernelValueHTMLImageArray { getSource() { const variablePrecision = this.getVariablePrecisionString(); - return utils.linesToString([ - `uniform ${ variablePrecision } sampler2DArray ${this.id}`, - `uniform ${ variablePrecision } ivec2 ${this.sizeId}`, - `uniform ${ variablePrecision } ivec3 ${this.dimensionsId}`, - ]); + return utils.linesToString([`uniform ${variablePrecision} sampler2DArray ${this.id}`, `uniform ${variablePrecision} ivec2 ${this.sizeId}`, `uniform ${variablePrecision} ivec3 ${this.dimensionsId}`]); } updateValue(images) { @@ -20,4 +16,4 @@ export class WebGL2KernelValueDynamicHTMLImageArray extends WebGL2KernelValueHTM this.kernel.setUniform2iv(this.sizeId, this.textureSize); super.updateValue(images); } -} \ No newline at end of file +} diff --git a/src/backend/web-gl2/kernel-value/dynamic-html-image.js b/src/backend/web-gl2/kernel-value/dynamic-html-image.js index c6d2bfdf..14bce760 100644 --- a/src/backend/web-gl2/kernel-value/dynamic-html-image.js +++ b/src/backend/web-gl2/kernel-value/dynamic-html-image.js @@ -4,10 +4,6 @@ import { WebGLKernelValueDynamicHTMLImage } from '../../web-gl/kernel-value/dyna export class WebGL2KernelValueDynamicHTMLImage extends WebGLKernelValueDynamicHTMLImage { getSource() { const variablePrecision = this.getVariablePrecisionString(); - return utils.linesToString([ - `uniform ${ variablePrecision } sampler2D ${this.id}`, - `uniform ${ variablePrecision } ivec2 ${this.sizeId}`, - `uniform ${ variablePrecision } ivec3 ${this.dimensionsId}`, - ]); + return utils.linesToString([`uniform ${variablePrecision} sampler2D ${this.id}`, `uniform ${variablePrecision} ivec2 ${this.sizeId}`, `uniform ${variablePrecision} ivec3 ${this.dimensionsId}`]); } -} \ No newline at end of file +} diff --git a/src/backend/web-gl2/kernel-value/dynamic-html-video.js b/src/backend/web-gl2/kernel-value/dynamic-html-video.js index e8686b44..1f83c368 100644 --- a/src/backend/web-gl2/kernel-value/dynamic-html-video.js +++ b/src/backend/web-gl2/kernel-value/dynamic-html-video.js @@ -1,3 +1,3 @@ import { WebGL2KernelValueDynamicHTMLImage } from './dynamic-html-image'; -export class WebGL2KernelValueDynamicHTMLVideo extends WebGL2KernelValueDynamicHTMLImage {} \ No newline at end of file +export class WebGL2KernelValueDynamicHTMLVideo extends WebGL2KernelValueDynamicHTMLImage {} diff --git a/src/backend/web-gl2/kernel-value/dynamic-memory-optimized-number-texture.js b/src/backend/web-gl2/kernel-value/dynamic-memory-optimized-number-texture.js index b1414b1c..26fb4640 100644 --- a/src/backend/web-gl2/kernel-value/dynamic-memory-optimized-number-texture.js +++ b/src/backend/web-gl2/kernel-value/dynamic-memory-optimized-number-texture.js @@ -3,10 +3,6 @@ import { WebGLKernelValueDynamicMemoryOptimizedNumberTexture } from '../../web-g export class WebGL2KernelValueDynamicMemoryOptimizedNumberTexture extends WebGLKernelValueDynamicMemoryOptimizedNumberTexture { getSource() { - return utils.linesToString([ - `uniform sampler2D ${this.id}`, - `uniform ivec2 ${this.sizeId}`, - `uniform ivec3 ${this.dimensionsId}`, - ]); + return utils.linesToString([`uniform sampler2D ${this.id}`, `uniform ivec2 ${this.sizeId}`, `uniform ivec3 ${this.dimensionsId}`]); } -} \ No newline at end of file +} diff --git a/src/backend/web-gl2/kernel-value/dynamic-number-texture.js b/src/backend/web-gl2/kernel-value/dynamic-number-texture.js index 756d31b6..3ce83ae5 100644 --- a/src/backend/web-gl2/kernel-value/dynamic-number-texture.js +++ b/src/backend/web-gl2/kernel-value/dynamic-number-texture.js @@ -4,10 +4,6 @@ import { WebGLKernelValueDynamicNumberTexture } from '../../web-gl/kernel-value/ export class WebGL2KernelValueDynamicNumberTexture extends WebGLKernelValueDynamicNumberTexture { getSource() { const variablePrecision = this.getVariablePrecisionString(); - return utils.linesToString([ - `uniform ${ variablePrecision } sampler2D ${this.id}`, - `uniform ${ variablePrecision } ivec2 ${this.sizeId}`, - `uniform ${ variablePrecision } ivec3 ${this.dimensionsId}`, - ]); + return utils.linesToString([`uniform ${variablePrecision} sampler2D ${this.id}`, `uniform ${variablePrecision} ivec2 ${this.sizeId}`, `uniform ${variablePrecision} ivec3 ${this.dimensionsId}`]); } -} \ No newline at end of file +} diff --git a/src/backend/web-gl2/kernel-value/dynamic-single-array.js b/src/backend/web-gl2/kernel-value/dynamic-single-array.js index 8e3905de..cf58a8c9 100644 --- a/src/backend/web-gl2/kernel-value/dynamic-single-array.js +++ b/src/backend/web-gl2/kernel-value/dynamic-single-array.js @@ -4,11 +4,7 @@ import { WebGL2KernelValueSingleArray } from '../../web-gl2/kernel-value/single- export class WebGL2KernelValueDynamicSingleArray extends WebGL2KernelValueSingleArray { getSource() { const variablePrecision = this.getVariablePrecisionString(); - return utils.linesToString([ - `uniform ${ variablePrecision } sampler2D ${this.id}`, - `uniform ${ variablePrecision } ivec2 ${this.sizeId}`, - `uniform ${ variablePrecision } ivec3 ${this.dimensionsId}`, - ]); + return utils.linesToString([`uniform ${variablePrecision} sampler2D ${this.id}`, `uniform ${variablePrecision} ivec2 ${this.sizeId}`, `uniform ${variablePrecision} ivec3 ${this.dimensionsId}`]); } updateValue(value) { @@ -21,4 +17,4 @@ export class WebGL2KernelValueDynamicSingleArray extends WebGL2KernelValueSingle this.kernel.setUniform2iv(this.sizeId, this.textureSize); super.updateValue(value); } -} \ No newline at end of file +} diff --git a/src/backend/web-gl2/kernel-value/dynamic-single-array1d-i.js b/src/backend/web-gl2/kernel-value/dynamic-single-array1d-i.js index f8bbf16f..97f27f27 100644 --- a/src/backend/web-gl2/kernel-value/dynamic-single-array1d-i.js +++ b/src/backend/web-gl2/kernel-value/dynamic-single-array1d-i.js @@ -4,11 +4,7 @@ import { WebGL2KernelValueSingleArray1DI } from '../../web-gl2/kernel-value/sing export class WebGL2KernelValueDynamicSingleArray1DI extends WebGL2KernelValueSingleArray1DI { getSource() { const variablePrecision = this.getVariablePrecisionString(); - return utils.linesToString([ - `uniform ${ variablePrecision } sampler2D ${this.id}`, - `uniform ${ variablePrecision } ivec2 ${this.sizeId}`, - `uniform ${ variablePrecision } ivec3 ${this.dimensionsId}`, - ]); + return utils.linesToString([`uniform ${variablePrecision} sampler2D ${this.id}`, `uniform ${variablePrecision} ivec2 ${this.sizeId}`, `uniform ${variablePrecision} ivec3 ${this.dimensionsId}`]); } updateValue(value) { @@ -17,4 +13,4 @@ export class WebGL2KernelValueDynamicSingleArray1DI extends WebGL2KernelValueSin this.kernel.setUniform2iv(this.sizeId, this.textureSize); super.updateValue(value); } -} \ No newline at end of file +} diff --git a/src/backend/web-gl2/kernel-value/dynamic-single-array2d-i.js b/src/backend/web-gl2/kernel-value/dynamic-single-array2d-i.js index d20fb80c..54cf7678 100644 --- a/src/backend/web-gl2/kernel-value/dynamic-single-array2d-i.js +++ b/src/backend/web-gl2/kernel-value/dynamic-single-array2d-i.js @@ -4,11 +4,7 @@ import { WebGL2KernelValueSingleArray2DI } from '../../web-gl2/kernel-value/sing export class WebGL2KernelValueDynamicSingleArray2DI extends WebGL2KernelValueSingleArray2DI { getSource() { const variablePrecision = this.getVariablePrecisionString(); - return utils.linesToString([ - `uniform ${ variablePrecision } sampler2D ${this.id}`, - `uniform ${ variablePrecision } ivec2 ${this.sizeId}`, - `uniform ${ variablePrecision } ivec3 ${this.dimensionsId}`, - ]); + return utils.linesToString([`uniform ${variablePrecision} sampler2D ${this.id}`, `uniform ${variablePrecision} ivec2 ${this.sizeId}`, `uniform ${variablePrecision} ivec3 ${this.dimensionsId}`]); } updateValue(value) { @@ -17,4 +13,4 @@ export class WebGL2KernelValueDynamicSingleArray2DI extends WebGL2KernelValueSin this.kernel.setUniform2iv(this.sizeId, this.textureSize); super.updateValue(value); } -} \ No newline at end of file +} diff --git a/src/backend/web-gl2/kernel-value/dynamic-single-array3d-i.js b/src/backend/web-gl2/kernel-value/dynamic-single-array3d-i.js index 7e406d7f..ea19628a 100644 --- a/src/backend/web-gl2/kernel-value/dynamic-single-array3d-i.js +++ b/src/backend/web-gl2/kernel-value/dynamic-single-array3d-i.js @@ -4,11 +4,7 @@ import { WebGL2KernelValueSingleArray3DI } from '../../web-gl2/kernel-value/sing export class WebGL2KernelValueDynamicSingleArray3DI extends WebGL2KernelValueSingleArray3DI { getSource() { const variablePrecision = this.getVariablePrecisionString(); - return utils.linesToString([ - `uniform ${ variablePrecision } sampler2D ${this.id}`, - `uniform ${ variablePrecision } ivec2 ${this.sizeId}`, - `uniform ${ variablePrecision } ivec3 ${this.dimensionsId}`, - ]); + return utils.linesToString([`uniform ${variablePrecision} sampler2D ${this.id}`, `uniform ${variablePrecision} ivec2 ${this.sizeId}`, `uniform ${variablePrecision} ivec3 ${this.dimensionsId}`]); } updateValue(value) { @@ -17,4 +13,4 @@ export class WebGL2KernelValueDynamicSingleArray3DI extends WebGL2KernelValueSin this.kernel.setUniform2iv(this.sizeId, this.textureSize); super.updateValue(value); } -} \ No newline at end of file +} diff --git a/src/backend/web-gl2/kernel-value/dynamic-single-input.js b/src/backend/web-gl2/kernel-value/dynamic-single-input.js index 570cd59f..8d331e18 100644 --- a/src/backend/web-gl2/kernel-value/dynamic-single-input.js +++ b/src/backend/web-gl2/kernel-value/dynamic-single-input.js @@ -4,11 +4,7 @@ import { WebGL2KernelValueSingleInput } from '../../web-gl2/kernel-value/single- export class WebGL2KernelValueDynamicSingleInput extends WebGL2KernelValueSingleInput { getSource() { const variablePrecision = this.getVariablePrecisionString(); - return utils.linesToString([ - `uniform ${ variablePrecision } sampler2D ${this.id}`, - `uniform ${ variablePrecision } ivec2 ${this.sizeId}`, - `uniform ${ variablePrecision } ivec3 ${this.dimensionsId}`, - ]); + return utils.linesToString([`uniform ${variablePrecision} sampler2D ${this.id}`, `uniform ${variablePrecision} ivec2 ${this.sizeId}`, `uniform ${variablePrecision} ivec3 ${this.dimensionsId}`]); } updateValue(value) { @@ -22,4 +18,4 @@ export class WebGL2KernelValueDynamicSingleInput extends WebGL2KernelValueSingle this.kernel.setUniform2iv(this.sizeId, this.textureSize); super.updateValue(value); } -} \ No newline at end of file +} diff --git a/src/backend/web-gl2/kernel-value/dynamic-unsigned-array.js b/src/backend/web-gl2/kernel-value/dynamic-unsigned-array.js index b7e00482..24fb8189 100644 --- a/src/backend/web-gl2/kernel-value/dynamic-unsigned-array.js +++ b/src/backend/web-gl2/kernel-value/dynamic-unsigned-array.js @@ -4,10 +4,6 @@ import { WebGLKernelValueDynamicUnsignedArray } from '../../web-gl/kernel-value/ export class WebGL2KernelValueDynamicUnsignedArray extends WebGLKernelValueDynamicUnsignedArray { getSource() { const variablePrecision = this.getVariablePrecisionString(); - return utils.linesToString([ - `uniform ${ variablePrecision } sampler2D ${this.id}`, - `uniform ${ variablePrecision } ivec2 ${this.sizeId}`, - `uniform ${ variablePrecision } ivec3 ${this.dimensionsId}`, - ]); + return utils.linesToString([`uniform ${variablePrecision} sampler2D ${this.id}`, `uniform ${variablePrecision} ivec2 ${this.sizeId}`, `uniform ${variablePrecision} ivec3 ${this.dimensionsId}`]); } -} \ No newline at end of file +} diff --git a/src/backend/web-gl2/kernel-value/dynamic-unsigned-input.js b/src/backend/web-gl2/kernel-value/dynamic-unsigned-input.js index 0675bee8..0cdf91db 100644 --- a/src/backend/web-gl2/kernel-value/dynamic-unsigned-input.js +++ b/src/backend/web-gl2/kernel-value/dynamic-unsigned-input.js @@ -4,10 +4,6 @@ import { WebGLKernelValueDynamicUnsignedInput } from '../../web-gl/kernel-value/ export class WebGL2KernelValueDynamicUnsignedInput extends WebGLKernelValueDynamicUnsignedInput { getSource() { const variablePrecision = this.getVariablePrecisionString(); - return utils.linesToString([ - `uniform ${ variablePrecision } sampler2D ${this.id}`, - `uniform ${ variablePrecision } ivec2 ${this.sizeId}`, - `uniform ${ variablePrecision } ivec3 ${this.dimensionsId}`, - ]); + return utils.linesToString([`uniform ${variablePrecision} sampler2D ${this.id}`, `uniform ${variablePrecision} ivec2 ${this.sizeId}`, `uniform ${variablePrecision} ivec3 ${this.dimensionsId}`]); } -} \ No newline at end of file +} diff --git a/src/backend/web-gl2/kernel-value/float.js b/src/backend/web-gl2/kernel-value/float.js index 94d36154..e32aca37 100644 --- a/src/backend/web-gl2/kernel-value/float.js +++ b/src/backend/web-gl2/kernel-value/float.js @@ -1,3 +1,3 @@ import { WebGLKernelValueFloat } from '../../web-gl/kernel-value/float'; -export class WebGL2KernelValueFloat extends WebGLKernelValueFloat {} \ No newline at end of file +export class WebGL2KernelValueFloat extends WebGLKernelValueFloat {} diff --git a/src/backend/web-gl2/kernel-value/html-image-array.js b/src/backend/web-gl2/kernel-value/html-image-array.js index a82723c9..282c26f5 100644 --- a/src/backend/web-gl2/kernel-value/html-image-array.js +++ b/src/backend/web-gl2/kernel-value/html-image-array.js @@ -21,11 +21,7 @@ export class WebGL2KernelValueHTMLImageArray extends WebGLKernelArray { } getSource() { const variablePrecision = this.getVariablePrecisionString(); - return utils.linesToString([ - `uniform ${ variablePrecision } sampler2DArray ${this.id}`, - `${ variablePrecision } ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`, - `${ variablePrecision } ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`, - ]); + return utils.linesToString([`uniform ${variablePrecision} sampler2DArray ${this.id}`, `${variablePrecision} ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`, `${variablePrecision} ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`]); } updateValue(images) { @@ -34,36 +30,13 @@ export class WebGL2KernelValueHTMLImageArray extends WebGLKernelArray { gl.bindTexture(gl.TEXTURE_2D_ARRAY, this.texture); gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true); // Upload the images into the texture. - gl.texImage3D( - gl.TEXTURE_2D_ARRAY, - 0, - gl.RGBA, - images[0].width, - images[0].height, - images.length, - 0, - gl.RGBA, - gl.UNSIGNED_BYTE, - null - ); + gl.texImage3D(gl.TEXTURE_2D_ARRAY, 0, gl.RGBA, images[0].width, images[0].height, images.length, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); for (let i = 0; i < images.length; i++) { const xOffset = 0; const yOffset = 0; const imageDepth = 1; - gl.texSubImage3D( - gl.TEXTURE_2D_ARRAY, - 0, - xOffset, - yOffset, - i, - images[i].width, - images[i].height, - imageDepth, - gl.RGBA, - gl.UNSIGNED_BYTE, - this.uploadValue = images[i] - ); + gl.texSubImage3D(gl.TEXTURE_2D_ARRAY, 0, xOffset, yOffset, i, images[i].width, images[i].height, imageDepth, gl.RGBA, gl.UNSIGNED_BYTE, (this.uploadValue = images[i])); } this.kernel.setUniform1i(this.id, this.index); } -} \ No newline at end of file +} diff --git a/src/backend/web-gl2/kernel-value/html-image.js b/src/backend/web-gl2/kernel-value/html-image.js index 97ece611..22441756 100644 --- a/src/backend/web-gl2/kernel-value/html-image.js +++ b/src/backend/web-gl2/kernel-value/html-image.js @@ -4,10 +4,6 @@ import { WebGLKernelValueHTMLImage } from '../../web-gl/kernel-value/html-image' export class WebGL2KernelValueHTMLImage extends WebGLKernelValueHTMLImage { getSource() { const variablePrecision = this.getVariablePrecisionString(); - return utils.linesToString([ - `uniform ${ variablePrecision } sampler2D ${this.id}`, - `${ variablePrecision } ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`, - `${ variablePrecision } ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`, - ]); + return utils.linesToString([`uniform ${variablePrecision} sampler2D ${this.id}`, `${variablePrecision} ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`, `${variablePrecision} ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`]); } -} \ No newline at end of file +} diff --git a/src/backend/web-gl2/kernel-value/html-video.js b/src/backend/web-gl2/kernel-value/html-video.js index b6abcd7b..341b31ef 100644 --- a/src/backend/web-gl2/kernel-value/html-video.js +++ b/src/backend/web-gl2/kernel-value/html-video.js @@ -1,4 +1,4 @@ import { utils } from '../../../utils'; import { WebGL2KernelValueHTMLImage } from './html-image'; -export class WebGL2KernelValueHTMLVideo extends WebGL2KernelValueHTMLImage {} \ No newline at end of file +export class WebGL2KernelValueHTMLVideo extends WebGL2KernelValueHTMLImage {} diff --git a/src/backend/web-gl2/kernel-value/integer.js b/src/backend/web-gl2/kernel-value/integer.js index f59da5c4..0f2ec3db 100644 --- a/src/backend/web-gl2/kernel-value/integer.js +++ b/src/backend/web-gl2/kernel-value/integer.js @@ -4,13 +4,13 @@ export class WebGL2KernelValueInteger extends WebGLKernelValueInteger { getSource(value) { const variablePrecision = this.getVariablePrecisionString(); if (this.origin === 'constants') { - return `const ${ variablePrecision } int ${this.id} = ${ parseInt(value) };\n`; + return `const ${variablePrecision} int ${this.id} = ${parseInt(value)};\n`; } - return `uniform ${ variablePrecision } int ${this.id};\n`; + return `uniform ${variablePrecision} int ${this.id};\n`; } updateValue(value) { if (this.origin === 'constants') return; - this.kernel.setUniform1i(this.id, this.uploadValue = value); + this.kernel.setUniform1i(this.id, (this.uploadValue = value)); } -} \ No newline at end of file +} diff --git a/src/backend/web-gl2/kernel-value/memory-optimized-number-texture.js b/src/backend/web-gl2/kernel-value/memory-optimized-number-texture.js index 60cddd8b..7fe3f01b 100644 --- a/src/backend/web-gl2/kernel-value/memory-optimized-number-texture.js +++ b/src/backend/web-gl2/kernel-value/memory-optimized-number-texture.js @@ -5,10 +5,6 @@ export class WebGL2KernelValueMemoryOptimizedNumberTexture extends WebGLKernelVa getSource() { const { id, sizeId, textureSize, dimensionsId, dimensions } = this; const variablePrecision = this.getVariablePrecisionString(); - return utils.linesToString([ - `uniform sampler2D ${id}`, - `${ variablePrecision } ivec2 ${sizeId} = ivec2(${textureSize[0]}, ${textureSize[1]})`, - `${ variablePrecision } ivec3 ${dimensionsId} = ivec3(${dimensions[0]}, ${dimensions[1]}, ${dimensions[2]})`, - ]); + return utils.linesToString([`uniform sampler2D ${id}`, `${variablePrecision} ivec2 ${sizeId} = ivec2(${textureSize[0]}, ${textureSize[1]})`, `${variablePrecision} ivec3 ${dimensionsId} = ivec3(${dimensions[0]}, ${dimensions[1]}, ${dimensions[2]})`]); } -} \ No newline at end of file +} diff --git a/src/backend/web-gl2/kernel-value/number-texture.js b/src/backend/web-gl2/kernel-value/number-texture.js index 2a1fe4ce..f9d2a8ae 100644 --- a/src/backend/web-gl2/kernel-value/number-texture.js +++ b/src/backend/web-gl2/kernel-value/number-texture.js @@ -5,10 +5,6 @@ export class WebGL2KernelValueNumberTexture extends WebGLKernelValueNumberTextur getSource() { const { id, sizeId, textureSize, dimensionsId, dimensions } = this; const variablePrecision = this.getVariablePrecisionString(); - return utils.linesToString([ - `uniform ${ variablePrecision } sampler2D ${id}`, - `${ variablePrecision } ivec2 ${sizeId} = ivec2(${textureSize[0]}, ${textureSize[1]})`, - `${ variablePrecision } ivec3 ${dimensionsId} = ivec3(${dimensions[0]}, ${dimensions[1]}, ${dimensions[2]})`, - ]); + return utils.linesToString([`uniform ${variablePrecision} sampler2D ${id}`, `${variablePrecision} ivec2 ${sizeId} = ivec2(${textureSize[0]}, ${textureSize[1]})`, `${variablePrecision} ivec3 ${dimensionsId} = ivec3(${dimensions[0]}, ${dimensions[1]}, ${dimensions[2]})`]); } -} \ No newline at end of file +} diff --git a/src/backend/web-gl2/kernel-value/single-array.js b/src/backend/web-gl2/kernel-value/single-array.js index b437cf0e..38dea15a 100644 --- a/src/backend/web-gl2/kernel-value/single-array.js +++ b/src/backend/web-gl2/kernel-value/single-array.js @@ -4,11 +4,7 @@ import { WebGLKernelValueSingleArray } from '../../web-gl/kernel-value/single-ar export class WebGL2KernelValueSingleArray extends WebGLKernelValueSingleArray { getSource() { const variablePrecision = this.getVariablePrecisionString(); - return utils.linesToString([ - `uniform ${ variablePrecision } sampler2D ${this.id}`, - `${ variablePrecision } ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`, - `${ variablePrecision } ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`, - ]); + return utils.linesToString([`uniform ${variablePrecision} sampler2D ${this.id}`, `${variablePrecision} ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`, `${variablePrecision} ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`]); } updateValue(value) { @@ -24,4 +20,4 @@ export class WebGL2KernelValueSingleArray extends WebGLKernelValueSingleArray { gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA32F, this.textureSize[0], this.textureSize[1], 0, gl.RGBA, gl.FLOAT, this.uploadValue); this.kernel.setUniform1i(this.id, this.index); } -} \ No newline at end of file +} diff --git a/src/backend/web-gl2/kernel-value/single-array1d-i.js b/src/backend/web-gl2/kernel-value/single-array1d-i.js index 8f1d051c..f78c9401 100644 --- a/src/backend/web-gl2/kernel-value/single-array1d-i.js +++ b/src/backend/web-gl2/kernel-value/single-array1d-i.js @@ -15,4 +15,4 @@ export class WebGL2KernelValueSingleArray1DI extends WebGLKernelValueSingleArray gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA32F, this.textureSize[0], this.textureSize[1], 0, gl.RGBA, gl.FLOAT, this.uploadValue); this.kernel.setUniform1i(this.id, this.index); } -} \ No newline at end of file +} diff --git a/src/backend/web-gl2/kernel-value/single-array2d-i.js b/src/backend/web-gl2/kernel-value/single-array2d-i.js index 88dad13f..7567e47c 100644 --- a/src/backend/web-gl2/kernel-value/single-array2d-i.js +++ b/src/backend/web-gl2/kernel-value/single-array2d-i.js @@ -15,4 +15,4 @@ export class WebGL2KernelValueSingleArray2DI extends WebGLKernelValueSingleArray gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA32F, this.textureSize[0], this.textureSize[1], 0, gl.RGBA, gl.FLOAT, this.uploadValue); this.kernel.setUniform1i(this.id, this.index); } -} \ No newline at end of file +} diff --git a/src/backend/web-gl2/kernel-value/single-array3d-i.js b/src/backend/web-gl2/kernel-value/single-array3d-i.js index 5fe7d352..fb4bddc2 100644 --- a/src/backend/web-gl2/kernel-value/single-array3d-i.js +++ b/src/backend/web-gl2/kernel-value/single-array3d-i.js @@ -15,4 +15,4 @@ export class WebGL2KernelValueSingleArray3DI extends WebGLKernelValueSingleArray gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA32F, this.textureSize[0], this.textureSize[1], 0, gl.RGBA, gl.FLOAT, this.uploadValue); this.kernel.setUniform1i(this.id, this.index); } -} \ No newline at end of file +} diff --git a/src/backend/web-gl2/kernel-value/single-input.js b/src/backend/web-gl2/kernel-value/single-input.js index 1b52721a..e2ce5599 100644 --- a/src/backend/web-gl2/kernel-value/single-input.js +++ b/src/backend/web-gl2/kernel-value/single-input.js @@ -4,11 +4,7 @@ import { WebGLKernelValueSingleInput } from '../../web-gl/kernel-value/single-in export class WebGL2KernelValueSingleInput extends WebGLKernelValueSingleInput { getSource() { const variablePrecision = this.getVariablePrecisionString(); - return utils.linesToString([ - `uniform ${ variablePrecision } sampler2D ${this.id}`, - `${ variablePrecision } ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`, - `${ variablePrecision } ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`, - ]); + return utils.linesToString([`uniform ${variablePrecision} sampler2D ${this.id}`, `${variablePrecision} ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`, `${variablePrecision} ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`]); } updateValue(input) { @@ -20,4 +16,4 @@ export class WebGL2KernelValueSingleInput extends WebGLKernelValueSingleInput { gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA32F, this.textureSize[0], this.textureSize[1], 0, gl.RGBA, gl.FLOAT, this.uploadValue); this.kernel.setUniform1i(this.id, this.index); } -} \ No newline at end of file +} diff --git a/src/backend/web-gl2/kernel-value/unsigned-array.js b/src/backend/web-gl2/kernel-value/unsigned-array.js index ac5e5c4d..6ffa3025 100644 --- a/src/backend/web-gl2/kernel-value/unsigned-array.js +++ b/src/backend/web-gl2/kernel-value/unsigned-array.js @@ -4,10 +4,6 @@ import { WebGLKernelValueUnsignedArray } from '../../web-gl/kernel-value/unsigne export class WebGL2KernelValueUnsignedArray extends WebGLKernelValueUnsignedArray { getSource() { const variablePrecision = this.getVariablePrecisionString(); - return utils.linesToString([ - `uniform ${ variablePrecision } sampler2D ${this.id}`, - `${ variablePrecision } ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`, - `${ variablePrecision } ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`, - ]); + return utils.linesToString([`uniform ${variablePrecision} sampler2D ${this.id}`, `${variablePrecision} ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`, `${variablePrecision} ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`]); } -} \ No newline at end of file +} diff --git a/src/backend/web-gl2/kernel-value/unsigned-input.js b/src/backend/web-gl2/kernel-value/unsigned-input.js index 49ccfd41..16e04d50 100644 --- a/src/backend/web-gl2/kernel-value/unsigned-input.js +++ b/src/backend/web-gl2/kernel-value/unsigned-input.js @@ -4,10 +4,6 @@ import { WebGLKernelValueUnsignedInput } from '../../web-gl/kernel-value/unsigne export class WebGL2KernelValueUnsignedInput extends WebGLKernelValueUnsignedInput { getSource() { const variablePrecision = this.getVariablePrecisionString(); - return utils.linesToString([ - `uniform ${ variablePrecision } sampler2D ${this.id}`, - `${ variablePrecision } ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`, - `${ variablePrecision } ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`, - ]); + return utils.linesToString([`uniform ${variablePrecision} sampler2D ${this.id}`, `${variablePrecision} ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`, `${variablePrecision} ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`]); } -} \ No newline at end of file +} diff --git a/src/backend/web-gl2/kernel.js b/src/backend/web-gl2/kernel.js index ec6ce49f..a972d2b5 100644 --- a/src/backend/web-gl2/kernel.js +++ b/src/backend/web-gl2/kernel.js @@ -133,7 +133,7 @@ export class WebGL2Kernel extends WebGLKernel { const settings = { alpha: false, depth: false, - antialias: false + antialias: false, }; return this.canvas.getContext('webgl2', settings); } @@ -151,10 +151,13 @@ export class WebGL2Kernel extends WebGLKernel { */ validateSettings(args) { if (!this.validate) { - this.texSize = utils.getKernelTextureSize({ - optimizeFloatMemory: this.optimizeFloatMemory, - precision: this.precision, - }, this.output); + this.texSize = utils.getKernelTextureSize( + { + optimizeFloatMemory: this.optimizeFloatMemory, + precision: this.precision, + }, + this.output + ); return; } @@ -212,17 +215,20 @@ export class WebGL2Kernel extends WebGLKernel { this.precision = 'single'; } - this.texSize = utils.getKernelTextureSize({ - optimizeFloatMemory: this.optimizeFloatMemory, - precision: this.precision, - }, this.output); + this.texSize = utils.getKernelTextureSize( + { + optimizeFloatMemory: this.optimizeFloatMemory, + precision: this.precision, + }, + this.output + ); this.checkTextureSize(); } translateSource() { const functionBuilder = FunctionBuilder.fromKernel(this, WebGL2FunctionNode, { - fixIntegerDivisionAccuracy: this.fixIntegerDivisionAccuracy + fixIntegerDivisionAccuracy: this.fixIntegerDivisionAccuracy, }); this.translatedSource = functionBuilder.getPrototypeString('kernel'); this.setupReturnTypes(functionBuilder); @@ -341,16 +347,18 @@ export class WebGL2Kernel extends WebGLKernel { } gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0 + i + 1, gl.TEXTURE_2D, texture, 0); - this.mappedTextures.push(new this.TextureConstructor({ - texture, - size: texSize, - dimensions: this.threadDim, - output: this.output, - context: this.context, - internalFormat: this.getInternalFormat(), - textureFormat: this.getTextureFormat(), - kernel: this, - })); + this.mappedTextures.push( + new this.TextureConstructor({ + texture, + size: texSize, + dimensions: this.threadDim, + output: this.output, + context: this.context, + internalFormat: this.getInternalFormat(), + textureFormat: this.getTextureFormat(), + kernel: this, + }) + ); } } @@ -373,9 +381,9 @@ export class WebGL2Kernel extends WebGLKernel { const subKernels = this.subKernels; const variablePrecision = this.getVariablePrecisionString(this.texSize, this.tactic); if (subKernels === null || subKernels.length < 1) { - return `in ${ variablePrecision } vec2 vTexCoord;\n`; + return `in ${variablePrecision} vec2 vTexCoord;\n`; } else { - return `out ${ variablePrecision } vec2 vTexCoord;\n`; + return `out ${variablePrecision} vec2 vTexCoord;\n`; } } @@ -401,63 +409,41 @@ export class WebGL2Kernel extends WebGLKernel { const result = [this.getKernelResultDeclaration()]; const subKernels = this.subKernels; if (subKernels !== null) { - result.push( - 'layout(location = 0) out vec4 data0' - ); + result.push('layout(location = 0) out vec4 data0'); switch (this.returnType) { case 'Number': case 'Float': case 'Integer': for (let i = 0; i < subKernels.length; i++) { const subKernel = subKernels[i]; - result.push( - subKernel.returnType === 'Integer' ? - `int subKernelResult_${ subKernel.name } = 0` : - `float subKernelResult_${ subKernel.name } = 0.0`, - `layout(location = ${ i + 1 }) out vec4 data${ i + 1 }` - ); + result.push(subKernel.returnType === 'Integer' ? `int subKernelResult_${subKernel.name} = 0` : `float subKernelResult_${subKernel.name} = 0.0`, `layout(location = ${i + 1}) out vec4 data${i + 1}`); } break; case 'Array(2)': for (let i = 0; i < subKernels.length; i++) { - result.push( - `vec2 subKernelResult_${ subKernels[i].name }`, - `layout(location = ${ i + 1 }) out vec4 data${ i + 1 }` - ); + result.push(`vec2 subKernelResult_${subKernels[i].name}`, `layout(location = ${i + 1}) out vec4 data${i + 1}`); } break; case 'Array(3)': for (let i = 0; i < subKernels.length; i++) { - result.push( - `vec3 subKernelResult_${ subKernels[i].name }`, - `layout(location = ${ i + 1 }) out vec4 data${ i + 1 }` - ); + result.push(`vec3 subKernelResult_${subKernels[i].name}`, `layout(location = ${i + 1}) out vec4 data${i + 1}`); } break; case 'Array(4)': for (let i = 0; i < subKernels.length; i++) { - result.push( - `vec4 subKernelResult_${ subKernels[i].name }`, - `layout(location = ${ i + 1 }) out vec4 data${ i + 1 }` - ); + result.push(`vec4 subKernelResult_${subKernels[i].name}`, `layout(location = ${i + 1}) out vec4 data${i + 1}`); } break; } } else { - result.push( - 'out vec4 data0' - ); + result.push('out vec4 data0'); } return utils.linesToString(result) + this.translatedSource; } getMainResultGraphical() { - return utils.linesToString([ - ' threadId = indexTo3D(index, uOutputDim)', - ' kernel()', - ' data0 = actualColor', - ]); + return utils.linesToString([' threadId = indexTo3D(index, uOutputDim)', ' kernel()', ' data0 = actualColor']); } getMainResultPackedPixels() { @@ -466,8 +452,7 @@ export class WebGL2Kernel extends WebGLKernel { case 'Number': case 'Integer': case 'Float': - return this.getMainResultKernelPackedPixels() + - this.getMainResultSubKernelPackedPixels(); + return this.getMainResultKernelPackedPixels() + this.getMainResultSubKernelPackedPixels(); default: throw new Error(`packed output only usable with Numbers, "${this.returnType}" specified`); } @@ -477,11 +462,7 @@ export class WebGL2Kernel extends WebGLKernel { * @return {String} */ getMainResultKernelPackedPixels() { - return utils.linesToString([ - ' threadId = indexTo3D(index, uOutputDim)', - ' kernel()', - ` data0 = ${this.useLegacyEncoder ? 'legacyEncode32' : 'encode32'}(kernelResult)` - ]); + return utils.linesToString([' threadId = indexTo3D(index, uOutputDim)', ' kernel()', ` data0 = ${this.useLegacyEncoder ? 'legacyEncode32' : 'encode32'}(kernelResult)`]); } /** @@ -493,24 +474,16 @@ export class WebGL2Kernel extends WebGLKernel { for (let i = 0; i < this.subKernels.length; i++) { const subKernel = this.subKernels[i]; if (subKernel.returnType === 'Integer') { - result.push( - ` data${i + 1} = ${this.useLegacyEncoder ? 'legacyEncode32' : 'encode32'}(float(subKernelResult_${this.subKernels[i].name}))` - ); + result.push(` data${i + 1} = ${this.useLegacyEncoder ? 'legacyEncode32' : 'encode32'}(float(subKernelResult_${this.subKernels[i].name}))`); } else { - result.push( - ` data${i + 1} = ${this.useLegacyEncoder ? 'legacyEncode32' : 'encode32'}(subKernelResult_${this.subKernels[i].name})` - ); + result.push(` data${i + 1} = ${this.useLegacyEncoder ? 'legacyEncode32' : 'encode32'}(subKernelResult_${this.subKernels[i].name})`); } } return utils.linesToString(result); } getMainResultKernelMemoryOptimizedFloats(result, channel) { - result.push( - ' threadId = indexTo3D(index, uOutputDim)', - ' kernel()', - ` data0.${channel} = kernelResult` - ); + result.push(' threadId = indexTo3D(index, uOutputDim)', ' kernel()', ` data0.${channel} = kernelResult`); } getMainResultSubKernelMemoryOptimizedFloats(result, channel) { @@ -518,23 +491,15 @@ export class WebGL2Kernel extends WebGLKernel { for (let i = 0; i < this.subKernels.length; i++) { const subKernel = this.subKernels[i]; if (subKernel.returnType === 'Integer') { - result.push( - ` data${i + 1}.${channel} = float(subKernelResult_${subKernel.name})` - ); + result.push(` data${i + 1}.${channel} = float(subKernelResult_${subKernel.name})`); } else { - result.push( - ` data${i + 1}.${channel} = subKernelResult_${subKernel.name}` - ); + result.push(` data${i + 1}.${channel} = subKernelResult_${subKernel.name}`); } } } getMainResultKernelNumberTexture() { - return [ - ' threadId = indexTo3D(index, uOutputDim)', - ' kernel()', - ' data0[0] = kernelResult', - ]; + return [' threadId = indexTo3D(index, uOutputDim)', ' kernel()', ' data0[0] = kernelResult']; } getMainResultSubKernelNumberTexture() { @@ -543,25 +508,16 @@ export class WebGL2Kernel extends WebGLKernel { for (let i = 0; i < this.subKernels.length; ++i) { const subKernel = this.subKernels[i]; if (subKernel.returnType === 'Integer') { - result.push( - ` data${i + 1}[0] = float(subKernelResult_${subKernel.name})` - ); + result.push(` data${i + 1}[0] = float(subKernelResult_${subKernel.name})`); } else { - result.push( - ` data${i + 1}[0] = subKernelResult_${subKernel.name}` - ); + result.push(` data${i + 1}[0] = subKernelResult_${subKernel.name}`); } } return result; } getMainResultKernelArray2Texture() { - return [ - ' threadId = indexTo3D(index, uOutputDim)', - ' kernel()', - ' data0[0] = kernelResult[0]', - ' data0[1] = kernelResult[1]', - ]; + return [' threadId = indexTo3D(index, uOutputDim)', ' kernel()', ' data0[0] = kernelResult[0]', ' data0[1] = kernelResult[1]']; } getMainResultSubKernelArray2Texture() { @@ -569,22 +525,13 @@ export class WebGL2Kernel extends WebGLKernel { if (!this.subKernels) return result; for (let i = 0; i < this.subKernels.length; ++i) { const subKernel = this.subKernels[i]; - result.push( - ` data${i + 1}[0] = subKernelResult_${subKernel.name}[0]`, - ` data${i + 1}[1] = subKernelResult_${subKernel.name}[1]` - ); + result.push(` data${i + 1}[0] = subKernelResult_${subKernel.name}[0]`, ` data${i + 1}[1] = subKernelResult_${subKernel.name}[1]`); } return result; } getMainResultKernelArray3Texture() { - return [ - ' threadId = indexTo3D(index, uOutputDim)', - ' kernel()', - ' data0[0] = kernelResult[0]', - ' data0[1] = kernelResult[1]', - ' data0[2] = kernelResult[2]', - ]; + return [' threadId = indexTo3D(index, uOutputDim)', ' kernel()', ' data0[0] = kernelResult[0]', ' data0[1] = kernelResult[1]', ' data0[2] = kernelResult[2]']; } getMainResultSubKernelArray3Texture() { @@ -592,30 +539,20 @@ export class WebGL2Kernel extends WebGLKernel { if (!this.subKernels) return result; for (let i = 0; i < this.subKernels.length; ++i) { const subKernel = this.subKernels[i]; - result.push( - ` data${i + 1}[0] = subKernelResult_${subKernel.name}[0]`, - ` data${i + 1}[1] = subKernelResult_${subKernel.name}[1]`, - ` data${i + 1}[2] = subKernelResult_${subKernel.name}[2]` - ); + result.push(` data${i + 1}[0] = subKernelResult_${subKernel.name}[0]`, ` data${i + 1}[1] = subKernelResult_${subKernel.name}[1]`, ` data${i + 1}[2] = subKernelResult_${subKernel.name}[2]`); } return result; } getMainResultKernelArray4Texture() { - return [ - ' threadId = indexTo3D(index, uOutputDim)', - ' kernel()', - ' data0 = kernelResult', - ]; + return [' threadId = indexTo3D(index, uOutputDim)', ' kernel()', ' data0 = kernelResult']; } getMainResultSubKernelArray4Texture() { const result = []; if (!this.subKernels) return result; for (let i = 0; i < this.subKernels.length; ++i) { - result.push( - ` data${i + 1} = subKernelResult_${this.subKernels[i].name}` - ); + result.push(` data${i + 1} = subKernelResult_${this.subKernels[i].name}`); } return result; } @@ -634,4 +571,4 @@ export class WebGL2Kernel extends WebGLKernel { json.settings.threadDim = this.threadDim; return json; } -} \ No newline at end of file +} diff --git a/src/backend/web-gl2/vertex-shader.js b/src/backend/web-gl2/vertex-shader.js index 8ea12cd7..7e33b18a 100644 --- a/src/backend/web-gl2/vertex-shader.js +++ b/src/backend/web-gl2/vertex-shader.js @@ -13,4 +13,4 @@ uniform vec2 ratio; void main(void) { gl_Position = vec4((aPos + vec2(1)) * ratio + vec2(-1), 0, 1); vTexCoord = aTexCoord; -}`; \ No newline at end of file +}`; diff --git a/src/browser.js b/src/browser.js index 18835c04..99980955 100644 --- a/src/browser.js +++ b/src/browser.js @@ -22,29 +22,29 @@ import { FunctionTracer } from './backend/function-tracer'; import mathRandom from './plugins/math-random-uniformly-distributed'; -GPU.alias = alias -GPU.utils = utils -GPU.Input = Input -GPU.input = input -GPU.Texture = Texture -GPU.FunctionBuilder = FunctionBuilder -GPU.FunctionNode = FunctionNode -GPU.CPUFunctionNode = CPUFunctionNode -GPU.CPUKernel = CPUKernel - -GPU.WebGLFunctionNode = WebGLFunctionNode -GPU.WebGLKernel = WebGLKernel -GPU.webGLKernelValueMaps = webGLKernelValueMaps - -GPU.WebGL2FunctionNode = WebGL2FunctionNode -GPU.WebGL2Kernel = WebGL2Kernel -GPU.webGL2KernelValueMaps = webGL2KernelValueMaps - -GPU.Kernel = Kernel -GPU.FunctionTracer = FunctionTracer +GPU.alias = alias; +GPU.utils = utils; +GPU.Input = Input; +GPU.input = input; +GPU.Texture = Texture; +GPU.FunctionBuilder = FunctionBuilder; +GPU.FunctionNode = FunctionNode; +GPU.CPUFunctionNode = CPUFunctionNode; +GPU.CPUKernel = CPUKernel; + +GPU.WebGLFunctionNode = WebGLFunctionNode; +GPU.WebGLKernel = WebGLKernel; +GPU.webGLKernelValueMaps = webGLKernelValueMaps; + +GPU.WebGL2FunctionNode = WebGL2FunctionNode; +GPU.WebGL2Kernel = WebGL2Kernel; +GPU.webGL2KernelValueMaps = webGL2KernelValueMaps; + +GPU.Kernel = Kernel; +GPU.FunctionTracer = FunctionTracer; GPU.plugins = { mathRandom, -} +}; -export default GPU \ No newline at end of file +export default GPU; diff --git a/src/gpu.js b/src/gpu.js index 879d8071..2b8a39b4 100644 --- a/src/gpu.js +++ b/src/gpu.js @@ -6,7 +6,6 @@ import { WebGL2Kernel } from './backend/web-gl2/kernel'; import { WebGLKernel } from './backend/web-gl/kernel'; import { kernelRunShortcut } from './kernel-run-shortcut'; - /** * * @type {Array.} @@ -20,17 +19,17 @@ export const kernelOrder = [WebGL2Kernel, WebGLKernel]; export const kernelTypes = ['gpu', 'cpu']; const internalKernels = { - 'webgl2': WebGL2Kernel, - 'webgl': WebGLKernel, + webgl2: WebGL2Kernel, + webgl: WebGLKernel, }; /** - * - * @param {import('./backend/headless-gl/kernel').HeadlessGLKernel} HeadlessGLKernel + * + * @param {import('./backend/headless-gl/kernel').HeadlessGLKernel} HeadlessGLKernel */ export function setupNode(HeadlessGLKernel) { - kernelOrder.unshift(HeadlessGLKernel) - internalKernels.headlessgl = HeadlessGLKernel + kernelOrder.unshift(HeadlessGLKernel); + internalKernels.headlessgl = HeadlessGLKernel; } let validate = true; @@ -300,7 +299,7 @@ export class GPU { return existingKernel; } - const newKernel = switchableKernels[signature] = new Constructor(source, { + const newKernel = (switchableKernels[signature] = new Constructor(source, { argumentTypes, constantTypes: _kernel.constantTypes, graphical: _kernel.graphical, @@ -331,23 +330,26 @@ export class GPU { texture: _kernel.texture, mappedTextures: _kernel.mappedTextures, drawBuffersMap: _kernel.drawBuffersMap, - }); + })); newKernel.build.apply(newKernel, args); kernelRun.replaceKernel(newKernel); kernels.push(newKernel); return newKernel; } - const mergedSettings = Object.assign({ - context: this.context, - canvas: this.canvas, - functions: this.functions, - nativeFunctions: this.nativeFunctions, - injectedNative: this.injectedNative, - gpu: this, - validate, - onRequestFallback, - onRequestSwitchKernel - }, settingsCopy); + const mergedSettings = Object.assign( + { + context: this.context, + canvas: this.canvas, + functions: this.functions, + nativeFunctions: this.nativeFunctions, + injectedNative: this.injectedNative, + gpu: this, + validate, + onRequestFallback, + onRequestSwitchKernel, + }, + settingsCopy + ); const kernel = new this.Kernel(source, mergedSettings); const kernelRun = kernelRunShortcut(kernel); @@ -480,13 +482,10 @@ export class GPU { const context = arguments[0].context; const max = arguments.length - 1; for (let i = 0; i < max; i++) { - arguments[i] - .setCanvas(canvas) - .setContext(context) - .setPipeline(true); + arguments[i].setCanvas(canvas).setContext(context).setPipeline(true); } - return function() { + return function () { const texture = combinedKernel.apply(this, arguments); if (texture.toArray) { return texture.toArray(); @@ -579,7 +578,6 @@ export class GPU { } } - function upgradeDeprecatedCreateKernelSettings(settings) { if (!settings) { return {}; @@ -603,4 +601,4 @@ function upgradeDeprecatedCreateKernelSettings(settings) { upgradedSettings.optimizeFloatMemory = Boolean(settings.floatTextures); } return upgradedSettings; -} \ No newline at end of file +} diff --git a/src/index.d.ts b/src/index.d.ts index 40d86bd0..d7b8dc02 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -16,32 +16,10 @@ export class GPU { addFunction(kernel: GPUFunction, settings?: IGPUFunctionSettings): this; addNativeFunction(name: string, source: string, settings?: IGPUFunctionSettings): this; combineKernels(...kernels: KernelFunction[]): IKernelRunShortcut; - combineKernels(...kernels: KF[]): - ((...args: Parameters) => - ReturnType[] - | ReturnType[][] - | ReturnType[][][] - | Texture - | void - ) - & IKernelRunShortcutBase; + combineKernels(...kernels: KF[]): ((...args: Parameters) => ReturnType[] | ReturnType[][] | ReturnType[][][] | Texture | void) & IKernelRunShortcutBase; createKernel(kernel: KernelFunction, settings?: IGPUKernelSettings): IKernelRunShortcut; - createKernel(kernel: KernelType, settings?: IGPUKernelSettings): - ((...args: Parameters) => - ReturnType[] - | ReturnType[][] - | ReturnType[][][] - | Texture - | void - ) - & IKernelRunShortcutBase; - createKernelMap< - ArgTypes extends ThreadKernelVariable[], - ConstantsType = null, - >( - subKernels: ISubKernelObject, - rootKernel: ThreadFunction, - settings?: IGPUKernelSettings): (((this: IKernelFunctionThis, ...args: ArgTypes) => IMappedKernelResult) & IKernelMapRunShortcut); + createKernel(kernel: KernelType, settings?: IGPUKernelSettings): ((...args: Parameters) => ReturnType[] | ReturnType[][] | ReturnType[][][] | Texture | void) & IKernelRunShortcutBase; + createKernelMap(subKernels: ISubKernelObject, rootKernel: ThreadFunction, settings?: IGPUKernelSettings): ((this: IKernelFunctionThis, ...args: ArgTypes) => IMappedKernelResult) & IKernelMapRunShortcut; destroy(): Promise; Kernel: typeof Kernel; mode: string; @@ -50,15 +28,11 @@ export class GPU { } export interface ISubKernelObject { - [targetLocation: string]: - ((...args: ThreadKernelVariable[]) => ThreadFunctionResult) - | ((...args: any[]) => ThreadFunctionResult); + [targetLocation: string]: ((...args: ThreadKernelVariable[]) => ThreadFunctionResult) | ((...args: any[]) => ThreadFunctionResult); } export interface ISubKernelArray { - [index: number]: - ((...args: ThreadKernelVariable[]) => ThreadFunctionResult) - | ((...args: any[]) => ThreadFunctionResult); + [index: number]: ((...args: ThreadKernelVariable[]) => ThreadFunctionResult) | ((...args: any[]) => ThreadFunctionResult); } export interface ISubKernelsResults { @@ -76,7 +50,7 @@ export interface IGPUNativeFunction extends IGPUFunctionSettings { export interface IMappedKernelResult { result?: KernelVariable; - [targetLocation: string]: KernelVariable + [targetLocation: string]: KernelVariable; } export interface INativeFunction extends IGPUFunctionSettings { @@ -90,7 +64,7 @@ export interface IInternalNativeFunction extends IArgumentTypes { } export interface INativeFunctionList { - [name: string]: INativeFunction + [name: string]: INativeFunction; } export type GPUMode = 'gpu' | 'cpu' | 'dev'; @@ -105,39 +79,16 @@ export interface IGPUSettings { // format: 'Float32Array' | 'Float16Array' | 'Float' // WE WANT THIS! } -export type GPUVariableType - = 'Array' - | 'Array(2)' - | 'Array(3)' - | 'Array(4)' - | 'Array1D(2)' - | 'Array2D(2)' - | 'Array3D(2)' - | 'Array1D(3)' - | 'Array2D(3)' - | 'Array3D(3)' - | 'Array1D(4)' - | 'Array2D(4)' - | 'Array3D(4)' - | 'Boolean' - | 'HTMLCanvas' - | 'HTMLImage' - | 'HTMLImageArray' - | 'Number' - | 'Float' - | 'Integer' - | GPUTextureType; - -export type GPUTextureType - = 'NumberTexture' - | 'ArrayTexture(4)'; +export type GPUVariableType = 'Array' | 'Array(2)' | 'Array(3)' | 'Array(4)' | 'Array1D(2)' | 'Array2D(2)' | 'Array3D(2)' | 'Array1D(3)' | 'Array2D(3)' | 'Array3D(3)' | 'Array1D(4)' | 'Array2D(4)' | 'Array3D(4)' | 'Boolean' | 'HTMLCanvas' | 'HTMLImage' | 'HTMLImageArray' | 'Number' | 'Float' | 'Integer' | GPUTextureType; + +export type GPUTextureType = 'NumberTexture' | 'ArrayTexture(4)'; export interface IGPUArgumentTypes { [argumentName: string]: GPUVariableType; } export interface IGPUFunctionSettings { - argumentTypes?: IGPUArgumentTypes | string[], + argumentTypes?: IGPUArgumentTypes | string[]; returnType?: GPUVariableType; } @@ -179,7 +130,7 @@ export class Kernel { getVariablePrecisionString(textureSize?: number[], tactic?: Tactic, isInt?: boolean): string; prependString(value: string): void; hasPrependString(value: string): boolean; - constructor(kernel: KernelFunction|IKernelJSON|string, settings?: IDirectKernelSettings); + constructor(kernel: KernelFunction | IKernelJSON | string, settings?: IDirectKernelSettings); onRequestSwitchKernel?: Kernel; onActivate(previousKernel: Kernel): void; build(...args: KernelVariable[]): void; @@ -232,37 +183,21 @@ export class Kernel { setUniform4iv(name: string, value: [number, number, number, number]): void; } +export type GPUFunction = ThreadFunction | IFunction | IGPUFunction | string[]; -export type GPUFunction - = ThreadFunction - | IFunction - | IGPUFunction - | string[]; - -export type ThreadFunction = - ((this: IKernelFunctionThis, ...args: ArgTypes) => ThreadFunctionResult); +export type ThreadFunction = (this: IKernelFunctionThis, ...args: ArgTypes) => ThreadFunctionResult; export type Precision = 'single' | 'unsigned'; -export class CPUKernel extends Kernel { - -} -export class GLKernel extends Kernel { - -} -export class WebGLKernel extends GLKernel { - -} -export class WebGL2Kernel extends WebGLKernel { - -} -export class HeadlessGLKernel extends WebGLKernel { - -} +export class CPUKernel extends Kernel {} +export class GLKernel extends Kernel {} +export class WebGLKernel extends GLKernel {} +export class WebGL2Kernel extends WebGLKernel {} +export class HeadlessGLKernel extends WebGLKernel {} export interface IArgumentTypes { - argumentTypes: GPUVariableType[], - argumentNames: string[], + argumentTypes: GPUVariableType[]; + argumentNames: string[]; } export interface IConstants { @@ -309,12 +244,12 @@ export interface IKernelXYZ { } export interface FunctionList { - [functionName: string]: Function + [functionName: string]: Function; } export interface IGPUKernelSettings extends IKernelSettings { argumentTypes?: ITypesList; - functions?: Function[]|FunctionList; + functions?: Function[] | FunctionList; tactic?: Tactic; onRequestSwitchKernel?: Kernel; } @@ -335,17 +270,17 @@ export interface IKernelSettings { dynamicArguments?: boolean; constantTypes?: ITypesList; useLegacyEncoder?: boolean; - nativeFunctions?: IGPUNativeFunction[], + nativeFunctions?: IGPUNativeFunction[]; strictIntegers?: boolean; } export interface IDirectKernelSettings extends IKernelSettings { argumentTypes?: string[]; - functions?: string[]|IFunction; + functions?: string[] | IFunction; } export interface ITypesList { - [typeName: string]: GPUVariableType + [typeName: string]: GPUVariableType; } export interface IKernelRunShortcutBase extends Kernel { @@ -354,12 +289,9 @@ export interface IKernelRunShortcutBase extends Kernel { exec(): Promise; } -export interface IKernelRunShortcut extends IKernelRunShortcutBase { +export interface IKernelRunShortcut extends IKernelRunShortcutBase {} -} - -export interface IKernelMapRunShortcut extends IKernelRunShortcutBase< - { result: KernelOutput } & { [key in keyof SubKernelType]: KernelOutput }> {} +export interface IKernelMapRunShortcut extends IKernelRunShortcutBase<{ result: KernelOutput } & { [key in keyof SubKernelType]: KernelOutput }> {} export interface IKernelFeatures { isFloatRead: boolean; @@ -382,70 +314,17 @@ export interface IKernelFunctionThis { output: IKernelXYZ; thread: IKernelXYZ; constants: ConstantsT; - color(r: number): void, - color(r: number, g: number): void, - color(r: number, g: number, b: number): void, - color(r: number, g: number, b: number, a: number): void, -} - -export type KernelVariable = - boolean - | number - | Texture - | Input - | HTMLCanvasElement - | OffscreenCanvas - | HTMLVideoElement - | HTMLImageElement - | HTMLImageElement[] - | ImageBitmap - | ImageData - | Float32Array - | Uint8Array - | Uint16Array - | Uint32Array - | Uint8ClampedArray - | KernelOutput; - -export type ThreadFunctionResult - = number - | number[] - | number[][] - | [number, number] - | [number, number, number] - | [number, number, number, number] - | Pixel - | Boolean; - -export type ThreadKernelVariable - = boolean - | number - | number[] - | number[][] - | number[][][] - - | Float32Array - | Float32Array[] - | Float32Array[][] - - | Pixel - | Pixel[][] - - | [number, number] - | [number, number][] - | [number, number][][] - | [number, number][][][] - - | [number, number, number] - | [number, number, number][] - | [number, number, number][][] - | [number, number, number][][][] - - | [number, number, number, number] - | [number, number, number, number][] - | [number, number, number, number][][] - | [number, number, number, number][][][] - ; + color(r: number): void; + color(r: number, g: number): void; + color(r: number, g: number, b: number): void; + color(r: number, g: number, b: number, a: number): void; +} + +export type KernelVariable = boolean | number | Texture | Input | HTMLCanvasElement | OffscreenCanvas | HTMLVideoElement | HTMLImageElement | HTMLImageElement[] | ImageBitmap | ImageData | Float32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | KernelOutput; + +export type ThreadFunctionResult = number | number[] | number[][] | [number, number] | [number, number, number] | [number, number, number, number] | Pixel | Boolean; + +export type ThreadKernelVariable = boolean | number | number[] | number[][] | number[][][] | Float32Array | Float32Array[] | Float32Array[][] | Pixel | Pixel[][] | [number, number] | [number, number][] | [number, number][][] | [number, number][][][] | [number, number, number] | [number, number, number][] | [number, number, number][][] | [number, number, number][][][] | [number, number, number, number] | [number, number, number, number][] | [number, number, number, number][][] | [number, number, number, number][][][]; export type Pixel = { r: number; @@ -460,35 +339,10 @@ export type Pixel = { // ) => KernelOutput); export interface KernelFunction { - ( - this: IKernelFunctionThis, - ...args: ArgT - ): KernelOutput; + (this: IKernelFunctionThis, ...args: ArgT): KernelOutput; } -export type KernelOutput = void - | number - | number[] - | number[][] - | number[][][] - - | Float32Array - | Float32Array[] - | Float32Array[][] - - | [number, number][] - | [number, number, number][] - | [number, number, number, number][] - - | [number, number][][] - | [number, number, number][][] - | [number, number, number, number][][] - - | [number, number][][][] - | [number, number, number][][][] - | [number, number, number, number][][][] - - | Texture; +export type KernelOutput = void | number | number[] | number[][] | number[][][] | Float32Array | Float32Array[] | Float32Array[][] | [number, number][] | [number, number, number][] | [number, number, number, number][] | [number, number][][] | [number, number, number][][] | [number, number, number, number][][] | [number, number][][][] | [number, number, number][][][] | [number, number, number, number][][][] | Texture; export interface IFunction { source: string; @@ -525,7 +379,6 @@ export interface ISubKernel { returnType: string; } - export class FunctionBuilder { static fromKernel(kernel: Kernel, FunctionNode: FunctionNode, extraNodeOptions?: any): FunctionBuilder; constructor(settings: IFunctionBuilderSettings); @@ -537,7 +390,6 @@ export class FunctionBuilder { getPrototypeString(functionName: string): string; } - export interface IFunctionBuilderSettings { kernel: Kernel; rootNode: FunctionNode; @@ -552,7 +404,7 @@ export class FunctionNode implements IFunctionSettings { } export interface IFunctionNodeSettings extends IFunctionSettings { - argumentTypes: string[] + argumentTypes: string[]; } export class WebGLFunctionNode extends FunctionNode {} @@ -571,7 +423,7 @@ export interface IGPUTextureSettings { } export class Texture { - constructor(settings: IGPUTextureSettings) + constructor(settings: IGPUTextureSettings); toArray(): TextureArrayOutput; clone(): Texture; delete(): void; @@ -579,27 +431,7 @@ export class Texture { kernel: Kernel; } -export type TextureArrayOutput - = number[] - | number[][] - | number[][][] - - | Float32Array - | Float32Array[] - | Float32Array[][] - - | [number, number][] - | [number, number][][] - | [number, number][][][] - - | [number, number, number][] - | [number, number, number][][] - | [number, number, number][][][] - - | [number, number, number, number][] - | [number, number, number, number][][] - | [number, number, number, number][][][] - ; +export type TextureArrayOutput = number[] | number[][] | number[][][] | Float32Array | Float32Array[] | Float32Array[][] | [number, number][] | [number, number][][] | [number, number][][][] | [number, number, number][] | [number, number, number][][] | [number, number, number][][][] | [number, number, number, number][] | [number, number, number, number][][] | [number, number, number, number][][][]; export interface IPlugin { source: string; @@ -662,8 +494,8 @@ export interface IJSONSettings { } export declare const utils: { - getMinifySafeName: (arrowReference: () => T) => string -} + getMinifySafeName: (arrowReference: () => T) => string; +}; export interface IReason { type: 'argumentMismatch' | 'outputPrecisionMismatch'; diff --git a/src/index.js b/src/index.js index eb199122..1cc8700a 100644 --- a/src/index.js +++ b/src/index.js @@ -7,9 +7,11 @@ describe('Test Node GPU', () => { it('should find and use gpu runner', () => { const gpu = new GPU({ mode: 'gpu' }); - const kernel = gpu.createKernel(function() { - return 1; - }).setOutput([1]); + const kernel = gpu + .createKernel(function () { + return 1; + }) + .setOutput([1]); const result = kernel(); @@ -20,19 +22,16 @@ describe('Test Node GPU', () => { it('supports 2x2 size', () => { const gpu = new GPU({ mode: 'gpu' }); - const kernel = gpu.createKernel(function() { - return this.thread.x * this.thread.y; - }).setOutput([2, 2]); + const kernel = gpu + .createKernel(function () { + return this.thread.x * this.thread.y; + }) + .setOutput([2, 2]); const result = kernel(); expect(gpu.runner.constructor).to.equal(GPU.HeadlessGLRunner); - expect(result).to.deep.equal( - [ - Float32Array.from([0, 0]), - Float32Array.from([0, 1]) - ] - ); + expect(result).to.deep.equal([Float32Array.from([0, 0]), Float32Array.from([0, 1])]); }); }); @@ -40,9 +39,11 @@ describe('Test Node GPU', () => { it('should find and use gpu runner', () => { const gpu = new GPU({ mode: 'cpu' }); - const kernel = gpu.createKernel(function() { - return 1; - }).setOutput([1]); + const kernel = gpu + .createKernel(function () { + return 1; + }) + .setOutput([1]); const result = kernel(); @@ -53,19 +54,16 @@ describe('Test Node GPU', () => { it('supports 2x2 size', () => { const gpu = new GPU({ mode: 'cpu' }); - const kernel = gpu.createKernel(function() { - return this.thread.x * this.thread.y; - }).setOutput([2, 2]); + const kernel = gpu + .createKernel(function () { + return this.thread.x * this.thread.y; + }) + .setOutput([2, 2]); const result = kernel(); expect(gpu.runner.constructor).to.equal(GPU.CPURunner); - expect(result).to.deep.equal( - [ - Float32Array.from([0, 0]), - Float32Array.from([0, 1]) - ] - ); + expect(result).to.deep.equal([Float32Array.from([0, 0]), Float32Array.from([0, 1])]); }); }); -}); \ No newline at end of file +}); diff --git a/src/input.js b/src/input.js index 1f7af4ec..65660701 100644 --- a/src/input.js +++ b/src/input.js @@ -1,4 +1,4 @@ -import { utils } from "./utils"; +import { utils } from './utils'; export class Input { constructor(value, size) { @@ -18,19 +18,18 @@ export class Input { const [w, h, d] = this.size; if (d) { - if (this.value.length !== (w * h * d)) { - throw new Error(`Input size ${this.value.length} does not match ${w} * ${h} * ${d} = ${(h * w * d)}`); + if (this.value.length !== w * h * d) { + throw new Error(`Input size ${this.value.length} does not match ${w} * ${h} * ${d} = ${h * w * d}`); } } else if (h) { - if (this.value.length !== (w * h)) { - throw new Error(`Input size ${this.value.length} does not match ${w} * ${h} = ${(h * w)}`); + if (this.value.length !== w * h) { + throw new Error(`Input size ${this.value.length} does not match ${w} * ${h} = ${h * w}`); } } else { if (this.value.length !== w) { throw new Error(`Input size ${this.value.length} does not match ${w}`); } } - } toArray() { @@ -47,4 +46,4 @@ export class Input { export function input(value, size) { return new Input(value, size); -} \ No newline at end of file +} diff --git a/src/kernel-run-shortcut.js b/src/kernel-run-shortcut.js index dc34eb75..18a60d88 100644 --- a/src/kernel-run-shortcut.js +++ b/src/kernel-run-shortcut.js @@ -6,9 +6,9 @@ import { utils } from './utils'; * @returns {function()} */ export function kernelRunShortcut(kernel) { - let run = function() { + let run = function () { kernel.build.apply(kernel, arguments); - run = function() { + run = function () { let result = kernel.run.apply(kernel, arguments); if (kernel.switchingKernels) { const reasons = kernel.resetSwitchingKernels(); @@ -26,14 +26,14 @@ export function kernelRunShortcut(kernel) { }; return run.apply(kernel, arguments); }; - const shortcut = function() { + const shortcut = function () { return run.apply(kernel, arguments); }; /** * Run kernel in async mode * @returns {Promise} */ - shortcut.exec = function() { + shortcut.exec = function () { return new Promise((accept, reject) => { try { accept(run.apply(this, arguments)); @@ -42,7 +42,7 @@ export function kernelRunShortcut(kernel) { } }); }; - shortcut.replaceKernel = function(replacementKernel) { + shortcut.replaceKernel = function (replacementKernel) { kernel = replacementKernel; bindKernelToShortcut(kernel, shortcut); }; @@ -62,21 +62,21 @@ function bindKernelToShortcut(kernel, shortcut) { if (property[0] === '_' && property[1] === '_') continue; if (typeof kernel[property] === 'function') { if (property.substring(0, 3) === 'add' || property.substring(0, 3) === 'set') { - shortcut[property] = function() { + shortcut[property] = function () { shortcut.kernel[property].apply(shortcut.kernel, arguments); return shortcut; }; } else { - shortcut[property] = function() { + shortcut[property] = function () { return shortcut.kernel[property].apply(shortcut.kernel, arguments); }; } } else { shortcut.__defineGetter__(property, () => shortcut.kernel[property]); - shortcut.__defineSetter__(property, (value) => { + shortcut.__defineSetter__(property, value => { shortcut.kernel[property] = value; }); } } shortcut.kernel = kernel; -} \ No newline at end of file +} diff --git a/src/plugins/math-random-triangle-noise.js b/src/plugins/math-random-triangle-noise.js index c8aecd0b..acc1eb34 100644 --- a/src/plugins/math-random-triangle-noise.js +++ b/src/plugins/math-random-triangle-noise.js @@ -34,7 +34,7 @@ const functionReplace = 'nrand(vTexCoord)'; const functionReturnType = 'Number'; -const onBeforeRun = (kernel) => { +const onBeforeRun = kernel => { kernel.setUniform1f('triangle_noise_seed', Math.random()); }; @@ -48,5 +48,5 @@ export default { functionMatch, functionReplace, functionReturnType, - source -}; \ No newline at end of file + source, +}; diff --git a/src/plugins/math-random-uniformly-distributed.js b/src/plugins/math-random-uniformly-distributed.js index 6fd8e3bb..42ce8d11 100644 --- a/src/plugins/math-random-uniformly-distributed.js +++ b/src/plugins/math-random-uniformly-distributed.js @@ -29,7 +29,7 @@ const functionReturnType = 'Number'; * * @param {Kernel} kernel */ -const onBeforeRun = (kernel) => { +const onBeforeRun = kernel => { kernel.setUniform1f('randomSeed1', Math.random()); kernel.setUniform1f('randomSeed2', Math.random()); }; @@ -44,7 +44,7 @@ const plugin = { functionMatch, functionReplace, functionReturnType, - source + source, }; -export default plugin; \ No newline at end of file +export default plugin; diff --git a/src/texture.js b/src/texture.js index a3436f49..15a9e9d1 100644 --- a/src/texture.js +++ b/src/texture.js @@ -4,17 +4,7 @@ */ export class Texture { constructor(settings) { - const { - texture, - size, - dimensions, - output, - context, - type = 'NumberTexture', - kernel, - internalFormat, - textureFormat - } = settings; + const { texture, size, dimensions, output, context, type = 'NumberTexture', kernel, internalFormat, textureFormat } = settings; if (!output) throw new Error('settings property "output" required.'); if (!context) throw new Error('settings property "context" required.'); if (!texture) throw new Error('settings property "texture" required.'); @@ -65,4 +55,4 @@ export class Texture { clear() { throw new Error(`Not implemented on ${this.constructor.name}`); } -} \ No newline at end of file +} diff --git a/src/utils.js b/src/utils.js index 726891e7..6654dc0d 100644 --- a/src/utils.js +++ b/src/utils.js @@ -3,7 +3,7 @@ import { Input } from './input'; import { Texture } from './texture'; const FUNCTION_NAME = /function ([^(]*)/; -const STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg; +const STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm; const ARGUMENT_NAMES = /([^\s,]+)/g; /** @@ -38,7 +38,7 @@ export const utils = { * @returns {Boolean} TRUE if the object is a JS function */ isFunction(funcObj) { - return typeof(funcObj) === 'function'; + return typeof funcObj === 'function'; }, /** @@ -50,9 +50,7 @@ export const utils = { */ isFunctionString(fn) { if (typeof fn === 'string') { - return (fn - .slice(0, 'function'.length) - .toLowerCase() === 'function'); + return fn.slice(0, 'function'.length).toLowerCase() === 'function'; } return false; }, @@ -362,7 +360,7 @@ export const utils = { do { props.push.apply(props, Object.getOwnPropertyNames(obj)); - } while (obj = Object.getPrototypeOf(obj)); + } while ((obj = Object.getPrototypeOf(obj))); return props; }, @@ -380,14 +378,14 @@ export const utils = { }, warnDeprecated(type, oldName, newName) { if (newName) { - console.warn(`You are using a deprecated ${ type } "${ oldName }". It has been replaced with "${ newName }". Fixing, but please upgrade as it will soon be removed.`); + console.warn(`You are using a deprecated ${type} "${oldName}". It has been replaced with "${newName}". Fixing, but please upgrade as it will soon be removed.`); } else { - console.warn(`You are using a deprecated ${ type } "${ oldName }". It has been removed. Fixing, but please upgrade as it will soon be removed.`); + console.warn(`You are using a deprecated ${type} "${oldName}". It has been removed. Fixing, but please upgrade as it will soon be removed.`); } }, flipPixels: (pixels, width, height) => { // https://stackoverflow.com/a/41973289/1324039 - const halfHeight = height / 2 | 0; // the | 0 keeps the result an int + const halfHeight = (height / 2) | 0; // the | 0 keeps the result an int const bytesPerRow = width * 4; // make a temp buffer to hold one row const temp = new Uint8ClampedArray(width * 4); @@ -424,7 +422,7 @@ export const utils = { for (let z = 0; z < depth; z++) { const yResults = new Array(height); for (let y = 0; y < height; y++) { - const xStart = (z * height * width) + y * width; + const xStart = z * height * width + y * width; const xEnd = xStart + width; yResults[y] = array.subarray(xStart, xEnd); } @@ -448,7 +446,7 @@ export const utils = { for (let z = 0; z < depth; z++) { const yResults = new Array(height); for (let y = 0; y < height; y++) { - const offset = (z * height * width) + (y * width); + const offset = z * height * width + y * width; yResults[y] = array.subarray(offset, offset + width); } zResults[z] = yResults; @@ -524,7 +522,7 @@ export const utils = { const yResults = new Array(height); for (let y = 0; y < height; y++) { const xResults = new Array(width); - const offset = (z * xResultsMax * height) + (y * xResultsMax); + const offset = z * xResultsMax * height + y * xResultsMax; let i = 0; for (let x = 0; x < xResultsMax; x += 4) { xResults[i++] = array.subarray(x + offset, x + offset + 2); @@ -565,7 +563,7 @@ export const utils = { const yResults = new Array(height); for (let y = 0; y < height; y++) { const xResults = new Array(width); - const offset = (z * xResultsMax * height) + (y * xResultsMax); + const offset = z * xResultsMax * height + y * xResultsMax; let i = 0; for (let x = 0; x < xResultsMax; x += 4) { xResults[i++] = array.subarray(x + offset, x + offset + 3); @@ -606,7 +604,7 @@ export const utils = { const yResults = new Array(height); for (let y = 0; y < height; y++) { const xResults = new Array(width); - const offset = (z * xResultsMax * height) + (y * xResultsMax); + const offset = z * xResultsMax * height + y * xResultsMax; let i = 0; for (let x = 0; x < xResultsMax; x += 4) { xResults[i++] = array.subarray(x + offset, x + offset + 4); @@ -646,7 +644,7 @@ export const utils = { case 'Program': return flatten(ast.body) + (ast.body[0].type === 'VariableDeclaration' ? ';' : ''); case 'FunctionDeclaration': - return `function ${ast.id.name}(${ast.params.map(flatten).join(', ')}) ${ flatten(ast.body) }`; + return `function ${ast.id.name}(${ast.params.map(flatten).join(', ')}) ${flatten(ast.body)}`; case 'BlockStatement': { const result = []; indent += 2; @@ -660,7 +658,8 @@ export const utils = { return `{\n${result.join('')}}`; } case 'VariableDeclaration': - const declarations = utils.normalizeDeclarations(ast) + const declarations = utils + .normalizeDeclarations(ast) .map(flatten) .filter(r => r !== null); if (declarations.length < 1) { @@ -760,7 +759,7 @@ export const utils = { return flatten(ast.key); } } - throw new Error(`unhandled ast.type of ${ ast.type }`); + throw new Error(`unhandled ast.type of ${ast.type}`); } const result = flatten(ast); if (functionDependencies.length > 0) { @@ -777,7 +776,7 @@ export const utils = { return result; }, - normalizeDeclarations: (ast) => { + normalizeDeclarations: ast => { if (ast.type !== 'VariableDeclaration') throw new Error('Ast is not of type "VariableDeclaration"'); const normalizedDeclarations = []; for (let declarationIndex = 0; declarationIndex < ast.declarations.length; declarationIndex++) { @@ -794,7 +793,7 @@ export const utils = { type: 'VariableDeclarator', id: { type: 'Identifier', - name: subProperty.key.name + name: subProperty.key.name, }, init: { type: 'MemberExpression', @@ -803,16 +802,16 @@ export const utils = { object: declaration.init, property: { type: 'Identifier', - name: property.key.name + name: property.key.name, }, - computed: false + computed: false, }, property: { type: 'Identifier', - name: subProperty.key.name + name: subProperty.key.name, }, - computed: false - } + computed: false, + }, }); } else { throw new Error('unexpected state'); @@ -823,17 +822,17 @@ export const utils = { type: 'VariableDeclarator', id: { type: 'Identifier', - name: property.value && property.value.name ? property.value.name : property.key.name + name: property.value && property.value.name ? property.value.name : property.key.name, }, init: { type: 'MemberExpression', object: declaration.init, property: { type: 'Identifier', - name: property.key.name + name: property.key.name, }, - computed: false - } + computed: false, + }, }); } else { throw new Error('unexpected state'); @@ -848,7 +847,7 @@ export const utils = { type: 'VariableDeclarator', id: { type: 'Identifier', - name: element.name + name: element.name, }, init: { type: 'MemberExpression', @@ -858,10 +857,10 @@ export const utils = { value: elementIndex, raw: elementIndex.toString(), start: element.start, - end: element.end + end: element.end, }, - computed: true - } + computed: true, + }, }); } else { throw new Error('unexpected state'); @@ -881,44 +880,51 @@ export const utils = { * @return {Array} */ splitHTMLImageToRGB: (gpu, image) => { - const rKernel = gpu.createKernel(function(a) { - const pixel = a[this.thread.y][this.thread.x]; - return pixel.r * 255; - }, { - output: [image.width, image.height], - precision: 'unsigned', - argumentTypes: { a: 'HTMLImage' }, - }); - const gKernel = gpu.createKernel(function(a) { - const pixel = a[this.thread.y][this.thread.x]; - return pixel.g * 255; - }, { - output: [image.width, image.height], - precision: 'unsigned', - argumentTypes: { a: 'HTMLImage' }, - }); - const bKernel = gpu.createKernel(function(a) { - const pixel = a[this.thread.y][this.thread.x]; - return pixel.b * 255; - }, { - output: [image.width, image.height], - precision: 'unsigned', - argumentTypes: { a: 'HTMLImage' }, - }); - const aKernel = gpu.createKernel(function(a) { - const pixel = a[this.thread.y][this.thread.x]; - return pixel.a * 255; - }, { - output: [image.width, image.height], - precision: 'unsigned', - argumentTypes: { a: 'HTMLImage' }, - }); - const result = [ - rKernel(image), - gKernel(image), - bKernel(image), - aKernel(image), - ]; + const rKernel = gpu.createKernel( + function (a) { + const pixel = a[this.thread.y][this.thread.x]; + return pixel.r * 255; + }, + { + output: [image.width, image.height], + precision: 'unsigned', + argumentTypes: { a: 'HTMLImage' }, + } + ); + const gKernel = gpu.createKernel( + function (a) { + const pixel = a[this.thread.y][this.thread.x]; + return pixel.g * 255; + }, + { + output: [image.width, image.height], + precision: 'unsigned', + argumentTypes: { a: 'HTMLImage' }, + } + ); + const bKernel = gpu.createKernel( + function (a) { + const pixel = a[this.thread.y][this.thread.x]; + return pixel.b * 255; + }, + { + output: [image.width, image.height], + precision: 'unsigned', + argumentTypes: { a: 'HTMLImage' }, + } + ); + const aKernel = gpu.createKernel( + function (a) { + const pixel = a[this.thread.y][this.thread.x]; + return pixel.a * 255; + }, + { + output: [image.width, image.height], + precision: 'unsigned', + argumentTypes: { a: 'HTMLImage' }, + } + ); + const result = [rKernel(image), gKernel(image), bKernel(image), aKernel(image)]; result.rKernel = rKernel; result.gKernel = gKernel; result.bKernel = bKernel; @@ -936,54 +942,61 @@ export const utils = { * @return {Object[]} */ splitRGBAToCanvases: (gpu, rgba, width, height) => { - const visualKernelR = gpu.createKernel(function(v) { - const pixel = v[this.thread.y][this.thread.x]; - this.color(pixel.r / 255, 0, 0, 255); - }, { - output: [width, height], - graphical: true, - argumentTypes: { v: 'Array2D(4)' } - }); + const visualKernelR = gpu.createKernel( + function (v) { + const pixel = v[this.thread.y][this.thread.x]; + this.color(pixel.r / 255, 0, 0, 255); + }, + { + output: [width, height], + graphical: true, + argumentTypes: { v: 'Array2D(4)' }, + } + ); visualKernelR(rgba); - const visualKernelG = gpu.createKernel(function(v) { - const pixel = v[this.thread.y][this.thread.x]; - this.color(0, pixel.g / 255, 0, 255); - }, { - output: [width, height], - graphical: true, - argumentTypes: { v: 'Array2D(4)' } - }); + const visualKernelG = gpu.createKernel( + function (v) { + const pixel = v[this.thread.y][this.thread.x]; + this.color(0, pixel.g / 255, 0, 255); + }, + { + output: [width, height], + graphical: true, + argumentTypes: { v: 'Array2D(4)' }, + } + ); visualKernelG(rgba); - const visualKernelB = gpu.createKernel(function(v) { - const pixel = v[this.thread.y][this.thread.x]; - this.color(0, 0, pixel.b / 255, 255); - }, { - output: [width, height], - graphical: true, - argumentTypes: { v: 'Array2D(4)' } - }); + const visualKernelB = gpu.createKernel( + function (v) { + const pixel = v[this.thread.y][this.thread.x]; + this.color(0, 0, pixel.b / 255, 255); + }, + { + output: [width, height], + graphical: true, + argumentTypes: { v: 'Array2D(4)' }, + } + ); visualKernelB(rgba); - const visualKernelA = gpu.createKernel(function(v) { - const pixel = v[this.thread.y][this.thread.x]; - this.color(255, 255, 255, pixel.a / 255); - }, { - output: [width, height], - graphical: true, - argumentTypes: { v: 'Array2D(4)' } - }); + const visualKernelA = gpu.createKernel( + function (v) { + const pixel = v[this.thread.y][this.thread.x]; + this.color(255, 255, 255, pixel.a / 255); + }, + { + output: [width, height], + graphical: true, + argumentTypes: { v: 'Array2D(4)' }, + } + ); visualKernelA(rgba); - return [ - visualKernelR.canvas, - visualKernelG.canvas, - visualKernelB.canvas, - visualKernelA.canvas, - ]; + return [visualKernelR.canvas, visualKernelG.canvas, visualKernelB.canvas, visualKernelA.canvas]; }, - getMinifySafeName: (fn) => { + getMinifySafeName: fn => { try { const ast = acorn.parse(`const value = ${fn.toString()}`); const { init } = ast.body[0].declarations[0]; @@ -992,7 +1005,7 @@ export const utils = { throw new Error('Unrecognized function type. Please use `() => yourFunctionVariableHere` or function() { return yourFunctionVariableHere; }'); } }, - sanitizeName: function(name) { + sanitizeName: function (name) { if (dollarSign.test(name)) { name = name.replace(dollarSign, 'S_S'); } @@ -1002,11 +1015,11 @@ export const utils = { name = name.replace(singleUnderscore, 'u_u'); } return name; - } + }, }; const dollarSign = /\$/; const doubleUnderscore = /__/; const singleUnderscore = /_/; -const _systemEndianness = utils.getSystemEndianness(); \ No newline at end of file +const _systemEndianness = utils.getSystemEndianness(); diff --git a/test/all-template.html b/test/all-template.html index 6e1afb75..7f2f9536 100644 --- a/test/all-template.html +++ b/test/all-template.html @@ -1,41 +1,41 @@ - - - GPU.JS : Test All - + + + GPU.JS : Test All + - - - - - -

-
- + + + + +
+
+ - - - - {{test-files}} - + window.process = { + cwd: () => { + return '../..'; + }, + }; + window.require = module => { + if (module.match(/[.][.]\/src$/)) return browserGPU; + if (module === 'sinon') return sinon; + if (module === 'qunit') return QUnit; + if (module === 'acorn') return acorn; + if (module.match(/[.][.]\/browser-test-utils$/)) return browserTestUtils; + throw new Error('cannot find ' + module); + }; + + + + + {{test-files}} + diff --git a/test/all.html b/test/all.html index 4333257b..e2e6260b 100644 --- a/test/all.html +++ b/test/all.html @@ -1,328 +1,328 @@ - - - GPU.JS : Test All - + + + GPU.JS : Test All + - - - - - -
-
- + + + + +
+
+ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + window.process = { + cwd: () => { + return '../..'; + }, + }; + window.require = module => { + if (module.match(/[.][.]\/src$/)) return browserGPU; + if (module === 'sinon') return sinon; + if (module === 'qunit') return QUnit; + if (module === 'acorn') return acorn; + if (module.match(/[.][.]\/browser-test-utils$/)) return browserTestUtils; + throw new Error('cannot find ' + module); + }; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/benchmark-faster.js b/test/benchmark-faster.js index a41e505c..d28a2016 100644 --- a/test/benchmark-faster.js +++ b/test/benchmark-faster.js @@ -1,7 +1,7 @@ const { GPU } = require('../src/index.js'); const Benchmark = require('benchmark'); -const suite = new Benchmark.Suite; +const suite = new Benchmark.Suite(); const size = 512; @@ -9,35 +9,35 @@ const gpu = new GPU({ mode: 'gpu' }); const cpu = new GPU({ mode: 'cpu' }); const gpuKernel = gpu - .createKernel(function(i, j) { + .createKernel(function (i, j) { return i[this.thread.x] + j[this.thread.x]; }) .setOutput([size, size]); const gpuArg1 = gpu - .createKernel(function() { + .createKernel(function () { return 0.89; }) .setPipeline(true) .setOutput([size, size])(); const gpuArg2 = gpu - .createKernel(function() { + .createKernel(function () { return this.thread.x; }) .setPipeline(true) .setOutput([size, size])(); const cpuKernel = cpu - .createKernel(function(i, j) { + .createKernel(function (i, j) { return i[this.thread.x] + j[this.thread.x]; }) .setOutput([size, size]); const cpuArg1 = cpu - .createKernel(function() { + .createKernel(function () { return 0.89; }) .setOutput([size, size])(); const cpuArg2 = cpu - .createKernel(function() { + .createKernel(function () { return this.thread.x; }) .setOutput([size, size])(); @@ -49,7 +49,7 @@ suite .add('cpu', () => { cpuKernel(cpuArg1, cpuArg2); }) - .on('cycle', (event) => { + .on('cycle', event => { console.log(String(event.target)); }) .on('complete', function () { diff --git a/test/benchmark.js b/test/benchmark.js index 86e72d14..afa3326e 100644 --- a/test/benchmark.js +++ b/test/benchmark.js @@ -12,7 +12,7 @@ const b = randomMatrix(size, size); function randomMatrix(width, height) { const matrix = new Array(height); for (let y = 0; y < height; y++) { - const row = matrix[y] = new Float32Array(width); + const row = (matrix[y] = new Float32Array(width)); for (let x = 0; x < width; x++) { row[x] = Math.random(); } @@ -21,7 +21,7 @@ function randomMatrix(width, height) { } const gpuKernel = gpu - .createKernel(function(a, b) { + .createKernel(function (a, b) { let sum = 0; for (let i = 0; i < this.constants.size; i++) { sum += a[this.thread.y][i] * b[i][this.thread.x]; @@ -29,14 +29,14 @@ const gpuKernel = gpu return sum; }) .setConstants({ - size + size, }) .setPipeline(false) .setPrecision('unsigned') .setOutput([size, size]); const cpuKernel = cpu - .createKernel(function(a, b) { + .createKernel(function (a, b) { let sum = 0; for (let i = 0; i < this.constants.size; i++) { sum += a[this.thread.y][i] * b[i][this.thread.x]; @@ -44,7 +44,7 @@ const cpuKernel = cpu return sum; }) .setConstants({ - size + size, }) .setOutput([size, size]); @@ -61,7 +61,7 @@ suite cpuKernel(a, b); }) // add listeners - .on('cycle', (event) => { + .on('cycle', event => { console.log(String(event.target)); }) .on('complete', function () { diff --git a/test/browser-test-utils.js b/test/browser-test-utils.js index f3020caf..00deb4e1 100644 --- a/test/browser-test-utils.js +++ b/test/browser-test-utils.js @@ -15,12 +15,7 @@ function imageToArray(image) { const row = []; result.unshift(row); for (let x = 0; x < image.width; x++) { - const pixel = new Float32Array([ - data[i++], - data[i++], - data[i++], - data[i++], - ]); + const pixel = new Float32Array([data[i++], data[i++], data[i++], data[i++]]); row.push(pixel); } } @@ -28,7 +23,7 @@ function imageToArray(image) { } function loadImage(image) { - return new Promise((resolve) => { + return new Promise(resolve => { if (typeof image === 'string') { const src = image; image = new Image(); @@ -59,9 +54,12 @@ function check2DImage(result, expected, channel) { function greenCanvas(mode, width, height) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function() { - this.color(0, 1, 0, 1); - }, { output: [width, height], graphical: true }); + const kernel = gpu.createKernel( + function () { + this.color(0, 1, 0, 1); + }, + { output: [width, height], graphical: true } + ); kernel(); const canvas = kernel.canvas; gpu.destroy(); @@ -80,4 +78,3 @@ if (typeof window !== 'undefined') { } else { module.exports = _exports; } - diff --git a/test/features/add-custom-function.js b/test/features/add-custom-function.js index 70e350e0..a2387242 100644 --- a/test/features/add-custom-function.js +++ b/test/features/add-custom-function.js @@ -8,11 +8,14 @@ function inGPUInstanceSettings(mode) { return a + b; } const gpu = new GPU({ mode, functions: [customAdder] }); - const kernel = gpu.createKernel(function(a, b) { - return customAdder(a[this.thread.x], b[this.thread.x]); - }, { - output: [6] - }); + const kernel = gpu.createKernel( + function (a, b) { + return customAdder(a[this.thread.x], b[this.thread.x]); + }, + { + output: [6], + } + ); const a = [1, 2, 3, 5, 6, 7]; const b = [4, 5, 6, 1, 2, 3]; @@ -49,18 +52,19 @@ test('in GPU instance settings cpu', () => { inGPUInstanceSettings('cpu'); }); - function withGPUAddFunctionMethod(mode) { function customAdder(a, b) { return a + b; } - const gpu = new GPU({ mode }) - .addFunction(customAdder); - const kernel = gpu.createKernel(function(a, b) { - return customAdder(a[this.thread.x], b[this.thread.x]); - }, { - output: [6] - }); + const gpu = new GPU({ mode }).addFunction(customAdder); + const kernel = gpu.createKernel( + function (a, b) { + return customAdder(a[this.thread.x], b[this.thread.x]); + }, + { + output: [6], + } + ); const a = [1, 2, 3, 5, 6, 7]; const b = [4, 5, 6, 1, 2, 3]; @@ -102,14 +106,15 @@ function inKernelInstanceSettings(mode) { return a + b; } const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(a, b) { - return customAdder(a[this.thread.x], b[this.thread.x]); - }, { - output: [6], - functions: [ - customAdder - ], - }); + const kernel = gpu.createKernel( + function (a, b) { + return customAdder(a[this.thread.x], b[this.thread.x]); + }, + { + output: [6], + functions: [customAdder], + } + ); const a = [1, 2, 3, 5, 6, 7]; const b = [4, 5, 6, 1, 2, 3]; @@ -151,11 +156,15 @@ function withKernelAddFunctionMethod(mode) { return a + b; } const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(a, b) { - return customAdder(a[this.thread.x], b[this.thread.x]); - }, { - output: [6] - }) + const kernel = gpu + .createKernel( + function (a, b) { + return customAdder(a[this.thread.x], b[this.thread.x]); + }, + { + output: [6], + } + ) .addFunction(customAdder); const a = [1, 2, 3, 5, 6, 7]; @@ -208,13 +217,16 @@ function sumAB(mode) { gpu.addFunction(customAdder); - const kernel = gpu.createKernel(function(a, b) { - return customAdder(a, b); - }, { - output: [6], - constants: { width: 6 }, - precision: 'unsigned', - }); + const kernel = gpu.createKernel( + function (a, b) { + return customAdder(a, b); + }, + { + output: [6], + constants: { width: 6 }, + precision: 'unsigned', + } + ); assert.ok(kernel !== null, 'function generated test'); @@ -265,11 +277,14 @@ function sumABThisOutputX(mode) { return sum; } - const kernel = gpu.createKernel(function(a, b) { - return customAdder(a, b); - }, { - output: [6], - }); + const kernel = gpu.createKernel( + function (a, b) { + return customAdder(a, b); + }, + { + output: [6], + } + ); assert.ok(kernel !== null, 'function generated test'); @@ -307,24 +322,26 @@ test('sumABThisOutputX cpu', () => { sumABThisOutputX('cpu'); }); - describe('features: add custom private'); function addCustomPrivate(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(a, b) { - function customAdder(a, b) { - let sum = 0; - for (let i = 0; i < this.output.x; i++) { - sum += a[this.thread.x] + b[this.thread.x]; + const kernel = gpu.createKernel( + function (a, b) { + function customAdder(a, b) { + let sum = 0; + for (let i = 0; i < this.output.x; i++) { + sum += a[this.thread.x] + b[this.thread.x]; + } + return sum; } - return sum; + return customAdder(a, b); + }, + { + output: [6], } - return customAdder(a, b); - }, { - output: [6], - }); + ); assert.ok(kernel !== null, 'function generated test'); @@ -370,9 +387,12 @@ function testSetFunctionsFromArrayOnKernel(mode) { function custom() { return 1; } - const kernel = gpu.createKernel(function() { - return custom(); - }, { output: [1] }); + const kernel = gpu.createKernel( + function () { + return custom(); + }, + { output: [1] } + ); kernel.setFunctions([custom]); assert.equal(kernel()[0], 1); gpu.destroy(); @@ -406,12 +426,20 @@ describe('features: setFunctions from array on kernel'); function testSetFunctionsFromArrayOnGPU(mode) { const gpu = new GPU({ mode }); - assert.equal(gpu.setFunctions([function custom() { - return 1; - }]), gpu); - const kernel = gpu.createKernel(function() { - return custom(); - }, { output: [1] }); + assert.equal( + gpu.setFunctions([ + function custom() { + return 1; + }, + ]), + gpu + ); + const kernel = gpu.createKernel( + function () { + return custom(); + }, + { output: [1] } + ); assert.equal(kernel()[0], 1); gpu.destroy(); } @@ -444,7 +472,8 @@ describe('features: setFunctions from array on kernel'); function testAddIGPUFunction(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(value) { + const kernel = gpu + .createKernel(function (value) { return custom(value); }) .setOutput([1]) @@ -482,4 +511,4 @@ test('gpu', () => { test('cpu', () => { testAddIGPUFunction('cpu'); -}); \ No newline at end of file +}); diff --git a/test/features/add-custom-native-function.js b/test/features/add-custom-native-function.js index 5c8cd9df..ef3c436c 100644 --- a/test/features/add-custom-native-function.js +++ b/test/features/add-custom-native-function.js @@ -15,11 +15,14 @@ function nativeDivide(mode, fn) { gpu.addNativeFunction('divide', fn, { returnType: 'Number' }); - const f = gpu.createKernel(function(a, b) { - return divide(a[this.thread.x], b[this.thread.x]); - }, { - output: [6] - }); + const f = gpu.createKernel( + function (a, b) { + return divide(a[this.thread.x], b[this.thread.x]); + }, + { + output: [6], + } + ); assert.ok(f !== null, 'function generated test'); @@ -59,31 +62,35 @@ test('nativeDivide cpu', () => { nativeDivide('cpu', jsDivide); }); - describe('features: instantiate native and override'); function divideOverride(mode) { const gpu = new GPU({ mode, functions: [divide], - nativeFunctions: [{ - name: 'divide', - // deliberately add, rather than divide, to ensure native functions are treated as more important than regular ones - source: `float divide(float a, float b) { + nativeFunctions: [ + { + name: 'divide', + // deliberately add, rather than divide, to ensure native functions are treated as more important than regular ones + source: `float divide(float a, float b) { return a + b; - }` - }] + }`, + }, + ], }); function divide(a, b) { return a / b; } - const kernel = gpu.createKernel(function(a, b) { - return divide(a[this.thread.x], b[this.thread.x]); - }, { - output: [6] - }); + const kernel = gpu.createKernel( + function (a, b) { + return divide(a[this.thread.x], b[this.thread.x]); + }, + { + output: [6], + } + ); const a = [1, 4, 3, 5, 6, 3]; const b = [4, 2, 6, 1, 2, 3]; @@ -121,24 +128,29 @@ function argumentCasting(mode) { const gpu = new GPU({ mode, functions: [divide], - nativeFunctions: [{ - // deliberately add, rather than divide, to ensure native functions are treated as more important than regular ones - name: 'divide', - source: `float divide(int a, int b) { + nativeFunctions: [ + { + // deliberately add, rather than divide, to ensure native functions are treated as more important than regular ones + name: 'divide', + source: `float divide(int a, int b) { return float(a + b); - }` - }] + }`, + }, + ], }); function divide(a, b) { return a / b; } - const kernel = gpu.createKernel(function(a, b) { - return divide(a[this.thread.x], b[this.thread.x]); - }, { - output: [6] - }); + const kernel = gpu.createKernel( + function (a, b) { + return divide(a[this.thread.x], b[this.thread.x]); + }, + { + output: [6], + } + ); const a = [1, 4, 3, 5, 6, 3]; const b = [4, 2, 6, 1, 2, 3]; @@ -170,31 +182,35 @@ test('argumentCasting (GPU only) gpu', () => { argumentCasting('headlessgl'); }); - describe('features: mixed argument casting'); function mixedArgumentCasting(mode) { const gpu = new GPU({ mode, functions: [divide], - nativeFunctions: [{ - // deliberately add, rather than divide, to ensure native functions are treated as more important than regular ones - name: 'divide', - source: `float divide(int a, float b) { + nativeFunctions: [ + { + // deliberately add, rather than divide, to ensure native functions are treated as more important than regular ones + name: 'divide', + source: `float divide(int a, float b) { return float(a + int(b)); - }` - }] + }`, + }, + ], }); function divide(a, b) { return a / b; } - const kernel = gpu.createKernel(function(a, b) { - return divide(a[this.thread.x], b[this.thread.x]); - }, { - output: [6] - }); + const kernel = gpu.createKernel( + function (a, b) { + return divide(a[this.thread.x], b[this.thread.x]); + }, + { + output: [6], + } + ); const a = [1, 4, 3, 5, 6, 3]; const b = [4, 2, 6, 1, 2, 3]; @@ -232,24 +248,29 @@ function returnTypeCasting(mode) { const gpu = new GPU({ mode, functions: [divide], - nativeFunctions: [{ - // deliberately add, rather than divide, to ensure native functions are treated as more important than regular ones - name: 'divide', - source: `int divide(float a, float b) { + nativeFunctions: [ + { + // deliberately add, rather than divide, to ensure native functions are treated as more important than regular ones + name: 'divide', + source: `int divide(float a, float b) { return int(a + b); - }` - }] + }`, + }, + ], }); function divide(a, b) { return a / b; } - const kernel = gpu.createKernel(function(a, b) { - return divide(a[this.thread.x], b[this.thread.x]); - }, { - output: [6] - }); + const kernel = gpu.createKernel( + function (a, b) { + return divide(a[this.thread.x], b[this.thread.x]); + }, + { + output: [6], + } + ); const a = [1, 4, 3, 5, 6, 3]; const b = [4, 2, 6, 1, 2, 3]; @@ -285,72 +306,101 @@ describe('features: Adding nativeFunctions directly on kernel'); function testDirectlyOnKernelViaSettings(nativeFunctions, mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(v) { - return native(v[this.thread.x]); - }, { - output: [1], - nativeFunctions - }); + const kernel = gpu.createKernel( + function (v) { + return native(v[this.thread.x]); + }, + { + output: [1], + nativeFunctions, + } + ); assert.equal(kernel([1])[0], 2); gpu.destroy(); } test('via settings auto', () => { - testDirectlyOnKernelViaSettings([{ - name: 'native', - source: `float native(float value) { + testDirectlyOnKernelViaSettings([ + { + name: 'native', + source: `float native(float value) { return 1.0 + value; - }` - }]) + }`, + }, + ]); }); test('via settings gpu', () => { - testDirectlyOnKernelViaSettings([{ - name: 'native', - source: `float native(float value) { + testDirectlyOnKernelViaSettings( + [ + { + name: 'native', + source: `float native(float value) { return 1.0 + value; - }` - }], 'gpu') + }`, + }, + ], + 'gpu' + ); }); (GPU.isWebGLSupported ? test : skip)('via settings webgl', () => { - testDirectlyOnKernelViaSettings([{ - name: 'native', - source: `float native(float value) { + testDirectlyOnKernelViaSettings( + [ + { + name: 'native', + source: `float native(float value) { return 1.0 + value; - }` - }], 'webgl') + }`, + }, + ], + 'webgl' + ); }); (GPU.isWebGL2Supported ? test : skip)('via settings webgl2', () => { - testDirectlyOnKernelViaSettings([{ - name: 'native', - source: `float native(float value) { + testDirectlyOnKernelViaSettings( + [ + { + name: 'native', + source: `float native(float value) { return 1.0 + value; - }` - }], 'webgl2') + }`, + }, + ], + 'webgl2' + ); }); (GPU.isHeadlessGLSupported ? test : skip)('via settings headlessgl', () => { - testDirectlyOnKernelViaSettings([{ - name: 'native', - source: `float native(float value) { + testDirectlyOnKernelViaSettings( + [ + { + name: 'native', + source: `float native(float value) { return 1.0 + value; - }` - }], 'headlessgl') + }`, + }, + ], + 'headlessgl' + ); }); test('via settings cpu', () => { - testDirectlyOnKernelViaSettings([{ - name: 'native', - source: `function native(value) { + testDirectlyOnKernelViaSettings( + [ + { + name: 'native', + source: `function native(value) { return 1.0 + value; }`, - returnType: 'Float' - }], 'cpu') + returnType: 'Float', + }, + ], + 'cpu' + ); }); - describe('features: Adding nativeFunctions directly on kernel'); /** @@ -360,78 +410,111 @@ describe('features: Adding nativeFunctions directly on kernel'); */ function testDirectlyOnKernelViaMethod(nativeFunctions, mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(v) { - return native(v[this.thread.x]); - }, { - output: [1] - }) + const kernel = gpu + .createKernel( + function (v) { + return native(v[this.thread.x]); + }, + { + output: [1], + } + ) .setNativeFunctions(nativeFunctions); assert.equal(kernel([1])[0], 2); gpu.destroy(); } test('via method auto', () => { - testDirectlyOnKernelViaMethod([{ - name: 'native', - source: `float native(float value) { + testDirectlyOnKernelViaMethod([ + { + name: 'native', + source: `float native(float value) { return 1.0 + value; - }` - }]) + }`, + }, + ]); }); test('via method gpu', () => { - testDirectlyOnKernelViaMethod([{ - name: 'native', - source: `float native(float value) { + testDirectlyOnKernelViaMethod( + [ + { + name: 'native', + source: `float native(float value) { return 1.0 + value; - }` - }], 'gpu') + }`, + }, + ], + 'gpu' + ); }); (GPU.isWebGLSupported ? test : skip)('via method webgl', () => { - testDirectlyOnKernelViaMethod([{ - name: 'native', - source: `float native(float value) { + testDirectlyOnKernelViaMethod( + [ + { + name: 'native', + source: `float native(float value) { return 1.0 + value; - }` - }], 'webgl') + }`, + }, + ], + 'webgl' + ); }); (GPU.isWebGL2Supported ? test : skip)('via method webgl2', () => { - testDirectlyOnKernelViaMethod([{ - name: 'native', - source: `float native(float value) { + testDirectlyOnKernelViaMethod( + [ + { + name: 'native', + source: `float native(float value) { return 1.0 + value; - }` - }], 'webgl2') + }`, + }, + ], + 'webgl2' + ); }); (GPU.isHeadlessGLSupported ? test : skip)('via method headlessgl', () => { - testDirectlyOnKernelViaMethod([{ - name: 'native', - source: `float native(float value) { + testDirectlyOnKernelViaMethod( + [ + { + name: 'native', + source: `float native(float value) { return 1.0 + value; - }` - }], 'headlessgl') + }`, + }, + ], + 'headlessgl' + ); }); test('via method cpu', () => { - testDirectlyOnKernelViaMethod([{ - name: 'native', - source: `function native(value) { + testDirectlyOnKernelViaMethod( + [ + { + name: 'native', + source: `function native(value) { return 1.0 + value; }`, - returnType: 'Float' - }], 'cpu') + returnType: 'Float', + }, + ], + 'cpu' + ); }); - function testSetNativeFunctionsFromArrayOnGPU(nativeFunction, mode) { const gpu = new GPU({ mode }); assert.equal(gpu.setNativeFunctions([nativeFunction]), gpu); - const kernel = gpu.createKernel(function() { - return custom(); - }, { output: [1] }); + const kernel = gpu.createKernel( + function () { + return custom(); + }, + { output: [1] } + ); assert.equal(kernel()[0], 1); gpu.destroy(); } @@ -441,52 +524,67 @@ test('auto', () => { name: 'custom', source: `float custom() { return 1.0; - }` + }`, }); }); test('gpu', () => { - testSetNativeFunctionsFromArrayOnGPU({ - name: 'custom', - source: `float custom() { + testSetNativeFunctionsFromArrayOnGPU( + { + name: 'custom', + source: `float custom() { return 1.0; - }` - }, 'gpu'); + }`, + }, + 'gpu' + ); }); (GPU.isWebGLSupported ? test : skip)('webgl', () => { - testSetNativeFunctionsFromArrayOnGPU({ - name: 'custom', - source: `float custom() { + testSetNativeFunctionsFromArrayOnGPU( + { + name: 'custom', + source: `float custom() { return 1.0; - }` - }, 'webgl'); + }`, + }, + 'webgl' + ); }); (GPU.isWebGL2Supported ? test : skip)('webgl2', () => { - testSetNativeFunctionsFromArrayOnGPU({ - name: 'custom', - source: `float custom() { + testSetNativeFunctionsFromArrayOnGPU( + { + name: 'custom', + source: `float custom() { return 1.0; - }` - }, 'webgl2'); + }`, + }, + 'webgl2' + ); }); (GPU.isHeadlessGLSupported ? test : skip)('headlessgl', () => { - testSetNativeFunctionsFromArrayOnGPU({ - name: 'custom', - source: `float custom() { + testSetNativeFunctionsFromArrayOnGPU( + { + name: 'custom', + source: `float custom() { return 1.0; - }` - }, 'headlessgl'); + }`, + }, + 'headlessgl' + ); }); test('cpu', () => { - testSetNativeFunctionsFromArrayOnGPU({ - name: 'custom', - source: `function custom() { + testSetNativeFunctionsFromArrayOnGPU( + { + name: 'custom', + source: `function custom() { return 1.0; }`, - returnType: 'Number' - }, 'cpu'); -}); \ No newline at end of file + returnType: 'Number', + }, + 'cpu' + ); +}); diff --git a/test/features/add-typed-functions.js b/test/features/add-typed-functions.js index 0fae969c..116eb36d 100644 --- a/test/features/add-typed-functions.js +++ b/test/features/add-typed-functions.js @@ -10,9 +10,10 @@ function vec2Test(mode) { return [1, 2]; } gpu.addFunction(typedFunction, { - returnType: 'Array(2)' + returnType: 'Array(2)', }); - const kernel = gpu.createKernel(function() { + const kernel = gpu + .createKernel(function () { const result = typedFunction(); return result[0] + result[1]; }) @@ -39,7 +40,6 @@ test('Array(2) - gpu', () => { vec2Test('headlessgl'); }); - describe('features: add typed functions vec3Test'); function vec3Test(mode) { @@ -49,9 +49,10 @@ function vec3Test(mode) { return [1, 2, 3]; } gpu.addFunction(typedFunction, { - returnType: 'Array(3)' + returnType: 'Array(3)', }); - const kernel = gpu.createKernel(function() { + const kernel = gpu + .createKernel(function () { const result = typedFunction(); return result[0] + result[1] + result[2]; }) @@ -86,9 +87,10 @@ function vec4Test(mode) { return [1, 2, 3, 4]; } gpu.addFunction(typedFunction, { - returnType: 'Array(4)' + returnType: 'Array(4)', }); - const kernel = gpu.createKernel(function() { + const kernel = gpu + .createKernel(function () { const result = typedFunction(); return result[0] + result[1] + result[2] + result[3]; }) @@ -112,4 +114,4 @@ test('Array(4) - gpu', () => { }); (GPU.isHeadlessGLSupported ? test : skip)('Array(4) - headlessgl', () => { vec4Test('headlessgl'); -}); \ No newline at end of file +}); diff --git a/test/features/argument-array-types.js b/test/features/argument-array-types.js index 69b55ee2..2b7cbb8c 100644 --- a/test/features/argument-array-types.js +++ b/test/features/argument-array-types.js @@ -5,13 +5,16 @@ describe('argument array types'); function testSinglePrecisionArray2(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(value) { - return value[0] + value[1]; - }, { - output: [1], - argumentTypes: { value: 'Array(2)' }, - precision: 'single', - }); + const kernel = gpu.createKernel( + function (value) { + return value[0] + value[1]; + }, + { + output: [1], + argumentTypes: { value: 'Array(2)' }, + precision: 'single', + } + ); const result = kernel(new Float32Array([1, 2])); assert.equal(result[0], 3); gpu.destroy(); @@ -43,13 +46,16 @@ test('single precision Array(2) cpu', () => { function testUnsignedPrecisionArray2(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(value) { - return value[0] + value[1]; - }, { - output: [1], - argumentTypes: { value: 'Array(2)' }, - precision: 'unsigned', - }); + const kernel = gpu.createKernel( + function (value) { + return value[0] + value[1]; + }, + { + output: [1], + argumentTypes: { value: 'Array(2)' }, + precision: 'unsigned', + } + ); const result = kernel(new Float32Array([1, 2])); assert.equal(result[0], 3); gpu.destroy(); @@ -81,13 +87,16 @@ test('unsigned precision Array(2) cpu', () => { function testSinglePrecisionArray3(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(value) { - return value[0] + value[1] + value[2]; - }, { - output: [1], - argumentTypes: { value: 'Array(3)' }, - precision: 'single', - }); + const kernel = gpu.createKernel( + function (value) { + return value[0] + value[1] + value[2]; + }, + { + output: [1], + argumentTypes: { value: 'Array(3)' }, + precision: 'single', + } + ); const result = kernel(new Float32Array([1, 2, 3])); assert.equal(result[0], 6); gpu.destroy(); @@ -119,13 +128,16 @@ test('single precision Array(3) cpu', () => { function testUnsignedPrecisionArray3(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(value) { - return value[0] + value[1] + value[2]; - }, { - output: [1], - argumentTypes: { value: 'Array(3)' }, - precision: 'unsigned', - }); + const kernel = gpu.createKernel( + function (value) { + return value[0] + value[1] + value[2]; + }, + { + output: [1], + argumentTypes: { value: 'Array(3)' }, + precision: 'unsigned', + } + ); const result = kernel(new Float32Array([1, 2, 3])); assert.equal(result[0], 6); gpu.destroy(); @@ -157,13 +169,16 @@ test('unsigned precision Array(3) cpu', () => { function testSinglePrecisionArray4(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(value) { - return value[0] + value[1] + value[2] + value[3]; - }, { - output: [1], - argumentTypes: { value: 'Array(4)' }, - precision: 'single', - }); + const kernel = gpu.createKernel( + function (value) { + return value[0] + value[1] + value[2] + value[3]; + }, + { + output: [1], + argumentTypes: { value: 'Array(4)' }, + precision: 'single', + } + ); const result = kernel(new Float32Array([1, 2, 3, 4])); assert.equal(result[0], 10); gpu.destroy(); @@ -195,13 +210,16 @@ test('single precision Array(4) cpu', () => { function testUnsignedPrecisionArray4(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(value) { - return value[0] + value[1] + value[2] + value[3]; - }, { - output: [1], - argumentTypes: { value: 'Array(4)' }, - precision: 'unsigned', - }); + const kernel = gpu.createKernel( + function (value) { + return value[0] + value[1] + value[2] + value[3]; + }, + { + output: [1], + argumentTypes: { value: 'Array(4)' }, + precision: 'unsigned', + } + ); const result = kernel(new Float32Array([1, 2, 3, 4])); assert.equal(result[0], 10); gpu.destroy(); @@ -229,4 +247,4 @@ test('unsigned precision Array(4) gpu', () => { test('unsigned precision Array(4) cpu', () => { testUnsignedPrecisionArray4('cpu'); -}); \ No newline at end of file +}); diff --git a/test/features/argument-array1d-types.js b/test/features/argument-array1d-types.js index f575a692..e88bb61d 100644 --- a/test/features/argument-array1d-types.js +++ b/test/features/argument-array1d-types.js @@ -5,19 +5,17 @@ describe('argument array 1 types'); function testSinglePrecisionArray1D2(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(value) { - return value[this.thread.x]; - }, { - output: [4], - argumentTypes: { value: 'Array1D(2)' }, - precision: 'single', - }); - const value = [ - new Float32Array([1, 2]), - new Float32Array([3, 4]), - new Float32Array([5, 6]), - new Float32Array([7, 8]), - ]; + const kernel = gpu.createKernel( + function (value) { + return value[this.thread.x]; + }, + { + output: [4], + argumentTypes: { value: 'Array1D(2)' }, + precision: 'single', + } + ); + const value = [new Float32Array([1, 2]), new Float32Array([3, 4]), new Float32Array([5, 6]), new Float32Array([7, 8])]; const result = kernel(value); assert.deepEqual(result, value); gpu.destroy(); @@ -49,19 +47,17 @@ test('single precision Array1D(2) cpu', () => { function testUnsignedPrecisionArray1D2(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(value) { - return value[this.thread.x]; - }, { - output: [4], - argumentTypes: { value: 'Array1D(2)' }, - precision: 'unsigned', - }); - const value = [ - new Float32Array([1, 2]), - new Float32Array([3, 4]), - new Float32Array([5, 6]), - new Float32Array([7, 8]), - ]; + const kernel = gpu.createKernel( + function (value) { + return value[this.thread.x]; + }, + { + output: [4], + argumentTypes: { value: 'Array1D(2)' }, + precision: 'unsigned', + } + ); + const value = [new Float32Array([1, 2]), new Float32Array([3, 4]), new Float32Array([5, 6]), new Float32Array([7, 8])]; const result = kernel(value); assert.deepEqual(result, value); gpu.destroy(); @@ -93,19 +89,17 @@ test('fallback unsigned precision Array1D(2) cpu', () => { function testSinglePrecisionArray1D3(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(value) { - return value[this.thread.x]; - }, { - output: [4], - argumentTypes: { value: 'Array1D(3)' }, - precision: 'single', - }); - const value = [ - new Float32Array([1, 2, 3]), - new Float32Array([4, 5, 6]), - new Float32Array([7, 8, 9]), - new Float32Array([10, 11, 12]), - ]; + const kernel = gpu.createKernel( + function (value) { + return value[this.thread.x]; + }, + { + output: [4], + argumentTypes: { value: 'Array1D(3)' }, + precision: 'single', + } + ); + const value = [new Float32Array([1, 2, 3]), new Float32Array([4, 5, 6]), new Float32Array([7, 8, 9]), new Float32Array([10, 11, 12])]; const result = kernel(value); assert.deepEqual(result, value); gpu.destroy(); @@ -137,19 +131,17 @@ test('single precision Array1D(3) cpu', () => { function testUnsignedPrecisionArray1D3(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(value) { - return value[this.thread.x]; - }, { - output: [4], - argumentTypes: { value: 'Array1D(3)' }, - precision: 'unsigned', - }); - const value = [ - new Float32Array([1, 2, 3]), - new Float32Array([4, 5, 6]), - new Float32Array([7, 8, 9]), - new Float32Array([10, 11, 12]), - ]; + const kernel = gpu.createKernel( + function (value) { + return value[this.thread.x]; + }, + { + output: [4], + argumentTypes: { value: 'Array1D(3)' }, + precision: 'unsigned', + } + ); + const value = [new Float32Array([1, 2, 3]), new Float32Array([4, 5, 6]), new Float32Array([7, 8, 9]), new Float32Array([10, 11, 12])]; const result = kernel(value); assert.deepEqual(result, value); assert.deepEqual(result, value); @@ -182,19 +174,17 @@ test('fallback unsigned precision Array1D(3) cpu', () => { function testUnsignedPrecisionArray1D4(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(value) { - return value[this.thread.x]; - }, { - output: [4], - argumentTypes: { value: 'Array1D(4)' }, - precision: 'unsigned', - }); - const value = [ - new Float32Array([1, 2, 3, 4]), - new Float32Array([5, 6, 7, 8]), - new Float32Array([9, 10, 11, 12]), - new Float32Array([13, 14, 15, 16]), - ]; + const kernel = gpu.createKernel( + function (value) { + return value[this.thread.x]; + }, + { + output: [4], + argumentTypes: { value: 'Array1D(4)' }, + precision: 'unsigned', + } + ); + const value = [new Float32Array([1, 2, 3, 4]), new Float32Array([5, 6, 7, 8]), new Float32Array([9, 10, 11, 12]), new Float32Array([13, 14, 15, 16])]; const result = kernel(value); assert.deepEqual(result, value); assert.deepEqual(result, value); @@ -223,4 +213,4 @@ test('fallback unsigned precision Array1D(4) gpu', () => { test('fallback unsigned precision Array1D(4) cpu', () => { testUnsignedPrecisionArray1D4('cpu'); -}); \ No newline at end of file +}); diff --git a/test/features/argument-array2d-types.js b/test/features/argument-array2d-types.js index 8b4fe3f0..28eb1cdf 100644 --- a/test/features/argument-array2d-types.js +++ b/test/features/argument-array2d-types.js @@ -5,26 +5,19 @@ describe('argument array 2 types'); function testSinglePrecisionArray2D2(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(value) { - return value[this.thread.y][this.thread.x]; - }, { - output: [4, 2], - argumentTypes: { value: 'Array2D(2)' }, - precision: 'single', - }); + const kernel = gpu.createKernel( + function (value) { + return value[this.thread.y][this.thread.x]; + }, + { + output: [4, 2], + argumentTypes: { value: 'Array2D(2)' }, + precision: 'single', + } + ); const value = [ - [ - new Float32Array([1, 2]), - new Float32Array([3, 4]), - new Float32Array([5, 6]), - new Float32Array([7, 8]), - ], - [ - new Float32Array([9, 10]), - new Float32Array([11, 12]), - new Float32Array([13, 14]), - new Float32Array([15, 16]), - ] + [new Float32Array([1, 2]), new Float32Array([3, 4]), new Float32Array([5, 6]), new Float32Array([7, 8])], + [new Float32Array([9, 10]), new Float32Array([11, 12]), new Float32Array([13, 14]), new Float32Array([15, 16])], ]; const result = kernel(value); assert.deepEqual(result, value); @@ -57,26 +50,19 @@ test('single precision Array2D(2) cpu', () => { function testUnsignedPrecisionArray2D2(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(value) { - return value[this.thread.y][this.thread.x]; - }, { - output: [4, 2], - argumentTypes: { value: 'Array2D(2)' }, - precision: 'unsigned', - }); + const kernel = gpu.createKernel( + function (value) { + return value[this.thread.y][this.thread.x]; + }, + { + output: [4, 2], + argumentTypes: { value: 'Array2D(2)' }, + precision: 'unsigned', + } + ); const value = [ - [ - new Float32Array([1, 2]), - new Float32Array([3, 4]), - new Float32Array([5, 6]), - new Float32Array([7, 8]), - ], - [ - new Float32Array([9, 10]), - new Float32Array([11, 12]), - new Float32Array([13, 14]), - new Float32Array([15, 16]), - ] + [new Float32Array([1, 2]), new Float32Array([3, 4]), new Float32Array([5, 6]), new Float32Array([7, 8])], + [new Float32Array([9, 10]), new Float32Array([11, 12]), new Float32Array([13, 14]), new Float32Array([15, 16])], ]; const result = kernel(value); assert.deepEqual(result, value); @@ -109,26 +95,19 @@ test('fallback unsigned precision Array2D(2) cpu', () => { function testSinglePrecisionArray2D3(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(value) { - return value[this.thread.y][this.thread.x]; - }, { - output: [4, 2], - argumentTypes: { value: 'Array2D(3)' }, - precision: 'single', - }); + const kernel = gpu.createKernel( + function (value) { + return value[this.thread.y][this.thread.x]; + }, + { + output: [4, 2], + argumentTypes: { value: 'Array2D(3)' }, + precision: 'single', + } + ); const value = [ - [ - new Float32Array([1, 2, 3]), - new Float32Array([4, 5, 6]), - new Float32Array([7, 8, 9]), - new Float32Array([10, 11, 12]), - ], - [ - new Float32Array([13, 14, 15]), - new Float32Array([16, 17, 18]), - new Float32Array([19, 20, 21]), - new Float32Array([22, 23, 25]), - ] + [new Float32Array([1, 2, 3]), new Float32Array([4, 5, 6]), new Float32Array([7, 8, 9]), new Float32Array([10, 11, 12])], + [new Float32Array([13, 14, 15]), new Float32Array([16, 17, 18]), new Float32Array([19, 20, 21]), new Float32Array([22, 23, 25])], ]; const result = kernel(value); assert.deepEqual(result, value); @@ -161,26 +140,19 @@ test('single precision Array2D(3) cpu', () => { function testUnsignedPrecisionArray2D3(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(value) { - return value[this.thread.y][this.thread.x]; - }, { - output: [4, 2], - argumentTypes: { value: 'Array2D(3)' }, - precision: 'unsigned', - }); + const kernel = gpu.createKernel( + function (value) { + return value[this.thread.y][this.thread.x]; + }, + { + output: [4, 2], + argumentTypes: { value: 'Array2D(3)' }, + precision: 'unsigned', + } + ); const value = [ - [ - new Float32Array([1, 2, 3]), - new Float32Array([4, 5, 6]), - new Float32Array([7, 8, 9]), - new Float32Array([10, 11, 12]), - ], - [ - new Float32Array([13, 14, 15]), - new Float32Array([16, 17, 18]), - new Float32Array([19, 20, 21]), - new Float32Array([22, 23, 25]), - ] + [new Float32Array([1, 2, 3]), new Float32Array([4, 5, 6]), new Float32Array([7, 8, 9]), new Float32Array([10, 11, 12])], + [new Float32Array([13, 14, 15]), new Float32Array([16, 17, 18]), new Float32Array([19, 20, 21]), new Float32Array([22, 23, 25])], ]; const result = kernel(value); assert.deepEqual(result, value); @@ -213,26 +185,19 @@ test('fallback unsigned precision Array2D(3) cpu', () => { function testSinglePrecisionArray2D4(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(value) { - return value[this.thread.y][this.thread.x]; - }, { - output: [4, 2], - argumentTypes: { value: 'Array2D(4)' }, - precision: 'single', - }); + const kernel = gpu.createKernel( + function (value) { + return value[this.thread.y][this.thread.x]; + }, + { + output: [4, 2], + argumentTypes: { value: 'Array2D(4)' }, + precision: 'single', + } + ); const value = [ - [ - new Float32Array([1, 2, 3, 4]), - new Float32Array([5, 6, 7, 8]), - new Float32Array([9, 10, 11, 12]), - new Float32Array([13, 14, 15, 16]), - ], - [ - new Float32Array([17, 18, 19, 20]), - new Float32Array([21, 22, 23, 24]), - new Float32Array([25, 26, 27, 28]), - new Float32Array([29, 30, 31, 32]), - ] + [new Float32Array([1, 2, 3, 4]), new Float32Array([5, 6, 7, 8]), new Float32Array([9, 10, 11, 12]), new Float32Array([13, 14, 15, 16])], + [new Float32Array([17, 18, 19, 20]), new Float32Array([21, 22, 23, 24]), new Float32Array([25, 26, 27, 28]), new Float32Array([29, 30, 31, 32])], ]; const result = kernel(value); assert.deepEqual(result, value); @@ -265,26 +230,19 @@ test('single precision Array2D(4) cpu', () => { function testUnsignedPrecisionArray2D4(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(value) { - return value[this.thread.y][this.thread.x]; - }, { - output: [4, 2], - argumentTypes: { value: 'Array2D(4)' }, - precision: 'unsigned', - }); + const kernel = gpu.createKernel( + function (value) { + return value[this.thread.y][this.thread.x]; + }, + { + output: [4, 2], + argumentTypes: { value: 'Array2D(4)' }, + precision: 'unsigned', + } + ); const value = [ - [ - new Float32Array([1, 2, 3, 4]), - new Float32Array([5, 6, 7, 8]), - new Float32Array([9, 10, 11, 12]), - new Float32Array([13, 14, 15, 16]), - ], - [ - new Float32Array([17, 18, 19, 20]), - new Float32Array([21, 22, 23, 24]), - new Float32Array([25, 26, 27, 28]), - new Float32Array([29, 30, 31, 32]), - ] + [new Float32Array([1, 2, 3, 4]), new Float32Array([5, 6, 7, 8]), new Float32Array([9, 10, 11, 12]), new Float32Array([13, 14, 15, 16])], + [new Float32Array([17, 18, 19, 20]), new Float32Array([21, 22, 23, 24]), new Float32Array([25, 26, 27, 28]), new Float32Array([29, 30, 31, 32])], ]; const result = kernel(value); assert.deepEqual(result, value); @@ -313,4 +271,4 @@ test('fallback unsigned precision Array2D(4) gpu', () => { test('fallback unsigned precision Array2D(4) cpu', () => { testUnsignedPrecisionArray2D4('cpu'); -}); \ No newline at end of file +}); diff --git a/test/features/argument-array3d-types.js b/test/features/argument-array3d-types.js index 07b05fac..282882a3 100644 --- a/test/features/argument-array3d-types.js +++ b/test/features/argument-array3d-types.js @@ -5,44 +5,29 @@ describe('argument array 3 types'); function testSinglePrecisionArray3D2(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(value) { - return value[this.thread.z][this.thread.y][this.thread.x]; - }, { - output: [2, 2, 3], - argumentTypes: { value: 'Array3D(2)' }, - precision: 'single', - }); + const kernel = gpu.createKernel( + function (value) { + return value[this.thread.z][this.thread.y][this.thread.x]; + }, + { + output: [2, 2, 3], + argumentTypes: { value: 'Array3D(2)' }, + precision: 'single', + } + ); const value = [ [ - [ - new Float32Array([1, 2]), - new Float32Array([3, 4]), - ], - [ - new Float32Array([5, 6]), - new Float32Array([7, 8]), - ] + [new Float32Array([1, 2]), new Float32Array([3, 4])], + [new Float32Array([5, 6]), new Float32Array([7, 8])], ], [ - [ - new Float32Array([9, 10]), - new Float32Array([11, 12]), - ], - [ - new Float32Array([13, 14]), - new Float32Array([15, 16]), - ] + [new Float32Array([9, 10]), new Float32Array([11, 12])], + [new Float32Array([13, 14]), new Float32Array([15, 16])], ], [ - [ - new Float32Array([17, 18]), - new Float32Array([19, 20]), - ], - [ - new Float32Array([21, 22]), - new Float32Array([23, 24]), - ] - ] + [new Float32Array([17, 18]), new Float32Array([19, 20])], + [new Float32Array([21, 22]), new Float32Array([23, 24])], + ], ]; const result = kernel(value); assert.deepEqual(result, value); @@ -75,44 +60,29 @@ test('single precision Array3D(2) cpu', () => { function testUnsignedPrecisionArray3D2(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(value) { - return value[this.thread.z][this.thread.y][this.thread.x]; - }, { - output: [2, 2, 3], - argumentTypes: { value: 'Array2D(2)' }, - precision: 'unsigned', - }); + const kernel = gpu.createKernel( + function (value) { + return value[this.thread.z][this.thread.y][this.thread.x]; + }, + { + output: [2, 2, 3], + argumentTypes: { value: 'Array2D(2)' }, + precision: 'unsigned', + } + ); const value = [ [ - [ - new Float32Array([1, 2]), - new Float32Array([3, 4]), - ], - [ - new Float32Array([5, 6]), - new Float32Array([7, 8]), - ] + [new Float32Array([1, 2]), new Float32Array([3, 4])], + [new Float32Array([5, 6]), new Float32Array([7, 8])], ], [ - [ - new Float32Array([9, 10]), - new Float32Array([11, 12]), - ], - [ - new Float32Array([13, 14]), - new Float32Array([15, 16]), - ] + [new Float32Array([9, 10]), new Float32Array([11, 12])], + [new Float32Array([13, 14]), new Float32Array([15, 16])], ], [ - [ - new Float32Array([17, 18]), - new Float32Array([19, 20]), - ], - [ - new Float32Array([21, 22]), - new Float32Array([23, 24]), - ] - ] + [new Float32Array([17, 18]), new Float32Array([19, 20])], + [new Float32Array([21, 22]), new Float32Array([23, 24])], + ], ]; const result = kernel(value); assert.deepEqual(result, value); @@ -145,44 +115,29 @@ test('fallback unsigned precision Array3D(3) cpu', () => { function testSinglePrecisionArray3D3(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(value) { - return value[this.thread.z][this.thread.y][this.thread.x]; - }, { - output: [2, 2, 3], - argumentTypes: { value: 'Array3D(3)' }, - precision: 'single', - }); + const kernel = gpu.createKernel( + function (value) { + return value[this.thread.z][this.thread.y][this.thread.x]; + }, + { + output: [2, 2, 3], + argumentTypes: { value: 'Array3D(3)' }, + precision: 'single', + } + ); const value = [ [ - [ - new Float32Array([1, 2, 3]), - new Float32Array([4, 5, 6]), - ], - [ - new Float32Array([7, 8, 9]), - new Float32Array([10, 11, 12]), - ] + [new Float32Array([1, 2, 3]), new Float32Array([4, 5, 6])], + [new Float32Array([7, 8, 9]), new Float32Array([10, 11, 12])], ], [ - [ - new Float32Array([13, 14, 15]), - new Float32Array([16, 17, 18]), - ], - [ - new Float32Array([19, 20, 21]), - new Float32Array([22, 23, 24]), - ] + [new Float32Array([13, 14, 15]), new Float32Array([16, 17, 18])], + [new Float32Array([19, 20, 21]), new Float32Array([22, 23, 24])], ], [ - [ - new Float32Array([25, 26, 27]), - new Float32Array([28, 29, 30]), - ], - [ - new Float32Array([31, 32, 33]), - new Float32Array([34, 35, 36]), - ] - ] + [new Float32Array([25, 26, 27]), new Float32Array([28, 29, 30])], + [new Float32Array([31, 32, 33]), new Float32Array([34, 35, 36])], + ], ]; const result = kernel(value); assert.deepEqual(result, value); @@ -215,44 +170,29 @@ test('single precision Array3D(3) cpu', () => { function testUnsignedPrecisionArray3D3(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(value) { - return value[this.thread.z][this.thread.y][this.thread.x]; - }, { - output: [2, 2, 3], - argumentTypes: { value: 'Array2D(3)' }, - precision: 'unsigned', - }); + const kernel = gpu.createKernel( + function (value) { + return value[this.thread.z][this.thread.y][this.thread.x]; + }, + { + output: [2, 2, 3], + argumentTypes: { value: 'Array2D(3)' }, + precision: 'unsigned', + } + ); const value = [ [ - [ - new Float32Array([1, 2, 3]), - new Float32Array([4, 5, 6]), - ], - [ - new Float32Array([7, 8, 9]), - new Float32Array([10, 11, 12]), - ] + [new Float32Array([1, 2, 3]), new Float32Array([4, 5, 6])], + [new Float32Array([7, 8, 9]), new Float32Array([10, 11, 12])], ], [ - [ - new Float32Array([13, 14, 15]), - new Float32Array([16, 17, 18]), - ], - [ - new Float32Array([19, 20, 21]), - new Float32Array([22, 23, 24]), - ] + [new Float32Array([13, 14, 15]), new Float32Array([16, 17, 18])], + [new Float32Array([19, 20, 21]), new Float32Array([22, 23, 24])], ], [ - [ - new Float32Array([25, 26, 27]), - new Float32Array([28, 29, 30]), - ], - [ - new Float32Array([31, 32, 33]), - new Float32Array([34, 35, 36]), - ] - ] + [new Float32Array([25, 26, 27]), new Float32Array([28, 29, 30])], + [new Float32Array([31, 32, 33]), new Float32Array([34, 35, 36])], + ], ]; const result = kernel(value); assert.deepEqual(result, value); @@ -285,44 +225,29 @@ test('fallback unsigned precision Array3D(3) cpu', () => { function testSinglePrecisionArray3D4(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(value) { - return value[this.thread.z][this.thread.y][this.thread.x]; - }, { - output: [2, 2, 3], - argumentTypes: { value: 'Array3D(4)' }, - precision: 'single', - }); + const kernel = gpu.createKernel( + function (value) { + return value[this.thread.z][this.thread.y][this.thread.x]; + }, + { + output: [2, 2, 3], + argumentTypes: { value: 'Array3D(4)' }, + precision: 'single', + } + ); const value = [ [ - [ - new Float32Array([1, 2, 3, 4]), - new Float32Array([5, 6, 7, 8]), - ], - [ - new Float32Array([9, 10, 11, 12]), - new Float32Array([13, 14, 15, 16]), - ] + [new Float32Array([1, 2, 3, 4]), new Float32Array([5, 6, 7, 8])], + [new Float32Array([9, 10, 11, 12]), new Float32Array([13, 14, 15, 16])], ], [ - [ - new Float32Array([17, 18, 19, 20]), - new Float32Array([21, 22, 23, 24]), - ], - [ - new Float32Array([25, 26, 27, 28]), - new Float32Array([29, 30, 31, 32]), - ] + [new Float32Array([17, 18, 19, 20]), new Float32Array([21, 22, 23, 24])], + [new Float32Array([25, 26, 27, 28]), new Float32Array([29, 30, 31, 32])], ], [ - [ - new Float32Array([33, 34, 35, 36]), - new Float32Array([37, 38, 39, 40]), - ], - [ - new Float32Array([41, 42, 43, 44]), - new Float32Array([45, 46, 47, 48]), - ] - ] + [new Float32Array([33, 34, 35, 36]), new Float32Array([37, 38, 39, 40])], + [new Float32Array([41, 42, 43, 44]), new Float32Array([45, 46, 47, 48])], + ], ]; const result = kernel(value); assert.deepEqual(result, value); @@ -355,44 +280,29 @@ test('single precision Array3D(4) cpu', () => { function testUnsignedPrecisionArray3D4(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(value) { - return value[this.thread.z][this.thread.y][this.thread.x]; - }, { - output: [2, 2, 3], - argumentTypes: { value: 'Array2D(3)' }, - precision: 'unsigned', - }); + const kernel = gpu.createKernel( + function (value) { + return value[this.thread.z][this.thread.y][this.thread.x]; + }, + { + output: [2, 2, 3], + argumentTypes: { value: 'Array2D(3)' }, + precision: 'unsigned', + } + ); const value = [ [ - [ - new Float32Array([1, 2, 3, 4]), - new Float32Array([5, 6, 7, 8]), - ], - [ - new Float32Array([9, 10, 11, 12]), - new Float32Array([13, 14, 15, 16]), - ] + [new Float32Array([1, 2, 3, 4]), new Float32Array([5, 6, 7, 8])], + [new Float32Array([9, 10, 11, 12]), new Float32Array([13, 14, 15, 16])], ], [ - [ - new Float32Array([17, 18, 19, 20]), - new Float32Array([21, 22, 23, 24]), - ], - [ - new Float32Array([25, 26, 27, 28]), - new Float32Array([29, 30, 31, 32]), - ] + [new Float32Array([17, 18, 19, 20]), new Float32Array([21, 22, 23, 24])], + [new Float32Array([25, 26, 27, 28]), new Float32Array([29, 30, 31, 32])], ], [ - [ - new Float32Array([33, 34, 35, 36]), - new Float32Array([37, 38, 39, 40]), - ], - [ - new Float32Array([41, 42, 43, 44]), - new Float32Array([45, 46, 47, 48]), - ] - ] + [new Float32Array([33, 34, 35, 36]), new Float32Array([37, 38, 39, 40])], + [new Float32Array([41, 42, 43, 44]), new Float32Array([45, 46, 47, 48])], + ], ]; const result = kernel(value); assert.deepEqual(result, value); @@ -421,4 +331,4 @@ test('fallback unsigned precision Array3D(4) gpu', () => { test('fallback unsigned precision Array3D(4) cpu', () => { testUnsignedPrecisionArray3D4('cpu'); -}); \ No newline at end of file +}); diff --git a/test/features/arithmetic-operators.js b/test/features/arithmetic-operators.js index fc2494df..2e9d6334 100644 --- a/test/features/arithmetic-operators.js +++ b/test/features/arithmetic-operators.js @@ -5,9 +5,12 @@ describe('features: arithmetic operators'); function addition(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function() { - return 3 + 2; - }, { output: [1] }); + const kernel = gpu.createKernel( + function () { + return 3 + 2; + }, + { output: [1] } + ); const result = kernel(); assert.equal(result[0], 3 + 2); gpu.destroy(); @@ -37,12 +40,14 @@ test('addition cpu', () => { addition('cpu'); }); - function subtraction(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function() { - return 3 - 2; - }, { output: [1] }); + const kernel = gpu.createKernel( + function () { + return 3 - 2; + }, + { output: [1] } + ); const result = kernel(); assert.equal(result[0], 3 - 2); gpu.destroy(); @@ -74,9 +79,12 @@ test('subtraction cpu', () => { function multiplication(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function() { - return 3 * 2; - }, { output: [1] }); + const kernel = gpu.createKernel( + function () { + return 3 * 2; + }, + { output: [1] } + ); const result = kernel(); assert.equal(result[0], 3 * 2); gpu.destroy(); @@ -108,9 +116,12 @@ test('multiplication cpu', () => { function exponential(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function() { - return 3 ** 2; - }, { output: [1] }); + const kernel = gpu.createKernel( + function () { + return 3 ** 2; + }, + { output: [1] } + ); const result = kernel(); assert.equal(result[0], 3 ** 2); gpu.destroy(); @@ -142,9 +153,12 @@ test('exponential cpu', () => { function division(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function() { - return 3 / 2; - }, { output: [1] }); + const kernel = gpu.createKernel( + function () { + return 3 / 2; + }, + { output: [1] } + ); const result = kernel(); assert.equal(result[0], 3 / 2); gpu.destroy(); @@ -176,19 +190,28 @@ test('division cpu', () => { function modulus(mode) { const gpu = new GPU({ mode }); - const kernel1 = gpu.createKernel(function() { - return 3 % 2; - }, { output: [1] }); + const kernel1 = gpu.createKernel( + function () { + return 3 % 2; + }, + { output: [1] } + ); assert.equal(kernel1()[0], 3 % 2); - const kernel2 = gpu.createKernel(function() { - return -126 % 63.5; - }, { output: [1] }); + const kernel2 = gpu.createKernel( + function () { + return -126 % 63.5; + }, + { output: [1] } + ); assert.equal(kernel2()[0], -126 % 63.5); - const kernel3 = gpu.createKernel(function() { - return 126 % -63.5; - }, { output: [1] }); + const kernel3 = gpu.createKernel( + function () { + return 126 % -63.5; + }, + { output: [1] } + ); assert.equal(kernel3()[0], 126 % -63.5); gpu.destroy(); @@ -220,9 +243,12 @@ test('modulus cpu', () => { function modulusVariable(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(v) { - return 91 % 7; - }, { output: [1] }); + const kernel = gpu.createKernel( + function (v) { + return 91 % 7; + }, + { output: [1] } + ); assert.equal(kernel(7)[0], 0); gpu.destroy(); } @@ -231,14 +257,16 @@ test('modulus variable auto', () => { modulusVariable(); }); - function increment(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function() { - let i = 3; - i++; - return i; - }, { output: [1] }); + const kernel = gpu.createKernel( + function () { + let i = 3; + i++; + return i; + }, + { output: [1] } + ); const result = kernel(); let i = 3; i++; @@ -272,10 +300,13 @@ test('increment cpu', () => { function incrementEarlyReturn(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function() { - let i = 3; - return i++; - }, { output: [1] }); + const kernel = gpu.createKernel( + function () { + let i = 3; + return i++; + }, + { output: [1] } + ); const result = kernel(); let i = 3; assert.equal(result[0], i++); @@ -308,11 +339,14 @@ test('increment early return cpu', () => { function decrement(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function() { - let i = 3; - i--; - return i; - }, { output: [1] }); + const kernel = gpu.createKernel( + function () { + let i = 3; + i--; + return i; + }, + { output: [1] } + ); const result = kernel(); let i = 3; i--; @@ -346,10 +380,13 @@ test('decrement cpu', () => { function decrementEarlyReturn(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function() { - let i = 3; - return i--; - }, { output: [1] }); + const kernel = gpu.createKernel( + function () { + let i = 3; + return i--; + }, + { output: [1] } + ); const result = kernel(); let i = 3; assert.equal(result[0], i--); @@ -378,4 +415,4 @@ test('decrement early return auto', () => { test('decrement early return cpu', () => { decrementEarlyReturn('cpu'); -}); \ No newline at end of file +}); diff --git a/test/features/assignment-operators.js b/test/features/assignment-operators.js index 45c26d0f..a04a48f4 100644 --- a/test/features/assignment-operators.js +++ b/test/features/assignment-operators.js @@ -5,10 +5,13 @@ describe('features: assignment operators'); function equal(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function() { - let i = 3; - return i; - }, { output: [1] }); + const kernel = gpu.createKernel( + function () { + let i = 3; + return i; + }, + { output: [1] } + ); const result = kernel(); assert.equal(result[0], 3); gpu.destroy(); @@ -40,11 +43,14 @@ test('equal cpu', () => { function plusEqual(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function() { - let i = 3; - i += 3; - return i; - }, { output: [1] }); + const kernel = gpu.createKernel( + function () { + let i = 3; + i += 3; + return i; + }, + { output: [1] } + ); const result = kernel(); let i = 3; i += 3; @@ -78,11 +84,14 @@ test('plus equal cpu', () => { function minusEqual(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function() { - let i = 6; - i -= 3; - return i; - }, { output: [1] }); + const kernel = gpu.createKernel( + function () { + let i = 6; + i -= 3; + return i; + }, + { output: [1] } + ); const result = kernel(); let i = 6; i -= 3; @@ -116,11 +125,14 @@ test('minus equal cpu', () => { function multiplyEqual(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function() { - let i = 6; - i *= 3; - return i; - }, { output: [1] }); + const kernel = gpu.createKernel( + function () { + let i = 6; + i *= 3; + return i; + }, + { output: [1] } + ); const result = kernel(); let i = 6; i *= 3; @@ -154,11 +166,14 @@ test('multiply equal cpu', () => { function divideEqual(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function() { - let i = 6; - i /= 3; - return i; - }, { output: [1] }); + const kernel = gpu.createKernel( + function () { + let i = 6; + i /= 3; + return i; + }, + { output: [1] } + ); const result = kernel(); let i = 6; i /= 3; @@ -190,14 +205,16 @@ test('divide equal cpu', () => { divideEqual('cpu'); }); - function modulusEqual(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function() { - let i = 2; - i %= 3; - return i; - }, { output: [1] }); + const kernel = gpu.createKernel( + function () { + let i = 2; + i %= 3; + return i; + }, + { output: [1] } + ); const result = kernel(); let i = 2; i %= 3; @@ -231,11 +248,14 @@ test('modulus equal cpu', () => { function exponentialEqual(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function() { - let i = 2; - i **= 3; - return i; - }, { output: [1] }); + const kernel = gpu.createKernel( + function () { + let i = 2; + i **= 3; + return i; + }, + { output: [1] } + ); const result = kernel(); let i = 2; i **= 3; @@ -265,4 +285,4 @@ test('exponential equal auto', () => { test('exponential equal cpu', () => { exponentialEqual('cpu'); -}); \ No newline at end of file +}); diff --git a/test/features/basic-math.js b/test/features/basic-math.js index 3571ee5a..5d12d761 100644 --- a/test/features/basic-math.js +++ b/test/features/basic-math.js @@ -5,12 +5,15 @@ describe('features: basic math'); function sumABTest(mode) { const gpu = new GPU({ mode }); - const f = gpu.createKernel(function(a, b) { - return (a[this.thread.x] + b[this.thread.x]); - }, { - output: [6], - mode: mode, - }); + const f = gpu.createKernel( + function (a, b) { + return a[this.thread.x] + b[this.thread.x]; + }, + { + output: [6], + mode: mode, + } + ); assert.ok(f !== null, 'function generated test'); @@ -50,35 +53,41 @@ test('sumAB cpu', () => { sumABTest('cpu'); }); - function multABTest(mode) { const gpu = new GPU({ mode }); - const f = gpu.createKernel(function(a, b) { - let sum = 0; - sum += a[this.thread.y][0] * b[0][this.thread.x]; - sum += a[this.thread.y][1] * b[1][this.thread.x]; - sum += a[this.thread.y][2] * b[2][this.thread.x]; - return sum; - }, { - output: [3, 3] - }); + const f = gpu.createKernel( + function (a, b) { + let sum = 0; + sum += a[this.thread.y][0] * b[0][this.thread.x]; + sum += a[this.thread.y][1] * b[1][this.thread.x]; + sum += a[this.thread.y][2] * b[2][this.thread.x]; + return sum; + }, + { + output: [3, 3], + } + ); assert.ok(f !== null, 'function generated test'); - assert.deepEqual(f( + assert.deepEqual( + f( [ [1, 2, 3], [4, 5, 6], - [7, 8, 9] + [7, 8, 9], ], [ [1, 2, 3], [4, 5, 6], - [7, 8, 9] - ]).map((object) => { return Array.from(object); }), + [7, 8, 9], + ] + ).map(object => { + return Array.from(object); + }), [ [30, 36, 42], [66, 81, 96], - [102, 126, 150] + [102, 126, 150], ], 'basic mult function test' ); @@ -102,4 +111,4 @@ test('multAB gpu', () => { }); test('multAB cpu', () => { multABTest('cpu'); -}); \ No newline at end of file +}); diff --git a/test/features/bitwise-operators.js b/test/features/bitwise-operators.js index f93572b4..77bce858 100644 --- a/test/features/bitwise-operators.js +++ b/test/features/bitwise-operators.js @@ -5,7 +5,8 @@ describe('feature: bitwise operators'); function testBitwiseAndSinglePrecision(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(v1, v2) { + const kernel = gpu + .createKernel(function (v1, v2) { return v1 & v2; }) .setOutput([1]) @@ -46,7 +47,8 @@ test('bitwise AND single precision cpu', () => { function testBitwiseAndUnsignedPrecision(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(v1, v2) { + const kernel = gpu + .createKernel(function (v1, v2) { return v1 & v2; }) .setOutput([1]) @@ -87,7 +89,8 @@ test('bitwise AND unsigned precision cpu', () => { function testBitwiseOrSinglePrecision(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(v1, v2) { + const kernel = gpu + .createKernel(function (v1, v2) { return v1 | v2; }) .setOutput([1]) @@ -128,7 +131,8 @@ test('bitwise OR single precision cpu', () => { function testBitwiseOrUnsignedPrecision(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(v1, v2) { + const kernel = gpu + .createKernel(function (v1, v2) { return v1 | v2; }) .setOutput([1]) @@ -169,7 +173,8 @@ test('bitwise OR unsigned precision cpu', () => { function testBitwiseXORSinglePrecision(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(v1, v2) { + const kernel = gpu + .createKernel(function (v1, v2) { return v1 ^ v2; }) .setOutput([1]) @@ -210,7 +215,8 @@ test('bitwise XOR single precision cpu', () => { function testBitwiseXORUnsignedPrecision(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(v1, v2) { + const kernel = gpu + .createKernel(function (v1, v2) { return v1 ^ v2; }) .setOutput([1]) @@ -251,7 +257,8 @@ test('bitwise XOR unsigned precision cpu', () => { function testBitwiseNotSinglePrecision(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(v1) { + const kernel = gpu + .createKernel(function (v1) { return ~v1; }) .setOutput([1]) @@ -290,7 +297,8 @@ test('bitwise NOT single precision cpu', () => { function testBitwiseNotUnsignedPrecision(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(v1) { + const kernel = gpu + .createKernel(function (v1) { return ~v1; }) .setOutput([1]) @@ -329,7 +337,8 @@ test('bitwise NOT unsigned precision cpu', () => { function testBitwiseZeroFillLeftShiftSinglePrecision(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(v1, v2) { + const kernel = gpu + .createKernel(function (v1, v2) { return v1 << v2; }) .setOutput([1]) @@ -370,7 +379,8 @@ test('bitwise zero fill left shift single precision cpu', () => { function testBitwiseZeroFillLeftShiftUnsignedPrecision(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(v1, v2) { + const kernel = gpu + .createKernel(function (v1, v2) { return v1 << v2; }) .setOutput([1]) @@ -411,7 +421,8 @@ test('bitwise zero fill left shift unsigned precision cpu', () => { function testBitwiseSignedRightShiftSinglePrecision(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(v1, v2) { + const kernel = gpu + .createKernel(function (v1, v2) { return v1 >> v2; }) .setOutput([1]) @@ -452,7 +463,8 @@ test('bitwise signed fill right shift single precision cpu', () => { function testBitwiseSignedRightShiftUnsignedPrecision(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(v1, v2) { + const kernel = gpu + .createKernel(function (v1, v2) { return v1 >> v2; }) .setOutput([1]) @@ -493,7 +505,8 @@ test('bitwise signed fill right shift unsigned precision cpu', () => { function testBitwiseZeroFillRightShiftSinglePrecision(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(v1, v2) { + const kernel = gpu + .createKernel(function (v1, v2) { return v1 >>> v2; }) .setOutput([1]) @@ -534,7 +547,8 @@ test('bitwise zero fill right shift single precision cpu', () => { function testBitwiseZeroFillRightShiftUnsignedPrecision(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(v1, v2) { + const kernel = gpu + .createKernel(function (v1, v2) { return v1 >>> v2; }) .setOutput([1]) @@ -571,4 +585,4 @@ test('bitwise zero fill right shift unsigned precision gpu', () => { test('bitwise zero fill right shift unsigned precision cpu', () => { testBitwiseZeroFillRightShiftUnsignedPrecision('cpu'); -}); \ No newline at end of file +}); diff --git a/test/features/boolean-from-expression.js b/test/features/boolean-from-expression.js index 7e2560f5..c6e4e2ca 100644 --- a/test/features/boolean-from-expression.js +++ b/test/features/boolean-from-expression.js @@ -5,10 +5,13 @@ describe('feature: bitwise operators'); function testBooleanFromExpression(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function() { - const result = 1 === 1 && 2 === 2; - return result ? 1 : 0; - }, { output: [1] }); + const kernel = gpu.createKernel( + function () { + const result = 1 === 1 && 2 === 2; + return result ? 1 : 0; + }, + { output: [1] } + ); assert.equal(kernel()[0], 1); gpu.destroy(); } @@ -35,4 +38,4 @@ test('gpu', () => { test('cpu', () => { testBooleanFromExpression('cpu'); -}); \ No newline at end of file +}); diff --git a/test/features/canvas.js b/test/features/canvas.js index 4b0635fd..028a5dc1 100644 --- a/test/features/canvas.js +++ b/test/features/canvas.js @@ -7,12 +7,15 @@ describe('features: canvas argument'); function canvasArgumentTest(mode) { const gpu = new GPU({ mode }); const canvas = greenCanvas(mode, 1, 1); - const kernel = gpu.createKernel(function(canvas) { - const pixel = canvas[this.thread.y][this.thread.x]; - return pixel[1]; - }, { - output: [canvas.width, canvas.height] - }); + const kernel = gpu.createKernel( + function (canvas) { + const pixel = canvas[this.thread.y][this.thread.x]; + return pixel[1]; + }, + { + output: [canvas.width, canvas.height], + } + ); const result = kernel(canvas); assert.equal(result[0][0], 1); gpu.destroy(); @@ -41,13 +44,16 @@ function canvasArgumentTest(mode) { function canvasManuallyDefinedArgumentTest(mode) { const gpu = new GPU({ mode }); const canvas = greenCanvas(mode, 1, 1); - const kernel = gpu.createKernel(function(canvas) { - const pixel = canvas[this.thread.y][this.thread.x]; - return pixel[1]; - }, { - output: [canvas.width, canvas.height], - argumentTypes: { canvas: 'HTMLCanvas' } - }); + const kernel = gpu.createKernel( + function (canvas) { + const pixel = canvas[this.thread.y][this.thread.x]; + return pixel[1]; + }, + { + output: [canvas.width, canvas.height], + argumentTypes: { canvas: 'HTMLCanvas' }, + } + ); const result = kernel(canvas); assert.equal(result[0][0], 1); gpu.destroy(); @@ -71,4 +77,4 @@ function canvasManuallyDefinedArgumentTest(mode) { (typeof HTMLCanvasElement !== 'undefined' ? test : skip)('manually defined cpu', () => { canvasManuallyDefinedArgumentTest('cpu'); -}); \ No newline at end of file +}); diff --git a/test/features/clear-textures.js b/test/features/clear-textures.js index 3edcddd1..d3e7d05a 100644 --- a/test/features/clear-textures.js +++ b/test/features/clear-textures.js @@ -7,13 +7,16 @@ function clearTexture(precision, mode) { const gpu = new GPU({ mode }); function makeTexture() { - return (gpu.createKernel(function() { - return this.thread.x; - }, { - output: [5], - pipeline: true, - precision - }))(); + return gpu.createKernel( + function () { + return this.thread.x; + }, + { + output: [5], + pipeline: true, + precision, + } + )(); } const texture = makeTexture(); assert.deepEqual(texture.toArray(), new Float32Array([0, 1, 2, 3, 4])); @@ -56,12 +59,14 @@ test('unsigned precision auto', () => { clearTexture('single', 'headlessgl'); }); - function clearClonedTexture(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function() { - return 1; - }, { output: [1], pipeline: true, immutable: true }); + const kernel = gpu.createKernel( + function () { + return 1; + }, + { output: [1], pipeline: true, immutable: true } + ); const result = kernel(); assert.equal(result.toArray()[0], 1); const result2 = result.clone(); @@ -92,4 +97,4 @@ test('clear cloned texture gpu', () => { (GPU.isHeadlessGLSupported ? test : skip)('clear cloned texture headlessgl', () => { clearClonedTexture('headlessgl'); -}); \ No newline at end of file +}); diff --git a/test/features/clone-textures.js b/test/features/clone-textures.js index b2758dc7..4efaad25 100644 --- a/test/features/clone-textures.js +++ b/test/features/clone-textures.js @@ -7,13 +7,16 @@ function copy1DTexture(precision, mode) { const gpu = new GPU({ mode }); function makeTexture() { - return (gpu.createKernel(function() { - return this.thread.x; - }, { - output: [5], - pipeline: true, - precision - }))(); + return gpu.createKernel( + function () { + return this.thread.x; + }, + { + output: [5], + pipeline: true, + precision, + } + )(); } const texture = makeTexture(); const clone = texture.clone(); @@ -59,13 +62,16 @@ function copy2DTexture(precision, mode) { const gpu = new GPU({ mode }); function makeTexture() { - return (gpu.createKernel(function() { - return this.thread.x + (this.thread.y * this.output.x); - }, { - output: [5, 5], - pipeline: true, - precision - }))(); + return gpu.createKernel( + function () { + return this.thread.x + this.thread.y * this.output.x; + }, + { + output: [5, 5], + pipeline: true, + precision, + } + )(); } const texture = makeTexture(); const clone = texture.clone(); @@ -111,13 +117,16 @@ function copy3DTexture(precision, mode) { const gpu = new GPU({ mode }); function makeTexture() { - return (gpu.createKernel(function() { - return this.thread.x + (this.thread.y * this.output.x) * (this.output.x * this.output.y * this.thread.z); - }, { - output: [5, 5, 5], - pipeline: true, - precision - }))(); + return gpu.createKernel( + function () { + return this.thread.x + this.thread.y * this.output.x * (this.output.x * this.output.y * this.thread.z); + }, + { + output: [5, 5, 5], + pipeline: true, + precision, + } + )(); } const texture = makeTexture(); const clone = texture.clone(); @@ -157,4 +166,4 @@ test('3D unsigned precision auto', () => { (GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('3D single precision headlessgl', () => { copy3DTexture('single', 'headlessgl'); -}); \ No newline at end of file +}); diff --git a/test/features/combine-kernels.js b/test/features/combine-kernels.js index fec45507..b6788954 100644 --- a/test/features/combine-kernels.js +++ b/test/features/combine-kernels.js @@ -6,21 +6,27 @@ describe('features: combine kernels'); function combineKernels(mode) { const gpu = new GPU({ mode }); - const kernel1 = gpu.createKernel(function(a, b) { - return a[this.thread.x] + b[this.thread.x]; - }, { output: [5] }); - - const kernel2 = gpu.createKernel(function(c, d) { - return c[this.thread.x] * d[this.thread.x]; - }, { output: [5] }); - - const superKernel = gpu.combineKernels(kernel1, kernel2, function(array1, array2, array3) { + const kernel1 = gpu.createKernel( + function (a, b) { + return a[this.thread.x] + b[this.thread.x]; + }, + { output: [5] } + ); + + const kernel2 = gpu.createKernel( + function (c, d) { + return c[this.thread.x] * d[this.thread.x]; + }, + { output: [5] } + ); + + const superKernel = gpu.combineKernels(kernel1, kernel2, function (array1, array2, array3) { return kernel2(kernel1(array1, array2), array3); }); const result = superKernel([1, 2, 3, 4, 5], [1, 2, 3, 4, 5], [1, 2, 3, 4, 5]); assert.deepEqual(Array.from(result), [2, 8, 18, 32, 50]); - gpu.destroy() + gpu.destroy(); } test('combine kernel auto', () => { @@ -47,25 +53,30 @@ test('combine kernel cpu', () => { combineKernels('cpu'); }); - function combineKernelsSinglePrecision(mode) { const gpu = new GPU({ mode }); - const kernel1 = gpu.createKernel(function(a, b) { - return a[this.thread.x] + b[this.thread.x]; - }, { output: [5], precision: 'single' }); - - const kernel2 = gpu.createKernel(function(c, d) { - return c[this.thread.x] * d[this.thread.x]; - }, { output: [5], precision: 'single' }); - - const superKernel = gpu.combineKernels(kernel1, kernel2, function(array1, array2, array3) { + const kernel1 = gpu.createKernel( + function (a, b) { + return a[this.thread.x] + b[this.thread.x]; + }, + { output: [5], precision: 'single' } + ); + + const kernel2 = gpu.createKernel( + function (c, d) { + return c[this.thread.x] * d[this.thread.x]; + }, + { output: [5], precision: 'single' } + ); + + const superKernel = gpu.combineKernels(kernel1, kernel2, function (array1, array2, array3) { return kernel2(kernel1(array1, array2), array3); }); const result = superKernel([1, 2, 3, 4, 5], [1, 2, 3, 4, 5], [1, 2, 3, 4, 5]); assert.deepEqual(Array.from(result), [2, 8, 18, 32, 50]); - gpu.destroy() + gpu.destroy(); } (GPU.isSinglePrecisionSupported ? test : skip)('combine kernel single precision auto', () => { @@ -92,33 +103,38 @@ test('combine kernel single precision cpu', () => { combineKernelsSinglePrecision('cpu'); }); - function combineKernelsOptimizeFloatMemory(mode) { const gpu = new GPU({ mode }); - const kernel1 = gpu.createKernel(function(a, b) { - return a[this.thread.x] + b[this.thread.x]; - }, { - output: [5], - precision: 'single', - optimizeFloatMemory: true, - }); - - const kernel2 = gpu.createKernel(function(c, d) { - return c[this.thread.x] * d[this.thread.x]; - }, { - output: [5], - precision: 'single', - optimizeFloatMemory: true, - }); - - const superKernel = gpu.combineKernels(kernel1, kernel2, function(array1, array2, array3) { + const kernel1 = gpu.createKernel( + function (a, b) { + return a[this.thread.x] + b[this.thread.x]; + }, + { + output: [5], + precision: 'single', + optimizeFloatMemory: true, + } + ); + + const kernel2 = gpu.createKernel( + function (c, d) { + return c[this.thread.x] * d[this.thread.x]; + }, + { + output: [5], + precision: 'single', + optimizeFloatMemory: true, + } + ); + + const superKernel = gpu.combineKernels(kernel1, kernel2, function (array1, array2, array3) { return kernel2(kernel1(array1, array2), array3); }); const result = superKernel([1, 2, 3, 4, 5], [1, 2, 3, 4, 5], [1, 2, 3, 4, 5]); assert.deepEqual(Array.from(result), [2, 8, 18, 32, 50]); - gpu.destroy() + gpu.destroy(); } (GPU.isSinglePrecisionSupported ? test : skip)('combine kernel float textures auto', () => { @@ -143,4 +159,4 @@ function combineKernelsOptimizeFloatMemory(mode) { test('combine kernel float textures cpu', () => { combineKernelsOptimizeFloatMemory('cpu'); -}); \ No newline at end of file +}); diff --git a/test/features/constants-array.js b/test/features/constants-array.js index 83e22f34..fc1f4e3c 100644 --- a/test/features/constants-array.js +++ b/test/features/constants-array.js @@ -6,12 +6,15 @@ describe('features: constants array'); function feature(mode) { const gpu = new GPU({ mode }); const array = [200, 200]; - const tryConst = gpu.createKernel(function() { - return this.constants.array[this.thread.x]; - }, { - constants: { array }, - output: [2] - }); + const tryConst = gpu.createKernel( + function () { + return this.constants.array[this.thread.x]; + }, + { + constants: { array }, + output: [2], + } + ); const result = tryConst(); assert.deepEqual(Array.from(result), [200, 200], 'array constant passed test'); gpu.destroy(); @@ -39,4 +42,4 @@ test('gpu', () => { test('arrayConstantTest cpu', () => { feature('cpu'); -}); \ No newline at end of file +}); diff --git a/test/features/constants-bool.js b/test/features/constants-bool.js index 1e8fcfa0..646a33fc 100644 --- a/test/features/constants-bool.js +++ b/test/features/constants-bool.js @@ -7,12 +7,13 @@ function boolTrueConstantTest(mode) { const gpu = new GPU({ mode }); const bool = true; const tryConst = gpu.createKernel( - function() { + function () { return this.constants.bool ? 1 : 0; - }, { - constants: { bool }, - output: [1] }, + { + constants: { bool }, + output: [1], + } ); const result = tryConst(); assert.equal(result[0], 1, 'bool constant passed test'); @@ -43,17 +44,17 @@ test('true cpu', () => { boolTrueConstantTest('cpu'); }); - function boolFalseConstantTest(mode) { const gpu = new GPU({ mode }); const bool = false; const tryConst = gpu.createKernel( - function() { + function () { return this.constants.bool ? 1 : 0; - }, { - constants: { bool }, - output: [1] }, + { + constants: { bool }, + output: [1], + } ); const result = tryConst(); assert.equal(result[0], 0, 'bool constant passed test'); @@ -82,4 +83,4 @@ test('false gpu', () => { test('false cpu', () => { boolFalseConstantTest('cpu'); -}); \ No newline at end of file +}); diff --git a/test/features/constants-canvas.js b/test/features/constants-canvas.js index 91641cc4..49399835 100644 --- a/test/features/constants-canvas.js +++ b/test/features/constants-canvas.js @@ -8,10 +8,11 @@ function canvasConstantTest(mode) { const gpu = new GPU({ mode }); const canvas = greenCanvas(mode, 1, 1); const kernel = gpu.createKernel( - function() { + function () { const pixel = this.constants.canvas[this.thread.y][this.thread.x]; return pixel.g; - }, { + }, + { constants: { canvas }, output: [1, 1], } @@ -40,4 +41,4 @@ function canvasConstantTest(mode) { (typeof HTMLCanvasElement !== 'undefined' ? test : skip)('cpu', () => { canvasConstantTest('cpu'); -}); \ No newline at end of file +}); diff --git a/test/features/constants-float.js b/test/features/constants-float.js index 7b13119f..f35cb6fc 100644 --- a/test/features/constants-float.js +++ b/test/features/constants-float.js @@ -7,19 +7,17 @@ function floatConstantTest(mode) { const gpu = new GPU({ mode }); const float = 200.01; const tryConst = gpu.createKernel( - function() { + function () { return this.constants.float; - }, { - constants: { float }, - output: [2] }, + { + constants: { float }, + output: [2], + } ); const result = tryConst(); const match = new Float32Array([200.01, 200.01]); - const test = ( - result[0].toFixed(1) === match[0].toFixed(1) && - result[1].toFixed(1) === match[1].toFixed(1) - ); + const test = result[0].toFixed(1) === match[0].toFixed(1) && result[1].toFixed(1) === match[1].toFixed(1); assert.ok(test, 'float constant passed test'); gpu.destroy(); } @@ -46,4 +44,4 @@ test('gpu', () => { test('cpu', () => { floatConstantTest('cpu'); -}); \ No newline at end of file +}); diff --git a/test/features/constants-image-array.js b/test/features/constants-image-array.js index 60b358c5..cdf77922 100644 --- a/test/features/constants-image-array.js +++ b/test/features/constants-image-array.js @@ -28,7 +28,7 @@ function feature(mode, done) { } const settings = { constants: { imageArray }, - output: [1, 1, 4] + output: [1, 1, 4], }; if (mode === 'webgl' || gpu.Kernel === WebGLKernel) { @@ -58,7 +58,7 @@ function feature(mode, done) { (GPU.isWebGLSupported && typeof Image !== 'undefined' ? test : skip)('webgl', t => { assert.throws(() => { - feature('webgl') + feature('webgl'); }, 'imageArray are not compatible with webgl'); }); @@ -68,4 +68,4 @@ function feature(mode, done) { (typeof Image !== 'undefined' ? test : skip)('cpu', t => { feature('cpu', t.async()); -}); \ No newline at end of file +}); diff --git a/test/features/constants-image.js b/test/features/constants-image.js index c66cac93..5637a1e3 100644 --- a/test/features/constants-image.js +++ b/test/features/constants-image.js @@ -7,11 +7,11 @@ function imageConstantTest(mode, done) { const gpu = new GPU({ mode }); const image = new Image(); image.src = 'jellyfish-1.jpeg'; - image.onload = function() { + image.onload = function () { const width = image.width; const height = image.height; const tryConst = gpu.createKernel( - function() { + function () { const pixel = this.constants.image[this.thread.y][this.thread.x]; let color = 0; if (this.thread.z === 0) { @@ -24,7 +24,8 @@ function imageConstantTest(mode, done) { color = pixel.b; } return 255 * color; - }, { + }, + { constants: { image }, output: [width, height, 3], } @@ -34,7 +35,7 @@ function imageConstantTest(mode, done) { assert.ok(test, 'image constant passed test'); gpu.destroy(); done(); - } + }; } (typeof Image !== 'undefined' ? test : skip)('auto', t => { @@ -55,4 +56,4 @@ function imageConstantTest(mode, done) { (typeof Image !== 'undefined' ? test : skip)('cpu', t => { imageConstantTest('cpu', t.async()); -}); \ No newline at end of file +}); diff --git a/test/features/constants-integer.js b/test/features/constants-integer.js index 71628d03..67c01d72 100644 --- a/test/features/constants-integer.js +++ b/test/features/constants-integer.js @@ -6,16 +6,19 @@ describe('features: constants integer'); function integerConstantTest(mode) { const gpu = new GPU({ mode }); const int = 200; - const tryConst = gpu.createKernel( - function() { - return this.constants.int; - }, { - constants: { int } - } - ).setOutput([2]); + const tryConst = gpu + .createKernel( + function () { + return this.constants.int; + }, + { + constants: { int }, + } + ) + .setOutput([2]); const result = tryConst(); const match = new Float32Array([200, 200]); - const test = (result[0] === match[0] && result[1] === match[1]); + const test = result[0] === match[0] && result[1] === match[1]; assert.ok(test, 'int constant passed test'); gpu.destroy(); } @@ -42,4 +45,4 @@ test('gpu', () => { test('cpu', () => { integerConstantTest('cpu'); -}); \ No newline at end of file +}); diff --git a/test/features/constants-texture.js b/test/features/constants-texture.js index 0410f692..014e38c2 100644 --- a/test/features/constants-texture.js +++ b/test/features/constants-texture.js @@ -6,19 +6,22 @@ describe('features: constants texture 1d'); function test1D(mode) { const gpu = new GPU({ mode }); const createTexture = gpu - .createKernel(function() { + .createKernel(function () { return 200; }) .setOutput([2]) .setPipeline(true); const texture = createTexture(); - const tryConst = gpu.createKernel( - function() { - return this.constants.texture[this.thread.x]; - }, { - constants: { texture } - } - ).setOutput([2]); + const tryConst = gpu + .createKernel( + function () { + return this.constants.texture[this.thread.x]; + }, + { + constants: { texture }, + } + ) + .setOutput([2]); const result = tryConst(); const expected = new Float32Array([200, 200]); assert.deepEqual(result, expected, 'texture constant passed test'); @@ -33,15 +36,15 @@ test('gpu', () => { test1D('gpu'); }); -(GPU.isWebGLSupported ? test : skip)('webgl', function() { +(GPU.isWebGLSupported ? test : skip)('webgl', function () { test1D('webgl'); }); -(GPU.isWebGL2Supported ? test : skip)('webgl2', function() { +(GPU.isWebGL2Supported ? test : skip)('webgl2', function () { test1D('webgl2'); }); -(GPU.isHeadlessGLSupported ? test : skip)('headlessgl', function() { +(GPU.isHeadlessGLSupported ? test : skip)('headlessgl', function () { test1D('headlessgl'); }); @@ -49,26 +52,27 @@ test('cpu', () => { test1D('cpu'); }); - - describe('features: constants texture 2d'); function test2D(mode) { const gpu = new GPU({ mode }); const createTexture = gpu - .createKernel(function() { + .createKernel(function () { return 200; }) .setOutput([2, 2]) .setPipeline(true); const texture = createTexture(); - const tryConst = gpu.createKernel( - function() { - return this.constants.texture[this.thread.y][this.thread.x]; - }, { - constants: { texture } - } - ).setOutput([2, 2]); + const tryConst = gpu + .createKernel( + function () { + return this.constants.texture[this.thread.y][this.thread.x]; + }, + { + constants: { texture }, + } + ) + .setOutput([2, 2]); const result = tryConst(); const expected = [new Float32Array([200, 200]), new Float32Array([200, 200])]; assert.deepEqual(result, expected, 'texture constant passed test'); @@ -83,15 +87,15 @@ test('gpu', () => { test2D('gpu'); }); -(GPU.isWebGLSupported ? test : skip)('webgl', function() { +(GPU.isWebGLSupported ? test : skip)('webgl', function () { test2D('webgl'); }); -(GPU.isWebGL2Supported ? test : skip)('webgl2', function() { +(GPU.isWebGL2Supported ? test : skip)('webgl2', function () { test2D('webgl2'); }); -(GPU.isHeadlessGLSupported ? test : skip)('headlessgl', function() { +(GPU.isHeadlessGLSupported ? test : skip)('headlessgl', function () { test2D('headlessgl'); }); @@ -99,29 +103,31 @@ test('cpu', () => { test2D('cpu'); }); - describe('features: constants texture 3d'); function test3D(mode) { const gpu = new GPU({ mode }); const createTexture = gpu - .createKernel(function() { + .createKernel(function () { return 200; }) .setOutput([2, 2, 2]) .setPipeline(true); const texture = createTexture(); - const tryConst = gpu.createKernel( - function() { - return this.constants.texture[this.thread.z][this.thread.y][this.thread.x]; - }, { - constants: { texture } - } - ).setOutput([2, 2, 2]); + const tryConst = gpu + .createKernel( + function () { + return this.constants.texture[this.thread.z][this.thread.y][this.thread.x]; + }, + { + constants: { texture }, + } + ) + .setOutput([2, 2, 2]); const result = tryConst(); const expected = [ [new Float32Array([200, 200]), new Float32Array([200, 200])], - [new Float32Array([200, 200]), new Float32Array([200, 200])] + [new Float32Array([200, 200]), new Float32Array([200, 200])], ]; assert.deepEqual(result, expected, 'texture constant passed test'); gpu.destroy(); @@ -135,18 +141,18 @@ test('gpu', () => { test3D('cpu'); }); -(GPU.isWebGLSupported ? test : skip)('webgl', function() { +(GPU.isWebGLSupported ? test : skip)('webgl', function () { test3D('webgl'); }); -(GPU.isWebGL2Supported ? test : skip)('webgl2', function() { +(GPU.isWebGL2Supported ? test : skip)('webgl2', function () { test3D('webgl2'); }); -(GPU.isHeadlessGLSupported ? test : skip)('headlessgl', function() { +(GPU.isHeadlessGLSupported ? test : skip)('headlessgl', function () { test3D('headlessgl'); }); test('cpu', () => { test3D('cpu'); -}); \ No newline at end of file +}); diff --git a/test/features/cpu-with-textures.js b/test/features/cpu-with-textures.js index 035dfb1d..4d1a8cf8 100644 --- a/test/features/cpu-with-textures.js +++ b/test/features/cpu-with-textures.js @@ -5,20 +5,26 @@ describe('features: CPU with Textures'); function cpuWithTexturesNumberWithSinglePrecision(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function() { - return this.thread.x; - }, { - output: [2], - pipeline: true, - precision: 'single', - }); + const kernel = gpu.createKernel( + function () { + return this.thread.x; + }, + { + output: [2], + pipeline: true, + precision: 'single', + } + ); const texture = kernel(); assert.ok(texture.toArray); assert.deepEqual(Array.from(texture.toArray()), [0, 1]); const cpu = new GPU({ mode: 'cpu' }); - const cpuKernel = cpu.createKernel(function(v) { - return v[this.thread.x]; - }, { output: [2] }); + const cpuKernel = cpu.createKernel( + function (v) { + return v[this.thread.x]; + }, + { output: [2] } + ); assert.notOk(cpuKernel.kernel.textureCache); const result = cpuKernel(texture); assert.ok(cpuKernel.kernel.textureCache); @@ -54,21 +60,27 @@ function cpuWithTexturesNumberWithSinglePrecision(mode) { function cpuWithTexturesMemoryOptimizedNumberWithSinglePrecision(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function() { - return this.thread.x; - }, { - output: [2], - pipeline: true, - precision: 'single', - optimizeFloatMemory: true, - }); + const kernel = gpu.createKernel( + function () { + return this.thread.x; + }, + { + output: [2], + pipeline: true, + precision: 'single', + optimizeFloatMemory: true, + } + ); const texture = kernel(); assert.ok(texture.toArray); assert.deepEqual(Array.from(texture.toArray()), [0, 1]); const cpu = new GPU({ mode: 'cpu' }); - const cpuKernel = cpu.createKernel(function(v) { - return v[this.thread.x]; - }, { output: [2] }); + const cpuKernel = cpu.createKernel( + function (v) { + return v[this.thread.x]; + }, + { output: [2] } + ); assert.notOk(cpuKernel.kernel.textureCache); const result = cpuKernel(texture); assert.ok(cpuKernel.kernel.textureCache); @@ -104,38 +116,53 @@ function cpuWithTexturesMemoryOptimizedNumberWithSinglePrecision(mode) { function cpuWithTexturesArray2WithSinglePrecision(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function() { - return [this.thread.x, this.thread.x]; - }, { - output: [2], - pipeline: true, - precision: 'single', - }); + const kernel = gpu.createKernel( + function () { + return [this.thread.x, this.thread.x]; + }, + { + output: [2], + pipeline: true, + precision: 'single', + } + ); const texture = kernel(); assert.ok(texture.toArray); - assert.deepEqual(texture.toArray().map(value => Array.from(value)), [ - [0, 0], - [1, 1] - ]); + assert.deepEqual( + texture.toArray().map(value => Array.from(value)), + [ + [0, 0], + [1, 1], + ] + ); const cpu = new GPU({ mode: 'cpu' }); - const cpuKernel = cpu.createKernel(function(v) { - return v[this.thread.x]; - }, { output: [2] }); + const cpuKernel = cpu.createKernel( + function (v) { + return v[this.thread.x]; + }, + { output: [2] } + ); assert.notOk(cpuKernel.kernel.textureCache); const result = cpuKernel(texture); assert.ok(cpuKernel.kernel.textureCache); - assert.deepEqual(result.map(value => Array.from(value)), [ - [0, 0], - [1, 1] - ]); + assert.deepEqual( + result.map(value => Array.from(value)), + [ + [0, 0], + [1, 1], + ] + ); let calledTwice = false; texture.toArray = () => { calledTwice = true; }; - assert.deepEqual(cpuKernel(texture).map(value => Array.from(value)), [ - [0, 0], - [1, 1] - ]); + assert.deepEqual( + cpuKernel(texture).map(value => Array.from(value)), + [ + [0, 0], + [1, 1], + ] + ); assert.equal(calledTwice, false); gpu.destroy(); } @@ -162,38 +189,53 @@ function cpuWithTexturesArray2WithSinglePrecision(mode) { function cpuWithTexturesArray3WithSinglePrecision(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function() { - return [this.thread.x, this.thread.x, this.thread.x]; - }, { - output: [2], - pipeline: true, - precision: 'single', - }); + const kernel = gpu.createKernel( + function () { + return [this.thread.x, this.thread.x, this.thread.x]; + }, + { + output: [2], + pipeline: true, + precision: 'single', + } + ); const texture = kernel(); assert.ok(texture.toArray); - assert.deepEqual(texture.toArray().map(value => Array.from(value)), [ - [0, 0, 0], - [1, 1, 1] - ]); + assert.deepEqual( + texture.toArray().map(value => Array.from(value)), + [ + [0, 0, 0], + [1, 1, 1], + ] + ); const cpu = new GPU({ mode: 'cpu' }); - const cpuKernel = cpu.createKernel(function(v) { - return v[this.thread.x]; - }, { output: [2] }); + const cpuKernel = cpu.createKernel( + function (v) { + return v[this.thread.x]; + }, + { output: [2] } + ); assert.notOk(cpuKernel.kernel.textureCache); const result = cpuKernel(texture); assert.ok(cpuKernel.kernel.textureCache); - assert.deepEqual(result.map(value => Array.from(value)), [ - [0, 0, 0], - [1, 1, 1] - ]); + assert.deepEqual( + result.map(value => Array.from(value)), + [ + [0, 0, 0], + [1, 1, 1], + ] + ); let calledTwice = false; texture.toArray = () => { calledTwice = true; }; - assert.deepEqual(cpuKernel(texture).map(value => Array.from(value)), [ - [0, 0, 0], - [1, 1, 1] - ]); + assert.deepEqual( + cpuKernel(texture).map(value => Array.from(value)), + [ + [0, 0, 0], + [1, 1, 1], + ] + ); assert.equal(calledTwice, false); gpu.destroy(); } @@ -220,38 +262,53 @@ function cpuWithTexturesArray3WithSinglePrecision(mode) { function cpuWithTexturesArray4WithSinglePrecision(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function() { - return [this.thread.x, this.thread.x, this.thread.x, this.thread.x]; - }, { - output: [2], - pipeline: true, - precision: 'single', - }); + const kernel = gpu.createKernel( + function () { + return [this.thread.x, this.thread.x, this.thread.x, this.thread.x]; + }, + { + output: [2], + pipeline: true, + precision: 'single', + } + ); const texture = kernel(); assert.ok(texture.toArray); - assert.deepEqual(texture.toArray().map(value => Array.from(value)), [ - [0, 0, 0, 0], - [1, 1, 1, 1] - ]); + assert.deepEqual( + texture.toArray().map(value => Array.from(value)), + [ + [0, 0, 0, 0], + [1, 1, 1, 1], + ] + ); const cpu = new GPU({ mode: 'cpu' }); - const cpuKernel = cpu.createKernel(function(v) { - return v[this.thread.x]; - }, { output: [2] }); + const cpuKernel = cpu.createKernel( + function (v) { + return v[this.thread.x]; + }, + { output: [2] } + ); assert.notOk(cpuKernel.kernel.textureCache); const result = cpuKernel(texture); assert.ok(cpuKernel.kernel.textureCache); - assert.deepEqual(result.map(value => Array.from(value)), [ - [0, 0, 0, 0], - [1, 1, 1, 1] - ]); + assert.deepEqual( + result.map(value => Array.from(value)), + [ + [0, 0, 0, 0], + [1, 1, 1, 1], + ] + ); let calledTwice = false; texture.toArray = () => { calledTwice = true; }; - assert.deepEqual(cpuKernel(texture).map(value => Array.from(value)), [ - [0, 0, 0, 0], - [1, 1, 1, 1] - ]); + assert.deepEqual( + cpuKernel(texture).map(value => Array.from(value)), + [ + [0, 0, 0, 0], + [1, 1, 1, 1], + ] + ); assert.equal(calledTwice, false); gpu.destroy(); } @@ -278,20 +335,26 @@ function cpuWithTexturesArray4WithSinglePrecision(mode) { function cpuWithTexturesNumberWithUnsignedPrecision(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function() { - return this.thread.x; - }, { - output: [2], - pipeline: true, - precision: 'unsigned', - }); + const kernel = gpu.createKernel( + function () { + return this.thread.x; + }, + { + output: [2], + pipeline: true, + precision: 'unsigned', + } + ); const texture = kernel(); assert.ok(texture.toArray); assert.deepEqual(Array.from(texture.toArray()), [0, 1]); const cpu = new GPU({ mode: 'cpu' }); - const cpuKernel = cpu.createKernel(function(v) { - return v[this.thread.x]; - }, { output: [2] }); + const cpuKernel = cpu.createKernel( + function (v) { + return v[this.thread.x]; + }, + { output: [2] } + ); assert.notOk(cpuKernel.kernel.textureCache); const result = cpuKernel(texture); assert.ok(cpuKernel.kernel.textureCache); @@ -323,4 +386,4 @@ function cpuWithTexturesNumberWithUnsignedPrecision(mode) { (GPU.isHeadlessGLSupported && GPU.isSinglePrecisionSupported ? test : skip)('number with unsigned precision headlessgl', () => { cpuWithTexturesNumberWithUnsignedPrecision('headlessgl'); -}); \ No newline at end of file +}); diff --git a/test/features/create-kernel-map.js b/test/features/create-kernel-map.js index d516b545..c0519ec8 100644 --- a/test/features/create-kernel-map.js +++ b/test/features/create-kernel-map.js @@ -10,12 +10,17 @@ function createPropertyKernels(gpu, output) { const adder = alias('adder', function add(a1, a2) { return a1 + a2; }); - return gpu.createKernelMap({ - addResult: adder, - divideResult: divide - }, function(k1, k2, k3) { - return divide(adder(k1[this.thread.x], k2[this.thread.x]), k3[this.thread.x]); - }).setOutput(output); + return gpu + .createKernelMap( + { + addResult: adder, + divideResult: divide, + }, + function (k1, k2, k3) { + return divide(adder(k1[this.thread.x], k2[this.thread.x]), k3[this.thread.x]); + } + ) + .setOutput(output); } function createArrayKernels(gpu, output) { @@ -26,18 +31,19 @@ function createArrayKernels(gpu, output) { function divide(d1, d2) { return d1 / d2; } - return gpu.createKernelMap([ - add, divide - ], function(k1, k2, k3) { - return divide(add(k1[this.thread.x], k2[this.thread.x]), k3[this.thread.x]); - }).setOutput(output) + return gpu + .createKernelMap([add, divide], function (k1, k2, k3) { + return divide(add(k1[this.thread.x], k2[this.thread.x]), k3[this.thread.x]); + }) + .setOutput(output); } - function createKernel(gpu, output) { - return gpu.createKernel(function(a) { - return a[this.thread.x]; - }).setOutput(output); + return gpu + .createKernel(function (a) { + return a[this.thread.x]; + }) + .setOutput(output); } function createKernelMapObject1Dimension1Length(mode) { @@ -78,7 +84,6 @@ test('createKernelMap object 1 dimension 1 length cpu', () => { createKernelMapObject1Dimension1Length('cpu'); }); - function createKernelMapArray1Dimension1Length(mode) { const gpu = new GPU({ mode }); const superKernel = createArrayKernels(gpu, [1]); @@ -117,7 +122,6 @@ test('createKernelMap array 1 dimension 1 length cpu', () => { createKernelMapArray1Dimension1Length('cpu'); }); - function createKernelMapObject1Dimension5Length(mode) { const gpu = new GPU({ mode }); const superKernel = createPropertyKernels(gpu, [5]); @@ -156,7 +160,6 @@ test('createKernelMap object 1 dimension 5 length cpu', () => { createKernelMapObject1Dimension5Length('cpu'); }); - function createKernelMapArrayAuto(mode) { const gpu = new GPU({ mode }); const superKernel = createArrayKernels(gpu, [5]); @@ -200,11 +203,16 @@ function createKernelMap3DAuto(mode) { function saveTarget(value) { return value; } - const kernel = gpu.createKernelMap({ - target: saveTarget - }, function(value) { - return saveTarget(value); - }).setOutput([3, 3, 3]); + const kernel = gpu + .createKernelMap( + { + target: saveTarget, + }, + function (value) { + return saveTarget(value); + } + ) + .setOutput([3, 3, 3]); const result = kernel(1); const target = createKernel(gpu, [3, 3, 3])(result.target); assert.equal(result.result.length, 3); @@ -243,17 +251,19 @@ test('createKernelMap 3d cpu', () => { function createKernelMapArray2(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernelMap({ + const kernel = gpu.createKernelMap( + { mapFunc: function mapFunc(mapFuncVal) { return mapFuncVal; - } + }, }, function main() { const mapFuncVal = [1, 2]; mapFunc(mapFuncVal); const returnValue = [3, 4]; return returnValue; - }, { + }, + { output: [1], returnType: 'Array(2)', } @@ -290,17 +300,19 @@ test('createKernelMap Array(2) cpu', () => { function createKernelMapArray3(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernelMap({ + const kernel = gpu.createKernelMap( + { mapFunc: function mapFunc(mapFuncVal) { return mapFuncVal; - } + }, }, function main() { const mapFuncVal = [1, 2, 3]; mapFunc(mapFuncVal); const returnValue = [4, 5, 6]; return returnValue; - }, { + }, + { output: [1], returnType: 'Array(3)', } @@ -337,17 +349,19 @@ test('createKernelMap Array(3) cpu', () => { function createKernelMapArray4(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernelMap({ + const kernel = gpu.createKernelMap( + { mapFunc: function mapFunc(mapFuncVal) { return mapFuncVal; - } + }, }, function main() { const mapFuncVal = [1, 2, 3, 4]; mapFunc(mapFuncVal); const returnValue = [5, 6, 7, 8]; return returnValue; - }, { + }, + { output: [1], returnType: 'Array(4)', } @@ -380,4 +394,4 @@ test('createKernelMap Array(4) gpu', () => { test('createKernelMap Array(4) cpu', () => { createKernelMapArray4('cpu'); -}); \ No newline at end of file +}); diff --git a/test/features/demo.js b/test/features/demo.js index f4fc86ec..86e40feb 100644 --- a/test/features/demo.js +++ b/test/features/demo.js @@ -25,7 +25,8 @@ function demo(mode) { return result; } const gpu = new GPU({ mode }); - const multiplyMatrix = gpu.createKernel(function(a, b) { + const multiplyMatrix = gpu + .createKernel(function (a, b) { let sum = 0; for (let i = 0; i < 6; i++) { sum += a[this.thread.y][i] * b[i][this.thread.x]; @@ -34,31 +35,31 @@ function demo(mode) { }) .setOutput([6, 6]); - assert.ok(multiplyMatrix !== null, "function generated test"); - assert.equal(multiplyMatrix(a, b).length, 6, "basic return function test"); + assert.ok(multiplyMatrix !== null, 'function generated test'); + assert.equal(multiplyMatrix(a, b).length, 6, 'basic return function test'); gpu.destroy(); } -test("auto", () => { +test('auto', () => { demo(); }); -test("gpu", () => { +test('gpu', () => { demo('gpu'); }); -(GPU.isWebGLSupported ? test : skip)("webgl", function() { +(GPU.isWebGLSupported ? test : skip)('webgl', function () { demo('webgl'); }); -(GPU.isWebGL2Supported ? test : skip)("webgl2", function() { +(GPU.isWebGL2Supported ? test : skip)('webgl2', function () { demo('webgl2'); }); -(GPU.isHeadlessGLSupported ? test : skip)("headlessgl", function() { +(GPU.isHeadlessGLSupported ? test : skip)('headlessgl', function () { demo('headlessgl'); }); -test("cpu", () => { +test('cpu', () => { demo('cpu'); -}); \ No newline at end of file +}); diff --git a/test/features/destroy.js b/test/features/destroy.js index d6e05356..8597f1d0 100644 --- a/test/features/destroy.js +++ b/test/features/destroy.js @@ -10,21 +10,20 @@ function testWithoutDestroyContext(done, mode) { gpu.kernels.push({ kernel: { constructor: { - destroyContext: null - } + destroyContext: null, + }, }, - destroy: destroyKernel + destroy: destroyKernel, }); gpu.destroy(); - gpu.destroy() - .then(() => { - assert.equal(destroyKernel.callCount, 2); - assert.ok(true); - done(); - }); + gpu.destroy().then(() => { + assert.equal(destroyKernel.callCount, 2); + assert.ok(true); + done(); + }); } -test('without destroy context', (t) => { +test('without destroy context', t => { const done = t.async(); testWithoutDestroyContext(done); }); @@ -36,27 +35,25 @@ function testWithDestroyContext(done, mode) { gpu.kernels.push({ kernel: { constructor: { - destroyContext: destroyContextSpy - } + destroyContext: destroyContextSpy, + }, }, - destroy: destroyKernel + destroy: destroyKernel, }); gpu.destroy(); - gpu.destroy() - .then(() => { - assert.equal(destroyKernel.callCount, 2); - assert.equal(destroyContextSpy.callCount, 2); - assert.ok(true); - done(); - }); + gpu.destroy().then(() => { + assert.equal(destroyKernel.callCount, 2); + assert.equal(destroyContextSpy.callCount, 2); + assert.ok(true); + done(); + }); } -test('with destroy context', (t) => { +test('with destroy context', t => { const done = t.async(); testWithDestroyContext(done); }); - function testTexturesAreDestroyed(done, mode) { const mockTexture1 = {}; const mockTexture2 = {}; @@ -71,15 +68,14 @@ function testTexturesAreDestroyed(done, mode) { destroyExtensions: () => {}, }; mockKernelInstance.destroy = WebGLKernel.prototype.destroy.bind(mockKernelInstance); - GPU.prototype.destroy.call({ kernels: [mockKernelInstance] }) - .then(() => { - assert.equal(deleteTextureMock.callCount, 3); - assert.ok(true); - done(); - }); + GPU.prototype.destroy.call({ kernels: [mockKernelInstance] }).then(() => { + assert.equal(deleteTextureMock.callCount, 3); + assert.ok(true); + done(); + }); } -test('textures are destroyed', (t) => { +test('textures are destroyed', t => { const done = t.async(); testTexturesAreDestroyed(done); }); @@ -99,22 +95,21 @@ function testKernelTextureIsDeleted(done) { destroyExtensions: () => {}, }; mockKernelInstance.destroy = WebGLKernel.prototype.destroy.bind(mockKernelInstance); - GPU.prototype.destroy.call({ kernels: [mockKernelInstance] }) - .then(() => { - assert.equal(mockTextureDelete.callCount, 1); - assert.ok(true); - done(); - }); + GPU.prototype.destroy.call({ kernels: [mockKernelInstance] }).then(() => { + assert.equal(mockTextureDelete.callCount, 1); + assert.ok(true); + done(); + }); } -test('kernel.texture is deleted', (t) => { +test('kernel.texture is deleted', t => { const done = t.async(); testKernelTextureIsDeleted(done); }); function testKernelMappedTexturesAreDeleted(done) { const mockGPU = { - kernels: [] + kernels: [], }; const webGLTexture1 = {}; const mockTextureDelete1 = sinon.spy(); @@ -138,7 +133,8 @@ function testKernelMappedTexturesAreDeleted(done) { }; mockGPU.kernels.push(mockKernelInstance); mockKernelInstance.destroy = WebGLKernel.prototype.destroy.bind(mockKernelInstance); - GPU.prototype.destroy.call({ kernels: [mockKernelInstance] }) + GPU.prototype.destroy + .call({ kernels: [mockKernelInstance] }) .then(() => { assert.equal(mockTextureDelete1.callCount, 1); assert.equal(mockTextureDelete2.callCount, 1); @@ -146,19 +142,19 @@ function testKernelMappedTexturesAreDeleted(done) { assert.ok(true); done(); }) - .catch((e) => { + .catch(e => { console.error(e); }); } -test('kernel.mappedTextures are deleted', (t) => { +test('kernel.mappedTextures are deleted', t => { const done = t.async(); testKernelMappedTexturesAreDeleted(done); }); test('gpu.kernels is populated and removed by kernel', () => { const gpu = new GPU(); - const kernel = gpu.createKernel(function() { + const kernel = gpu.createKernel(function () { return 1; }); assert.equal(gpu.kernels.length, 1); @@ -171,15 +167,14 @@ test('gpu.kernels is populated and removed by kernel', () => { test('gpu.kernels is populated and removed by gpu', t => { const done = t.async(); const gpu = new GPU(); - const kernel = gpu.createKernel(function() { + const kernel = gpu.createKernel(function () { return 1; }); assert.equal(gpu.kernels.length, 1); assert.equal(gpu.kernels.indexOf(kernel.kernel), 0); - gpu.destroy() - .then(() => { - assert.equal(gpu.kernels.length, 0); - done(); - }); -}); \ No newline at end of file + gpu.destroy().then(() => { + assert.equal(gpu.kernels.length, 0); + done(); + }); +}); diff --git a/test/features/destructured-assignment.js b/test/features/destructured-assignment.js index 3687247c..38c0e588 100644 --- a/test/features/destructured-assignment.js +++ b/test/features/destructured-assignment.js @@ -5,10 +5,15 @@ describe('features: destructured assignment'); function testObject(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function() { - const { thread: { x, y } } = this; - return x + y; - }, { output: [2, 2] }); + const kernel = gpu.createKernel( + function () { + const { + thread: { x, y }, + } = this; + return x + y; + }, + { output: [2, 2] } + ); assert.deepEqual(kernel(), [new Float32Array([0, 1]), new Float32Array([1, 2])]); } @@ -38,10 +43,13 @@ test('object cpu', () => { function testNestedObject(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function() { - const { x, y } = this.thread; - return x + y; - }, { output: [2, 2] }); + const kernel = gpu.createKernel( + function () { + const { x, y } = this.thread; + return x + y; + }, + { output: [2, 2] } + ); assert.deepEqual(kernel(), [new Float32Array([0, 1]), new Float32Array([1, 2])]); } @@ -71,10 +79,13 @@ test('nested object cpu', () => { function testArray(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(array) { - const [first, second] = array; - return first + second; - }, { output: [1], argumentTypes: { array: 'Array(2)' } }); + const kernel = gpu.createKernel( + function (array) { + const [first, second] = array; + return first + second; + }, + { output: [1], argumentTypes: { array: 'Array(2)' } } + ); assert.deepEqual(kernel([1, 2]), new Float32Array([3])); } @@ -100,4 +111,4 @@ test('array gpu', () => { test('array cpu', () => { testArray('cpu'); -}); \ No newline at end of file +}); diff --git a/test/features/dev-mode.js b/test/features/dev-mode.js index a409cff0..238dad87 100644 --- a/test/features/dev-mode.js +++ b/test/features/dev-mode.js @@ -5,9 +5,12 @@ describe('features: dev mode'); test('are added to GPU instance .kernels property', () => { const gpu = new GPU({ mode: 'dev' }); - const kernel = gpu.createKernel(function(value) { - return value; - }, { output: [1] }); + const kernel = gpu.createKernel( + function (value) { + return value; + }, + { output: [1] } + ); assert.equal(gpu.kernels.length, 1); assert.deepEqual(kernel(1), new Float32Array([1])); gpu.destroy(); @@ -15,147 +18,145 @@ test('are added to GPU instance .kernels property', () => { test('works with integer', () => { const gpu = new GPU({ mode: 'dev' }); - const kernel = gpu.createKernel(function(value) { - return value; - }, { output: [1] }); + const kernel = gpu.createKernel( + function (value) { + return value; + }, + { output: [1] } + ); assert.deepEqual(kernel(1), new Float32Array([1])); gpu.destroy(); }); test('works with float', () => { const gpu = new GPU({ mode: 'dev' }); - const kernel = gpu.createKernel(function(value) { - return value; - }, { output: [1] }); + const kernel = gpu.createKernel( + function (value) { + return value; + }, + { output: [1] } + ); assert.deepEqual(kernel(1.5), new Float32Array([1.5])); gpu.destroy(); }); test('works with array', () => { const gpu = new GPU({ mode: 'dev' }); - const kernel = gpu.createKernel(function(value) { - return value[this.thread.x]; - }, { output: [4] }); + const kernel = gpu.createKernel( + function (value) { + return value[this.thread.x]; + }, + { output: [4] } + ); assert.deepEqual(kernel([1, 2, 3, 4]), new Float32Array([1, 2, 3, 4])); gpu.destroy(); }); test('works with matrix', () => { const gpu = new GPU({ mode: 'dev' }); - const kernel = gpu.createKernel(function(value) { - return value[this.thread.y][this.thread.x]; - }, { output: [4, 2] }); - assert.deepEqual(kernel( - [ + const kernel = gpu.createKernel( + function (value) { + return value[this.thread.y][this.thread.x]; + }, + { output: [4, 2] } + ); + assert.deepEqual( + kernel([ [1, 2, 3, 4], - [5, 6, 7, 8] - ] - ), [ - new Float32Array([1, 2, 3, 4]), - new Float32Array([5, 6, 7, 8]), - ]); + [5, 6, 7, 8], + ]), + [new Float32Array([1, 2, 3, 4]), new Float32Array([5, 6, 7, 8])] + ); gpu.destroy(); }); test('works with cube', () => { const gpu = new GPU({ mode: 'dev' }); - const kernel = gpu.createKernel(function(value) { - return value[this.thread.z][this.thread.y][this.thread.x]; - }, { output: [4, 2, 2] }); - assert.deepEqual(kernel( - [ + const kernel = gpu.createKernel( + function (value) { + return value[this.thread.z][this.thread.y][this.thread.x]; + }, + { output: [4, 2, 2] } + ); + assert.deepEqual( + kernel([ [ [1, 2, 3, 4], - [5, 6, 7, 8] + [5, 6, 7, 8], ], [ [9, 10, 11, 12], - [13, 14, 15, 16] - ] - ] - ), [ - [ - new Float32Array([1, 2, 3, 4]), - new Float32Array([5, 6, 7, 8]), - ], + [13, 14, 15, 16], + ], + ]), [ - new Float32Array([9, 10, 11, 12]), - new Float32Array([13, 14, 15, 16]), + [new Float32Array([1, 2, 3, 4]), new Float32Array([5, 6, 7, 8])], + [new Float32Array([9, 10, 11, 12]), new Float32Array([13, 14, 15, 16])], ] - ]); + ); gpu.destroy(); }); test('works with input array', () => { const gpu = new GPU({ mode: 'dev' }); - const kernel = gpu.createKernel(function(value) { - return value[this.thread.x]; - }, { output: [4] }); + const kernel = gpu.createKernel( + function (value) { + return value[this.thread.x]; + }, + { output: [4] } + ); assert.deepEqual(kernel(input([1, 2, 3, 4], [4])), new Float32Array([1, 2, 3, 4])); gpu.destroy(); }); test('works with input matrix', () => { const gpu = new GPU({ mode: 'dev' }); - const kernel = gpu.createKernel(function(value) { - return value[this.thread.y][this.thread.x]; - }, { output: [4, 2] }); - assert.deepEqual(kernel(input([1, 2, 3, 4, 5, 6, 7, 8], [4, 2])), [ - new Float32Array([1, 2, 3, 4]), - new Float32Array([5, 6, 7, 8]), - ]); + const kernel = gpu.createKernel( + function (value) { + return value[this.thread.y][this.thread.x]; + }, + { output: [4, 2] } + ); + assert.deepEqual(kernel(input([1, 2, 3, 4, 5, 6, 7, 8], [4, 2])), [new Float32Array([1, 2, 3, 4]), new Float32Array([5, 6, 7, 8])]); gpu.destroy(); }); test('works with input cube', () => { const gpu = new GPU({ mode: 'dev' }); - const kernel = gpu.createKernel(function(value) { - return value[this.thread.z][this.thread.y][this.thread.x]; - }, { output: [4, 2, 2] }); - assert.deepEqual(kernel( - input([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], [4, 2, 2]) - ), [ - [ - new Float32Array([1, 2, 3, 4]), - new Float32Array([5, 6, 7, 8]), - ], - [ - new Float32Array([9, 10, 11, 12]), - new Float32Array([13, 14, 15, 16]), - ] + const kernel = gpu.createKernel( + function (value) { + return value[this.thread.z][this.thread.y][this.thread.x]; + }, + { output: [4, 2, 2] } + ); + assert.deepEqual(kernel(input([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], [4, 2, 2])), [ + [new Float32Array([1, 2, 3, 4]), new Float32Array([5, 6, 7, 8])], + [new Float32Array([9, 10, 11, 12]), new Float32Array([13, 14, 15, 16])], ]); gpu.destroy(); }); test('works with texture', () => { - const texture = ((new GPU()).createKernel(function(cube) { - return cube[this.thread.z][this.thread.y][this.thread.x]; - }, { output: [4, 2, 2], pipeline: true }))([ - [ - new Float32Array([1, 2, 3, 4]), - new Float32Array([5, 6, 7, 8]), - ], - [ - new Float32Array([9, 10, 11, 12]), - new Float32Array([13, 14, 15, 16]), - ] + const texture = new GPU().createKernel( + function (cube) { + return cube[this.thread.z][this.thread.y][this.thread.x]; + }, + { output: [4, 2, 2], pipeline: true } + )([ + [new Float32Array([1, 2, 3, 4]), new Float32Array([5, 6, 7, 8])], + [new Float32Array([9, 10, 11, 12]), new Float32Array([13, 14, 15, 16])], ]); assert.ok(texture.constructor.name.match('Texture')); const gpu = new GPU({ mode: 'dev' }); - const kernel = gpu.createKernel(function(value) { - return value[this.thread.z][this.thread.y][this.thread.x]; - }, { output: [4, 2, 2] }); - assert.deepEqual(kernel( - texture - ), [ - [ - new Float32Array([1, 2, 3, 4]), - new Float32Array([5, 6, 7, 8]), - ], - [ - new Float32Array([9, 10, 11, 12]), - new Float32Array([13, 14, 15, 16]), - ] + const kernel = gpu.createKernel( + function (value) { + return value[this.thread.z][this.thread.y][this.thread.x]; + }, + { output: [4, 2, 2] } + ); + assert.deepEqual(kernel(texture), [ + [new Float32Array([1, 2, 3, 4]), new Float32Array([5, 6, 7, 8])], + [new Float32Array([9, 10, 11, 12]), new Float32Array([13, 14, 15, 16])], ]); gpu.destroy(); }); @@ -167,9 +168,12 @@ test('works with adding functions', () => { return value + 1; } gpu.addFunction(addOne); - const kernel = gpu.createKernel(function(value) { - return addOne(value); - }, { output: [1] }); + const kernel = gpu.createKernel( + function (value) { + return addOne(value); + }, + { output: [1] } + ); assert.deepEqual(kernel(1), new Float32Array([2])); gpu.destroy(); -}); \ No newline at end of file +}); diff --git a/test/features/dynamic-arguments.js b/test/features/dynamic-arguments.js index 8ef472fc..e5838c92 100644 --- a/test/features/dynamic-arguments.js +++ b/test/features/dynamic-arguments.js @@ -16,7 +16,8 @@ function testHTMLImage(done, mode) { function loaded() { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(image) { + const kernel = gpu + .createKernel(function (image) { const pixel = image[this.thread.y][this.thread.x]; return (pixel[0] + pixel[1] + pixel[2]) / 3; }) @@ -28,12 +29,12 @@ function testHTMLImage(done, mode) { kernel.setOutput([138, 91]); const pixels2 = kernel(image2); - assert.ok(pixels1[0][0] > .43); - assert.ok(pixels1[0][0] < .45); + assert.ok(pixels1[0][0] > 0.43); + assert.ok(pixels1[0][0] < 0.45); assert.equal(pixels1.length, image1.height); assert.equal(pixels1[0].length, image1.width); - assert.ok(pixels2[0][0] > .82); - assert.ok(pixels2[0][0] < .83); + assert.ok(pixels2[0][0] > 0.82); + assert.ok(pixels2[0][0] < 0.83); assert.equal(pixels2.length, image2.height); assert.equal(pixels2[0].length, image2.width); @@ -66,46 +67,44 @@ function testMemoryOptimizedNumberTexture(mode) { [9, 10, 11, 12], [13, 14, 15, 16], ]; - const texture4X4 = ( - gpu.createKernel(function(value) { + const texture4X4 = gpu + .createKernel(function (value) { return value[this.thread.y][this.thread.x]; }) .setOutput([4, 4]) .setPrecision('single') .setOptimizeFloatMemory(true) - .setPipeline(true) - )(matrix4X4); + .setPipeline(true)(matrix4X4); const matrix3X3 = [ [1, 2, 3], [4, 5, 6], - [7, 8, 9] + [7, 8, 9], ]; - const texture3X3 = ( - gpu.createKernel(function(value) { + const texture3X3 = gpu + .createKernel(function (value) { return value[this.thread.y][this.thread.x]; }) .setOutput([3, 3]) .setPrecision('single') .setOptimizeFloatMemory(true) - .setPipeline(true) - )(matrix3X3); + .setPipeline(true)(matrix3X3); const matrix2X2 = [ [1, 2], - [3, 4] + [3, 4], ]; - const texture2X2 = ( - gpu.createKernel(function(value) { + const texture2X2 = gpu + .createKernel(function (value) { return value[this.thread.y][this.thread.x]; }) .setOutput([2, 2]) .setPrecision('single') .setOptimizeFloatMemory(true) - .setPipeline(true) - )(matrix2X2); + .setPipeline(true)(matrix2X2); - const kernel = gpu.createKernel(function(texture) { + const kernel = gpu + .createKernel(function (texture) { return texture[this.thread.y][this.thread.x]; }) .setDynamicArguments(true) @@ -113,25 +112,13 @@ function testMemoryOptimizedNumberTexture(mode) { .setOptimizeFloatMemory(true) .setOutput([4, 4]); - assert.deepEqual(kernel(texture4X4), [ - new Float32Array([1, 2, 3, 4]), - new Float32Array([5, 6, 7, 8]), - new Float32Array([9, 10, 11, 12]), - new Float32Array([13, 14, 15, 16]), - ]); + assert.deepEqual(kernel(texture4X4), [new Float32Array([1, 2, 3, 4]), new Float32Array([5, 6, 7, 8]), new Float32Array([9, 10, 11, 12]), new Float32Array([13, 14, 15, 16])]); kernel.setOutput([3, 3]); - assert.deepEqual(kernel(texture3X3), [ - new Float32Array([1, 2, 3]), - new Float32Array([4, 5, 6]), - new Float32Array([7, 8, 9]), - ]); + assert.deepEqual(kernel(texture3X3), [new Float32Array([1, 2, 3]), new Float32Array([4, 5, 6]), new Float32Array([7, 8, 9])]); kernel.setOutput([2, 2]); - assert.deepEqual(kernel(texture2X2), [ - new Float32Array([1, 2]), - new Float32Array([3, 4]), - ]); + assert.deepEqual(kernel(texture2X2), [new Float32Array([1, 2]), new Float32Array([3, 4])]); assert.ok(kernel.kernelArguments[0].constructor.name.match('DynamicMemoryOptimizedNumberTexture')); @@ -166,68 +153,54 @@ function testNumberTexture(mode) { [9, 10, 11, 12], [13, 14, 15, 16], ]; - const texture4X4 = ( - gpu.createKernel(function(value) { + const texture4X4 = gpu + .createKernel(function (value) { return value[this.thread.y][this.thread.x]; }) .setOutput([4, 4]) .setPrecision('single') - .setPipeline(true) - )(matrix4X4); + .setPipeline(true)(matrix4X4); const matrix3X3 = [ [1, 2, 3], [4, 5, 6], - [7, 8, 9] + [7, 8, 9], ]; - const texture3X3 = ( - gpu.createKernel(function(value) { + const texture3X3 = gpu + .createKernel(function (value) { return value[this.thread.y][this.thread.x]; }) .setOutput([3, 3]) .setPrecision('single') - .setPipeline(true) - )(matrix3X3); + .setPipeline(true)(matrix3X3); const matrix2X2 = [ [1, 2], - [3, 4] + [3, 4], ]; - const texture2X2 = ( - gpu.createKernel(function(value) { + const texture2X2 = gpu + .createKernel(function (value) { return value[this.thread.y][this.thread.x]; }) .setOutput([2, 2]) .setPrecision('single') - .setPipeline(true) - )(matrix2X2); + .setPipeline(true)(matrix2X2); - const kernel = gpu.createKernel(function(texture) { + const kernel = gpu + .createKernel(function (texture) { return texture[this.thread.y][this.thread.x]; }) .setDynamicArguments(true) .setDynamicOutput(true) .setOutput([4, 4]); - assert.deepEqual(kernel(texture4X4), [ - new Float32Array([1, 2, 3, 4]), - new Float32Array([5, 6, 7, 8]), - new Float32Array([9, 10, 11, 12]), - new Float32Array([13, 14, 15, 16]), - ]); + assert.deepEqual(kernel(texture4X4), [new Float32Array([1, 2, 3, 4]), new Float32Array([5, 6, 7, 8]), new Float32Array([9, 10, 11, 12]), new Float32Array([13, 14, 15, 16])]); kernel.setOutput([3, 3]); - assert.deepEqual(kernel(texture3X3), [ - new Float32Array([1, 2, 3]), - new Float32Array([4, 5, 6]), - new Float32Array([7, 8, 9]), - ]); + assert.deepEqual(kernel(texture3X3), [new Float32Array([1, 2, 3]), new Float32Array([4, 5, 6]), new Float32Array([7, 8, 9])]); kernel.setOutput([2, 2]); - assert.deepEqual(kernel(texture2X2), [ - new Float32Array([1, 2]), - new Float32Array([3, 4]), - ]); + assert.deepEqual(kernel(texture2X2), [new Float32Array([1, 2]), new Float32Array([3, 4])]); assert.ok(kernel.kernelArguments[0].constructor.name.match('NumberTexture')); @@ -262,70 +235,56 @@ function testMixedNumberTexture(mode) { [9, 10, 11, 12], [13, 14, 15, 16], ]; - const texture4X4 = ( - gpu.createKernel(function(value) { + const texture4X4 = gpu + .createKernel(function (value) { return value[this.thread.y][this.thread.x]; }) .setOutput([4, 4]) .setPrecision('single') .setOptimizeFloatMemory(true) - .setPipeline(true) - )(matrix4X4); + .setPipeline(true)(matrix4X4); const matrix3X3 = [ [1, 2, 3], [4, 5, 6], - [7, 8, 9] + [7, 8, 9], ]; - const texture3X3 = ( - gpu.createKernel(function(value) { + const texture3X3 = gpu + .createKernel(function (value) { return value[this.thread.y][this.thread.x]; }) .setOutput([3, 3]) .setPrecision('single') .setOptimizeFloatMemory(true) - .setPipeline(true) - )(matrix3X3); + .setPipeline(true)(matrix3X3); const matrix2X2 = [ [1, 2], - [3, 4] + [3, 4], ]; - const texture2X2 = ( - gpu.createKernel(function(value) { + const texture2X2 = gpu + .createKernel(function (value) { return value[this.thread.y][this.thread.x]; }) .setOutput([2, 2]) .setPrecision('single') - .setPipeline(true) - )(matrix2X2); + .setPipeline(true)(matrix2X2); - const kernel = gpu.createKernel(function(texture) { + const kernel = gpu + .createKernel(function (texture) { return texture[this.thread.y][this.thread.x]; }) .setDynamicArguments(true) .setDynamicOutput(true) .setOutput([4, 4]); - assert.deepEqual(kernel(texture4X4), [ - new Float32Array([1, 2, 3, 4]), - new Float32Array([5, 6, 7, 8]), - new Float32Array([9, 10, 11, 12]), - new Float32Array([13, 14, 15, 16]), - ]); + assert.deepEqual(kernel(texture4X4), [new Float32Array([1, 2, 3, 4]), new Float32Array([5, 6, 7, 8]), new Float32Array([9, 10, 11, 12]), new Float32Array([13, 14, 15, 16])]); kernel.setOutput([3, 3]); - assert.deepEqual(kernel(texture3X3), [ - new Float32Array([1, 2, 3]), - new Float32Array([4, 5, 6]), - new Float32Array([7, 8, 9]), - ]); + assert.deepEqual(kernel(texture3X3), [new Float32Array([1, 2, 3]), new Float32Array([4, 5, 6]), new Float32Array([7, 8, 9])]); kernel.setOutput([2, 2]); - assert.deepEqual(kernel(texture2X2), [ - new Float32Array([1, 2]), - new Float32Array([3, 4]), - ]); + assert.deepEqual(kernel(texture2X2), [new Float32Array([1, 2]), new Float32Array([3, 4])]); assert.ok(kernel.kernelArguments[0].constructor.name.match('NumberTexture')); @@ -354,25 +313,20 @@ function testMixedNumberTexture(mode) { function testSingleArray1D2(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(v) { - return v[this.thread.x]; - }, { - argumentTypes: { v: 'Array1D(2)' }, - dynamicArguments: true, - dynamicOutput: true - }); - const expected1 = [ - new Float32Array([1, 2]), - new Float32Array([3, 4]), - ]; + const kernel = gpu.createKernel( + function (v) { + return v[this.thread.x]; + }, + { + argumentTypes: { v: 'Array1D(2)' }, + dynamicArguments: true, + dynamicOutput: true, + } + ); + const expected1 = [new Float32Array([1, 2]), new Float32Array([3, 4])]; kernel.setOutput([expected1.length]); assert.deepEqual(kernel(expected1), expected1); - const expected2 = [ - new Float32Array([1, 2]), - new Float32Array([3, 4]), - new Float32Array([5, 6]), - new Float32Array([7, 8]), - ]; + const expected2 = [new Float32Array([1, 2]), new Float32Array([3, 4]), new Float32Array([5, 6]), new Float32Array([7, 8])]; kernel.setOutput([expected2.length]); assert.deepEqual(kernel(expected2), expected2); gpu.destroy(); @@ -404,25 +358,20 @@ test('Single Array1D2 cpu', () => { function testSingleArray1D3(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(v) { - return v[this.thread.x]; - }, { - argumentTypes: { v: 'Array1D(3)' }, - dynamicArguments: true, - dynamicOutput: true - }); - const expected1 = [ - new Float32Array([1, 2, 3]), - new Float32Array([4, 5, 6]), - ]; + const kernel = gpu.createKernel( + function (v) { + return v[this.thread.x]; + }, + { + argumentTypes: { v: 'Array1D(3)' }, + dynamicArguments: true, + dynamicOutput: true, + } + ); + const expected1 = [new Float32Array([1, 2, 3]), new Float32Array([4, 5, 6])]; kernel.setOutput([expected1.length]); assert.deepEqual(kernel(expected1), expected1); - const expected2 = [ - new Float32Array([1, 2, 3]), - new Float32Array([4, 5, 6]), - new Float32Array([7, 8, 9]), - new Float32Array([10, 11, 12]), - ]; + const expected2 = [new Float32Array([1, 2, 3]), new Float32Array([4, 5, 6]), new Float32Array([7, 8, 9]), new Float32Array([10, 11, 12])]; kernel.setOutput([expected2.length]); assert.deepEqual(kernel(expected2), expected2); gpu.destroy(); @@ -454,25 +403,20 @@ test('Single Array1D3 cpu', () => { function testSingleArray1D4(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(v) { - return v[this.thread.x]; - }, { - argumentTypes: { v: 'Array1D(4)' }, - dynamicArguments: true, - dynamicOutput: true - }); - const expected1 = [ - new Float32Array([1, 2, 3, 4]), - new Float32Array([5, 6, 7, 8]), - ]; + const kernel = gpu.createKernel( + function (v) { + return v[this.thread.x]; + }, + { + argumentTypes: { v: 'Array1D(4)' }, + dynamicArguments: true, + dynamicOutput: true, + } + ); + const expected1 = [new Float32Array([1, 2, 3, 4]), new Float32Array([5, 6, 7, 8])]; kernel.setOutput([expected1.length]); assert.deepEqual(kernel(expected1), expected1); - const expected2 = [ - new Float32Array([1, 2, 3, 4]), - new Float32Array([5, 6, 7, 8]), - new Float32Array([9, 10, 11, 12]), - new Float32Array([13, 14, 15, 16]), - ]; + const expected2 = [new Float32Array([1, 2, 3, 4]), new Float32Array([5, 6, 7, 8]), new Float32Array([9, 10, 11, 12]), new Float32Array([13, 14, 15, 16])]; kernel.setOutput([expected2.length]); assert.deepEqual(kernel(expected2), expected2); gpu.destroy(); @@ -504,38 +448,25 @@ test('Single Array1D4 cpu', () => { function testSingleArray2D2(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(v) { - return v[this.thread.y][this.thread.x]; - }, { - argumentTypes: { v: 'Array2D(2)' }, - dynamicArguments: true, - dynamicOutput: true - }); + const kernel = gpu.createKernel( + function (v) { + return v[this.thread.y][this.thread.x]; + }, + { + argumentTypes: { v: 'Array2D(2)' }, + dynamicArguments: true, + dynamicOutput: true, + } + ); const expected1 = [ - [ - new Float32Array([1, 2]), - new Float32Array([3, 4]), - ], - [ - new Float32Array([5, 6]), - new Float32Array([7, 8]), - ] + [new Float32Array([1, 2]), new Float32Array([3, 4])], + [new Float32Array([5, 6]), new Float32Array([7, 8])], ]; kernel.setOutput([expected1[0].length, expected1.length]); assert.deepEqual(kernel(expected1), expected1); const expected2 = [ - [ - new Float32Array([1, 2]), - new Float32Array([3, 4]), - new Float32Array([5, 6]), - new Float32Array([7, 8]), - ], - [ - new Float32Array([9, 10]), - new Float32Array([11, 12]), - new Float32Array([13, 14]), - new Float32Array([15, 16]), - ] + [new Float32Array([1, 2]), new Float32Array([3, 4]), new Float32Array([5, 6]), new Float32Array([7, 8])], + [new Float32Array([9, 10]), new Float32Array([11, 12]), new Float32Array([13, 14]), new Float32Array([15, 16])], ]; kernel.setOutput([expected2[0].length, expected2.length]); assert.deepEqual(kernel(expected2), expected2); @@ -568,38 +499,25 @@ test('Single Array2D2 gpu', () => { function testSingleArray2D3(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(v) { - return v[this.thread.y][this.thread.x]; - }, { - argumentTypes: { v: 'Array2D(3)' }, - dynamicArguments: true, - dynamicOutput: true - }); + const kernel = gpu.createKernel( + function (v) { + return v[this.thread.y][this.thread.x]; + }, + { + argumentTypes: { v: 'Array2D(3)' }, + dynamicArguments: true, + dynamicOutput: true, + } + ); const expected1 = [ - [ - new Float32Array([1, 2, 3]), - new Float32Array([4, 5, 6]), - ], - [ - new Float32Array([7, 8, 9]), - new Float32Array([10, 11, 12]), - ] + [new Float32Array([1, 2, 3]), new Float32Array([4, 5, 6])], + [new Float32Array([7, 8, 9]), new Float32Array([10, 11, 12])], ]; kernel.setOutput([expected1[0].length, expected1.length]); assert.deepEqual(kernel(expected1), expected1); const expected2 = [ - [ - new Float32Array([1, 2, 3]), - new Float32Array([4, 5, 6]), - new Float32Array([7, 8, 9]), - new Float32Array([10, 11, 12]), - ], - [ - new Float32Array([13, 14, 15]), - new Float32Array([16, 17, 18]), - new Float32Array([19, 20, 21]), - new Float32Array([22, 23, 24]), - ] + [new Float32Array([1, 2, 3]), new Float32Array([4, 5, 6]), new Float32Array([7, 8, 9]), new Float32Array([10, 11, 12])], + [new Float32Array([13, 14, 15]), new Float32Array([16, 17, 18]), new Float32Array([19, 20, 21]), new Float32Array([22, 23, 24])], ]; kernel.setOutput([expected2[0].length, expected2.length]); assert.deepEqual(kernel(expected2), expected2); @@ -632,38 +550,25 @@ test('Single Array2D3 cpu', () => { function testSingleArray2D4(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(v) { - return v[this.thread.y][this.thread.x]; - }, { - argumentTypes: { v: 'Array2D(4)' }, - dynamicArguments: true, - dynamicOutput: true - }); + const kernel = gpu.createKernel( + function (v) { + return v[this.thread.y][this.thread.x]; + }, + { + argumentTypes: { v: 'Array2D(4)' }, + dynamicArguments: true, + dynamicOutput: true, + } + ); const expected1 = [ - [ - new Float32Array([1, 2, 3, 4]), - new Float32Array([5, 6, 7, 8]), - ], - [ - new Float32Array([9, 10, 11, 12]), - new Float32Array([13, 14, 15, 16]), - ] + [new Float32Array([1, 2, 3, 4]), new Float32Array([5, 6, 7, 8])], + [new Float32Array([9, 10, 11, 12]), new Float32Array([13, 14, 15, 16])], ]; kernel.setOutput([expected1[0].length, expected1.length]); assert.deepEqual(kernel(expected1), expected1); const expected2 = [ - [ - new Float32Array([1, 2, 3, 4]), - new Float32Array([5, 6, 7, 8]), - new Float32Array([9, 10, 11, 12]), - new Float32Array([13, 14, 15, 16]), - ], - [ - new Float32Array([17, 18, 19, 20]), - new Float32Array([21, 22, 23, 24]), - new Float32Array([25, 26, 27, 28]), - new Float32Array([29, 30, 31, 32]), - ] + [new Float32Array([1, 2, 3, 4]), new Float32Array([5, 6, 7, 8]), new Float32Array([9, 10, 11, 12]), new Float32Array([13, 14, 15, 16])], + [new Float32Array([17, 18, 19, 20]), new Float32Array([21, 22, 23, 24]), new Float32Array([25, 26, 27, 28]), new Float32Array([29, 30, 31, 32])], ]; kernel.setOutput([expected2[0].length, expected2.length]); assert.deepEqual(kernel(expected2), expected2); @@ -696,66 +601,37 @@ test('Single Array2D4 cpu', () => { function testSingleArray3D2(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(v) { - return v[this.thread.z][this.thread.y][this.thread.x]; - }, { - argumentTypes: { v: 'Array3D(2)' }, - dynamicArguments: true, - dynamicOutput: true - }); + const kernel = gpu.createKernel( + function (v) { + return v[this.thread.z][this.thread.y][this.thread.x]; + }, + { + argumentTypes: { v: 'Array3D(2)' }, + dynamicArguments: true, + dynamicOutput: true, + } + ); const expected1 = [ [ - [ - new Float32Array([1, 2]), - new Float32Array([3, 4]), - ], - [ - new Float32Array([5, 6]), - new Float32Array([7, 8]), - ] + [new Float32Array([1, 2]), new Float32Array([3, 4])], + [new Float32Array([5, 6]), new Float32Array([7, 8])], ], [ - [ - new Float32Array([9, 10]), - new Float32Array([11, 12]), - ], - [ - new Float32Array([13, 14]), - new Float32Array([15, 16]), - ] - ] + [new Float32Array([9, 10]), new Float32Array([11, 12])], + [new Float32Array([13, 14]), new Float32Array([15, 16])], + ], ]; kernel.setOutput([expected1[0][0].length, expected1[0].length, expected1.length]); assert.deepEqual(kernel(expected1), expected1); const expected2 = [ [ - [ - new Float32Array([1, 2]), - new Float32Array([3, 4]), - new Float32Array([5, 6]), - new Float32Array([7, 8]), - ], - [ - new Float32Array([9, 10]), - new Float32Array([11, 12]), - new Float32Array([13, 14]), - new Float32Array([15, 16]), - ] + [new Float32Array([1, 2]), new Float32Array([3, 4]), new Float32Array([5, 6]), new Float32Array([7, 8])], + [new Float32Array([9, 10]), new Float32Array([11, 12]), new Float32Array([13, 14]), new Float32Array([15, 16])], ], [ - [ - new Float32Array([17, 18]), - new Float32Array([19, 20]), - new Float32Array([21, 22]), - new Float32Array([23, 24]), - ], - [ - new Float32Array([25, 26]), - new Float32Array([27, 28]), - new Float32Array([29, 30]), - new Float32Array([31, 32]), - ] - ] + [new Float32Array([17, 18]), new Float32Array([19, 20]), new Float32Array([21, 22]), new Float32Array([23, 24])], + [new Float32Array([25, 26]), new Float32Array([27, 28]), new Float32Array([29, 30]), new Float32Array([31, 32])], + ], ]; kernel.setOutput([expected2[0][0].length, expected2[0].length, expected2.length]); assert.deepEqual(kernel(expected2), expected2); @@ -788,66 +664,37 @@ test('Single Array3D2 cpu', () => { function testSingleArray3D3(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(v) { - return v[this.thread.z][this.thread.y][this.thread.x]; - }, { - argumentTypes: { v: 'Array3D(3)' }, - dynamicArguments: true, - dynamicOutput: true - }); + const kernel = gpu.createKernel( + function (v) { + return v[this.thread.z][this.thread.y][this.thread.x]; + }, + { + argumentTypes: { v: 'Array3D(3)' }, + dynamicArguments: true, + dynamicOutput: true, + } + ); const expected1 = [ [ - [ - new Float32Array([1, 2, 3]), - new Float32Array([4, 5, 6]), - ], - [ - new Float32Array([7, 8, 9]), - new Float32Array([10, 11, 12]), - ] + [new Float32Array([1, 2, 3]), new Float32Array([4, 5, 6])], + [new Float32Array([7, 8, 9]), new Float32Array([10, 11, 12])], ], [ - [ - new Float32Array([13, 14, 15]), - new Float32Array([16, 17, 18]), - ], - [ - new Float32Array([19, 20, 21]), - new Float32Array([22, 23, 24]), - ] - ] + [new Float32Array([13, 14, 15]), new Float32Array([16, 17, 18])], + [new Float32Array([19, 20, 21]), new Float32Array([22, 23, 24])], + ], ]; kernel.setOutput([expected1[0][0].length, expected1[0].length, expected1.length]); assert.deepEqual(kernel(expected1), expected1); const expected2 = [ [ - [ - new Float32Array([1, 2, 3]), - new Float32Array([4, 5, 6]), - new Float32Array([7, 8, 9]), - new Float32Array([10, 11, 12]), - ], - [ - new Float32Array([13, 14, 15]), - new Float32Array([16, 17, 18]), - new Float32Array([19, 20, 21]), - new Float32Array([22, 23, 24]), - ] + [new Float32Array([1, 2, 3]), new Float32Array([4, 5, 6]), new Float32Array([7, 8, 9]), new Float32Array([10, 11, 12])], + [new Float32Array([13, 14, 15]), new Float32Array([16, 17, 18]), new Float32Array([19, 20, 21]), new Float32Array([22, 23, 24])], ], [ - [ - new Float32Array([25, 26, 27]), - new Float32Array([28, 29, 30]), - new Float32Array([31, 32, 33]), - new Float32Array([34, 35, 36]), - ], - [ - new Float32Array([37, 38, 39]), - new Float32Array([40, 41, 42]), - new Float32Array([43, 44, 45]), - new Float32Array([46, 47, 48]), - ] - ] + [new Float32Array([25, 26, 27]), new Float32Array([28, 29, 30]), new Float32Array([31, 32, 33]), new Float32Array([34, 35, 36])], + [new Float32Array([37, 38, 39]), new Float32Array([40, 41, 42]), new Float32Array([43, 44, 45]), new Float32Array([46, 47, 48])], + ], ]; kernel.setOutput([expected2[0][0].length, expected2[0].length, expected2.length]); assert.deepEqual(kernel(expected2), expected2); @@ -880,66 +727,37 @@ test('Single Array3D3 cpu', () => { function testSingleArray3D4(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(v) { - return v[this.thread.z][this.thread.y][this.thread.x]; - }, { - argumentTypes: { v: 'Array3D(4)' }, - dynamicArguments: true, - dynamicOutput: true - }); + const kernel = gpu.createKernel( + function (v) { + return v[this.thread.z][this.thread.y][this.thread.x]; + }, + { + argumentTypes: { v: 'Array3D(4)' }, + dynamicArguments: true, + dynamicOutput: true, + } + ); const expected1 = [ [ - [ - new Float32Array([1, 2, 3, 4]), - new Float32Array([5, 6, 7, 8]), - ], - [ - new Float32Array([9, 10, 11, 12]), - new Float32Array([13, 14, 15, 16]), - ] + [new Float32Array([1, 2, 3, 4]), new Float32Array([5, 6, 7, 8])], + [new Float32Array([9, 10, 11, 12]), new Float32Array([13, 14, 15, 16])], ], [ - [ - new Float32Array([17, 18, 19, 20]), - new Float32Array([21, 22, 23, 24]), - ], - [ - new Float32Array([25, 26, 27, 28]), - new Float32Array([29, 30, 31, 32]), - ] - ] + [new Float32Array([17, 18, 19, 20]), new Float32Array([21, 22, 23, 24])], + [new Float32Array([25, 26, 27, 28]), new Float32Array([29, 30, 31, 32])], + ], ]; kernel.setOutput([expected1[0][0].length, expected1[0].length, expected1.length]); assert.deepEqual(kernel(expected1), expected1); const expected2 = [ [ - [ - new Float32Array([1, 2, 3, 4]), - new Float32Array([5, 6, 7, 8]), - new Float32Array([9, 10, 11, 12]), - new Float32Array([13, 14, 15, 16]), - ], - [ - new Float32Array([17, 18, 19, 20]), - new Float32Array([21, 22, 23, 24]), - new Float32Array([25, 26, 27, 28]), - new Float32Array([29, 30, 31, 32]), - ] + [new Float32Array([1, 2, 3, 4]), new Float32Array([5, 6, 7, 8]), new Float32Array([9, 10, 11, 12]), new Float32Array([13, 14, 15, 16])], + [new Float32Array([17, 18, 19, 20]), new Float32Array([21, 22, 23, 24]), new Float32Array([25, 26, 27, 28]), new Float32Array([29, 30, 31, 32])], ], [ - [ - new Float32Array([33, 34, 35, 36]), - new Float32Array([37, 38, 39, 40]), - new Float32Array([41, 42, 43, 44]), - new Float32Array([45, 46, 47, 48]), - ], - [ - new Float32Array([49, 50, 51, 52]), - new Float32Array([53, 54, 56, 57]), - new Float32Array([58, 59, 60, 61]), - new Float32Array([62, 63, 64, 65]), - ] - ] + [new Float32Array([33, 34, 35, 36]), new Float32Array([37, 38, 39, 40]), new Float32Array([41, 42, 43, 44]), new Float32Array([45, 46, 47, 48])], + [new Float32Array([49, 50, 51, 52]), new Float32Array([53, 54, 56, 57]), new Float32Array([58, 59, 60, 61]), new Float32Array([62, 63, 64, 65])], + ], ]; kernel.setOutput([expected2[0][0].length, expected2[0].length, expected2.length]); assert.deepEqual(kernel(expected2), expected2); @@ -972,7 +790,8 @@ test('Single Array3D4 cpu', () => { function testUnsignedPrecisionArray(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(input) { + const kernel = gpu + .createKernel(function (input) { return input[this.thread.x]; }) .setPrecision('unsigned') @@ -1016,7 +835,8 @@ test('unsigned precision Array cpu', () => { function testSinglePrecisionArray(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(input) { + const kernel = gpu + .createKernel(function (input) { return input[this.thread.x]; }) .setPrecision('single') @@ -1060,7 +880,8 @@ test('single precision Array cpu', () => { function testUnsignedPrecisionMatrix(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(input) { + const kernel = gpu + .createKernel(function (input) { return input[this.thread.y][this.thread.x]; }) .setPrecision('unsigned') @@ -1072,24 +893,33 @@ function testUnsignedPrecisionMatrix(mode) { [1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], - [13, 14, 15, 16] + [13, 14, 15, 16], ]; - assert.deepEqual(kernel(matrix), matrix.map(row => new Float32Array(row))); + assert.deepEqual( + kernel(matrix), + matrix.map(row => new Float32Array(row)) + ); kernel.setOutput([3, 3]); matrix = [ [1, 2, 3], [4, 5, 6], - [7, 8, 9] + [7, 8, 9], ]; - assert.deepEqual(kernel(matrix), matrix.map(row => new Float32Array(row))); + assert.deepEqual( + kernel(matrix), + matrix.map(row => new Float32Array(row)) + ); kernel.setOutput([2, 2]); matrix = [ [1, 2], - [3, 4] + [3, 4], ]; - assert.deepEqual(kernel(matrix), matrix.map(row => new Float32Array(row))); + assert.deepEqual( + kernel(matrix), + matrix.map(row => new Float32Array(row)) + ); gpu.destroy(); } @@ -1119,7 +949,8 @@ test('unsigned precision Matrix cpu', () => { function testSinglePrecisionMatrix(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(input) { + const kernel = gpu + .createKernel(function (input) { return input[this.thread.y][this.thread.x]; }) .setDynamicArguments(true) @@ -1130,24 +961,33 @@ function testSinglePrecisionMatrix(mode) { [1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], - [13, 14, 15, 16] + [13, 14, 15, 16], ]; - assert.deepEqual(kernel(matrix), matrix.map(row => new Float32Array(row))); + assert.deepEqual( + kernel(matrix), + matrix.map(row => new Float32Array(row)) + ); kernel.setOutput([3, 3]); matrix = [ [1, 2, 3], [4, 5, 6], - [7, 8, 9] + [7, 8, 9], ]; - assert.deepEqual(kernel(matrix), matrix.map(row => new Float32Array(row))); + assert.deepEqual( + kernel(matrix), + matrix.map(row => new Float32Array(row)) + ); kernel.setOutput([2, 2]); matrix = [ [1, 2], - [3, 4] + [3, 4], ]; - assert.deepEqual(kernel(matrix), matrix.map(row => new Float32Array(row))); + assert.deepEqual( + kernel(matrix), + matrix.map(row => new Float32Array(row)) + ); gpu.destroy(); } @@ -1177,7 +1017,8 @@ test('single precision Matrix cpu', () => { function testUnsignedPrecisionInputMatrix(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(input) { + const kernel = gpu + .createKernel(function (input) { return input[this.thread.y][this.thread.x]; }) .setPrecision('unsigned') @@ -1185,40 +1026,16 @@ function testUnsignedPrecisionInputMatrix(mode) { .setDynamicOutput(true) .setOutput([4, 4]); - let matrix = input([ - 1, 2, 3, 4, - 5, 6, 7, 8, - 9, 10, 11, 12, - 13, 14, 15, 16 - ], [4, 4]); - assert.deepEqual(kernel(matrix), [ - new Float32Array([1, 2, 3, 4]), - new Float32Array([5, 6, 7, 8]), - new Float32Array([9, 10, 11, 12]), - new Float32Array([13, 14, 15, 16]), - ]); + let matrix = input([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], [4, 4]); + assert.deepEqual(kernel(matrix), [new Float32Array([1, 2, 3, 4]), new Float32Array([5, 6, 7, 8]), new Float32Array([9, 10, 11, 12]), new Float32Array([13, 14, 15, 16])]); kernel.setOutput([3, 3]); - matrix = input([ - 1, 2, 3, - 4, 5, 6, - 7, 8, 9 - ], [3, 3]); - assert.deepEqual(kernel(matrix), [ - new Float32Array([1, 2, 3]), - new Float32Array([4, 5, 6]), - new Float32Array([7, 8, 9]) - ]); + matrix = input([1, 2, 3, 4, 5, 6, 7, 8, 9], [3, 3]); + assert.deepEqual(kernel(matrix), [new Float32Array([1, 2, 3]), new Float32Array([4, 5, 6]), new Float32Array([7, 8, 9])]); kernel.setOutput([2, 2]); - matrix = input([ - 1, 2, - 3, 4 - ], [2, 2]); - assert.deepEqual(kernel(matrix), [ - new Float32Array([1, 2]), - new Float32Array([3, 4]) - ]); + matrix = input([1, 2, 3, 4], [2, 2]); + assert.deepEqual(kernel(matrix), [new Float32Array([1, 2]), new Float32Array([3, 4])]); gpu.destroy(); } @@ -1248,47 +1065,24 @@ test('unsigned precision Input Matrix cpu', () => { function testSinglePrecisionInputMatrix(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(input) { + const kernel = gpu + .createKernel(function (input) { return input[this.thread.y][this.thread.x]; }) .setDynamicArguments(true) .setDynamicOutput(true) .setOutput([4, 4]); - let matrix = input([ - 1, 2, 3, 4, - 5, 6, 7, 8, - 9, 10, 11, 12, - 13, 14, 15, 16 - ], [4, 4]); - assert.deepEqual(kernel(matrix), [ - new Float32Array([1, 2, 3, 4]), - new Float32Array([5, 6, 7, 8]), - new Float32Array([9, 10, 11, 12]), - new Float32Array([13, 14, 15, 16]) - ]); + let matrix = input([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], [4, 4]); + assert.deepEqual(kernel(matrix), [new Float32Array([1, 2, 3, 4]), new Float32Array([5, 6, 7, 8]), new Float32Array([9, 10, 11, 12]), new Float32Array([13, 14, 15, 16])]); kernel.setOutput([3, 3]); - matrix = input([ - 1, 2, 3, - 4, 5, 6, - 7, 8, 9 - ], [3, 3]); - assert.deepEqual(kernel(matrix), [ - new Float32Array([1, 2, 3]), - new Float32Array([4, 5, 6]), - new Float32Array([7, 8, 9]) - ]); + matrix = input([1, 2, 3, 4, 5, 6, 7, 8, 9], [3, 3]); + assert.deepEqual(kernel(matrix), [new Float32Array([1, 2, 3]), new Float32Array([4, 5, 6]), new Float32Array([7, 8, 9])]); kernel.setOutput([2, 2]); - matrix = input([ - 1, 2, - 3, 4 - ], [2, 2]); - assert.deepEqual(kernel(matrix), [ - new Float32Array([1, 2]), - new Float32Array([3, 4]) - ]); + matrix = input([1, 2, 3, 4], [2, 2]); + assert.deepEqual(kernel(matrix), [new Float32Array([1, 2]), new Float32Array([3, 4])]); gpu.destroy(); } @@ -1314,4 +1108,4 @@ function testSinglePrecisionInputMatrix(mode) { test('single precision Input Matrix cpu', () => { testSinglePrecisionInputMatrix('cpu'); -}); \ No newline at end of file +}); diff --git a/test/features/dynamic-output.js b/test/features/dynamic-output.js index 7028b0f2..696aecc3 100644 --- a/test/features/dynamic-output.js +++ b/test/features/dynamic-output.js @@ -5,9 +5,12 @@ describe('features: dynamic output'); function dynamicOutput1DGrows(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function() { - return this.output.x + this.thread.x; - }, { dynamicOutput: true }); + const kernel = gpu.createKernel( + function () { + return this.output.x + this.thread.x; + }, + { dynamicOutput: true } + ); kernel.setOutput([5]); let result = kernel(); @@ -48,12 +51,14 @@ test('dynamic output 1d grows cpu', () => { dynamicOutput1DGrows('cpu'); }); - function dynamicOutput1DShrinks(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function() { - return this.output.x + this.thread.x; - }, { dynamicOutput: true }); + const kernel = gpu.createKernel( + function () { + return this.output.x + this.thread.x; + }, + { dynamicOutput: true } + ); kernel.setOutput([10]); let result = kernel(); @@ -96,13 +101,17 @@ test('dynamic output 1d shrinks cpu', () => { function dynamicOutput1DKernelMapGrows(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernelMap({ - result2: function map(v) { - return v; - } - }, function() { - return map(this.output.x + this.thread.x); - }, { dynamicOutput: true }); + const kernel = gpu.createKernelMap( + { + result2: function map(v) { + return v; + }, + }, + function () { + return map(this.output.x + this.thread.x); + }, + { dynamicOutput: true } + ); kernel.setOutput([5]); let result = kernel(); @@ -147,16 +156,19 @@ test('dynamic output 1d kernel map grows cpu', () => { dynamicOutput1DKernelMapGrows('cpu'); }); - function dynamicOutput1DKernelMapShrinks(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernelMap({ - result2: function map(v) { - return v; - } - }, function() { - return map(this.output.x + this.thread.x); - }, { dynamicOutput: true }); + const kernel = gpu.createKernelMap( + { + result2: function map(v) { + return v; + }, + }, + function () { + return map(this.output.x + this.thread.x); + }, + { dynamicOutput: true } + ); kernel.setOutput([10]); let result = kernel(); @@ -203,27 +215,36 @@ test('dynamic output 1d kernel map shrinks cpu', () => { function dynamicOutput2DGrows(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function() { - return this.output.x + this.output.y + this.thread.x + this.thread.y; - }, { dynamicOutput: true }); + const kernel = gpu.createKernel( + function () { + return this.output.x + this.output.y + this.thread.x + this.thread.y; + }, + { dynamicOutput: true } + ); kernel.setOutput([2, 2]); let result = kernel(); assert.equal(result.length, 2); - assert.deepEqual(result.map(row => Array.from(row)), [ - [4, 5], - [5, 6] - ]); + assert.deepEqual( + result.map(row => Array.from(row)), + [ + [4, 5], + [5, 6], + ] + ); assert.deepEqual(Array.from(kernel.output), [2, 2]); kernel.setOutput([3, 3]); result = kernel(); assert.equal(result.length, 3); - assert.deepEqual(result.map(row => Array.from(row)), [ - [6, 7, 8], - [7, 8, 9], - [8, 9, 10] - ]); + assert.deepEqual( + result.map(row => Array.from(row)), + [ + [6, 7, 8], + [7, 8, 9], + [8, 9, 10], + ] + ); assert.deepEqual(Array.from(kernel.output), [3, 3]); gpu.destroy(); @@ -253,30 +274,38 @@ test('dynamic output 2d grows cpu', () => { dynamicOutput2DGrows('cpu'); }); - function dynamicOutput2DShrinks(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function() { - return this.output.x + this.output.y + this.thread.x + this.thread.y; - }, { dynamicOutput: true }); + const kernel = gpu.createKernel( + function () { + return this.output.x + this.output.y + this.thread.x + this.thread.y; + }, + { dynamicOutput: true } + ); kernel.setOutput([3, 3]); let result = kernel(); assert.equal(result.length, 3); - assert.deepEqual(result.map(row => Array.from(row)), [ - [6, 7, 8], - [7, 8, 9], - [8, 9, 10] - ]); + assert.deepEqual( + result.map(row => Array.from(row)), + [ + [6, 7, 8], + [7, 8, 9], + [8, 9, 10], + ] + ); assert.deepEqual(Array.from(kernel.output), [3, 3]); kernel.setOutput([2, 2]); result = kernel(); assert.equal(result.length, 2); - assert.deepEqual(result.map(row => Array.from(row)), [ - [4, 5], - [5, 6] - ]); + assert.deepEqual( + result.map(row => Array.from(row)), + [ + [4, 5], + [5, 6], + ] + ); assert.deepEqual(Array.from(kernel.output), [2, 2]); gpu.destroy(); @@ -308,42 +337,58 @@ test('dynamic output 2d shrinks cpu', () => { function dynamicOutput2DKernelMapGrows(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernelMap({ - result1: function map(v) { - return v; - } - }, function() { - return map(this.output.x + this.output.y + this.thread.x + this.thread.y); - }, { dynamicOutput: true }); + const kernel = gpu.createKernelMap( + { + result1: function map(v) { + return v; + }, + }, + function () { + return map(this.output.x + this.output.y + this.thread.x + this.thread.y); + }, + { dynamicOutput: true } + ); kernel.setOutput([2, 2]); let result = kernel(); assert.equal(result.result.length, 2); assert.equal(result.result1.length, 2); - assert.deepEqual(result.result.map(row => Array.from(row)), [ - [4, 5], - [5, 6] - ]); - assert.deepEqual(result.result1.map(row => Array.from(row)), [ - [4, 5], - [5, 6] - ]); + assert.deepEqual( + result.result.map(row => Array.from(row)), + [ + [4, 5], + [5, 6], + ] + ); + assert.deepEqual( + result.result1.map(row => Array.from(row)), + [ + [4, 5], + [5, 6], + ] + ); assert.deepEqual(Array.from(kernel.output), [2, 2]); kernel.setOutput([3, 3]); result = kernel(); assert.equal(result.result.length, 3); assert.equal(result.result1.length, 3); - assert.deepEqual(result.result.map(row => Array.from(row)), [ - [6, 7, 8], - [7, 8, 9], - [8, 9, 10] - ]); - assert.deepEqual(result.result1.map(row => Array.from(row)), [ - [6, 7, 8], - [7, 8, 9], - [8, 9, 10] - ]); + assert.deepEqual( + result.result.map(row => Array.from(row)), + [ + [6, 7, 8], + [7, 8, 9], + [8, 9, 10], + ] + ); + assert.deepEqual( + result.result1.map(row => Array.from(row)), + [ + [6, 7, 8], + [7, 8, 9], + [8, 9, 10], + ] + ); assert.deepEqual(Array.from(kernel.output), [3, 3]); gpu.destroy(); @@ -373,45 +418,60 @@ test('dynamic output 2d kernel map grows cpu', () => { dynamicOutput2DKernelMapGrows('cpu'); }); - function dynamicOutput2DKernelMapShrinks(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernelMap({ - result1: function map(v) { - return v; - } - }, function() { - return map(this.output.x + this.output.y + this.thread.x + this.thread.y); - }, { dynamicOutput: true }); + const kernel = gpu.createKernelMap( + { + result1: function map(v) { + return v; + }, + }, + function () { + return map(this.output.x + this.output.y + this.thread.x + this.thread.y); + }, + { dynamicOutput: true } + ); kernel.setOutput([3, 3]); let result = kernel(); assert.equal(result.result.length, 3); assert.equal(result.result1.length, 3); - assert.deepEqual(result.result.map(row => Array.from(row)), [ - [6, 7, 8], - [7, 8, 9], - [8, 9, 10] - ]); - assert.deepEqual(result.result1.map(row => Array.from(row)), [ - [6, 7, 8], - [7, 8, 9], - [8, 9, 10] - ]); + assert.deepEqual( + result.result.map(row => Array.from(row)), + [ + [6, 7, 8], + [7, 8, 9], + [8, 9, 10], + ] + ); + assert.deepEqual( + result.result1.map(row => Array.from(row)), + [ + [6, 7, 8], + [7, 8, 9], + [8, 9, 10], + ] + ); assert.deepEqual(Array.from(kernel.output), [3, 3]); kernel.setOutput([2, 2]); result = kernel(); assert.equal(result.result.length, 2); assert.equal(result.result1.length, 2); - assert.deepEqual(result.result.map(row => Array.from(row)), [ - [4, 5], - [5, 6] - ]); - assert.deepEqual(result.result1.map(row => Array.from(row)), [ - [4, 5], - [5, 6] - ]); + assert.deepEqual( + result.result.map(row => Array.from(row)), + [ + [4, 5], + [5, 6], + ] + ); + assert.deepEqual( + result.result1.map(row => Array.from(row)), + [ + [4, 5], + [5, 6], + ] + ); assert.deepEqual(Array.from(kernel.output), [2, 2]); gpu.destroy(); @@ -444,37 +504,25 @@ test('dynamic output 2d shrinks cpu', () => { function dynamicOutput2DGraphicalGrows(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function() { - this.color(1, 1, 1, 1); - }, { graphical: true, dynamicOutput: true }); + const kernel = gpu.createKernel( + function () { + this.color(1, 1, 1, 1); + }, + { graphical: true, dynamicOutput: true } + ); kernel.setOutput([2, 2]); kernel(); let result = kernel.getPixels(); assert.equal(result.length, 2 * 2 * 4); - assert.deepEqual(Array.from(result), [ - 255, 255, 255, 255, - 255, 255, 255, 255, - 255, 255, 255, 255, - 255, 255, 255, 255 - ]); + assert.deepEqual(Array.from(result), [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]); assert.deepEqual(Array.from(kernel.output), [2, 2]); kernel.setOutput([3, 3]); kernel(); result = kernel.getPixels(); assert.equal(result.length, 3 * 3 * 4); - assert.deepEqual(Array.from(result), [ - 255, 255, 255, 255, - 255, 255, 255, 255, - 255, 255, 255, 255, - 255, 255, 255, 255, - 255, 255, 255, 255, - 255, 255, 255, 255, - 255, 255, 255, 255, - 255, 255, 255, 255, - 255, 255, 255, 255, - ]); + assert.deepEqual(Array.from(result), [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]); assert.deepEqual(Array.from(kernel.output), [3, 3]); gpu.destroy(); @@ -504,40 +552,27 @@ test('dynamic output 2d graphical grows gpu', () => { dynamicOutput2DGraphicalGrows('cpu'); }); - function dynamicOutput2DGraphicalShrinks(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function() { - this.color(1, 1, 1, 1); - }, { graphical: true, dynamicOutput: true }); + const kernel = gpu.createKernel( + function () { + this.color(1, 1, 1, 1); + }, + { graphical: true, dynamicOutput: true } + ); kernel.setOutput([3, 3]); kernel(); let result = kernel.getPixels(); assert.equal(result.length, 3 * 3 * 4); - assert.deepEqual(Array.from(result), [ - 255, 255, 255, 255, - 255, 255, 255, 255, - 255, 255, 255, 255, - 255, 255, 255, 255, - 255, 255, 255, 255, - 255, 255, 255, 255, - 255, 255, 255, 255, - 255, 255, 255, 255, - 255, 255, 255, 255, - ]); + assert.deepEqual(Array.from(result), [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]); assert.deepEqual(Array.from(kernel.output), [3, 3]); kernel.setOutput([2, 2]); kernel(); result = kernel.getPixels(); assert.equal(result.length, 2 * 2 * 4); - assert.deepEqual(Array.from(result), [ - 255, 255, 255, 255, - 255, 255, 255, 255, - 255, 255, 255, 255, - 255, 255, 255, 255 - ]); + assert.deepEqual(Array.from(result), [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]); assert.deepEqual(Array.from(kernel.output), [2, 2]); gpu.destroy(); @@ -569,45 +604,54 @@ test('dynamic output 2d graphical shrinks gpu', () => { function dynamicOutput3DGrows(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function() { - return this.output.x + this.output.y + this.thread.z + this.thread.x + this.thread.y + this.thread.z; - }, { dynamicOutput: true }); + const kernel = gpu.createKernel( + function () { + return this.output.x + this.output.y + this.thread.z + this.thread.x + this.thread.y + this.thread.z; + }, + { dynamicOutput: true } + ); kernel.setOutput([2, 2, 2]); let result = kernel(); assert.equal(result.length, 2); - assert.deepEqual(result.map(matrix => matrix.map(row => Array.from(row))), [ + assert.deepEqual( + result.map(matrix => matrix.map(row => Array.from(row))), [ - [4, 5], - [5, 6] - ], - [ - [6, 7], - [7, 8] + [ + [4, 5], + [5, 6], + ], + [ + [6, 7], + [7, 8], + ], ] - ]); + ); assert.deepEqual(Array.from(kernel.output), [2, 2, 2]); kernel.setOutput([3, 3, 3]); result = kernel(); assert.equal(result.length, 3); - assert.deepEqual(result.map(matrix => matrix.map(row => Array.from(row))), [ + assert.deepEqual( + result.map(matrix => matrix.map(row => Array.from(row))), [ - [6, 7, 8], - [7, 8, 9], - [8, 9, 10] - ], - [ - [8, 9, 10], - [9, 10, 11], - [10, 11, 12] - ], - [ - [10, 11, 12], - [11, 12, 13], - [12, 13, 14] + [ + [6, 7, 8], + [7, 8, 9], + [8, 9, 10], + ], + [ + [8, 9, 10], + [9, 10, 11], + [10, 11, 12], + ], + [ + [10, 11, 12], + [11, 12, 13], + [12, 13, 14], + ], ] - ]); + ); assert.deepEqual(Array.from(kernel.output), [3, 3, 3]); gpu.destroy(); @@ -637,48 +681,56 @@ test('dynamic output 3d grows cpu', () => { dynamicOutput3DGrows('cpu'); }); - function dynamicOutput3DShrinks(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function() { - return this.output.x + this.output.y + this.thread.z + this.thread.x + this.thread.y + this.thread.z; - }, { dynamicOutput: true }); + const kernel = gpu.createKernel( + function () { + return this.output.x + this.output.y + this.thread.z + this.thread.x + this.thread.y + this.thread.z; + }, + { dynamicOutput: true } + ); kernel.setOutput([3, 3, 3]); let result = kernel(); assert.equal(result.length, 3); - assert.deepEqual(result.map(matrix => matrix.map(row => Array.from(row))), [ + assert.deepEqual( + result.map(matrix => matrix.map(row => Array.from(row))), [ - [6, 7, 8], - [7, 8, 9], - [8, 9, 10] - ], - [ - [8, 9, 10], - [9, 10, 11], - [10, 11, 12] - ], - [ - [10, 11, 12], - [11, 12, 13], - [12, 13, 14] + [ + [6, 7, 8], + [7, 8, 9], + [8, 9, 10], + ], + [ + [8, 9, 10], + [9, 10, 11], + [10, 11, 12], + ], + [ + [10, 11, 12], + [11, 12, 13], + [12, 13, 14], + ], ] - ]); + ); assert.deepEqual(Array.from(kernel.output), [3, 3, 3]); kernel.setOutput([2, 2, 2]); result = kernel(); assert.equal(result.length, 2); - assert.deepEqual(result.map(matrix => matrix.map(row => Array.from(row))), [ - [ - [4, 5], - [5, 6] - ], + assert.deepEqual( + result.map(matrix => matrix.map(row => Array.from(row))), [ - [6, 7], - [7, 8] + [ + [4, 5], + [5, 6], + ], + [ + [6, 7], + [7, 8], + ], ] - ]); + ); assert.deepEqual(Array.from(kernel.output), [2, 2, 2]); gpu.destroy(); @@ -710,78 +762,94 @@ test('dynamic output 3d shrinks cpu', () => { function dynamicOutput3DKernelMapGrows(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernelMap({ - result1: function map(v) { - return v; - } - }, function() { - return map(this.output.x + this.output.y + this.thread.z + this.thread.x + this.thread.y + this.thread.z); - }, { dynamicOutput: true }); + const kernel = gpu.createKernelMap( + { + result1: function map(v) { + return v; + }, + }, + function () { + return map(this.output.x + this.output.y + this.thread.z + this.thread.x + this.thread.y + this.thread.z); + }, + { dynamicOutput: true } + ); kernel.setOutput([2, 2, 2]); let result = kernel(); assert.equal(result.result.length, 2); assert.equal(result.result1.length, 2); - assert.deepEqual(result.result.map(matrix => matrix.map(row => Array.from(row))), [ + assert.deepEqual( + result.result.map(matrix => matrix.map(row => Array.from(row))), [ - [4, 5], - [5, 6] - ], - [ - [6, 7], - [7, 8] + [ + [4, 5], + [5, 6], + ], + [ + [6, 7], + [7, 8], + ], ] - ]); - assert.deepEqual(result.result1.map(matrix => matrix.map(row => Array.from(row))), [ - [ - [4, 5], - [5, 6] - ], + ); + assert.deepEqual( + result.result1.map(matrix => matrix.map(row => Array.from(row))), [ - [6, 7], - [7, 8] + [ + [4, 5], + [5, 6], + ], + [ + [6, 7], + [7, 8], + ], ] - ]); + ); assert.deepEqual(Array.from(kernel.output), [2, 2, 2]); kernel.setOutput([3, 3, 3]); result = kernel(); assert.equal(result.result.length, 3); assert.equal(result.result1.length, 3); - assert.deepEqual(result.result.map(matrix => matrix.map(row => Array.from(row))), [ + assert.deepEqual( + result.result.map(matrix => matrix.map(row => Array.from(row))), [ - [6, 7, 8], - [7, 8, 9], - [8, 9, 10] - ], - [ - [8, 9, 10], - [9, 10, 11], - [10, 11, 12] - ], - [ - [10, 11, 12], - [11, 12, 13], - [12, 13, 14] + [ + [6, 7, 8], + [7, 8, 9], + [8, 9, 10], + ], + [ + [8, 9, 10], + [9, 10, 11], + [10, 11, 12], + ], + [ + [10, 11, 12], + [11, 12, 13], + [12, 13, 14], + ], ] - ]); - assert.deepEqual(result.result1.map(matrix => matrix.map(row => Array.from(row))), [ - [ - [6, 7, 8], - [7, 8, 9], - [8, 9, 10] - ], + ); + assert.deepEqual( + result.result1.map(matrix => matrix.map(row => Array.from(row))), [ - [8, 9, 10], - [9, 10, 11], - [10, 11, 12] - ], - [ - [10, 11, 12], - [11, 12, 13], - [12, 13, 14] + [ + [6, 7, 8], + [7, 8, 9], + [8, 9, 10], + ], + [ + [8, 9, 10], + [9, 10, 11], + [10, 11, 12], + ], + [ + [10, 11, 12], + [11, 12, 13], + [12, 13, 14], + ], ] - ]); + ); assert.deepEqual(Array.from(kernel.output), [3, 3, 3]); gpu.destroy(); @@ -811,81 +879,96 @@ test('dynamic output 3d kernel map grows cpu', () => { dynamicOutput3DKernelMapGrows('cpu'); }); - function dynamicOutput3DKernelMapShrinks(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernelMap({ - result1: function map(v) { - return v; - } - }, function() { - return map(this.output.x + this.output.y + this.thread.z + this.thread.x + this.thread.y + this.thread.z); - }, { dynamicOutput: true }); + const kernel = gpu.createKernelMap( + { + result1: function map(v) { + return v; + }, + }, + function () { + return map(this.output.x + this.output.y + this.thread.z + this.thread.x + this.thread.y + this.thread.z); + }, + { dynamicOutput: true } + ); kernel.setOutput([3, 3, 3]); let result = kernel(); assert.equal(result.result.length, 3); assert.equal(result.result1.length, 3); - assert.deepEqual(result.result.map(matrix => matrix.map(row => Array.from(row))), [ - [ - [6, 7, 8], - [7, 8, 9], - [8, 9, 10] - ], + assert.deepEqual( + result.result.map(matrix => matrix.map(row => Array.from(row))), [ - [8, 9, 10], - [9, 10, 11], - [10, 11, 12] - ], - [ - [10, 11, 12], - [11, 12, 13], - [12, 13, 14] + [ + [6, 7, 8], + [7, 8, 9], + [8, 9, 10], + ], + [ + [8, 9, 10], + [9, 10, 11], + [10, 11, 12], + ], + [ + [10, 11, 12], + [11, 12, 13], + [12, 13, 14], + ], ] - ]); - assert.deepEqual(result.result1.map(matrix => matrix.map(row => Array.from(row))), [ - [ - [6, 7, 8], - [7, 8, 9], - [8, 9, 10] - ], - [ - [8, 9, 10], - [9, 10, 11], - [10, 11, 12] - ], + ); + assert.deepEqual( + result.result1.map(matrix => matrix.map(row => Array.from(row))), [ - [10, 11, 12], - [11, 12, 13], - [12, 13, 14] + [ + [6, 7, 8], + [7, 8, 9], + [8, 9, 10], + ], + [ + [8, 9, 10], + [9, 10, 11], + [10, 11, 12], + ], + [ + [10, 11, 12], + [11, 12, 13], + [12, 13, 14], + ], ] - ]); + ); assert.deepEqual(Array.from(kernel.output), [3, 3, 3]); kernel.setOutput([2, 2, 2]); result = kernel(); assert.equal(result.result.length, 2); assert.equal(result.result1.length, 2); - assert.deepEqual(result.result.map(matrix => matrix.map(row => Array.from(row))), [ - [ - [4, 5], - [5, 6] - ], + assert.deepEqual( + result.result.map(matrix => matrix.map(row => Array.from(row))), [ - [6, 7], - [7, 8] + [ + [4, 5], + [5, 6], + ], + [ + [6, 7], + [7, 8], + ], ] - ]); - assert.deepEqual(result.result1.map(matrix => matrix.map(row => Array.from(row))), [ + ); + assert.deepEqual( + result.result1.map(matrix => matrix.map(row => Array.from(row))), [ - [4, 5], - [5, 6] - ], - [ - [6, 7], - [7, 8] + [ + [4, 5], + [5, 6], + ], + [ + [6, 7], + [7, 8], + ], ] - ]); + ); assert.deepEqual(Array.from(kernel.output), [2, 2, 2]); gpu.destroy(); @@ -913,4 +996,4 @@ test('dynamic output 3d kernel map shrinks gpu', () => { test('dynamic output 3d kernel map shrinks cpu', () => { dynamicOutput3DKernelMapShrinks('cpu'); -}); \ No newline at end of file +}); diff --git a/test/features/function-return.js b/test/features/function-return.js index 008b4eea..6a919a9b 100644 --- a/test/features/function-return.js +++ b/test/features/function-return.js @@ -5,11 +5,14 @@ describe('features: function return'); function functionReturnFloat(mode) { const gpu = new GPU({ mode }); - const f = gpu.createKernel(function() { - return 42; - }, { - output: [1] - }); + const f = gpu.createKernel( + function () { + return 42; + }, + { + output: [1], + } + ); assert.equal(f()[0], 42); gpu.destroy(); } @@ -38,14 +41,16 @@ test('float cpu', () => { functionReturnFloat('cpu'); }); - function functionReturnArray2(mode) { const gpu = new GPU({ mode }); - const f = gpu.createKernel(function() { - return [42, 43]; - }, { - output: [1] - }); + const f = gpu.createKernel( + function () { + return [42, 43]; + }, + { + output: [1], + } + ); const result = f(); assert.equal(result[0].constructor, Float32Array); assert.equal(result[0][0], 42); @@ -79,11 +84,14 @@ test('Array(2) cpu', () => { function functionReturnArray3(mode) { const gpu = new GPU({ mode }); - const f = gpu.createKernel(function() { - return [42, 43, 44]; - }, { - output: [1] - }); + const f = gpu.createKernel( + function () { + return [42, 43, 44]; + }, + { + output: [1], + } + ); const result = f(); assert.equal(result[0].constructor, Float32Array); assert.equal(result[0][0], 42); @@ -116,14 +124,16 @@ test('Array(3) cpu', () => { functionReturnArray3('cpu'); }); - function functionReturnArray4(mode) { const gpu = new GPU({ mode }); - const f = gpu.createKernel(function() { - return [42, 43, 44, 45]; - }, { - output: [1] - }); + const f = gpu.createKernel( + function () { + return [42, 43, 44, 45]; + }, + { + output: [1], + } + ); const result = f(); assert.equal(result[0].constructor, Float32Array); @@ -160,22 +170,21 @@ test('Array(4) cpu', () => { function functionReturnArray4MemberExpression(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(value) { - let pixel = toIntArray4(value[this.thread.y][this.thread.x]); - return pixel; - - function toIntArray4(pixel) { - return [pixel[0] * 255, pixel[1] * 255, pixel[2] * 255, pixel[3] * 255]; + const kernel = gpu.createKernel( + function (value) { + let pixel = toIntArray4(value[this.thread.y][this.thread.x]); + return pixel; + + function toIntArray4(pixel) { + return [pixel[0] * 255, pixel[1] * 255, pixel[2] * 255, pixel[3] * 255]; + } + }, + { + output: [1, 1], + argumentTypes: { value: 'Array2D(4)' }, } - }, { - output: [1, 1], - argumentTypes: { value: 'Array2D(4)' }, - }); - const result = kernel([ - [ - [1, 1, 1, 1] - ] - ]); + ); + const result = kernel([[[1, 1, 1, 1]]]); assert.deepEqual(Array.from(result[0][0]), [255, 255, 255, 255]); gpu.destroy(); } @@ -202,4 +211,4 @@ test('gpu', () => { test('cpu', () => { functionReturnArray4MemberExpression('cpu'); -}); \ No newline at end of file +}); diff --git a/test/features/get-canvas.js b/test/features/get-canvas.js index 1755facb..6191d382 100644 --- a/test/features/get-canvas.js +++ b/test/features/get-canvas.js @@ -9,12 +9,17 @@ function getCanvasTest(mode) { assert.ok(gpu.context === null, 'context is initially null'); assert.ok(gpu.canvas === null, 'canvas is initially null'); - const render = gpu.createKernel(function() { - this.color(0, 0, 0, 1); - }, { - output: [30, 30], - mode: mode - }).setGraphical(true); + const render = gpu + .createKernel( + function () { + this.color(0, 0, 0, 1); + }, + { + output: [30, 30], + mode: mode, + } + ) + .setGraphical(true); assert.ok(render !== null, 'function generated test'); assert.ok(render.canvas, 'testing for canvas after createKernel'); @@ -57,4 +62,4 @@ test('gpu', () => { test('cpu', () => { getCanvasTest('cpu'); -}); \ No newline at end of file +}); diff --git a/test/features/get-pixels.js b/test/features/get-pixels.js index 90081fcf..5f4e4624 100644 --- a/test/features/get-pixels.js +++ b/test/features/get-pixels.js @@ -5,321 +5,112 @@ describe('features: getPixels'); function getPixelsStandard(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(v) { - this.color( - v[this.thread.y][this.thread.x][0], - v[this.thread.y][this.thread.x][1], - v[this.thread.y][this.thread.x][2] - ); - }, { - output: [2, 2], - graphical: true, - }); + const kernel = gpu.createKernel( + function (v) { + this.color(v[this.thread.y][this.thread.x][0], v[this.thread.y][this.thread.x][1], v[this.thread.y][this.thread.x][2]); + }, + { + output: [2, 2], + graphical: true, + } + ); kernel([ [ - [.02, .04, .06, .08], - [.10, .12, .14, .16] + [0.02, 0.04, 0.06, 0.08], + [0.1, 0.12, 0.14, 0.16], ], [ - [.18, .20, .22, .24], - [.26, .28, .30, .32] - ] + [0.18, 0.2, 0.22, 0.24], + [0.26, 0.28, 0.3, 0.32], + ], ]); const pixels = Array.from(kernel.getPixels()); gpu.destroy(); return pixels; } - test('standard auto', () => { const pixels = getPixelsStandard(); - assert.deepEqual(pixels, [ - 46, - 51, - 56, - 255, - 66, - 71, - 76, - 255, - 5, - 10, - 15, - 255, - 25, - 31, - 36, - 255 - ]); + assert.deepEqual(pixels, [46, 51, 56, 255, 66, 71, 76, 255, 5, 10, 15, 255, 25, 31, 36, 255]); }); test('standard gpu', () => { const pixels = getPixelsStandard('gpu'); - assert.deepEqual(pixels, [ - 46, - 51, - 56, - 255, - 66, - 71, - 76, - 255, - 5, - 10, - 15, - 255, - 25, - 31, - 36, - 255 - ]); + assert.deepEqual(pixels, [46, 51, 56, 255, 66, 71, 76, 255, 5, 10, 15, 255, 25, 31, 36, 255]); }); (GPU.isWebGLSupported ? test : skip)('standard webgl', () => { const pixels = getPixelsStandard('webgl'); - assert.deepEqual(pixels, [ - 46, - 51, - 56, - 255, - 66, - 71, - 76, - 255, - 5, - 10, - 15, - 255, - 25, - 31, - 36, - 255 - ]); + assert.deepEqual(pixels, [46, 51, 56, 255, 66, 71, 76, 255, 5, 10, 15, 255, 25, 31, 36, 255]); }); (GPU.isWebGL2Supported ? test : skip)('standard webgl2', () => { const pixels = getPixelsStandard('webgl2'); - assert.deepEqual(pixels, [ - 46, - 51, - 56, - 255, - 66, - 71, - 76, - 255, - 5, - 10, - 15, - 255, - 25, - 31, - 36, - 255 - ]); + assert.deepEqual(pixels, [46, 51, 56, 255, 66, 71, 76, 255, 5, 10, 15, 255, 25, 31, 36, 255]); }); (GPU.isHeadlessGLSupported ? test : skip)('standard headlessgl', () => { const pixels = getPixelsStandard('headlessgl'); - assert.deepEqual(pixels, [ - 46, - 51, - 56, - 255, - 66, - 71, - 76, - 255, - 5, - 10, - 15, - 255, - 25, - 31, - 36, - 255 - ]); + assert.deepEqual(pixels, [46, 51, 56, 255, 66, 71, 76, 255, 5, 10, 15, 255, 25, 31, 36, 255]); }); (GPU.isCanvasSupported ? test : skip)('standard cpu', () => { const pixels = getPixelsStandard('cpu'); - assert.deepEqual(pixels, [ - 45, - 51, - 56, - 255, - 66, - 71, - 76, - 255, - 5, - 10, - 15, - 255, - 25, - 30, - 35, - 255 - ]); + assert.deepEqual(pixels, [45, 51, 56, 255, 66, 71, 76, 255, 5, 10, 15, 255, 25, 30, 35, 255]); }); - function getPixelsFlipped(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(v) { - this.color( - v[this.thread.y][this.thread.x][0], - v[this.thread.y][this.thread.x][1], - v[this.thread.y][this.thread.x][2] - ); - }, { - output: [2, 2], - graphical: true, - }); + const kernel = gpu.createKernel( + function (v) { + this.color(v[this.thread.y][this.thread.x][0], v[this.thread.y][this.thread.x][1], v[this.thread.y][this.thread.x][2]); + }, + { + output: [2, 2], + graphical: true, + } + ); kernel([ [ - [.02, .04, .06, .08], - [.10, .12, .14, .16] + [0.02, 0.04, 0.06, 0.08], + [0.1, 0.12, 0.14, 0.16], ], [ - [.18, .20, .22, .24], - [.26, .28, .30, .32] - ] + [0.18, 0.2, 0.22, 0.24], + [0.26, 0.28, 0.3, 0.32], + ], ]); const pixels = Array.from(kernel.getPixels(true)); gpu.destroy(); return pixels; } - test('flipped auto', () => { const pixels = getPixelsFlipped(); - assert.deepEqual(pixels, [ - 5, - 10, - 15, - 255, - 25, - 31, - 36, - 255, - 46, - 51, - 56, - 255, - 66, - 71, - 76, - 255 - ]); + assert.deepEqual(pixels, [5, 10, 15, 255, 25, 31, 36, 255, 46, 51, 56, 255, 66, 71, 76, 255]); }); test('flipped gpu', () => { const pixels = getPixelsFlipped('gpu'); - assert.deepEqual(pixels, [ - 5, - 10, - 15, - 255, - 25, - 31, - 36, - 255, - 46, - 51, - 56, - 255, - 66, - 71, - 76, - 255 - ]); + assert.deepEqual(pixels, [5, 10, 15, 255, 25, 31, 36, 255, 46, 51, 56, 255, 66, 71, 76, 255]); }); (GPU.isWebGLSupported ? test : skip)('flipped webgl', () => { const pixels = getPixelsFlipped('webgl'); - assert.deepEqual(pixels, [ - 5, - 10, - 15, - 255, - 25, - 31, - 36, - 255, - 46, - 51, - 56, - 255, - 66, - 71, - 76, - 255 - ]); + assert.deepEqual(pixels, [5, 10, 15, 255, 25, 31, 36, 255, 46, 51, 56, 255, 66, 71, 76, 255]); }); (GPU.isWebGL2Supported ? test : skip)('flipped webgl2', () => { const pixels = getPixelsFlipped('webgl2'); - assert.deepEqual(pixels, [ - 5, - 10, - 15, - 255, - 25, - 31, - 36, - 255, - 46, - 51, - 56, - 255, - 66, - 71, - 76, - 255 - ]); + assert.deepEqual(pixels, [5, 10, 15, 255, 25, 31, 36, 255, 46, 51, 56, 255, 66, 71, 76, 255]); }); (GPU.isHeadlessGLSupported ? test : skip)('flipped headlessgl', () => { const pixels = getPixelsFlipped('headlessgl'); - assert.deepEqual(pixels, [ - 5, - 10, - 15, - 255, - 25, - 31, - 36, - 255, - 46, - 51, - 56, - 255, - 66, - 71, - 76, - 255 - ]); + assert.deepEqual(pixels, [5, 10, 15, 255, 25, 31, 36, 255, 46, 51, 56, 255, 66, 71, 76, 255]); }); (GPU.isCanvasSupported ? test : skip)('flipped cpu', () => { const pixels = getPixelsFlipped('cpu'); - assert.deepEqual(pixels, [ - 5, - 10, - 15, - 255, - 25, - 30, - 35, - 255, - 45, - 51, - 56, - 255, - 66, - 71, - 76, - 255 - ]); -}); \ No newline at end of file + assert.deepEqual(pixels, [5, 10, 15, 255, 25, 30, 35, 255, 45, 51, 56, 255, 66, 71, 76, 255]); +}); diff --git a/test/features/if-else.js b/test/features/if-else.js index 9585a1cc..fb67e1fd 100644 --- a/test/features/if-else.js +++ b/test/features/if-else.js @@ -5,19 +5,22 @@ describe('if else boolean'); function ifElseBooleanTest(mode) { const gpu = new GPU({ - mode + mode, }); - const f = gpu.createKernel(function() { - let result = 0; - if (true) { - result = 4; - } else { - result = 2; + const f = gpu.createKernel( + function () { + let result = 0; + if (true) { + result = 4; + } else { + result = 2; + } + return result; + }, + { + output: [1], } - return result; - }, { - output: [1] - }); + ); assert.ok(f !== null, 'function generated test'); assert.equal(f()[0], 4, 'basic return function test'); @@ -48,20 +51,22 @@ test('cpu', () => { ifElseBooleanTest('cpu'); }); - describe('if else lookup'); function ifElseLookupTest(mode) { const gpu = new GPU({ mode }); - const f = gpu.createKernel(function(x) { - if (x[this.thread.x] > 0) { - return 0; - } else { - return 1; + const f = gpu.createKernel( + function (x) { + if (x[this.thread.x] > 0) { + return 0; + } else { + return 1; + } + }, + { + output: [4], } - }, { - output: [4] - }); + ); assert.ok(f !== null, 'function generated test'); assert.deepEqual(Array.from(f([1, 1, 0, 0])), [0, 0, 1, 1], 'basic return function test'); @@ -96,18 +101,21 @@ describe('if else if'); function ifElseIfTest(mode) { const gpu = new GPU({ mode }); - const f = gpu.createKernel(function(x) { - const v = x[this.thread.x]; - if (v > 0) { - return 0; - } else if (v < 1) { - return .5; + const f = gpu.createKernel( + function (x) { + const v = x[this.thread.x]; + if (v > 0) { + return 0; + } else if (v < 1) { + return 0.5; + } + return 1; + }, + { + output: [2], } - return 1; - }, { - output: [2] - }); - assert.deepEqual(Array.from(f([-1, 1])), [.5, 0], 'basic return function test'); + ); + assert.deepEqual(Array.from(f([-1, 1])), [0.5, 0], 'basic return function test'); gpu.destroy(); } @@ -133,4 +141,4 @@ test('gpu', () => { test('cpu', () => { ifElseIfTest('cpu'); -}); \ No newline at end of file +}); diff --git a/test/features/image-array.js b/test/features/image-array.js index 230661c1..c92b1de0 100644 --- a/test/features/image-array.js +++ b/test/features/image-array.js @@ -8,7 +8,7 @@ function getImages(callback) { 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCABbAIoDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwDtjB/vL/wHP8qUBk//AGv8anjEr/7L/wC1z/hUhib+Lb/wHj+dfQOfc893WjK/+8u3/a6f5/OkU7Plb7nZun4Yqx5TJ93/ANB/w4pvkb/67cH8xS5kNW6htpCtRm2b7yv9duf1BNO2/wB75f8AaXj+dO4uVdGBWkI2UpXZ/Ezf72Qf/r1KsS/eXbRzE7Fb/d3Uv/AW/n/KrOyneXRzCKqbX+X/AMd6H8quww76jMKv97/P0qxC2z5W/BvX/wCvWc5aaAONtUDxbKtvLUON9RFvqBGq1JipAlCKzPuocihM06nrFsepNiVDkgKRs4n/AINv+7x/KmeTKn/LVvbdhh/iPzq3HJ/C303difT2PtU+2jna3HzSW5n/AL9PvKrf7uRSM8T/AOsiZf8Aa6/qKumHZ/q/l/2e3/1qbtV/9l/896OdBzLsVBEr/wCrfd/P86Ywli+8m5P5/wBKtPaL97b/AOyn8xTNsqfxbv8AZk4P5iq5gKwVX+aP7v8Ad/wBpEj2fd+51G3t6jB6VK6qn96Dd9Cuf5VG4/iWXa/5girTCxIP++v93r+VPUK/3agllaL5ZEX/AHucfgR0/HFSfvfvSbV9JFbj8Tjp+GKTDke5NspfL/haoVafzPmTcvZl53epA46VaRt393/DPTI7VDdhONiHbs+99z+96fX/ABqZVqbb/eqJJET5V3MvT2B9MmpcriJVjp0UVBbZHuZ4ok/vNz/hUIv7T7v21V/4DgfqKj3nsVYsiOneXTVli8vct1Gyd23KQPyxVT+29MHB1C0z/vCpipS2RSpyeyuUfKn/AIrhW/2vN4+hAUfrSJcT277ZNzJ2aPLAe3DVvgU14ll+WRVb/eXNae27o1VZdUY6ao3/ADyZk6D5GyfXHAx3/KnNqcb/AHopFbt0q81rsj2wttX/AJ5su5fy6j8KhO6L70W3/aVuD+fT86FKD2QOVJ7Rt8yuupx/db7/AF+6w/QrUy3cD/xr/wB9L/LOaZJEv3vs7f8AfJX9QSDVbyf+mUsUq9GVcj+fT2xVpRaIcab2v+BZNxbfd81f93qPyqu/2R/vSqqdmVuP/rfhT992ke1oo2/LP5cGkjWN/mkRWf8A2sqB+GMU1pqCiluQW9xI++NWgliVsDc4BYeuP0/ClS4+zx7Wib5ePlbr+Jx+tPDRyu/z7Zdxxtw2AMDucY46U77b5Ue5pYv9tVz26jB/pVPXoW4puyiPivYn/dq67P7sjBSPT6j3p8vyfeZV7/T15/z+fXOn1LTZZ/IbazbciaFOPx/qKqSXdy8nl2Hn/d5ZWyOuON3GKaotvt6m0MJKT2t67fedLDJE3zM3zc/MzZzjuO1NnuILe3/eN8zNkKq5ZmJyAB3Oa5wJ4it/lWJvK7fKGwPfr/Wov7H1O7f7RLcbZW6qzFcD0yP8MUfV4p+9JWN44CnH3qtVW8tWyxqOptLOvmI3m9Et1+bae+e2ahSy1K4/1zrAjdFVQT/WtLSxY6Z/q5W+0N/E0YbJ7gEdunetq2n1C4j+7Ay/7WVP5ZNVKt7NWgtPMU50qWlKK9WvyT0XzuctZ6TbS3yW0zK0rZKSN82SOcY7cZP4Vq/8I1EON1vx/sf/AF6uXtg1xG3k/u72P50WT2PUH/PXnFU18QQKoEthfrIBhgucA98VDr1Z6wZzTq1amrkzeFLSZozXCcgU1qUmmk1SEQtAv/LNmj/3en5VBI86fet/N/2o8fqDVyirT7jUrbq5nm+g8v8AiXsVkXp6+1RM8cv+p2+zbsEfQdPxP5GrV3brcSRfdV1yQ20Hkdv1P5Uxo28zbG8ay/7K8D684P061onG2hsvZ2utyv5WyPy47hW7/vMce+fWiJInkaHarfxbmYnr1AHIJzzn3qd1kf8Ac/uvvAlmXIb/AOv7fSnppkH3m+ZmxnaoUce3+etHOurHzJLViT2FpcQeXPZfJ1+7nB+oOazDoMtvJ5lle/PtIEMnAxnIHP5fia1xYKnzR7v93eRT/Lb7q3Esbf3ZMOp/E/40o1ZR0i9P69S6eInBcqlp2ev+ZXtNQlidYbuLypePl3AZPsc/596qXl0t7fPpUCSLt5uWXB2L1wMHnPcf1q9cRK8Hk3turRd/Qe4J+6fyrGutMl0+f7bDcSz2rYjkXzCrBeylhzjOBVU1Byvs+na5rh40nJuTs7adrmgkuiW/7mPy1+bDxqpYkHvjB74psWtLFO26KSW328MyZdPw5LD9frVhYrN7RGWw2pt3Iy4baRzkHr9akNnBLI+37/de49x6/wA/rUc0Nea7MZNdE/mWSIru0intLhZEZhsZW3D069vQj3NaCSRuit5mMgHBcAj8O1chPb32j3bzWn325kj/AIJhjrjs3vV3+3NGk+eS3cSNyw9+9TPDSaThqvIajfWJqbqN1V91Lupcpxk2+mFqZmkJppAPzS7qizRmnYRIdr/K1AC+XtX5VqPNKDRYdxQv7xFX+4fvc9SP8DTsyp/DuT9R9PWmj/WbvoPyz/jUgNJjuPR9/wAy0/G/71Q7f4l+V/5/WpFl/hb5W/Q/Q1D8hj1h2f6v/vlun/1qrta7N7W/7p2Uh7duEf6H+E+4/EVcBp/3/lao5mjSLsc9pVxPdR3vk/K0bMGsmwAO3GehOCeuOfrWnDLFcbJFVliZTjdwUx1Xg5GPQ+/pWbqGns2oytC7xy7VeOTqVIHIyTypGePUdQcUmm3Uj3UsckTLKu57iPkkdBuHqcncD1IK9xW00pJzidkoKcXKHT8P815/f3NO5gk8t9v71dvCt1UnsD3z1H/165d7iNXZcKMHGGBz+NdbA2/zVb+HCv8ATkg/1+lYE5fz5N1pEzbjklevNVh52umRSV2y+Gpd1QrThWnKeeS5pM0ykNTYCTdSbqjpafKBJmlBqOlFKwEwNOBqEVIKmwEympAN/wArVCtSCs2UhwLRf7UX5lf8RVlTUK0ltwJVHRTwPTgGoaNER3yr5luzfKrN5b+2eVP/AH0B+dZ0nlJrtr527zZEeEMvthlP5bgfcVpX6hrJlIyPMTj/AIEKxNTZm1OzBJI+XjPq65rSlHm09TqoPX1Vvv2/EtCT+ytZSOT5re4XyQ3XZjkZz2+bH+cVbksJGldlkwCxIFV9SUSW8e4Z4iP6mr8Mj+TH87fdHf2pSm4pS6m0G9Gt+p//2Q==', 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCABbAIoDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD1ZOlIwpwjKH5ehprSgHB69MelepfsecRkUgXmrBTofWkK01ICAimkVOVppFNSArkUhFSsvNMK1aYEZ60lPxzSEVQCdKM80YpD0pgLmlzTMU4daQEq9aD1pueKXPFSJjWptONNqkI1XYopwM+1ZbTrPqMUKnKqGdztI6cY/WobvxRpaSDM6SqOixHdmp9ClS8lkuVBHyBcHHBJye/T/AVmqcqcXOSOj2copuSNIAMBjtQV4qQL+8agisLmViAik21MVppWqTEV2WmMOKsEVGRzVJiK5FNIqZhzSYrRMCEikxUpWm7aaYEeKMYp+KQincBmeaN1KRSYqgGlqN1JRTsIqXfhsSZRYFPGd6DBH0rJhkuNPu3t5Lp7eKVhIGiG0E+/p7jpXf2kkc8qskqSxmPcsq9GzzzjjtWRrmlrdNIURfMABB9Mc5/Wpo4tuXJU2OyFSSTiyxpF+9yXguAolxuVlz849a0ytcTo98YxFJ/zwcDj+6ex/X8hXdFRj5elc+Kp+znoYNFcimkVORTCKwUiWiAioytTkc0xulaJksgIpmOamNMIq0xDCKbjmpaaasCIimkU800mqTGMIppFPJqMmqQhpFJQTTc1aAmvdNm065e901QV8zf5QOOeCQfY5P0/GtCG+gvXt7tCyjzfLcNwUJXGD75wPzq9Yyx3mno4fzA2cuv16/yrldRl/sW8unLAxylSUK91wcj8MVyQvWfJL4kd9OnKpLkS1M+ytZItSvtKRdzm4ba57KST+g5rvYohFCsakkKAuT14rlvC8iXur3d7MrfaG+58pIVTyeex6V1veqxs25qL6Wv62Lx1P2dVxe+79X28iIjmo261M1RN1rlRwsjbpUZqRqibpWqIYw0w0400mrQhKaaU00mrQDDTG609jxUZq0Ah6VGaeTTD1q0AxutMp7dKZViuW9JZoAzW2N4Yb0B4cHlWGeM9vy5FUdens7/UrON0DYfLg9kwCQfQ5Q/5xUunTJY395A2VDLuT/fX5vyP+etYWqqxuftoYbp5d7D+7jp/n2qKdK9Zy+75n0eXUU6972009Wv0Op8IKg0yVtipI0zFgO3oPpXQGuV0W7ijsoDE8aXRzvhkfb5uScEH1x+fFbC6oNxSS0nVwOV4JH4Z/kPxrjxEJSqyZw4yEpVpNLqXmqJqSK5juY1lifzEbo3+eh7Y60jNWSTOCWmjI2qJjzTnaoWat4ozYrHimE8UwtzTS9aJCHE03PNNL00tVJAOJphNGaQmrSEIaYad3ppqgGt0plONNqhMj0KJtRivL6fDPHCYVPYNjn/PvVLWopI9Qa3ZT5Yyyt65A/rmtLwwxWDVQMAC6bAA6dR/ICqeruxuYWJyTbqD+lSpNVpW2t+iPrcNFxxcoLZbeXYuaalo2jW0N1DFLIqsoS4j4kwx6Ng/5B/HHv7/AM27SztbYxIxWMIH6OxAHI6rzn/gNWoWIvIwDgc8dv4/8BWAzM9/ZsScmRiefdv8BV0IKTbl1uzVYVqdSpe6ScrPbq9vkek2dt9ktI4twcgEs+MbmJyT9Sc5pzmnn7oqN+lecrt3Z8nOTk231IHNQualeq79a3ijMaTUZahqjNapCuPzSZplFVYB+aM0ylHWiwD6aaKQ9KAGmm0402qEz//Z', 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCABbAIoDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD0hXp4eqSyVIJK91wPKuWt1IXqDfSF/ep5QuT76duqtupd9HKFyxvpQ9Vw9OD0uUZZDVKGqoHqRXqHEC2pqQGqqvUivWUojLamkY+XIJR904V/p61ErVJkFdp+6QQfes2jRMW+kEVo7tx04988VhyLHcC4mkYpA5MSuW6Lv4bPb7zc/wC7VLV9YeRjp8SgiEMZ2J+8AOAD2B459xUU93A0VuTM08QBLRxJsRD0wB/U8/06KdKUUu7PYw+BlyRk9L6/Lf8AHpc0xembS4ZJZf3shViUH3QoLYPpzkYpiapqGxfLmjEePlB647VTd2usxoX2KqbS5yAB6Z6dKP7JRvmJ5PJwTT5Yx+I744OnbXS/lciWWpFkx3rPElPEpr0XTPkLl/zaPNqj5h9ad5lT7MLl7zKXfVIS04Se9LkC5cD04PVMS04SVLgO5dD1Kr+9UBJUokqHAdy8slSq9UFkqRZKylAo0FkqUPWeslTLJWUoDTKusaJaalHK4UR3TKQJk4J4wN394fWuVsgyyLbTR+XMp2lC2fMXoefX+tdur4rK1vQ7fWIw2fKuUHyTL1z7j/J461pTqSUeRu1+vb/gHtZbmfsX7OtrD77enl5EdjLDkW0kmzJxBN0Vz2GTwGH93vj3qx/ZMg/vD2S9mRfwUAgD2HArkptB8SQhlWWO4U8ZD4L+mc4Bx75PvVddL1xVAGnSAAYAEygCuSphJyd1JM+gj9Vqe8q8V80v1RoCTNOD1TV6f5lfRuB+elrzDR5lVfMo8ylyCLokpwlqiJKd5nvR7Mdy6JPepBJ71QElSBz61DgO5fV6kElUBJTxLWbgVc0VkqRZKzllqVZazdMdzRWSpBL71nCanib3rN0x3NIS+9O833rOEvvTxL71Hsyrl7ePp+FLvH91aoed707zvep9mO5xCy0/zazxLUgkr6F0zluXPMpfNqn5lKJaXIFy6JKeHqkHp4kqeQZbElPWSqe+nK9Q4AXhJThJVMS04SVDgVcvCWnrLVASe9SCT3qHAdy+JaeJKoLJ71KJKhwGXRKfWneafWqe+jzPeo5ALnmn1pfO96oiSjzKXswuccstSCWqCye9SCSvecDkUy55lKJKqeZTg9TyFcxeWSnB6piSnCT3qHAq5c8yniSqQkp4epcCrlwPTvMqoJKXzKjkGXA59aeJPeqQk96cJKlwGXlkqUSe9UFkp4lqHAdy/wCbS+Z71S8yl8yp5BlzzKPMqp5opfMpcgHFLIakEtVQaXJr3nFHjqbRcEtOEtVATTgT61DgaKoy8JaUSe9Ugx9akyazcDRVLlwSe9PEnvVME+tPBPrU8pqplsSe9P8AMqmCfWnAn1qXEtSLYc+tOElVQT604E1HKirlsSVIJPeqgJpwJ9ankKuWhL707zaqAn1pcn1qeVDuWxJS+ZVTJ9aXJ9aXIO5//9k=', - 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCABbAIoDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwDso4Esrr7RHsZSNrxyLuBx+owO49a0I7TzTuZcBsYwenoMn3oht44pUiuD+7mbYjnsxH3T6Z7fl1xlYrgtp1vCcieK6jgmz2ZXGfzwPzrvxGLV/c37nvQi4LR3emv9dinqK2tgmnsWBAY/Me6iNyST9AaybCQ6l4isYYlVfs4Bk2jhcrl8+vBA+rVjaxrPn+XAmGREIRAfvs5zj/vnaPo9dt4T0Q6VYefOCbudfnLdVGcgfXkk+7H2rSipQp+0n8jbMZrCYV8/xSul+Ov3M6Qtkf0qJzSlqhdhWcUfFEcjVWdqfI4qu710wiSxGamFqQtTC1bJEkm6jNRbqXdTsFyTNAPNR7qN1FguTbhQTUJak30coXHlqTdUZam7qqwmySS7RLV7XV12RkYDn5WHPGcdccHcMjjnb0HLaz4m8tntICJJ5fLBeLncyMNsg92XA9iuPepLfRdeuI2gldkt3Uqy3M5kH5YOfzArc0XwtYaPL9oI+0XZBBmk6jPXA7fz968iGEad5s+5q47BYNOXMpy6JbfN9PlfoUfCfhM2hTUdTTNx96OI8hM9z7+3auy3gZ96g34Hv60xpa62nLc+UxmNq4yq6tZ6/gvJE7SVA8tRNL71A8laRpnK2Pkkquz80xpOetQu9dEYENkxems/FV95z1prSVooE3J99OD1TMlKH96fIFy5vpN9VvMo3+9HIO5OXpPMquZKb5lNQFctb6TeKreZRv8AenyBc6EyZxxjHpSGQVR873pDL71yezNLlxpKheWq5l96ieWrjTE2TtL71C0tQNLULS1tGmS2TtJUTSe9QNLURkraMCWyw0mKYZarmSmb6tQFcsmSgSVVL+9AkquQLlvzKXzKqiSl8z3pcg7lgyc0hkqsXpN9CgJss+ZR5nvVUyUnmGq5BGuZuOtJ5x9ap+ZSebWKpl3LZlPrTGl96rGT3phk96pQAnaWojJzUReomf3rRQE2TNJUZkqJpKiaStFAlk5kppfiq5kpDJV8gix5lAeq2+jzKfIBbD8UGSq3mcUnmUuQZZ8yk8yq++ml+aagBYL0nmVWaSm+YapQIuavmUhkqt5lMMtZchsWjJ70wye9VjJTTJVqAiwZPeo2k96rmSmGSqUBMnZ6jL1C0nFMMlaKBLZMXpu+oC9NL8VagS2WfMo8yqvmUoejkFct+ZRvqrvo8yjkKuWt9NL1X300yUKAXJzJTfMqu0nNM8z3q1AycjTMlNMnvVfJ9aTJ9ajlRvcn8zmkMlV8nPWkJPrT5RNkxkphlqBic9aYSfWrUCHImMlMMlQkn1qNic9atRRm5k5k96aZarkn1ppJ9atQM3ULHm0ol96pkn1pyk+tHIJVC4JPel82quTjrRk0uVFqZZMtMMtQEn1qMk+tNQIlUJ2lpnmmoCTnrTc1ooHPKo2z/9k=' + 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCABbAIoDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwDso4Esrr7RHsZSNrxyLuBx+owO49a0I7TzTuZcBsYwenoMn3oht44pUiuD+7mbYjnsxH3T6Z7fl1xlYrgtp1vCcieK6jgmz2ZXGfzwPzrvxGLV/c37nvQi4LR3emv9dinqK2tgmnsWBAY/Me6iNyST9AaybCQ6l4isYYlVfs4Bk2jhcrl8+vBA+rVjaxrPn+XAmGREIRAfvs5zj/vnaPo9dt4T0Q6VYefOCbudfnLdVGcgfXkk+7H2rSipQp+0n8jbMZrCYV8/xSul+Ov3M6Qtkf0qJzSlqhdhWcUfFEcjVWdqfI4qu710wiSxGamFqQtTC1bJEkm6jNRbqXdTsFyTNAPNR7qN1FguTbhQTUJak30coXHlqTdUZam7qqwmySS7RLV7XV12RkYDn5WHPGcdccHcMjjnb0HLaz4m8tntICJJ5fLBeLncyMNsg92XA9iuPepLfRdeuI2gldkt3Uqy3M5kH5YOfzArc0XwtYaPL9oI+0XZBBmk6jPXA7fz968iGEad5s+5q47BYNOXMpy6JbfN9PlfoUfCfhM2hTUdTTNx96OI8hM9z7+3auy3gZ96g34Hv60xpa62nLc+UxmNq4yq6tZ6/gvJE7SVA8tRNL71A8laRpnK2Pkkquz80xpOetQu9dEYENkxems/FV95z1prSVooE3J99OD1TMlKH96fIFy5vpN9VvMo3+9HIO5OXpPMquZKb5lNQFctb6TeKreZRv8AenyBc6EyZxxjHpSGQVR873pDL71yezNLlxpKheWq5l96ieWrjTE2TtL71C0tQNLULS1tGmS2TtJUTSe9QNLURkraMCWyw0mKYZarmSmb6tQFcsmSgSVVL+9AkquQLlvzKXzKqiSl8z3pcg7lgyc0hkqsXpN9CgJss+ZR5nvVUyUnmGq5BGuZuOtJ5x9ap+ZSebWKpl3LZlPrTGl96rGT3phk96pQAnaWojJzUReomf3rRQE2TNJUZkqJpKiaStFAlk5kppfiq5kpDJV8gix5lAeq2+jzKfIBbD8UGSq3mcUnmUuQZZ8yk8yq++ml+aagBYL0nmVWaSm+YapQIuavmUhkqt5lMMtZchsWjJ70wye9VjJTTJVqAiwZPeo2k96rmSmGSqUBMnZ6jL1C0nFMMlaKBLZMXpu+oC9NL8VagS2WfMo8yqvmUoejkFct+ZRvqrvo8yjkKuWt9NL1X300yUKAXJzJTfMqu0nNM8z3q1AycjTMlNMnvVfJ9aTJ9ajlRvcn8zmkMlV8nPWkJPrT5RNkxkphlqBic9aYSfWrUCHImMlMMlQkn1qNic9atRRm5k5k96aZarkn1ppJ9atQM3ULHm0ol96pkn1pyk+tHIJVC4JPel82quTjrRk0uVFqZZMtMMtQEn1qMk+tNQIlUJ2lpnmmoCTnrTc1ooHPKo2z/9k=', ]; const images = []; let finished = 0; @@ -29,16 +29,19 @@ function getImages(callback) { function imageArrayTest(mode, done) { const gpu = new GPU({ - mode + mode, }); - const imageKernel = gpu.createKernel(function(images) { - const pixel = images[this.thread.z][this.thread.y][this.thread.x]; - this.color(pixel[0], pixel[1], pixel[2], pixel[3]); - }, { - graphical: true, - output: [138, 91] - }); - getImages(function(images) { + const imageKernel = gpu.createKernel( + function (images) { + const pixel = images[this.thread.z][this.thread.y][this.thread.x]; + this.color(pixel[0], pixel[1], pixel[2], pixel[3]); + }, + { + graphical: true, + output: [138, 91], + } + ); + getImages(function (images) { imageKernel(images); const pixels = imageKernel.getPixels(); assert.equal(pixels.length, 50232); @@ -75,4 +78,4 @@ function imageArrayTest(mode, done) { (typeof Image !== 'undefined' ? test : skip)('image array cpu', t => { imageArrayTest('cpu', t.async()); -}); \ No newline at end of file +}); diff --git a/test/features/image.js b/test/features/image.js index 6f55493f..b136fad4 100644 --- a/test/features/image.js +++ b/test/features/image.js @@ -7,14 +7,17 @@ function imageArgumentTest(mode, done) { const gpu = new GPU({ mode }); const image = document.createElement('img'); image.src = 'jellyfish-1.jpeg'; - image.onload = function() { - const imageKernel = gpu.createKernel(function(image) { - const pixel = image[this.thread.y][this.thread.x]; - this.color(pixel[0], pixel[1], pixel[2], pixel[3]); - }, { - graphical: true, - output: [image.width, image.height] - }); + image.onload = function () { + const imageKernel = gpu.createKernel( + function (image) { + const pixel = image[this.thread.y][this.thread.x]; + this.color(pixel[0], pixel[1], pixel[2], pixel[3]); + }, + { + graphical: true, + output: [image.width, image.height], + } + ); imageKernel(image); assert.equal(true, true, 'does not throw'); gpu.destroy(); @@ -40,4 +43,4 @@ function imageArgumentTest(mode, done) { (typeof Image !== 'undefined' ? test : skip)('image argument cpu', t => { imageArgumentTest('cpu', t.async()); -}); \ No newline at end of file +}); diff --git a/test/features/infinity.js b/test/features/infinity.js index 1ab4087c..ae71e549 100644 --- a/test/features/infinity.js +++ b/test/features/infinity.js @@ -5,67 +5,78 @@ describe('infinity'); function inputWithoutFloat(checks, mode) { const gpu = new GPU({ mode }); - checks(gpu.createKernel(function() { - return Infinity; - }, { precision: 'unsigned' }) - .setOutput([1])()); + checks( + gpu + .createKernel( + function () { + return Infinity; + }, + { precision: 'unsigned' } + ) + .setOutput([1])() + ); gpu.destroy(); } -test("Infinity without float auto", () => { - inputWithoutFloat((v) => assert.deepEqual(v[0], NaN)); +test('Infinity without float auto', () => { + inputWithoutFloat(v => assert.deepEqual(v[0], NaN)); }); -test("Infinity without float cpu", () => { - inputWithoutFloat((v) => assert.deepEqual(v[0], Infinity), 'cpu'); +test('Infinity without float cpu', () => { + inputWithoutFloat(v => assert.deepEqual(v[0], Infinity), 'cpu'); }); -test("Infinity without float gpu", () => { - inputWithoutFloat((v) => assert.deepEqual(v[0], NaN), 'gpu'); +test('Infinity without float gpu', () => { + inputWithoutFloat(v => assert.deepEqual(v[0], NaN), 'gpu'); }); -(GPU.isWebGLSupported ? test : skip)("Infinity without float webgl", () => { - inputWithoutFloat((v) => assert.deepEqual(v[0], NaN), 'webgl'); +(GPU.isWebGLSupported ? test : skip)('Infinity without float webgl', () => { + inputWithoutFloat(v => assert.deepEqual(v[0], NaN), 'webgl'); }); -(GPU.isWebGL2Supported ? test : skip)("Infinity without float webgl2", () => { - inputWithoutFloat((v) => assert.deepEqual(v[0], NaN), 'webgl2'); +(GPU.isWebGL2Supported ? test : skip)('Infinity without float webgl2', () => { + inputWithoutFloat(v => assert.deepEqual(v[0], NaN), 'webgl2'); }); -(GPU.isHeadlessGLSupported ? test : skip)("Infinity without float headlessgl", () => { - inputWithoutFloat((v) => assert.deepEqual(v[0], NaN), 'headlessgl'); +(GPU.isHeadlessGLSupported ? test : skip)('Infinity without float headlessgl', () => { + inputWithoutFloat(v => assert.deepEqual(v[0], NaN), 'headlessgl'); }); - function inputWithFloat(checks, mode) { const gpu = new GPU({ mode }); - checks(gpu.createKernel(function() { - return Infinity; - }, { precision: 'single' }) - .setOutput([1])()); + checks( + gpu + .createKernel( + function () { + return Infinity; + }, + { precision: 'single' } + ) + .setOutput([1])() + ); gpu.destroy(); } -(GPU.isSinglePrecisionSupported ? test : skip)("Infinity with float auto", () => { - inputWithFloat((v) => assert.deepEqual(v[0], 3.4028234663852886e+38)); +(GPU.isSinglePrecisionSupported ? test : skip)('Infinity with float auto', () => { + inputWithFloat(v => assert.deepEqual(v[0], 3.4028234663852886e38)); }); -(GPU.isSinglePrecisionSupported ? test : skip)("Infinity with float cpu", () => { - inputWithFloat((v) => assert.deepEqual(v[0], Infinity), 'cpu'); +(GPU.isSinglePrecisionSupported ? test : skip)('Infinity with float cpu', () => { + inputWithFloat(v => assert.deepEqual(v[0], Infinity), 'cpu'); }); -(GPU.isSinglePrecisionSupported ? test : skip)("Infinity with float gpu", () => { - inputWithFloat((v) => assert.deepEqual(v[0], 3.4028234663852886e+38), 'gpu'); +(GPU.isSinglePrecisionSupported ? test : skip)('Infinity with float gpu', () => { + inputWithFloat(v => assert.deepEqual(v[0], 3.4028234663852886e38), 'gpu'); }); -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)("Infinity with float webgl", () => { - inputWithFloat((v) => assert.deepEqual(v[0], 3.4028234663852886e+38), 'webgl'); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('Infinity with float webgl', () => { + inputWithFloat(v => assert.deepEqual(v[0], 3.4028234663852886e38), 'webgl'); }); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)("Infinity with float webgl2", () => { - inputWithFloat((v) => assert.deepEqual(v[0], 3.4028234663852886e+38), 'webgl2'); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('Infinity with float webgl2', () => { + inputWithFloat(v => assert.deepEqual(v[0], 3.4028234663852886e38), 'webgl2'); }); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)("Infinity with float headlessgl", () => { - inputWithFloat((v) => assert.deepEqual(v[0], 3.4028234663852886e+38), 'headlessgl'); -}); \ No newline at end of file +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('Infinity with float headlessgl', () => { + inputWithFloat(v => assert.deepEqual(v[0], 3.4028234663852886e38), 'headlessgl'); +}); diff --git a/test/features/inject-native.js b/test/features/inject-native.js index bbd1f257..6be098ff 100644 --- a/test/features/inject-native.js +++ b/test/features/inject-native.js @@ -6,20 +6,28 @@ describe('features: inject native'); function gpuAddAB(mode) { const gpu = new GPU({ mode }); gpu - .injectNative(` + .injectNative( + ` int customAdder(int a, int b) { return a + b; } -`) - .addNativeFunction('customAdderLink', `int customAdderLink(int a, int b) { +` + ) + .addNativeFunction( + 'customAdderLink', + `int customAdderLink(int a, int b) { return customAdder(a, b); -}`); - const kernel = gpu.createKernel(function(a, b) { - return customAdderLink(a[this.thread.x], b[this.thread.x]); - }, { - output: [6], - returnType: 'Integer' - }); +}` + ); + const kernel = gpu.createKernel( + function (a, b) { + return customAdderLink(a[this.thread.x], b[this.thread.x]); + }, + { + output: [6], + returnType: 'Integer', + } + ); const a = [1, 2, 3, 5, 6, 7]; const b = [4, 5, 6, 1, 2, 3]; @@ -57,14 +65,16 @@ function cpuAddAB(mode) { return a + b; } const gpu = new GPU({ mode }); - gpu - .injectNative(customAdder.toString()); - const kernel = gpu.createKernel(function(a, b) { - return customAdder(a[this.thread.x], b[this.thread.x]); - }, { - output: [6], - returnType: 'Integer' - }); + gpu.injectNative(customAdder.toString()); + const kernel = gpu.createKernel( + function (a, b) { + return customAdder(a[this.thread.x], b[this.thread.x]); + }, + { + output: [6], + returnType: 'Integer', + } + ); const a = [1, 2, 3, 5, 6, 7]; const b = [4, 5, 6, 1, 2, 3]; @@ -79,4 +89,4 @@ function cpuAddAB(mode) { test('addAB cpu', () => { cpuAddAB('cpu'); -}); \ No newline at end of file +}); diff --git a/test/features/input.js b/test/features/input.js index 42b8bec7..85e76903 100644 --- a/test/features/input.js +++ b/test/features/input.js @@ -5,7 +5,8 @@ describe('input'); function inputX(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(a) { + const kernel = gpu + .createKernel(function (a) { return a[this.thread.x]; }) .setOutput([9]); @@ -18,30 +19,30 @@ function inputX(mode) { gpu.destroy(); } -test("inputX auto", () => { +test('inputX auto', () => { inputX(); }); -test("inputX gpu", () => { +test('inputX gpu', () => { inputX('gpu'); }); -(GPU.isWebGLSupported ? test : skip)("inputX webgl", () => { +(GPU.isWebGLSupported ? test : skip)('inputX webgl', () => { inputX('webgl'); }); -(GPU.isWebGL2Supported ? test : skip)("inputX webgl2", () => { +(GPU.isWebGL2Supported ? test : skip)('inputX webgl2', () => { inputX('webgl2'); }); -test("inputX cpu", () => { +test('inputX cpu', () => { inputX('cpu'); }); - function inputXY(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(a) { + const kernel = gpu + .createKernel(function (a) { return a[this.thread.y][this.thread.x]; }) .setOutput([9]); @@ -57,33 +58,34 @@ function inputXY(mode) { gpu.destroy(); } -test("inputXY auto", () => { +test('inputXY auto', () => { inputXY(); }); -test("inputXY gpu", () => { +test('inputXY gpu', () => { inputXY('gpu'); }); -(GPU.isWebGLSupported ? test : skip)("inputXY webgl", () => { +(GPU.isWebGLSupported ? test : skip)('inputXY webgl', () => { inputXY('webgl'); }); -(GPU.isWebGL2Supported ? test : skip)("inputXY webgl2", () => { +(GPU.isWebGL2Supported ? test : skip)('inputXY webgl2', () => { inputXY('webgl2'); }); -(GPU.isHeadlessGLSupported ? test : skip)("inputXY headlessgl", () => { +(GPU.isHeadlessGLSupported ? test : skip)('inputXY headlessgl', () => { inputXY('headlessgl'); }); -test("inputXY cpu", () => { +test('inputXY cpu', () => { inputXY('cpu'); }); function inputYX(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(a) { + const kernel = gpu + .createKernel(function (a) { return a[this.thread.y][this.thread.x]; }) .setOutput([3, 3]); @@ -92,41 +94,47 @@ function inputYX(mode) { a.set([1, 2, 3, 4, 5, 6, 7, 8, 9]); const result = kernel(input(a, [3, 3])); - assert.deepEqual(result.map(function(v) { return Array.from(v); }), [ - [1, 2, 3], - [4, 5, 6], - [7, 8, 9] - ]); + assert.deepEqual( + result.map(function (v) { + return Array.from(v); + }), + [ + [1, 2, 3], + [4, 5, 6], + [7, 8, 9], + ] + ); gpu.destroy(); } -test("inputYX auto", () => { +test('inputYX auto', () => { inputYX(); }); -test("inputYX gpu", () => { +test('inputYX gpu', () => { inputYX('gpu'); }); -(GPU.isWebGLSupported ? test : skip)("inputYX webgl", () => { +(GPU.isWebGLSupported ? test : skip)('inputYX webgl', () => { inputYX('webgl'); }); -(GPU.isWebGL2Supported ? test : skip)("inputYX webgl2", () => { +(GPU.isWebGL2Supported ? test : skip)('inputYX webgl2', () => { inputYX('webgl2'); }); -(GPU.isHeadlessGLSupported ? test : skip)("inputYX headlessgl", () => { +(GPU.isHeadlessGLSupported ? test : skip)('inputYX headlessgl', () => { inputYX('headlessgl'); }); -test("inputYX cpu", () => { +test('inputYX cpu', () => { inputYX('cpu'); }); function inputYXOffset(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(a) { + const kernel = gpu + .createKernel(function (a) { return a[this.thread.x][this.thread.y]; }) .setOutput([8, 2]); @@ -135,40 +143,46 @@ function inputYXOffset(mode) { a.set([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]); const result = kernel(input(a, [2, 8])); - assert.deepEqual(result.map(function(v) { return Array.from(v); }), [ - [1, 3, 5, 7, 9, 11, 13, 15], - [2, 4, 6, 8, 10, 12, 14, 16] - ]); + assert.deepEqual( + result.map(function (v) { + return Array.from(v); + }), + [ + [1, 3, 5, 7, 9, 11, 13, 15], + [2, 4, 6, 8, 10, 12, 14, 16], + ] + ); gpu.destroy(); } -test("inputYXOffset auto", () => { +test('inputYXOffset auto', () => { inputYXOffset(); }); -test("inputYXOffset gpu", () => { +test('inputYXOffset gpu', () => { inputYXOffset('gpu'); }); -(GPU.isWebGLSupported ? test : skip)("inputYXOffset webgl", () => { +(GPU.isWebGLSupported ? test : skip)('inputYXOffset webgl', () => { inputYXOffset('webgl'); }); -(GPU.isWebGL2Supported ? test : skip)("inputYXOffset webgl2", () => { +(GPU.isWebGL2Supported ? test : skip)('inputYXOffset webgl2', () => { inputYXOffset('webgl2'); }); -(GPU.isHeadlessGLSupported ? test : skip)("inputYXOffset headlessgl", () => { +(GPU.isHeadlessGLSupported ? test : skip)('inputYXOffset headlessgl', () => { inputYXOffset('headlessgl'); }); -test("inputYXOffset cpu", () => { +test('inputYXOffset cpu', () => { inputYXOffset('cpu'); }); function inputYXOffsetPlus1(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(a) { + const kernel = gpu + .createKernel(function (a) { return a[this.thread.x][this.thread.y]; }) .setOutput([2, 8]); @@ -176,46 +190,52 @@ function inputYXOffsetPlus1(mode) { const a = new Float32Array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]); const result = kernel(input(a, [8, 2])); - assert.deepEqual(result.map(function(v) { return Array.from(v); }), [ - [1, 9], - [2, 10], - [3, 11], - [4, 12], - [5, 13], - [6, 14], - [7, 15], - [8, 16] - ]); + assert.deepEqual( + result.map(function (v) { + return Array.from(v); + }), + [ + [1, 9], + [2, 10], + [3, 11], + [4, 12], + [5, 13], + [6, 14], + [7, 15], + [8, 16], + ] + ); gpu.destroy(); } -test("inputYXOffsetPlus1 auto", () => { +test('inputYXOffsetPlus1 auto', () => { inputYXOffsetPlus1(); }); -test("inputYXOffsetPlus1 gpu", () => { +test('inputYXOffsetPlus1 gpu', () => { inputYXOffsetPlus1('gpu'); }); -(GPU.isWebGLSupported ? test : skip)("inputYXOffsetPlus1 webgl", () => { +(GPU.isWebGLSupported ? test : skip)('inputYXOffsetPlus1 webgl', () => { inputYXOffsetPlus1('webgl'); }); -(GPU.isWebGL2Supported ? test : skip)("inputYXOffsetPlus1 webgl2", () => { +(GPU.isWebGL2Supported ? test : skip)('inputYXOffsetPlus1 webgl2', () => { inputYXOffsetPlus1('webgl2'); }); -(GPU.isHeadlessGLSupported ? test : skip)("inputYXOffsetPlus1 headlessgl", () => { +(GPU.isHeadlessGLSupported ? test : skip)('inputYXOffsetPlus1 headlessgl', () => { inputYXOffsetPlus1('headlessgl'); }); -test("inputYXOffsetPlus1 cpu", () => { +test('inputYXOffsetPlus1 cpu', () => { inputYXOffsetPlus1('cpu'); }); function inputZYX(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(a) { + const kernel = gpu + .createKernel(function (a) { return a[this.thread.z][this.thread.y][this.thread.x]; }) .setOutput([2, 4, 4]); @@ -224,63 +244,70 @@ function inputZYX(mode) { a.set([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]); const result = kernel(input(a, [2, 4, 4])); - assert.deepEqual(result.map(function(v) { return v.map(function(v) { return Array.from(v); }); }), [ - [ - [1, 2], - [3, 4], - [5, 6], - [7, 8] - ], - [ - [9, 10], - [11, 12], - [13, 14], - [15, 16] - ], - [ - [17, 18], - [19, 20], - [21, 22], - [23, 24] - ], + assert.deepEqual( + result.map(function (v) { + return v.map(function (v) { + return Array.from(v); + }); + }), [ - [25, 26], - [27, 28], - [29, 30], - [31, 32] + [ + [1, 2], + [3, 4], + [5, 6], + [7, 8], + ], + [ + [9, 10], + [11, 12], + [13, 14], + [15, 16], + ], + [ + [17, 18], + [19, 20], + [21, 22], + [23, 24], + ], + [ + [25, 26], + [27, 28], + [29, 30], + [31, 32], + ], ] - ]); + ); gpu.destroy(); } -test("inputZYX auto", () => { +test('inputZYX auto', () => { inputZYX(); }); -test("inputZYX gpu", () => { +test('inputZYX gpu', () => { inputZYX('gpu'); }); -(GPU.isWebGLSupported ? test : skip)("inputZYX webgl", () => { +(GPU.isWebGLSupported ? test : skip)('inputZYX webgl', () => { inputZYX('webgl'); }); -(GPU.isWebGL2Supported ? test : skip)("inputZYX webgl2", () => { +(GPU.isWebGL2Supported ? test : skip)('inputZYX webgl2', () => { inputZYX('webgl2'); }); -(GPU.isHeadlessGLSupported ? test : skip)("inputZYX headlessgl", () => { +(GPU.isHeadlessGLSupported ? test : skip)('inputZYX headlessgl', () => { inputZYX('headlessgl'); }); -test("inputZYX cpu", () => { +test('inputZYX cpu', () => { inputZYX('cpu'); }); - function inputZYXVariables(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(a, x, y, z) { + const kernel = gpu + .createKernel(function (a, x, y, z) { return a[z][y][x]; }) .setOutput([1]); @@ -296,33 +323,34 @@ function inputZYXVariables(mode) { gpu.destroy(); } -test("inputZYXVariables auto", () => { +test('inputZYXVariables auto', () => { inputZYXVariables(); }); -test("inputZYXVariables gpu", () => { +test('inputZYXVariables gpu', () => { inputZYXVariables('gpu'); }); -(GPU.isWebGLSupported ? test : skip)("inputZYXVariables webgl", () => { +(GPU.isWebGLSupported ? test : skip)('inputZYXVariables webgl', () => { inputZYXVariables('webgl'); }); -(GPU.isWebGL2Supported ? test : skip)("inputZYXVariables webgl2", () => { +(GPU.isWebGL2Supported ? test : skip)('inputZYXVariables webgl2', () => { inputZYXVariables('webgl2'); }); -(GPU.isHeadlessGLSupported ? test : skip)("inputZYXVariables headlessgl", () => { +(GPU.isHeadlessGLSupported ? test : skip)('inputZYXVariables headlessgl', () => { inputZYXVariables('headlessgl'); }); -test("inputZYXVariables cpu", () => { +test('inputZYXVariables cpu', () => { inputZYXVariables('cpu'); }); function inputInt32ArrayX(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(a) { + const kernel = gpu + .createKernel(function (a) { return a[this.thread.x]; }) .setPrecision('unsigned') @@ -334,23 +362,23 @@ function inputInt32ArrayX(mode) { gpu.destroy(); } -test("inputInt32ArrayX auto", () => { +test('inputInt32ArrayX auto', () => { inputInt32ArrayX(); }); -test("inputInt32ArrayX gpu", () => { +test('inputInt32ArrayX gpu', () => { inputInt32ArrayX('gpu'); }); -(GPU.isWebGLSupported ? test : skip)("inputInt32ArrayX webgl", () => { +(GPU.isWebGLSupported ? test : skip)('inputInt32ArrayX webgl', () => { inputInt32ArrayX('webgl'); }); -(GPU.isWebGL2Supported ? test : skip)("inputInt32ArrayX webgl2", () => { +(GPU.isWebGL2Supported ? test : skip)('inputInt32ArrayX webgl2', () => { inputInt32ArrayX('webgl2'); }); -test("inputInt32ArrayX cpu", () => { +test('inputInt32ArrayX cpu', () => { inputInt32ArrayX('cpu'); }); @@ -361,17 +389,8 @@ test('.toArray() with matrix', () => { assert.deepEqual(input([1, 2, 3, 4, 5, 6, 7, 8], [4, 2]).toArray(), [new Float32Array([1, 2, 3, 4]), new Float32Array([5, 6, 7, 8])]); }); test('.toArray() with grid', () => { - assert.deepEqual( - input([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], [4, 2, 2]).toArray(), - [ - [ - new Float32Array([1, 2, 3, 4]), - new Float32Array([5, 6, 7, 8]), - ], - [ - new Float32Array([9, 10, 11, 12]), - new Float32Array([13, 14, 15, 16]) - ] - ] - ); -}); \ No newline at end of file + assert.deepEqual(input([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], [4, 2, 2]).toArray(), [ + [new Float32Array([1, 2, 3, 4]), new Float32Array([5, 6, 7, 8])], + [new Float32Array([9, 10, 11, 12]), new Float32Array([13, 14, 15, 16])], + ]); +}); diff --git a/test/features/internally-defined-matrices.js b/test/features/internally-defined-matrices.js index a3387cf7..025dc8a0 100644 --- a/test/features/internally-defined-matrices.js +++ b/test/features/internally-defined-matrices.js @@ -9,14 +9,17 @@ function testMatrix2(mode) { function getMatrix() { const matrix = [ [1, 2], - [3, 4] + [3, 4], ]; return matrix; } gpu.addFunction(getMatrix); - const kernel = gpu.createKernel(function(y, x) { - return getMatrix()[y][x]; - }, { output: [1] }); + const kernel = gpu.createKernel( + function (y, x) { + return getMatrix()[y][x]; + }, + { output: [1] } + ); assert.equal(kernel(0, 0)[0], 1); assert.equal(kernel(0, 1)[0], 2); @@ -62,9 +65,12 @@ function testMatrix3(mode) { return matrix; } gpu.addFunction(getMatrix); - const kernel = gpu.createKernel(function(y, x) { - return getMatrix()[y][x]; - }, { output: [1] }); + const kernel = gpu.createKernel( + function (y, x) { + return getMatrix()[y][x]; + }, + { output: [1] } + ); assert.equal(kernel(0, 0)[0], 1); assert.equal(kernel(0, 1)[0], 2); @@ -116,9 +122,12 @@ function testMatrix4(mode) { return matrix; } gpu.addFunction(getMatrix); - const kernel = gpu.createKernel(function(y, x) { - return getMatrix()[y][x]; - }, { output: [1] }); + const kernel = gpu.createKernel( + function (y, x) { + return getMatrix()[y][x]; + }, + { output: [1] } + ); assert.equal(kernel(0, 0)[0], 1); assert.equal(kernel(0, 1)[0], 2); @@ -162,4 +171,4 @@ test('matrix4 gpu', () => { test('matrix4 cpu', () => { testMatrix4('cpu'); -}); \ No newline at end of file +}); diff --git a/test/features/json.js b/test/features/json.js index 1ad7ce86..b373b6b6 100644 --- a/test/features/json.js +++ b/test/features/json.js @@ -6,9 +6,12 @@ describe('json serialize'); function testJSONSerialize(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(value) { - return value; - }, { output: [1] }); + const kernel = gpu.createKernel( + function (value) { + return value; + }, + { output: [1] } + ); kernel(1); @@ -41,4 +44,4 @@ test('gpu', () => { test('cpu', () => { testJSONSerialize('cpu'); -}); \ No newline at end of file +}); diff --git a/test/features/legacy-encoder.js b/test/features/legacy-encoder.js index 30a3d863..4241d16a 100644 --- a/test/features/legacy-encoder.js +++ b/test/features/legacy-encoder.js @@ -5,9 +5,12 @@ describe('features: legacy encoder'); function testLegacyEncoderOff(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function() { - return 1; - }, { output: [1], precision: 'unsigned' }); + const kernel = gpu.createKernel( + function () { + return 1; + }, + { output: [1], precision: 'unsigned' } + ); assert.equal(kernel()[0], 1); gpu.destroy(); } @@ -34,13 +37,16 @@ test('off cpu', () => { function testLegacyEncoderOn(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function() { - return 1; - }, { - output: [1], - precision: 'unsigned', - useLegacyEncoder: true, - }); + const kernel = gpu.createKernel( + function () { + return 1; + }, + { + output: [1], + precision: 'unsigned', + useLegacyEncoder: true, + } + ); assert.equal(kernel()[0], 1); gpu.destroy(); } @@ -71,12 +77,14 @@ function testSubKernelsLegacyEncoderOff(mode) { function addOne(value) { return value + 1; } - const kernel = gpu.createKernelMap([ - addOne, - ], function() { - const result = addOne(1); - return result + 1; - }, { output: [1], precision: 'unsigned' }); + const kernel = gpu.createKernelMap( + [addOne], + function () { + const result = addOne(1); + return result + 1; + }, + { output: [1], precision: 'unsigned' } + ); assert.equal(kernel()[0][0], 2); assert.equal(kernel().result[0], 3); gpu.destroy(); @@ -108,16 +116,18 @@ function testSubKernelsLegacyEncoderOn(mode) { function addOne(value) { return value + 1; } - const kernel = gpu.createKernelMap([ - addOne, - ], function() { - const value = addOne(1); - return value + 1; - }, { - output: [1], - precision: 'unsigned', - useLegacyEncoder: true, - }); + const kernel = gpu.createKernelMap( + [addOne], + function () { + const value = addOne(1); + return value + 1; + }, + { + output: [1], + precision: 'unsigned', + useLegacyEncoder: true, + } + ); assert.equal(kernel()[0][0], 2); assert.equal(kernel().result[0], 3); gpu.destroy(); @@ -145,126 +155,174 @@ test('subKernels on cpu', () => { test('HeadlessGLKernel.getMainResultKernelPackedPixels useLegacyEncoder = false', () => { const result = HeadlessGLKernel.prototype.getMainResultKernelPackedPixels.apply({ - useLegacyEncoder: false + useLegacyEncoder: false, }); - assert.equal(result, ` threadId = indexTo3D(index, uOutputDim); + assert.equal( + result, + ` threadId = indexTo3D(index, uOutputDim); kernel(); gl_FragData[0] = encode32(kernelResult); -`); +` + ); }); test('WebGLKernel.getMainResultKernelPackedPixels useLegacyEncoder = false', () => { const result = WebGLKernel.prototype.getMainResultKernelPackedPixels.apply({ - useLegacyEncoder: false + useLegacyEncoder: false, }); - assert.equal(result, ` threadId = indexTo3D(index, uOutputDim); + assert.equal( + result, + ` threadId = indexTo3D(index, uOutputDim); kernel(); gl_FragData[0] = encode32(kernelResult); -`); +` + ); }); test('WebGL2Kernel.getMainResultKernelPackedPixels useLegacyEncoder = false', () => { const result = WebGL2Kernel.prototype.getMainResultKernelPackedPixels.apply({ - useLegacyEncoder: false + useLegacyEncoder: false, }); - assert.equal(result, ` threadId = indexTo3D(index, uOutputDim); + assert.equal( + result, + ` threadId = indexTo3D(index, uOutputDim); kernel(); data0 = encode32(kernelResult); -`); +` + ); }); test('HeadlessGLKernel.getMainResultKernelPackedPixels useLegacyEncoder = true', () => { const result = HeadlessGLKernel.prototype.getMainResultKernelPackedPixels.apply({ - useLegacyEncoder: true + useLegacyEncoder: true, }); - assert.equal(result, ` threadId = indexTo3D(index, uOutputDim); + assert.equal( + result, + ` threadId = indexTo3D(index, uOutputDim); kernel(); gl_FragData[0] = legacyEncode32(kernelResult); -`); +` + ); }); test('WebGLKernel.getMainResultKernelPackedPixels useLegacyEncoder = true', () => { const result = WebGLKernel.prototype.getMainResultKernelPackedPixels.apply({ - useLegacyEncoder: true + useLegacyEncoder: true, }); - assert.equal(result, ` threadId = indexTo3D(index, uOutputDim); + assert.equal( + result, + ` threadId = indexTo3D(index, uOutputDim); kernel(); gl_FragData[0] = legacyEncode32(kernelResult); -`); +` + ); }); test('WebGL2Kernel.getMainResultKernelPackedPixels useLegacyEncoder = true', () => { const result = WebGL2Kernel.prototype.getMainResultKernelPackedPixels.apply({ - useLegacyEncoder: true + useLegacyEncoder: true, }); - assert.equal(result, ` threadId = indexTo3D(index, uOutputDim); + assert.equal( + result, + ` threadId = indexTo3D(index, uOutputDim); kernel(); data0 = legacyEncode32(kernelResult); -`); +` + ); }); test('HeadlessGLKernel.getMainResultSubKernelPackedPixels useLegacyEncoder = false', () => { const result = HeadlessGLKernel.prototype.getMainResultSubKernelPackedPixels.apply({ useLegacyEncoder: false, - subKernels: [{ - name: 'subKernel1' - }] + subKernels: [ + { + name: 'subKernel1', + }, + ], }); - assert.equal(result, ` gl_FragData[1] = encode32(subKernelResult_subKernel1); -`); + assert.equal( + result, + ` gl_FragData[1] = encode32(subKernelResult_subKernel1); +` + ); }); test('WebGLKernel.getMainResultSubKernelPackedPixels useLegacyEncoder = false', () => { const result = WebGLKernel.prototype.getMainResultSubKernelPackedPixels.apply({ useLegacyEncoder: false, - subKernels: [{ - name: 'subKernel1' - }] + subKernels: [ + { + name: 'subKernel1', + }, + ], }); - assert.equal(result, ` gl_FragData[1] = encode32(subKernelResult_subKernel1); -`); + assert.equal( + result, + ` gl_FragData[1] = encode32(subKernelResult_subKernel1); +` + ); }); test('WebGL2Kernel.getMainResultSubKernelPackedPixels useLegacyEncoder = false', () => { const result = WebGL2Kernel.prototype.getMainResultSubKernelPackedPixels.apply({ useLegacyEncoder: false, - subKernels: [{ - name: 'subKernel1' - }] + subKernels: [ + { + name: 'subKernel1', + }, + ], }); - assert.equal(result, ` data1 = encode32(subKernelResult_subKernel1); -`); + assert.equal( + result, + ` data1 = encode32(subKernelResult_subKernel1); +` + ); }); test('HeadlessGLKernel.getMainResultSubKernelPackedPixels useLegacyEncoder = true', () => { const result = HeadlessGLKernel.prototype.getMainResultSubKernelPackedPixels.apply({ useLegacyEncoder: true, - subKernels: [{ - name: 'subKernel1' - }] + subKernels: [ + { + name: 'subKernel1', + }, + ], }); - assert.equal(result, ` gl_FragData[1] = legacyEncode32(subKernelResult_subKernel1); -`); + assert.equal( + result, + ` gl_FragData[1] = legacyEncode32(subKernelResult_subKernel1); +` + ); }); test('WebGLKernel.getMainResultSubKernelPackedPixels useLegacyEncoder = true', () => { const result = WebGLKernel.prototype.getMainResultSubKernelPackedPixels.apply({ useLegacyEncoder: true, - subKernels: [{ - name: 'subKernel1' - }] + subKernels: [ + { + name: 'subKernel1', + }, + ], }); - assert.equal(result, ` gl_FragData[1] = legacyEncode32(subKernelResult_subKernel1); -`); + assert.equal( + result, + ` gl_FragData[1] = legacyEncode32(subKernelResult_subKernel1); +` + ); }); test('WebGL2Kernel.getMainResultSubKernelPackedPixels useLegacyEncoder = true', () => { const result = WebGL2Kernel.prototype.getMainResultSubKernelPackedPixels.apply({ useLegacyEncoder: true, - subKernels: [{ - name: 'subKernel1' - }] + subKernels: [ + { + name: 'subKernel1', + }, + ], }); - assert.equal(result, ` data1 = legacyEncode32(subKernelResult_subKernel1); -`); -}); \ No newline at end of file + assert.equal( + result, + ` data1 = legacyEncode32(subKernelResult_subKernel1); +` + ); +}); diff --git a/test/features/loops.js b/test/features/loops.js index e6fffdeb..e06e4caa 100644 --- a/test/features/loops.js +++ b/test/features/loops.js @@ -5,16 +5,19 @@ describe('loops - for'); function forLoopTest(mode) { const gpu = new GPU({ mode }); - const f = gpu.createKernel(function(a, b) { - let x = 0; - for (let i = 0; i < 10; i++) { - x = x + 1; + const f = gpu.createKernel( + function (a, b) { + let x = 0; + for (let i = 0; i < 10; i++) { + x = x + 1; + } + + return a[this.thread.x] + b[this.thread.x] + x; + }, + { + output: [6], } - - return (a[this.thread.x] + b[this.thread.x] + x); - }, { - output: [6] - }); + ); assert.ok(f !== null, 'function generated test'); @@ -52,24 +55,26 @@ test('cpu', () => { forLoopTest('cpu'); }); - describe('loops - for with constant'); function forWithConstantTest(mode) { const gpu = new GPU({ mode }); - const f = gpu.createKernel(function(a, b) { - let x = 0; - for (let i = 0; i < this.constants.max; i++) { - x = x + 1; + const f = gpu.createKernel( + function (a, b) { + let x = 0; + for (let i = 0; i < this.constants.max; i++) { + x = x + 1; + } + + return a[this.thread.x] + b[this.thread.x] + x; + }, + { + output: [6], + constants: { + max: 10, + }, } - - return (a[this.thread.x] + b[this.thread.x] + x); - }, { - output: [6], - constants: { - max: 10 - } - }); + ); assert.ok(f !== null, 'function generated test'); @@ -108,22 +113,24 @@ test('forConstantLoopTest cpu', () => { forWithConstantTest('cpu'); }); - describe('loops - while'); function whileLoopTest(mode) { const gpu = new GPU({ mode }); - const f = gpu.createKernel(function(a, b) { - let x = 0; - let i = 0; - while (i++ < 10) { - x = x + 1; + const f = gpu.createKernel( + function (a, b) { + let x = 0; + let i = 0; + while (i++ < 10) { + x = x + 1; + } + + return a[this.thread.x] + b[this.thread.x] + x; + }, + { + output: [6], } - - return (a[this.thread.x] + b[this.thread.x] + x); - }, { - output: [6] - }); + ); const a = [1, 2, 3, 5, 6, 7]; const b = [4, 5, 6, 1, 2, 3]; @@ -159,24 +166,25 @@ test('cpu', () => { whileLoopTest('cpu'); }); - - describe('loops - while with constant'); function whileWithConstantTest(mode) { const gpu = new GPU({ mode }); - const f = gpu.createKernel(function(a, b) { - let x = 0; - let i = 0; - while (i++ < this.constants.max) { - x = x + 1; + const f = gpu.createKernel( + function (a, b) { + let x = 0; + let i = 0; + while (i++ < this.constants.max) { + x = x + 1; + } + + return a[this.thread.x] + b[this.thread.x] + x; + }, + { + output: [6], + constants: { max: 10 }, } - - return (a[this.thread.x] + b[this.thread.x] + x); - }, { - output: [6], - constants: { max: 10 } - }); + ); assert.ok(f !== null, 'function generated test'); @@ -214,7 +222,6 @@ test('cpu', () => { whileWithConstantTest('cpu'); }); - describe('loops - evil while loop'); function evilWhileLoopTest(mode) { @@ -228,7 +235,7 @@ function evilWhileLoopTest(mode) { ++i; } - return (a[this.thread.x] + b[this.thread.x] + x); + return a[this.thread.x] + b[this.thread.x] + x; } const evil_while_a = [1, 2, 3, 5, 6, 7]; @@ -243,7 +250,7 @@ function evilWhileLoopTest(mode) { const gpu = new GPU({ mode }); const f = gpu.createKernel(evilWhileKernelFunction, { - output: [6] + output: [6], }); assert.ok(f !== null, 'function generated test'); @@ -285,17 +292,20 @@ describe('loops - do while'); function doWhileLoopTest(mode) { const gpu = new GPU({ mode }); - const f = gpu.createKernel(function(a, b) { - let x = 0; - let i = 0; - do { - x = x + 1; - i++; - } while (i < 10); - return (a[this.thread.x] + b[this.thread.x] + x); - }, { - output: [6] - }); + const f = gpu.createKernel( + function (a, b) { + let x = 0; + let i = 0; + do { + x = x + 1; + i++; + } while (i < 10); + return a[this.thread.x] + b[this.thread.x] + x; + }, + { + output: [6], + } + ); assert.ok(f !== null, 'function generated test'); @@ -336,18 +346,21 @@ describe('loops - do while with constant'); function doWhileWithConstantLoop(mode) { const gpu = new GPU({ mode }); - const f = gpu.createKernel(function(a, b) { - let x = 0; - let i = 0; - do { - x = x + 1; - i++; - } while (i < this.constants.max); - return (a[this.thread.x] + b[this.thread.x] + x); - }, { - output: [6], - constants: { max: 10 } - }); + const f = gpu.createKernel( + function (a, b) { + let x = 0; + let i = 0; + do { + x = x + 1; + i++; + } while (i < this.constants.max); + return a[this.thread.x] + b[this.thread.x] + x; + }, + { + output: [6], + constants: { max: 10 }, + } + ); assert.ok(f !== null, 'function generated test'); @@ -382,4 +395,4 @@ test('gpu', () => { test('cpu', () => { doWhileWithConstantLoop('cpu'); -}); \ No newline at end of file +}); diff --git a/test/features/math-object.js b/test/features/math-object.js index 35c17af8..a3aeb191 100644 --- a/test/features/math-object.js +++ b/test/features/math-object.js @@ -8,9 +8,12 @@ function mathProps(mode) { const gpu = new GPU({ mode }); for (let i = 0; i < props.length; i++) { const prop = props[i]; - const kernel = gpu.createKernel(`function() { + const kernel = gpu.createKernel( + `function() { return Math.${prop}; - }`, { output: [1] }); + }`, + { output: [1] } + ); assert.equal(kernel()[0].toFixed(6), Math[prop].toFixed(6)); } gpu.destroy(); @@ -76,9 +79,12 @@ function singleArgumentMathMethods(mode) { const gpu = new GPU({ mode }); for (let i = 0; i < methods.length; i++) { const method = methods[i]; - const kernel = gpu.createKernel(`function(value) { + const kernel = gpu.createKernel( + `function(value) { return Math.${method}(value); - }`, { output: [1] }); + }`, + { output: [1] } + ); for (let j = 0; j < 10; j++) { assert.equal(kernel(j / 10)[0].toFixed(3), Math[method](j / 10).toFixed(3), `Math.${method}(${j / 10})`); } @@ -111,20 +117,17 @@ test('Single argument Math methods cpu', () => { }); function twoArgumentMathMethods(mode) { - const methods = [ - 'atan2', - 'imul', - 'max', - 'min', - 'pow', - ]; + const methods = ['atan2', 'imul', 'max', 'min', 'pow']; const gpu = new GPU({ mode }); for (let i = 0; i < methods.length; i++) { const method = methods[i]; - const kernel = gpu.createKernel(`function(value1, value2) { + const kernel = gpu.createKernel( + `function(value1, value2) { return Math.${method}(value1, value2); - }`, { output: [1] }); + }`, + { output: [1] } + ); for (let j = 0; j < 10; j++) { const value1 = j / 10; const value2 = value1; @@ -160,11 +163,14 @@ test('Two argument Math methods cpu', () => { function sqrtABTest(mode) { const gpu = new GPU({ mode }); - const f = gpu.createKernel(function(a, b) { - return Math.sqrt(a[this.thread.x] * b[this.thread.x]); - }, { - output: [6] - }); + const f = gpu.createKernel( + function (a, b) { + return Math.sqrt(a[this.thread.x] * b[this.thread.x]); + }, + { + output: [6], + } + ); const a = [3, 4, 5, 6, 7, 8]; const b = [3, 4, 5, 6, 7, 8]; @@ -199,12 +205,14 @@ test('sqrtAB cpu', () => { sqrtABTest('cpu'); }); - function mathRandom(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function() { - return Math.random(); - }, { output: [1] }); + const kernel = gpu.createKernel( + function () { + return Math.random(); + }, + { output: [1] } + ); const result = kernel(); assert.ok(result[0] > 0 && result[0] < 1, `value was expected to be between o and 1, but was ${result[0]}`); @@ -232,4 +240,4 @@ test('random gpu', () => { test('random cpu', () => { mathRandom('cpu'); -}); \ No newline at end of file +}); diff --git a/test/features/nested-function.js b/test/features/nested-function.js index 371131a6..fc3998be 100644 --- a/test/features/nested-function.js +++ b/test/features/nested-function.js @@ -5,15 +5,18 @@ describe('nested function'); function nestedSumABTest(mode) { const gpu = new GPU({ mode }); - const f = gpu.createKernel(function(a, b) { - function custom_adder(a, b) { - return a + b; + const f = gpu.createKernel( + function (a, b) { + function custom_adder(a, b) { + return a + b; + } + + return custom_adder(a[this.thread.x], b[this.thread.x]); + }, + { + output: [6], } - - return custom_adder(a[this.thread.x], b[this.thread.x]); - }, { - output: [6] - }); + ); assert.ok(f !== null, 'function generated test'); @@ -61,9 +64,12 @@ function testNestedInCustomFunction(mode) { } const gpu = new GPU({ mode }); gpu.addFunction(custom1); - const kernel = gpu.createKernel(function() { - return custom1(); - }, { output: [1] }); + const kernel = gpu.createKernel( + function () { + return custom1(); + }, + { output: [1] } + ); assert.deepEqual(kernel(), new Float32Array([1])); gpu.destroy(); } @@ -90,4 +96,4 @@ test('nested in custom gpu', () => { test('nested in custom cpu', () => { testNestedInCustomFunction('cpu'); -}); \ No newline at end of file +}); diff --git a/test/features/offscreen-canvas.js b/test/features/offscreen-canvas.js index f3206c47..df0742e4 100644 --- a/test/features/offscreen-canvas.js +++ b/test/features/offscreen-canvas.js @@ -1,11 +1,12 @@ if (typeof importScripts !== 'undefined') { // inside Worker importScripts('../../dist/gpu-browser.js'); - onmessage = function(e) { + onmessage = function (e) { const gpu = new GPU({ mode: e.data }); const a = [1, 2, 3]; const b = [3, 2, 1]; - const kernel = gpu.createKernel(function(a, b) { + const kernel = gpu + .createKernel(function (a, b) { return a[this.thread.x] - b[this.thread.x]; }) .setOutput([3]); @@ -18,7 +19,7 @@ if (typeof importScripts !== 'undefined') { function testOffscreenCanvas(mode, done) { const worker = new Worker('features/offscreen-canvas.js'); - worker.onmessage = function(e) { + worker.onmessage = function (e) { const mode = e.data.mode; const result = e.data.result; assert.equal(mode, 'gpu', 'GPU mode used in Worker'); @@ -47,4 +48,4 @@ if (typeof importScripts !== 'undefined') { (GPU.isOffscreenCanvasSupported ? test : skip)('offscreen canvas cpu', t => { testOffscreenCanvas('cpu', t.async()); }); -} \ No newline at end of file +} diff --git a/test/features/optimize-float-memory.js b/test/features/optimize-float-memory.js index c5bf43a1..9ef6366c 100644 --- a/test/features/optimize-float-memory.js +++ b/test/features/optimize-float-memory.js @@ -5,11 +5,16 @@ describe('feature: optimizeFloatMemory'); function whenEnabledCallsCorrectRenderFunction(mode) { const gpu = new GPU({ mode }); - const fn = gpu.createKernel(function() { return 1 }, { - output: [1], - precision: 'single', - optimizeFloatMemory: true, - }); + const fn = gpu.createKernel( + function () { + return 1; + }, + { + output: [1], + precision: 'single', + optimizeFloatMemory: true, + } + ); const result = fn(); assert.equal(fn.TextureConstructor.name, 'GLTextureMemoryOptimized'); assert.equal(fn.formatValues, utils.erectMemoryOptimizedFloat); @@ -29,21 +34,28 @@ function whenEnabledCallsCorrectRenderFunction(mode) { whenEnabledCallsCorrectRenderFunction('headlessgl'); }); - function whenEnabledCallsCorrectRenderFunction2D(mode) { const gpu = new GPU({ mode }); - const fn = gpu.createKernel(function() { return 1 }, { - output: [2, 2], - precision: 'single', - optimizeFloatMemory: true, - }); + const fn = gpu.createKernel( + function () { + return 1; + }, + { + output: [2, 2], + precision: 'single', + optimizeFloatMemory: true, + } + ); const result = fn(); assert.equal(fn.TextureConstructor.name, 'GLTextureMemoryOptimized2D'); assert.equal(fn.formatValues, utils.erectMemoryOptimized2DFloat); - assert.deepEqual(result.map(row => Array.from(row)), [ - [1, 1], - [1, 1] - ]); + assert.deepEqual( + result.map(row => Array.from(row)), + [ + [1, 1], + [1, 1], + ] + ); } (GPU.isSinglePrecisionSupported && GPU.isGPUSupported ? test : skip)('when enabled calls correct render function 2d gpu (GPU ONLY)', () => { @@ -61,24 +73,32 @@ function whenEnabledCallsCorrectRenderFunction2D(mode) { function whenEnabledCallsCorrectRenderFunction3D(mode) { const gpu = new GPU({ mode }); - const fn = gpu.createKernel(function() { return 1 }, { - output: [2, 2, 2], - precision: 'single', - optimizeFloatMemory: true, - }); + const fn = gpu.createKernel( + function () { + return 1; + }, + { + output: [2, 2, 2], + precision: 'single', + optimizeFloatMemory: true, + } + ); const result = fn(); assert.equal(fn.TextureConstructor.name, 'GLTextureMemoryOptimized3D'); assert.equal(fn.formatValues, utils.erectMemoryOptimized3DFloat); - assert.deepEqual(result.map(matrix => matrix.map(row => Array.from(row))), [ + assert.deepEqual( + result.map(matrix => matrix.map(row => Array.from(row))), [ - [1, 1], - [1, 1] - ], - [ - [1, 1], - [1, 1] + [ + [1, 1], + [1, 1], + ], + [ + [1, 1], + [1, 1], + ], ] - ]); + ); } (GPU.isSinglePrecisionSupported && GPU.isGPUSupported ? test : skip)('when enabled calls correct render function 3d gpu (GPU ONLY)', () => { @@ -97,13 +117,16 @@ function whenEnabledCallsCorrectRenderFunction3D(mode) { function singlePrecision(mode) { const gpu = new GPU({ mode }); const array = [1, 2, 3, 4, 5]; - const kernel = gpu.createKernel(function(array) { - return array[this.thread.x]; - }, { - output: [5], - optimizeFloatMemory: true, - precision: 'single', - }); + const kernel = gpu.createKernel( + function (array) { + return array[this.thread.x]; + }, + { + output: [5], + optimizeFloatMemory: true, + precision: 'single', + } + ); const result = kernel(array); assert.deepEqual(Array.from(result), array); gpu.destroy(); @@ -133,7 +156,6 @@ test('single precision cpu', () => { singlePrecision('cpu'); }); - function float2DOutput(mode) { const gpu = new GPU({ mode }); const matrix = [ @@ -141,15 +163,21 @@ function float2DOutput(mode) { [6, 7, 8, 9, 10], [11, 12, 13, 14, 15], ]; - const kernel = gpu.createKernel(function(matrix) { - return matrix[this.thread.y][this.thread.x]; - }, { - output: [5, 3], - optimizeFloatMemory: true, - precision: 'single', - }); + const kernel = gpu.createKernel( + function (matrix) { + return matrix[this.thread.y][this.thread.x]; + }, + { + output: [5, 3], + optimizeFloatMemory: true, + precision: 'single', + } + ); const result = kernel(matrix); - assert.deepEqual(result.map(row => Array.from(row)), matrix); + assert.deepEqual( + result.map(row => Array.from(row)), + matrix + ); gpu.destroy(); } @@ -177,7 +205,6 @@ test('float 2d output cpu', () => { float2DOutput('cpu'); }); - function float3DOutput(mode) { const gpu = new GPU({ mode }); const cube = [ @@ -190,17 +217,23 @@ function float3DOutput(mode) { [16, 17, 18, 19, 20], [21, 22, 23, 24, 25], [26, 27, 28, 29, 30], - ] + ], ]; - const kernel = gpu.createKernel(function(cube) { - return cube[this.thread.z][this.thread.y][this.thread.x]; - }, { - output: [5, 3, 2], - optimizeFloatMemory: true, - precision: 'single', - }); + const kernel = gpu.createKernel( + function (cube) { + return cube[this.thread.z][this.thread.y][this.thread.x]; + }, + { + output: [5, 3, 2], + optimizeFloatMemory: true, + precision: 'single', + } + ); const result = kernel(cube); - assert.deepEqual(result.map(matrix => matrix.map(row => Array.from(row))), cube); + assert.deepEqual( + result.map(matrix => matrix.map(row => Array.from(row))), + cube + ); gpu.destroy(); } @@ -231,14 +264,17 @@ test('float 3d output cpu', () => { function floatPipelineOutput(mode) { const gpu = new GPU({ mode }); const array = [1, 2, 3, 4, 5]; - const kernel = gpu.createKernel(function(array) { - return array[this.thread.x]; - }, { - output: [5], - optimizeFloatMemory: true, - precision: 'single', - pipeline: true, - }); + const kernel = gpu.createKernel( + function (array) { + return array[this.thread.x]; + }, + { + output: [5], + optimizeFloatMemory: true, + precision: 'single', + pipeline: true, + } + ); const result = kernel(array).toArray(); assert.deepEqual(Array.from(result), array); gpu.destroy(); @@ -260,7 +296,6 @@ function floatPipelineOutput(mode) { floatPipelineOutput('headlessgl'); }); - function floatPipeline2DOutput(mode) { const gpu = new GPU({ mode }); const matrix = [ @@ -268,21 +303,26 @@ function floatPipeline2DOutput(mode) { [6, 7, 8, 9, 10], [11, 12, 13, 14, 15], ]; - const kernel = gpu.createKernel(function(matrix) { - return matrix[this.thread.y][this.thread.x]; - }, { - output: [5, 3], - optimizeFloatMemory: true, - precision: 'single', - pipeline: true, - }); + const kernel = gpu.createKernel( + function (matrix) { + return matrix[this.thread.y][this.thread.x]; + }, + { + output: [5, 3], + optimizeFloatMemory: true, + precision: 'single', + pipeline: true, + } + ); const texture = kernel(matrix); const result = texture.toArray(); - assert.deepEqual(result.map(row => Array.from(row)), matrix); + assert.deepEqual( + result.map(row => Array.from(row)), + matrix + ); gpu.destroy(); } - (GPU.isSinglePrecisionSupported && GPU.isGPUSupported ? test : skip)('float pipeline 2d output gpu (GPU Only)', () => { floatPipeline2DOutput('gpu'); }); @@ -299,7 +339,6 @@ function floatPipeline2DOutput(mode) { floatPipeline2DOutput('headlessgl'); }); - function floatPipeline3DOutput(mode) { const gpu = new GPU({ mode }); const cube = [ @@ -312,22 +351,27 @@ function floatPipeline3DOutput(mode) { [16, 17, 18, 19, 20], [21, 22, 23, 24, 25], [26, 27, 28, 29, 30], - ] + ], ]; - const kernel = gpu.createKernel(function(cube) { - return cube[this.thread.z][this.thread.y][this.thread.x]; - }, { - output: [5, 3, 2], - optimizeFloatMemory: true, - precision: 'single', - pipeline: true, - }); + const kernel = gpu.createKernel( + function (cube) { + return cube[this.thread.z][this.thread.y][this.thread.x]; + }, + { + output: [5, 3, 2], + optimizeFloatMemory: true, + precision: 'single', + pipeline: true, + } + ); const result = kernel(cube).toArray(); - assert.deepEqual(result.map(matrix => matrix.map(row => Array.from(row))), cube); + assert.deepEqual( + result.map(matrix => matrix.map(row => Array.from(row))), + cube + ); gpu.destroy(); } - (GPU.isSinglePrecisionSupported && GPU.isGPUSupported ? test : skip)('float pipeline 3d output gpu (GPU only)', () => { floatPipeline3DOutput('gpu'); }); @@ -342,4 +386,4 @@ function floatPipeline3DOutput(mode) { (GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('float pipeline 3d output headlessgl (GPU only)', () => { floatPipeline3DOutput('headlessgl'); -}); \ No newline at end of file +}); diff --git a/test/features/output.js b/test/features/output.js index 1abfad62..be431205 100644 --- a/test/features/output.js +++ b/test/features/output.js @@ -6,9 +6,12 @@ describe('features: output'); function outputArray(mode) { const gpu = new GPU({ mode }); const input = [1, 2, 3, 4, 5]; - const kernel = gpu.createKernel(function(input) { - return input[this.thread.x]; - }, { output: [5] }); + const kernel = gpu.createKernel( + function (input) { + return input[this.thread.x]; + }, + { output: [5] } + ); const result = kernel(input); assert.deepEqual(Array.from(result), input); gpu.destroy(); @@ -47,11 +50,17 @@ function outputMatrix(mode) { [1, 2, 3, 4, 5], [1, 2, 3, 4, 5], ]; - const kernel = gpu.createKernel(function(input) { - return input[this.thread.y][this.thread.x]; - }, { output: [5, 5] }); + const kernel = gpu.createKernel( + function (input) { + return input[this.thread.y][this.thread.x]; + }, + { output: [5, 5] } + ); const result = kernel(input); - assert.deepEqual(result.map(array => Array.from(array)), input); + assert.deepEqual( + result.map(array => Array.from(array)), + input + ); gpu.destroy(); } @@ -116,13 +125,19 @@ function outputCube(mode) { [1, 2, 3, 4, 5], [1, 2, 3, 4, 5], [1, 2, 3, 4, 5], - ] + ], ]; - const kernel = gpu.createKernel(function(input) { - return input[this.thread.z][this.thread.y][this.thread.x]; - }, { output: [5, 5, 5] }); + const kernel = gpu.createKernel( + function (input) { + return input[this.thread.z][this.thread.y][this.thread.x]; + }, + { output: [5, 5, 5] } + ); const result = kernel(input); - assert.deepEqual(result.map(matrix => matrix.map(array => Array.from(array))), input); + assert.deepEqual( + result.map(matrix => matrix.map(array => Array.from(array))), + input + ); gpu.destroy(); } @@ -153,19 +168,22 @@ test('output cube cpu', () => { function outputGraphicalArray(mode) { const gpu = new GPU({ mode }); const mockContext = { - getExtension: () => {} + getExtension: () => {}, }; const mockCanvas = { getContext: () => mockContext, }; assert.throws(() => { - const kernel = gpu.createKernel(function(input) { - return input[this.thread.x]; - }, { - canvas: mockCanvas, - output: [5], - graphical: true - }); + const kernel = gpu.createKernel( + function (input) { + return input[this.thread.x]; + }, + { + canvas: mockCanvas, + output: [5], + graphical: true, + } + ); kernel([1]); }, new Error('Output must have 2 dimensions on graphical mode')); gpu.destroy(); @@ -198,18 +216,21 @@ test('graphical output array cpu', () => { function outputGraphicalMatrix(mode, canvas, context) { const gpu = new GPU({ mode }); const input = [ - [0.25, .50], - [.75, 1], + [0.25, 0.5], + [0.75, 1], ]; - const kernel = gpu.createKernel(function(input) { - const color = input[this.thread.y][this.thread.x]; - this.color(color, color, color, color); - }, { - context, - canvas, - output: [2, 2], - graphical: true - }); + const kernel = gpu.createKernel( + function (input) { + const color = input[this.thread.y][this.thread.x]; + this.color(color, color, color, color); + }, + { + context, + canvas, + output: [2, 2], + graphical: true, + } + ); const result = kernel(input); assert.equal(result, undefined); const pixels = Array.from(kernel.getPixels()); @@ -221,92 +242,24 @@ function outputGraphicalMatrix(mode, canvas, context) { const canvas = document.createElement('canvas'); const context = canvas.getContext('webgl', { premultipliedAlpha: false }); const pixels = outputGraphicalMatrix('webgl', canvas, context); - assert.deepEqual(pixels, [ - 191, - 191, - 191, - 191, - 255, - 255, - 255, - 255, - 64, - 64, - 64, - 64, - 128, - 128, - 128, - 128 - ]); + assert.deepEqual(pixels, [191, 191, 191, 191, 255, 255, 255, 255, 64, 64, 64, 64, 128, 128, 128, 128]); }); (GPU.isWebGL2Supported ? test : skip)('graphical output matrix webgl2', () => { const canvas = document.createElement('canvas'); const context = canvas.getContext('webgl2', { premultipliedAlpha: false }); const pixels = outputGraphicalMatrix('webgl2', canvas, context); - assert.deepEqual(pixels, [ - 191, - 191, - 191, - 191, - 255, - 255, - 255, - 255, - 64, - 64, - 64, - 64, - 128, - 128, - 128, - 128 - ]); + assert.deepEqual(pixels, [191, 191, 191, 191, 255, 255, 255, 255, 64, 64, 64, 64, 128, 128, 128, 128]); }); (GPU.isHeadlessGLSupported ? test : skip)('graphical output matrix headlessgl', () => { const pixels = outputGraphicalMatrix('headlessgl'); - assert.deepEqual(pixels, [ - 191, - 191, - 191, - 191, - 255, - 255, - 255, - 255, - 64, - 64, - 64, - 64, - 128, - 128, - 128, - 128 - ]); + assert.deepEqual(pixels, [191, 191, 191, 191, 255, 255, 255, 255, 64, 64, 64, 64, 128, 128, 128, 128]); }); (GPU.isCanvasSupported ? test : skip)('graphical output matrix cpu with real canvas', () => { const pixels = outputGraphicalMatrix('cpu'); - assert.deepEqual(pixels, [ - 191, - 191, - 191, - 191, - 255, - 255, - 255, - 255, - 63, - 63, - 63, - 63, - 127, - 127, - 127, - 127 - ]); + assert.deepEqual(pixels, [191, 191, 191, 191, 255, 255, 255, 255, 63, 63, 63, 63, 127, 127, 127, 127]); }); test('graphical output matrix cpu with mocked canvas', () => { @@ -316,7 +269,7 @@ test('graphical output matrix cpu with mocked canvas', () => { createImageData: () => { return { data: new Uint8ClampedArray(2 * 2 * 4) }; }, - putImageData: (_outputImageData) => { + putImageData: _outputImageData => { outputImageData = _outputImageData; }, getImageData: () => { @@ -324,48 +277,34 @@ test('graphical output matrix cpu with mocked canvas', () => { }, getExtension: () => { return null; - } + }, }; const mockCanvas = { getContext: () => mockContext, }; const pixels = outputGraphicalMatrix('cpu', mockCanvas, mockContext); - assert.deepEqual(pixels, [ - 191, - 191, - 191, - 191, - 255, - 255, - 255, - 255, - 63, - 63, - 63, - 63, - 127, - 127, - 127, - 127 - ]); + assert.deepEqual(pixels, [191, 191, 191, 191, 255, 255, 255, 255, 63, 63, 63, 63, 127, 127, 127, 127]); }); function outputGraphicalCube(mode) { const gpu = new GPU({ mode }); const mockContext = { - getExtension: () => {} + getExtension: () => {}, }; const mockCanvas = { - getContext: () => mockContext + getContext: () => mockContext, }; assert.throws(() => { - const kernel = gpu.createKernel(function(input) { - return input[this.thread.x]; - }, { - canvas: mockCanvas, - output: [5, 5, 5], - graphical: true - }); + const kernel = gpu.createKernel( + function (input) { + return input[this.thread.x]; + }, + { + canvas: mockCanvas, + output: [5, 5, 5], + graphical: true, + } + ); kernel([1]); }, new Error('Output must have 2 dimensions on graphical mode')); gpu.destroy(); @@ -393,4 +332,4 @@ test('graphical output array gpu', () => { test('graphical output array cpu', () => { outputGraphicalCube('cpu'); -}); \ No newline at end of file +}); diff --git a/test/features/promise-api.js b/test/features/promise-api.js index 2e9b9249..44d45da3 100644 --- a/test/features/promise-api.js +++ b/test/features/promise-api.js @@ -6,12 +6,12 @@ describe('features: promise api'); function promiseApiFunctionReturn(mode, done) { const gpu = new GPU({ mode }); - const kernelFn = function() { + const kernelFn = function () { return 42.0; }; const settings = { - output: [1] + output: [1], }; // Setup kernel @@ -20,12 +20,12 @@ function promiseApiFunctionReturn(mode, done) { const promiseObj = kernel.exec(); assert.ok(promiseObj !== null, 'Promise object generated test'); promiseObj - .then((res) => { + .then(res => { assert.equal(res[0], 42.0); gpu.destroy(); done(); }) - .catch((err) => { + .catch(err => { throw err; }); } @@ -52,4 +52,4 @@ test('functionReturn gpu', t => { test('functionReturn cpu', t => { promiseApiFunctionReturn('cpu', t.async()); -}); \ No newline at end of file +}); diff --git a/test/features/raw-output.js b/test/features/raw-output.js index 002a5ba1..c00ae952 100644 --- a/test/features/raw-output.js +++ b/test/features/raw-output.js @@ -5,12 +5,15 @@ describe('features: raw output'); function rawUnsignedPrecisionRenderOutput(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(v) { - return v[this.thread.x]; - }, { - output: [1], - precision: 'unsigned', - }); + const kernel = gpu.createKernel( + function (v) { + return v[this.thread.x]; + }, + { + output: [1], + precision: 'unsigned', + } + ); kernel.build([1]); kernel.run([1]); const result = kernel.renderRawOutput(); @@ -45,15 +48,17 @@ test('raw unsigned precision render output cpu', () => { }); }); - function rawSinglePrecisionRenderOutput(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(v) { - return v[this.thread.x]; - }, { - output: [1], - precision: 'single', - }); + const kernel = gpu.createKernel( + function (v) { + return v[this.thread.x]; + }, + { + output: [1], + precision: 'single', + } + ); kernel.build([1]); kernel.run([1]); const result = kernel.renderRawOutput(); @@ -94,4 +99,4 @@ test('raw single precision render output cpu', () => { assert.throws(() => { rawSinglePrecisionRenderOutput('cpu'); }); -}); \ No newline at end of file +}); diff --git a/test/features/read-color-texture.js b/test/features/read-color-texture.js index ebe7777e..17feb1aa 100644 --- a/test/features/read-color-texture.js +++ b/test/features/read-color-texture.js @@ -5,57 +5,47 @@ describe('features: read color texture'); function colorSyntaxTest(mode) { const gpu = new GPU({ mode }); - const createTexture = gpu.createKernel( - function(value) { - this.color( - value[this.thread.y][this.thread.x], - value[this.thread.y][this.thread.x], - value[this.thread.y][this.thread.x], - value[this.thread.y][this.thread.x] - ); - } - ) + const createTexture = gpu + .createKernel(function (value) { + this.color(value[this.thread.y][this.thread.x], value[this.thread.y][this.thread.x], value[this.thread.y][this.thread.x], value[this.thread.y][this.thread.x]); + }) .setOutput([4, 4]) .setGraphical(true) .setPipeline(true); - const readRTexture = gpu.createKernel( - function(texture) { - const pixel = texture[this.thread.y][this.thread.x]; - return pixel.r; - } - ) + const readRTexture = gpu + .createKernel(function (texture) { + const pixel = texture[this.thread.y][this.thread.x]; + return pixel.r; + }) .setOutput([4, 4]); - const readGTexture = gpu.createKernel( - function(texture) { - const pixel = texture[this.thread.y][this.thread.x]; - return pixel.g; - } - ) + const readGTexture = gpu + .createKernel(function (texture) { + const pixel = texture[this.thread.y][this.thread.x]; + return pixel.g; + }) .setOutput([4, 4]); - const readBTexture = gpu.createKernel( - function(texture) { - const pixel = texture[this.thread.y][this.thread.x]; - return pixel.b; - } - ) + const readBTexture = gpu + .createKernel(function (texture) { + const pixel = texture[this.thread.y][this.thread.x]; + return pixel.b; + }) .setOutput([4, 4]); - const readATexture = gpu.createKernel( - function(texture) { - const pixel = texture[this.thread.y][this.thread.x]; - return pixel.a; - } - ) + const readATexture = gpu + .createKernel(function (texture) { + const pixel = texture[this.thread.y][this.thread.x]; + return pixel.a; + }) .setOutput([4, 4]); const texture = createTexture([ - [.01, .02, .03, .04], - [.05, .06, .07, .08], - [.09, .10, .11, .12], - [.13, .14, .15, .16] + [0.01, 0.02, 0.03, 0.04], + [0.05, 0.06, 0.07, 0.08], + [0.09, 0.1, 0.11, 0.12], + [0.13, 0.14, 0.15, 0.16], ]); const resultR = readRTexture(texture); const resultG = readGTexture(texture); @@ -174,4 +164,4 @@ test('colorSyntaxTest (cpu) throws', () => { assert.throws(() => { colorSyntaxTest('cpu'); }); -}); \ No newline at end of file +}); diff --git a/test/features/read-from-texture.js b/test/features/read-from-texture.js index dbe06e8d..14d88ba0 100644 --- a/test/features/read-from-texture.js +++ b/test/features/read-from-texture.js @@ -10,11 +10,15 @@ function readWithoutTextureKernels(mode) { return m + n; } - const kernels = gpu.createKernelMap({ - addResult: add - }, function(a, b) { - return add(a[this.thread.x], b[this.thread.x]); - }) + const kernels = gpu + .createKernelMap( + { + addResult: add, + }, + function (a, b) { + return add(a[this.thread.x], b[this.thread.x]); + } + ) .setOutput([5]); const result = kernels([1, 2, 3, 4, 5], [1, 2, 3, 4, 5]); const nonTextureResult = result.addResult; @@ -49,11 +53,15 @@ function readFromTextureKernels(mode) { function add(m, n) { return m + n; } - const kernels = gpu.createKernelMap({ - addResult: add - }, function(a, b) { - return add(a[this.thread.x], b[this.thread.x]); - }) + const kernels = gpu + .createKernelMap( + { + addResult: add, + }, + function (a, b) { + return add(a[this.thread.x], b[this.thread.x]); + } + ) .setPipeline(true) .setOutput([5]); const result = kernels([1, 2, 3, 4, 5], [1, 2, 3, 4, 5]); @@ -81,4 +89,4 @@ function readFromTextureKernels(mode) { (GPU.isHeadlessGLSupported && HeadlessGLKernel.features.kernelMap ? test : skip)('Read from Texture headlessgl', () => { readFromTextureKernels('headlessgl'); -}); \ No newline at end of file +}); diff --git a/test/features/read-image-bitmap.js b/test/features/read-image-bitmap.js index 78c038f1..4d7fcce8 100644 --- a/test/features/read-image-bitmap.js +++ b/test/features/read-image-bitmap.js @@ -7,13 +7,16 @@ function readImageBitmap(mode, done) { const gpu = new GPU({ mode }); const image = new Image(); image.src = 'jellyfish.jpeg'; - const kernel = gpu.createKernel(function(image) { - const pixel = image[this.thread.y][this.thread.x]; - return pixel[0] + pixel[1] + pixel[2] + pixel[3]; - }, { - output: [1] - }); - image.onload = async function() { + const kernel = gpu.createKernel( + function (image) { + const pixel = image[this.thread.y][this.thread.x]; + return pixel[0] + pixel[1] + pixel[2] + pixel[3]; + }, + { + output: [1], + } + ); + image.onload = async function () { const imageBitmapPromise = createImageBitmap(image, 0, 0, 1, 1); const imageBitmap = await imageBitmapPromise; const result = kernel(imageBitmap); @@ -24,26 +27,26 @@ function readImageBitmap(mode, done) { }; } -(typeof Image !== 'undefined' ? test : skip)('readImageBitmap auto', (assert) => { +(typeof Image !== 'undefined' ? test : skip)('readImageBitmap auto', assert => { readImageBitmap(null, assert.async()); }); -(typeof Image !== 'undefined' ? test : skip)('readImageBitmap gpu', (assert) => { +(typeof Image !== 'undefined' ? test : skip)('readImageBitmap gpu', assert => { readImageBitmap('gpu', assert.async()); }); -(GPU.isWebGLSupported && typeof Image !== 'undefined' ? test : skip)('readImageBitmap webgl', (assert) => { +(GPU.isWebGLSupported && typeof Image !== 'undefined' ? test : skip)('readImageBitmap webgl', assert => { readImageBitmap('webgl', assert.async()); }); -(GPU.isWebGL2Supported && typeof Image !== 'undefined' ? test : skip)('readImageBitmap webgl2', (assert) => { +(GPU.isWebGL2Supported && typeof Image !== 'undefined' ? test : skip)('readImageBitmap webgl2', assert => { readImageBitmap('webgl2', assert.async()); }); -(GPU.isHeadlessGLSupported && typeof Image !== 'undefined' ? test : skip)('readImageBitmap headlessgl', (assert) => { +(GPU.isHeadlessGLSupported && typeof Image !== 'undefined' ? test : skip)('readImageBitmap headlessgl', assert => { readImageBitmap('headlessgl', assert.async()); }); -(typeof Image !== 'undefined' ? test : skip)('readImageBitmap cpu', (assert) => { +(typeof Image !== 'undefined' ? test : skip)('readImageBitmap cpu', assert => { readImageBitmap('cpu', assert.async()); -}); \ No newline at end of file +}); diff --git a/test/features/read-image-data.js b/test/features/read-image-data.js index 633a8e51..aed9ed90 100644 --- a/test/features/read-image-data.js +++ b/test/features/read-image-data.js @@ -7,12 +7,15 @@ function readImageData(mode) { const gpu = new GPU({ mode }); const dataArray = new Uint8ClampedArray([255, 255, 255, 255]); const imageData = new ImageData(dataArray, 1, 1); - const kernel = gpu.createKernel(function(imageData) { - const pixel = imageData[this.thread.y][this.thread.x]; - return pixel[0] + pixel[1] + pixel[2] + pixel[3]; - }, { - output: [1] - }); + const kernel = gpu.createKernel( + function (imageData) { + const pixel = imageData[this.thread.y][this.thread.x]; + return pixel[0] + pixel[1] + pixel[2] + pixel[3]; + }, + { + output: [1], + } + ); const result = kernel(imageData); assert.equal(result.length, 1); assert.equal(result[0], 4); @@ -41,4 +44,4 @@ function readImageData(mode) { (typeof ImageData !== 'undefined' ? test : skip)('readImageData cpu', () => { readImageData('cpu'); -}); \ No newline at end of file +}); diff --git a/test/features/read-offscreen-canvas.js b/test/features/read-offscreen-canvas.js index 54563c6a..afbf5dd6 100644 --- a/test/features/read-offscreen-canvas.js +++ b/test/features/read-offscreen-canvas.js @@ -1,22 +1,28 @@ if (typeof importScripts !== 'undefined') { // inside Worker importScripts('../../dist/gpu-browser.js'); - onmessage = function(e) { + onmessage = function (e) { const gpu = new GPU({ mode: e.data }); - const kernel1 = gpu.createKernel(function() { - this.color(1, 1, 1, 1); - }, { - output: [1, 1], - graphical: true, - }); + const kernel1 = gpu.createKernel( + function () { + this.color(1, 1, 1, 1); + }, + { + output: [1, 1], + graphical: true, + } + ); kernel1(); const { canvas } = kernel1; - const kernel2 = gpu.createKernel(function(canvas) { - const pixel = canvas[0][this.thread.x]; - return pixel[0] + pixel[1] + pixel[2] + pixel[3]; - }, { - output: [1], - }); + const kernel2 = gpu.createKernel( + function (canvas) { + const pixel = canvas[0][this.thread.x]; + return pixel[0] + pixel[1] + pixel[2] + pixel[3]; + }, + { + output: [1], + } + ); postMessage({ mode: gpu.mode, result: kernel2(canvas) }); gpu.destroy(); }; @@ -26,7 +32,7 @@ if (typeof importScripts !== 'undefined') { function testReadOffscreenCanvas(mode, done) { const worker = new Worker('features/read-offscreen-canvas.js'); - worker.onmessage = function(e) { + worker.onmessage = function (e) { const { result } = e.data; if (mode) assert.equal(e.data.mode, mode, 'GPU mode used in Worker'); assert.deepEqual(result, Float32Array.from([4])); @@ -54,4 +60,4 @@ if (typeof importScripts !== 'undefined') { (GPU.isOffscreenCanvasSupported ? test : skip)('read offscreen canvas cpu', t => { testReadOffscreenCanvas('cpu', t.async()); }); -} \ No newline at end of file +} diff --git a/test/features/return-arrays.js b/test/features/return-arrays.js index 6898caf8..0461112b 100644 --- a/test/features/return-arrays.js +++ b/test/features/return-arrays.js @@ -5,13 +5,17 @@ describe('features: return arrays'); function returnArray2FromKernel(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function() { - return [1, 2]; - }, { output: [1], precision: 'single' }); + const kernel = gpu.createKernel( + function () { + return [1, 2]; + }, + { output: [1], precision: 'single' } + ); const result = kernel(); - assert.deepEqual(result.map(v => Array.from(v)), [ - [1, 2] - ]); + assert.deepEqual( + result.map(v => Array.from(v)), + [[1, 2]] + ); gpu.destroy(); } @@ -41,9 +45,12 @@ test('return Array(2) from kernel cpu', () => { function returnArray2D2FromKernel(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function() { - return [this.thread.x, this.thread.y]; - }, { output: [3, 7], precision: 'single' }); + const kernel = gpu.createKernel( + function () { + return [this.thread.x, this.thread.y]; + }, + { output: [3, 7], precision: 'single' } + ); const res = kernel(); for (let y = 0; y < 7; ++y) { for (let x = 0; x < 3; ++x) { @@ -80,9 +87,12 @@ test('return Array2D(2) from kernel cpu', () => { function returnArray3D2FromKernel(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function() { - return [this.thread.y, this.thread.z]; - }, { output: [3, 5, 7], precision: 'single' }); + const kernel = gpu.createKernel( + function () { + return [this.thread.y, this.thread.z]; + }, + { output: [3, 5, 7], precision: 'single' } + ); const res = kernel(); for (let z = 0; z < 7; ++z) { for (let y = 0; y < 5; ++y) { @@ -119,16 +129,16 @@ test('return Array3D(2) from kernel cpu', () => { returnArray3D2FromKernel('cpu'); }); - function returnArray3FromKernel(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function() { - return [1, 2, 3]; - }, { output: [1], precision: 'single' }); + const kernel = gpu.createKernel( + function () { + return [1, 2, 3]; + }, + { output: [1], precision: 'single' } + ); const result = kernel(); - assert.deepEqual(Array.from(result.map(v => Array.from(v))), [ - [1, 2, 3] - ]); + assert.deepEqual(Array.from(result.map(v => Array.from(v))), [[1, 2, 3]]); gpu.destroy(); } @@ -158,9 +168,12 @@ test('return Array(3) from kernel cpu', () => { function returnArray2D3FromKernel(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function() { - return [this.thread.x, this.thread.y, this.thread.x * this.thread.y]; - }, { output: [3, 7], precision: 'single' }); + const kernel = gpu.createKernel( + function () { + return [this.thread.x, this.thread.y, this.thread.x * this.thread.y]; + }, + { output: [3, 7], precision: 'single' } + ); const res = kernel(); for (let y = 0; y < 7; ++y) { for (let x = 0; x < 3; ++x) { @@ -198,9 +211,12 @@ test('return Array2D(3) from kernel cpu', () => { function returnArray3D3FromKernel(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function() { - return [this.thread.x, this.thread.y, this.thread.z]; - }, { output: [3, 5, 7], precision: 'single' }); + const kernel = gpu.createKernel( + function () { + return [this.thread.x, this.thread.y, this.thread.z]; + }, + { output: [3, 5, 7], precision: 'single' } + ); const res = kernel(); for (let z = 0; z < 7; ++z) { for (let y = 0; y < 5; ++y) { @@ -240,13 +256,17 @@ test('return Array3D(3) from kernel cpu', () => { function returnArray4FromKernel(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function() { - return [1, 2, 3, 4]; - }, { output: [1], precision: 'single' }); + const kernel = gpu.createKernel( + function () { + return [1, 2, 3, 4]; + }, + { output: [1], precision: 'single' } + ); const result = kernel(); - assert.deepEqual(result.map(v => Array.from(v)), [ - [1, 2, 3, 4] - ]); + assert.deepEqual( + result.map(v => Array.from(v)), + [[1, 2, 3, 4]] + ); gpu.destroy(); } @@ -276,9 +296,12 @@ test('return Array(4) from kernel cpu', () => { function returnArray2D4FromKernel(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function() { - return [this.thread.x, this.thread.y, this.thread.x * this.thread.y, this.thread.x - this.thread.y]; - }, { output: [3, 7], precision: 'single' }); + const kernel = gpu.createKernel( + function () { + return [this.thread.x, this.thread.y, this.thread.x * this.thread.y, this.thread.x - this.thread.y]; + }, + { output: [3, 7], precision: 'single' } + ); const res = kernel(); for (let y = 0; y < 3; ++y) { for (let x = 0; x < 3; ++x) { @@ -317,9 +340,12 @@ test('return Array2D(4) from kernel cpu', () => { function returnArray3D4FromKernel(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function() { - return [this.thread.x, this.thread.y, this.thread.z, this.thread.x * this.thread.y * this.thread.z]; - }, { output: [3, 5, 7], precision: 'single' }); + const kernel = gpu.createKernel( + function () { + return [this.thread.x, this.thread.y, this.thread.z, this.thread.x * this.thread.y * this.thread.z]; + }, + { output: [3, 5, 7], precision: 'single' } + ); const res = kernel(); for (let z = 0; z < 7; ++z) { for (let y = 0; y < 5; ++y) { @@ -359,19 +385,21 @@ test('return Array3D(4) from kernel cpu', () => { }); function returnArray2FromKernelVariables33Length(mode) { - const array = [ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33 - ]; + const array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33]; const sixteen = new Uint16Array(array); const eight = new Uint8Array(array); const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(v1, v2) { - return [v1[this.thread.x], v2[this.thread.x]]; - }, { output: [33] }); + const kernel = gpu.createKernel( + function (v1, v2) { + return [v1[this.thread.x], v2[this.thread.x]]; + }, + { output: [33] } + ); const result = kernel(sixteen, eight); - assert.deepEqual(result.map(v => Array.from(v)), array.map(v => [v, v])); + assert.deepEqual( + result.map(v => Array.from(v)), + array.map(v => [v, v]) + ); gpu.destroy(); } @@ -399,18 +427,23 @@ test('return Array(2) from kernel variables 33 in length cpu', () => { returnArray2FromKernelVariables33Length('cpu'); }); - function returnArray3FromKernelVariables33Length(mode) { const array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33]; const thirtyTwo = new Float32Array(array); const sixteen = new Uint16Array(array); const eight = new Uint8Array(array); const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(v1, v2, v3) { - return [v1[this.thread.x], v2[this.thread.x], v3[this.thread.x]]; - }, { output: [33] }); + const kernel = gpu.createKernel( + function (v1, v2, v3) { + return [v1[this.thread.x], v2[this.thread.x], v3[this.thread.x]]; + }, + { output: [33] } + ); const result = kernel(thirtyTwo, sixteen, eight); - assert.deepEqual(result.map(v => Array.from(v)), array.map(v => [v, v, v])); + assert.deepEqual( + result.map(v => Array.from(v)), + array.map(v => [v, v, v]) + ); gpu.destroy(); } @@ -438,18 +471,23 @@ test('return Array(3) from kernel variables 33 in length cpu', () => { returnArray3FromKernelVariables33Length('cpu'); }); - function returnArray4FromKernelVariables33Length(mode) { const array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33]; const thirtyTwo = new Float32Array(array); const sixteen = new Uint16Array(array); const eight = new Uint8Array(array); const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(v1, v2, v3, v4) { - return [v1[this.thread.x], v2[this.thread.x], v3[this.thread.x], v4[this.thread.x]]; - }, { output: [33] }); + const kernel = gpu.createKernel( + function (v1, v2, v3, v4) { + return [v1[this.thread.x], v2[this.thread.x], v3[this.thread.x], v4[this.thread.x]]; + }, + { output: [33] } + ); const result = kernel(array, thirtyTwo, sixteen, eight); - assert.deepEqual(result.map(v => Array.from(v)), array.map(v => [v, v, v, v])); + assert.deepEqual( + result.map(v => Array.from(v)), + array.map(v => [v, v, v, v]) + ); gpu.destroy(); } @@ -475,4 +513,4 @@ function returnArray4FromKernelVariables33Length(mode) { test('return Array(4) from kernel variables 33 in length cpu', () => { returnArray4FromKernelVariables33Length('cpu'); -}); \ No newline at end of file +}); diff --git a/test/features/single-precision-textures.js b/test/features/single-precision-textures.js index fda2ec70..b678137c 100644 --- a/test/features/single-precision-textures.js +++ b/test/features/single-precision-textures.js @@ -6,12 +6,15 @@ describe('features: single precision textures'); function singlePrecisionTexturesWithArray(mode) { const original = [1, 2, 3, 4, 5, 6, 7, 8, 9]; const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(packed) { - return packed[this.thread.x]; - }, { - output: [9], - precision: 'single' - }); + const kernel = gpu.createKernel( + function (packed) { + return packed[this.thread.x]; + }, + { + output: [9], + precision: 'single', + } + ); const result = kernel(original); assert.deepEqual(Array.from(result), original); @@ -45,12 +48,15 @@ test('with Array cpu', () => { function singlePrecisionTexturesWithFloat32Array(mode) { const original = new Float32Array([1, 2, 3, 4, 5, 6, 7, 8, 9]); const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(packed) { - return packed[this.thread.x]; - }, { - output: [9], - precision: 'single' - }); + const kernel = gpu.createKernel( + function (packed) { + return packed[this.thread.x]; + }, + { + output: [9], + precision: 'single', + } + ); const result = kernel(original); assert.deepEqual(Array.from(result), Array.from(original)); @@ -84,12 +90,15 @@ test('with Float32Array cpu', () => { function singlePrecisionTexturesWithUint16Array(mode) { const original = new Uint16Array([1, 2, 3, 4, 5, 6, 7, 8, 9]); const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(packed) { - return packed[this.thread.x]; - }, { - output: [9], - precision: 'single', - }); + const kernel = gpu.createKernel( + function (packed) { + return packed[this.thread.x]; + }, + { + output: [9], + precision: 'single', + } + ); const result = kernel(original); assert.deepEqual(Array.from(result), Array.from(original)); @@ -123,12 +132,15 @@ test('with Uint16Array cpu', () => { function singlePrecisionTexturesWithUint8Array(mode) { const original = new Uint8Array([1, 2, 3, 4, 5, 6, 7, 8, 9]); const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(packed) { - return packed[this.thread.x]; - }, { - output: [9], - precision: 'single' - }); + const kernel = gpu.createKernel( + function (packed) { + return packed[this.thread.x]; + }, + { + output: [9], + precision: 'single', + } + ); const result = kernel(original); assert.deepEqual(Array.from(result), Array.from(original)); @@ -162,12 +174,15 @@ test('with Uint8Array cpu', () => { function singlePrecisionTexturesWithUint8ClampedArray(mode) { const original = new Uint8ClampedArray([1, 2, 3, 4, 5, 6, 7, 8, 9]); const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(packed) { - return packed[this.thread.x]; - }, { - output: [9], - precision: 'single' - }); + const kernel = gpu.createKernel( + function (packed) { + return packed[this.thread.x]; + }, + { + output: [9], + precision: 'single', + } + ); const result = kernel(original); assert.deepEqual(Array.from(result), Array.from(original)); @@ -204,15 +219,21 @@ function singlePrecisionTexturesWithArray2D(mode) { [10, 11, 12, 13, 14, 15, 16, 18, 19], ]; const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(packed) { - return packed[this.thread.y][this.thread.x]; - }, { - output: [9, 2], - precision: 'single' - }); + const kernel = gpu.createKernel( + function (packed) { + return packed[this.thread.y][this.thread.x]; + }, + { + output: [9, 2], + precision: 'single', + } + ); const result = kernel(original); - assert.deepEqual(result.map(array => Array.from(array)), original.map(array => Array.from(array))); + assert.deepEqual( + result.map(array => Array.from(array)), + original.map(array => Array.from(array)) + ); gpu.destroy(); } @@ -241,20 +262,23 @@ test('with Array2D cpu', () => { }); function singlePrecisionTexturesWithFloat32Array2D(mode) { - const original = [ - new Float32Array([1, 2, 3, 4, 5, 6, 7, 8, 9]), - new Float32Array([10, 11, 12, 13, 14, 15, 16, 18, 19]), - ]; + const original = [new Float32Array([1, 2, 3, 4, 5, 6, 7, 8, 9]), new Float32Array([10, 11, 12, 13, 14, 15, 16, 18, 19])]; const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(packed) { - return packed[this.thread.y][this.thread.x]; - }, { - output: [9, 2], - precision: 'single' - }); + const kernel = gpu.createKernel( + function (packed) { + return packed[this.thread.y][this.thread.x]; + }, + { + output: [9, 2], + precision: 'single', + } + ); const result = kernel(original); - assert.deepEqual(result.map(array => Array.from(array)), original.map(array => Array.from(array))); + assert.deepEqual( + result.map(array => Array.from(array)), + original.map(array => Array.from(array)) + ); gpu.destroy(); } @@ -283,20 +307,23 @@ test('with Float32Array2D cpu', () => { }); function singlePrecisionTexturesWithUint16Array2D(mode) { - const original = [ - new Uint16Array([1, 2, 3, 4, 5, 6, 7, 8, 9]), - new Uint16Array([10, 11, 12, 13, 14, 15, 16, 18, 19]), - ]; + const original = [new Uint16Array([1, 2, 3, 4, 5, 6, 7, 8, 9]), new Uint16Array([10, 11, 12, 13, 14, 15, 16, 18, 19])]; const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(packed) { - return packed[this.thread.y][this.thread.x]; - }, { - output: [9, 2], - precision: 'single' - }); + const kernel = gpu.createKernel( + function (packed) { + return packed[this.thread.y][this.thread.x]; + }, + { + output: [9, 2], + precision: 'single', + } + ); const result = kernel(original); - assert.deepEqual(result.map(array => Array.from(array)), original.map(array => Array.from(array))); + assert.deepEqual( + result.map(array => Array.from(array)), + original.map(array => Array.from(array)) + ); gpu.destroy(); } @@ -325,20 +352,23 @@ test('with Uint16Array2D cpu', () => { }); function singlePrecisionTexturesWithUint8Array2D(mode) { - const original = [ - new Uint8Array([1, 2, 3, 4, 5, 6, 7, 8, 9]), - new Uint8Array([10, 11, 12, 13, 14, 15, 16, 18, 19]), - ]; + const original = [new Uint8Array([1, 2, 3, 4, 5, 6, 7, 8, 9]), new Uint8Array([10, 11, 12, 13, 14, 15, 16, 18, 19])]; const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(packed) { - return packed[this.thread.y][this.thread.x]; - }, { - output: [9, 2], - precision: 'single' - }); + const kernel = gpu.createKernel( + function (packed) { + return packed[this.thread.y][this.thread.x]; + }, + { + output: [9, 2], + precision: 'single', + } + ); const result = kernel(original); - assert.deepEqual(result.map(array => Array.from(array)), original.map(array => Array.from(array))); + assert.deepEqual( + result.map(array => Array.from(array)), + original.map(array => Array.from(array)) + ); gpu.destroy(); } @@ -367,20 +397,23 @@ test('with Uint8Array2D cpu', () => { }); function singlePrecisionTexturesWithUint8ClampedArray2D(mode) { - const original = [ - new Uint8ClampedArray([1, 2, 3, 4, 5, 6, 7, 8, 9]), - new Uint8ClampedArray([10, 11, 12, 13, 14, 15, 16, 18, 19]), - ]; + const original = [new Uint8ClampedArray([1, 2, 3, 4, 5, 6, 7, 8, 9]), new Uint8ClampedArray([10, 11, 12, 13, 14, 15, 16, 18, 19])]; const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(packed) { - return packed[this.thread.y][this.thread.x]; - }, { - output: [9, 2], - precision: 'single' - }); + const kernel = gpu.createKernel( + function (packed) { + return packed[this.thread.y][this.thread.x]; + }, + { + output: [9, 2], + precision: 'single', + } + ); const result = kernel(original); - assert.deepEqual(result.map(array => Array.from(array)), original.map(array => Array.from(array))); + assert.deepEqual( + result.map(array => Array.from(array)), + original.map(array => Array.from(array)) + ); gpu.destroy(); } @@ -417,18 +450,24 @@ function singlePrecisionTexturesWithArray3D(mode) { [ [20, 21, 22, 23, 24, 25, 26, 27, 28], [29, 30, 31, 32, 33, 34, 35, 36, 37], - ] + ], ]; const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(packed) { - return packed[this.thread.z][this.thread.y][this.thread.x]; - }, { - output: [9, 2, 2], - precision: 'single' - }); + const kernel = gpu.createKernel( + function (packed) { + return packed[this.thread.z][this.thread.y][this.thread.x]; + }, + { + output: [9, 2, 2], + precision: 'single', + } + ); const result = kernel(original); - assert.deepEqual(result.map(matrix => matrix.map(array => Array.from(array))), original); + assert.deepEqual( + result.map(matrix => matrix.map(array => Array.from(array))), + original + ); gpu.destroy(); } @@ -458,25 +497,25 @@ test('with Array3D cpu', () => { function singlePrecisionTexturesWithFloat32Array3D(mode) { const original = [ - [ - new Float32Array([1, 2, 3, 4, 5, 6, 7, 8, 9]), - new Float32Array([10, 11, 12, 13, 14, 15, 16, 18, 19]), - ], - [ - new Float32Array([20, 21, 22, 23, 24, 25, 26, 27, 28]), - new Float32Array([29, 30, 31, 32, 33, 34, 35, 36, 37]), - ] + [new Float32Array([1, 2, 3, 4, 5, 6, 7, 8, 9]), new Float32Array([10, 11, 12, 13, 14, 15, 16, 18, 19])], + [new Float32Array([20, 21, 22, 23, 24, 25, 26, 27, 28]), new Float32Array([29, 30, 31, 32, 33, 34, 35, 36, 37])], ]; const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(packed) { - return packed[this.thread.z][this.thread.y][this.thread.x]; - }, { - output: [9, 2, 2], - precision: 'single' - }); + const kernel = gpu.createKernel( + function (packed) { + return packed[this.thread.z][this.thread.y][this.thread.x]; + }, + { + output: [9, 2, 2], + precision: 'single', + } + ); const result = kernel(original); - assert.deepEqual(result.map(matrix => matrix.map(array => Array.from(array))), original.map(matrix => matrix.map(array => Array.from(array)))); + assert.deepEqual( + result.map(matrix => matrix.map(array => Array.from(array))), + original.map(matrix => matrix.map(array => Array.from(array))) + ); gpu.destroy(); } @@ -506,25 +545,25 @@ test('with Float32Array3D cpu', () => { function singlePrecisionTexturesWithUint16Array3D(mode) { const original = [ - [ - new Uint16Array([1, 2, 3, 4, 5, 6, 7, 8, 9]), - new Uint16Array([10, 11, 12, 13, 14, 15, 16, 18, 19]), - ], - [ - new Uint16Array([20, 21, 22, 23, 24, 25, 26, 27, 28]), - new Uint16Array([29, 30, 31, 32, 33, 34, 35, 36, 37]), - ] + [new Uint16Array([1, 2, 3, 4, 5, 6, 7, 8, 9]), new Uint16Array([10, 11, 12, 13, 14, 15, 16, 18, 19])], + [new Uint16Array([20, 21, 22, 23, 24, 25, 26, 27, 28]), new Uint16Array([29, 30, 31, 32, 33, 34, 35, 36, 37])], ]; const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(packed) { - return packed[this.thread.z][this.thread.y][this.thread.x]; - }, { - output: [9, 2, 2], - precision: 'single' - }); + const kernel = gpu.createKernel( + function (packed) { + return packed[this.thread.z][this.thread.y][this.thread.x]; + }, + { + output: [9, 2, 2], + precision: 'single', + } + ); const result = kernel(original); - assert.deepEqual(result.map(matrix => matrix.map(array => Array.from(array))), original.map(matrix => matrix.map(array => Array.from(array)))); + assert.deepEqual( + result.map(matrix => matrix.map(array => Array.from(array))), + original.map(matrix => matrix.map(array => Array.from(array))) + ); gpu.destroy(); } @@ -554,25 +593,25 @@ test('with Uint16Array3D cpu', () => { function singlePrecisionTexturesWithUint8Array3D(mode) { const original = [ - [ - new Uint8Array([1, 2, 3, 4, 5, 6, 7, 8, 9]), - new Uint8Array([10, 11, 12, 13, 14, 15, 16, 18, 19]), - ], - [ - new Uint8Array([20, 21, 22, 23, 24, 25, 26, 27, 28]), - new Uint8Array([29, 30, 31, 32, 33, 34, 35, 36, 37]), - ] + [new Uint8Array([1, 2, 3, 4, 5, 6, 7, 8, 9]), new Uint8Array([10, 11, 12, 13, 14, 15, 16, 18, 19])], + [new Uint8Array([20, 21, 22, 23, 24, 25, 26, 27, 28]), new Uint8Array([29, 30, 31, 32, 33, 34, 35, 36, 37])], ]; const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(packed) { - return packed[this.thread.z][this.thread.y][this.thread.x]; - }, { - output: [9, 2, 2], - precision: 'single' - }); + const kernel = gpu.createKernel( + function (packed) { + return packed[this.thread.z][this.thread.y][this.thread.x]; + }, + { + output: [9, 2, 2], + precision: 'single', + } + ); const result = kernel(original); - assert.deepEqual(result.map(matrix => matrix.map(array => Array.from(array))), original.map(matrix => matrix.map(array => Array.from(array)))); + assert.deepEqual( + result.map(matrix => matrix.map(array => Array.from(array))), + original.map(matrix => matrix.map(array => Array.from(array))) + ); gpu.destroy(); } @@ -602,25 +641,25 @@ test('with Uint8Array3D cpu', () => { function singlePrecisionTexturesWithUint8ClampedArray3D(mode) { const original = [ - [ - new Uint8ClampedArray([1, 2, 3, 4, 5, 6, 7, 8, 9]), - new Uint8ClampedArray([10, 11, 12, 13, 14, 15, 16, 18, 19]), - ], - [ - new Uint8ClampedArray([20, 21, 22, 23, 24, 25, 26, 27, 28]), - new Uint8ClampedArray([29, 30, 31, 32, 33, 34, 35, 36, 37]), - ] + [new Uint8ClampedArray([1, 2, 3, 4, 5, 6, 7, 8, 9]), new Uint8ClampedArray([10, 11, 12, 13, 14, 15, 16, 18, 19])], + [new Uint8ClampedArray([20, 21, 22, 23, 24, 25, 26, 27, 28]), new Uint8ClampedArray([29, 30, 31, 32, 33, 34, 35, 36, 37])], ]; const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(packed) { - return packed[this.thread.z][this.thread.y][this.thread.x]; - }, { - output: [9, 2, 2], - precision: 'single' - }); + const kernel = gpu.createKernel( + function (packed) { + return packed[this.thread.z][this.thread.y][this.thread.x]; + }, + { + output: [9, 2, 2], + precision: 'single', + } + ); const result = kernel(original); - assert.deepEqual(result.map(matrix => matrix.map(array => Array.from(array))), original.map(matrix => matrix.map(array => Array.from(array)))); + assert.deepEqual( + result.map(matrix => matrix.map(array => Array.from(array))), + original.map(matrix => matrix.map(array => Array.from(array))) + ); gpu.destroy(); } @@ -650,14 +689,17 @@ test('with Uint8ClampedArray3D cpu', () => { function testImmutableDoesNotCollideWithKernelTexture(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(v) { - return v[this.thread.x] + 1; - }, { - output: [1], - precision: 'single', - pipeline: true, - immutable: true, - }); + const kernel = gpu.createKernel( + function (v) { + return v[this.thread.x] + 1; + }, + { + output: [1], + precision: 'single', + pipeline: true, + immutable: true, + } + ); const v = [1]; const result1 = kernel(v); assert.deepEqual(result1.toArray(), new Float32Array([2])); @@ -689,4 +731,4 @@ function testImmutableDoesNotCollideWithKernelTexture(mode) { (GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('immutable does not collide with kernel texture headlessgl', () => { testImmutableDoesNotCollideWithKernelTexture('headlessgl'); -}); \ No newline at end of file +}); diff --git a/test/features/single-precision.js b/test/features/single-precision.js index eed5317f..d8e38ff2 100644 --- a/test/features/single-precision.js +++ b/test/features/single-precision.js @@ -6,36 +6,39 @@ describe('features: single precision'); function singlePrecisionKernel(mode) { const lst = new Float32Array([1, 2, 3, 4, 5, 6, 7, 8]); const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(lst) { - return lst[this.thread.x]; - }, { - precision: 'single', - output: [lst.length] - }); + const kernel = gpu.createKernel( + function (lst) { + return lst[this.thread.x]; + }, + { + precision: 'single', + output: [lst.length], + } + ); assert.deepEqual(kernel(lst), lst); gpu.destroy(); } -(GPU.isSinglePrecisionSupported ? test : skip)("auto", () => { +(GPU.isSinglePrecisionSupported ? test : skip)('auto', () => { singlePrecisionKernel(null); }); -test("cpu", () => { +test('cpu', () => { singlePrecisionKernel('cpu'); }); -(GPU.isSinglePrecisionSupported ? test : skip)("gpu", () => { +(GPU.isSinglePrecisionSupported ? test : skip)('gpu', () => { singlePrecisionKernel('gpu'); }); -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)("webgl", () => { +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('webgl', () => { singlePrecisionKernel('webgl'); }); -(GPU.isWebGL2Supported ? test : skip)("webgl2", () => { +(GPU.isWebGL2Supported ? test : skip)('webgl2', () => { singlePrecisionKernel('webgl2'); }); -(GPU.isHeadlessGLSupported ? test : skip)("headlessgl", () => { +(GPU.isHeadlessGLSupported ? test : skip)('headlessgl', () => { singlePrecisionKernel('headlessgl'); -}); \ No newline at end of file +}); diff --git a/test/features/switches.js b/test/features/switches.js index 655d25e1..406a834b 100644 --- a/test/features/switches.js +++ b/test/features/switches.js @@ -5,20 +5,23 @@ describe('features: switches'); function testBasic(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(value) { - switch (value) { - case 1: - return 1; - case 2: - return 2; - case 3: - return 3; + const kernel = gpu.createKernel( + function (value) { + switch (value) { + case 1: + return 1; + case 2: + return 2; + case 3: + return 3; + } + return 0; + }, + { + argumentTypes: ['Integer'], + output: [1], } - return 0; - }, { - argumentTypes: ['Integer'], - output: [1], - }); + ); assert.equal(kernel(1)[0], 1); assert.equal(kernel(2)[0], 2); assert.equal(kernel(3)[0], 3); @@ -50,18 +53,20 @@ test('basic cpu', () => { testBasic('cpu'); }); - function testOnlyDefault(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(value) { - switch (value) { - default: - return 3; + const kernel = gpu.createKernel( + function (value) { + switch (value) { + default: + return 3; + } + }, + { + argumentTypes: ['Integer'], + output: [1], } - }, { - argumentTypes: ['Integer'], - output: [1] - }); + ); assert.equal(kernel(1)[0], 3); assert.equal(kernel(2)[0], 3); assert.equal(kernel(3)[0], 3); @@ -95,19 +100,22 @@ test('only default cpu', () => { function testDefault(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(value) { - switch (value) { - case 1: - return 1; - case 2: - return 2; - default: - return 3; + const kernel = gpu.createKernel( + function (value) { + switch (value) { + case 1: + return 1; + case 2: + return 2; + default: + return 3; + } + }, + { + argumentTypes: ['Integer'], + output: [1], } - }, { - argumentTypes: ['Integer'], - output: [1] - }); + ); assert.equal(kernel(1)[0], 1); assert.equal(kernel(2)[0], 2); assert.equal(kernel(3)[0], 3); @@ -139,22 +147,24 @@ test('default cpu', () => { testDefault('cpu'); }); - function testEarlyDefault(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(value) { - switch (value) { - default: - return 3; - case 1: - return 1; - case 2: - return 2; + const kernel = gpu.createKernel( + function (value) { + switch (value) { + default: + return 3; + case 1: + return 1; + case 2: + return 2; + } + }, + { + argumentTypes: ['Integer'], + output: [1], } - }, { - argumentTypes: ['Integer'], - output: [1], - }); + ); assert.equal(kernel(1)[0], 1); assert.equal(kernel(2)[0], 2); assert.equal(kernel(3)[0], 3); @@ -186,21 +196,23 @@ test('early default cpu', () => { testEarlyDefault('cpu'); }); - function testFallThrough(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(value) { - switch (value) { - case 1: - case 2: - return 1; - default: - return 3; + const kernel = gpu.createKernel( + function (value) { + switch (value) { + case 1: + case 2: + return 1; + default: + return 3; + } + }, + { + argumentTypes: ['Integer'], + output: [1], } - }, { - argumentTypes: ['Integer'], - output: [1] - }); + ); assert.equal(kernel(1)[0], 1); assert.equal(kernel(2)[0], 1); assert.equal(kernel(3)[0], 3); @@ -230,4 +242,4 @@ test('fall through gpu', () => { test('fall through cpu', () => { testFallThrough('cpu'); -}); \ No newline at end of file +}); diff --git a/test/features/tactic.js b/test/features/tactic.js index 60f3695e..02900770 100644 --- a/test/features/tactic.js +++ b/test/features/tactic.js @@ -5,7 +5,8 @@ describe('internal: tactic'); function speedTest(mode) { const gpu = new GPU({ mode }); - const add = gpu.createKernel(function(a, b) { + const add = gpu + .createKernel(function (a, b) { return a + b; }) .setOutput([1]) @@ -41,7 +42,8 @@ test('speed cpu', () => { function balancedTest(mode) { const gpu = new GPU({ mode }); - const add = gpu.createKernel(function(a, b) { + const add = gpu + .createKernel(function (a, b) { return a + b; }) .setOutput([1]) @@ -77,7 +79,8 @@ test('balanced cpu', () => { function precisionTest(mode) { const gpu = new GPU({ mode }); - const add = gpu.createKernel(function(a, b) { + const add = gpu + .createKernel(function (a, b) { return a + b; }) .setOutput([1]) @@ -109,4 +112,4 @@ test('precision gpu', () => { test('precision cpu', () => { precisionTest('cpu'); -}); \ No newline at end of file +}); diff --git a/test/features/ternary.js b/test/features/ternary.js index a1d7473b..d6fe5a0f 100644 --- a/test/features/ternary.js +++ b/test/features/ternary.js @@ -7,7 +7,7 @@ function ternaryTest(mode) { const gpu = new GPU({ mode }); function ternaryFunction(value) { - return (value > 1 ? 1 : 0); + return value > 1 ? 1 : 0; } const kernel = gpu.createKernel(ternaryFunction, { output: [1] }); const truthyResult = kernel(100); @@ -43,10 +43,13 @@ test('cpu', () => { function ternaryWithVariableUsage(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(value1) { - const value2 = value1 + 1; - return value2 > 10 ? 1 : 0; - }, { output: [1] }); + const kernel = gpu.createKernel( + function (value1) { + const value2 = value1 + 1; + return value2 > 10 ? 1 : 0; + }, + { output: [1] } + ); assert.equal(kernel(9)[0], 0); assert.equal(kernel(10)[0], 1); @@ -76,4 +79,4 @@ test('with variable usage gpu', () => { test('with variable usage cpu', () => { ternaryWithVariableUsage('cpu'); -}); \ No newline at end of file +}); diff --git a/test/features/to-string/as-file.js b/test/features/to-string/as-file.js index 8469e0b2..c8009326 100644 --- a/test/features/to-string/as-file.js +++ b/test/features/to-string/as-file.js @@ -10,9 +10,12 @@ function toStringAsFileTest(mode) { fs.unlinkSync(path); } const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(v) { - return v[this.thread.y][this.thread.x] + 1; - }, { output: [1, 1] }); + const kernel = gpu.createKernel( + function (v) { + return v[this.thread.y][this.thread.x] + 1; + }, + { output: [1, 1] } + ); const a = [[1]]; const expected = kernel(a); assert.deepEqual(expected, [new Float32Array([2])]); @@ -33,5 +36,3 @@ function toStringAsFileTest(mode) { (GPU.isHeadlessGLSupported ? test : skip)('can save and restore function cpu', () => { toStringAsFileTest('cpu'); }); - - diff --git a/test/features/to-string/precision/single/arguments/array.js b/test/features/to-string/precision/single/arguments/array.js index d115cfe5..3fc66ee2 100644 --- a/test/features/to-string/precision/single/arguments/array.js +++ b/test/features/to-string/precision/single/arguments/array.js @@ -5,17 +5,20 @@ describe('feature: to-string single precision arguments Array'); function testArgument(mode, context, canvas) { const gpu = new GPU({ mode }); - const originalKernel = gpu.createKernel(function(a) { - return a[this.thread.x]; - }, { - canvas, - context, - output: [4], - precision: 'single', - }); + const originalKernel = gpu.createKernel( + function (a) { + return a[this.thread.x]; + }, + { + canvas, + context, + output: [4], + precision: 'single', + } + ); const a = [1, 2, 3, 4]; - const expected = new Float32Array([1,2,3,4]); + const expected = new Float32Array([1, 2, 3, 4]); const originalResult = originalKernel(a); assert.deepEqual(originalResult, expected); const kernelString = originalKernel.toString(a); @@ -23,8 +26,8 @@ function testArgument(mode, context, canvas) { const newResult = newKernel(a); assert.deepEqual(newResult, expected); - const b = [4,3,2,1]; - const expected2 = new Float32Array([4,3,2,1]); + const b = [4, 3, 2, 1]; + const expected2 = new Float32Array([4, 3, 2, 1]); const newResult2 = newKernel(b); assert.deepEqual(newResult2, expected2); gpu.destroy(); diff --git a/test/features/to-string/precision/single/arguments/array2.js b/test/features/to-string/precision/single/arguments/array2.js index b68236a8..ead9c27e 100644 --- a/test/features/to-string/precision/single/arguments/array2.js +++ b/test/features/to-string/precision/single/arguments/array2.js @@ -5,18 +5,21 @@ describe('feature: to-string single precision arguments Array(2)'); function testArgument(mode, context, canvas) { const gpu = new GPU({ mode }); - const originalKernel = gpu.createKernel(function(a) { - return a; - }, { - canvas, - context, - output: [1], - precision: 'single', - argumentTypes: { a: 'Array(2)' } - }); + const originalKernel = gpu.createKernel( + function (a) { + return a; + }, + { + canvas, + context, + output: [1], + precision: 'single', + argumentTypes: { a: 'Array(2)' }, + } + ); const a = new Float32Array([1, 2]); - const expected = [new Float32Array([1,2])]; + const expected = [new Float32Array([1, 2])]; const originalResult = originalKernel(a); assert.deepEqual(originalResult, expected); const kernelString = originalKernel.toString(a); @@ -25,7 +28,7 @@ function testArgument(mode, context, canvas) { assert.deepEqual(newResult, expected); const b = new Float32Array([2, 1]); - const expected2 = [new Float32Array([2,1])]; + const expected2 = [new Float32Array([2, 1])]; const newResult2 = newKernel(b); assert.deepEqual(newResult2, expected2); gpu.destroy(); diff --git a/test/features/to-string/precision/single/arguments/array2d.js b/test/features/to-string/precision/single/arguments/array2d.js index 7a503e33..1eb6285b 100644 --- a/test/features/to-string/precision/single/arguments/array2d.js +++ b/test/features/to-string/precision/single/arguments/array2d.js @@ -5,18 +5,21 @@ describe('feature: to-string single precision arguments Array2D'); function testArgument(mode, context, canvas) { const gpu = new GPU({ mode }); - const originalKernel = gpu.createKernel(function(a) { - let sum = 0; - for (let y = 0; y < 4; y++) { - sum += a[y][this.thread.x]; + const originalKernel = gpu.createKernel( + function (a) { + let sum = 0; + for (let y = 0; y < 4; y++) { + sum += a[y][this.thread.x]; + } + return sum; + }, + { + canvas, + context, + output: [4], + precision: 'single', } - return sum; - }, { - canvas, - context, - output: [4], - precision: 'single', - }); + ); const a = [ [1, 2, 3, 4], @@ -30,7 +33,7 @@ function testArgument(mode, context, canvas) { [1, 1, 1, 1], [1, 1, 1, 1], ]; - const expected = new Float32Array([28,32,36,40]); + const expected = new Float32Array([28, 32, 36, 40]); const originalResult = originalKernel(a); assert.deepEqual(originalResult, expected); const kernelString = originalKernel.toString(a); @@ -38,7 +41,7 @@ function testArgument(mode, context, canvas) { const newResult = newKernel(a); assert.deepEqual(newResult, expected); - const expected2 = new Float32Array([4,4,4,4]); + const expected2 = new Float32Array([4, 4, 4, 4]); const newResult2 = newKernel(b); assert.deepEqual(newResult2, expected2); gpu.destroy(); diff --git a/test/features/to-string/precision/single/arguments/array2d2.js b/test/features/to-string/precision/single/arguments/array2d2.js index ae1dcc72..7bde045e 100644 --- a/test/features/to-string/precision/single/arguments/array2d2.js +++ b/test/features/to-string/precision/single/arguments/array2d2.js @@ -5,18 +5,21 @@ describe('feature: to-string single precision arguments Array2D(2)'); function testArgument(mode, context, canvas) { const gpu = new GPU({ mode }); - const originalKernel = gpu.createKernel(function(a) { - const array2 = a[this.thread.y][this.thread.x]; - return [array2[0] + 1, array2[1] + 1]; - }, { - canvas, - context, - output: [2,2], - precision: 'single', - argumentTypes: { - a: 'Array2D(2)' + const originalKernel = gpu.createKernel( + function (a) { + const array2 = a[this.thread.y][this.thread.x]; + return [array2[0] + 1, array2[1] + 1]; + }, + { + canvas, + context, + output: [2, 2], + precision: 'single', + argumentTypes: { + a: 'Array2D(2)', + }, } - }); + ); const a = [ [ @@ -26,22 +29,16 @@ function testArgument(mode, context, canvas) { [ [5, 6], [7, 8], - ] + ], ]; const expected = [ - [ - new Float32Array([2, 3]), - new Float32Array([4, 5]), - ], - [ - new Float32Array([6, 7]), - new Float32Array([8, 9]), - ] + [new Float32Array([2, 3]), new Float32Array([4, 5])], + [new Float32Array([6, 7]), new Float32Array([8, 9])], ]; const originalResult = originalKernel(a); assert.deepEqual(originalResult, expected); const kernelString = originalKernel.toString(a); - const newKernel = new Function('return ' + kernelString)()({ context }) + const newKernel = new Function('return ' + kernelString)()({ context }); const newResult = newKernel(a); assert.deepEqual(newResult, expected); @@ -53,17 +50,11 @@ function testArgument(mode, context, canvas) { [ [1, 1], [1, 1], - ] + ], ]; const expected2 = [ - [ - new Float32Array([2, 2]), - new Float32Array([2, 2]), - ], - [ - new Float32Array([2, 2]), - new Float32Array([2, 2]), - ] + [new Float32Array([2, 2]), new Float32Array([2, 2])], + [new Float32Array([2, 2]), new Float32Array([2, 2])], ]; const newResult2 = newKernel(b); assert.deepEqual(newResult2, expected2); diff --git a/test/features/to-string/precision/single/arguments/array2d3.js b/test/features/to-string/precision/single/arguments/array2d3.js index 3d2fb874..0f1e4b94 100644 --- a/test/features/to-string/precision/single/arguments/array2d3.js +++ b/test/features/to-string/precision/single/arguments/array2d3.js @@ -5,19 +5,22 @@ describe('feature: to-string single precision arguments Array2D(3)'); function testArgument(mode, context, canvas) { const gpu = new GPU({ mode }); - const originalKernel = gpu.createKernel(function(a) { - const array3 = a[this.thread.y][this.thread.x]; - return [array3[0] + 1, array3[1] + 1, array3[2] + 1]; - }, { - canvas, - context, - output: [2,2], - precision: 'single', - dynamicOutput: true, - argumentTypes: { - a: 'Array2D(3)' + const originalKernel = gpu.createKernel( + function (a) { + const array3 = a[this.thread.y][this.thread.x]; + return [array3[0] + 1, array3[1] + 1, array3[2] + 1]; + }, + { + canvas, + context, + output: [2, 2], + precision: 'single', + dynamicOutput: true, + argumentTypes: { + a: 'Array2D(3)', + }, } - }); + ); const a = [ [ @@ -27,22 +30,16 @@ function testArgument(mode, context, canvas) { [ [7, 8, 9], [10, 11, 12], - ] + ], ]; const expected = [ - [ - new Float32Array([2, 3, 4]), - new Float32Array([5, 6, 7]), - ], - [ - new Float32Array([8, 9, 10]), - new Float32Array([11, 12, 13]), - ] + [new Float32Array([2, 3, 4]), new Float32Array([5, 6, 7])], + [new Float32Array([8, 9, 10]), new Float32Array([11, 12, 13])], ]; const originalResult = originalKernel(a); assert.deepEqual(originalResult, expected); const kernelString = originalKernel.toString(a); - const newKernel = new Function('return ' + kernelString)()({ context }) + const newKernel = new Function('return ' + kernelString)()({ context }); const newResult = newKernel(a); assert.deepEqual(newResult, expected); @@ -54,17 +51,11 @@ function testArgument(mode, context, canvas) { [ [1, 1, 1], [1, 1, 1], - ] + ], ]; const expected2 = [ - [ - new Float32Array([2, 2, 2]), - new Float32Array([2, 2, 2]), - ], - [ - new Float32Array([2, 2, 2]), - new Float32Array([2, 2, 2]), - ] + [new Float32Array([2, 2, 2]), new Float32Array([2, 2, 2])], + [new Float32Array([2, 2, 2]), new Float32Array([2, 2, 2])], ]; const newResult2 = newKernel(b); assert.deepEqual(newResult2, expected2); diff --git a/test/features/to-string/precision/single/arguments/array3.js b/test/features/to-string/precision/single/arguments/array3.js index cc982e1d..1341d4c2 100644 --- a/test/features/to-string/precision/single/arguments/array3.js +++ b/test/features/to-string/precision/single/arguments/array3.js @@ -5,18 +5,21 @@ describe('feature: to-string single precision arguments Array(3)'); function testArgument(mode, context, canvas) { const gpu = new GPU({ mode }); - const originalKernel = gpu.createKernel(function(a) { - return a; - }, { - canvas, - context, - output: [1], - precision: 'single', - argumentTypes: { a: 'Array(3)' } - }); + const originalKernel = gpu.createKernel( + function (a) { + return a; + }, + { + canvas, + context, + output: [1], + precision: 'single', + argumentTypes: { a: 'Array(3)' }, + } + ); const a = new Float32Array([1, 2, 3]); - const expected = [new Float32Array([1,2,3])]; + const expected = [new Float32Array([1, 2, 3])]; const originalResult = originalKernel(a); assert.deepEqual(originalResult, expected); const kernelString = originalKernel.toString(a); @@ -25,7 +28,7 @@ function testArgument(mode, context, canvas) { assert.deepEqual(newResult, expected); const b = new Float32Array([1, 1, 1]); - const expected2 = [new Float32Array([1,1,1])]; + const expected2 = [new Float32Array([1, 1, 1])]; const newResult2 = newKernel(b); assert.deepEqual(newResult2, expected2); gpu.destroy(); diff --git a/test/features/to-string/precision/single/arguments/array3d.js b/test/features/to-string/precision/single/arguments/array3d.js index 66d2a27b..fe6cc916 100644 --- a/test/features/to-string/precision/single/arguments/array3d.js +++ b/test/features/to-string/precision/single/arguments/array3d.js @@ -5,20 +5,23 @@ describe('feature: to-string single precision arguments Array3D'); function testArgument(mode, context, canvas) { const gpu = new GPU({ mode }); - const originalKernel = gpu.createKernel(function(a) { - let sum = 0; - for (let z = 0; z < 2; z++) { - for (let y = 0; y < 2; y++) { - sum += a[z][y][this.thread.x]; + const originalKernel = gpu.createKernel( + function (a) { + let sum = 0; + for (let z = 0; z < 2; z++) { + for (let y = 0; y < 2; y++) { + sum += a[z][y][this.thread.x]; + } } + return sum; + }, + { + canvas, + context, + output: [2], + precision: 'single', } - return sum; - }, { - canvas, - context, - output: [2], - precision: 'single', - }); + ); const a = [ [ @@ -28,7 +31,7 @@ function testArgument(mode, context, canvas) { [ [5, 6], [7, 8], - ] + ], ]; const expected = new Float32Array([16, 20]); const originalResult = originalKernel(a); @@ -46,7 +49,7 @@ function testArgument(mode, context, canvas) { [ [1, 1], [1, 1], - ] + ], ]; const expected2 = new Float32Array([4, 4]); const newResult2 = newKernel(b); diff --git a/test/features/to-string/precision/single/arguments/array4.js b/test/features/to-string/precision/single/arguments/array4.js index 8a3a70df..a3b9e381 100644 --- a/test/features/to-string/precision/single/arguments/array4.js +++ b/test/features/to-string/precision/single/arguments/array4.js @@ -5,18 +5,21 @@ describe('feature: to-string single precision arguments Array(4)'); function testArgument(mode, context, canvas) { const gpu = new GPU({ mode }); - const originalKernel = gpu.createKernel(function(a) { - return a; - }, { - canvas, - context, - output: [1], - precision: 'single', - argumentTypes: { a: 'Array(4)' } - }); + const originalKernel = gpu.createKernel( + function (a) { + return a; + }, + { + canvas, + context, + output: [1], + precision: 'single', + argumentTypes: { a: 'Array(4)' }, + } + ); const a = new Float32Array([1, 2, 3, 4]); - const expected = [new Float32Array([1,2,3,4])]; + const expected = [new Float32Array([1, 2, 3, 4])]; const originalResult = originalKernel(a); assert.deepEqual(originalResult, expected); const kernelString = originalKernel.toString(a); @@ -25,7 +28,7 @@ function testArgument(mode, context, canvas) { assert.deepEqual(newResult, expected); const b = new Float32Array([1, 1, 1, 1]); - const expected2 = [new Float32Array([1,1,1,1])]; + const expected2 = [new Float32Array([1, 1, 1, 1])]; const newResult2 = newKernel(b); assert.deepEqual(newResult2, expected2); gpu.destroy(); diff --git a/test/features/to-string/precision/single/arguments/boolean.js b/test/features/to-string/precision/single/arguments/boolean.js index 3ae322a0..eeb65a52 100644 --- a/test/features/to-string/precision/single/arguments/boolean.js +++ b/test/features/to-string/precision/single/arguments/boolean.js @@ -5,14 +5,17 @@ describe('feature: to-string single precision arguments Boolean'); function testArgument(mode, context, canvas) { const gpu = new GPU({ mode }); - const originalKernel = gpu.createKernel(function(a) { - return a ? 42 : -42; - }, { - canvas, - context, - output: [1], - precision: 'single', - }); + const originalKernel = gpu.createKernel( + function (a) { + return a ? 42 : -42; + }, + { + canvas, + context, + output: [1], + precision: 'single', + } + ); assert.deepEqual(originalKernel(true)[0], 42); assert.deepEqual(originalKernel(false)[0], -42); const kernelString = originalKernel.toString(true); diff --git a/test/features/to-string/precision/single/arguments/float.js b/test/features/to-string/precision/single/arguments/float.js index 3fd99e9f..f6ef9ec0 100644 --- a/test/features/to-string/precision/single/arguments/float.js +++ b/test/features/to-string/precision/single/arguments/float.js @@ -5,15 +5,18 @@ describe('feature: to-string single precision arguments Float'); function testArgument(mode, context, canvas) { const gpu = new GPU({ mode }); - const originalKernel = gpu.createKernel(function(a) { - return Math.floor(a) === 100 ? 42 : -42; - }, { - canvas, - context, - output: [1], - precision: 'single', - argumentTypes: { a: 'Float' }, - }); + const originalKernel = gpu.createKernel( + function (a) { + return Math.floor(a) === 100 ? 42 : -42; + }, + { + canvas, + context, + output: [1], + precision: 'single', + argumentTypes: { a: 'Float' }, + } + ); assert.equal(originalKernel.argumentTypes[0], 'Float'); assert.deepEqual(originalKernel(100)[0], 42); assert.deepEqual(originalKernel(10)[0], -42); diff --git a/test/features/to-string/precision/single/arguments/html-canvas.js b/test/features/to-string/precision/single/arguments/html-canvas.js index 039f1622..2841ced6 100644 --- a/test/features/to-string/precision/single/arguments/html-canvas.js +++ b/test/features/to-string/precision/single/arguments/html-canvas.js @@ -7,21 +7,27 @@ describe('feature: to-string single precision arguments HTMLCanvas'); function testArgument(mode, done) { const canvasInput1 = greenCanvas(mode, 1, 1); const canvasInput2 = greenCanvas(mode, 1, 1); - const gpu = new GPU({mode}); - const originalKernel = gpu.createKernel(function (canvas1, canvas2) { - const pixel1 = canvas1[this.thread.y][this.thread.x]; - const pixel2 = canvas2[this.thread.y][this.thread.x]; - return pixel1[1] + pixel2[1]; - }, { - output: [1], - precision: 'single', - argumentTypes: ['HTMLCanvas', 'HTMLCanvas'], - }); + const gpu = new GPU({ mode }); + const originalKernel = gpu.createKernel( + function (canvas1, canvas2) { + const pixel1 = canvas1[this.thread.y][this.thread.x]; + const pixel2 = canvas2[this.thread.y][this.thread.x]; + return pixel1[1] + pixel2[1]; + }, + { + output: [1], + precision: 'single', + argumentTypes: ['HTMLCanvas', 'HTMLCanvas'], + } + ); const canvas = originalKernel.canvas; const context = originalKernel.context; assert.deepEqual(originalKernel(canvasInput1, canvasInput2)[0], 2); const kernelString = originalKernel.toString(canvasInput1, canvasInput2); - const newKernel = new Function('return ' + kernelString)()({context, canvas}); + const newKernel = new Function('return ' + kernelString)()({ + context, + canvas, + }); const canvasInput3 = greenCanvas(mode, 1, 1); const canvasInput4 = greenCanvas(mode, 1, 1); assert.deepEqual(newKernel(canvasInput3, canvasInput4)[0], 2); @@ -35,5 +41,3 @@ function testArgument(mode, done) { (GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('webgl2', () => { testArgument('webgl2'); }); - - diff --git a/test/features/to-string/precision/single/arguments/html-image-array.js b/test/features/to-string/precision/single/arguments/html-image-array.js index 2d2a2fe3..43a835ad 100644 --- a/test/features/to-string/precision/single/arguments/html-image-array.js +++ b/test/features/to-string/precision/single/arguments/html-image-array.js @@ -4,50 +4,54 @@ const { GPU, CPUKernel } = require('../../../../../../src'); describe('feature: to-string single precision arguments HTMLImageArray'); function testArgument(mode, done) { - loadImages([ - 'jellyfish-1.jpeg', - 'jellyfish-2.jpeg', - 'jellyfish-3.jpeg', - 'jellyfish-4.jpeg', - ]) - .then(([image1, image2, image3, image4]) => { - const imagesArray1 = [image1, image2]; - const imagesArray2 = [image3, image4]; - const gpu = new GPU({mode}); - const originalKernel = gpu.createKernel(function (a, selection) { + loadImages(['jellyfish-1.jpeg', 'jellyfish-2.jpeg', 'jellyfish-3.jpeg', 'jellyfish-4.jpeg']).then(([image1, image2, image3, image4]) => { + const imagesArray1 = [image1, image2]; + const imagesArray2 = [image3, image4]; + const gpu = new GPU({ mode }); + const originalKernel = gpu.createKernel( + function (a, selection) { const image0 = a[0][0][0]; const image1 = a[1][0][0]; switch (selection) { - case 0: return image0.r * 255; - case 1: return image1.r * 255; - case 2: return image0.g * 255; - case 3: return image1.g * 255; + case 0: + return image0.r * 255; + case 1: + return image1.r * 255; + case 2: + return image0.g * 255; + case 3: + return image1.g * 255; } - }, { + }, + { output: [1], precision: 'single', argumentTypes: ['HTMLImageArray', 'Integer'], - }); - assert.deepEqual(originalKernel(imagesArray1, 0)[0], 172); - assert.deepEqual(originalKernel(imagesArray1, 1)[0], 255); - assert.deepEqual(originalKernel(imagesArray2, 2)[0], 87); - assert.deepEqual(originalKernel(imagesArray2, 3)[0], 110); - const kernelString = originalKernel.toString(imagesArray1, 0); - const canvas = originalKernel.canvas; - const context = originalKernel.context; - const newKernel = new Function('return ' + kernelString)()({context, canvas}); - assert.deepEqual(newKernel(imagesArray1, 0)[0], 172); - assert.deepEqual(newKernel(imagesArray1, 1)[0], 255); - assert.deepEqual(newKernel(imagesArray2, 2)[0], 87); - assert.deepEqual(newKernel(imagesArray2, 3)[0], 110); - gpu.destroy(); - done(originalKernel, newKernel); + } + ); + assert.deepEqual(originalKernel(imagesArray1, 0)[0], 172); + assert.deepEqual(originalKernel(imagesArray1, 1)[0], 255); + assert.deepEqual(originalKernel(imagesArray2, 2)[0], 87); + assert.deepEqual(originalKernel(imagesArray2, 3)[0], 110); + const kernelString = originalKernel.toString(imagesArray1, 0); + const canvas = originalKernel.canvas; + const context = originalKernel.context; + const newKernel = new Function('return ' + kernelString)()({ + context, + canvas, }); + assert.deepEqual(newKernel(imagesArray1, 0)[0], 172); + assert.deepEqual(newKernel(imagesArray1, 1)[0], 255); + assert.deepEqual(newKernel(imagesArray2, 2)[0], 87); + assert.deepEqual(newKernel(imagesArray2, 3)[0], 110); + gpu.destroy(); + done(originalKernel, newKernel); + }); } (GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('webgl', t => { const done = t.async(); - testArgument('webgl', (kernel) => { + testArgument('webgl', kernel => { // They aren't supported, so test that kernel falls back assert.equal(kernel.kernel.constructor, CPUKernel); done(); diff --git a/test/features/to-string/precision/single/arguments/html-image.js b/test/features/to-string/precision/single/arguments/html-image.js index d28f811b..7683099d 100644 --- a/test/features/to-string/precision/single/arguments/html-image.js +++ b/test/features/to-string/precision/single/arguments/html-image.js @@ -4,27 +4,32 @@ const { GPU } = require('../../../../../../src'); describe('feature: to-string single precision arguments HTMLImage'); function testArgument(mode, done) { - loadImages(['jellyfish-1.jpeg', 'jellyfish-2.jpeg']) - .then(([image1, image2]) => { - const gpu = new GPU({mode}); - const originalKernel = gpu.createKernel(function (a) { + loadImages(['jellyfish-1.jpeg', 'jellyfish-2.jpeg']).then(([image1, image2]) => { + const gpu = new GPU({ mode }); + const originalKernel = gpu.createKernel( + function (a) { const pixel = a[0][0]; return pixel.b * 255; - }, { + }, + { output: [1], precision: 'single', argumentTypes: ['HTMLImage'], - }); - const canvas = originalKernel.canvas; - const context = originalKernel.context; - assert.deepEqual(originalKernel(image1)[0], 253); - const kernelString = originalKernel.toString(image1); - const newKernel = new Function('return ' + kernelString)()({context, canvas}); - assert.deepEqual(newKernel(image1)[0], 253); - assert.deepEqual(newKernel(image2)[0], 255); - gpu.destroy(); - done(); + } + ); + const canvas = originalKernel.canvas; + const context = originalKernel.context; + assert.deepEqual(originalKernel(image1)[0], 253); + const kernelString = originalKernel.toString(image1); + const newKernel = new Function('return ' + kernelString)()({ + context, + canvas, }); + assert.deepEqual(newKernel(image1)[0], 253); + assert.deepEqual(newKernel(image2)[0], 255); + gpu.destroy(); + done(); + }); } (GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('webgl', t => { @@ -34,5 +39,3 @@ function testArgument(mode, done) { (GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('webgl2', t => { testArgument('webgl2', t.async()); }); - - diff --git a/test/features/to-string/precision/single/arguments/html-video.js b/test/features/to-string/precision/single/arguments/html-video.js index be1a938f..40b62ec3 100644 --- a/test/features/to-string/precision/single/arguments/html-video.js +++ b/test/features/to-string/precision/single/arguments/html-video.js @@ -7,28 +7,34 @@ function testArgument(mode, done) { const video = document.createElement('video'); video.currentTime = 2; video.src = 'jellyfish.webm'; - video.oncanplay = (e) => { + video.oncanplay = e => { video.oncanplay = null; setTimeout(() => { - const gpu = new GPU({mode}); - const originalKernel = gpu.createKernel(function (a) { - const pixel = a[0][0]; - return pixel.g * 255; - }, { - output: [1], - precision: 'single', - argumentTypes: ['HTMLVideo'], - }); + const gpu = new GPU({ mode }); + const originalKernel = gpu.createKernel( + function (a) { + const pixel = a[0][0]; + return pixel.g * 255; + }, + { + output: [1], + precision: 'single', + argumentTypes: ['HTMLVideo'], + } + ); const canvas = originalKernel.canvas; const context = originalKernel.context; assert.deepEqual(originalKernel(video)[0], 125); const kernelString = originalKernel.toString(video); - const newKernel = new Function('return ' + kernelString)()({context, canvas}); + const newKernel = new Function('return ' + kernelString)()({ + context, + canvas, + }); assert.deepEqual(newKernel(video)[0], 125); gpu.destroy(); done(); }, 1000); - } + }; } (GPU.isWebGLSupported ? test : skip)('webgl', t => { @@ -38,5 +44,3 @@ function testArgument(mode, done) { (GPU.isWebGL2Supported ? test : skip)('webgl2', t => { testArgument('webgl2', t.async()); }); - - diff --git a/test/features/to-string/precision/single/arguments/input.js b/test/features/to-string/precision/single/arguments/input.js index 0b87a66a..bcd39430 100644 --- a/test/features/to-string/precision/single/arguments/input.js +++ b/test/features/to-string/precision/single/arguments/input.js @@ -5,22 +5,25 @@ describe('feature: to-string single precision arguments Input'); function testArgument(mode, context, canvas) { const gpu = new GPU({ mode }); - const originalKernel = gpu.createKernel(function(a) { - let sum = 0; - for (let y = 0; y < 2; y++) { - for (let x = 0; x < 2; x++) { - sum += a[y][x]; + const originalKernel = gpu.createKernel( + function (a) { + let sum = 0; + for (let y = 0; y < 2; y++) { + for (let x = 0; x < 2; x++) { + sum += a[y][x]; + } } + return sum; + }, + { + canvas, + context, + output: [1], + precision: 'single', } - return sum; - }, { - canvas, - context, - output: [1], - precision: 'single', - }); - const arg1 = input([1,2,3,4],[2,2]); - const arg2 = input([5,6,7,8],[2,2]); + ); + const arg1 = input([1, 2, 3, 4], [2, 2]); + const arg2 = input([5, 6, 7, 8], [2, 2]); assert.deepEqual(originalKernel(arg1)[0], 10); assert.deepEqual(originalKernel(arg2)[0], 26); const kernelString = originalKernel.toString(arg1); diff --git a/test/features/to-string/precision/single/arguments/integer.js b/test/features/to-string/precision/single/arguments/integer.js index f787e503..f18e434d 100644 --- a/test/features/to-string/precision/single/arguments/integer.js +++ b/test/features/to-string/precision/single/arguments/integer.js @@ -5,15 +5,18 @@ describe('feature: to-string single precision arguments Integer'); function testArgument(mode, context, canvas) { const gpu = new GPU({ mode }); - const originalKernel = gpu.createKernel(function(a) { - return Math.floor(a) === 100 ? 42 : -42; - }, { - canvas, - context, - output: [1], - precision: 'single', - argumentTypes: { a: 'Integer' }, - }); + const originalKernel = gpu.createKernel( + function (a) { + return Math.floor(a) === 100 ? 42 : -42; + }, + { + canvas, + context, + output: [1], + precision: 'single', + argumentTypes: { a: 'Integer' }, + } + ); assert.equal(originalKernel.argumentTypes[0], 'Integer'); assert.deepEqual(originalKernel(100)[0], 42); assert.deepEqual(originalKernel(10)[0], -42); diff --git a/test/features/to-string/precision/single/arguments/memory-optimized-number-texture.js b/test/features/to-string/precision/single/arguments/memory-optimized-number-texture.js index b8e59340..10428c8e 100644 --- a/test/features/to-string/precision/single/arguments/memory-optimized-number-texture.js +++ b/test/features/to-string/precision/single/arguments/memory-optimized-number-texture.js @@ -5,37 +5,46 @@ describe('feature: to-string single precision arguments MemoryOptimizedNumberTex function testArgument(mode, context, canvas) { const gpu = new GPU({ mode, context, canvas }); - const texture1 = gpu.createKernel(function() { - return this.thread.x; - }, { - output: [4], - optimizeFloatMemory: true, - precision: 'single', - pipeline: true, - })(); - const texture2 = gpu.createKernel(function() { - return 4 - this.thread.x; - }, { - output: [4], - optimizeFloatMemory: true, - precision: 'single', - pipeline: true, - })(); - const originalKernel = gpu.createKernel(function(a) { - return a[this.thread.x]; - }, { - canvas, - context, - output: [4], - precision: 'single' - }); - assert.deepEqual(originalKernel(texture1), new Float32Array([0,1,2,3])); - assert.deepEqual(originalKernel(texture2), new Float32Array([4,3,2,1])); + const texture1 = gpu.createKernel( + function () { + return this.thread.x; + }, + { + output: [4], + optimizeFloatMemory: true, + precision: 'single', + pipeline: true, + } + )(); + const texture2 = gpu.createKernel( + function () { + return 4 - this.thread.x; + }, + { + output: [4], + optimizeFloatMemory: true, + precision: 'single', + pipeline: true, + } + )(); + const originalKernel = gpu.createKernel( + function (a) { + return a[this.thread.x]; + }, + { + canvas, + context, + output: [4], + precision: 'single', + } + ); + assert.deepEqual(originalKernel(texture1), new Float32Array([0, 1, 2, 3])); + assert.deepEqual(originalKernel(texture2), new Float32Array([4, 3, 2, 1])); const kernelString = originalKernel.toString(texture1); const newKernel = new Function('return ' + kernelString)()({ context }); - assert.deepEqual(newKernel(texture1), new Float32Array([0,1,2,3])); - assert.deepEqual(newKernel(texture2), new Float32Array([4,3,2,1])); + assert.deepEqual(newKernel(texture1), new Float32Array([0, 1, 2, 3])); + assert.deepEqual(newKernel(texture2), new Float32Array([4, 3, 2, 1])); gpu.destroy(); } diff --git a/test/features/to-string/precision/single/arguments/number-texture.js b/test/features/to-string/precision/single/arguments/number-texture.js index 36b80b5c..53fd2e1d 100644 --- a/test/features/to-string/precision/single/arguments/number-texture.js +++ b/test/features/to-string/precision/single/arguments/number-texture.js @@ -5,37 +5,46 @@ describe('feature: to-string single precision arguments NumberTexture'); function testArgument(mode, context, canvas) { const gpu = new GPU({ mode, context, canvas }); - const texture1 = gpu.createKernel(function() { - return this.thread.x; - }, { - output: [4], - optimizeFloatMemory: false, - precision: 'single', - pipeline: true, - })(); - const texture2 = gpu.createKernel(function() { - return 4 - this.thread.x; - }, { - output: [4], - optimizeFloatMemory: false, - precision: 'single', - pipeline: true, - })(); - const originalKernel = gpu.createKernel(function(a) { - return a[this.thread.x]; - }, { - canvas, - context, - output: [4], - precision: 'single' - }); - assert.deepEqual(originalKernel(texture1), new Float32Array([0,1,2,3])); - assert.deepEqual(originalKernel(texture2), new Float32Array([4,3,2,1])); + const texture1 = gpu.createKernel( + function () { + return this.thread.x; + }, + { + output: [4], + optimizeFloatMemory: false, + precision: 'single', + pipeline: true, + } + )(); + const texture2 = gpu.createKernel( + function () { + return 4 - this.thread.x; + }, + { + output: [4], + optimizeFloatMemory: false, + precision: 'single', + pipeline: true, + } + )(); + const originalKernel = gpu.createKernel( + function (a) { + return a[this.thread.x]; + }, + { + canvas, + context, + output: [4], + precision: 'single', + } + ); + assert.deepEqual(originalKernel(texture1), new Float32Array([0, 1, 2, 3])); + assert.deepEqual(originalKernel(texture2), new Float32Array([4, 3, 2, 1])); const kernelString = originalKernel.toString(texture1); const newKernel = new Function('return ' + kernelString)()({ context }); - assert.deepEqual(newKernel(texture1), new Float32Array([0,1,2,3])); - assert.deepEqual(newKernel(texture2), new Float32Array([4,3,2,1])); + assert.deepEqual(newKernel(texture1), new Float32Array([0, 1, 2, 3])); + assert.deepEqual(newKernel(texture2), new Float32Array([4, 3, 2, 1])); gpu.destroy(); } diff --git a/test/features/to-string/precision/single/constants/array.js b/test/features/to-string/precision/single/constants/array.js index 876d39ad..520af2c8 100644 --- a/test/features/to-string/precision/single/constants/array.js +++ b/test/features/to-string/precision/single/constants/array.js @@ -5,26 +5,35 @@ describe('feature: to-string single precision constants Array'); function testConstant(mode, context, canvas) { const gpu = new GPU({ mode }); - const originalKernel = gpu.createKernel(function() { - return this.constants.a[this.thread.x]; - }, { - canvas, - context, - output: [4], - precision: 'single', - constants: { - a: [1, 2, 3, 4] + const originalKernel = gpu.createKernel( + function () { + return this.constants.a[this.thread.x]; + }, + { + canvas, + context, + output: [4], + precision: 'single', + constants: { + a: [1, 2, 3, 4], + }, } - }); - const expected = new Float32Array([1,2,3,4]); + ); + const expected = new Float32Array([1, 2, 3, 4]); const originalResult = originalKernel(); assert.deepEqual(originalResult, expected); const kernelString = originalKernel.toString(); - const newResult = new Function('return ' + kernelString)()({ context, constants: { a: [1, 2, 3, 4] } })(); + const newResult = new Function('return ' + kernelString)()({ + context, + constants: { a: [1, 2, 3, 4] }, + })(); assert.deepEqual(newResult, expected); - const expected2 = new Float32Array([4,3,2,1]); - const newResult2 = new Function('return ' + kernelString)()({ context, constants: { a: [4, 3, 2, 1] } })(); + const expected2 = new Float32Array([4, 3, 2, 1]); + const newResult2 = new Function('return ' + kernelString)()({ + context, + constants: { a: [4, 3, 2, 1] }, + })(); assert.deepEqual(newResult2, expected2); gpu.destroy(); } diff --git a/test/features/to-string/precision/single/constants/array2.js b/test/features/to-string/precision/single/constants/array2.js index 3e548306..f219178d 100644 --- a/test/features/to-string/precision/single/constants/array2.js +++ b/test/features/to-string/precision/single/constants/array2.js @@ -5,30 +5,39 @@ describe('feature: to-string single precision constants Array(2)'); function testConstant(mode, context, canvas) { const gpu = new GPU({ mode }); - const originalKernel = gpu.createKernel(function() { - return this.constants.a; - }, { - canvas, - context, - output: [1], - precision: 'single', - constants: { - a: new Float32Array([1, 2]) + const originalKernel = gpu.createKernel( + function () { + return this.constants.a; }, - constantTypes: { - a: 'Array(2)' + { + canvas, + context, + output: [1], + precision: 'single', + constants: { + a: new Float32Array([1, 2]), + }, + constantTypes: { + a: 'Array(2)', + }, } - }); + ); const expected = [new Float32Array([1, 2])]; const originalResult = originalKernel(); assert.deepEqual(originalResult, expected); const kernelString = originalKernel.toString(); const Kernel = new Function('return ' + kernelString)(); - const newResult = Kernel({ context, constants: { a: new Float32Array([1, 2]) } })(); + const newResult = Kernel({ + context, + constants: { a: new Float32Array([1, 2]) }, + })(); assert.deepEqual(newResult, expected); // Array(2) is "sticky" as a constant, and cannot reset - const newResult2 = Kernel({ context, constants: { a: new Float32Array([2, 1]) } })(); + const newResult2 = Kernel({ + context, + constants: { a: new Float32Array([2, 1]) }, + })(); assert.deepEqual(newResult2, expected); gpu.destroy(); } diff --git a/test/features/to-string/precision/single/constants/array2d.js b/test/features/to-string/precision/single/constants/array2d.js index c48af645..89258dc4 100644 --- a/test/features/to-string/precision/single/constants/array2d.js +++ b/test/features/to-string/precision/single/constants/array2d.js @@ -11,22 +11,25 @@ function testConstant(mode, context, canvas) { [9, 10, 11, 12], [13, 14, 15, 16], ]; - const originalKernel = gpu.createKernel(function() { - let sum = 0; - for (let y = 0; y < 4; y++) { - sum += this.constants.a[y][this.thread.x]; + const originalKernel = gpu.createKernel( + function () { + let sum = 0; + for (let y = 0; y < 4; y++) { + sum += this.constants.a[y][this.thread.x]; + } + return sum; + }, + { + canvas, + context, + output: [4], + precision: 'single', + constants: { + a, + }, } - return sum; - }, { - canvas, - context, - output: [4], - precision: 'single', - constants: { - a - } - }); - const expected = new Float32Array([28,32,36,40]); + ); + const expected = new Float32Array([28, 32, 36, 40]); const originalResult = originalKernel(); assert.deepEqual(originalResult, expected); const kernelString = originalKernel.toString(); @@ -40,7 +43,7 @@ function testConstant(mode, context, canvas) { [1, 1, 1, 1], [1, 1, 1, 1], ]; - const expected2 = new Float32Array([4,4,4,4]); + const expected2 = new Float32Array([4, 4, 4, 4]); const newResult2 = Kernel({ context, constants: { a: b } })(); assert.deepEqual(newResult2, expected2); gpu.destroy(); diff --git a/test/features/to-string/precision/single/constants/array3.js b/test/features/to-string/precision/single/constants/array3.js index e1aee848..a22f15fe 100644 --- a/test/features/to-string/precision/single/constants/array3.js +++ b/test/features/to-string/precision/single/constants/array3.js @@ -5,30 +5,39 @@ describe('feature: to-string single precision constants Array(3)'); function testConstant(mode, context, canvas) { const gpu = new GPU({ mode }); - const originalKernel = gpu.createKernel(function() { - return this.constants.a; - }, { - canvas, - context, - output: [1], - precision: 'single', - constants: { - a: new Float32Array([1, 2, 3]) + const originalKernel = gpu.createKernel( + function () { + return this.constants.a; }, - constantTypes: { - a: 'Array(3)' + { + canvas, + context, + output: [1], + precision: 'single', + constants: { + a: new Float32Array([1, 2, 3]), + }, + constantTypes: { + a: 'Array(3)', + }, } - }); + ); const expected = [new Float32Array([1, 2, 3])]; const originalResult = originalKernel(); assert.deepEqual(originalResult, expected); const kernelString = originalKernel.toString(); const Kernel = new Function('return ' + kernelString)(); - const newResult = Kernel({ context, constants: { a: new Float32Array([1, 2, 3]) } })(); + const newResult = Kernel({ + context, + constants: { a: new Float32Array([1, 2, 3]) }, + })(); assert.deepEqual(newResult, expected); // Array(3) is "sticky" as a constant, and cannot reset - const newResult2 = Kernel({ context, constants: { a: new Float32Array([3, 2, 1]) } })(); + const newResult2 = Kernel({ + context, + constants: { a: new Float32Array([3, 2, 1]) }, + })(); assert.deepEqual(newResult2, expected); gpu.destroy(); } diff --git a/test/features/to-string/precision/single/constants/array3d.js b/test/features/to-string/precision/single/constants/array3d.js index 784ad56d..2e92f7bb 100644 --- a/test/features/to-string/precision/single/constants/array3d.js +++ b/test/features/to-string/precision/single/constants/array3d.js @@ -13,25 +13,28 @@ function testConstant(mode, context, canvas) { [ [5, 6], [7, 8], - ] + ], ]; - const originalKernel = gpu.createKernel(function() { - let sum = 0; - for (let z = 0; z < 2; z++) { - for (let y = 0; y < 2; y++) { - sum += this.constants.a[z][y][this.thread.x]; + const originalKernel = gpu.createKernel( + function () { + let sum = 0; + for (let z = 0; z < 2; z++) { + for (let y = 0; y < 2; y++) { + sum += this.constants.a[z][y][this.thread.x]; + } } + return sum; + }, + { + canvas, + context, + output: [2], + precision: 'single', + constants: { + a, + }, } - return sum; - }, { - canvas, - context, - output: [2], - precision: 'single', - constants: { - a - } - }); + ); const expected = new Float32Array([16, 20]); const originalResult = originalKernel(); @@ -41,7 +44,6 @@ function testConstant(mode, context, canvas) { const newResult = Kernel({ context, constants: { a } })(); assert.deepEqual(newResult, expected); - const b = [ [ [1, 1], @@ -50,7 +52,7 @@ function testConstant(mode, context, canvas) { [ [1, 1], [1, 1], - ] + ], ]; const newResult2 = Kernel({ context, constants: { a: b } })(); const expected2 = new Float32Array([4, 4]); diff --git a/test/features/to-string/precision/single/constants/array4.js b/test/features/to-string/precision/single/constants/array4.js index 3290d304..c32d3a4f 100644 --- a/test/features/to-string/precision/single/constants/array4.js +++ b/test/features/to-string/precision/single/constants/array4.js @@ -6,31 +6,40 @@ describe('feature: to-string single precision constants Array(4)'); function testConstant(mode, context, canvas) { const gpu = new GPU({ mode }); const a = new Float32Array([1, 2, 3, 4]); - const originalKernel = gpu.createKernel(function() { - return this.constants.a; - }, { - canvas, - context, - output: [1], - precision: 'single', - constants: { - a + const originalKernel = gpu.createKernel( + function () { + return this.constants.a; }, - constantTypes: { - a: 'Array(4)' + { + canvas, + context, + output: [1], + precision: 'single', + constants: { + a, + }, + constantTypes: { + a: 'Array(4)', + }, } - }); + ); const expected = [new Float32Array([1, 2, 3, 4])]; const originalResult = originalKernel(); assert.deepEqual(originalResult, expected); const kernelString = originalKernel.toString(); - const newResult = new Function('return ' + kernelString)()({ context, constants: { a } })(); + const newResult = new Function('return ' + kernelString)()({ + context, + constants: { a }, + })(); assert.deepEqual(newResult, expected); // Array(3) is "sticky" as a constant, and cannot reset const b = new Float32Array([4, 3, 2, 1]); const expected2 = [new Float32Array([1, 2, 3, 4])]; - const newResult2 = new Function('return ' + kernelString)()({ context, constants: { a: b } })(); + const newResult2 = new Function('return ' + kernelString)()({ + context, + constants: { a: b }, + })(); assert.deepEqual(newResult2, expected2); gpu.destroy(); } diff --git a/test/features/to-string/precision/single/constants/boolean.js b/test/features/to-string/precision/single/constants/boolean.js index a1bb6f5a..2842e584 100644 --- a/test/features/to-string/precision/single/constants/boolean.js +++ b/test/features/to-string/precision/single/constants/boolean.js @@ -5,28 +5,34 @@ describe('feature: to-string single precision constants Boolean'); function testConstant(mode, context, canvas) { const gpu = new GPU({ mode }); - const originalKernel1 = gpu.createKernel(function() { - return this.constants.a ? 42 : -42; - }, { - canvas, - context, - output: [1], - precision: 'single', - constants: { - a: true + const originalKernel1 = gpu.createKernel( + function () { + return this.constants.a ? 42 : -42; + }, + { + canvas, + context, + output: [1], + precision: 'single', + constants: { + a: true, + }, } - }); - const originalKernel2 = gpu.createKernel(function() { - return this.constants.a ? 42 : -42; - }, { - canvas, - context, - output: [1], - precision: 'single', - constants: { - a: false + ); + const originalKernel2 = gpu.createKernel( + function () { + return this.constants.a ? 42 : -42; + }, + { + canvas, + context, + output: [1], + precision: 'single', + constants: { + a: false, + }, } - }); + ); assert.deepEqual(originalKernel1()[0], 42); assert.deepEqual(originalKernel2()[0], -42); const kernelString1 = originalKernel1.toString(); diff --git a/test/features/to-string/precision/single/constants/float.js b/test/features/to-string/precision/single/constants/float.js index 551a24b4..8c9447e1 100644 --- a/test/features/to-string/precision/single/constants/float.js +++ b/test/features/to-string/precision/single/constants/float.js @@ -5,18 +5,21 @@ describe('feature: to-string single precision constants Float'); function testConstant(mode, context, canvas) { const gpu = new GPU({ mode }); - const originalKernel = gpu.createKernel(function() { - return Math.floor(this.constants.a) === 100 ? 42 : -42; - }, { - canvas, - context, - output: [1], - precision: 'single', - constants: { - a: 100 + const originalKernel = gpu.createKernel( + function () { + return Math.floor(this.constants.a) === 100 ? 42 : -42; }, - constantTypes: { a: 'Float' } - }); + { + canvas, + context, + output: [1], + precision: 'single', + constants: { + a: 100, + }, + constantTypes: { a: 'Float' }, + } + ); assert.equal(originalKernel.constantTypes.a, 'Float'); assert.deepEqual(originalKernel()[0], 42); const kernelString = originalKernel.toString(); diff --git a/test/features/to-string/precision/single/constants/html-canvas.js b/test/features/to-string/precision/single/constants/html-canvas.js index fb9eac43..ece2f052 100644 --- a/test/features/to-string/precision/single/constants/html-canvas.js +++ b/test/features/to-string/precision/single/constants/html-canvas.js @@ -7,16 +7,19 @@ describe('feature: to-string single precision constants HTMLCanvas'); function testArgument(mode, done) { const canvasInput1 = greenCanvas(mode, 1, 1); const canvasInput2 = greenCanvas(mode, 1, 1); - const gpu = new GPU({mode}); - const originalKernel = gpu.createKernel(function () { - const pixel1 = this.constants.canvas1[this.thread.y][this.thread.x]; - const pixel2 = this.constants.canvas2[this.thread.y][this.thread.x]; - return pixel1[1] + pixel2[1]; - }, { - output: [1], - precision: 'single', - constants: { canvas1: canvasInput1, canvas2: canvasInput2 } - }); + const gpu = new GPU({ mode }); + const originalKernel = gpu.createKernel( + function () { + const pixel1 = this.constants.canvas1[this.thread.y][this.thread.x]; + const pixel2 = this.constants.canvas2[this.thread.y][this.thread.x]; + return pixel1[1] + pixel2[1]; + }, + { + output: [1], + precision: 'single', + constants: { canvas1: canvasInput1, canvas2: canvasInput2 }, + } + ); const canvas = originalKernel.canvas; const context = originalKernel.context; assert.deepEqual(originalKernel()[0], 2); @@ -28,8 +31,8 @@ function testArgument(mode, done) { canvas, constants: { canvas1: canvasInput3, - canvas2: canvasInput4 - } + canvas2: canvasInput4, + }, }); assert.deepEqual(newKernel()[0], 2); gpu.destroy(); @@ -42,5 +45,3 @@ function testArgument(mode, done) { (GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('webgl2', () => { testArgument('webgl2'); }); - - diff --git a/test/features/to-string/precision/single/constants/html-image-array.js b/test/features/to-string/precision/single/constants/html-image-array.js index a7b0a3a4..d4087966 100644 --- a/test/features/to-string/precision/single/constants/html-image-array.js +++ b/test/features/to-string/precision/single/constants/html-image-array.js @@ -4,60 +4,61 @@ const { GPU, CPUKernel } = require('../../../../../../src'); describe('feature: to-string single precision constants HTMLImageArray'); function testArgument(mode, done) { - loadImages([ - 'jellyfish-1.jpeg', - 'jellyfish-2.jpeg', - 'jellyfish-3.jpeg', - 'jellyfish-4.jpeg', - ]) - .then(([image1, image2, image3, image4]) => { - const images1 = [image1, image2]; - const images2 = [image3, image4]; - const gpu = new GPU({mode}); - const originalKernel = gpu.createKernel(function (selection) { + loadImages(['jellyfish-1.jpeg', 'jellyfish-2.jpeg', 'jellyfish-3.jpeg', 'jellyfish-4.jpeg']).then(([image1, image2, image3, image4]) => { + const images1 = [image1, image2]; + const images2 = [image3, image4]; + const gpu = new GPU({ mode }); + const originalKernel = gpu.createKernel( + function (selection) { const image0 = this.constants.a[0][0][0]; const image1 = this.constants.a[1][0][0]; switch (selection) { - case 0: return image0.r * 255; - case 1: return image1.r * 255; - case 2: return image0.b * 255; - case 3: return image1.b * 255; + case 0: + return image0.r * 255; + case 1: + return image1.r * 255; + case 2: + return image0.b * 255; + case 3: + return image1.b * 255; } - }, { + }, + { output: [1], precision: 'single', argumentTypes: ['Integer'], constants: { a: images1, - } - }); - assert.deepEqual(originalKernel(0)[0], 172); - assert.deepEqual(originalKernel(1)[0], 255); - assert.deepEqual(originalKernel(2)[0], 253); - assert.deepEqual(originalKernel(3)[0], 255); - const kernelString = originalKernel.toString(0); - const canvas = originalKernel.canvas; - const context = originalKernel.context; - const Kernel = new Function('return ' + kernelString)(); - const newKernel1 = Kernel({context, canvas, constants: { a: images1 }}); - assert.deepEqual(newKernel1(0)[0], 172); - assert.deepEqual(newKernel1(1)[0], 255); - assert.deepEqual(newKernel1(2)[0], 253); - assert.deepEqual(newKernel1(3)[0], 255); + }, + } + ); + assert.deepEqual(originalKernel(0)[0], 172); + assert.deepEqual(originalKernel(1)[0], 255); + assert.deepEqual(originalKernel(2)[0], 253); + assert.deepEqual(originalKernel(3)[0], 255); + const kernelString = originalKernel.toString(0); + const canvas = originalKernel.canvas; + const context = originalKernel.context; + const Kernel = new Function('return ' + kernelString)(); + const newKernel1 = Kernel({ context, canvas, constants: { a: images1 } }); + assert.deepEqual(newKernel1(0)[0], 172); + assert.deepEqual(newKernel1(1)[0], 255); + assert.deepEqual(newKernel1(2)[0], 253); + assert.deepEqual(newKernel1(3)[0], 255); - const newKernel2 = Kernel({context, canvas, constants: { a: images2 }}); - assert.deepEqual(newKernel2(0)[0], 0); - assert.deepEqual(newKernel2(1)[0], 73); - assert.deepEqual(newKernel2(2)[0], 255); - assert.deepEqual(newKernel2(3)[0], 253); - gpu.destroy(); - done(originalKernel, newKernel1); - }); + const newKernel2 = Kernel({ context, canvas, constants: { a: images2 } }); + assert.deepEqual(newKernel2(0)[0], 0); + assert.deepEqual(newKernel2(1)[0], 73); + assert.deepEqual(newKernel2(2)[0], 255); + assert.deepEqual(newKernel2(3)[0], 253); + gpu.destroy(); + done(originalKernel, newKernel1); + }); } (GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('webgl', t => { const done = t.async(); - testArgument('webgl', (kernel) => { + testArgument('webgl', kernel => { // They aren't supported, so test that kernel falls back assert.equal(kernel.kernel.constructor, CPUKernel); done(); diff --git a/test/features/to-string/precision/single/constants/html-image.js b/test/features/to-string/precision/single/constants/html-image.js index 0da4574f..831488c3 100644 --- a/test/features/to-string/precision/single/constants/html-image.js +++ b/test/features/to-string/precision/single/constants/html-image.js @@ -4,26 +4,32 @@ const { GPU } = require('../../../../../../src'); describe('feature: to-string single precision constants HTMLImage'); function testArgument(mode, done) { - loadImages(['jellyfish-1.jpeg', 'jellyfish-2.jpeg']) - .then(([image1, image2]) => { - const gpu = new GPU({mode}); - const originalKernel = gpu.createKernel(function () { + loadImages(['jellyfish-1.jpeg', 'jellyfish-2.jpeg']).then(([image1, image2]) => { + const gpu = new GPU({ mode }); + const originalKernel = gpu.createKernel( + function () { const pixel = this.constants.a[0][0]; return pixel.b * 255; - }, { + }, + { output: [1], precision: 'single', - constants: { a: image1 } - }); - const canvas = originalKernel.canvas; - const context = originalKernel.context; - assert.deepEqual(originalKernel()[0], 253); - const kernelString = originalKernel.toString(); - const newKernel = new Function('return ' + kernelString)()({context, canvas, constants: { a: image2 } }); - assert.deepEqual(newKernel(image2)[0], 255); - gpu.destroy(); - done(); + constants: { a: image1 }, + } + ); + const canvas = originalKernel.canvas; + const context = originalKernel.context; + assert.deepEqual(originalKernel()[0], 253); + const kernelString = originalKernel.toString(); + const newKernel = new Function('return ' + kernelString)()({ + context, + canvas, + constants: { a: image2 }, }); + assert.deepEqual(newKernel(image2)[0], 255); + gpu.destroy(); + done(); + }); } (GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('webgl', t => { @@ -37,5 +43,3 @@ function testArgument(mode, done) { (GPU.isSinglePrecisionSupported && (GPU.isWebGLSupported || GPU.isWebGL2Supported) ? test : skip)('cpu', t => { testArgument('cpu', t.async()); }); - - diff --git a/test/features/to-string/precision/single/constants/input.js b/test/features/to-string/precision/single/constants/input.js index 7f600bad..6d0fc039 100644 --- a/test/features/to-string/precision/single/constants/input.js +++ b/test/features/to-string/precision/single/constants/input.js @@ -5,31 +5,34 @@ describe('feature: to-string single precision constants Input'); function testConstant(mode, context, canvas) { const gpu = new GPU({ mode }); - const a = input([1,2,3,4],[2,2]); - const originalKernel = gpu.createKernel(function() { - let sum = 0; - for (let y = 0; y < 2; y++) { - for (let x = 0; x < 2; x++) { - sum += this.constants.a[y][x]; + const a = input([1, 2, 3, 4], [2, 2]); + const originalKernel = gpu.createKernel( + function () { + let sum = 0; + for (let y = 0; y < 2; y++) { + for (let x = 0; x < 2; x++) { + sum += this.constants.a[y][x]; + } } + return sum; + }, + { + canvas, + context, + output: [1], + precision: 'single', + constants: { + a, + }, } - return sum; - }, { - canvas, - context, - output: [1], - precision: 'single', - constants: { - a - } - }); + ); assert.deepEqual(originalKernel()[0], 10); const kernelString = originalKernel.toString(); const Kernel = new Function('return ' + kernelString)(); const newKernel = Kernel({ context, constants: { a } }); assert.deepEqual(newKernel()[0], 10); - const b = input([1,1,1,1],[2,2]); + const b = input([1, 1, 1, 1], [2, 2]); const newKernel2 = Kernel({ context, constants: { a: b } }); assert.deepEqual(newKernel2()[0], 4); gpu.destroy(); diff --git a/test/features/to-string/precision/single/constants/integer.js b/test/features/to-string/precision/single/constants/integer.js index aaae2d20..68d97009 100644 --- a/test/features/to-string/precision/single/constants/integer.js +++ b/test/features/to-string/precision/single/constants/integer.js @@ -5,18 +5,21 @@ describe('feature: to-string single precision constants Integer'); function testConstant(mode, context, canvas) { const gpu = new GPU({ mode }); - const originalKernel = gpu.createKernel(function() { - return Math.floor(this.constants.a) === 100 ? 42 : -42; - }, { - canvas, - context, - output: [1], - precision: 'single', - constants: { - a: 100 + const originalKernel = gpu.createKernel( + function () { + return Math.floor(this.constants.a) === 100 ? 42 : -42; }, - constantTypes: { a: 'Integer' } - }); + { + canvas, + context, + output: [1], + precision: 'single', + constants: { + a: 100, + }, + constantTypes: { a: 'Integer' }, + } + ); assert.equal(originalKernel.constantTypes.a, 'Integer'); assert.deepEqual(originalKernel()[0], 42); const kernelString = originalKernel.toString(); diff --git a/test/features/to-string/precision/single/constants/memory-optimized-number-texture.js b/test/features/to-string/precision/single/constants/memory-optimized-number-texture.js index 9f996df6..cf4d5020 100644 --- a/test/features/to-string/precision/single/constants/memory-optimized-number-texture.js +++ b/test/features/to-string/precision/single/constants/memory-optimized-number-texture.js @@ -5,40 +5,49 @@ describe('feature: to-string single precision constants MemoryOptimizedNumberTex function testConstant(mode, context, canvas) { const gpu = new GPU({ mode, context, canvas }); - const texture = gpu.createKernel(function() { - return this.thread.x; - }, { - output: [4], - optimizeFloatMemory: true, - precision: 'single', - pipeline: true, - })(); - const texture2 = gpu.createKernel(function() { - return this.output.x - this.thread.x; - }, { - output: [4], - optimizeFloatMemory: true, - precision: 'single', - pipeline: true, - })(); - const originalKernel = gpu.createKernel(function() { - return this.constants.a[this.thread.x]; - }, { - output: [4], - precision: 'single', - constants: { - a: texture + const texture = gpu.createKernel( + function () { + return this.thread.x; + }, + { + output: [4], + optimizeFloatMemory: true, + precision: 'single', + pipeline: true, } - }); - assert.deepEqual(originalKernel(), new Float32Array([0,1,2,3])); + )(); + const texture2 = gpu.createKernel( + function () { + return this.output.x - this.thread.x; + }, + { + output: [4], + optimizeFloatMemory: true, + precision: 'single', + pipeline: true, + } + )(); + const originalKernel = gpu.createKernel( + function () { + return this.constants.a[this.thread.x]; + }, + { + output: [4], + precision: 'single', + constants: { + a: texture, + }, + } + ); + assert.deepEqual(originalKernel(), new Float32Array([0, 1, 2, 3])); const kernelString = originalKernel.toString(); const Kernel = new Function('return ' + kernelString)(); const newKernel = Kernel({ context, constants: { a: texture } }); const newKernel2 = Kernel({ context, constants: { a: texture2 } }); - assert.deepEqual(texture2.toArray ? texture2.toArray() : texture2, new Float32Array([4,3,2,1])); - assert.deepEqual(texture.toArray ? texture.toArray() : texture, new Float32Array([0,1,2,3])); - assert.deepEqual(newKernel(), new Float32Array([0,1,2,3])); - assert.deepEqual(newKernel2(), new Float32Array([4,3,2,1])); + assert.deepEqual(texture2.toArray ? texture2.toArray() : texture2, new Float32Array([4, 3, 2, 1])); + assert.deepEqual(texture.toArray ? texture.toArray() : texture, new Float32Array([0, 1, 2, 3])); + assert.deepEqual(newKernel(), new Float32Array([0, 1, 2, 3])); + assert.deepEqual(newKernel2(), new Float32Array([4, 3, 2, 1])); gpu.destroy(); } diff --git a/test/features/to-string/precision/single/constants/number-texture.js b/test/features/to-string/precision/single/constants/number-texture.js index d8829edc..fd6fd9f0 100644 --- a/test/features/to-string/precision/single/constants/number-texture.js +++ b/test/features/to-string/precision/single/constants/number-texture.js @@ -5,42 +5,51 @@ describe('feature: to-string single precision constants NumberTexture'); function testConstant(mode, context, canvas) { const gpu = new GPU({ mode, context, canvas }); - const texture = gpu.createKernel(function() { - return this.thread.x; - }, { - output: [4], - optimizeFloatMemory: false, - precision: 'single', - pipeline: true, - })(); - const texture2 = gpu.createKernel(function() { - return this.output.x - this.thread.x; - }, { - output: [4], - optimizeFloatMemory: false, - precision: 'single', - pipeline: true, - })(); - const originalKernel = gpu.createKernel(function() { - return this.constants.a[this.thread.x]; - }, { - canvas, - context, - output: [4], - precision: 'single', - constants: { - a: texture + const texture = gpu.createKernel( + function () { + return this.thread.x; + }, + { + output: [4], + optimizeFloatMemory: false, + precision: 'single', + pipeline: true, } - }); - assert.deepEqual(originalKernel(), new Float32Array([0,1,2,3])); + )(); + const texture2 = gpu.createKernel( + function () { + return this.output.x - this.thread.x; + }, + { + output: [4], + optimizeFloatMemory: false, + precision: 'single', + pipeline: true, + } + )(); + const originalKernel = gpu.createKernel( + function () { + return this.constants.a[this.thread.x]; + }, + { + canvas, + context, + output: [4], + precision: 'single', + constants: { + a: texture, + }, + } + ); + assert.deepEqual(originalKernel(), new Float32Array([0, 1, 2, 3])); const kernelString = originalKernel.toString(); const Kernel = new Function('return ' + kernelString)(); const newKernel = Kernel({ context, constants: { a: texture } }); const newKernel2 = Kernel({ context, constants: { a: texture2 } }); - assert.deepEqual(texture2.toArray ? texture2.toArray() : texture2, new Float32Array([4,3,2,1])); - assert.deepEqual(texture.toArray ? texture.toArray() : texture, new Float32Array([0,1,2,3])); - assert.deepEqual(newKernel(), new Float32Array([0,1,2,3])); - assert.deepEqual(newKernel2(), new Float32Array([4,3,2,1])); + assert.deepEqual(texture2.toArray ? texture2.toArray() : texture2, new Float32Array([4, 3, 2, 1])); + assert.deepEqual(texture.toArray ? texture.toArray() : texture, new Float32Array([0, 1, 2, 3])); + assert.deepEqual(newKernel(), new Float32Array([0, 1, 2, 3])); + assert.deepEqual(newKernel2(), new Float32Array([4, 3, 2, 1])); gpu.destroy(); } diff --git a/test/features/to-string/precision/single/graphical.js b/test/features/to-string/precision/single/graphical.js index 3d86eb7f..222b0736 100644 --- a/test/features/to-string/precision/single/graphical.js +++ b/test/features/to-string/precision/single/graphical.js @@ -5,26 +5,27 @@ describe('feature: to-string single precision graphical'); function testGraphical(mode, context, canvas) { const gpu = new GPU({ mode }); - const originalKernel = gpu.createKernel(function() { - this.color(1,1,1,1); - }, { - canvas, - context, - output: [2,2], - precision: 'single', - graphical: true, - }); + const originalKernel = gpu.createKernel( + function () { + this.color(1, 1, 1, 1); + }, + { + canvas, + context, + output: [2, 2], + precision: 'single', + graphical: true, + } + ); - const expected = new Uint8ClampedArray([ - 255, 255, 255, 255, - 255, 255, 255, 255, - 255, 255, 255, 255, - 255, 255, 255, 255, - ]); + const expected = new Uint8ClampedArray([255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]); originalKernel(); assert.deepEqual(originalKernel.getPixels(), expected); const kernelString = originalKernel.toString(); - const newKernel = new Function('return ' + kernelString)()({ canvas, context }); + const newKernel = new Function('return ' + kernelString)()({ + canvas, + context, + }); newKernel(); assert.deepEqual(newKernel.getPixels(), expected); gpu.destroy(); diff --git a/test/features/to-string/precision/single/kernel-map/array/array.js b/test/features/to-string/precision/single/kernel-map/array/array.js index ef7c52f7..e0c1eebe 100644 --- a/test/features/to-string/precision/single/kernel-map/array/array.js +++ b/test/features/to-string/precision/single/kernel-map/array/array.js @@ -8,16 +8,20 @@ function testReturn(mode, context, canvas) { function addOne(value) { return value + 1; } - const originalKernel = gpu.createKernelMap([addOne], function(a) { - const result = a[this.thread.x] + 1; - addOne(result); - return result; - }, { - canvas, - context, - output: [6], - precision: 'single', - }); + const originalKernel = gpu.createKernelMap( + [addOne], + function (a) { + const result = a[this.thread.x] + 1; + addOne(result); + return result; + }, + { + canvas, + context, + output: [6], + precision: 'single', + } + ); const a = [1, 2, 3, 4, 5, 6]; const expected = new Float32Array([2, 3, 4, 5, 6, 7]); diff --git a/test/features/to-string/precision/single/kernel-map/array/array2d.js b/test/features/to-string/precision/single/kernel-map/array/array2d.js index 25bf743c..091e19aa 100644 --- a/test/features/to-string/precision/single/kernel-map/array/array2d.js +++ b/test/features/to-string/precision/single/kernel-map/array/array2d.js @@ -8,26 +8,24 @@ function testReturn(mode, context, canvas) { function addOne(value) { return value + 1; } - const originalKernel = gpu.createKernelMap([addOne], function(a) { - const result = a[this.thread.x] + 1; - addOne(result); - return result; - }, { - canvas, - context, - output: [2, 2], - precision: 'single', - }); + const originalKernel = gpu.createKernelMap( + [addOne], + function (a) { + const result = a[this.thread.x] + 1; + addOne(result); + return result; + }, + { + canvas, + context, + output: [2, 2], + precision: 'single', + } + ); const a = [1, 2, 3, 4, 5, 6]; - const expected = [ - new Float32Array([2, 3]), - new Float32Array([2, 3]), - ]; - const expectedZero = [ - new Float32Array([3, 4]), - new Float32Array([3, 4]), - ]; + const expected = [new Float32Array([2, 3]), new Float32Array([2, 3])]; + const expectedZero = [new Float32Array([3, 4]), new Float32Array([3, 4])]; const originalResult = originalKernel(a); assert.deepEqual(originalResult.result, expected); assert.deepEqual(originalResult[0], expectedZero); diff --git a/test/features/to-string/precision/single/kernel-map/array/array3d.js b/test/features/to-string/precision/single/kernel-map/array/array3d.js index 03c5f117..85251e8c 100644 --- a/test/features/to-string/precision/single/kernel-map/array/array3d.js +++ b/test/features/to-string/precision/single/kernel-map/array/array3d.js @@ -8,37 +8,29 @@ function testReturn(mode, context, canvas) { function addOne(value) { return value + 1; } - const originalKernel = gpu.createKernelMap([addOne], function(a) { - const result = a[this.thread.x] + 1; - addOne(result); - return result; - }, { - canvas, - context, - output: [2, 2, 2], - precision: 'single', - }); + const originalKernel = gpu.createKernelMap( + [addOne], + function (a) { + const result = a[this.thread.x] + 1; + addOne(result); + return result; + }, + { + canvas, + context, + output: [2, 2, 2], + precision: 'single', + } + ); const a = [1, 2]; const expected = [ - [ - new Float32Array([2, 3]), - new Float32Array([2, 3]), - ], - [ - new Float32Array([2, 3]), - new Float32Array([2, 3]), - ] + [new Float32Array([2, 3]), new Float32Array([2, 3])], + [new Float32Array([2, 3]), new Float32Array([2, 3])], ]; const expectedZero = [ - [ - new Float32Array([3, 4]), - new Float32Array([3, 4]), - ], - [ - new Float32Array([3, 4]), - new Float32Array([3, 4]), - ] + [new Float32Array([3, 4]), new Float32Array([3, 4])], + [new Float32Array([3, 4]), new Float32Array([3, 4])], ]; const originalResult = originalKernel(a); assert.deepEqual(originalResult.result, expected); diff --git a/test/features/to-string/precision/single/kernel-map/array/memory-optimized-number-texture.js b/test/features/to-string/precision/single/kernel-map/array/memory-optimized-number-texture.js index e0b61bac..c2b72a85 100644 --- a/test/features/to-string/precision/single/kernel-map/array/memory-optimized-number-texture.js +++ b/test/features/to-string/precision/single/kernel-map/array/memory-optimized-number-texture.js @@ -8,18 +8,22 @@ function testReturn(mode, context, canvas) { function addOne(value) { return value + 1; } - const originalKernel = gpu.createKernelMap([addOne], function(a) { - const result = a[this.thread.x] + 1; - addOne(result); - return result; - }, { - canvas, - context, - output: [6], - precision: 'single', - pipeline: true, - optimizeFloatMemory: true, - }); + const originalKernel = gpu.createKernelMap( + [addOne], + function (a) { + const result = a[this.thread.x] + 1; + addOne(result); + return result; + }, + { + canvas, + context, + output: [6], + precision: 'single', + pipeline: true, + optimizeFloatMemory: true, + } + ); const a = [1, 2, 3, 4, 5, 6]; const expected = new Float32Array([2, 3, 4, 5, 6, 7]); diff --git a/test/features/to-string/precision/single/kernel-map/array/number-texture.js b/test/features/to-string/precision/single/kernel-map/array/number-texture.js index 86e8a3e2..6749b5c6 100644 --- a/test/features/to-string/precision/single/kernel-map/array/number-texture.js +++ b/test/features/to-string/precision/single/kernel-map/array/number-texture.js @@ -8,17 +8,21 @@ function testReturn(mode, context, canvas) { function addOne(value) { return value + 1; } - const originalKernel = gpu.createKernelMap([addOne], function(a) { - const result = a[this.thread.x] + 1; - addOne(result); - return result; - }, { - canvas, - context, - output: [6], - precision: 'single', - pipeline: true, - }); + const originalKernel = gpu.createKernelMap( + [addOne], + function (a) { + const result = a[this.thread.x] + 1; + addOne(result); + return result; + }, + { + canvas, + context, + output: [6], + precision: 'single', + pipeline: true, + } + ); const a = [1, 2, 3, 4, 5, 6]; const expected = new Float32Array([2, 3, 4, 5, 6, 7]); diff --git a/test/features/to-string/precision/single/kernel-map/object/array.js b/test/features/to-string/precision/single/kernel-map/object/array.js index 6fb90600..ed0ad15a 100644 --- a/test/features/to-string/precision/single/kernel-map/object/array.js +++ b/test/features/to-string/precision/single/kernel-map/object/array.js @@ -8,16 +8,20 @@ function testReturn(mode, context, canvas) { function addOne(value) { return value + 1; } - const originalKernel = gpu.createKernelMap({ addOneResult: addOne }, function(a) { - const result = a[this.thread.x] + 1; - addOne(result); - return result; - }, { - canvas, - context, - output: [6], - precision: 'single', - }); + const originalKernel = gpu.createKernelMap( + { addOneResult: addOne }, + function (a) { + const result = a[this.thread.x] + 1; + addOne(result); + return result; + }, + { + canvas, + context, + output: [6], + precision: 'single', + } + ); const a = [1, 2, 3, 4, 5, 6]; const expected = new Float32Array([2, 3, 4, 5, 6, 7]); diff --git a/test/features/to-string/precision/single/kernel-map/object/array2d.js b/test/features/to-string/precision/single/kernel-map/object/array2d.js index 60b22f91..c85c5d3f 100644 --- a/test/features/to-string/precision/single/kernel-map/object/array2d.js +++ b/test/features/to-string/precision/single/kernel-map/object/array2d.js @@ -8,26 +8,24 @@ function testReturn(mode, context, canvas) { function addOne(value) { return value + 1; } - const originalKernel = gpu.createKernelMap({ addOneResult: addOne }, function(a) { - const result = a[this.thread.x] + 1; - addOne(result); - return result; - }, { - canvas, - context, - output: [2, 2], - precision: 'single', - }); + const originalKernel = gpu.createKernelMap( + { addOneResult: addOne }, + function (a) { + const result = a[this.thread.x] + 1; + addOne(result); + return result; + }, + { + canvas, + context, + output: [2, 2], + precision: 'single', + } + ); const a = [1, 2, 3, 4, 5, 6]; - const expected = [ - new Float32Array([2, 3]), - new Float32Array([2, 3]), - ]; - const expectedZero = [ - new Float32Array([3, 4]), - new Float32Array([3, 4]), - ]; + const expected = [new Float32Array([2, 3]), new Float32Array([2, 3])]; + const expectedZero = [new Float32Array([3, 4]), new Float32Array([3, 4])]; const originalResult = originalKernel(a); assert.deepEqual(originalResult.result, expected); assert.deepEqual(originalResult.addOneResult, expectedZero); diff --git a/test/features/to-string/precision/single/kernel-map/object/array3d.js b/test/features/to-string/precision/single/kernel-map/object/array3d.js index 0c1ac27d..3f40adeb 100644 --- a/test/features/to-string/precision/single/kernel-map/object/array3d.js +++ b/test/features/to-string/precision/single/kernel-map/object/array3d.js @@ -8,37 +8,29 @@ function testReturn(mode, context, canvas) { function addOne(value) { return value + 1; } - const originalKernel = gpu.createKernelMap({ addOneResult: addOne }, function(a) { - const result = a[this.thread.x] + 1; - addOne(result); - return result; - }, { - canvas, - context, - output: [2, 2, 2], - precision: 'single', - }); + const originalKernel = gpu.createKernelMap( + { addOneResult: addOne }, + function (a) { + const result = a[this.thread.x] + 1; + addOne(result); + return result; + }, + { + canvas, + context, + output: [2, 2, 2], + precision: 'single', + } + ); const a = [1, 2]; const expected = [ - [ - new Float32Array([2, 3]), - new Float32Array([2, 3]), - ], - [ - new Float32Array([2, 3]), - new Float32Array([2, 3]), - ] - ] + [new Float32Array([2, 3]), new Float32Array([2, 3])], + [new Float32Array([2, 3]), new Float32Array([2, 3])], + ]; const expectedZero = [ - [ - new Float32Array([3, 4]), - new Float32Array([3, 4]), - ], - [ - new Float32Array([3, 4]), - new Float32Array([3, 4]), - ] + [new Float32Array([3, 4]), new Float32Array([3, 4])], + [new Float32Array([3, 4]), new Float32Array([3, 4])], ]; const originalResult = originalKernel(a); assert.deepEqual(originalResult.result, expected); diff --git a/test/features/to-string/precision/single/kernel-map/object/memory-optimized-number-texture.js b/test/features/to-string/precision/single/kernel-map/object/memory-optimized-number-texture.js index 06c27cd3..11125d6b 100644 --- a/test/features/to-string/precision/single/kernel-map/object/memory-optimized-number-texture.js +++ b/test/features/to-string/precision/single/kernel-map/object/memory-optimized-number-texture.js @@ -8,18 +8,22 @@ function testReturn(mode, context, canvas) { function addOne(value) { return value + 1; } - const originalKernel = gpu.createKernelMap({ addOneResult: addOne }, function(a) { - const result = a[this.thread.x] + 1; - addOne(result); - return result; - }, { - canvas, - context, - output: [6], - precision: 'single', - pipeline: true, - optimizeFloatMemory: true, - }); + const originalKernel = gpu.createKernelMap( + { addOneResult: addOne }, + function (a) { + const result = a[this.thread.x] + 1; + addOne(result); + return result; + }, + { + canvas, + context, + output: [6], + precision: 'single', + pipeline: true, + optimizeFloatMemory: true, + } + ); const a = [1, 2, 3, 4, 5, 6]; const expected = new Float32Array([2, 3, 4, 5, 6, 7]); diff --git a/test/features/to-string/precision/single/kernel-map/object/number-texture.js b/test/features/to-string/precision/single/kernel-map/object/number-texture.js index ee294f1e..5524f71d 100644 --- a/test/features/to-string/precision/single/kernel-map/object/number-texture.js +++ b/test/features/to-string/precision/single/kernel-map/object/number-texture.js @@ -8,17 +8,21 @@ function testReturn(mode, context, canvas) { function addOne(value) { return value + 1; } - const originalKernel = gpu.createKernelMap({ addOneResult: addOne }, function(a) { - const result = a[this.thread.x] + 1; - addOne(result); - return result; - }, { - canvas, - context, - output: [6], - precision: 'single', - pipeline: true, - }); + const originalKernel = gpu.createKernelMap( + { addOneResult: addOne }, + function (a) { + const result = a[this.thread.x] + 1; + addOne(result); + return result; + }, + { + canvas, + context, + output: [6], + precision: 'single', + pipeline: true, + } + ); const a = [1, 2, 3, 4, 5, 6]; const expected = new Float32Array([2, 3, 4, 5, 6, 7]); diff --git a/test/features/to-string/precision/single/returns/array.js b/test/features/to-string/precision/single/returns/array.js index fde332ec..7ba47f4c 100644 --- a/test/features/to-string/precision/single/returns/array.js +++ b/test/features/to-string/precision/single/returns/array.js @@ -5,14 +5,17 @@ describe('feature: to-string single precision returns Array'); function testReturn(mode, context, canvas) { const gpu = new GPU({ mode }); - const originalKernel = gpu.createKernel(function(a) { - return a[this.thread.x] + 1; - }, { - canvas, - context, - output: [6], - precision: 'single', - }); + const originalKernel = gpu.createKernel( + function (a) { + return a[this.thread.x] + 1; + }, + { + canvas, + context, + output: [6], + precision: 'single', + } + ); const a = [1, 2, 3, 4, 5, 6]; const expected = new Float32Array([2, 3, 4, 5, 6, 7]); diff --git a/test/features/to-string/precision/single/returns/array2d.js b/test/features/to-string/precision/single/returns/array2d.js index bea7ee04..12fb3c73 100644 --- a/test/features/to-string/precision/single/returns/array2d.js +++ b/test/features/to-string/precision/single/returns/array2d.js @@ -5,21 +5,21 @@ describe('feature: to-string single precision returns Array2D'); function testReturn(mode, context, canvas) { const gpu = new GPU({ mode }); - const originalKernel = gpu.createKernel(function(a, b) { - return a[this.thread.x] + b[this.thread.y]; - }, { - canvas, - context, - output: [2, 2], - precision: 'single', - }); + const originalKernel = gpu.createKernel( + function (a, b) { + return a[this.thread.x] + b[this.thread.y]; + }, + { + canvas, + context, + output: [2, 2], + precision: 'single', + } + ); const a = [1, 2]; const b = [2, 3]; - const expected = [ - new Float32Array([3, 4]), - new Float32Array([4, 5]), - ]; + const expected = [new Float32Array([3, 4]), new Float32Array([4, 5])]; const originalResult = originalKernel(a, b); assert.deepEqual(originalResult, expected); const kernelString = originalKernel.toString(a, b); diff --git a/test/features/to-string/precision/single/returns/array3d.js b/test/features/to-string/precision/single/returns/array3d.js index 04828661..d20899ff 100644 --- a/test/features/to-string/precision/single/returns/array3d.js +++ b/test/features/to-string/precision/single/returns/array3d.js @@ -5,26 +5,24 @@ describe('feature: to-string single precision returns Array3d'); function testReturn(mode, context, canvas) { const gpu = new GPU({ mode }); - const originalKernel = gpu.createKernel(function(a, b, c) { - return a[this.thread.x] + b[this.thread.y] + c[this.thread.z]; - }, { - canvas, - context, - output: [2, 2, 2], - precision: 'single', - }); + const originalKernel = gpu.createKernel( + function (a, b, c) { + return a[this.thread.x] + b[this.thread.y] + c[this.thread.z]; + }, + { + canvas, + context, + output: [2, 2, 2], + precision: 'single', + } + ); const a = [1, 2]; const b = [3, 4]; const c = [5, 6]; const expected = [ - [ - new Float32Array([9,10]), - new Float32Array([10,11]), - ],[ - new Float32Array([10,11]), - new Float32Array([11,12]), - ] + [new Float32Array([9, 10]), new Float32Array([10, 11])], + [new Float32Array([10, 11]), new Float32Array([11, 12])], ]; const originalResult = originalKernel(a, b, c); assert.deepEqual(originalResult, expected); diff --git a/test/features/to-string/precision/single/returns/texture.js b/test/features/to-string/precision/single/returns/texture.js index d0cf4ecc..faa7e476 100644 --- a/test/features/to-string/precision/single/returns/texture.js +++ b/test/features/to-string/precision/single/returns/texture.js @@ -5,15 +5,18 @@ describe('feature: to-string single precision returns Texture'); function testReturn(mode, context, canvas) { const gpu = new GPU({ mode }); - const originalKernel = gpu.createKernel(function(a) { - return a[this.thread.x] + 1; - }, { - canvas, - context, - output: [6], - precision: 'single', - pipeline: true, - }); + const originalKernel = gpu.createKernel( + function (a) { + return a[this.thread.x] + 1; + }, + { + canvas, + context, + output: [6], + precision: 'single', + pipeline: true, + } + ); const a = [1, 2, 3, 4, 5, 6]; const expected = new Float32Array([2, 3, 4, 5, 6, 7]); diff --git a/test/features/to-string/precision/unsigned/arguments/array.js b/test/features/to-string/precision/unsigned/arguments/array.js index 18f6ef72..ef81f8a4 100644 --- a/test/features/to-string/precision/unsigned/arguments/array.js +++ b/test/features/to-string/precision/unsigned/arguments/array.js @@ -5,17 +5,20 @@ describe('feature: to-string unsigned precision arguments Array'); function testArgument(mode, context, canvas) { const gpu = new GPU({ mode }); - const originalKernel = gpu.createKernel(function(a) { - return a[this.thread.x]; - }, { - canvas, - context, - output: [4], - precision: 'unsigned', - }); + const originalKernel = gpu.createKernel( + function (a) { + return a[this.thread.x]; + }, + { + canvas, + context, + output: [4], + precision: 'unsigned', + } + ); const a = [1, 2, 3, 4]; - const expected = new Float32Array([1,2,3,4]); + const expected = new Float32Array([1, 2, 3, 4]); const originalResult = originalKernel(a); assert.deepEqual(originalResult, expected); const kernelString = originalKernel.toString(a); @@ -23,8 +26,8 @@ function testArgument(mode, context, canvas) { const newResult = newKernel(a); assert.deepEqual(newResult, expected); - const b = [4,3,2,1]; - const expected2 = new Float32Array([4,3,2,1]); + const b = [4, 3, 2, 1]; + const expected2 = new Float32Array([4, 3, 2, 1]); const newResult2 = newKernel(b); assert.deepEqual(newResult2, expected2); gpu.destroy(); diff --git a/test/features/to-string/precision/unsigned/arguments/array2.js b/test/features/to-string/precision/unsigned/arguments/array2.js index e4ce7279..52201f96 100644 --- a/test/features/to-string/precision/unsigned/arguments/array2.js +++ b/test/features/to-string/precision/unsigned/arguments/array2.js @@ -5,18 +5,21 @@ describe('feature: to-string unsigned precision arguments Array(2)'); function testArgument(mode, context, canvas) { const gpu = new GPU({ mode }); - const originalKernel = gpu.createKernel(function(a) { - return a; - }, { - canvas, - context, - output: [1], - precision: 'unsigned', - argumentTypes: { a: 'Array(2)' } - }); + const originalKernel = gpu.createKernel( + function (a) { + return a; + }, + { + canvas, + context, + output: [1], + precision: 'unsigned', + argumentTypes: { a: 'Array(2)' }, + } + ); const a = new Float32Array([1, 2]); - const expected = [new Float32Array([1,2])]; + const expected = [new Float32Array([1, 2])]; const originalResult = originalKernel(a); assert.deepEqual(originalResult, expected); const kernelString = originalKernel.toString(a); @@ -25,7 +28,7 @@ function testArgument(mode, context, canvas) { assert.deepEqual(newResult, expected); const b = new Float32Array([2, 1]); - const expected2 = [new Float32Array([2,1])]; + const expected2 = [new Float32Array([2, 1])]; const newResult2 = newKernel(b); assert.deepEqual(newResult2, expected2); gpu.destroy(); diff --git a/test/features/to-string/precision/unsigned/arguments/array2d.js b/test/features/to-string/precision/unsigned/arguments/array2d.js index 670a0bf7..fe0f4a9a 100644 --- a/test/features/to-string/precision/unsigned/arguments/array2d.js +++ b/test/features/to-string/precision/unsigned/arguments/array2d.js @@ -5,18 +5,21 @@ describe('feature: to-string unsigned precision arguments Array2D'); function testArgument(mode, context, canvas) { const gpu = new GPU({ mode }); - const originalKernel = gpu.createKernel(function(a) { - let sum = 0; - for (let y = 0; y < 4; y++) { - sum += a[y][this.thread.x]; + const originalKernel = gpu.createKernel( + function (a) { + let sum = 0; + for (let y = 0; y < 4; y++) { + sum += a[y][this.thread.x]; + } + return sum; + }, + { + canvas, + context, + output: [4], + precision: 'unsigned', } - return sum; - }, { - canvas, - context, - output: [4], - precision: 'unsigned', - }); + ); const a = [ [1, 2, 3, 4], @@ -30,7 +33,7 @@ function testArgument(mode, context, canvas) { [1, 1, 1, 1], [1, 1, 1, 1], ]; - const expected = new Float32Array([28,32,36,40]); + const expected = new Float32Array([28, 32, 36, 40]); const originalResult = originalKernel(a); assert.deepEqual(originalResult, expected); const kernelString = originalKernel.toString(a); @@ -38,7 +41,7 @@ function testArgument(mode, context, canvas) { const newResult = newKernel(a); assert.deepEqual(newResult, expected); - const expected2 = new Float32Array([4,4,4,4]); + const expected2 = new Float32Array([4, 4, 4, 4]); const newResult2 = newKernel(b); assert.deepEqual(newResult2, expected2); gpu.destroy(); diff --git a/test/features/to-string/precision/unsigned/arguments/array3.js b/test/features/to-string/precision/unsigned/arguments/array3.js index e1bc7428..b0333d9c 100644 --- a/test/features/to-string/precision/unsigned/arguments/array3.js +++ b/test/features/to-string/precision/unsigned/arguments/array3.js @@ -5,18 +5,21 @@ describe('feature: to-string unsigned precision arguments Array(3)'); function testArgument(mode, context, canvas) { const gpu = new GPU({ mode }); - const originalKernel = gpu.createKernel(function(a) { - return a; - }, { - canvas, - context, - output: [1], - precision: 'unsigned', - argumentTypes: { a: 'Array(3)' } - }); + const originalKernel = gpu.createKernel( + function (a) { + return a; + }, + { + canvas, + context, + output: [1], + precision: 'unsigned', + argumentTypes: { a: 'Array(3)' }, + } + ); const a = new Float32Array([1, 2, 3]); - const expected = [new Float32Array([1,2,3])]; + const expected = [new Float32Array([1, 2, 3])]; const originalResult = originalKernel(a); assert.deepEqual(originalResult, expected); const kernelString = originalKernel.toString(a); @@ -25,7 +28,7 @@ function testArgument(mode, context, canvas) { assert.deepEqual(newResult, expected); const b = new Float32Array([1, 1, 1]); - const expected2 = [new Float32Array([1,1,1])]; + const expected2 = [new Float32Array([1, 1, 1])]; const newResult2 = newKernel(b); assert.deepEqual(newResult2, expected2); gpu.destroy(); diff --git a/test/features/to-string/precision/unsigned/arguments/array3d.js b/test/features/to-string/precision/unsigned/arguments/array3d.js index 46e465f0..ae66310c 100644 --- a/test/features/to-string/precision/unsigned/arguments/array3d.js +++ b/test/features/to-string/precision/unsigned/arguments/array3d.js @@ -5,20 +5,23 @@ describe('feature: to-string unsigned precision arguments Array3D'); function testArgument(mode, context, canvas) { const gpu = new GPU({ mode }); - const originalKernel = gpu.createKernel(function(a) { - let sum = 0; - for (let z = 0; z < 2; z++) { - for (let y = 0; y < 2; y++) { - sum += a[z][y][this.thread.x]; + const originalKernel = gpu.createKernel( + function (a) { + let sum = 0; + for (let z = 0; z < 2; z++) { + for (let y = 0; y < 2; y++) { + sum += a[z][y][this.thread.x]; + } } + return sum; + }, + { + canvas, + context, + output: [2], + precision: 'unsigned', } - return sum; - }, { - canvas, - context, - output: [2], - precision: 'unsigned', - }); + ); const a = [ [ @@ -28,7 +31,7 @@ function testArgument(mode, context, canvas) { [ [5, 6], [7, 8], - ] + ], ]; const expected = new Float32Array([16, 20]); const originalResult = originalKernel(a); @@ -46,7 +49,7 @@ function testArgument(mode, context, canvas) { [ [1, 1], [1, 1], - ] + ], ]; const expected2 = new Float32Array([4, 4]); const newResult2 = newKernel(b); diff --git a/test/features/to-string/precision/unsigned/arguments/array4.js b/test/features/to-string/precision/unsigned/arguments/array4.js index ca319303..f8e32097 100644 --- a/test/features/to-string/precision/unsigned/arguments/array4.js +++ b/test/features/to-string/precision/unsigned/arguments/array4.js @@ -5,18 +5,21 @@ describe('feature: to-string unsigned precision arguments Array(4)'); function testArgument(mode, context, canvas) { const gpu = new GPU({ mode }); - const originalKernel = gpu.createKernel(function(a) { - return a; - }, { - canvas, - context, - output: [1], - precision: 'unsigned', - argumentTypes: { a: 'Array(4)' } - }); + const originalKernel = gpu.createKernel( + function (a) { + return a; + }, + { + canvas, + context, + output: [1], + precision: 'unsigned', + argumentTypes: { a: 'Array(4)' }, + } + ); const a = new Float32Array([1, 2, 3, 4]); - const expected = [new Float32Array([1,2,3,4])]; + const expected = [new Float32Array([1, 2, 3, 4])]; const originalResult = originalKernel(a); assert.deepEqual(originalResult, expected); const kernelString = originalKernel.toString(a); @@ -25,7 +28,7 @@ function testArgument(mode, context, canvas) { assert.deepEqual(newResult, expected); const b = new Float32Array([1, 1, 1, 1]); - const expected2 = [new Float32Array([1,1,1,1])]; + const expected2 = [new Float32Array([1, 1, 1, 1])]; const newResult2 = newKernel(b); assert.deepEqual(newResult2, expected2); gpu.destroy(); diff --git a/test/features/to-string/precision/unsigned/arguments/boolean.js b/test/features/to-string/precision/unsigned/arguments/boolean.js index 157b3ac3..6f7874cb 100644 --- a/test/features/to-string/precision/unsigned/arguments/boolean.js +++ b/test/features/to-string/precision/unsigned/arguments/boolean.js @@ -5,14 +5,17 @@ describe('feature: to-string unsigned precision arguments Boolean'); function testArgument(mode, context, canvas) { const gpu = new GPU({ mode }); - const originalKernel = gpu.createKernel(function(a) { - return a ? 42 : -42; - }, { - canvas, - context, - output: [1], - precision: 'unsigned', - }); + const originalKernel = gpu.createKernel( + function (a) { + return a ? 42 : -42; + }, + { + canvas, + context, + output: [1], + precision: 'unsigned', + } + ); assert.deepEqual(originalKernel(true)[0], 42); assert.deepEqual(originalKernel(false)[0], -42); const kernelString = originalKernel.toString(true); diff --git a/test/features/to-string/precision/unsigned/arguments/float.js b/test/features/to-string/precision/unsigned/arguments/float.js index aabe1cf2..16c347c9 100644 --- a/test/features/to-string/precision/unsigned/arguments/float.js +++ b/test/features/to-string/precision/unsigned/arguments/float.js @@ -5,15 +5,18 @@ describe('feature: to-string unsigned precision arguments Float'); function testArgument(mode, context, canvas) { const gpu = new GPU({ mode }); - const originalKernel = gpu.createKernel(function(a) { - return Math.floor(a) === 100 ? 42 : -42; - }, { - canvas, - context, - output: [1], - precision: 'unsigned', - argumentTypes: { a: 'Float' }, - }); + const originalKernel = gpu.createKernel( + function (a) { + return Math.floor(a) === 100 ? 42 : -42; + }, + { + canvas, + context, + output: [1], + precision: 'unsigned', + argumentTypes: { a: 'Float' }, + } + ); assert.equal(originalKernel.argumentTypes[0], 'Float'); assert.deepEqual(originalKernel(100)[0], 42); assert.deepEqual(originalKernel(10)[0], -42); diff --git a/test/features/to-string/precision/unsigned/arguments/html-canvas.js b/test/features/to-string/precision/unsigned/arguments/html-canvas.js index e0ae40ed..15e73de2 100644 --- a/test/features/to-string/precision/unsigned/arguments/html-canvas.js +++ b/test/features/to-string/precision/unsigned/arguments/html-canvas.js @@ -7,21 +7,27 @@ describe('feature: to-string unsigned precision arguments HTMLCanvas'); function testArgument(mode, done) { const canvasInput1 = greenCanvas(mode, 1, 1); const canvasInput2 = greenCanvas(mode, 1, 1); - const gpu = new GPU({mode}); - const originalKernel = gpu.createKernel(function (canvas1, canvas2) { - const pixel1 = canvas1[this.thread.y][this.thread.x]; - const pixel2 = canvas2[this.thread.y][this.thread.x]; - return pixel1[1] + pixel2[1]; - }, { - output: [1], - precision: 'unsigned', - argumentTypes: ['HTMLCanvas', 'HTMLCanvas'], - }); + const gpu = new GPU({ mode }); + const originalKernel = gpu.createKernel( + function (canvas1, canvas2) { + const pixel1 = canvas1[this.thread.y][this.thread.x]; + const pixel2 = canvas2[this.thread.y][this.thread.x]; + return pixel1[1] + pixel2[1]; + }, + { + output: [1], + precision: 'unsigned', + argumentTypes: ['HTMLCanvas', 'HTMLCanvas'], + } + ); const canvas = originalKernel.canvas; const context = originalKernel.context; assert.deepEqual(originalKernel(canvasInput1, canvasInput2)[0], 2); const kernelString = originalKernel.toString(canvasInput1, canvasInput2); - const newKernel = new Function('return ' + kernelString)()({context, canvas}); + const newKernel = new Function('return ' + kernelString)()({ + context, + canvas, + }); const canvasInput3 = greenCanvas(mode, 1, 1); const canvasInput4 = greenCanvas(mode, 1, 1); assert.deepEqual(newKernel(canvasInput3, canvasInput4)[0], 2); @@ -35,5 +41,3 @@ function testArgument(mode, done) { (GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('webgl2', () => { testArgument('webgl2'); }); - - diff --git a/test/features/to-string/precision/unsigned/arguments/html-image-array.js b/test/features/to-string/precision/unsigned/arguments/html-image-array.js index a259b44a..fd19d62e 100644 --- a/test/features/to-string/precision/unsigned/arguments/html-image-array.js +++ b/test/features/to-string/precision/unsigned/arguments/html-image-array.js @@ -4,50 +4,54 @@ const { GPU, CPUKernel } = require('../../../../../../src'); describe('feature: to-string unsigned precision arguments HTMLImageArray'); function testArgument(mode, done) { - loadImages([ - 'jellyfish-1.jpeg', - 'jellyfish-2.jpeg', - 'jellyfish-3.jpeg', - 'jellyfish-4.jpeg', - ]) - .then(([image1, image2, image3, image4]) => { - const imagesArray1 = [image1, image2]; - const imagesArray2 = [image3, image4]; - const gpu = new GPU({mode}); - const originalKernel = gpu.createKernel(function (a, selection) { + loadImages(['jellyfish-1.jpeg', 'jellyfish-2.jpeg', 'jellyfish-3.jpeg', 'jellyfish-4.jpeg']).then(([image1, image2, image3, image4]) => { + const imagesArray1 = [image1, image2]; + const imagesArray2 = [image3, image4]; + const gpu = new GPU({ mode }); + const originalKernel = gpu.createKernel( + function (a, selection) { const image0 = a[0][0][0]; const image1 = a[1][0][0]; switch (selection) { - case 0: return image0.r * 255; - case 1: return image1.r * 255; - case 2: return image0.g * 255; - case 3: return image1.g * 255; + case 0: + return image0.r * 255; + case 1: + return image1.r * 255; + case 2: + return image0.g * 255; + case 3: + return image1.g * 255; } - }, { + }, + { output: [1], precision: 'unsigned', argumentTypes: ['HTMLImageArray', 'Integer'], - }); - assert.deepEqual(originalKernel(imagesArray1, 0)[0], 172); - assert.deepEqual(originalKernel(imagesArray1, 1)[0], 255); - assert.deepEqual(originalKernel(imagesArray2, 2)[0], 87); - assert.deepEqual(originalKernel(imagesArray2, 3)[0], 110); - const kernelString = originalKernel.toString(imagesArray1, 0); - const canvas = originalKernel.canvas; - const context = originalKernel.context; - const newKernel = new Function('return ' + kernelString)()({context, canvas}); - assert.deepEqual(newKernel(imagesArray1, 0)[0], 172); - assert.deepEqual(newKernel(imagesArray1, 1)[0], 255); - assert.deepEqual(newKernel(imagesArray2, 2)[0], 87); - assert.deepEqual(newKernel(imagesArray2, 3)[0], 110); - gpu.destroy(); - done(originalKernel, newKernel); + } + ); + assert.deepEqual(originalKernel(imagesArray1, 0)[0], 172); + assert.deepEqual(originalKernel(imagesArray1, 1)[0], 255); + assert.deepEqual(originalKernel(imagesArray2, 2)[0], 87); + assert.deepEqual(originalKernel(imagesArray2, 3)[0], 110); + const kernelString = originalKernel.toString(imagesArray1, 0); + const canvas = originalKernel.canvas; + const context = originalKernel.context; + const newKernel = new Function('return ' + kernelString)()({ + context, + canvas, }); + assert.deepEqual(newKernel(imagesArray1, 0)[0], 172); + assert.deepEqual(newKernel(imagesArray1, 1)[0], 255); + assert.deepEqual(newKernel(imagesArray2, 2)[0], 87); + assert.deepEqual(newKernel(imagesArray2, 3)[0], 110); + gpu.destroy(); + done(originalKernel, newKernel); + }); } (GPU.isWebGLSupported ? test : skip)('webgl', t => { const done = t.async(); - testArgument('webgl', (kernel) => { + testArgument('webgl', kernel => { // They aren't supported, so test that kernel falls back assert.equal(kernel.kernel.constructor, CPUKernel); done(); diff --git a/test/features/to-string/precision/unsigned/arguments/html-image.js b/test/features/to-string/precision/unsigned/arguments/html-image.js index 86134f88..2e0cbf69 100644 --- a/test/features/to-string/precision/unsigned/arguments/html-image.js +++ b/test/features/to-string/precision/unsigned/arguments/html-image.js @@ -4,27 +4,32 @@ const { GPU } = require('../../../../../../src'); describe('feature: to-string unsigned precision arguments HTMLImage'); function testArgument(mode, done) { - loadImages(['jellyfish-1.jpeg', 'jellyfish-2.jpeg']) - .then(([image1, image2]) => { - const gpu = new GPU({mode}); - const originalKernel = gpu.createKernel(function (a) { + loadImages(['jellyfish-1.jpeg', 'jellyfish-2.jpeg']).then(([image1, image2]) => { + const gpu = new GPU({ mode }); + const originalKernel = gpu.createKernel( + function (a) { const pixel = a[0][0]; return pixel.b * 255; - }, { + }, + { output: [1], precision: 'unsigned', argumentTypes: ['HTMLImage'], - }); - const canvas = originalKernel.canvas; - const context = originalKernel.context; - assert.deepEqual(originalKernel(image1)[0], 253); - const kernelString = originalKernel.toString(image1); - const newKernel = new Function('return ' + kernelString)()({context, canvas}); - assert.deepEqual(newKernel(image1)[0], 253); - assert.deepEqual(newKernel(image2)[0], 255); - gpu.destroy(); - done(); + } + ); + const canvas = originalKernel.canvas; + const context = originalKernel.context; + assert.deepEqual(originalKernel(image1)[0], 253); + const kernelString = originalKernel.toString(image1); + const newKernel = new Function('return ' + kernelString)()({ + context, + canvas, }); + assert.deepEqual(newKernel(image1)[0], 253); + assert.deepEqual(newKernel(image2)[0], 255); + gpu.destroy(); + done(); + }); } (GPU.isWebGLSupported ? test : skip)('webgl', t => { @@ -34,5 +39,3 @@ function testArgument(mode, done) { (GPU.isWebGL2Supported ? test : skip)('webgl2', t => { testArgument('webgl2', t.async()); }); - - diff --git a/test/features/to-string/precision/unsigned/arguments/html-video.js b/test/features/to-string/precision/unsigned/arguments/html-video.js index 5c4f477e..4efda3d7 100644 --- a/test/features/to-string/precision/unsigned/arguments/html-video.js +++ b/test/features/to-string/precision/unsigned/arguments/html-video.js @@ -7,28 +7,34 @@ function testArgument(mode, done) { const video = document.createElement('video'); video.currentTime = 2; video.src = 'jellyfish.webm'; - video.oncanplay = (e) => { + video.oncanplay = e => { video.oncanplay = null; setTimeout(() => { - const gpu = new GPU({mode}); - const originalKernel = gpu.createKernel(function (a) { - const pixel = a[0][0]; - return pixel.g * 255; - }, { - output: [1], - precision: 'unsigned', - argumentTypes: ['HTMLVideo'], - }); + const gpu = new GPU({ mode }); + const originalKernel = gpu.createKernel( + function (a) { + const pixel = a[0][0]; + return pixel.g * 255; + }, + { + output: [1], + precision: 'unsigned', + argumentTypes: ['HTMLVideo'], + } + ); const canvas = originalKernel.canvas; const context = originalKernel.context; assert.deepEqual(originalKernel(video)[0], 125); const kernelString = originalKernel.toString(video); - const newKernel = new Function('return ' + kernelString)()({context, canvas}); + const newKernel = new Function('return ' + kernelString)()({ + context, + canvas, + }); assert.deepEqual(newKernel(video)[0], 125); gpu.destroy(); done(); }, 1000); - } + }; } (GPU.isWebGLSupported ? test : skip)('webgl', t => { @@ -38,5 +44,3 @@ function testArgument(mode, done) { (GPU.isWebGL2Supported ? test : skip)('webgl2', t => { testArgument('webgl2', t.async()); }); - - diff --git a/test/features/to-string/precision/unsigned/arguments/input.js b/test/features/to-string/precision/unsigned/arguments/input.js index 0d96103d..a6e98a16 100644 --- a/test/features/to-string/precision/unsigned/arguments/input.js +++ b/test/features/to-string/precision/unsigned/arguments/input.js @@ -5,22 +5,25 @@ describe('feature: to-string unsigned precision arguments Input'); function testArgument(mode, context, canvas) { const gpu = new GPU({ mode }); - const originalKernel = gpu.createKernel(function(a) { - let sum = 0; - for (let y = 0; y < 2; y++) { - for (let x = 0; x < 2; x++) { - sum += a[y][x]; + const originalKernel = gpu.createKernel( + function (a) { + let sum = 0; + for (let y = 0; y < 2; y++) { + for (let x = 0; x < 2; x++) { + sum += a[y][x]; + } } + return sum; + }, + { + canvas, + context, + output: [1], + precision: 'unsigned', } - return sum; - }, { - canvas, - context, - output: [1], - precision: 'unsigned', - }); - const arg1 = input([1,2,3,4],[2,2]); - const arg2 = input([5,6,7,8],[2,2]); + ); + const arg1 = input([1, 2, 3, 4], [2, 2]); + const arg2 = input([5, 6, 7, 8], [2, 2]); assert.deepEqual(originalKernel(arg1)[0], 10); assert.deepEqual(originalKernel(arg2)[0], 26); const kernelString = originalKernel.toString(arg1); diff --git a/test/features/to-string/precision/unsigned/arguments/integer.js b/test/features/to-string/precision/unsigned/arguments/integer.js index 22d1e750..a33823d0 100644 --- a/test/features/to-string/precision/unsigned/arguments/integer.js +++ b/test/features/to-string/precision/unsigned/arguments/integer.js @@ -5,15 +5,18 @@ describe('feature: to-string unsigned precision arguments Integer'); function testArgument(mode, context, canvas) { const gpu = new GPU({ mode }); - const originalKernel = gpu.createKernel(function(a) { - return Math.floor(a) === 100 ? 42 : -42; - }, { - canvas, - context, - output: [1], - precision: 'unsigned', - argumentTypes: { a: 'Integer' }, - }); + const originalKernel = gpu.createKernel( + function (a) { + return Math.floor(a) === 100 ? 42 : -42; + }, + { + canvas, + context, + output: [1], + precision: 'unsigned', + argumentTypes: { a: 'Integer' }, + } + ); assert.equal(originalKernel.argumentTypes[0], 'Integer'); assert.deepEqual(originalKernel(100)[0], 42); assert.deepEqual(originalKernel(10)[0], -42); diff --git a/test/features/to-string/precision/unsigned/arguments/memory-optimized-number-texture.js b/test/features/to-string/precision/unsigned/arguments/memory-optimized-number-texture.js index 6695695e..c86d45b9 100644 --- a/test/features/to-string/precision/unsigned/arguments/memory-optimized-number-texture.js +++ b/test/features/to-string/precision/unsigned/arguments/memory-optimized-number-texture.js @@ -5,37 +5,46 @@ describe('feature: to-string unsigned precision arguments MemoryOptimizedNumberT function testArgument(mode, context, canvas) { const gpu = new GPU({ mode, context, canvas }); - const texture1 = gpu.createKernel(function() { - return this.thread.x; - }, { - output: [4], - optimizeFloatMemory: true, - precision: 'unsigned', - pipeline: true, - })(); - const texture2 = gpu.createKernel(function() { - return 4 - this.thread.x; - }, { - output: [4], - optimizeFloatMemory: true, - precision: 'unsigned', - pipeline: true, - })(); - const originalKernel = gpu.createKernel(function(a) { - return a[this.thread.x]; - }, { - canvas, - context, - output: [4], - precision: 'unsigned' - }); - assert.deepEqual(originalKernel(texture1), new Float32Array([0,1,2,3])); - assert.deepEqual(originalKernel(texture2), new Float32Array([4,3,2,1])); + const texture1 = gpu.createKernel( + function () { + return this.thread.x; + }, + { + output: [4], + optimizeFloatMemory: true, + precision: 'unsigned', + pipeline: true, + } + )(); + const texture2 = gpu.createKernel( + function () { + return 4 - this.thread.x; + }, + { + output: [4], + optimizeFloatMemory: true, + precision: 'unsigned', + pipeline: true, + } + )(); + const originalKernel = gpu.createKernel( + function (a) { + return a[this.thread.x]; + }, + { + canvas, + context, + output: [4], + precision: 'unsigned', + } + ); + assert.deepEqual(originalKernel(texture1), new Float32Array([0, 1, 2, 3])); + assert.deepEqual(originalKernel(texture2), new Float32Array([4, 3, 2, 1])); const kernelString = originalKernel.toString(texture1); const newKernel = new Function('return ' + kernelString)()({ context }); - assert.deepEqual(newKernel(texture1), new Float32Array([0,1,2,3])); - assert.deepEqual(newKernel(texture2), new Float32Array([4,3,2,1])); + assert.deepEqual(newKernel(texture1), new Float32Array([0, 1, 2, 3])); + assert.deepEqual(newKernel(texture2), new Float32Array([4, 3, 2, 1])); gpu.destroy(); } diff --git a/test/features/to-string/precision/unsigned/arguments/number-texture.js b/test/features/to-string/precision/unsigned/arguments/number-texture.js index a0012393..821f94d5 100644 --- a/test/features/to-string/precision/unsigned/arguments/number-texture.js +++ b/test/features/to-string/precision/unsigned/arguments/number-texture.js @@ -5,37 +5,46 @@ describe('feature: to-string unsigned precision arguments NumberTexture'); function testArgument(mode, context, canvas) { const gpu = new GPU({ mode, context, canvas }); - const texture1 = gpu.createKernel(function() { - return this.thread.x; - }, { - output: [4], - optimizeFloatMemory: false, - precision: 'unsigned', - pipeline: true, - })(); - const texture2 = gpu.createKernel(function() { - return 4 - this.thread.x; - }, { - output: [4], - optimizeFloatMemory: false, - precision: 'unsigned', - pipeline: true, - })(); - const originalKernel = gpu.createKernel(function(a) { - return a[this.thread.x]; - }, { - canvas, - context, - output: [4], - precision: 'unsigned' - }); - assert.deepEqual(originalKernel(texture1), new Float32Array([0,1,2,3])); - assert.deepEqual(originalKernel(texture2), new Float32Array([4,3,2,1])); + const texture1 = gpu.createKernel( + function () { + return this.thread.x; + }, + { + output: [4], + optimizeFloatMemory: false, + precision: 'unsigned', + pipeline: true, + } + )(); + const texture2 = gpu.createKernel( + function () { + return 4 - this.thread.x; + }, + { + output: [4], + optimizeFloatMemory: false, + precision: 'unsigned', + pipeline: true, + } + )(); + const originalKernel = gpu.createKernel( + function (a) { + return a[this.thread.x]; + }, + { + canvas, + context, + output: [4], + precision: 'unsigned', + } + ); + assert.deepEqual(originalKernel(texture1), new Float32Array([0, 1, 2, 3])); + assert.deepEqual(originalKernel(texture2), new Float32Array([4, 3, 2, 1])); const kernelString = originalKernel.toString(texture1); const newKernel = new Function('return ' + kernelString)()({ context }); - assert.deepEqual(newKernel(texture1), new Float32Array([0,1,2,3])); - assert.deepEqual(newKernel(texture2), new Float32Array([4,3,2,1])); + assert.deepEqual(newKernel(texture1), new Float32Array([0, 1, 2, 3])); + assert.deepEqual(newKernel(texture2), new Float32Array([4, 3, 2, 1])); gpu.destroy(); } diff --git a/test/features/to-string/precision/unsigned/constants/array.js b/test/features/to-string/precision/unsigned/constants/array.js index 5e7073c3..7ac1f114 100644 --- a/test/features/to-string/precision/unsigned/constants/array.js +++ b/test/features/to-string/precision/unsigned/constants/array.js @@ -5,26 +5,35 @@ describe('feature: to-string unsigned precision constants Array'); function testConstant(mode, context, canvas) { const gpu = new GPU({ mode }); - const originalKernel = gpu.createKernel(function() { - return this.constants.a[this.thread.x]; - }, { - canvas, - context, - output: [4], - precision: 'unsigned', - constants: { - a: [1, 2, 3, 4] + const originalKernel = gpu.createKernel( + function () { + return this.constants.a[this.thread.x]; + }, + { + canvas, + context, + output: [4], + precision: 'unsigned', + constants: { + a: [1, 2, 3, 4], + }, } - }); - const expected = new Float32Array([1,2,3,4]); + ); + const expected = new Float32Array([1, 2, 3, 4]); const originalResult = originalKernel(); assert.deepEqual(originalResult, expected); const kernelString = originalKernel.toString(); - const newResult = new Function('return ' + kernelString)()({ context, constants: { a: [1, 2, 3, 4] } })(); + const newResult = new Function('return ' + kernelString)()({ + context, + constants: { a: [1, 2, 3, 4] }, + })(); assert.deepEqual(newResult, expected); - const expected2 = new Float32Array([4,3,2,1]); - const newResult2 = new Function('return ' + kernelString)()({ context, constants: { a: [4, 3, 2, 1] } })(); + const expected2 = new Float32Array([4, 3, 2, 1]); + const newResult2 = new Function('return ' + kernelString)()({ + context, + constants: { a: [4, 3, 2, 1] }, + })(); assert.deepEqual(newResult2, expected2); gpu.destroy(); } diff --git a/test/features/to-string/precision/unsigned/constants/array2.js b/test/features/to-string/precision/unsigned/constants/array2.js index bce3d0eb..1efb64c1 100644 --- a/test/features/to-string/precision/unsigned/constants/array2.js +++ b/test/features/to-string/precision/unsigned/constants/array2.js @@ -5,30 +5,39 @@ describe('feature: to-string unsigned precision constants Array(2)'); function testConstant(mode, context, canvas) { const gpu = new GPU({ mode }); - const originalKernel = gpu.createKernel(function() { - return this.constants.a; - }, { - canvas, - context, - output: [1], - precision: 'unsigned', - constants: { - a: new Float32Array([1, 2]) + const originalKernel = gpu.createKernel( + function () { + return this.constants.a; }, - constantTypes: { - a: 'Array(2)' + { + canvas, + context, + output: [1], + precision: 'unsigned', + constants: { + a: new Float32Array([1, 2]), + }, + constantTypes: { + a: 'Array(2)', + }, } - }); + ); const expected = [new Float32Array([1, 2])]; const originalResult = originalKernel(); assert.deepEqual(originalResult, expected); const kernelString = originalKernel.toString(); const Kernel = new Function('return ' + kernelString)(); - const newResult = Kernel({ context, constants: { a: new Float32Array([1, 2]) } })(); + const newResult = Kernel({ + context, + constants: { a: new Float32Array([1, 2]) }, + })(); assert.deepEqual(newResult, expected); // Array(2) is "sticky" as a constant, and cannot reset - const newResult2 = Kernel({ context, constants: { a: new Float32Array([2, 1]) } })(); + const newResult2 = Kernel({ + context, + constants: { a: new Float32Array([2, 1]) }, + })(); assert.deepEqual(newResult2, expected); gpu.destroy(); } diff --git a/test/features/to-string/precision/unsigned/constants/array2d.js b/test/features/to-string/precision/unsigned/constants/array2d.js index 5728c074..6f5c9cec 100644 --- a/test/features/to-string/precision/unsigned/constants/array2d.js +++ b/test/features/to-string/precision/unsigned/constants/array2d.js @@ -11,22 +11,25 @@ function testConstant(mode, context, canvas) { [9, 10, 11, 12], [13, 14, 15, 16], ]; - const originalKernel = gpu.createKernel(function() { - let sum = 0; - for (let y = 0; y < 4; y++) { - sum += this.constants.a[y][this.thread.x]; + const originalKernel = gpu.createKernel( + function () { + let sum = 0; + for (let y = 0; y < 4; y++) { + sum += this.constants.a[y][this.thread.x]; + } + return sum; + }, + { + canvas, + context, + output: [4], + precision: 'unsigned', + constants: { + a, + }, } - return sum; - }, { - canvas, - context, - output: [4], - precision: 'unsigned', - constants: { - a - } - }); - const expected = new Float32Array([28,32,36,40]); + ); + const expected = new Float32Array([28, 32, 36, 40]); const originalResult = originalKernel(); assert.deepEqual(originalResult, expected); const kernelString = originalKernel.toString(); @@ -40,7 +43,7 @@ function testConstant(mode, context, canvas) { [1, 1, 1, 1], [1, 1, 1, 1], ]; - const expected2 = new Float32Array([4,4,4,4]); + const expected2 = new Float32Array([4, 4, 4, 4]); const newResult2 = Kernel({ context, constants: { a: b } })(); assert.deepEqual(newResult2, expected2); gpu.destroy(); diff --git a/test/features/to-string/precision/unsigned/constants/array3.js b/test/features/to-string/precision/unsigned/constants/array3.js index fae63691..92a0ea49 100644 --- a/test/features/to-string/precision/unsigned/constants/array3.js +++ b/test/features/to-string/precision/unsigned/constants/array3.js @@ -5,30 +5,39 @@ describe('feature: to-string unsigned precision constants Array(3)'); function testConstant(mode, context, canvas) { const gpu = new GPU({ mode }); - const originalKernel = gpu.createKernel(function() { - return this.constants.a; - }, { - canvas, - context, - output: [1], - precision: 'unsigned', - constants: { - a: new Float32Array([1, 2, 3]) + const originalKernel = gpu.createKernel( + function () { + return this.constants.a; }, - constantTypes: { - a: 'Array(3)' + { + canvas, + context, + output: [1], + precision: 'unsigned', + constants: { + a: new Float32Array([1, 2, 3]), + }, + constantTypes: { + a: 'Array(3)', + }, } - }); + ); const expected = [new Float32Array([1, 2, 3])]; const originalResult = originalKernel(); assert.deepEqual(originalResult, expected); const kernelString = originalKernel.toString(); const Kernel = new Function('return ' + kernelString)(); - const newResult = Kernel({ context, constants: { a: new Float32Array([1, 2, 3]) } })(); + const newResult = Kernel({ + context, + constants: { a: new Float32Array([1, 2, 3]) }, + })(); assert.deepEqual(newResult, expected); // Array(3) is "sticky" as a constant, and cannot reset - const newResult2 = Kernel({ context, constants: { a: new Float32Array([3, 2, 1]) } })(); + const newResult2 = Kernel({ + context, + constants: { a: new Float32Array([3, 2, 1]) }, + })(); assert.deepEqual(newResult2, expected); gpu.destroy(); } diff --git a/test/features/to-string/precision/unsigned/constants/array3d.js b/test/features/to-string/precision/unsigned/constants/array3d.js index 680ae6e2..83db0b5a 100644 --- a/test/features/to-string/precision/unsigned/constants/array3d.js +++ b/test/features/to-string/precision/unsigned/constants/array3d.js @@ -13,25 +13,28 @@ function testConstant(mode, context, canvas) { [ [5, 6], [7, 8], - ] + ], ]; - const originalKernel = gpu.createKernel(function() { - let sum = 0; - for (let z = 0; z < 2; z++) { - for (let y = 0; y < 2; y++) { - sum += this.constants.a[z][y][this.thread.x]; + const originalKernel = gpu.createKernel( + function () { + let sum = 0; + for (let z = 0; z < 2; z++) { + for (let y = 0; y < 2; y++) { + sum += this.constants.a[z][y][this.thread.x]; + } } + return sum; + }, + { + canvas, + context, + output: [2], + precision: 'unsigned', + constants: { + a, + }, } - return sum; - }, { - canvas, - context, - output: [2], - precision: 'unsigned', - constants: { - a - } - }); + ); const expected = new Float32Array([16, 20]); const originalResult = originalKernel(); @@ -41,7 +44,6 @@ function testConstant(mode, context, canvas) { const newResult = Kernel({ context, constants: { a } })(); assert.deepEqual(newResult, expected); - const b = [ [ [1, 1], @@ -50,7 +52,7 @@ function testConstant(mode, context, canvas) { [ [1, 1], [1, 1], - ] + ], ]; const newResult2 = Kernel({ context, constants: { a: b } })(); const expected2 = new Float32Array([4, 4]); diff --git a/test/features/to-string/precision/unsigned/constants/array4.js b/test/features/to-string/precision/unsigned/constants/array4.js index a0a93754..8580a74f 100644 --- a/test/features/to-string/precision/unsigned/constants/array4.js +++ b/test/features/to-string/precision/unsigned/constants/array4.js @@ -6,31 +6,40 @@ describe('feature: to-string unsigned precision constants Array(4)'); function testConstant(mode, context, canvas) { const gpu = new GPU({ mode }); const a = new Float32Array([1, 2, 3, 4]); - const originalKernel = gpu.createKernel(function() { - return this.constants.a; - }, { - canvas, - context, - output: [1], - precision: 'unsigned', - constants: { - a + const originalKernel = gpu.createKernel( + function () { + return this.constants.a; }, - constantTypes: { - a: 'Array(4)' + { + canvas, + context, + output: [1], + precision: 'unsigned', + constants: { + a, + }, + constantTypes: { + a: 'Array(4)', + }, } - }); + ); const expected = [new Float32Array([1, 2, 3, 4])]; const originalResult = originalKernel(); assert.deepEqual(originalResult, expected); const kernelString = originalKernel.toString(); - const newResult = new Function('return ' + kernelString)()({ context, constants: { a } })(); + const newResult = new Function('return ' + kernelString)()({ + context, + constants: { a }, + })(); assert.deepEqual(newResult, expected); // Array(3) is "sticky" as a constant, and cannot reset const b = new Float32Array([4, 3, 2, 1]); const expected2 = [new Float32Array([1, 2, 3, 4])]; - const newResult2 = new Function('return ' + kernelString)()({ context, constants: { a: b } })(); + const newResult2 = new Function('return ' + kernelString)()({ + context, + constants: { a: b }, + })(); assert.deepEqual(newResult2, expected2); gpu.destroy(); } diff --git a/test/features/to-string/precision/unsigned/constants/boolean.js b/test/features/to-string/precision/unsigned/constants/boolean.js index 6e65b715..c1a8ac86 100644 --- a/test/features/to-string/precision/unsigned/constants/boolean.js +++ b/test/features/to-string/precision/unsigned/constants/boolean.js @@ -5,28 +5,34 @@ describe('feature: to-string unsigned precision constants Boolean'); function testConstant(mode, context, canvas) { const gpu = new GPU({ mode }); - const originalKernel1 = gpu.createKernel(function() { - return this.constants.a ? 42 : -42; - }, { - canvas, - context, - output: [1], - precision: 'unsigned', - constants: { - a: true + const originalKernel1 = gpu.createKernel( + function () { + return this.constants.a ? 42 : -42; + }, + { + canvas, + context, + output: [1], + precision: 'unsigned', + constants: { + a: true, + }, } - }); - const originalKernel2 = gpu.createKernel(function() { - return this.constants.a ? 42 : -42; - }, { - canvas, - context, - output: [1], - precision: 'unsigned', - constants: { - a: false + ); + const originalKernel2 = gpu.createKernel( + function () { + return this.constants.a ? 42 : -42; + }, + { + canvas, + context, + output: [1], + precision: 'unsigned', + constants: { + a: false, + }, } - }); + ); assert.deepEqual(originalKernel1()[0], 42); assert.deepEqual(originalKernel2()[0], -42); const kernelString1 = originalKernel1.toString(); diff --git a/test/features/to-string/precision/unsigned/constants/float.js b/test/features/to-string/precision/unsigned/constants/float.js index abdebe81..070ddf6a 100644 --- a/test/features/to-string/precision/unsigned/constants/float.js +++ b/test/features/to-string/precision/unsigned/constants/float.js @@ -5,18 +5,21 @@ describe('feature: to-string unsigned precision constants Float'); function testConstant(mode, context, canvas) { const gpu = new GPU({ mode }); - const originalKernel = gpu.createKernel(function() { - return Math.floor(this.constants.a) === 100 ? 42 : -42; - }, { - canvas, - context, - output: [1], - precision: 'unsigned', - constants: { - a: 100 + const originalKernel = gpu.createKernel( + function () { + return Math.floor(this.constants.a) === 100 ? 42 : -42; }, - constantTypes: { a: 'Float' } - }); + { + canvas, + context, + output: [1], + precision: 'unsigned', + constants: { + a: 100, + }, + constantTypes: { a: 'Float' }, + } + ); assert.equal(originalKernel.constantTypes.a, 'Float'); assert.deepEqual(originalKernel()[0], 42); const kernelString = originalKernel.toString(); diff --git a/test/features/to-string/precision/unsigned/constants/html-canvas.js b/test/features/to-string/precision/unsigned/constants/html-canvas.js index 8c85ba1a..75e31876 100644 --- a/test/features/to-string/precision/unsigned/constants/html-canvas.js +++ b/test/features/to-string/precision/unsigned/constants/html-canvas.js @@ -7,16 +7,19 @@ describe('feature: to-string unsigned precision constants HTMLCanvas'); function testArgument(mode, done) { const canvasInput1 = greenCanvas(mode, 1, 1); const canvasInput2 = greenCanvas(mode, 1, 1); - const gpu = new GPU({mode}); - const originalKernel = gpu.createKernel(function () { - const pixel1 = this.constants.canvas1[this.thread.y][this.thread.x]; - const pixel2 = this.constants.canvas2[this.thread.y][this.thread.x]; - return pixel1[1] + pixel2[1]; - }, { - output: [1], - precision: 'unsigned', - constants: { canvas1: canvasInput1, canvas2: canvasInput2 } - }); + const gpu = new GPU({ mode }); + const originalKernel = gpu.createKernel( + function () { + const pixel1 = this.constants.canvas1[this.thread.y][this.thread.x]; + const pixel2 = this.constants.canvas2[this.thread.y][this.thread.x]; + return pixel1[1] + pixel2[1]; + }, + { + output: [1], + precision: 'unsigned', + constants: { canvas1: canvasInput1, canvas2: canvasInput2 }, + } + ); const canvas = originalKernel.canvas; const context = originalKernel.context; assert.deepEqual(originalKernel()[0], 2); @@ -28,8 +31,8 @@ function testArgument(mode, done) { canvas, constants: { canvas1: canvasInput3, - canvas2: canvasInput4 - } + canvas2: canvasInput4, + }, }); assert.deepEqual(newKernel()[0], 2); gpu.destroy(); @@ -42,5 +45,3 @@ function testArgument(mode, done) { (GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('webgl2', () => { testArgument('webgl2'); }); - - diff --git a/test/features/to-string/precision/unsigned/constants/html-image-array.js b/test/features/to-string/precision/unsigned/constants/html-image-array.js index db3f5267..685f6b3e 100644 --- a/test/features/to-string/precision/unsigned/constants/html-image-array.js +++ b/test/features/to-string/precision/unsigned/constants/html-image-array.js @@ -4,60 +4,61 @@ const { GPU, CPUKernel } = require('../../../../../../src'); describe('feature: to-string unsigned precision constants HTMLImageArray'); function testArgument(mode, done) { - loadImages([ - 'jellyfish-1.jpeg', - 'jellyfish-2.jpeg', - 'jellyfish-3.jpeg', - 'jellyfish-4.jpeg', - ]) - .then(([image1, image2, image3, image4]) => { - const images1 = [image1, image2]; - const images2 = [image3, image4]; - const gpu = new GPU({mode}); - const originalKernel = gpu.createKernel(function (selection) { + loadImages(['jellyfish-1.jpeg', 'jellyfish-2.jpeg', 'jellyfish-3.jpeg', 'jellyfish-4.jpeg']).then(([image1, image2, image3, image4]) => { + const images1 = [image1, image2]; + const images2 = [image3, image4]; + const gpu = new GPU({ mode }); + const originalKernel = gpu.createKernel( + function (selection) { const image0 = this.constants.a[0][0][0]; const image1 = this.constants.a[1][0][0]; switch (selection) { - case 0: return image0.r * 255; - case 1: return image1.r * 255; - case 2: return image0.b * 255; - case 3: return image1.b * 255; + case 0: + return image0.r * 255; + case 1: + return image1.r * 255; + case 2: + return image0.b * 255; + case 3: + return image1.b * 255; } - }, { + }, + { output: [1], precision: 'unsigned', argumentTypes: ['Integer'], constants: { a: images1, - } - }); - assert.deepEqual(originalKernel(0)[0], 172); - assert.deepEqual(originalKernel(1)[0], 255); - assert.deepEqual(originalKernel(2)[0], 253); - assert.deepEqual(originalKernel(3)[0], 255); - const kernelString = originalKernel.toString(0); - const canvas = originalKernel.canvas; - const context = originalKernel.context; - const Kernel = new Function('return ' + kernelString)(); - const newKernel1 = Kernel({context, canvas, constants: { a: images1 }}); - assert.deepEqual(newKernel1(0)[0], 172); - assert.deepEqual(newKernel1(1)[0], 255); - assert.deepEqual(newKernel1(2)[0], 253); - assert.deepEqual(newKernel1(3)[0], 255); + }, + } + ); + assert.deepEqual(originalKernel(0)[0], 172); + assert.deepEqual(originalKernel(1)[0], 255); + assert.deepEqual(originalKernel(2)[0], 253); + assert.deepEqual(originalKernel(3)[0], 255); + const kernelString = originalKernel.toString(0); + const canvas = originalKernel.canvas; + const context = originalKernel.context; + const Kernel = new Function('return ' + kernelString)(); + const newKernel1 = Kernel({ context, canvas, constants: { a: images1 } }); + assert.deepEqual(newKernel1(0)[0], 172); + assert.deepEqual(newKernel1(1)[0], 255); + assert.deepEqual(newKernel1(2)[0], 253); + assert.deepEqual(newKernel1(3)[0], 255); - const newKernel2 = Kernel({context, canvas, constants: { a: images2 }}); - assert.deepEqual(newKernel2(0)[0], 0); - assert.deepEqual(newKernel2(1)[0], 73); - assert.deepEqual(newKernel2(2)[0], 255); - assert.deepEqual(newKernel2(3)[0], 253); - gpu.destroy(); - done(originalKernel, newKernel1); - }); + const newKernel2 = Kernel({ context, canvas, constants: { a: images2 } }); + assert.deepEqual(newKernel2(0)[0], 0); + assert.deepEqual(newKernel2(1)[0], 73); + assert.deepEqual(newKernel2(2)[0], 255); + assert.deepEqual(newKernel2(3)[0], 253); + gpu.destroy(); + done(originalKernel, newKernel1); + }); } (GPU.isWebGLSupported ? test : skip)('webgl', t => { const done = t.async(); - testArgument('webgl', (kernel) => { + testArgument('webgl', kernel => { // They aren't supported, so test that kernel falls back assert.equal(kernel.kernel.constructor, CPUKernel); done(); diff --git a/test/features/to-string/precision/unsigned/constants/html-image.js b/test/features/to-string/precision/unsigned/constants/html-image.js index fd19e827..9ac78776 100644 --- a/test/features/to-string/precision/unsigned/constants/html-image.js +++ b/test/features/to-string/precision/unsigned/constants/html-image.js @@ -5,32 +5,34 @@ const { loadImage, imageToArray, check2DImage } = require('../../../../../browse describe('feature: to-string unsigned precision constants HTMLImage'); function testArgument(mode, done) { - loadImages(['jellyfish-1.jpeg', 'jellyfish-2.jpeg']) - .then(([image1, image2]) => { - const gpu = new GPU({mode}); - const originalKernel = gpu.createKernel(function () { + loadImages(['jellyfish-1.jpeg', 'jellyfish-2.jpeg']).then(([image1, image2]) => { + const gpu = new GPU({ mode }); + const originalKernel = gpu.createKernel( + function () { const pixel = this.constants.a[0][0]; return pixel.b * 255; - }, { + }, + { output: [1], precision: 'unsigned', - constants: { a: image1 } - }); - const canvas = originalKernel.canvas; - const context = originalKernel.context; - assert.deepEqual(originalKernel()[0], 253); - const kernelString = originalKernel.toString(); - const newKernel = new Function('return ' + kernelString)()({ - context, - canvas, - constants: { - a: image2 - } - }); - assert.deepEqual(newKernel()[0], 255); - gpu.destroy(); - done(); + constants: { a: image1 }, + } + ); + const canvas = originalKernel.canvas; + const context = originalKernel.context; + assert.deepEqual(originalKernel()[0], 253); + const kernelString = originalKernel.toString(); + const newKernel = new Function('return ' + kernelString)()({ + context, + canvas, + constants: { + a: image2, + }, }); + assert.deepEqual(newKernel()[0], 255); + gpu.destroy(); + done(); + }); } (GPU.isWebGLSupported ? test : skip)('webgl', t => { @@ -40,5 +42,3 @@ function testArgument(mode, done) { (GPU.isWebGL2Supported ? test : skip)('webgl2', t => { testArgument('webgl2', t.async()); }); - - diff --git a/test/features/to-string/precision/unsigned/constants/input.js b/test/features/to-string/precision/unsigned/constants/input.js index 8b435a2a..1e7d0c49 100644 --- a/test/features/to-string/precision/unsigned/constants/input.js +++ b/test/features/to-string/precision/unsigned/constants/input.js @@ -5,31 +5,34 @@ describe('feature: to-string unsigned precision constants Input'); function testConstant(mode, context, canvas) { const gpu = new GPU({ mode }); - const a = input([1,2,3,4],[2,2]); - const originalKernel = gpu.createKernel(function() { - let sum = 0; - for (let y = 0; y < 2; y++) { - for (let x = 0; x < 2; x++) { - sum += this.constants.a[y][x]; + const a = input([1, 2, 3, 4], [2, 2]); + const originalKernel = gpu.createKernel( + function () { + let sum = 0; + for (let y = 0; y < 2; y++) { + for (let x = 0; x < 2; x++) { + sum += this.constants.a[y][x]; + } } + return sum; + }, + { + canvas, + context, + output: [1], + precision: 'unsigned', + constants: { + a, + }, } - return sum; - }, { - canvas, - context, - output: [1], - precision: 'unsigned', - constants: { - a - } - }); + ); assert.deepEqual(originalKernel()[0], 10); const kernelString = originalKernel.toString(); const Kernel = new Function('return ' + kernelString)(); const newKernel = Kernel({ context, constants: { a } }); assert.deepEqual(newKernel()[0], 10); - const b = input([1,1,1,1],[2,2]); + const b = input([1, 1, 1, 1], [2, 2]); const newKernel2 = Kernel({ context, constants: { a: b } }); assert.deepEqual(newKernel2()[0], 4); gpu.destroy(); diff --git a/test/features/to-string/precision/unsigned/constants/integer.js b/test/features/to-string/precision/unsigned/constants/integer.js index 8244c9d8..3e8e77fc 100644 --- a/test/features/to-string/precision/unsigned/constants/integer.js +++ b/test/features/to-string/precision/unsigned/constants/integer.js @@ -5,18 +5,21 @@ describe('feature: to-string unsigned precision constants Integer'); function testConstant(mode, context, canvas) { const gpu = new GPU({ mode }); - const originalKernel = gpu.createKernel(function() { - return Math.floor(this.constants.a) === 100 ? 42 : -42; - }, { - canvas, - context, - output: [1], - precision: 'unsigned', - constants: { - a: 100 + const originalKernel = gpu.createKernel( + function () { + return Math.floor(this.constants.a) === 100 ? 42 : -42; }, - constantTypes: { a: 'Integer' } - }); + { + canvas, + context, + output: [1], + precision: 'unsigned', + constants: { + a: 100, + }, + constantTypes: { a: 'Integer' }, + } + ); assert.equal(originalKernel.constantTypes.a, 'Integer'); assert.deepEqual(originalKernel()[0], 42); const kernelString = originalKernel.toString(); diff --git a/test/features/to-string/precision/unsigned/constants/memory-optimized-number-texture.js b/test/features/to-string/precision/unsigned/constants/memory-optimized-number-texture.js index bb65fcc9..303f7c35 100644 --- a/test/features/to-string/precision/unsigned/constants/memory-optimized-number-texture.js +++ b/test/features/to-string/precision/unsigned/constants/memory-optimized-number-texture.js @@ -5,40 +5,49 @@ describe('feature: to-string unsigned precision constants MemoryOptimizedNumberT function testConstant(mode, context, canvas) { const gpu = new GPU({ mode, context, canvas }); - const texture = gpu.createKernel(function() { - return this.thread.x; - }, { - output: [4], - optimizeFloatMemory: true, - precision: 'unsigned', - pipeline: true, - })(); - const texture2 = gpu.createKernel(function() { - return this.output.x - this.thread.x; - }, { - output: [4], - optimizeFloatMemory: true, - precision: 'unsigned', - pipeline: true, - })(); - const originalKernel = gpu.createKernel(function() { - return this.constants.a[this.thread.x]; - }, { - output: [4], - precision: 'unsigned', - constants: { - a: texture + const texture = gpu.createKernel( + function () { + return this.thread.x; + }, + { + output: [4], + optimizeFloatMemory: true, + precision: 'unsigned', + pipeline: true, } - }); - assert.deepEqual(originalKernel(), new Float32Array([0,1,2,3])); + )(); + const texture2 = gpu.createKernel( + function () { + return this.output.x - this.thread.x; + }, + { + output: [4], + optimizeFloatMemory: true, + precision: 'unsigned', + pipeline: true, + } + )(); + const originalKernel = gpu.createKernel( + function () { + return this.constants.a[this.thread.x]; + }, + { + output: [4], + precision: 'unsigned', + constants: { + a: texture, + }, + } + ); + assert.deepEqual(originalKernel(), new Float32Array([0, 1, 2, 3])); const kernelString = originalKernel.toString(); const Kernel = new Function('return ' + kernelString)(); const newKernel = Kernel({ context, constants: { a: texture } }); const newKernel2 = Kernel({ context, constants: { a: texture2 } }); - assert.deepEqual(texture2.toArray ? texture2.toArray() : texture2, new Float32Array([4,3,2,1])); - assert.deepEqual(texture.toArray ? texture.toArray() : texture, new Float32Array([0,1,2,3])); - assert.deepEqual(newKernel(), new Float32Array([0,1,2,3])); - assert.deepEqual(newKernel2(), new Float32Array([4,3,2,1])); + assert.deepEqual(texture2.toArray ? texture2.toArray() : texture2, new Float32Array([4, 3, 2, 1])); + assert.deepEqual(texture.toArray ? texture.toArray() : texture, new Float32Array([0, 1, 2, 3])); + assert.deepEqual(newKernel(), new Float32Array([0, 1, 2, 3])); + assert.deepEqual(newKernel2(), new Float32Array([4, 3, 2, 1])); gpu.destroy(); } diff --git a/test/features/to-string/precision/unsigned/constants/number-texture.js b/test/features/to-string/precision/unsigned/constants/number-texture.js index b41fd742..aff6b529 100644 --- a/test/features/to-string/precision/unsigned/constants/number-texture.js +++ b/test/features/to-string/precision/unsigned/constants/number-texture.js @@ -5,42 +5,51 @@ describe('feature: to-string unsigned precision constants NumberTexture'); function testConstant(mode, context, canvas) { const gpu = new GPU({ mode, context, canvas }); - const texture = gpu.createKernel(function() { - return this.thread.x; - }, { - output: [4], - optimizeFloatMemory: false, - precision: 'unsigned', - pipeline: true, - })(); - const texture2 = gpu.createKernel(function() { - return this.output.x - this.thread.x; - }, { - output: [4], - optimizeFloatMemory: false, - precision: 'unsigned', - pipeline: true, - })(); - const originalKernel = gpu.createKernel(function() { - return this.constants.a[this.thread.x]; - }, { - canvas, - context, - output: [4], - precision: 'unsigned', - constants: { - a: texture + const texture = gpu.createKernel( + function () { + return this.thread.x; + }, + { + output: [4], + optimizeFloatMemory: false, + precision: 'unsigned', + pipeline: true, } - }); - assert.deepEqual(originalKernel(), new Float32Array([0,1,2,3])); + )(); + const texture2 = gpu.createKernel( + function () { + return this.output.x - this.thread.x; + }, + { + output: [4], + optimizeFloatMemory: false, + precision: 'unsigned', + pipeline: true, + } + )(); + const originalKernel = gpu.createKernel( + function () { + return this.constants.a[this.thread.x]; + }, + { + canvas, + context, + output: [4], + precision: 'unsigned', + constants: { + a: texture, + }, + } + ); + assert.deepEqual(originalKernel(), new Float32Array([0, 1, 2, 3])); const kernelString = originalKernel.toString(); const Kernel = new Function('return ' + kernelString)(); const newKernel = Kernel({ context, constants: { a: texture } }); const newKernel2 = Kernel({ context, constants: { a: texture2 } }); - assert.deepEqual(texture2.toArray ? texture2.toArray() : texture2, new Float32Array([4,3,2,1])); - assert.deepEqual(texture.toArray ? texture.toArray() : texture, new Float32Array([0,1,2,3])); - assert.deepEqual(newKernel(), new Float32Array([0,1,2,3])); - assert.deepEqual(newKernel2(), new Float32Array([4,3,2,1])); + assert.deepEqual(texture2.toArray ? texture2.toArray() : texture2, new Float32Array([4, 3, 2, 1])); + assert.deepEqual(texture.toArray ? texture.toArray() : texture, new Float32Array([0, 1, 2, 3])); + assert.deepEqual(newKernel(), new Float32Array([0, 1, 2, 3])); + assert.deepEqual(newKernel2(), new Float32Array([4, 3, 2, 1])); gpu.destroy(); } diff --git a/test/features/to-string/precision/unsigned/graphical.js b/test/features/to-string/precision/unsigned/graphical.js index b6198589..2fa79210 100644 --- a/test/features/to-string/precision/unsigned/graphical.js +++ b/test/features/to-string/precision/unsigned/graphical.js @@ -5,26 +5,27 @@ describe('feature: to-string unsigned precision graphical'); function testGraphical(mode, context, canvas) { const gpu = new GPU({ mode }); - const originalKernel = gpu.createKernel(function() { - this.color(1,1,1,1); - }, { - canvas, - context, - output: [2,2], - precision: 'unsigned', - graphical: true, - }); + const originalKernel = gpu.createKernel( + function () { + this.color(1, 1, 1, 1); + }, + { + canvas, + context, + output: [2, 2], + precision: 'unsigned', + graphical: true, + } + ); - const expected = new Uint8ClampedArray([ - 255, 255, 255, 255, - 255, 255, 255, 255, - 255, 255, 255, 255, - 255, 255, 255, 255, - ]); + const expected = new Uint8ClampedArray([255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]); originalKernel(); assert.deepEqual(originalKernel.getPixels(), expected); const kernelString = originalKernel.toString(); - const newKernel = new Function('return ' + kernelString)()({ canvas, context }); + const newKernel = new Function('return ' + kernelString)()({ + canvas, + context, + }); newKernel(); assert.deepEqual(newKernel.getPixels(), expected); gpu.destroy(); diff --git a/test/features/to-string/precision/unsigned/kernel-map/array/array.js b/test/features/to-string/precision/unsigned/kernel-map/array/array.js index 093004f3..2181ed24 100644 --- a/test/features/to-string/precision/unsigned/kernel-map/array/array.js +++ b/test/features/to-string/precision/unsigned/kernel-map/array/array.js @@ -8,16 +8,20 @@ function testReturn(mode, context, canvas) { function addOne(value) { return value + 1; } - const originalKernel = gpu.createKernelMap([addOne], function(a) { - const result = a[this.thread.x] + 1; - addOne(result); - return result; - }, { - canvas, - context, - output: [6], - precision: 'unsigned', - }); + const originalKernel = gpu.createKernelMap( + [addOne], + function (a) { + const result = a[this.thread.x] + 1; + addOne(result); + return result; + }, + { + canvas, + context, + output: [6], + precision: 'unsigned', + } + ); const a = [1, 2, 3, 4, 5, 6]; const expected = new Float32Array([2, 3, 4, 5, 6, 7]); diff --git a/test/features/to-string/precision/unsigned/kernel-map/array/array2d.js b/test/features/to-string/precision/unsigned/kernel-map/array/array2d.js index e4d8c555..af2a8246 100644 --- a/test/features/to-string/precision/unsigned/kernel-map/array/array2d.js +++ b/test/features/to-string/precision/unsigned/kernel-map/array/array2d.js @@ -8,26 +8,24 @@ function testReturn(mode, context, canvas) { function addOne(value) { return value + 1; } - const originalKernel = gpu.createKernelMap([addOne], function(a) { - const result = a[this.thread.x] + 1; - addOne(result); - return result; - }, { - canvas, - context, - output: [2, 2], - precision: 'unsigned', - }); + const originalKernel = gpu.createKernelMap( + [addOne], + function (a) { + const result = a[this.thread.x] + 1; + addOne(result); + return result; + }, + { + canvas, + context, + output: [2, 2], + precision: 'unsigned', + } + ); const a = [1, 2, 3, 4, 5, 6]; - const expected = [ - new Float32Array([2, 3]), - new Float32Array([2, 3]), - ]; - const expectedZero = [ - new Float32Array([3, 4]), - new Float32Array([3, 4]), - ]; + const expected = [new Float32Array([2, 3]), new Float32Array([2, 3])]; + const expectedZero = [new Float32Array([3, 4]), new Float32Array([3, 4])]; const originalResult = originalKernel(a); assert.deepEqual(originalResult.result, expected); assert.deepEqual(originalResult[0], expectedZero); diff --git a/test/features/to-string/precision/unsigned/kernel-map/array/array3d.js b/test/features/to-string/precision/unsigned/kernel-map/array/array3d.js index 631d0c7f..f3529a4a 100644 --- a/test/features/to-string/precision/unsigned/kernel-map/array/array3d.js +++ b/test/features/to-string/precision/unsigned/kernel-map/array/array3d.js @@ -8,37 +8,29 @@ function testReturn(mode, context, canvas) { function addOne(value) { return value + 1; } - const originalKernel = gpu.createKernelMap([addOne], function(a) { - const result = a[this.thread.x] + 1; - addOne(result); - return result; - }, { - canvas, - context, - output: [2, 2, 2], - precision: 'unsigned', - }); + const originalKernel = gpu.createKernelMap( + [addOne], + function (a) { + const result = a[this.thread.x] + 1; + addOne(result); + return result; + }, + { + canvas, + context, + output: [2, 2, 2], + precision: 'unsigned', + } + ); const a = [1, 2]; const expected = [ - [ - new Float32Array([2, 3]), - new Float32Array([2, 3]), - ], - [ - new Float32Array([2, 3]), - new Float32Array([2, 3]), - ] + [new Float32Array([2, 3]), new Float32Array([2, 3])], + [new Float32Array([2, 3]), new Float32Array([2, 3])], ]; const expectedZero = [ - [ - new Float32Array([3, 4]), - new Float32Array([3, 4]), - ], - [ - new Float32Array([3, 4]), - new Float32Array([3, 4]), - ] + [new Float32Array([3, 4]), new Float32Array([3, 4])], + [new Float32Array([3, 4]), new Float32Array([3, 4])], ]; const originalResult = originalKernel(a); assert.deepEqual(originalResult.result, expected); diff --git a/test/features/to-string/precision/unsigned/kernel-map/array/memory-optimized-number-texture.js b/test/features/to-string/precision/unsigned/kernel-map/array/memory-optimized-number-texture.js index 783dbf72..afa141aa 100644 --- a/test/features/to-string/precision/unsigned/kernel-map/array/memory-optimized-number-texture.js +++ b/test/features/to-string/precision/unsigned/kernel-map/array/memory-optimized-number-texture.js @@ -8,18 +8,22 @@ function testReturn(mode, context, canvas) { function addOne(value) { return value + 1; } - const originalKernel = gpu.createKernelMap([addOne], function(a) { - const result = a[this.thread.x] + 1; - addOne(result); - return result; - }, { - canvas, - context, - output: [6], - precision: 'unsigned', - pipeline: true, - optimizeFloatMemory: true, - }); + const originalKernel = gpu.createKernelMap( + [addOne], + function (a) { + const result = a[this.thread.x] + 1; + addOne(result); + return result; + }, + { + canvas, + context, + output: [6], + precision: 'unsigned', + pipeline: true, + optimizeFloatMemory: true, + } + ); const a = [1, 2, 3, 4, 5, 6]; const expected = new Float32Array([2, 3, 4, 5, 6, 7]); diff --git a/test/features/to-string/precision/unsigned/kernel-map/array/number-texture.js b/test/features/to-string/precision/unsigned/kernel-map/array/number-texture.js index 3ace604a..2c73ae29 100644 --- a/test/features/to-string/precision/unsigned/kernel-map/array/number-texture.js +++ b/test/features/to-string/precision/unsigned/kernel-map/array/number-texture.js @@ -8,17 +8,21 @@ function testReturn(mode, context, canvas) { function addOne(value) { return value + 1; } - const originalKernel = gpu.createKernelMap([addOne], function(a) { - const result = a[this.thread.x] + 1; - addOne(result); - return result; - }, { - canvas, - context, - output: [6], - precision: 'unsigned', - pipeline: true, - }); + const originalKernel = gpu.createKernelMap( + [addOne], + function (a) { + const result = a[this.thread.x] + 1; + addOne(result); + return result; + }, + { + canvas, + context, + output: [6], + precision: 'unsigned', + pipeline: true, + } + ); const a = [1, 2, 3, 4, 5, 6]; const expected = new Float32Array([2, 3, 4, 5, 6, 7]); diff --git a/test/features/to-string/precision/unsigned/kernel-map/object/array.js b/test/features/to-string/precision/unsigned/kernel-map/object/array.js index 87c40562..a1e08f2d 100644 --- a/test/features/to-string/precision/unsigned/kernel-map/object/array.js +++ b/test/features/to-string/precision/unsigned/kernel-map/object/array.js @@ -8,16 +8,20 @@ function testReturn(mode, context, canvas) { function addOne(value) { return value + 1; } - const originalKernel = gpu.createKernelMap({ addOneResult: addOne }, function(a) { - const result = a[this.thread.x] + 1; - addOne(result); - return result; - }, { - canvas, - context, - output: [6], - precision: 'unsigned', - }); + const originalKernel = gpu.createKernelMap( + { addOneResult: addOne }, + function (a) { + const result = a[this.thread.x] + 1; + addOne(result); + return result; + }, + { + canvas, + context, + output: [6], + precision: 'unsigned', + } + ); const a = [1, 2, 3, 4, 5, 6]; const expected = new Float32Array([2, 3, 4, 5, 6, 7]); diff --git a/test/features/to-string/precision/unsigned/kernel-map/object/array2d.js b/test/features/to-string/precision/unsigned/kernel-map/object/array2d.js index 05b4231e..41f6c0fe 100644 --- a/test/features/to-string/precision/unsigned/kernel-map/object/array2d.js +++ b/test/features/to-string/precision/unsigned/kernel-map/object/array2d.js @@ -8,26 +8,24 @@ function testReturn(mode, context, canvas) { function addOne(value) { return value + 1; } - const originalKernel = gpu.createKernelMap({ addOneResult: addOne }, function(a) { - const result = a[this.thread.x] + 1; - addOne(result); - return result; - }, { - canvas, - context, - output: [2, 2], - precision: 'unsigned', - }); + const originalKernel = gpu.createKernelMap( + { addOneResult: addOne }, + function (a) { + const result = a[this.thread.x] + 1; + addOne(result); + return result; + }, + { + canvas, + context, + output: [2, 2], + precision: 'unsigned', + } + ); const a = [1, 2, 3, 4, 5, 6]; - const expected = [ - new Float32Array([2, 3]), - new Float32Array([2, 3]), - ]; - const expectedZero = [ - new Float32Array([3, 4]), - new Float32Array([3, 4]), - ]; + const expected = [new Float32Array([2, 3]), new Float32Array([2, 3])]; + const expectedZero = [new Float32Array([3, 4]), new Float32Array([3, 4])]; const originalResult = originalKernel(a); assert.deepEqual(originalResult.result, expected); assert.deepEqual(originalResult.addOneResult, expectedZero); diff --git a/test/features/to-string/precision/unsigned/kernel-map/object/array3d.js b/test/features/to-string/precision/unsigned/kernel-map/object/array3d.js index 16f1fede..f70b3838 100644 --- a/test/features/to-string/precision/unsigned/kernel-map/object/array3d.js +++ b/test/features/to-string/precision/unsigned/kernel-map/object/array3d.js @@ -8,37 +8,29 @@ function testReturn(mode, context, canvas) { function addOne(value) { return value + 1; } - const originalKernel = gpu.createKernelMap({ addOneResult: addOne }, function(a) { - const result = a[this.thread.x] + 1; - addOne(result); - return result; - }, { - canvas, - context, - output: [2, 2, 2], - precision: 'unsigned', - }); + const originalKernel = gpu.createKernelMap( + { addOneResult: addOne }, + function (a) { + const result = a[this.thread.x] + 1; + addOne(result); + return result; + }, + { + canvas, + context, + output: [2, 2, 2], + precision: 'unsigned', + } + ); const a = [1, 2]; const expected = [ - [ - new Float32Array([2, 3]), - new Float32Array([2, 3]), - ], - [ - new Float32Array([2, 3]), - new Float32Array([2, 3]), - ] + [new Float32Array([2, 3]), new Float32Array([2, 3])], + [new Float32Array([2, 3]), new Float32Array([2, 3])], ]; const expectedZero = [ - [ - new Float32Array([3, 4]), - new Float32Array([3, 4]), - ], - [ - new Float32Array([3, 4]), - new Float32Array([3, 4]), - ] + [new Float32Array([3, 4]), new Float32Array([3, 4])], + [new Float32Array([3, 4]), new Float32Array([3, 4])], ]; const originalResult = originalKernel(a); assert.deepEqual(originalResult.result, expected); diff --git a/test/features/to-string/precision/unsigned/kernel-map/object/memory-optimized-number-texture.js b/test/features/to-string/precision/unsigned/kernel-map/object/memory-optimized-number-texture.js index 6df0bf2e..0142cf1a 100644 --- a/test/features/to-string/precision/unsigned/kernel-map/object/memory-optimized-number-texture.js +++ b/test/features/to-string/precision/unsigned/kernel-map/object/memory-optimized-number-texture.js @@ -8,18 +8,22 @@ function testReturn(mode, context, canvas) { function addOne(value) { return value + 1; } - const originalKernel = gpu.createKernelMap({ addOneResult: addOne }, function(a) { - const result = a[this.thread.x] + 1; - addOne(result); - return result; - }, { - canvas, - context, - output: [6], - precision: 'unsigned', - pipeline: true, - optimizeFloatMemory: true, - }); + const originalKernel = gpu.createKernelMap( + { addOneResult: addOne }, + function (a) { + const result = a[this.thread.x] + 1; + addOne(result); + return result; + }, + { + canvas, + context, + output: [6], + precision: 'unsigned', + pipeline: true, + optimizeFloatMemory: true, + } + ); const a = [1, 2, 3, 4, 5, 6]; const expected = new Float32Array([2, 3, 4, 5, 6, 7]); diff --git a/test/features/to-string/precision/unsigned/kernel-map/object/number-texture.js b/test/features/to-string/precision/unsigned/kernel-map/object/number-texture.js index 22607128..8d886178 100644 --- a/test/features/to-string/precision/unsigned/kernel-map/object/number-texture.js +++ b/test/features/to-string/precision/unsigned/kernel-map/object/number-texture.js @@ -8,17 +8,21 @@ function testReturn(mode, context, canvas) { function addOne(value) { return value + 1; } - const originalKernel = gpu.createKernelMap({ addOneResult: addOne }, function(a) { - const result = a[this.thread.x] + 1; - addOne(result); - return result; - }, { - canvas, - context, - output: [6], - precision: 'unsigned', - pipeline: true, - }); + const originalKernel = gpu.createKernelMap( + { addOneResult: addOne }, + function (a) { + const result = a[this.thread.x] + 1; + addOne(result); + return result; + }, + { + canvas, + context, + output: [6], + precision: 'unsigned', + pipeline: true, + } + ); const a = [1, 2, 3, 4, 5, 6]; const expected = new Float32Array([2, 3, 4, 5, 6, 7]); diff --git a/test/features/to-string/precision/unsigned/returns/array.js b/test/features/to-string/precision/unsigned/returns/array.js index 612aad73..6f31d1ca 100644 --- a/test/features/to-string/precision/unsigned/returns/array.js +++ b/test/features/to-string/precision/unsigned/returns/array.js @@ -5,14 +5,17 @@ describe('feature: to-string unsigned precision returns Array'); function testReturn(mode, context, canvas) { const gpu = new GPU({ mode }); - const originalKernel = gpu.createKernel(function(a) { - return a[this.thread.x] + 1; - }, { - canvas, - context, - output: [6], - precision: 'unsigned', - }); + const originalKernel = gpu.createKernel( + function (a) { + return a[this.thread.x] + 1; + }, + { + canvas, + context, + output: [6], + precision: 'unsigned', + } + ); const a = [1, 2, 3, 4, 5, 6]; const expected = new Float32Array([2, 3, 4, 5, 6, 7]); diff --git a/test/features/to-string/precision/unsigned/returns/array2d.js b/test/features/to-string/precision/unsigned/returns/array2d.js index eacfc731..ead84e9b 100644 --- a/test/features/to-string/precision/unsigned/returns/array2d.js +++ b/test/features/to-string/precision/unsigned/returns/array2d.js @@ -5,21 +5,21 @@ describe('feature: to-string unsigned precision returns Array2D'); function testReturn(mode, context, canvas) { const gpu = new GPU({ mode }); - const originalKernel = gpu.createKernel(function(a, b) { - return a[this.thread.x] + b[this.thread.y]; - }, { - canvas, - context, - output: [2, 2], - precision: 'unsigned', - }); + const originalKernel = gpu.createKernel( + function (a, b) { + return a[this.thread.x] + b[this.thread.y]; + }, + { + canvas, + context, + output: [2, 2], + precision: 'unsigned', + } + ); const a = [1, 2]; const b = [2, 3]; - const expected = [ - new Float32Array([3, 4]), - new Float32Array([4, 5]), - ]; + const expected = [new Float32Array([3, 4]), new Float32Array([4, 5])]; const originalResult = originalKernel(a, b); assert.deepEqual(originalResult, expected); const kernelString = originalKernel.toString(a, b); diff --git a/test/features/to-string/precision/unsigned/returns/array3d.js b/test/features/to-string/precision/unsigned/returns/array3d.js index edebde18..15423855 100644 --- a/test/features/to-string/precision/unsigned/returns/array3d.js +++ b/test/features/to-string/precision/unsigned/returns/array3d.js @@ -5,26 +5,24 @@ describe('feature: to-string unsigned precision returns Array3d'); function testReturn(mode, context, canvas) { const gpu = new GPU({ mode }); - const originalKernel = gpu.createKernel(function(a, b, c) { - return a[this.thread.x] + b[this.thread.y] + c[this.thread.z]; - }, { - canvas, - context, - output: [2, 2, 2], - precision: 'unsigned', - }); + const originalKernel = gpu.createKernel( + function (a, b, c) { + return a[this.thread.x] + b[this.thread.y] + c[this.thread.z]; + }, + { + canvas, + context, + output: [2, 2, 2], + precision: 'unsigned', + } + ); const a = [1, 2]; const b = [3, 4]; const c = [5, 6]; const expected = [ - [ - new Float32Array([9,10]), - new Float32Array([10,11]), - ],[ - new Float32Array([10,11]), - new Float32Array([11,12]), - ] + [new Float32Array([9, 10]), new Float32Array([10, 11])], + [new Float32Array([10, 11]), new Float32Array([11, 12])], ]; const originalResult = originalKernel(a, b, c); assert.deepEqual(originalResult, expected); diff --git a/test/features/to-string/precision/unsigned/returns/texture.js b/test/features/to-string/precision/unsigned/returns/texture.js index 6edc33f2..8bc59bb5 100644 --- a/test/features/to-string/precision/unsigned/returns/texture.js +++ b/test/features/to-string/precision/unsigned/returns/texture.js @@ -5,15 +5,18 @@ describe('feature: to-string unsigned precision returns Texture'); function testReturn(mode, context, canvas) { const gpu = new GPU({ mode }); - const originalKernel = gpu.createKernel(function(a) { - return a[this.thread.x] + 1; - }, { - canvas, - context, - output: [6], - precision: 'unsigned', - pipeline: true, - }); + const originalKernel = gpu.createKernel( + function (a) { + return a[this.thread.x] + 1; + }, + { + canvas, + context, + output: [6], + precision: 'unsigned', + pipeline: true, + } + ); const a = [1, 2, 3, 4, 5, 6]; const expected = new Float32Array([2, 3, 4, 5, 6, 7]); diff --git a/test/features/type-management.js b/test/features/type-management.js index f108827c..d2d4822e 100644 --- a/test/features/type-management.js +++ b/test/features/type-management.js @@ -4,555 +4,845 @@ const { GPU, WebGLFunctionNode, WebGL2FunctionNode, CPUFunctionNode } = require( describe('features: type management'); test('arrays directly - Array(2) webgl', () => { - const node = new WebGLFunctionNode((function direct() { - return [0, 0]; - }).toString(), { returnType: 'Array(2)', output: [1] }); - assert.equal(node.toString(), 'vec2 direct() {\n\ + const node = new WebGLFunctionNode( + function direct() { + return [0, 0]; + }.toString(), + { returnType: 'Array(2)', output: [1] } + ); + assert.equal( + node.toString(), + 'vec2 direct() {\n\ return vec2(0.0, 0.0);\n\ -}'); +}' + ); }); test('arrays directly - Array(2) webgl2', () => { - const node = new WebGL2FunctionNode((function direct() { - return [0, 0]; - }).toString(), { returnType: 'Array(2)', output: [1] }); - assert.equal(node.toString(), 'vec2 direct() {\n\ + const node = new WebGL2FunctionNode( + function direct() { + return [0, 0]; + }.toString(), + { returnType: 'Array(2)', output: [1] } + ); + assert.equal( + node.toString(), + 'vec2 direct() {\n\ return vec2(0.0, 0.0);\n\ -}'); +}' + ); }); test('arrays directly - Array(2) cpu', () => { - const node = new CPUFunctionNode((function direct() { - return [0, 0]; - }).toString(), { returnType: 'Array(2)', output: [1] }); - assert.equal(node.toString(), 'function direct() {\n\ + const node = new CPUFunctionNode( + function direct() { + return [0, 0]; + }.toString(), + { returnType: 'Array(2)', output: [1] } + ); + assert.equal( + node.toString(), + 'function direct() {\n\ return new Float32Array([0, 0]);\n\ -}'); +}' + ); }); test('arrays directly - Array(3) webgl', () => { - const node = new WebGLFunctionNode((function direct() { - return [0, 0, 0]; - }).toString(), { returnType: 'Array(3)', output: [1] }); - assert.equal(node.toString(), 'vec3 direct() {\n\ + const node = new WebGLFunctionNode( + function direct() { + return [0, 0, 0]; + }.toString(), + { returnType: 'Array(3)', output: [1] } + ); + assert.equal( + node.toString(), + 'vec3 direct() {\n\ return vec3(0.0, 0.0, 0.0);\n\ -}'); +}' + ); }); test('arrays directly - Array(3) webgl2', () => { - const node = new WebGL2FunctionNode((function direct() { - return [0, 0, 0]; - }).toString(), { returnType: 'Array(3)', output: [1] }); - assert.equal(node.toString(), 'vec3 direct() {\n\ + const node = new WebGL2FunctionNode( + function direct() { + return [0, 0, 0]; + }.toString(), + { returnType: 'Array(3)', output: [1] } + ); + assert.equal( + node.toString(), + 'vec3 direct() {\n\ return vec3(0.0, 0.0, 0.0);\n\ -}'); +}' + ); }); test('arrays directly - Array(3) cpu', () => { - const node = new CPUFunctionNode((function direct() { - return [0, 0, 0]; - }).toString(), { returnType: 'Array(3)', output: [1] }); - assert.equal(node.toString(), 'function direct() {\n\ + const node = new CPUFunctionNode( + function direct() { + return [0, 0, 0]; + }.toString(), + { returnType: 'Array(3)', output: [1] } + ); + assert.equal( + node.toString(), + 'function direct() {\n\ return new Float32Array([0, 0, 0]);\n\ -}'); +}' + ); }); - test('arrays directly - Array(4) webgl', () => { - const node = new WebGLFunctionNode((function direct() { - return [0, 0, 0, 0]; - }).toString(), { returnType: 'Array(4)', output: [1] }); - assert.equal(node.toString(), 'vec4 direct() {\n\ + const node = new WebGLFunctionNode( + function direct() { + return [0, 0, 0, 0]; + }.toString(), + { returnType: 'Array(4)', output: [1] } + ); + assert.equal( + node.toString(), + 'vec4 direct() {\n\ return vec4(0.0, 0.0, 0.0, 0.0);\n\ -}'); +}' + ); }); test('arrays directly - Array(4) webgl2', () => { - const node = new WebGL2FunctionNode((function direct() { - return [0, 0, 0, 0]; - }).toString(), { returnType: 'Array(4)', output: [1] }); - assert.equal(node.toString(), 'vec4 direct() {\n\ + const node = new WebGL2FunctionNode( + function direct() { + return [0, 0, 0, 0]; + }.toString(), + { returnType: 'Array(4)', output: [1] } + ); + assert.equal( + node.toString(), + 'vec4 direct() {\n\ return vec4(0.0, 0.0, 0.0, 0.0);\n\ -}'); -}); -test("arrays directly - Array(4) cpu", function(assert) { - const node = new CPUFunctionNode((function direct() { - return [0, 0, 0, 0]; - }).toString(), { returnType: 'Array(4)', output: [1] }); - assert.equal(node.toString(), 'function direct() {\n\ +}' + ); +}); +test('arrays directly - Array(4) cpu', function (assert) { + const node = new CPUFunctionNode( + function direct() { + return [0, 0, 0, 0]; + }.toString(), + { returnType: 'Array(4)', output: [1] } + ); + assert.equal( + node.toString(), + 'function direct() {\n\ return new Float32Array([0, 0, 0, 0]);\n\ -}'); +}' + ); }); - test('arrays referenced directly - Array(2) webgl', () => { - const node = new WebGLFunctionNode((function refDirect() { - const array = [0, 0]; - return array; - }).toString(), { returnType: 'Array(2)', output: [1] }); - assert.equal(node.toString(), 'vec2 refDirect() {\n\ + const node = new WebGLFunctionNode( + function refDirect() { + const array = [0, 0]; + return array; + }.toString(), + { returnType: 'Array(2)', output: [1] } + ); + assert.equal( + node.toString(), + 'vec2 refDirect() {\n\ vec2 user_array=vec2(0.0, 0.0);\n\ return user_array;\n\ -}'); +}' + ); }); test('arrays referenced directly - Array(2) webgl2', () => { - const node = new WebGL2FunctionNode((function refDirect() { - const array = [0, 0]; - return array; - }).toString(), { returnType: 'Array(2)', output: [1] }); - assert.equal(node.toString(), 'vec2 refDirect() {\n\ + const node = new WebGL2FunctionNode( + function refDirect() { + const array = [0, 0]; + return array; + }.toString(), + { returnType: 'Array(2)', output: [1] } + ); + assert.equal( + node.toString(), + 'vec2 refDirect() {\n\ vec2 user_array=vec2(0.0, 0.0);\n\ return user_array;\n\ -}'); +}' + ); }); test('arrays referenced directly - Array(2) cpu', () => { - const node = new CPUFunctionNode((function refDirect() { - const array = [0, 0]; - return array; - }).toString(), { returnType: 'Array(2)', output: [1] }); - assert.equal(node.toString(), 'function refDirect() {\n\ + const node = new CPUFunctionNode( + function refDirect() { + const array = [0, 0]; + return array; + }.toString(), + { returnType: 'Array(2)', output: [1] } + ); + assert.equal( + node.toString(), + 'function refDirect() {\n\ const user_array=new Float32Array([0, 0]);\n\ return user_array;\n\ -}'); +}' + ); }); - test('arrays referenced directly - Array(3) webgl', () => { - const node = new WebGLFunctionNode((function refDirect() { - const array = [0, 0, 0]; - return array; - }).toString(), { returnType: 'Array(3)', output: [1] }); - assert.equal(node.toString(), 'vec3 refDirect() {\n\ + const node = new WebGLFunctionNode( + function refDirect() { + const array = [0, 0, 0]; + return array; + }.toString(), + { returnType: 'Array(3)', output: [1] } + ); + assert.equal( + node.toString(), + 'vec3 refDirect() {\n\ vec3 user_array=vec3(0.0, 0.0, 0.0);\n\ return user_array;\n\ -}'); +}' + ); }); test('arrays referenced directly - Array(3) webgl2', () => { - const node = new WebGL2FunctionNode((function refDirect() { - const array = [0, 0, 0]; - return array; - }).toString(), { returnType: 'Array(3)', output: [1] }); - assert.equal(node.toString(), 'vec3 refDirect() {\n\ + const node = new WebGL2FunctionNode( + function refDirect() { + const array = [0, 0, 0]; + return array; + }.toString(), + { returnType: 'Array(3)', output: [1] } + ); + assert.equal( + node.toString(), + 'vec3 refDirect() {\n\ vec3 user_array=vec3(0.0, 0.0, 0.0);\n\ return user_array;\n\ -}'); +}' + ); }); test('arrays referenced directly - Array(3) cpu', () => { - const node = new CPUFunctionNode((function refDirect() { - const array = [0, 0, 0]; - return array; - }).toString(), { returnType: 'Array(3)', output: [1] }); - assert.equal(node.toString(), 'function refDirect() {\n\ + const node = new CPUFunctionNode( + function refDirect() { + const array = [0, 0, 0]; + return array; + }.toString(), + { returnType: 'Array(3)', output: [1] } + ); + assert.equal( + node.toString(), + 'function refDirect() {\n\ const user_array=new Float32Array([0, 0, 0]);\n\ return user_array;\n\ -}'); +}' + ); }); - test('arrays referenced directly - Array(4) webgl', () => { - const node = new WebGLFunctionNode((function refDirect() { - const array = [0, 0, 0, 0]; - return array; - }).toString(), { returnType: 'Array(4)', output: [1] }); - assert.equal(node.toString(), 'vec4 refDirect() {\n\ + const node = new WebGLFunctionNode( + function refDirect() { + const array = [0, 0, 0, 0]; + return array; + }.toString(), + { returnType: 'Array(4)', output: [1] } + ); + assert.equal( + node.toString(), + 'vec4 refDirect() {\n\ vec4 user_array=vec4(0.0, 0.0, 0.0, 0.0);\n\ return user_array;\n\ -}'); +}' + ); }); test('arrays referenced directly - Array(4) webgl2', () => { - const node = new WebGL2FunctionNode((function refDirect() { - const array = [0, 0, 0, 0]; - return array; - }).toString(), { returnType: 'Array(4)', output: [1] }); - assert.equal(node.toString(), 'vec4 refDirect() {\n\ + const node = new WebGL2FunctionNode( + function refDirect() { + const array = [0, 0, 0, 0]; + return array; + }.toString(), + { returnType: 'Array(4)', output: [1] } + ); + assert.equal( + node.toString(), + 'vec4 refDirect() {\n\ vec4 user_array=vec4(0.0, 0.0, 0.0, 0.0);\n\ return user_array;\n\ -}'); +}' + ); }); test('arrays referenced directly - Array(4) cpu', () => { - const node = new CPUFunctionNode((function refDirect() { - const array = [0, 0, 0, 0]; - return array; - }).toString(), { returnType: 'Array(4)', output: [1] }); - assert.equal(node.toString(), 'function refDirect() {\n\ + const node = new CPUFunctionNode( + function refDirect() { + const array = [0, 0, 0, 0]; + return array; + }.toString(), + { returnType: 'Array(4)', output: [1] } + ); + assert.equal( + node.toString(), + 'function refDirect() {\n\ const user_array=new Float32Array([0, 0, 0, 0]);\n\ return user_array;\n\ -}'); +}' + ); }); - test('arrays referenced indirectly - Array(2) webgl', () => { - const node = new WebGLFunctionNode((function indirect() { - const array = [0, 0]; - const array2 = array; - return array2; - }).toString(), { returnType: 'Array(2)', output: [1] }); - assert.equal(node.toString(), 'vec2 indirect() {\n\ + const node = new WebGLFunctionNode( + function indirect() { + const array = [0, 0]; + const array2 = array; + return array2; + }.toString(), + { returnType: 'Array(2)', output: [1] } + ); + assert.equal( + node.toString(), + 'vec2 indirect() {\n\ vec2 user_array=vec2(0.0, 0.0);\n\ vec2 user_array2=user_array;\n\ return user_array2;\n\ -}'); +}' + ); }); test('arrays referenced indirectly - Array(2) webgl2', () => { - const node = new WebGL2FunctionNode((function indirect() { - const array = [0, 0]; - const array2 = array; - return array2; - }).toString(), { returnType: 'Array(2)', output: [1] }); - assert.equal(node.toString(), 'vec2 indirect() {\n\ + const node = new WebGL2FunctionNode( + function indirect() { + const array = [0, 0]; + const array2 = array; + return array2; + }.toString(), + { returnType: 'Array(2)', output: [1] } + ); + assert.equal( + node.toString(), + 'vec2 indirect() {\n\ vec2 user_array=vec2(0.0, 0.0);\n\ vec2 user_array2=user_array;\n\ return user_array2;\n\ -}'); +}' + ); }); test('arrays referenced indirectly - Array(2) cpu', () => { - const node = new CPUFunctionNode((function indirect() { - const array = [0, 0]; - const array2 = array; - return array2; - }).toString(), { returnType: 'Array(2)', output: [1] }); - assert.equal(node.toString(), 'function indirect() {\n\ + const node = new CPUFunctionNode( + function indirect() { + const array = [0, 0]; + const array2 = array; + return array2; + }.toString(), + { returnType: 'Array(2)', output: [1] } + ); + assert.equal( + node.toString(), + 'function indirect() {\n\ const user_array=new Float32Array([0, 0]);\n\ const user_array2=user_array;\n\ return user_array2;\n\ -}'); +}' + ); }); - test('arrays referenced indirectly - Array(3) webgl', () => { - const node = new WebGLFunctionNode((function indirect() { - const array = [0, 0, 0]; - const array2 = array; - return array2; - }).toString(), { returnType: 'Array(3)', output: [1] }); - assert.equal(node.toString(), 'vec3 indirect() {\n\ + const node = new WebGLFunctionNode( + function indirect() { + const array = [0, 0, 0]; + const array2 = array; + return array2; + }.toString(), + { returnType: 'Array(3)', output: [1] } + ); + assert.equal( + node.toString(), + 'vec3 indirect() {\n\ vec3 user_array=vec3(0.0, 0.0, 0.0);\n\ vec3 user_array2=user_array;\n\ return user_array2;\n\ -}'); +}' + ); }); test('arrays referenced indirectly - Array(3) webgl2', () => { - const node = new WebGL2FunctionNode((function indirect() { - const array = [0, 0, 0]; - const array2 = array; - return array2; - }).toString(), { returnType: 'Array(3)', output: [1] }); - assert.equal(node.toString(), 'vec3 indirect() {\n\ + const node = new WebGL2FunctionNode( + function indirect() { + const array = [0, 0, 0]; + const array2 = array; + return array2; + }.toString(), + { returnType: 'Array(3)', output: [1] } + ); + assert.equal( + node.toString(), + 'vec3 indirect() {\n\ vec3 user_array=vec3(0.0, 0.0, 0.0);\n\ vec3 user_array2=user_array;\n\ return user_array2;\n\ -}'); +}' + ); }); test('arrays referenced indirectly - Array(3) cpu', () => { - const node = new CPUFunctionNode((function indirect() { - const array = [0, 0, 0]; - const array2 = array; - return array2; - }).toString(), { returnType: 'Array(3)', output: [1] }); - assert.equal(node.toString(), 'function indirect() {\n\ + const node = new CPUFunctionNode( + function indirect() { + const array = [0, 0, 0]; + const array2 = array; + return array2; + }.toString(), + { returnType: 'Array(3)', output: [1] } + ); + assert.equal( + node.toString(), + 'function indirect() {\n\ const user_array=new Float32Array([0, 0, 0]);\n\ const user_array2=user_array;\n\ return user_array2;\n\ -}'); +}' + ); }); - test('arrays referenced indirectly - Array(4) webgl', () => { - const node = new WebGLFunctionNode((function indirect() { - const array = [0, 0, 0, 0]; - const array2 = array; - return array2; - }).toString(), { returnType: 'Array(4)', output: [1] }); - assert.equal(node.toString(), 'vec4 indirect() {\n\ + const node = new WebGLFunctionNode( + function indirect() { + const array = [0, 0, 0, 0]; + const array2 = array; + return array2; + }.toString(), + { returnType: 'Array(4)', output: [1] } + ); + assert.equal( + node.toString(), + 'vec4 indirect() {\n\ vec4 user_array=vec4(0.0, 0.0, 0.0, 0.0);\n\ vec4 user_array2=user_array;\n\ return user_array2;\n\ -}'); +}' + ); }); test('arrays referenced indirectly - Array(4) webgl2', () => { - const node = new WebGL2FunctionNode((function indirect() { - const array = [0, 0, 0, 0]; - const array2 = array; - return array2; - }).toString(), { returnType: 'Array(4)', output: [1] }); - assert.equal(node.toString(), 'vec4 indirect() {\n\ + const node = new WebGL2FunctionNode( + function indirect() { + const array = [0, 0, 0, 0]; + const array2 = array; + return array2; + }.toString(), + { returnType: 'Array(4)', output: [1] } + ); + assert.equal( + node.toString(), + 'vec4 indirect() {\n\ vec4 user_array=vec4(0.0, 0.0, 0.0, 0.0);\n\ vec4 user_array2=user_array;\n\ return user_array2;\n\ -}'); +}' + ); }); test('arrays referenced indirectly - Array(4) cpu', () => { - const node = new CPUFunctionNode((function indirect() { - const array = [0, 0, 0, 0]; - const array2 = array; - return array2; - }).toString(), { returnType: 'Array(4)', output: [1] }); - assert.equal(node.toString(), 'function indirect() {\n\ + const node = new CPUFunctionNode( + function indirect() { + const array = [0, 0, 0, 0]; + const array2 = array; + return array2; + }.toString(), + { returnType: 'Array(4)', output: [1] } + ); + assert.equal( + node.toString(), + 'function indirect() {\n\ const user_array=new Float32Array([0, 0, 0, 0]);\n\ const user_array2=user_array;\n\ return user_array2;\n\ -}'); +}' + ); }); - test('arrays arguments - Array(2) webgl', () => { - const node = new WebGLFunctionNode((function arrayArguments(array, array2) { - const array3 = [0, 0]; - array3[0] = array[0]; - array3[1] = array[1] * array2[1]; - return array3; - }).toString(), { argumentTypes: ['Array(2)', 'Array(2)'], output: [1] }); - assert.equal(node.toString(), 'vec2 arrayArguments(vec2 user_array, vec2 user_array2) {\n\ + const node = new WebGLFunctionNode( + function arrayArguments(array, array2) { + const array3 = [0, 0]; + array3[0] = array[0]; + array3[1] = array[1] * array2[1]; + return array3; + }.toString(), + { argumentTypes: ['Array(2)', 'Array(2)'], output: [1] } + ); + assert.equal( + node.toString(), + 'vec2 arrayArguments(vec2 user_array, vec2 user_array2) {\n\ vec2 user_array3=vec2(0.0, 0.0);\n\ user_array3[0]=user_array[0];\n\ user_array3[1]=(user_array[1]*user_array2[1]);\n\ return user_array3;\n\ -}'); +}' + ); }); test('arrays arguments - Array(2) webgl2', () => { - const node = new WebGL2FunctionNode((function arrayArguments(array, array2) { - const array3 = [0, 0]; - array3[0] = array[0]; - array3[1] = array[1] * array2[1]; - return array3; - }).toString(), { argumentTypes: ['Array(2)', 'Array(2)'], output: [1] }); - assert.equal(node.toString(), 'vec2 arrayArguments(vec2 user_array, vec2 user_array2) {\n\ + const node = new WebGL2FunctionNode( + function arrayArguments(array, array2) { + const array3 = [0, 0]; + array3[0] = array[0]; + array3[1] = array[1] * array2[1]; + return array3; + }.toString(), + { argumentTypes: ['Array(2)', 'Array(2)'], output: [1] } + ); + assert.equal( + node.toString(), + 'vec2 arrayArguments(vec2 user_array, vec2 user_array2) {\n\ vec2 user_array3=vec2(0.0, 0.0);\n\ user_array3[0]=user_array[0];\n\ user_array3[1]=(user_array[1]*user_array2[1]);\n\ return user_array3;\n\ -}'); +}' + ); }); test('arrays arguments - Array(2) cpu', () => { - const node = new CPUFunctionNode((function arrayArguments(array, array2) { - const array3 = [0, 0]; - array3[0] = array[0]; - array3[1] = array[1] * array2[1]; - return array3; - }).toString(), { argumentTypes: ['Array(2)', 'Array(2)'], output: [1] }); - assert.equal(node.toString(), 'function arrayArguments(user_array, user_array2) {\n\ + const node = new CPUFunctionNode( + function arrayArguments(array, array2) { + const array3 = [0, 0]; + array3[0] = array[0]; + array3[1] = array[1] * array2[1]; + return array3; + }.toString(), + { argumentTypes: ['Array(2)', 'Array(2)'], output: [1] } + ); + assert.equal( + node.toString(), + 'function arrayArguments(user_array, user_array2) {\n\ const user_array3=new Float32Array([0, 0]);\n\ user_array3[0]=user_array[0];\n\ user_array3[1]=(user_array[1]*user_array2[1]);\n\ return user_array3;\n\ -}'); +}' + ); }); test('arrays arguments - Array(3) webgl', () => { - const node = new WebGLFunctionNode((function arrayArguments(array, array2) { - const array3 = [0, 0, 0]; - array3[0] = array[0]; - array3[1] = array[1] * array2[1]; - return array3; - }).toString(), { argumentTypes: ['Array(3)', 'Array(3)'], output: [1] }); - assert.equal(node.toString(), 'vec3 arrayArguments(vec3 user_array, vec3 user_array2) {\n\ + const node = new WebGLFunctionNode( + function arrayArguments(array, array2) { + const array3 = [0, 0, 0]; + array3[0] = array[0]; + array3[1] = array[1] * array2[1]; + return array3; + }.toString(), + { argumentTypes: ['Array(3)', 'Array(3)'], output: [1] } + ); + assert.equal( + node.toString(), + 'vec3 arrayArguments(vec3 user_array, vec3 user_array2) {\n\ vec3 user_array3=vec3(0.0, 0.0, 0.0);\n\ user_array3[0]=user_array[0];\n\ user_array3[1]=(user_array[1]*user_array2[1]);\n\ return user_array3;\n\ -}'); +}' + ); }); test('arrays arguments - Array(3) webgl2', () => { - const node = new WebGL2FunctionNode((function arrayArguments(array, array2) { - const array3 = [0, 0, 0]; - array3[0] = array[0]; - array3[1] = array[1] * array2[1]; - return array3; - }).toString(), { argumentTypes: ['Array(3)', 'Array(3)'], output: [1] }); - assert.equal(node.toString(), 'vec3 arrayArguments(vec3 user_array, vec3 user_array2) {\n\ + const node = new WebGL2FunctionNode( + function arrayArguments(array, array2) { + const array3 = [0, 0, 0]; + array3[0] = array[0]; + array3[1] = array[1] * array2[1]; + return array3; + }.toString(), + { argumentTypes: ['Array(3)', 'Array(3)'], output: [1] } + ); + assert.equal( + node.toString(), + 'vec3 arrayArguments(vec3 user_array, vec3 user_array2) {\n\ vec3 user_array3=vec3(0.0, 0.0, 0.0);\n\ user_array3[0]=user_array[0];\n\ user_array3[1]=(user_array[1]*user_array2[1]);\n\ return user_array3;\n\ -}'); +}' + ); }); test('arrays arguments - Array(3) cpu', () => { - const node = new CPUFunctionNode((function arrayArguments(array, array2) { - const array3 = [0, 0, 0]; - array3[0] = array[0]; - array3[1] = array[1] * array2[1]; - return array3; - }).toString(), { argumentTypes: ['Array(3)', 'Array(3)'], output: [1] }); - assert.equal(node.toString(), 'function arrayArguments(user_array, user_array2) {\n\ + const node = new CPUFunctionNode( + function arrayArguments(array, array2) { + const array3 = [0, 0, 0]; + array3[0] = array[0]; + array3[1] = array[1] * array2[1]; + return array3; + }.toString(), + { argumentTypes: ['Array(3)', 'Array(3)'], output: [1] } + ); + assert.equal( + node.toString(), + 'function arrayArguments(user_array, user_array2) {\n\ const user_array3=new Float32Array([0, 0, 0]);\n\ user_array3[0]=user_array[0];\n\ user_array3[1]=(user_array[1]*user_array2[1]);\n\ return user_array3;\n\ -}'); +}' + ); }); - test('arrays arguments - Array(4) webgl', () => { - const node = new WebGLFunctionNode((function arrayArguments(array, array2) { - const array3 = [0, 0, 0, 0]; - array3[0] = array[0]; - array3[1] = array[1] * array2[1]; - return array3; - }).toString(), { argumentTypes: ['Array(4)', 'Array(4)'], output: [1] }); - assert.equal(node.toString(), 'vec4 arrayArguments(vec4 user_array, vec4 user_array2) {\n\ + const node = new WebGLFunctionNode( + function arrayArguments(array, array2) { + const array3 = [0, 0, 0, 0]; + array3[0] = array[0]; + array3[1] = array[1] * array2[1]; + return array3; + }.toString(), + { argumentTypes: ['Array(4)', 'Array(4)'], output: [1] } + ); + assert.equal( + node.toString(), + 'vec4 arrayArguments(vec4 user_array, vec4 user_array2) {\n\ vec4 user_array3=vec4(0.0, 0.0, 0.0, 0.0);\n\ user_array3[0]=user_array[0];\n\ user_array3[1]=(user_array[1]*user_array2[1]);\n\ return user_array3;\n\ -}'); +}' + ); }); test('arrays arguments - Array(4) webgl2', () => { - const node = new WebGL2FunctionNode((function arrayArguments(array, array2) { - const array3 = [0, 0, 0, 0]; - array3[0] = array[0]; - array3[1] = array[1] * array2[1]; - return array3; - }).toString(), { argumentTypes: ['Array(4)', 'Array(4)'], output: [1] }); - assert.equal(node.toString(), 'vec4 arrayArguments(vec4 user_array, vec4 user_array2) {\n\ + const node = new WebGL2FunctionNode( + function arrayArguments(array, array2) { + const array3 = [0, 0, 0, 0]; + array3[0] = array[0]; + array3[1] = array[1] * array2[1]; + return array3; + }.toString(), + { argumentTypes: ['Array(4)', 'Array(4)'], output: [1] } + ); + assert.equal( + node.toString(), + 'vec4 arrayArguments(vec4 user_array, vec4 user_array2) {\n\ vec4 user_array3=vec4(0.0, 0.0, 0.0, 0.0);\n\ user_array3[0]=user_array[0];\n\ user_array3[1]=(user_array[1]*user_array2[1]);\n\ return user_array3;\n\ -}'); +}' + ); }); test('arrays arguments - Array(4) cpu', () => { - const node = new CPUFunctionNode((function arrayArguments(array, array2) { - const array3 = [0, 0, 0, 0]; - array3[0] = array[0]; - array3[1] = array[1] * array2[1]; - return array3; - }).toString(), { argumentTypes: ['Array(4)', 'Array(4)'], output: [1] }); - assert.equal(node.toString(), 'function arrayArguments(user_array, user_array2) {\n\ + const node = new CPUFunctionNode( + function arrayArguments(array, array2) { + const array3 = [0, 0, 0, 0]; + array3[0] = array[0]; + array3[1] = array[1] * array2[1]; + return array3; + }.toString(), + { argumentTypes: ['Array(4)', 'Array(4)'], output: [1] } + ); + assert.equal( + node.toString(), + 'function arrayArguments(user_array, user_array2) {\n\ const user_array3=new Float32Array([0, 0, 0, 0]);\n\ user_array3[0]=user_array[0];\n\ user_array3[1]=(user_array[1]*user_array2[1]);\n\ return user_array3;\n\ -}'); +}' + ); }); test('arrays inherited - Array(2) webgl', () => { - const node = new WebGLFunctionNode((function inherited(array, array2) { - const array3 = [0, 0]; - array3[0] = array[0]; - array3[1] = array[1] * array2[1]; - return array3; - }).toString(), { argumentTypes: ['Array(2)', 'Array(2)'], returnType: 'Array(2)', output: [1] }); - assert.equal(node.toString(), 'vec2 inherited(vec2 user_array, vec2 user_array2) {\n\ + const node = new WebGLFunctionNode( + function inherited(array, array2) { + const array3 = [0, 0]; + array3[0] = array[0]; + array3[1] = array[1] * array2[1]; + return array3; + }.toString(), + { + argumentTypes: ['Array(2)', 'Array(2)'], + returnType: 'Array(2)', + output: [1], + } + ); + assert.equal( + node.toString(), + 'vec2 inherited(vec2 user_array, vec2 user_array2) {\n\ vec2 user_array3=vec2(0.0, 0.0);\n\ user_array3[0]=user_array[0];\n\ user_array3[1]=(user_array[1]*user_array2[1]);\n\ return user_array3;\n\ -}'); +}' + ); }); test('arrays inherited - Array(2) webgl2', () => { - const node = new WebGL2FunctionNode((function inherited(array, array2) { - const array3 = [0, 0]; - array3[0] = array[0]; - array3[1] = array[1] * array2[1]; - return array3; - }).toString(), { argumentTypes: ['Array(2)', 'Array(2)'], returnType: 'Array(2)', output: [1] }); - assert.equal(node.toString(), 'vec2 inherited(vec2 user_array, vec2 user_array2) {\n\ + const node = new WebGL2FunctionNode( + function inherited(array, array2) { + const array3 = [0, 0]; + array3[0] = array[0]; + array3[1] = array[1] * array2[1]; + return array3; + }.toString(), + { + argumentTypes: ['Array(2)', 'Array(2)'], + returnType: 'Array(2)', + output: [1], + } + ); + assert.equal( + node.toString(), + 'vec2 inherited(vec2 user_array, vec2 user_array2) {\n\ vec2 user_array3=vec2(0.0, 0.0);\n\ user_array3[0]=user_array[0];\n\ user_array3[1]=(user_array[1]*user_array2[1]);\n\ return user_array3;\n\ -}'); +}' + ); }); test('arrays inherited - Array(2) cpu', () => { - const node = new CPUFunctionNode((function inherited(array, array2) { - const array3 = [0, 0]; - array3[0] = array[0]; - array3[1] = array[1] * array2[1]; - return array3; - }).toString(), { argumentTypes: ['Array(2)', 'Array(2)'], returnType: 'Array(2)', output: [1] }); - assert.equal(node.toString(), 'function inherited(user_array, user_array2) {\n\ + const node = new CPUFunctionNode( + function inherited(array, array2) { + const array3 = [0, 0]; + array3[0] = array[0]; + array3[1] = array[1] * array2[1]; + return array3; + }.toString(), + { + argumentTypes: ['Array(2)', 'Array(2)'], + returnType: 'Array(2)', + output: [1], + } + ); + assert.equal( + node.toString(), + 'function inherited(user_array, user_array2) {\n\ const user_array3=new Float32Array([0, 0]);\n\ user_array3[0]=user_array[0];\n\ user_array3[1]=(user_array[1]*user_array2[1]);\n\ return user_array3;\n\ -}'); +}' + ); }); test('arrays inherited - Array(3) webgl', () => { - const node = new WebGLFunctionNode((function inherited(array, array2) { - const array3 = [0, 0, 0]; - array3[0] = array[0]; - array3[1] = array[1] * array2[1]; - return array3; - }).toString(), { argumentTypes: ['Array(3)', 'Array(3)'], returnType: 'Array(3)', output: [1] }); - assert.equal(node.toString(), 'vec3 inherited(vec3 user_array, vec3 user_array2) {\n\ + const node = new WebGLFunctionNode( + function inherited(array, array2) { + const array3 = [0, 0, 0]; + array3[0] = array[0]; + array3[1] = array[1] * array2[1]; + return array3; + }.toString(), + { + argumentTypes: ['Array(3)', 'Array(3)'], + returnType: 'Array(3)', + output: [1], + } + ); + assert.equal( + node.toString(), + 'vec3 inherited(vec3 user_array, vec3 user_array2) {\n\ vec3 user_array3=vec3(0.0, 0.0, 0.0);\n\ user_array3[0]=user_array[0];\n\ user_array3[1]=(user_array[1]*user_array2[1]);\n\ return user_array3;\n\ -}'); +}' + ); }); test('arrays inherited - Array(3) webgl2', () => { - const node = new WebGL2FunctionNode((function inherited(array, array2) { - const array3 = [0, 0, 0]; - array3[0] = array[0]; - array3[1] = array[1] * array2[1]; - return array3; - }).toString(), { argumentTypes: ['Array(3)', 'Array(3)'], returnType: 'Array(3)', output: [1] }); - assert.equal(node.toString(), 'vec3 inherited(vec3 user_array, vec3 user_array2) {\n\ + const node = new WebGL2FunctionNode( + function inherited(array, array2) { + const array3 = [0, 0, 0]; + array3[0] = array[0]; + array3[1] = array[1] * array2[1]; + return array3; + }.toString(), + { + argumentTypes: ['Array(3)', 'Array(3)'], + returnType: 'Array(3)', + output: [1], + } + ); + assert.equal( + node.toString(), + 'vec3 inherited(vec3 user_array, vec3 user_array2) {\n\ vec3 user_array3=vec3(0.0, 0.0, 0.0);\n\ user_array3[0]=user_array[0];\n\ user_array3[1]=(user_array[1]*user_array2[1]);\n\ return user_array3;\n\ -}'); +}' + ); }); test('arrays inherited - Array(3) cpu', () => { - const node = new CPUFunctionNode((function inherited(array, array2) { - const array3 = [0, 0, 0]; - array3[0] = array[0]; - array3[1] = array[1] * array2[1]; - return array3; - }).toString(), { argumentTypes: ['Array(3)', 'Array(3)'], returnType: 'Array(3)', output: [1] }); - assert.equal(node.toString(), 'function inherited(user_array, user_array2) {\n\ + const node = new CPUFunctionNode( + function inherited(array, array2) { + const array3 = [0, 0, 0]; + array3[0] = array[0]; + array3[1] = array[1] * array2[1]; + return array3; + }.toString(), + { + argumentTypes: ['Array(3)', 'Array(3)'], + returnType: 'Array(3)', + output: [1], + } + ); + assert.equal( + node.toString(), + 'function inherited(user_array, user_array2) {\n\ const user_array3=new Float32Array([0, 0, 0]);\n\ user_array3[0]=user_array[0];\n\ user_array3[1]=(user_array[1]*user_array2[1]);\n\ return user_array3;\n\ -}'); +}' + ); }); test('arrays inherited - Array(4) webgl', () => { - const node = new WebGLFunctionNode((function inherited(array, array2) { - const array3 = [0, 0, 0, 0]; - array3[0] = array[0]; - array3[1] = array[1] * array2[1]; - return array3; - }).toString(), { argumentTypes: ['Array(4)', 'Array(4)'], returnType: 'Array(4)', output: [1] }); - assert.equal(node.toString(), 'vec4 inherited(vec4 user_array, vec4 user_array2) {\n\ + const node = new WebGLFunctionNode( + function inherited(array, array2) { + const array3 = [0, 0, 0, 0]; + array3[0] = array[0]; + array3[1] = array[1] * array2[1]; + return array3; + }.toString(), + { + argumentTypes: ['Array(4)', 'Array(4)'], + returnType: 'Array(4)', + output: [1], + } + ); + assert.equal( + node.toString(), + 'vec4 inherited(vec4 user_array, vec4 user_array2) {\n\ vec4 user_array3=vec4(0.0, 0.0, 0.0, 0.0);\n\ user_array3[0]=user_array[0];\n\ user_array3[1]=(user_array[1]*user_array2[1]);\n\ return user_array3;\n\ -}'); +}' + ); }); test('arrays inherited - Array(4) webgl2', () => { - const node = new WebGL2FunctionNode((function inherited(array, array2) { - const array3 = [0, 0, 0, 0]; - array3[0] = array[0]; - array3[1] = array[1] * array2[1]; - return array3; - }).toString(), { argumentTypes: ['Array(4)', 'Array(4)'], returnType: 'Array(4)', output: [1] }); - assert.equal(node.toString(), 'vec4 inherited(vec4 user_array, vec4 user_array2) {' + - '\nvec4 user_array3=vec4(0.0, 0.0, 0.0, 0.0);' + - '\nuser_array3[0]=user_array[0];' + - '\nuser_array3[1]=(user_array[1]*user_array2[1]);' + - '\nreturn user_array3;' + - '\n}'); + const node = new WebGL2FunctionNode( + function inherited(array, array2) { + const array3 = [0, 0, 0, 0]; + array3[0] = array[0]; + array3[1] = array[1] * array2[1]; + return array3; + }.toString(), + { + argumentTypes: ['Array(4)', 'Array(4)'], + returnType: 'Array(4)', + output: [1], + } + ); + assert.equal(node.toString(), 'vec4 inherited(vec4 user_array, vec4 user_array2) {' + '\nvec4 user_array3=vec4(0.0, 0.0, 0.0, 0.0);' + '\nuser_array3[0]=user_array[0];' + '\nuser_array3[1]=(user_array[1]*user_array2[1]);' + '\nreturn user_array3;' + '\n}'); }); test('arrays inherited - Array(4) cpu', () => { - const node = new CPUFunctionNode((function inherited(array, array2) { - const array3 = [0, 0, 0, 0]; - array3[0] = array[0]; - array3[1] = array[1] * array2[1]; - return array3; - }).toString(), { argumentTypes: ['Array(4)', 'Array(4)'], returnType: 'Array(4)', output: [1] }); - assert.equal(node.toString(), 'function inherited(user_array, user_array2) {\n\ + const node = new CPUFunctionNode( + function inherited(array, array2) { + const array3 = [0, 0, 0, 0]; + array3[0] = array[0]; + array3[1] = array[1] * array2[1]; + return array3; + }.toString(), + { + argumentTypes: ['Array(4)', 'Array(4)'], + returnType: 'Array(4)', + output: [1], + } + ); + assert.equal( + node.toString(), + 'function inherited(user_array, user_array2) {\n\ const user_array3=new Float32Array([0, 0, 0, 0]);\n\ user_array3[0]=user_array[0];\n\ user_array3[1]=(user_array[1]*user_array2[1]);\n\ return user_array3;\n\ -}'); +}' + ); }); test('auto detect float, array, array2d, array3d - webgl', () => { - const node = new WebGLFunctionNode(`function advancedUsed(int, array, array2d, array3d) { + const node = new WebGLFunctionNode( + `function advancedUsed(int, array, array2d, array3d) { let allValues = this.constants.float; allValues += this.constants.int; allValues += this.constants.array[this.thread.x]; @@ -564,72 +854,83 @@ test('auto detect float, array, array2d, array3d - webgl', () => { allValues += array3d[this.thread.x][this.thread.y][this.thread.z]; return allValues * Math.random(); - }`, { - returnType: 'Number', - output: [1], - argumentTypes: ['Integer', 'Array', 'Array2D', 'Array3D'], - constants: { - float: 1, - int: 1, - array: [1], - array2d: [ - [1] - ], - array3d: [ - [ - [1] - ] - ] - }, - constantTypes: { float: 'Float', int: 'Integer', array: 'Array', array2d: 'Array2D', array3d: 'Array3D' }, - constantBitRatios: { float: 0, int: 0, array: 4, array2d: 4, array3d: 4 }, - lookupFunctionArgumentBitRatio: () => 4, - }); - - assert.equal(node.toString(), 'float advancedUsed(int user_int, sampler2D user_array,ivec2 user_arraySize,ivec3 user_arrayDim, sampler2D user_array2d,ivec2 user_array2dSize,ivec3 user_array2dDim, sampler2D user_array3d,ivec2 user_array3dSize,ivec3 user_array3dDim) {' + - '\nfloat user_allValues=constants_float;' + - '\nuser_allValues+=float(constants_int);' + - '\nuser_allValues+=get32(constants_array, constants_arraySize, constants_arrayDim, 0, 0, threadId.x);' + - '\nuser_allValues+=get32(constants_array2d, constants_array2dSize, constants_array2dDim, 0, threadId.x, threadId.y);' + - '\nuser_allValues+=get32(constants_array3d, constants_array3dSize, constants_array3dDim, threadId.x, threadId.y, threadId.z);' + - '\nuser_allValues+=float(user_int);' + - '\nuser_allValues+=get32(user_array, user_arraySize, user_arrayDim, 0, 0, threadId.x);' + - '\nuser_allValues+=get32(user_array2d, user_array2dSize, user_array2dDim, 0, threadId.x, threadId.y);' + - '\nuser_allValues+=get32(user_array3d, user_array3dSize, user_array3dDim, threadId.x, threadId.y, threadId.z);' + - '\nreturn (user_allValues*random());' + - '\n}'); + }`, + { + returnType: 'Number', + output: [1], + argumentTypes: ['Integer', 'Array', 'Array2D', 'Array3D'], + constants: { + float: 1, + int: 1, + array: [1], + array2d: [[1]], + array3d: [[[1]]], + }, + constantTypes: { + float: 'Float', + int: 'Integer', + array: 'Array', + array2d: 'Array2D', + array3d: 'Array3D', + }, + constantBitRatios: { + float: 0, + int: 0, + array: 4, + array2d: 4, + array3d: 4, + }, + lookupFunctionArgumentBitRatio: () => 4, + } + ); + + assert.equal(node.toString(), 'float advancedUsed(int user_int, sampler2D user_array,ivec2 user_arraySize,ivec3 user_arrayDim, sampler2D user_array2d,ivec2 user_array2dSize,ivec3 user_array2dDim, sampler2D user_array3d,ivec2 user_array3dSize,ivec3 user_array3dDim) {' + '\nfloat user_allValues=constants_float;' + '\nuser_allValues+=float(constants_int);' + '\nuser_allValues+=get32(constants_array, constants_arraySize, constants_arrayDim, 0, 0, threadId.x);' + '\nuser_allValues+=get32(constants_array2d, constants_array2dSize, constants_array2dDim, 0, threadId.x, threadId.y);' + '\nuser_allValues+=get32(constants_array3d, constants_array3dSize, constants_array3dDim, threadId.x, threadId.y, threadId.z);' + '\nuser_allValues+=float(user_int);' + '\nuser_allValues+=get32(user_array, user_arraySize, user_arrayDim, 0, 0, threadId.x);' + '\nuser_allValues+=get32(user_array2d, user_array2dSize, user_array2dDim, 0, threadId.x, threadId.y);' + '\nuser_allValues+=get32(user_array3d, user_array3dSize, user_array3dDim, threadId.x, threadId.y, threadId.z);' + '\nreturn (user_allValues*random());' + '\n}'); }); - function notDefined(mode) { const gpu = new GPU({ mode }); - const kernel1 = gpu.createKernel(function() { - return result; - }, { output: [1] }); + const kernel1 = gpu.createKernel( + function () { + return result; + }, + { output: [1] } + ); assert.throws(() => { kernel1(); }, new Error('Identifier is not defined on line 1, position 0:\n result')); - const kernel2 = gpu.createKernel(function() { - return result[0]; - }, { output: [1] }); + const kernel2 = gpu.createKernel( + function () { + return result[0]; + }, + { output: [1] } + ); assert.throws(() => { kernel2(); }, new Error('Identifier is not defined on line 1, position 0:\n result')); - const kernel3 = gpu.createKernel(function() { - return result[0][0]; - }, { output: [1] }); + const kernel3 = gpu.createKernel( + function () { + return result[0][0]; + }, + { output: [1] } + ); assert.throws(() => { kernel3(); }, new Error('Identifier is not defined on line 1, position 0:\n result')); - const kernel4 = gpu.createKernel(function() { - return result[0][0][0]; - }, { output: [1] }); + const kernel4 = gpu.createKernel( + function () { + return result[0][0][0]; + }, + { output: [1] } + ); assert.throws(() => { kernel4(); }, new Error('Identifier is not defined on line 1, position 0:\n result')); - const kernel5 = gpu.createKernel(function() { - return result[0][0][0][0]; - }, { output: [1] }); + const kernel5 = gpu.createKernel( + function () { + return result[0][0][0][0]; + }, + { output: [1] } + ); assert.throws(() => { kernel5(); }, new Error('Identifier is not defined on line 1, position 1:\n result')); @@ -658,4 +959,4 @@ test('not defined gpu', () => { test('not defined cpu', () => { notDefined('cpu'); -}); \ No newline at end of file +}); diff --git a/test/features/unsigned-precision-textures.js b/test/features/unsigned-precision-textures.js index eb384b5f..34688a77 100644 --- a/test/features/unsigned-precision-textures.js +++ b/test/features/unsigned-precision-textures.js @@ -6,12 +6,15 @@ describe('features: unsigned precision textures'); function unsignedPrecisionTexturesWithArray(mode) { const original = [1, 2, 3, 4, 5, 6, 7, 8, 9]; const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(packed) { - return packed[this.thread.x]; - }, { - output: [9], - precision: 'unsigned' - }); + const kernel = gpu.createKernel( + function (packed) { + return packed[this.thread.x]; + }, + { + output: [9], + precision: 'unsigned', + } + ); const result = kernel(original); assert.deepEqual(Array.from(result), original); @@ -45,12 +48,15 @@ test('with Array cpu', () => { function unsignedPrecisionTexturesWithFloat32Array(mode) { const original = new Float32Array([1, 2, 3, 4, 5, 6, 7, 8, 9]); const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(packed) { - return packed[this.thread.x]; - }, { - output: [9], - precision: 'unsigned' - }); + const kernel = gpu.createKernel( + function (packed) { + return packed[this.thread.x]; + }, + { + output: [9], + precision: 'unsigned', + } + ); const result = kernel(original); assert.deepEqual(Array.from(result), Array.from(original)); @@ -84,12 +90,15 @@ test('with Float32Array cpu', () => { function unsignedPrecisionTexturesWithUint16Array(mode) { const original = new Uint16Array([1, 2, 3, 4, 5, 6, 7, 8, 9]); const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(packed) { - return packed[this.thread.x]; - }, { - output: [9], - precision: 'unsigned', - }); + const kernel = gpu.createKernel( + function (packed) { + return packed[this.thread.x]; + }, + { + output: [9], + precision: 'unsigned', + } + ); const result = kernel(original); assert.deepEqual(Array.from(result), Array.from(original)); @@ -123,12 +132,15 @@ test('with Uint16Array cpu', () => { function unsignedPrecisionTexturesWithUint8Array(mode) { const original = new Uint8Array([1, 2, 3, 4, 5, 6, 7, 8, 9]); const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(packed) { - return packed[this.thread.x]; - }, { - output: [9], - precision: 'unsigned' - }); + const kernel = gpu.createKernel( + function (packed) { + return packed[this.thread.x]; + }, + { + output: [9], + precision: 'unsigned', + } + ); const result = kernel(original); assert.deepEqual(Array.from(result), Array.from(original)); @@ -162,12 +174,15 @@ test('with Uint8Array cpu', () => { function unsignedPrecisionTexturesWithUint8ClampedArray(mode) { const original = new Uint8ClampedArray([1, 2, 3, 4, 5, 6, 7, 8, 9]); const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(packed) { - return packed[this.thread.x]; - }, { - output: [9], - precision: 'unsigned' - }); + const kernel = gpu.createKernel( + function (packed) { + return packed[this.thread.x]; + }, + { + output: [9], + precision: 'unsigned', + } + ); const result = kernel(original); assert.deepEqual(Array.from(result), Array.from(original)); @@ -204,15 +219,21 @@ function unsignedPrecisionTexturesWithArray2D(mode) { [10, 11, 12, 13, 14, 15, 16, 18, 19], ]; const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(packed) { - return packed[this.thread.y][this.thread.x]; - }, { - output: [9, 2], - precision: 'unsigned' - }); + const kernel = gpu.createKernel( + function (packed) { + return packed[this.thread.y][this.thread.x]; + }, + { + output: [9, 2], + precision: 'unsigned', + } + ); const result = kernel(original); - assert.deepEqual(result.map(array => Array.from(array)), original.map(array => Array.from(array))); + assert.deepEqual( + result.map(array => Array.from(array)), + original.map(array => Array.from(array)) + ); gpu.destroy(); } @@ -241,20 +262,23 @@ test('with Array2D cpu', () => { }); function unsignedPrecisionTexturesWithFloat32Array2D(mode) { - const original = [ - new Float32Array([1, 2, 3, 4, 5, 6, 7, 8, 9]), - new Float32Array([10, 11, 12, 13, 14, 15, 16, 18, 19]), - ]; + const original = [new Float32Array([1, 2, 3, 4, 5, 6, 7, 8, 9]), new Float32Array([10, 11, 12, 13, 14, 15, 16, 18, 19])]; const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(packed) { - return packed[this.thread.y][this.thread.x]; - }, { - output: [9, 2], - precision: 'unsigned' - }); + const kernel = gpu.createKernel( + function (packed) { + return packed[this.thread.y][this.thread.x]; + }, + { + output: [9, 2], + precision: 'unsigned', + } + ); const result = kernel(original); - assert.deepEqual(result.map(array => Array.from(array)), original.map(array => Array.from(array))); + assert.deepEqual( + result.map(array => Array.from(array)), + original.map(array => Array.from(array)) + ); gpu.destroy(); } @@ -283,20 +307,23 @@ test('with Float32Array2D cpu', () => { }); function unsignedPrecisionTexturesWithUint16Array2D(mode) { - const original = [ - new Uint16Array([1, 2, 3, 4, 5, 6, 7, 8, 9]), - new Uint16Array([10, 11, 12, 13, 14, 15, 16, 18, 19]), - ]; + const original = [new Uint16Array([1, 2, 3, 4, 5, 6, 7, 8, 9]), new Uint16Array([10, 11, 12, 13, 14, 15, 16, 18, 19])]; const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(packed) { - return packed[this.thread.y][this.thread.x]; - }, { - output: [9, 2], - precision: 'unsigned' - }); + const kernel = gpu.createKernel( + function (packed) { + return packed[this.thread.y][this.thread.x]; + }, + { + output: [9, 2], + precision: 'unsigned', + } + ); const result = kernel(original); - assert.deepEqual(result.map(array => Array.from(array)), original.map(array => Array.from(array))); + assert.deepEqual( + result.map(array => Array.from(array)), + original.map(array => Array.from(array)) + ); gpu.destroy(); } @@ -325,20 +352,23 @@ test('with Uint16Array2D cpu', () => { }); function unsignedPrecisionTexturesWithUint8Array2D(mode) { - const original = [ - new Uint8Array([1, 2, 3, 4, 5, 6, 7, 8, 9]), - new Uint8Array([10, 11, 12, 13, 14, 15, 16, 18, 19]), - ]; + const original = [new Uint8Array([1, 2, 3, 4, 5, 6, 7, 8, 9]), new Uint8Array([10, 11, 12, 13, 14, 15, 16, 18, 19])]; const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(packed) { - return packed[this.thread.y][this.thread.x]; - }, { - output: [9, 2], - precision: 'unsigned' - }); + const kernel = gpu.createKernel( + function (packed) { + return packed[this.thread.y][this.thread.x]; + }, + { + output: [9, 2], + precision: 'unsigned', + } + ); const result = kernel(original); - assert.deepEqual(result.map(array => Array.from(array)), original.map(array => Array.from(array))); + assert.deepEqual( + result.map(array => Array.from(array)), + original.map(array => Array.from(array)) + ); gpu.destroy(); } @@ -367,20 +397,23 @@ test('with Uint8Array2D cpu', () => { }); function unsignedPrecisionTexturesWithUint8ClampedArray2D(mode) { - const original = [ - new Uint8ClampedArray([1, 2, 3, 4, 5, 6, 7, 8, 9]), - new Uint8ClampedArray([10, 11, 12, 13, 14, 15, 16, 18, 19]), - ]; + const original = [new Uint8ClampedArray([1, 2, 3, 4, 5, 6, 7, 8, 9]), new Uint8ClampedArray([10, 11, 12, 13, 14, 15, 16, 18, 19])]; const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(packed) { - return packed[this.thread.y][this.thread.x]; - }, { - output: [9, 2], - precision: 'unsigned' - }); + const kernel = gpu.createKernel( + function (packed) { + return packed[this.thread.y][this.thread.x]; + }, + { + output: [9, 2], + precision: 'unsigned', + } + ); const result = kernel(original); - assert.deepEqual(result.map(array => Array.from(array)), original.map(array => Array.from(array))); + assert.deepEqual( + result.map(array => Array.from(array)), + original.map(array => Array.from(array)) + ); gpu.destroy(); } @@ -417,18 +450,24 @@ function unsignedPrecisionTexturesWithArray3D(mode) { [ [20, 21, 22, 23, 24, 25, 26, 27, 28], [29, 30, 31, 32, 33, 34, 35, 36, 37], - ] + ], ]; const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(packed) { - return packed[this.thread.z][this.thread.y][this.thread.x]; - }, { - output: [9, 2, 2], - precision: 'unsigned' - }); + const kernel = gpu.createKernel( + function (packed) { + return packed[this.thread.z][this.thread.y][this.thread.x]; + }, + { + output: [9, 2, 2], + precision: 'unsigned', + } + ); const result = kernel(original); - assert.deepEqual(result.map(matrix => matrix.map(array => Array.from(array))), original); + assert.deepEqual( + result.map(matrix => matrix.map(array => Array.from(array))), + original + ); gpu.destroy(); } @@ -458,25 +497,25 @@ test('with Array3D cpu', () => { function unsignedPrecisionTexturesWithFloat32Array3D(mode) { const original = [ - [ - new Float32Array([1, 2, 3, 4, 5, 6, 7, 8, 9]), - new Float32Array([10, 11, 12, 13, 14, 15, 16, 18, 19]), - ], - [ - new Float32Array([20, 21, 22, 23, 24, 25, 26, 27, 28]), - new Float32Array([29, 30, 31, 32, 33, 34, 35, 36, 37]), - ] + [new Float32Array([1, 2, 3, 4, 5, 6, 7, 8, 9]), new Float32Array([10, 11, 12, 13, 14, 15, 16, 18, 19])], + [new Float32Array([20, 21, 22, 23, 24, 25, 26, 27, 28]), new Float32Array([29, 30, 31, 32, 33, 34, 35, 36, 37])], ]; const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(packed) { - return packed[this.thread.z][this.thread.y][this.thread.x]; - }, { - output: [9, 2, 2], - precision: 'unsigned' - }); + const kernel = gpu.createKernel( + function (packed) { + return packed[this.thread.z][this.thread.y][this.thread.x]; + }, + { + output: [9, 2, 2], + precision: 'unsigned', + } + ); const result = kernel(original); - assert.deepEqual(result.map(matrix => matrix.map(array => Array.from(array))), original.map(matrix => matrix.map(array => Array.from(array)))); + assert.deepEqual( + result.map(matrix => matrix.map(array => Array.from(array))), + original.map(matrix => matrix.map(array => Array.from(array))) + ); gpu.destroy(); } @@ -506,25 +545,25 @@ test('with Float32Array3D cpu', () => { function unsignedPrecisionTexturesWithUint16Array3D(mode) { const original = [ - [ - new Uint16Array([1, 2, 3, 4, 5, 6, 7, 8, 9]), - new Uint16Array([10, 11, 12, 13, 14, 15, 16, 18, 19]), - ], - [ - new Uint16Array([20, 21, 22, 23, 24, 25, 26, 27, 28]), - new Uint16Array([29, 30, 31, 32, 33, 34, 35, 36, 37]), - ] + [new Uint16Array([1, 2, 3, 4, 5, 6, 7, 8, 9]), new Uint16Array([10, 11, 12, 13, 14, 15, 16, 18, 19])], + [new Uint16Array([20, 21, 22, 23, 24, 25, 26, 27, 28]), new Uint16Array([29, 30, 31, 32, 33, 34, 35, 36, 37])], ]; const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(packed) { - return packed[this.thread.z][this.thread.y][this.thread.x]; - }, { - output: [9, 2, 2], - precision: 'unsigned' - }); + const kernel = gpu.createKernel( + function (packed) { + return packed[this.thread.z][this.thread.y][this.thread.x]; + }, + { + output: [9, 2, 2], + precision: 'unsigned', + } + ); const result = kernel(original); - assert.deepEqual(result.map(matrix => matrix.map(array => Array.from(array))), original.map(matrix => matrix.map(array => Array.from(array)))); + assert.deepEqual( + result.map(matrix => matrix.map(array => Array.from(array))), + original.map(matrix => matrix.map(array => Array.from(array))) + ); gpu.destroy(); } @@ -554,25 +593,25 @@ test('with Uint16Array3D cpu', () => { function unsignedPrecisionTexturesWithUint8Array3D(mode) { const original = [ - [ - new Uint8Array([1, 2, 3, 4, 5, 6, 7, 8, 9]), - new Uint8Array([10, 11, 12, 13, 14, 15, 16, 18, 19]), - ], - [ - new Uint8Array([20, 21, 22, 23, 24, 25, 26, 27, 28]), - new Uint8Array([29, 30, 31, 32, 33, 34, 35, 36, 37]), - ] + [new Uint8Array([1, 2, 3, 4, 5, 6, 7, 8, 9]), new Uint8Array([10, 11, 12, 13, 14, 15, 16, 18, 19])], + [new Uint8Array([20, 21, 22, 23, 24, 25, 26, 27, 28]), new Uint8Array([29, 30, 31, 32, 33, 34, 35, 36, 37])], ]; const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(packed) { - return packed[this.thread.z][this.thread.y][this.thread.x]; - }, { - output: [9, 2, 2], - precision: 'unsigned' - }); + const kernel = gpu.createKernel( + function (packed) { + return packed[this.thread.z][this.thread.y][this.thread.x]; + }, + { + output: [9, 2, 2], + precision: 'unsigned', + } + ); const result = kernel(original); - assert.deepEqual(result.map(matrix => matrix.map(array => Array.from(array))), original.map(matrix => matrix.map(array => Array.from(array)))); + assert.deepEqual( + result.map(matrix => matrix.map(array => Array.from(array))), + original.map(matrix => matrix.map(array => Array.from(array))) + ); gpu.destroy(); } @@ -602,25 +641,25 @@ test('with Uint8Array3D cpu', () => { function unsignedPrecisionTexturesWithUint8ClampedArray3D(mode) { const original = [ - [ - new Uint8ClampedArray([1, 2, 3, 4, 5, 6, 7, 8, 9]), - new Uint8ClampedArray([10, 11, 12, 13, 14, 15, 16, 18, 19]), - ], - [ - new Uint8ClampedArray([20, 21, 22, 23, 24, 25, 26, 27, 28]), - new Uint8ClampedArray([29, 30, 31, 32, 33, 34, 35, 36, 37]), - ] + [new Uint8ClampedArray([1, 2, 3, 4, 5, 6, 7, 8, 9]), new Uint8ClampedArray([10, 11, 12, 13, 14, 15, 16, 18, 19])], + [new Uint8ClampedArray([20, 21, 22, 23, 24, 25, 26, 27, 28]), new Uint8ClampedArray([29, 30, 31, 32, 33, 34, 35, 36, 37])], ]; const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(packed) { - return packed[this.thread.z][this.thread.y][this.thread.x]; - }, { - output: [9, 2, 2], - precision: 'unsigned' - }); + const kernel = gpu.createKernel( + function (packed) { + return packed[this.thread.z][this.thread.y][this.thread.x]; + }, + { + output: [9, 2, 2], + precision: 'unsigned', + } + ); const result = kernel(original); - assert.deepEqual(result.map(matrix => matrix.map(array => Array.from(array))), original.map(matrix => matrix.map(array => Array.from(array)))); + assert.deepEqual( + result.map(matrix => matrix.map(array => Array.from(array))), + original.map(matrix => matrix.map(array => Array.from(array))) + ); gpu.destroy(); } @@ -650,14 +689,17 @@ test('with Uint8ClampedArray3D cpu', () => { function testImmutableDoesNotCollideWithKernelTexture(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(v) { - return v[this.thread.x] + 1; - }, { - output: [1], - precision: 'unsigned', - pipeline: true, - immutable: true, - }); + const kernel = gpu.createKernel( + function (v) { + return v[this.thread.x] + 1; + }, + { + output: [1], + precision: 'unsigned', + pipeline: true, + immutable: true, + } + ); const v = [1]; const result1 = kernel(v); assert.deepEqual(result1.toArray(), new Float32Array([2])); @@ -688,4 +730,4 @@ test('immutable does not collide with kernel texture gpu', () => { (GPU.isHeadlessGLSupported ? test : skip)('immutable does not collide with kernel texture headlessgl', () => { testImmutableDoesNotCollideWithKernelTexture('headlessgl'); -}); \ No newline at end of file +}); diff --git a/test/features/video.js b/test/features/video.js index 63743a4e..10e29e5f 100644 --- a/test/features/video.js +++ b/test/features/video.js @@ -8,14 +8,17 @@ function videoArgumentTest(mode, done) { video.src = 'jellyfish.webm'; setTimeout(() => { const gpu = new GPU({ mode }); - const videoKernel = gpu.createKernel(function(a) { - const pixel = a[this.thread.y][this.thread.x]; - return pixel.g * 255; - }, { - output: [200], - precision: 'unsigned', - argumentTypes: ['HTMLVideo'], - }); + const videoKernel = gpu.createKernel( + function (a) { + const pixel = a[this.thread.y][this.thread.x]; + return pixel.g * 255; + }, + { + output: [200], + precision: 'unsigned', + argumentTypes: ['HTMLVideo'], + } + ); const pixelResult = videoKernel(video)[0]; // CPU captures a bit different of a color assert.ok(pixelResult <= 127 && pixelResult >= 121); @@ -43,4 +46,4 @@ function videoArgumentTest(mode, done) { (typeof HTMLVideoElement !== 'undefined' ? test : skip)('video argument cpu', t => { videoArgumentTest('cpu', t.async()); -}); \ No newline at end of file +}); diff --git a/test/index.js b/test/index.js index d24b5b6a..1cc8700a 100644 --- a/test/index.js +++ b/test/index.js @@ -7,9 +7,11 @@ describe('Test Node GPU', () => { it('should find and use gpu runner', () => { const gpu = new GPU({ mode: 'gpu' }); - const kernel = gpu.createKernel(function() { - return 1; - }).setOutput([1]); + const kernel = gpu + .createKernel(function () { + return 1; + }) + .setOutput([1]); const result = kernel(); @@ -20,19 +22,16 @@ describe('Test Node GPU', () => { it('supports 2x2 size', () => { const gpu = new GPU({ mode: 'gpu' }); - const kernel = gpu.createKernel(function() { - return this.thread.x * this.thread.y; - }).setOutput([2, 2]); + const kernel = gpu + .createKernel(function () { + return this.thread.x * this.thread.y; + }) + .setOutput([2, 2]); const result = kernel(); expect(gpu.runner.constructor).to.equal(GPU.HeadlessGLRunner); - expect(result).to.deep.equal( - [ - Float32Array.from([0,0]), - Float32Array.from([0,1]) - ] - ); + expect(result).to.deep.equal([Float32Array.from([0, 0]), Float32Array.from([0, 1])]); }); }); @@ -40,9 +39,11 @@ describe('Test Node GPU', () => { it('should find and use gpu runner', () => { const gpu = new GPU({ mode: 'cpu' }); - const kernel = gpu.createKernel(function() { - return 1; - }).setOutput([1]); + const kernel = gpu + .createKernel(function () { + return 1; + }) + .setOutput([1]); const result = kernel(); @@ -53,20 +54,16 @@ describe('Test Node GPU', () => { it('supports 2x2 size', () => { const gpu = new GPU({ mode: 'cpu' }); - const kernel = gpu.createKernel(function() { - return this.thread.x * this.thread.y; - }).setOutput([2, 2]); + const kernel = gpu + .createKernel(function () { + return this.thread.x * this.thread.y; + }) + .setOutput([2, 2]); const result = kernel(); expect(gpu.runner.constructor).to.equal(GPU.CPURunner); - expect(result).to.deep.equal( - [ - Float32Array.from([0,0]), - Float32Array.from([0,1]) - ] - ); + expect(result).to.deep.equal([Float32Array.from([0, 0]), Float32Array.from([0, 1])]); }); }); }); - diff --git a/test/internal/argument-texture-switching.js b/test/internal/argument-texture-switching.js index e222c9cb..3717cc62 100644 --- a/test/internal/argument-texture-switching.js +++ b/test/internal/argument-texture-switching.js @@ -5,14 +5,16 @@ describe('internal: argument texture switching'); function testArrayWithoutTypeDefined(mode) { const gpu = new GPU({ mode }); - const texture = ( - gpu.createKernel(function() { return this.thread.x; }) + const texture = gpu + .createKernel(function () { + return this.thread.x; + }) .setOutput([10]) .setPipeline(true) - .setPrecision('single') - )(); + .setPrecision('single')(); const expected = texture.toArray(); - const kernel = gpu.createKernel(function(value) { + const kernel = gpu + .createKernel(function (value) { return value[this.thread.x]; }) .setOutput([10]) @@ -48,18 +50,20 @@ function testArrayWithoutTypeDefined(mode) { function testArrayWithTypeDefined(mode) { const gpu = new GPU({ mode }); - const texture = ( - gpu.createKernel(function() { return this.thread.x; }) + const texture = gpu + .createKernel(function () { + return this.thread.x; + }) .setOutput([10]) .setPipeline(true) - .setPrecision('single') - )(); + .setPrecision('single')(); const expected = texture.toArray(); - const kernel = gpu.createKernel(function(value) { + const kernel = gpu + .createKernel(function (value) { return value[this.thread.x]; }) .setArgumentTypes({ - value: 'Array' + value: 'Array', }) .setOutput([10]) .setPipeline(false) @@ -94,18 +98,20 @@ function testArrayWithTypeDefined(mode) { function testArray1D2(mode) { const gpu = new GPU({ mode }); - const texture = ( - gpu.createKernel(function() { return [this.thread.x, this.thread.x + 1]; }) + const texture = gpu + .createKernel(function () { + return [this.thread.x, this.thread.x + 1]; + }) .setOutput([10]) .setPipeline(true) - .setPrecision('single') - )(); + .setPrecision('single')(); const expected = texture.toArray(); - const kernel = gpu.createKernel(function(value) { + const kernel = gpu + .createKernel(function (value) { return value[this.thread.x]; }) .setArgumentTypes({ - value: 'Array1D(2)' + value: 'Array1D(2)', }) .setOutput([10]) .setPipeline(false) @@ -140,18 +146,20 @@ function testArray1D2(mode) { function testArray1D3(mode) { const gpu = new GPU({ mode }); - const texture = ( - gpu.createKernel(function() { return [this.thread.x, this.thread.x + 1, this.thread.x + 2]; }) + const texture = gpu + .createKernel(function () { + return [this.thread.x, this.thread.x + 1, this.thread.x + 2]; + }) .setOutput([10]) .setPipeline(true) - .setPrecision('single') - )(); + .setPrecision('single')(); const expected = texture.toArray(); - const kernel = gpu.createKernel(function(value) { + const kernel = gpu + .createKernel(function (value) { return value[this.thread.x]; }) .setArgumentTypes({ - value: 'Array1D(3)' + value: 'Array1D(3)', }) .setOutput([10]) .setPipeline(false) @@ -186,18 +194,20 @@ function testArray1D3(mode) { function testArray1D4(mode) { const gpu = new GPU({ mode }); - const texture = ( - gpu.createKernel(function() { return [this.thread.x, this.thread.x + 1, this.thread.x + 2, this.thread.x + 3]; }) + const texture = gpu + .createKernel(function () { + return [this.thread.x, this.thread.x + 1, this.thread.x + 2, this.thread.x + 3]; + }) .setOutput([10]) .setPipeline(true) - .setPrecision('single') - )(); + .setPrecision('single')(); const expected = texture.toArray(); - const kernel = gpu.createKernel(function(value) { + const kernel = gpu + .createKernel(function (value) { return value[this.thread.x]; }) .setArgumentTypes({ - value: 'Array1D(4)' + value: 'Array1D(4)', }) .setOutput([10]) .setPipeline(false) @@ -232,18 +242,20 @@ function testArray1D4(mode) { function testArray2D2(mode) { const gpu = new GPU({ mode }); - const texture = ( - gpu.createKernel(function() { return [this.thread.x, this.thread.y]; }) + const texture = gpu + .createKernel(function () { + return [this.thread.x, this.thread.y]; + }) .setOutput([10, 10]) .setPipeline(true) - .setPrecision('single') - )(); + .setPrecision('single')(); const expected = texture.toArray(); - const kernel = gpu.createKernel(function(value) { + const kernel = gpu + .createKernel(function (value) { return value[this.thread.y][this.thread.x]; }) .setArgumentTypes({ - value: 'Array2D(2)' + value: 'Array2D(2)', }) .setOutput([10, 10]) .setPipeline(false) @@ -278,18 +290,20 @@ function testArray2D2(mode) { function testArray2D3(mode) { const gpu = new GPU({ mode }); - const texture = ( - gpu.createKernel(function() { return [this.thread.x, this.thread.y, this.thread.x * this.thread.y]; }) + const texture = gpu + .createKernel(function () { + return [this.thread.x, this.thread.y, this.thread.x * this.thread.y]; + }) .setOutput([10, 10]) .setPipeline(true) - .setPrecision('single') - )(); + .setPrecision('single')(); const expected = texture.toArray(); - const kernel = gpu.createKernel(function(value) { + const kernel = gpu + .createKernel(function (value) { return value[this.thread.y][this.thread.x]; }) .setArgumentTypes({ - value: 'Array2D(3)' + value: 'Array2D(3)', }) .setOutput([10, 10]) .setPipeline(false) @@ -324,25 +338,20 @@ function testArray2D3(mode) { function testArray2D4(mode) { const gpu = new GPU({ mode }); - const texture = ( - gpu.createKernel(function() { - return [ - this.thread.x, - this.thread.y, - this.thread.x * this.thread.y, - this.thread.x / this.thread.y - ]; + const texture = gpu + .createKernel(function () { + return [this.thread.x, this.thread.y, this.thread.x * this.thread.y, this.thread.x / this.thread.y]; }) .setOutput([10, 10]) .setPipeline(true) - .setPrecision('single') - )(); + .setPrecision('single')(); const expected = texture.toArray(); - const kernel = gpu.createKernel(function(value) { + const kernel = gpu + .createKernel(function (value) { return value[this.thread.y][this.thread.x]; }) .setArgumentTypes({ - value: 'Array2D(4)' + value: 'Array2D(4)', }) .setOutput([10, 10]) .setPipeline(false) @@ -377,18 +386,20 @@ function testArray2D4(mode) { function testArray3D2(mode) { const gpu = new GPU({ mode }); - const texture = ( - gpu.createKernel(function() { return [this.thread.x, this.thread.x * this.thread.y * this.thread.z]; }) + const texture = gpu + .createKernel(function () { + return [this.thread.x, this.thread.x * this.thread.y * this.thread.z]; + }) .setOutput([10, 10, 10]) .setPipeline(true) - .setPrecision('single') - )(); + .setPrecision('single')(); const expected = texture.toArray(); - const kernel = gpu.createKernel(function(value) { + const kernel = gpu + .createKernel(function (value) { return value[this.thread.z][this.thread.y][this.thread.x]; }) .setArgumentTypes({ - value: 'Array3D(2)' + value: 'Array3D(2)', }) .setOutput([10, 10, 10]) .setPipeline(false) @@ -423,18 +434,20 @@ function testArray3D2(mode) { function testArray3D3(mode) { const gpu = new GPU({ mode }); - const texture = ( - gpu.createKernel(function() { return [this.thread.x, this.thread.y, this.thread.z]; }) + const texture = gpu + .createKernel(function () { + return [this.thread.x, this.thread.y, this.thread.z]; + }) .setOutput([10, 10, 10]) .setPipeline(true) - .setPrecision('single') - )(); + .setPrecision('single')(); const expected = texture.toArray(); - const kernel = gpu.createKernel(function(value) { + const kernel = gpu + .createKernel(function (value) { return value[this.thread.z][this.thread.y][this.thread.x]; }) .setArgumentTypes({ - value: 'Array3D(3)' + value: 'Array3D(3)', }) .setOutput([10, 10, 10]) .setPipeline(false) @@ -469,25 +482,20 @@ function testArray3D3(mode) { function testArray3D4(mode) { const gpu = new GPU({ mode }); - const texture = ( - gpu.createKernel(function() { - return [ - this.thread.x, - this.thread.y, - this.thread.z, - this.thread.x * this.thread.y * this.thread.z - ]; + const texture = gpu + .createKernel(function () { + return [this.thread.x, this.thread.y, this.thread.z, this.thread.x * this.thread.y * this.thread.z]; }) .setOutput([10, 10, 10]) .setPipeline(true) - .setPrecision('single') - )(); + .setPrecision('single')(); const expected = texture.toArray(); - const kernel = gpu.createKernel(function(value) { + const kernel = gpu + .createKernel(function (value) { return value[this.thread.z][this.thread.y][this.thread.x]; }) .setArgumentTypes({ - value: 'Array3D(4)' + value: 'Array3D(4)', }) .setOutput([10, 10, 10]) .setPipeline(false) @@ -518,4 +526,4 @@ function testArray3D4(mode) { (GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('Array3D(4) (GPU only) headlessgl', () => { testArray3D4('headlessgl'); -}); \ No newline at end of file +}); diff --git a/test/internal/backend/cpu-kernel.js b/test/internal/backend/cpu-kernel.js index de633526..a308a547 100644 --- a/test/internal/backend/cpu-kernel.js +++ b/test/internal/backend/cpu-kernel.js @@ -11,4 +11,4 @@ test('.build() checks if already built, and returns early if true', () => { }; CPUKernel.prototype.build.apply(mockContext); assert.equal(mockContext.setupConstants.callCount, 0); -}); \ No newline at end of file +}); diff --git a/test/internal/backend/function-node/isSafe.js b/test/internal/backend/function-node/isSafe.js index ae5f19ae..86bd6822 100644 --- a/test/internal/backend/function-node/isSafe.js +++ b/test/internal/backend/function-node/isSafe.js @@ -6,20 +6,23 @@ describe('FunctionNode.isSafe()'); test('calls this.getDependencies(ast) and then this.isSafeDependencies()', () => { const mockAst = {}; const dependenciesMock = { - dependencies: [] + dependencies: [], }; let calls = 0; - FunctionNode.prototype.isSafe.call({ - getDependencies: (ast) => { - assert.equal(ast, mockAst); - assert.equal(calls++, 0); - return dependenciesMock; + FunctionNode.prototype.isSafe.call( + { + getDependencies: ast => { + assert.equal(ast, mockAst); + assert.equal(calls++, 0); + return dependenciesMock; + }, + isSafeDependencies: dependencies => { + assert.equal(calls++, 1); + assert.equal(dependencies, dependenciesMock); + }, }, - isSafeDependencies: (dependencies) => { - assert.equal(calls++, 1); - assert.equal(dependencies, dependenciesMock); - } - }, mockAst); + mockAst + ); assert.equal(calls, 2); }); diff --git a/test/internal/backend/function-node/isSafeDependencies.js b/test/internal/backend/function-node/isSafeDependencies.js index 17e1dcde..28fee075 100644 --- a/test/internal/backend/function-node/isSafeDependencies.js +++ b/test/internal/backend/function-node/isSafeDependencies.js @@ -8,29 +8,35 @@ test('calls if dependencies are falsey, returns true', () => { }); test('calls if dependencies have all isSafe that are true, returns true', () => { - assert.equal(FunctionNode.prototype.isSafeDependencies([ - { - isSafe: true - }, - { - isSafe: true - }, - { - isSafe: true - } - ]), true); + assert.equal( + FunctionNode.prototype.isSafeDependencies([ + { + isSafe: true, + }, + { + isSafe: true, + }, + { + isSafe: true, + }, + ]), + true + ); }); test('calls if dependencies have any isSafe that are false, returns false', () => { - assert.equal(FunctionNode.prototype.isSafeDependencies([ - { - isSafe: true - }, - { - isSafe: false - }, - { - isSafe: true - } - ]), false); + assert.equal( + FunctionNode.prototype.isSafeDependencies([ + { + isSafe: true, + }, + { + isSafe: false, + }, + { + isSafe: true, + }, + ]), + false + ); }); diff --git a/test/internal/backend/gl-kernel.js b/test/internal/backend/gl-kernel.js index 7af5e074..ffcb0e65 100644 --- a/test/internal/backend/gl-kernel.js +++ b/test/internal/backend/gl-kernel.js @@ -11,7 +11,7 @@ test('nativeFunctionArguments() parse simple function', () => { assert.deepEqual(result, { argumentNames: ['longName'], - argumentTypes: ['Array(2)'] + argumentTypes: ['Array(2)'], }); }); @@ -22,7 +22,7 @@ test('nativeFunctionArguments() parse simple function with argument that has num assert.deepEqual(result, { argumentNames: ['longName123'], - argumentTypes: ['Array(2)'] + argumentTypes: ['Array(2)'], }); }); @@ -33,7 +33,7 @@ test('nativeFunctionArguments() parse simple function, multiple arguments', () = assert.deepEqual(result, { argumentNames: ['a', 'b', 'c'], - argumentTypes: ['Array(3)', 'Array(3)', 'Number'] + argumentTypes: ['Array(3)', 'Array(3)', 'Number'], }); }); @@ -44,7 +44,7 @@ test('nativeFunctionArguments() parse simple function, multiple arguments with c assert.deepEqual(result, { argumentNames: ['a', 'c', 'e'], - argumentTypes: ['Array(3)', 'Array(2)', 'Number'] + argumentTypes: ['Array(3)', 'Array(2)', 'Number'], }); }); @@ -59,7 +59,7 @@ test('nativeFunctionArguments() parse simple function, multiple arguments on mul assert.deepEqual(result, { argumentNames: ['a', 'b', 'c'], - argumentTypes: ['Array(4)', 'Array(3)', 'Number'] + argumentTypes: ['Array(4)', 'Array(3)', 'Number'], }); }); @@ -77,7 +77,7 @@ test('nativeFunctionArguments() parse simple function, multiple arguments on mul assert.deepEqual(result, { argumentNames: ['a', 'b', 'c'], - argumentTypes: ['Array(2)', 'Array(3)', 'Number'] + argumentTypes: ['Array(2)', 'Array(3)', 'Number'], }); }); @@ -92,7 +92,7 @@ test('nativeFunctionArguments() parse simple function, multiple arguments on mul assert.deepEqual(result, { argumentNames: ['a', 'b', 'c'], - argumentTypes: ['Array(2)', 'Array(4)', 'Integer'] + argumentTypes: ['Array(2)', 'Array(4)', 'Integer'], }); }); @@ -105,7 +105,7 @@ test('nativeFunctionArguments() parse simple function that is cut short', () => assert.deepEqual(result, { argumentNames: ['a', 'b', 'c'], - argumentTypes: ['Array(2)', 'Array(3)', 'Number'] + argumentTypes: ['Array(2)', 'Array(3)', 'Number'], }); }); @@ -118,7 +118,12 @@ test('getVariablePrecisionString() when tactic is set to "balanced" returns "med }); test('getVariablePrecisionString() when tactic is set to "precision" returns "highp"', () => { - assert.equal(GLKernel.prototype.getVariablePrecisionString.call({ tactic: 'precision' }), 'highp'); + assert.equal( + GLKernel.prototype.getVariablePrecisionString.call({ + tactic: 'precision', + }), + 'highp' + ); }); test('getVariablePrecisionString() when tactic is not set and texSize is within lowFloatPrecision', () => { @@ -130,8 +135,8 @@ test('getVariablePrecisionString() when tactic is not set and texSize is within mediumFloatPrecision: { rangeMax: Math.log2(4 * 4) }, highFloatPrecision: { rangeMax: Math.log2(5 * 5) }, isSpeedTacticSupported: true, - } - } + }, + }, }; const textureSize = [2, 2]; assert.equal(GLKernel.prototype.getVariablePrecisionString.call(mockInstance, textureSize), 'lowp'); @@ -146,8 +151,8 @@ test('getVariablePrecisionString() when tactic is not set and texSize is within mediumFloatPrecision: { rangeMax: Math.log2(4 * 4) }, highFloatPrecision: { rangeMax: Math.log2(5 * 5) }, isSpeedTacticSupported: true, - } - } + }, + }, }; const textureSize = [4, 4]; assert.equal(GLKernel.prototype.getVariablePrecisionString.call(mockInstance, textureSize), 'mediump'); @@ -162,8 +167,8 @@ test('getVariablePrecisionString() when tactic is not set and texSize is within mediumFloatPrecision: { rangeMax: Math.log2(4 * 4) }, highFloatPrecision: { rangeMax: Math.log2(5 * 5) }, isSpeedTacticSupported: true, - } - } + }, + }, }; const textureSize = [5, 5]; assert.equal(GLKernel.prototype.getVariablePrecisionString.call(mockInstance, textureSize), 'highp'); @@ -178,8 +183,8 @@ test('getVariablePrecisionString() when tactic is not set and texSize is outside mediumFloatPrecision: { rangeMax: Math.log2(4 * 4) }, highFloatPrecision: { rangeMax: Math.log2(5 * 5) }, isSpeedTacticSupported: true, - } - } + }, + }, }; const textureSize = [6, 6]; assert.throws(() => GLKernel.prototype.getVariablePrecisionString.call(mockInstance, textureSize)); @@ -194,8 +199,8 @@ test('getVariablePrecisionString() when tactic is not set and texSize is within mediumIntPrecision: { rangeMax: Math.log2(4 * 4) }, highIntPrecision: { rangeMax: Math.log2(5 * 5) }, isSpeedTacticSupported: true, - } - } + }, + }, }; const textureSize = [2, 2]; assert.equal(GLKernel.prototype.getVariablePrecisionString.call(mockInstance, textureSize, null, true), 'lowp'); @@ -210,8 +215,8 @@ test('getVariablePrecisionString() when tactic is not set and texSize is within mediumIntPrecision: { rangeMax: Math.log2(4 * 4) }, highIntPrecision: { rangeMax: Math.log2(5 * 5) }, isSpeedTacticSupported: true, - } - } + }, + }, }; const textureSize = [4, 4]; assert.equal(GLKernel.prototype.getVariablePrecisionString.call(mockInstance, textureSize, null, true), 'mediump'); @@ -226,8 +231,8 @@ test('getVariablePrecisionString() when tactic is not set and texSize is within mediumIntPrecision: { rangeMax: Math.log2(4 * 4) }, highIntPrecision: { rangeMax: Math.log2(5 * 5) }, isSpeedTacticSupported: true, - } - } + }, + }, }; const textureSize = [5, 5]; assert.equal(GLKernel.prototype.getVariablePrecisionString.call(mockInstance, textureSize, null, true), 'highp'); @@ -242,8 +247,8 @@ test('getVariablePrecisionString() when tactic is not set and texSize is outside mediumIntPrecision: { rangeMax: Math.log2(4 * 4) }, highIntPrecision: { rangeMax: Math.log2(5 * 5) }, isSpeedTacticSupported: true, - } - } + }, + }, }; const textureSize = [6, 6]; assert.throws(() => GLKernel.prototype.getVariablePrecisionString.call(mockInstance, textureSize, null, true)); @@ -255,8 +260,8 @@ test('getVariablePrecisionString() when features.isSpeedTacticSupported is false constructor: { features: { isSpeedTacticSupported: false, - } - } + }, + }, }; const textureSize = [1, 1]; assert.equal(GLKernel.prototype.getVariablePrecisionString.call(mockInstance, textureSize, null, true), 'highp'); @@ -310,7 +315,7 @@ test('setOutput() throws when not dynamicOutput and already compiled', () => { GLKernel.prototype.setOutput.call({ program: {}, toKernelOutput: () => {}, - dynamicOutput: false + dynamicOutput: false, }); }, new Error('Resizing a kernel with dynamicOutput: false is not possible')); }); @@ -329,13 +334,13 @@ test('setOutput() when does not need to trigger recompile', () => { const mockContext = { bindFramebuffer: sinon.spy(), FRAMEBUFFER: 'FRAMEBUFFER', - viewport: sinon.spy() + viewport: sinon.spy(), }; const mockTexture = { delete: sinon.spy(), }; const mockMappedTexture = { - delete: sinon.spy() + delete: sinon.spy(), }; const mock_setupOutputTexture = sinon.spy(); const mock_setupSubOutputTextures = sinon.spy(); @@ -360,9 +365,7 @@ test('setOutput() when does not need to trigger recompile', () => { height: 0, }, texture: mockTexture, - mappedTextures: [ - mockMappedTexture - ], + mappedTextures: [mockMappedTexture], _setupOutputTexture: mock_setupOutputTexture, _setupSubOutputTextures: mock_setupSubOutputTextures, }; @@ -394,12 +397,12 @@ test('setOutput() when needs to trigger recompile', () => { texSize: [1, 1], toKernelOutput: GLKernel.prototype.toKernelOutput, dynamicOutput: true, - getVariablePrecisionString: (textureSize) => { + getVariablePrecisionString: textureSize => { if (textureSize[0] === 1) return 'lowp'; return 'highp'; }, - switchKernels: sinon.spy() + switchKernels: sinon.spy(), }; GLKernel.prototype.setOutput.call(mockInstance, [100, 100]); assert.ok(mockInstance.switchKernels.callCount, 1); -}); \ No newline at end of file +}); diff --git a/test/internal/backend/headless-gl/kernel/index.js b/test/internal/backend/headless-gl/kernel/index.js index 7e02a453..e3175ad1 100644 --- a/test/internal/backend/headless-gl/kernel/index.js +++ b/test/internal/backend/headless-gl/kernel/index.js @@ -7,10 +7,10 @@ describe('internal: HeadlessGLKernel'); global.document = { createElement: () => { return {}; - } + }, }; // this is done late on purpose! Do not change this, as it causes HeadlessGL to initialize with certain values -const { HeadlessGLKernel } = require('../../../../../src'); + const { HeadlessGLKernel } = require('../../../../../src'); HeadlessGLKernel.setupFeatureChecks(); assert.ok(true); delete global.document; diff --git a/test/internal/backend/web-gl/function-node/astBinaryExpression.js b/test/internal/backend/web-gl/function-node/astBinaryExpression.js index a7ef538e..358c1bfb 100644 --- a/test/internal/backend/web-gl/function-node/astBinaryExpression.js +++ b/test/internal/backend/web-gl/function-node/astBinaryExpression.js @@ -3,371 +3,376 @@ const { WebGLFunctionNode } = require(process.cwd() + '/src'); describe('WebGLFunctionNode.astBinaryExpression()'); - test('divide float & float', () => { - const node = new WebGLFunctionNode(`function kernel(left, right) { + const node = new WebGLFunctionNode( + `function kernel(left, right) { return left / right; - }`, { - returnType: 'Number', - output: [1], - argumentTypes: ['Number', 'Number'] - }); - - assert.equal(node.toString(), 'float kernel(float user_left, float user_right) {' - + '\nreturn (user_left/user_right);' - + '\n}'); + }`, + { + returnType: 'Number', + output: [1], + argumentTypes: ['Number', 'Number'], + } + ); + + assert.equal(node.toString(), 'float kernel(float user_left, float user_right) {' + '\nreturn (user_left/user_right);' + '\n}'); }); test('divide float & int', () => { - const node = new WebGLFunctionNode(`function kernel(left, right) { + const node = new WebGLFunctionNode( + `function kernel(left, right) { return left / right; - }`, { - returnType: 'Number', - output: [1], - argumentTypes: ['Number', 'Integer'] - }); - - assert.equal(node.toString(), 'float kernel(float user_left, int user_right) {' - + '\nreturn (user_left/float(user_right));' - + '\n}'); + }`, + { + returnType: 'Number', + output: [1], + argumentTypes: ['Number', 'Integer'], + } + ); + + assert.equal(node.toString(), 'float kernel(float user_left, int user_right) {' + '\nreturn (user_left/float(user_right));' + '\n}'); }); test('divide float & literal float', () => { - const node = new WebGLFunctionNode(`function kernel(left) { + const node = new WebGLFunctionNode( + `function kernel(left) { return left / 1.1; - }`, { - returnType: 'Number', - output: [1], - argumentTypes: ['Number'] - }); - - assert.equal(node.toString(), 'float kernel(float user_left) {' - + '\nreturn (user_left/1.1);' - + '\n}'); + }`, + { + returnType: 'Number', + output: [1], + argumentTypes: ['Number'], + } + ); + + assert.equal(node.toString(), 'float kernel(float user_left) {' + '\nreturn (user_left/1.1);' + '\n}'); }); test('divide float & literal integer', () => { - const node = new WebGLFunctionNode(`function kernel(left) { + const node = new WebGLFunctionNode( + `function kernel(left) { return left / 1; - }`, { - returnType: 'Number', - output: [1], - argumentTypes: ['Number'] - }); - - assert.equal(node.toString(), 'float kernel(float user_left) {' - + '\nreturn (user_left/1.0);' - + '\n}'); + }`, + { + returnType: 'Number', + output: [1], + argumentTypes: ['Number'], + } + ); + + assert.equal(node.toString(), 'float kernel(float user_left) {' + '\nreturn (user_left/1.0);' + '\n}'); }); test('divide float & Input', () => { - const node = new WebGLFunctionNode(`function kernel(left, right) { + const node = new WebGLFunctionNode( + `function kernel(left, right) { return left / right[this.thread.x]; - }`, { - returnType: 'Number', - output: [1], - argumentTypes: ['Number', 'Input'], - lookupFunctionArgumentBitRatio: () => 4, - }); - - assert.equal(node.toString(), 'float kernel(float user_left, sampler2D user_right,ivec2 user_rightSize,ivec3 user_rightDim) {' - + '\nreturn (user_left/get32(user_right, user_rightSize, user_rightDim, 0, 0, threadId.x));' - + '\n}'); + }`, + { + returnType: 'Number', + output: [1], + argumentTypes: ['Number', 'Input'], + lookupFunctionArgumentBitRatio: () => 4, + } + ); + + assert.equal(node.toString(), 'float kernel(float user_left, sampler2D user_right,ivec2 user_rightSize,ivec3 user_rightDim) {' + '\nreturn (user_left/get32(user_right, user_rightSize, user_rightDim, 0, 0, threadId.x));' + '\n}'); }); test('divide int & float', () => { - const node = new WebGLFunctionNode(`function kernel(left, right) { + const node = new WebGLFunctionNode( + `function kernel(left, right) { return left / right; - }`, { - returnType: 'Number', - output: [1], - argumentTypes: ['Integer', 'Number'] - }); - - assert.equal(node.toString(), 'float kernel(int user_left, float user_right) {' - + '\nreturn float((user_left/int(user_right)));' - + '\n}'); + }`, + { + returnType: 'Number', + output: [1], + argumentTypes: ['Integer', 'Number'], + } + ); + + assert.equal(node.toString(), 'float kernel(int user_left, float user_right) {' + '\nreturn float((user_left/int(user_right)));' + '\n}'); }); test('divide int & int', () => { - const node = new WebGLFunctionNode(`function kernel(left, right) { + const node = new WebGLFunctionNode( + `function kernel(left, right) { return left / right; - }`, { - returnType: 'Number', - output: [1], - argumentTypes: ['Integer', 'Integer'] - }); - - assert.equal(node.toString(), 'float kernel(int user_left, int user_right) {' - + '\nreturn float((user_left/user_right));' - + '\n}'); + }`, + { + returnType: 'Number', + output: [1], + argumentTypes: ['Integer', 'Integer'], + } + ); + + assert.equal(node.toString(), 'float kernel(int user_left, int user_right) {' + '\nreturn float((user_left/user_right));' + '\n}'); }); test('divide int & literal float', () => { - const node = new WebGLFunctionNode(`function kernel(left) { + const node = new WebGLFunctionNode( + `function kernel(left) { return left / 1.1; - }`, { - returnType: 'Number', - output: [1], - argumentTypes: ['Integer'] - }); - - assert.equal(node.toString(), 'float kernel(int user_left) {' - + '\nreturn float((user_left/1));' - + '\n}'); + }`, + { + returnType: 'Number', + output: [1], + argumentTypes: ['Integer'], + } + ); + + assert.equal(node.toString(), 'float kernel(int user_left) {' + '\nreturn float((user_left/1));' + '\n}'); }); test('divide int & literal integer', () => { - const node = new WebGLFunctionNode(`function kernel(left) { + const node = new WebGLFunctionNode( + `function kernel(left) { return left / 1; - }`, { - returnType: 'Number', - output: [1], - argumentTypes: ['Integer'] - }); - - assert.equal(node.toString(), 'float kernel(int user_left) {' - + '\nreturn float((user_left/1));' - + '\n}'); + }`, + { + returnType: 'Number', + output: [1], + argumentTypes: ['Integer'], + } + ); + + assert.equal(node.toString(), 'float kernel(int user_left) {' + '\nreturn float((user_left/1));' + '\n}'); }); test('divide int & Input', () => { - const node = new WebGLFunctionNode(`function kernel(left, right) { + const node = new WebGLFunctionNode( + `function kernel(left, right) { return left / right[this.thread.x]; - }`, { - returnType: 'Number', - output: [1], - argumentTypes: ['Integer', 'Input'], - lookupFunctionArgumentBitRatio: () => 4, - }); - - assert.equal(node.toString(), 'float kernel(int user_left, sampler2D user_right,ivec2 user_rightSize,ivec3 user_rightDim) {' - + '\nreturn float((user_left/int(get32(user_right, user_rightSize, user_rightDim, 0, 0, threadId.x))));' - + '\n}'); + }`, + { + returnType: 'Number', + output: [1], + argumentTypes: ['Integer', 'Input'], + lookupFunctionArgumentBitRatio: () => 4, + } + ); + + assert.equal(node.toString(), 'float kernel(int user_left, sampler2D user_right,ivec2 user_rightSize,ivec3 user_rightDim) {' + '\nreturn float((user_left/int(get32(user_right, user_rightSize, user_rightDim, 0, 0, threadId.x))));' + '\n}'); }); test('divide literal integer & float', () => { - const node = new WebGLFunctionNode(`function kernel(left) { + const node = new WebGLFunctionNode( + `function kernel(left) { return 1 / left; - }`, { - returnType: 'Number', - output: [1], - argumentTypes: ['Number'] - }); - - assert.equal(node.toString(), 'float kernel(float user_left) {' - + '\nreturn (1.0/user_left);' - + '\n}'); + }`, + { + returnType: 'Number', + output: [1], + argumentTypes: ['Number'], + } + ); + + assert.equal(node.toString(), 'float kernel(float user_left) {' + '\nreturn (1.0/user_left);' + '\n}'); }); test('divide literal integer & int', () => { - const node = new WebGLFunctionNode(`function kernel(left) { + const node = new WebGLFunctionNode( + `function kernel(left) { return 1 / left; - }`, { - returnType: 'Number', - output: [1], - argumentTypes: ['Integer'] - }); - - assert.equal(node.toString(), 'float kernel(int user_left) {' - + '\nreturn float((1/user_left));' - + '\n}'); + }`, + { + returnType: 'Number', + output: [1], + argumentTypes: ['Integer'], + } + ); + + assert.equal(node.toString(), 'float kernel(int user_left) {' + '\nreturn float((1/user_left));' + '\n}'); }); test('divide literal integer & literal float', () => { - const node = new WebGLFunctionNode(`function kernel() { + const node = new WebGLFunctionNode( + `function kernel() { return 1 / 1.1; - }`, { - returnType: 'Number', - output: [1], - argumentTypes: [] - }); - - assert.equal(node.toString(), 'float kernel() {' - + '\nreturn (1.0/1.1);' - + '\n}'); + }`, + { + returnType: 'Number', + output: [1], + argumentTypes: [], + } + ); + + assert.equal(node.toString(), 'float kernel() {' + '\nreturn (1.0/1.1);' + '\n}'); }); test('divide literal integer & literal integer', () => { - const node = new WebGLFunctionNode(`function kernel() { + const node = new WebGLFunctionNode( + `function kernel() { return 1 / 1; - }`, { - returnType: 'Number', - output: [1], - argumentTypes: [] - }); - - assert.equal(node.toString(), 'float kernel() {' - + '\nreturn (1.0/1.0);' - + '\n}'); + }`, + { + returnType: 'Number', + output: [1], + argumentTypes: [], + } + ); + + assert.equal(node.toString(), 'float kernel() {' + '\nreturn (1.0/1.0);' + '\n}'); }); test('divide literal integer & Input', () => { - const node = new WebGLFunctionNode(`function kernel(v) { + const node = new WebGLFunctionNode( + `function kernel(v) { return 1 / v[this.thread.x]; - }`, { - returnType: 'Number', - output: [1], - argumentTypes: ['Input'], - lookupFunctionArgumentBitRatio: () => 4, - }); - - assert.equal(node.toString(), 'float kernel(sampler2D user_v,ivec2 user_vSize,ivec3 user_vDim) {' - + '\nreturn (1.0/get32(user_v, user_vSize, user_vDim, 0, 0, threadId.x));' - + '\n}'); + }`, + { + returnType: 'Number', + output: [1], + argumentTypes: ['Input'], + lookupFunctionArgumentBitRatio: () => 4, + } + ); + + assert.equal(node.toString(), 'float kernel(sampler2D user_v,ivec2 user_vSize,ivec3 user_vDim) {' + '\nreturn (1.0/get32(user_v, user_vSize, user_vDim, 0, 0, threadId.x));' + '\n}'); }); test('divide literal float & float', () => { - const node = new WebGLFunctionNode(`function kernel(right) { + const node = new WebGLFunctionNode( + `function kernel(right) { return 1.1 / right; - }`, { - returnType: 'Number', - output: [1], - argumentTypes: ['Number'] - }); - - assert.equal(node.toString(), 'float kernel(float user_right) {' - + '\nreturn (1.1/user_right);' - + '\n}'); + }`, + { + returnType: 'Number', + output: [1], + argumentTypes: ['Number'], + } + ); + + assert.equal(node.toString(), 'float kernel(float user_right) {' + '\nreturn (1.1/user_right);' + '\n}'); }); test('divide literal float & int', () => { - const node = new WebGLFunctionNode(`function kernel(right) { + const node = new WebGLFunctionNode( + `function kernel(right) { return 1.1 / right; - }`, { - returnType: 'Number', - output: [1], - argumentTypes: ['Integer'] - }); - - assert.equal(node.toString(), 'float kernel(int user_right) {' - + '\nreturn (1.1/float(user_right));' - + '\n}'); + }`, + { + returnType: 'Number', + output: [1], + argumentTypes: ['Integer'], + } + ); + + assert.equal(node.toString(), 'float kernel(int user_right) {' + '\nreturn (1.1/float(user_right));' + '\n}'); }); test('divide literal float & literal float', () => { - const node = new WebGLFunctionNode(`function kernel() { + const node = new WebGLFunctionNode( + `function kernel() { return 1.1 / 1.1; - }`, { - returnType: 'Number', - output: [1], - argumentTypes: [] - }); - - assert.equal(node.toString(), 'float kernel() {' - + '\nreturn (1.1/1.1);' - + '\n}'); + }`, + { + returnType: 'Number', + output: [1], + argumentTypes: [], + } + ); + + assert.equal(node.toString(), 'float kernel() {' + '\nreturn (1.1/1.1);' + '\n}'); }); test('divide literal float & literal integer', () => { - const node = new WebGLFunctionNode(`function kernel() { + const node = new WebGLFunctionNode( + `function kernel() { return 1.1 / 1; - }`, { - returnType: 'Number', - output: [1], - argumentTypes: [] - }); - - assert.equal(node.toString(), 'float kernel() {' - + '\nreturn (1.1/1.0);' - + '\n}'); + }`, + { + returnType: 'Number', + output: [1], + argumentTypes: [], + } + ); + + assert.equal(node.toString(), 'float kernel() {' + '\nreturn (1.1/1.0);' + '\n}'); }); test('divide literal float & Input', () => { - const node = new WebGLFunctionNode(`function kernel(v) { + const node = new WebGLFunctionNode( + `function kernel(v) { return 1.1 / v[this.thread.x]; - }`, { - returnType: 'Number', - output: [1], - argumentTypes: ['Input'], - lookupFunctionArgumentBitRatio: () => 4, - }); - - assert.equal(node.toString(), 'float kernel(sampler2D user_v,ivec2 user_vSize,ivec3 user_vDim) {' - + '\nreturn (1.1/get32(user_v, user_vSize, user_vDim, 0, 0, threadId.x));' - + '\n}'); + }`, + { + returnType: 'Number', + output: [1], + argumentTypes: ['Input'], + lookupFunctionArgumentBitRatio: () => 4, + } + ); + + assert.equal(node.toString(), 'float kernel(sampler2D user_v,ivec2 user_vSize,ivec3 user_vDim) {' + '\nreturn (1.1/get32(user_v, user_vSize, user_vDim, 0, 0, threadId.x));' + '\n}'); }); test('divide this.thread.x by this.output.x and multiple, integer, integer, and float with this.fixIntegerDivisionAccuracy = false', () => { - const node = new WebGLFunctionNode(`function kernel() { + const node = new WebGLFunctionNode( + `function kernel() { return (this.thread.x / this.output.x) * 4; - }`, { - returnType: 'Number', - output: [1], - argumentTypes: [], - lookupFunctionArgumentBitRatio: () => 4, - fixIntegerDivisionAccuracy: false, - }); - - assert.equal(node.toString(), 'float kernel() {' - + '\nreturn float(((threadId.x/1)*4));' - + '\n}'); + }`, + { + returnType: 'Number', + output: [1], + argumentTypes: [], + lookupFunctionArgumentBitRatio: () => 4, + fixIntegerDivisionAccuracy: false, + } + ); + + assert.equal(node.toString(), 'float kernel() {' + '\nreturn float(((threadId.x/1)*4));' + '\n}'); }); test('divide this.thread.x by this.output.x and multiple, integer, integer, and float with this.fixIntegerDivisionAccuracy = true', () => { - const node = new WebGLFunctionNode(`function kernel() { + const node = new WebGLFunctionNode( + `function kernel() { return (this.thread.x / this.output.x) * 4; - }`, { - returnType: 'Number', - output: [1], - argumentTypes: [], - lookupFunctionArgumentBitRatio: () => 4, - fixIntegerDivisionAccuracy: true, - }); - - assert.equal(node.toString(), 'float kernel() {' - + '\nreturn (divWithIntCheck(float(threadId.x), 1.0)*4.0);' - + '\n}'); + }`, + { + returnType: 'Number', + output: [1], + argumentTypes: [], + lookupFunctionArgumentBitRatio: () => 4, + fixIntegerDivisionAccuracy: true, + } + ); + + assert.equal(node.toString(), 'float kernel() {' + '\nreturn (divWithIntCheck(float(threadId.x), 1.0)*4.0);' + '\n}'); }); test('multiply Input and Input', () => { - const node = new WebGLFunctionNode('function kernel(v1, v2) {' - + '\n return v1[this.thread.x] * v2[this.thread.x];' - + '\n}', { + const node = new WebGLFunctionNode('function kernel(v1, v2) {' + '\n return v1[this.thread.x] * v2[this.thread.x];' + '\n}', { output: [1], argumentTypes: ['Input', 'Input'], lookupFunctionArgumentBitRatio: () => 4, }); - assert.equal(node.toString(), 'float kernel(sampler2D user_v1,ivec2 user_v1Size,ivec3 user_v1Dim, sampler2D user_v2,ivec2 user_v2Size,ivec3 user_v2Dim) {' - + '\nreturn (get32(user_v1, user_v1Size, user_v1Dim, 0, 0, threadId.x)*get32(user_v2, user_v2Size, user_v2Dim, 0, 0, threadId.x));' - + '\n}'); + assert.equal(node.toString(), 'float kernel(sampler2D user_v1,ivec2 user_v1Size,ivec3 user_v1Dim, sampler2D user_v2,ivec2 user_v2Size,ivec3 user_v2Dim) {' + '\nreturn (get32(user_v1, user_v1Size, user_v1Dim, 0, 0, threadId.x)*get32(user_v2, user_v2Size, user_v2Dim, 0, 0, threadId.x));' + '\n}'); }); test('multiply Input and int', () => { - const node = new WebGLFunctionNode('function kernel(v1, v2) {' - + '\n return v1[this.thread.x] * v2;' - + '\n}', { + const node = new WebGLFunctionNode('function kernel(v1, v2) {' + '\n return v1[this.thread.x] * v2;' + '\n}', { output: [1], argumentTypes: ['Input', 'Integer'], lookupFunctionArgumentBitRatio: () => 4, }); - assert.equal(node.toString(), 'float kernel(sampler2D user_v1,ivec2 user_v1Size,ivec3 user_v1Dim, int user_v2) {' - + '\nreturn (get32(user_v1, user_v1Size, user_v1Dim, 0, 0, threadId.x)*float(user_v2));' - + '\n}'); + assert.equal(node.toString(), 'float kernel(sampler2D user_v1,ivec2 user_v1Size,ivec3 user_v1Dim, int user_v2) {' + '\nreturn (get32(user_v1, user_v1Size, user_v1Dim, 0, 0, threadId.x)*float(user_v2));' + '\n}'); }); test('multiply Input and float', () => { - const node = new WebGLFunctionNode('function kernel(v1, v2) {' - + '\n return v1[this.thread.x] * v2;' - + '\n}', { + const node = new WebGLFunctionNode('function kernel(v1, v2) {' + '\n return v1[this.thread.x] * v2;' + '\n}', { output: [1], argumentTypes: ['Input', 'Float'], lookupFunctionArgumentBitRatio: () => 4, }); - assert.equal(node.toString(), 'float kernel(sampler2D user_v1,ivec2 user_v1Size,ivec3 user_v1Dim, float user_v2) {' - + '\nreturn (get32(user_v1, user_v1Size, user_v1Dim, 0, 0, threadId.x)*user_v2);' - + '\n}'); + assert.equal(node.toString(), 'float kernel(sampler2D user_v1,ivec2 user_v1Size,ivec3 user_v1Dim, float user_v2) {' + '\nreturn (get32(user_v1, user_v1Size, user_v1Dim, 0, 0, threadId.x)*user_v2);' + '\n}'); }); test('multiply Input and Number', () => { - const node = new WebGLFunctionNode('function kernel(v1, v2) {' - + '\n return v1[this.thread.x] * v2;' - + '\n}', { + const node = new WebGLFunctionNode('function kernel(v1, v2) {' + '\n return v1[this.thread.x] * v2;' + '\n}', { output: [1], argumentTypes: ['Input', 'Number'], lookupFunctionArgumentBitRatio: () => 4, }); - assert.equal(node.toString(), 'float kernel(sampler2D user_v1,ivec2 user_v1Size,ivec3 user_v1Dim, float user_v2) {' - + '\nreturn (get32(user_v1, user_v1Size, user_v1Dim, 0, 0, threadId.x)*user_v2);' - + '\n}'); + assert.equal(node.toString(), 'float kernel(sampler2D user_v1,ivec2 user_v1Size,ivec3 user_v1Dim, float user_v2) {' + '\nreturn (get32(user_v1, user_v1Size, user_v1Dim, 0, 0, threadId.x)*user_v2);' + '\n}'); }); diff --git a/test/internal/backend/web-gl/function-node/astCallExpression.js b/test/internal/backend/web-gl/function-node/astCallExpression.js index cc55f22b..db0da4e8 100644 --- a/test/internal/backend/web-gl/function-node/astCallExpression.js +++ b/test/internal/backend/web-gl/function-node/astCallExpression.js @@ -4,70 +4,74 @@ const { WebGLFunctionNode } = require(process.cwd() + '/src'); describe('WebGLFunctionNode.astCallExpression()'); test('handles Math.abs with floats', () => { - const node = new WebGLFunctionNode(`function kernel(v) { + const node = new WebGLFunctionNode( + `function kernel(v) { return Math.abs(v); - }`, { output: [1], argumentTypes: ['Number'] }); - assert.equal(node.toString(), 'float kernel(float user_v) {' - + '\nreturn abs(user_v);' - + '\n}'); + }`, + { output: [1], argumentTypes: ['Number'] } + ); + assert.equal(node.toString(), 'float kernel(float user_v) {' + '\nreturn abs(user_v);' + '\n}'); }); test('handles Math.abs with ints', () => { - const node = new WebGLFunctionNode(`function kernel(v) { + const node = new WebGLFunctionNode( + `function kernel(v) { return Math.abs(v); - }`, { output: [1], argumentTypes: ['Integer'] }); - assert.equal(node.toString(), 'float kernel(int user_v) {' - + '\nreturn abs(float(user_v));' - + '\n}'); + }`, + { output: [1], argumentTypes: ['Integer'] } + ); + assert.equal(node.toString(), 'float kernel(int user_v) {' + '\nreturn abs(float(user_v));' + '\n}'); }); test('handles Math.pow with floats', () => { - const node = new WebGLFunctionNode(`function kernel(v, v2) { + const node = new WebGLFunctionNode( + `function kernel(v, v2) { return Math.pow(v, v2); - }`, { output: [1], argumentTypes: ['Number', 'Number'] }); - assert.equal(node.toString(), 'float kernel(float user_v, float user_v2) {' - + '\nreturn _pow(user_v, user_v2);' - + '\n}'); + }`, + { output: [1], argumentTypes: ['Number', 'Number'] } + ); + assert.equal(node.toString(), 'float kernel(float user_v, float user_v2) {' + '\nreturn _pow(user_v, user_v2);' + '\n}'); }); test('handles Math.pow with mixed 1', () => { - const node = new WebGLFunctionNode(`function kernel(v, v2) { + const node = new WebGLFunctionNode( + `function kernel(v, v2) { return Math.pow(v, v2); - }`, { output: [1], argumentTypes: ['Number', 'Integer'] }); - assert.equal(node.toString(), 'float kernel(float user_v, int user_v2) {' - + '\nreturn _pow(user_v, float(user_v2));' - + '\n}'); + }`, + { output: [1], argumentTypes: ['Number', 'Integer'] } + ); + assert.equal(node.toString(), 'float kernel(float user_v, int user_v2) {' + '\nreturn _pow(user_v, float(user_v2));' + '\n}'); }); test('handles Math.pow with mixed 2', () => { - const node = new WebGLFunctionNode(`function kernel(v, v2) { + const node = new WebGLFunctionNode( + `function kernel(v, v2) { return Math.pow(v, v2); - }`, { output: [1], argumentTypes: ['Integer', 'Number'] }); - assert.equal(node.toString(), 'float kernel(int user_v, float user_v2) {' - + '\nreturn _pow(float(user_v), user_v2);' - + '\n}'); + }`, + { output: [1], argumentTypes: ['Integer', 'Number'] } + ); + assert.equal(node.toString(), 'float kernel(int user_v, float user_v2) {' + '\nreturn _pow(float(user_v), user_v2);' + '\n}'); }); test('handles Math.pow with ints', () => { - const node = new WebGLFunctionNode(`function kernel(v, v2) { + const node = new WebGLFunctionNode( + `function kernel(v, v2) { return Math.pow(v, v2); - }`, { output: [1], argumentTypes: ['Integer', 'Integer'] }); - assert.equal(node.toString(), 'float kernel(int user_v, int user_v2) {' - + '\nreturn _pow(float(user_v), float(user_v2));' - + '\n}'); + }`, + { output: [1], argumentTypes: ['Integer', 'Integer'] } + ); + assert.equal(node.toString(), 'float kernel(int user_v, int user_v2) {' + '\nreturn _pow(float(user_v), float(user_v2));' + '\n}'); }); test('handles argument of type Input', () => { let lookupReturnTypeCalls = 0; let lookupFunctionArgumentTypes = 0; - const node = new WebGLFunctionNode('function kernel(v) {' - + '\n return childFunction(v);' - + '\n}', { + const node = new WebGLFunctionNode('function kernel(v) {' + '\n return childFunction(v);' + '\n}', { output: [1], argumentTypes: ['Input'], needsArgumentType: () => false, - lookupReturnType: (functionName) => { + lookupReturnType: functionName => { lookupReturnTypeCalls++; if (functionName === 'childFunction') { return 'Number'; } throw new Error(`unhanded lookupReturnType for ${functionName}`); }, - lookupFunctionArgumentTypes: (functionName) => { + lookupFunctionArgumentTypes: functionName => { lookupFunctionArgumentTypes++; if (functionName === 'childFunction') { return ['Input']; @@ -75,31 +79,27 @@ test('handles argument of type Input', () => { throw new Error(`unhanded lookupFunctionArgumentTypes for ${functionName}`); }, triggerImplyArgumentBitRatio: () => {}, - assignArgumentType: () => {} + assignArgumentType: () => {}, }); - assert.equal(node.toString(), 'float kernel(sampler2D user_v,ivec2 user_vSize,ivec3 user_vDim) {' - + '\nreturn childFunction(user_v,user_vSize,user_vDim);' - + '\n}'); + assert.equal(node.toString(), 'float kernel(sampler2D user_v,ivec2 user_vSize,ivec3 user_vDim) {' + '\nreturn childFunction(user_v,user_vSize,user_vDim);' + '\n}'); assert.equal(lookupReturnTypeCalls, 2); assert.equal(lookupFunctionArgumentTypes, 1); }); test('handles argument of type HTMLImageArray', () => { let lookupReturnTypeCalls = 0; let lookupFunctionArgumentTypes = 0; - const node = new WebGLFunctionNode('function kernel(v) {' - + '\n return childFunction(v);' - + '\n}', { + const node = new WebGLFunctionNode('function kernel(v) {' + '\n return childFunction(v);' + '\n}', { output: [1], argumentTypes: ['HTMLImageArray'], needsArgumentType: () => false, - lookupReturnType: (functionName) => { + lookupReturnType: functionName => { lookupReturnTypeCalls++; if (functionName === 'childFunction') { return 'Number'; } throw new Error(`unhanded lookupReturnType for ${functionName}`); }, - lookupFunctionArgumentTypes: (functionName) => { + lookupFunctionArgumentTypes: functionName => { lookupFunctionArgumentTypes++; if (functionName === 'childFunction') { return ['HTMLImageArray']; @@ -107,29 +107,33 @@ test('handles argument of type HTMLImageArray', () => { throw new Error(`unhanded lookupFunctionArgumentTypes for ${functionName}`); }, triggerImplyArgumentBitRatio: () => {}, - assignArgumentType: () => {} + assignArgumentType: () => {}, }); - assert.equal(node.toString(), 'float kernel(sampler2DArray user_v,ivec2 user_vSize,ivec3 user_vDim) {' - + '\nreturn childFunction(user_v,user_vSize,user_vDim);' - + '\n}'); + assert.equal(node.toString(), 'float kernel(sampler2DArray user_v,ivec2 user_vSize,ivec3 user_vDim) {' + '\nreturn childFunction(user_v,user_vSize,user_vDim);' + '\n}'); assert.equal(lookupReturnTypeCalls, 2); assert.equal(lookupFunctionArgumentTypes, 1); }); test('handles argument types of CallExpression that return arrays', () => { - const node = new WebGLFunctionNode(`function kernel() { + const node = new WebGLFunctionNode( + `function kernel() { const p = [this.thread.x, this.thread.y]; const z = array2(array2(p, 0.01), 0.02); return 1.0; - }`, { - output: [1, 1], - lookupReturnType: () => 'Number', - needsArgumentType: () => false, - lookupFunctionArgumentTypes: () => [], - triggerImplyArgumentType: () => {} - }); - assert.equal(node.toString(), `float kernel() { + }`, + { + output: [1, 1], + lookupReturnType: () => 'Number', + needsArgumentType: () => false, + lookupFunctionArgumentTypes: () => [], + triggerImplyArgumentType: () => {}, + } + ); + assert.equal( + node.toString(), + `float kernel() { vec2 user_p=vec2(threadId.x, threadId.y); float user_z=array2(array2(user_p, 0.01), 0.02); return 1.0; -}`); +}` + ); }); diff --git a/test/internal/backend/web-gl/function-node/astForStatement.js b/test/internal/backend/web-gl/function-node/astForStatement.js index 787cf692..7cc32e74 100644 --- a/test/internal/backend/web-gl/function-node/astForStatement.js +++ b/test/internal/backend/web-gl/function-node/astForStatement.js @@ -4,27 +4,25 @@ const { WebGLFunctionNode } = require(process.cwd() + '/src'); describe('WebGLFunctionNode.astForStatement()'); test('with safe loop with init', () => { - const node = new WebGLFunctionNode(`function kernel() { + const node = new WebGLFunctionNode( + `function kernel() { let sum = 0; for (let i = 0;i < 100; i++) { sum++; } return sum; - }`, { - output: [1] - }); + }`, + { + output: [1], + } + ); - assert.equal(node.toString(), 'float kernel() {' - + '\nint user_sum=0;' - + '\nfor (int user_i=0;(user_i<100);user_i++){' - + '\nuser_sum++;}' - + '\n' - + '\nreturn float(user_sum);' - + '\n}'); + assert.equal(node.toString(), 'float kernel() {' + '\nint user_sum=0;' + '\nfor (int user_i=0;(user_i<100);user_i++){' + '\nuser_sum++;}' + '\n' + '\nreturn float(user_sum);' + '\n}'); }); test('with safe loop with init and if', () => { - const node = new WebGLFunctionNode(`function kernel() { + const node = new WebGLFunctionNode( + `function kernel() { let sum = 0; for (let i = 0;i < 100; i++) { if (i > 50) { @@ -32,148 +30,110 @@ test('with safe loop with init and if', () => { } } return sum; - }`, { - output: [1] - }); + }`, + { + output: [1], + } + ); - assert.equal(node.toString(), 'float kernel() {' - + '\nint user_sum=0;' - + '\nfor (int user_i=0;(user_i<100);user_i++){' - + '\nif ((user_i>50)){' - + '\nuser_sum++;}' - + '\n}' - + '\n' - + '\nreturn float(user_sum);' - + '\n}'); + assert.equal(node.toString(), 'float kernel() {' + '\nint user_sum=0;' + '\nfor (int user_i=0;(user_i<100);user_i++){' + '\nif ((user_i>50)){' + '\nuser_sum++;}' + '\n}' + '\n' + '\nreturn float(user_sum);' + '\n}'); }); test('with safe loop with no init', () => { - const node = new WebGLFunctionNode(`function kernel() { + const node = new WebGLFunctionNode( + `function kernel() { let sum = 0; const i = 0; for (;i < 100; i++) { sum++; } return sum; - }`, { - output: [1] - }); + }`, + { + output: [1], + } + ); - assert.equal(node.toString(), 'float kernel() {' - + '\nint user_sum=0;' - + '\nint user_i=0;' - + '\nfor (int safeI=0;safeI { - const node = new WebGLFunctionNode(`function kernel() { + const node = new WebGLFunctionNode( + `function kernel() { let sum = 0; for (let i = 0;; i++) { if (i > 100) break; sum++; } return sum; - }`, { - output: [1] - }); + }`, + { + output: [1], + } + ); - assert.equal(node.toString(), 'float kernel() {' - + '\nint user_sum=0;' - + '\nint user_i=0;' - + '\nfor (int safeI=0;safeI100)) {' - + '\nbreak;' - + '\n}' - + '\nuser_sum++;' - + '\nuser_i++;}' - + '\n' - + '\nreturn float(user_sum);' - + '\n}'); + assert.equal(node.toString(), 'float kernel() {' + '\nint user_sum=0;' + '\nint user_i=0;' + '\nfor (int safeI=0;safeI100)) {' + '\nbreak;' + '\n}' + '\nuser_sum++;' + '\nuser_i++;}' + '\n' + '\nreturn float(user_sum);' + '\n}'); }); test('with unsafe loop with init', () => { - const node = new WebGLFunctionNode(`function kernel(arg1) { + const node = new WebGLFunctionNode( + `function kernel(arg1) { let sum = 0; for (let i = 0 + arg1;i < 100; i++) { sum++; } return sum; - }`, { - output: [1], - argumentTypes: ['Number'] - }); + }`, + { + output: [1], + argumentTypes: ['Number'], + } + ); - assert.equal(node.toString(), 'float kernel(float user_arg1) {' - + '\nint user_sum=0;' - + '\nfloat user_i=(0.0+user_arg1);' - + '\nfor (int safeI=0;safeI { - const node = new WebGLFunctionNode(`function kernel(arg1) { + const node = new WebGLFunctionNode( + `function kernel(arg1) { let sum = 0; let i = 0 + arg1; for (;i < 100; i++) { sum++; } return sum; - }`, { - output: [1], - argumentTypes: ['Number'] - }); + }`, + { + output: [1], + argumentTypes: ['Number'], + } + ); - assert.equal(node.toString(), 'float kernel(float user_arg1) {' - + '\nint user_sum=0;' - + '\nfloat user_i=(0.0+user_arg1);' - + '\nfor (int safeI=0;safeI { - const node = new WebGLFunctionNode(`function kernel(arg1) { + const node = new WebGLFunctionNode( + `function kernel(arg1) { let sum = 0; let i = 0 + arg1; for (;100 > i; i++) { sum++; } return sum; - }`, { - output: [1], - argumentTypes: ['Number'] - }); + }`, + { + output: [1], + argumentTypes: ['Number'], + } + ); - assert.equal(node.toString(), 'float kernel(float user_arg1) {' - + '\nint user_sum=0;' - + '\nfloat user_i=(0.0+user_arg1);' - + '\nfor (int safeI=0;safeIuser_i)) break;' - + '\nuser_sum++;' - + '\nuser_i++;}' - + '\n' - + '\nreturn float(user_sum);' - + '\n}'); + assert.equal(node.toString(), 'float kernel(float user_arg1) {' + '\nint user_sum=0;' + '\nfloat user_i=(0.0+user_arg1);' + '\nfor (int safeI=0;safeIuser_i)) break;' + '\nuser_sum++;' + '\nuser_i++;}' + '\n' + '\nreturn float(user_sum);' + '\n}'); }); - test('nested safe loop', () => { - const node = new WebGLFunctionNode(`function kernel() { + const node = new WebGLFunctionNode( + `function kernel() { let sum = 0; for (let i = 0; i < 100; i++) { for (let j = 0; j < 100; j++) { @@ -181,23 +141,18 @@ test('nested safe loop', () => { } } return sum; - }`, { - output: [1] - }); + }`, + { + output: [1], + } + ); - assert.equal(node.toString(), 'float kernel() {' - + '\nint user_sum=0;' - + '\nfor (int user_i=0;(user_i<100);user_i++){' - + '\nfor (int user_j=0;(user_j<100);user_j++){' - + '\nuser_sum++;}' - + '\n}' - + '\n' - + '\nreturn float(user_sum);' - + '\n}'); + assert.equal(node.toString(), 'float kernel() {' + '\nint user_sum=0;' + '\nfor (int user_i=0;(user_i<100);user_i++){' + '\nfor (int user_j=0;(user_j<100);user_j++){' + '\nuser_sum++;}' + '\n}' + '\n' + '\nreturn float(user_sum);' + '\n}'); }); test('nested unsafe loop', () => { - const node = new WebGLFunctionNode(`function kernel(arg1, arg2) { + const node = new WebGLFunctionNode( + `function kernel(arg1, arg2) { let sum = 0; for (let i = arg1; i < 100; i++) { for (let j = arg2; j < 100; j++) { @@ -205,89 +160,67 @@ test('nested unsafe loop', () => { } } return sum; - }`, { - argumentTypes: ['Number', 'Number'], - output: [1] - }); + }`, + { + argumentTypes: ['Number', 'Number'], + output: [1], + } + ); - assert.equal(node.toString(), 'float kernel(float user_arg1, float user_arg2) {' - + '\nint user_sum=0;' - + '\nfloat user_i=user_arg1;' - + '\nfor (int safeI2=0;safeI2 { - const node = new WebGLFunctionNode(`function kernel() { + const node = new WebGLFunctionNode( + `function kernel() { let sum = 0; for (let i = 0; i < this.output.x; i++) { sum += 1; } return sum; - }`, { - argumentTypes: [], - output: [1] - }); + }`, + { + argumentTypes: [], + output: [1], + } + ); - assert.equal(node.toString(), 'float kernel() {' - + '\nfloat user_sum=0.0;' - + '\nfor (int user_i=0;(user_i<1);user_i++){' - + '\nuser_sum+=1.0;}' - + '\n' - + '\nreturn user_sum;' - + '\n}'); + assert.equal(node.toString(), 'float kernel() {' + '\nfloat user_sum=0.0;' + '\nfor (int user_i=0;(user_i<1);user_i++){' + '\nuser_sum+=1.0;}' + '\n' + '\nreturn user_sum;' + '\n}'); }); test('this.thread.x usage inside loop', () => { - const node = new WebGLFunctionNode(`function kernel() { + const node = new WebGLFunctionNode( + `function kernel() { let sum = 0; for (let i = 0; i < this.thread.x; i++) { sum += 1; } return sum; - }`, { - argumentTypes: [], - output: [1] - }); + }`, + { + argumentTypes: [], + output: [1], + } + ); - assert.equal(node.toString(), 'float kernel() {' - + '\nfloat user_sum=0.0;' - + '\nfor (int user_i=0;(user_i { - const node = new WebGLFunctionNode(`function kernel() { + const node = new WebGLFunctionNode( + `function kernel() { let sum = 0; let x = this.thread.x; for (let i = 0; i < x; i++) { sum += 1; } return sum; - }`, { - argumentTypes: [], - output: [1] - }); + }`, + { + argumentTypes: [], + output: [1], + } + ); - assert.equal(node.toString(), 'float kernel() {' - + '\nfloat user_sum=0.0;' - + '\nfloat user_x=float(threadId.x);' - + '\nfor (int user_i=0;(user_i { - assert.equal(run('const value = it', { - argumentNames: ['it'], - argumentTypes: ['Number'] - }), 'float user_value=user_it;'); + assert.equal( + run('const value = it', { + argumentNames: ['it'], + argumentTypes: ['Number'], + }), + 'float user_value=user_it;' + ); }); test('value int', () => { - assert.equal(run('const value = it', { - argumentNames: ['it'], - argumentTypes: ['Integer'] - }), 'float user_value=float(user_it);'); + assert.equal( + run('const value = it', { + argumentNames: ['it'], + argumentTypes: ['Integer'], + }), + 'float user_value=float(user_it);' + ); }); test('value[] float', () => { - assert.equal(run('const value = it[1]', { - argumentNames: ['it'], - argumentTypes: ['Array'], - lookupFunctionArgumentBitRatio: () => 4, - }), 'float user_value=get32(user_it, user_itSize, user_itDim, 0, 0, 1);'); + assert.equal( + run('const value = it[1]', { + argumentNames: ['it'], + argumentTypes: ['Array'], + lookupFunctionArgumentBitRatio: () => 4, + }), + 'float user_value=get32(user_it, user_itSize, user_itDim, 0, 0, 1);' + ); }); test('value[][] float', () => { - assert.equal(run('const value = it[1][2]', { - argumentNames: ['it'], - argumentTypes: ['Array2D'], - lookupFunctionArgumentBitRatio: () => 4, - }), 'float user_value=get32(user_it, user_itSize, user_itDim, 0, 1, 2);'); + assert.equal( + run('const value = it[1][2]', { + argumentNames: ['it'], + argumentTypes: ['Array2D'], + lookupFunctionArgumentBitRatio: () => 4, + }), + 'float user_value=get32(user_it, user_itSize, user_itDim, 0, 1, 2);' + ); }); test('value[][][] float', () => { - assert.equal(run('const value = it[1][2][3]', { - argumentNames: ['it'], - argumentTypes: ['Array3D'], - lookupFunctionArgumentBitRatio: () => 4, - }), 'float user_value=get32(user_it, user_itSize, user_itDim, 1, 2, 3);'); + assert.equal( + run('const value = it[1][2][3]', { + argumentNames: ['it'], + argumentTypes: ['Array3D'], + lookupFunctionArgumentBitRatio: () => 4, + }), + 'float user_value=get32(user_it, user_itSize, user_itDim, 1, 2, 3);' + ); }); test('Array2 value[] from value[]', () => { - assert.equal(run('const value = [arg1[0], arg2[0]];', { - argumentNames: ['arg1', 'arg2'], - argumentTypes: ['Array', 'Array'], - lookupFunctionArgumentBitRatio: () => 4, - }), 'vec2 user_value=vec2(' - + 'get32(user_arg1, user_arg1Size, user_arg1Dim, 0, 0, 0), ' - + 'get32(user_arg2, user_arg2Size, user_arg2Dim, 0, 0, 0)' - + ');'); + assert.equal( + run('const value = [arg1[0], arg2[0]];', { + argumentNames: ['arg1', 'arg2'], + argumentTypes: ['Array', 'Array'], + lookupFunctionArgumentBitRatio: () => 4, + }), + 'vec2 user_value=vec2(' + 'get32(user_arg1, user_arg1Size, user_arg1Dim, 0, 0, 0), ' + 'get32(user_arg2, user_arg2Size, user_arg2Dim, 0, 0, 0)' + ');' + ); }); test('Array3 value[] from value[]', () => { - assert.equal(run('const value = [arg1[0], arg2[0], arg3[0]];', { - argumentNames: ['arg1', 'arg2', 'arg3'], - argumentTypes: ['Array', 'Array', 'Array'], - lookupFunctionArgumentBitRatio: () => 4, - }), 'vec3 user_value=vec3(' - + 'get32(user_arg1, user_arg1Size, user_arg1Dim, 0, 0, 0), ' - + 'get32(user_arg2, user_arg2Size, user_arg2Dim, 0, 0, 0), ' - + 'get32(user_arg3, user_arg3Size, user_arg3Dim, 0, 0, 0)' - + ');'); + assert.equal( + run('const value = [arg1[0], arg2[0], arg3[0]];', { + argumentNames: ['arg1', 'arg2', 'arg3'], + argumentTypes: ['Array', 'Array', 'Array'], + lookupFunctionArgumentBitRatio: () => 4, + }), + 'vec3 user_value=vec3(' + 'get32(user_arg1, user_arg1Size, user_arg1Dim, 0, 0, 0), ' + 'get32(user_arg2, user_arg2Size, user_arg2Dim, 0, 0, 0), ' + 'get32(user_arg3, user_arg3Size, user_arg3Dim, 0, 0, 0)' + ');' + ); }); test('Array4 value[] from value[]', () => { - assert.equal(run('const value = [arg1[0], arg2[0], arg3[0], arg4[0]];', { - argumentNames: ['arg1', 'arg2', 'arg3', 'arg4'], - argumentTypes: ['Array', 'Array', 'Array', 'Array'], - lookupFunctionArgumentBitRatio: () => 4, - }), 'vec4 user_value=vec4(' - + 'get32(user_arg1, user_arg1Size, user_arg1Dim, 0, 0, 0), ' - + 'get32(user_arg2, user_arg2Size, user_arg2Dim, 0, 0, 0), ' - + 'get32(user_arg3, user_arg3Size, user_arg3Dim, 0, 0, 0), ' - + 'get32(user_arg4, user_arg4Size, user_arg4Dim, 0, 0, 0)' - + ');'); + assert.equal( + run('const value = [arg1[0], arg2[0], arg3[0], arg4[0]];', { + argumentNames: ['arg1', 'arg2', 'arg3', 'arg4'], + argumentTypes: ['Array', 'Array', 'Array', 'Array'], + lookupFunctionArgumentBitRatio: () => 4, + }), + 'vec4 user_value=vec4(' + 'get32(user_arg1, user_arg1Size, user_arg1Dim, 0, 0, 0), ' + 'get32(user_arg2, user_arg2Size, user_arg2Dim, 0, 0, 0), ' + 'get32(user_arg3, user_arg3Size, user_arg3Dim, 0, 0, 0), ' + 'get32(user_arg4, user_arg4Size, user_arg4Dim, 0, 0, 0)' + ');' + ); }); test('float, Array2, Array3 chain values', () => { - assert.equal(run('const value1 = 1, ' - + 'value2 = [arg1[0], arg2[0]], ' - + 'value3 = [arg1[0], arg2[0], arg3[0]], ' - + 'value4 = [arg1[0], arg2[0], arg3[0], arg4[0]];', { - argumentNames: ['arg1', 'arg2', 'arg3', 'arg4'], - argumentTypes: ['Array', 'Array', 'Array', 'Array'], - lookupFunctionArgumentBitRatio: () => 4, - }), 'float user_value1=1.0;' - + 'vec2 user_value2=vec2(' - + 'get32(user_arg1, user_arg1Size, user_arg1Dim, 0, 0, 0), ' - + 'get32(user_arg2, user_arg2Size, user_arg2Dim, 0, 0, 0)' - + ');' - + 'vec3 user_value3=vec3(' - + 'get32(user_arg1, user_arg1Size, user_arg1Dim, 0, 0, 0), ' - + 'get32(user_arg2, user_arg2Size, user_arg2Dim, 0, 0, 0), ' - + 'get32(user_arg3, user_arg3Size, user_arg3Dim, 0, 0, 0)' - + ');' - + 'vec4 user_value4=vec4(' - + 'get32(user_arg1, user_arg1Size, user_arg1Dim, 0, 0, 0), ' - + 'get32(user_arg2, user_arg2Size, user_arg2Dim, 0, 0, 0), ' - + 'get32(user_arg3, user_arg3Size, user_arg3Dim, 0, 0, 0), ' - + 'get32(user_arg4, user_arg4Size, user_arg4Dim, 0, 0, 0)' - + ');'); + assert.equal( + run('const value1 = 1, ' + 'value2 = [arg1[0], arg2[0]], ' + 'value3 = [arg1[0], arg2[0], arg3[0]], ' + 'value4 = [arg1[0], arg2[0], arg3[0], arg4[0]];', { + argumentNames: ['arg1', 'arg2', 'arg3', 'arg4'], + argumentTypes: ['Array', 'Array', 'Array', 'Array'], + lookupFunctionArgumentBitRatio: () => 4, + }), + 'float user_value1=1.0;' + 'vec2 user_value2=vec2(' + 'get32(user_arg1, user_arg1Size, user_arg1Dim, 0, 0, 0), ' + 'get32(user_arg2, user_arg2Size, user_arg2Dim, 0, 0, 0)' + ');' + 'vec3 user_value3=vec3(' + 'get32(user_arg1, user_arg1Size, user_arg1Dim, 0, 0, 0), ' + 'get32(user_arg2, user_arg2Size, user_arg2Dim, 0, 0, 0), ' + 'get32(user_arg3, user_arg3Size, user_arg3Dim, 0, 0, 0)' + ');' + 'vec4 user_value4=vec4(' + 'get32(user_arg1, user_arg1Size, user_arg1Dim, 0, 0, 0), ' + 'get32(user_arg2, user_arg2Size, user_arg2Dim, 0, 0, 0), ' + 'get32(user_arg3, user_arg3Size, user_arg3Dim, 0, 0, 0), ' + 'get32(user_arg4, user_arg4Size, user_arg4Dim, 0, 0, 0)' + ');' + ); }); test('float, Array2, Array3, Array4 multiple values', () => { - assert.equal(run('const value1 = 1, ' - + 'value2 = [arg1[0], arg2[0]], ' - + 'value3 = [arg1[0], arg2[0], arg3[0]], ' - + 'value4 = [arg1[0], arg2[0], arg3[0], arg4[0]];', { - argumentNames: ['arg1', 'arg2', 'arg3', 'arg4'], - argumentTypes: ['Array', 'Array', 'Array', 'Array'], - lookupFunctionArgumentBitRatio: () => 4, - }), 'float user_value1=1.0;' - + 'vec2 user_value2=vec2(' - + 'get32(user_arg1, user_arg1Size, user_arg1Dim, 0, 0, 0), ' - + 'get32(user_arg2, user_arg2Size, user_arg2Dim, 0, 0, 0)' - + ');' - + 'vec3 user_value3=vec3(' - + 'get32(user_arg1, user_arg1Size, user_arg1Dim, 0, 0, 0), ' - + 'get32(user_arg2, user_arg2Size, user_arg2Dim, 0, 0, 0), ' - + 'get32(user_arg3, user_arg3Size, user_arg3Dim, 0, 0, 0)' - + ');' - + 'vec4 user_value4=vec4(' - + 'get32(user_arg1, user_arg1Size, user_arg1Dim, 0, 0, 0), ' - + 'get32(user_arg2, user_arg2Size, user_arg2Dim, 0, 0, 0), ' - + 'get32(user_arg3, user_arg3Size, user_arg3Dim, 0, 0, 0), ' - + 'get32(user_arg4, user_arg4Size, user_arg4Dim, 0, 0, 0)' - + ');'); + assert.equal( + run('const value1 = 1, ' + 'value2 = [arg1[0], arg2[0]], ' + 'value3 = [arg1[0], arg2[0], arg3[0]], ' + 'value4 = [arg1[0], arg2[0], arg3[0], arg4[0]];', { + argumentNames: ['arg1', 'arg2', 'arg3', 'arg4'], + argumentTypes: ['Array', 'Array', 'Array', 'Array'], + lookupFunctionArgumentBitRatio: () => 4, + }), + 'float user_value1=1.0;' + 'vec2 user_value2=vec2(' + 'get32(user_arg1, user_arg1Size, user_arg1Dim, 0, 0, 0), ' + 'get32(user_arg2, user_arg2Size, user_arg2Dim, 0, 0, 0)' + ');' + 'vec3 user_value3=vec3(' + 'get32(user_arg1, user_arg1Size, user_arg1Dim, 0, 0, 0), ' + 'get32(user_arg2, user_arg2Size, user_arg2Dim, 0, 0, 0), ' + 'get32(user_arg3, user_arg3Size, user_arg3Dim, 0, 0, 0)' + ');' + 'vec4 user_value4=vec4(' + 'get32(user_arg1, user_arg1Size, user_arg1Dim, 0, 0, 0), ' + 'get32(user_arg2, user_arg2Size, user_arg2Dim, 0, 0, 0), ' + 'get32(user_arg3, user_arg3Size, user_arg3Dim, 0, 0, 0), ' + 'get32(user_arg4, user_arg4Size, user_arg4Dim, 0, 0, 0)' + ');' + ); }); test('float, float, Array4, Array4, Array4 chain values', () => { - assert.equal(run('const value1 = 1, value2 = 1.5, ' - + 'value3 = [arg1[0], arg2[0], arg3[0], arg4[0]], ' - + 'value4 = [arg4[4], arg3[4], arg2[4], arg1[4]], ' - + 'value5 = [arg2[1], arg2[2], arg2[3], arg2[4]];', { - argumentNames: ['arg1', 'arg2', 'arg3', 'arg4'], - argumentTypes: ['Array', 'Array', 'Array', 'Array'], - lookupFunctionArgumentBitRatio: () => 4, - }), 'float user_value1=1.0,user_value2=1.5;' - + 'vec4 user_value3=vec4(' - + 'get32(user_arg1, user_arg1Size, user_arg1Dim, 0, 0, 0), ' - + 'get32(user_arg2, user_arg2Size, user_arg2Dim, 0, 0, 0), ' - + 'get32(user_arg3, user_arg3Size, user_arg3Dim, 0, 0, 0), ' - + 'get32(user_arg4, user_arg4Size, user_arg4Dim, 0, 0, 0)' - + '),' - + 'user_value4=vec4(' - + 'get32(user_arg4, user_arg4Size, user_arg4Dim, 0, 0, 4), ' - + 'get32(user_arg3, user_arg3Size, user_arg3Dim, 0, 0, 4), ' - + 'get32(user_arg2, user_arg2Size, user_arg2Dim, 0, 0, 4), ' - + 'get32(user_arg1, user_arg1Size, user_arg1Dim, 0, 0, 4)' - + '),' - + 'user_value5=vec4(' - + 'get32(user_arg2, user_arg2Size, user_arg2Dim, 0, 0, 1), ' - + 'get32(user_arg2, user_arg2Size, user_arg2Dim, 0, 0, 2), ' - + 'get32(user_arg2, user_arg2Size, user_arg2Dim, 0, 0, 3), ' - + 'get32(user_arg2, user_arg2Size, user_arg2Dim, 0, 0, 4)' - + ');'); + assert.equal( + run('const value1 = 1, value2 = 1.5, ' + 'value3 = [arg1[0], arg2[0], arg3[0], arg4[0]], ' + 'value4 = [arg4[4], arg3[4], arg2[4], arg1[4]], ' + 'value5 = [arg2[1], arg2[2], arg2[3], arg2[4]];', { + argumentNames: ['arg1', 'arg2', 'arg3', 'arg4'], + argumentTypes: ['Array', 'Array', 'Array', 'Array'], + lookupFunctionArgumentBitRatio: () => 4, + }), + 'float user_value1=1.0,user_value2=1.5;' + 'vec4 user_value3=vec4(' + 'get32(user_arg1, user_arg1Size, user_arg1Dim, 0, 0, 0), ' + 'get32(user_arg2, user_arg2Size, user_arg2Dim, 0, 0, 0), ' + 'get32(user_arg3, user_arg3Size, user_arg3Dim, 0, 0, 0), ' + 'get32(user_arg4, user_arg4Size, user_arg4Dim, 0, 0, 0)' + '),' + 'user_value4=vec4(' + 'get32(user_arg4, user_arg4Size, user_arg4Dim, 0, 0, 4), ' + 'get32(user_arg3, user_arg3Size, user_arg3Dim, 0, 0, 4), ' + 'get32(user_arg2, user_arg2Size, user_arg2Dim, 0, 0, 4), ' + 'get32(user_arg1, user_arg1Size, user_arg1Dim, 0, 0, 4)' + '),' + 'user_value5=vec4(' + 'get32(user_arg2, user_arg2Size, user_arg2Dim, 0, 0, 1), ' + 'get32(user_arg2, user_arg2Size, user_arg2Dim, 0, 0, 2), ' + 'get32(user_arg2, user_arg2Size, user_arg2Dim, 0, 0, 3), ' + 'get32(user_arg2, user_arg2Size, user_arg2Dim, 0, 0, 4)' + ');' + ); }); test('float literal, float literal, multiple values', () => { - assert.equal(run('const value1 = 0, ' - + 'value2 = 0;', { - argumentNames: [], - argumentTypes: [] - }), 'float user_value1=0.0,user_value2=0.0;'); + assert.equal( + run('const value1 = 0, ' + 'value2 = 0;', { + argumentNames: [], + argumentTypes: [], + }), + 'float user_value1=0.0,user_value2=0.0;' + ); }); test('float literal, float literal, multiple values', () => { - assert.equal(run('const value1 = 0, ' - + 'value2 = 0;', { - argumentNames: [], - argumentTypes: [] - }), 'float user_value1=0.0,user_value2=0.0;'); + assert.equal( + run('const value1 = 0, ' + 'value2 = 0;', { + argumentNames: [], + argumentTypes: [], + }), + 'float user_value1=0.0,user_value2=0.0;' + ); }); test('this.constant.value throws', () => { @@ -195,49 +166,64 @@ test('this.constant.value throws', () => { test('this.constants.value without constantTypes declared', () => { assert.throws(() => { - run('const value=this.constants.it') + run('const value=this.constants.it'); }); }); test('this.constants.value float', () => { - assert.equal(run('const value = this.constants.it', { - constantTypes: { it: 'Number' } - }), 'float user_value=constants_it;'); + assert.equal( + run('const value = this.constants.it', { + constantTypes: { it: 'Number' }, + }), + 'float user_value=constants_it;' + ); }); test('this.constants.value int', () => { - assert.equal(run('const value = this.constants.it', { - constantTypes: { - it: 'Integer' - } - }), 'float user_value=float(constants_it);'); + assert.equal( + run('const value = this.constants.it', { + constantTypes: { + it: 'Integer', + }, + }), + 'float user_value=float(constants_it);' + ); }); test('this.constants.value[] float', () => { - assert.equal(run('const value = this.constants.it[1]', { - constantTypes: { - it: 'Array' - }, - constantBitRatios: { it: 4 }, - }), 'float user_value=get32(constants_it, constants_itSize, constants_itDim, 0, 0, 1);'); + assert.equal( + run('const value = this.constants.it[1]', { + constantTypes: { + it: 'Array', + }, + constantBitRatios: { it: 4 }, + }), + 'float user_value=get32(constants_it, constants_itSize, constants_itDim, 0, 0, 1);' + ); }); test('this.constants.value[][] float', () => { - assert.equal(run('const value = this.constants.it[1][2]', { - constantTypes: { - it: 'Array2D' - }, - constantBitRatios: { it: 4 }, - }), 'float user_value=get32(constants_it, constants_itSize, constants_itDim, 0, 1, 2);'); + assert.equal( + run('const value = this.constants.it[1][2]', { + constantTypes: { + it: 'Array2D', + }, + constantBitRatios: { it: 4 }, + }), + 'float user_value=get32(constants_it, constants_itSize, constants_itDim, 0, 1, 2);' + ); }); test('this.constants.value[][][] float', () => { - assert.equal(run('const value = this.constants.it[1][2][3]', { - constantTypes: { - it: 'Array3D' - }, - constantBitRatios: { it: 4 }, - }), 'float user_value=get32(constants_it, constants_itSize, constants_itDim, 1, 2, 3);'); + assert.equal( + run('const value = this.constants.it[1][2][3]', { + constantTypes: { + it: 'Array3D', + }, + constantBitRatios: { it: 4 }, + }), + 'float user_value=get32(constants_it, constants_itSize, constants_itDim, 1, 2, 3);' + ); }); test('this.thread.x float', () => { diff --git a/test/internal/backend/web-gl/function-node/contexts.js b/test/internal/backend/web-gl/function-node/contexts.js index 89699dea..02bc8bde 100644 --- a/test/internal/backend/web-gl/function-node/contexts.js +++ b/test/internal/backend/web-gl/function-node/contexts.js @@ -4,7 +4,8 @@ const { WebGLFunctionNode } = require(process.cwd() + '/src'); describe('WebGLFunctionNode.contexts'); test('safe from literal 1', () => { - const node = new WebGLFunctionNode(`function kernel() { + const node = new WebGLFunctionNode( + `function kernel() { const const1 = 1; const const2 = const1 + 2; const const3 = const2 + 3; @@ -12,7 +13,9 @@ test('safe from literal 1', () => { for (let i = 0; i < const3; i++) { sum += const3; } - }`, { output: [1] }); + }`, + { output: [1] } + ); node.toString(); const { const1, const2, const3 } = node.contexts[1]; @@ -22,37 +25,39 @@ test('safe from literal 1', () => { origin: 'literal', value: 1, isSafe: true, - } + }, ]); assert.equal(const2.isSafe, true); assert.deepEqual(const2.dependencies, [ { name: 'const1', origin: 'declaration', - isSafe: true - },{ + isSafe: true, + }, + { origin: 'literal', value: 2, isSafe: true, - } + }, ]); assert.equal(const3.isSafe, true); assert.deepEqual(const3.dependencies, [ { name: 'const2', origin: 'declaration', - isSafe: true - },{ + isSafe: true, + }, + { origin: 'literal', value: 3, isSafe: true, - } + }, ]); }); - test('safe from argument', () => { - const node = new WebGLFunctionNode(`function kernel(arg1) { + const node = new WebGLFunctionNode( + `function kernel(arg1) { const const1 = arg1 + 3; const const2 = const1 + 2; const const3 = const2 + 1; @@ -60,7 +65,9 @@ test('safe from argument', () => { for (let i = 0; i < const3; i++) { sum += const3; } - }`, { output: [1], argumentTypes: ['Number'] }); + }`, + { output: [1], argumentTypes: ['Number'] } + ); node.toString(); const { const1, const2, const3 } = node.contexts[1]; @@ -69,42 +76,45 @@ test('safe from argument', () => { { name: 'arg1', origin: 'argument', - isSafe: false - },{ + isSafe: false, + }, + { origin: 'literal', value: 3, isSafe: true, - } + }, ]); assert.equal(const2.isSafe, false); assert.deepEqual(const2.dependencies, [ { name: 'const1', origin: 'declaration', - isSafe: false - },{ + isSafe: false, + }, + { origin: 'literal', value: 2, isSafe: true, - } + }, ]); assert.equal(const3.isSafe, false); assert.deepEqual(const3.dependencies, [ { name: 'const2', origin: 'declaration', - isSafe: false - },{ + isSafe: false, + }, + { origin: 'literal', value: 1, isSafe: true, - } + }, ]); }); - test('safe from multiplication', () => { - const node = new WebGLFunctionNode(`function kernel() { + const node = new WebGLFunctionNode( + `function kernel() { const const1 = 555; const const2 = const1 + .555; const const3 = const2 * .1; @@ -112,7 +122,9 @@ test('safe from multiplication', () => { for (let i = 0; i < const3; i++) { sum += const3; } - }`, { output: [1] }); + }`, + { output: [1] } + ); node.toString(); const { const1, const2, const3 } = node.contexts[1]; @@ -121,35 +133,37 @@ test('safe from multiplication', () => { origin: 'literal', value: 555, isSafe: true, - } + }, ]); assert.deepEqual(const2.dependencies, [ { name: 'const1', origin: 'declaration', isSafe: true, - },{ + }, + { origin: 'literal', - value: .555, + value: 0.555, isSafe: true, - } + }, ]); assert.deepEqual(const3.dependencies, [ { name: 'const2', origin: 'declaration', isSafe: false, - },{ + }, + { origin: 'literal', - value: .1, + value: 0.1, isSafe: false, - } + }, ]); }); - test('safe from multiplication deep', () => { - const node = new WebGLFunctionNode(`function kernel() { + const node = new WebGLFunctionNode( + `function kernel() { const const1 = 555 * 1; const const2 = const1 + .555; const const3 = .1 - const2; @@ -164,7 +178,9 @@ test('safe from multiplication deep', () => { for (let i = 0; i < const3; i++) { sum += const3; } - }`, { output: [1] }); + }`, + { output: [1] } + ); node.toString(); const { const1, const10 } = node.contexts[1]; @@ -174,17 +190,18 @@ test('safe from multiplication deep', () => { name: 'const9', origin: 'declaration', isSafe: false, - },{ + }, + { origin: 'literal', value: 10, isSafe: true, - } + }, ]); }); - test('safe from division', () => { - const node = new WebGLFunctionNode(`function kernel() { + const node = new WebGLFunctionNode( + `function kernel() { const const1 = 555; const const2 = const1 + .555; const const3 = const2 / .1; @@ -192,7 +209,9 @@ test('safe from division', () => { for (let i = 0; i < const3; i++) { sum += const3; } - }`, { output: [1] }); + }`, + { output: [1] } + ); node.toString(); const { const1, const2, const3 } = node.contexts[1]; @@ -201,35 +220,37 @@ test('safe from division', () => { origin: 'literal', value: 555, isSafe: true, - } + }, ]); assert.deepEqual(const2.dependencies, [ { name: 'const1', origin: 'declaration', isSafe: true, - },{ + }, + { origin: 'literal', - value: .555, + value: 0.555, isSafe: true, - } + }, ]); assert.deepEqual(const3.dependencies, [ { name: 'const2', origin: 'declaration', isSafe: false, - },{ + }, + { origin: 'literal', - value: .1, + value: 0.1, isSafe: false, - } + }, ]); }); - test('safe from division deep', () => { - const node = new WebGLFunctionNode(`function kernel() { + const node = new WebGLFunctionNode( + `function kernel() { const const1 = 555 / 1; const const2 = const1 + .555; const const3 = .1 - const2; @@ -244,7 +265,9 @@ test('safe from division deep', () => { for (let i = 0; i < const3; i++) { sum += const3; } - }`, { output: [1] }); + }`, + { output: [1] } + ); node.toString(); const { const1, const10 } = node.contexts[1]; @@ -254,10 +277,11 @@ test('safe from division deep', () => { name: 'const9', origin: 'declaration', isSafe: false, - },{ + }, + { origin: 'literal', value: 10, isSafe: true, - } + }, ]); }); diff --git a/test/internal/backend/web-gl/function-node/firstAvailableTypeFromAst.js b/test/internal/backend/web-gl/function-node/firstAvailableTypeFromAst.js index 9431062d..09a0a131 100644 --- a/test/internal/backend/web-gl/function-node/firstAvailableTypeFromAst.js +++ b/test/internal/backend/web-gl/function-node/firstAvailableTypeFromAst.js @@ -4,9 +4,12 @@ const { WebGLFunctionNode } = require(process.cwd() + '/src'); describe('WebGLFunctionNode.getType()'); function run(value, settings) { - const node = new WebGLFunctionNode(`function fn(value, value2, value3) { - ${ value }; - }`, Object.assign({ output: [1] }, settings)); + const node = new WebGLFunctionNode( + `function fn(value, value2, value3) { + ${value}; + }`, + Object.assign({ output: [1] }, settings) + ); const ast = node.getJsAST(); node.traceFunctionAST(ast); @@ -32,59 +35,83 @@ test('unknown value from arguments', () => { }); test('value Number from arguments', () => { - assert.equal(run('value', { - argumentNames: ['value'], - argumentTypes: ['Fake Type'] - }), 'Fake Type'); + assert.equal( + run('value', { + argumentNames: ['value'], + argumentTypes: ['Fake Type'], + }), + 'Fake Type' + ); }); test('value[] Number from arguments', () => { - assert.equal(run('value[0]', { - argumentNames: ['value'], - argumentTypes: ['Array'] - }), 'Number'); + assert.equal( + run('value[0]', { + argumentNames: ['value'], + argumentTypes: ['Array'], + }), + 'Number' + ); }); test('value[][] Number from arguments', () => { - assert.equal(run('value[0][0]', { - argumentNames: ['value'], - argumentTypes: ['Array'] - }), 'Number'); + assert.equal( + run('value[0][0]', { + argumentNames: ['value'], + argumentTypes: ['Array'], + }), + 'Number' + ); }); test('value[][][] Number from arguments', () => { - assert.equal(run('value[0][0][0]', { - argumentNames: ['value'], - argumentTypes: ['Array'] - }), 'Number'); + assert.equal( + run('value[0][0][0]', { + argumentNames: ['value'], + argumentTypes: ['Array'], + }), + 'Number' + ); }); test('this.constants.value Integer', () => { - assert.equal(run('this.constants.value', { - constants: { value: 1 }, - constantTypes: { value: 'Integer' } - }), 'Integer'); + assert.equal( + run('this.constants.value', { + constants: { value: 1 }, + constantTypes: { value: 'Integer' }, + }), + 'Integer' + ); }); test('this.constants.value[] Number', () => { - assert.equal(run('this.constants.value[0]', { - constants: { value: [1] }, - constantTypes: { value: 'Array' } - }), 'Number'); + assert.equal( + run('this.constants.value[0]', { + constants: { value: [1] }, + constantTypes: { value: 'Array' }, + }), + 'Number' + ); }); test('this.constants.value[][] Number', () => { - assert.equal(run('this.constants.value[0][0]', { - constants: { value: [[1]] }, - constantTypes: { value: 'Array' } - }), 'Number'); + assert.equal( + run('this.constants.value[0][0]', { + constants: { value: [[1]] }, + constantTypes: { value: 'Array' }, + }), + 'Number' + ); }); test('this.constants.value[][][] Number', () => { - assert.equal(run('this.constants.value[0][0][0]', { - constants: { value: [[[1]]] }, - constantTypes: { value: 'Array' } - }), 'Number'); + assert.equal( + run('this.constants.value[0][0][0]', { + constants: { value: [[[1]]] }, + constantTypes: { value: 'Array' }, + }), + 'Number' + ); }); test('this.thread.x', () => { @@ -130,9 +157,12 @@ test('unknown function call', () => { }); test('function call', () => { - assert.equal(run('value()', { - lookupReturnType: (name, ast, node) => name === 'value' ? 'Fake Type' : null, - }), 'Fake Type'); + assert.equal( + run('value()', { + lookupReturnType: (name, ast, node) => (name === 'value' ? 'Fake Type' : null), + }), + 'Fake Type' + ); }); test('simple unknown expression', () => { @@ -142,23 +172,32 @@ test('simple unknown expression', () => { }); test('simple expression', () => { - assert.equal(run('value + otherValue', { - argumentNames: ['value'], - argumentTypes: ['Number'] - }), 'Number'); + assert.equal( + run('value + otherValue', { + argumentNames: ['value'], + argumentTypes: ['Number'], + }), + 'Number' + ); }); test('simple right expression', () => { - assert.equal(run('value + value2', { - argumentNames: ['value', 'value2'], - argumentTypes: ['Number', 'Number'] - }), 'Number'); + assert.equal( + run('value + value2', { + argumentNames: ['value', 'value2'], + argumentTypes: ['Number', 'Number'], + }), + 'Number' + ); }); test('function call expression', () => { - assert.equal(run('otherFunction() + value', { - lookupReturnType: (name, ast, node) => name === 'otherFunction' ? 'Fake Type' : null, - }), 'Fake Type'); + assert.equal( + run('otherFunction() + value', { + lookupReturnType: (name, ast, node) => (name === 'otherFunction' ? 'Fake Type' : null), + }), + 'Fake Type' + ); }); test('Math.E', () => { @@ -206,7 +245,12 @@ test('Math.atan(value)', () => { }); test('Math.atan2(value, value2)', () => { - assert.equal(run('Math.atan2(value, value2)', { argumentTypes: ['Number', 'Number', 'Number'] }), 'Number'); + assert.equal( + run('Math.atan2(value, value2)', { + argumentTypes: ['Number', 'Number', 'Number'], + }), + 'Number' + ); }); test('Math.ceil(value)', () => { @@ -222,7 +266,12 @@ test('Math.exp(value)', () => { }); test('Math.floor(value)', () => { - assert.equal(run('Math.floor(value)', { argumentTypes: ['Number', 'Number', 'Number'] }), 'Number'); + assert.equal( + run('Math.floor(value)', { + argumentTypes: ['Number', 'Number', 'Number'], + }), + 'Number' + ); }); test('Math.log(value)', () => { @@ -230,15 +279,30 @@ test('Math.log(value)', () => { }); test('Math.max(value, value2, value3)', () => { - assert.equal(run('Math.max(value, value2, value3)', { argumentTypes: ['Number', 'Number', 'Number'] }), 'Number'); + assert.equal( + run('Math.max(value, value2, value3)', { + argumentTypes: ['Number', 'Number', 'Number'], + }), + 'Number' + ); }); test('Math.min(value, value2, value3)', () => { - assert.equal(run('Math.min(value, value2, value3)', { argumentTypes: ['Number', 'Number', 'Number'] }), 'Number'); + assert.equal( + run('Math.min(value, value2, value3)', { + argumentTypes: ['Number', 'Number', 'Number'], + }), + 'Number' + ); }); test('Math.pow(value, value2)', () => { - assert.equal(run('Math.pow(value, value2)', { argumentTypes: ['Number', 'Number', 'Number'] }), 'Number'); + assert.equal( + run('Math.pow(value, value2)', { + argumentTypes: ['Number', 'Number', 'Number'], + }), + 'Number' + ); }); test('Math.random()', () => { @@ -246,7 +310,12 @@ test('Math.random()', () => { }); test('Math.round(value)', () => { - assert.equal(run('Math.random(value)', { argumentTypes: ['Number', 'Number', 'Number'] }), 'Number'); + assert.equal( + run('Math.random(value)', { + argumentTypes: ['Number', 'Number', 'Number'], + }), + 'Number' + ); }); test('Math.sin(value)', () => { diff --git a/test/internal/backend/web-gl/function-node/getVariableSignature.js b/test/internal/backend/web-gl/function-node/getVariableSignature.js index a1fb5bfd..8aac9bbb 100644 --- a/test/internal/backend/web-gl/function-node/getVariableSignature.js +++ b/test/internal/backend/web-gl/function-node/getVariableSignature.js @@ -6,13 +6,16 @@ describe('WebGLFunctionNode.getVariableSignature()'); function run(value) { const mockInstance = { source: `function() { ${value}; }`, - traceFunctionAST: () => {} + traceFunctionAST: () => {}, }; const ast = WebGLFunctionNode.prototype.getJsAST.call(mockInstance); const expression = ast.body.body[0].expression; - return WebGLFunctionNode.prototype.getVariableSignature.call({ - isAstVariable: WebGLFunctionNode.prototype.isAstVariable - }, expression); + return WebGLFunctionNode.prototype.getVariableSignature.call( + { + isAstVariable: WebGLFunctionNode.prototype.isAstVariable, + }, + expression + ); } test('value', () => { @@ -107,7 +110,8 @@ test('this.constants.value[][][][]', () => { assert.equal(run('this.constants.value[0][0][0].something'), null); }); test('complex nested this.constants.value[][][]', () => { - assert.equal(run(` + assert.equal( + run(` this.constants.value[ this.constants.value[i + 1] ] @@ -117,10 +121,13 @@ test('complex nested this.constants.value[][][]', () => { [ this.thread.x - 100 ] -`), 'this.constants.value[][][]'); +`), + 'this.constants.value[][][]' + ); }); test('complex nested with function call this.constants.value[][][]', () => { - assert.equal(run(` + assert.equal( + run(` this.constants.value[ something() ] @@ -130,7 +137,9 @@ test('complex nested with function call this.constants.value[][][]', () => { [ this.thread.x - 100 ] -`), 'this.constants.value[][][]') +`), + 'this.constants.value[][][]' + ); }); test('non-existent something', () => { assert.equal(run('this.constants.value[0][0].something'), null); diff --git a/test/internal/backend/web-gl/function-node/getVariableType.js b/test/internal/backend/web-gl/function-node/getVariableType.js index f8944092..61c1b1ba 100644 --- a/test/internal/backend/web-gl/function-node/getVariableType.js +++ b/test/internal/backend/web-gl/function-node/getVariableType.js @@ -7,148 +7,154 @@ test('Native function > detects same native argument type float, and no cast', ( const nativeFunction = `float nativeFunction(float value) { return value + 1.0; }`; const returnType = GLKernel.nativeFunctionReturnType(nativeFunction); const { argumentTypes } = GLKernel.nativeFunctionArguments(nativeFunction); - const node = new WebGLFunctionNode(`function kernel(value) { + const node = new WebGLFunctionNode( + `function kernel(value) { return nativeFunction(value); - }`, { - output: [1], - argumentTypes: ['Number'], - lookupReturnType: (name, ast, node) => { - if (name === 'nativeFunction') return returnType; - throw new Error('unknown function'); - }, - lookupFunctionArgumentTypes: (functionName) => { - if (functionName === 'nativeFunction') return argumentTypes; - throw new Error('unknown function'); - }, - needsArgumentType: () => false - }); + }`, + { + output: [1], + argumentTypes: ['Number'], + lookupReturnType: (name, ast, node) => { + if (name === 'nativeFunction') return returnType; + throw new Error('unknown function'); + }, + lookupFunctionArgumentTypes: functionName => { + if (functionName === 'nativeFunction') return argumentTypes; + throw new Error('unknown function'); + }, + needsArgumentType: () => false, + } + ); - assert.equal(node.toString(), 'float kernel(float user_value) {' - + '\nreturn nativeFunction(user_value);' - + '\n}'); + assert.equal(node.toString(), 'float kernel(float user_value) {' + '\nreturn nativeFunction(user_value);' + '\n}'); }); test('Native function > detects same native argument type int, and no cast', () => { const nativeFunction = `float nativeFunction(int value) { return float(value + 1); }`; const returnType = GLKernel.nativeFunctionReturnType(nativeFunction); const { argumentTypes } = GLKernel.nativeFunctionArguments(nativeFunction); - const node = new WebGLFunctionNode(`function kernel(value) { + const node = new WebGLFunctionNode( + `function kernel(value) { return nativeFunction(value); - }`, { - output: [1], - argumentTypes: ['Integer'], - lookupReturnType: (name, ast, node) => { - if (name === 'nativeFunction') return returnType; - throw new Error('unknown function'); - }, - lookupFunctionArgumentTypes: (functionName) => { - if (functionName === 'nativeFunction') return argumentTypes; - throw new Error('unknown function'); - }, - needsArgumentType: () => false - }); + }`, + { + output: [1], + argumentTypes: ['Integer'], + lookupReturnType: (name, ast, node) => { + if (name === 'nativeFunction') return returnType; + throw new Error('unknown function'); + }, + lookupFunctionArgumentTypes: functionName => { + if (functionName === 'nativeFunction') return argumentTypes; + throw new Error('unknown function'); + }, + needsArgumentType: () => false, + } + ); - assert.equal(node.toString(), 'float kernel(int user_value) {' - + '\nreturn nativeFunction(user_value);' - + '\n}'); + assert.equal(node.toString(), 'float kernel(int user_value) {' + '\nreturn nativeFunction(user_value);' + '\n}'); }); test('Native function > detects different native argument type int from literal, and cast to it from float', () => { const nativeFunction = `float nativeFunction(int value) { return float(value + 1); }`; const returnType = GLKernel.nativeFunctionReturnType(nativeFunction); const { argumentTypes } = GLKernel.nativeFunctionArguments(nativeFunction); - const node = new WebGLFunctionNode(`function kernel(value) { + const node = new WebGLFunctionNode( + `function kernel(value) { return nativeFunction(1.5); - }`, { - output: [1], - argumentTypes: ['Number'], - lookupReturnType: (name, ast, node) => { - if (name === 'nativeFunction') return returnType; - throw new Error('unknown function'); - }, - lookupFunctionArgumentTypes: (functionName) => { - if (functionName === 'nativeFunction') return argumentTypes; - throw new Error('unknown function'); - }, - needsArgumentType: () => false - }); + }`, + { + output: [1], + argumentTypes: ['Number'], + lookupReturnType: (name, ast, node) => { + if (name === 'nativeFunction') return returnType; + throw new Error('unknown function'); + }, + lookupFunctionArgumentTypes: functionName => { + if (functionName === 'nativeFunction') return argumentTypes; + throw new Error('unknown function'); + }, + needsArgumentType: () => false, + } + ); - assert.equal(node.toString(), 'float kernel(float user_value) {' - + '\nreturn nativeFunction(int(1.5));' - + '\n}'); + assert.equal(node.toString(), 'float kernel(float user_value) {' + '\nreturn nativeFunction(int(1.5));' + '\n}'); }); test('Native function > detects different native argument type float from literal, and cast to it from int', () => { const nativeFunction = `float nativeFunction(int value) { return float(value + 1); }`; const returnType = GLKernel.nativeFunctionReturnType(nativeFunction); const { argumentTypes } = GLKernel.nativeFunctionArguments(nativeFunction); - const node = new WebGLFunctionNode(`function kernel(value) { + const node = new WebGLFunctionNode( + `function kernel(value) { return nativeFunction(1); - }`, { - output: [1], - argumentTypes: ['Number'], - lookupReturnType: (name, ast, node) => { - if (name === 'nativeFunction') return returnType; - throw new Error('unknown function'); - }, - lookupFunctionArgumentTypes: (functionName) => { - if (functionName === 'nativeFunction') return argumentTypes; - throw new Error('unknown function'); - }, - needsArgumentType: () => false - }); + }`, + { + output: [1], + argumentTypes: ['Number'], + lookupReturnType: (name, ast, node) => { + if (name === 'nativeFunction') return returnType; + throw new Error('unknown function'); + }, + lookupFunctionArgumentTypes: functionName => { + if (functionName === 'nativeFunction') return argumentTypes; + throw new Error('unknown function'); + }, + needsArgumentType: () => false, + } + ); - assert.equal(node.toString(), 'float kernel(float user_value) {' - + '\nreturn nativeFunction(1);' - + '\n}'); + assert.equal(node.toString(), 'float kernel(float user_value) {' + '\nreturn nativeFunction(1);' + '\n}'); }); test('Native function > detects different native argument type int, and cast to it from float', () => { const nativeFunction = `float nativeFunction(int value) { return float(value + 1); }`; const returnType = GLKernel.nativeFunctionReturnType(nativeFunction); const { argumentTypes } = GLKernel.nativeFunctionArguments(nativeFunction); - const node = new WebGLFunctionNode(`function kernel(value) { + const node = new WebGLFunctionNode( + `function kernel(value) { return nativeFunction(value); - }`, { - output: [1], - argumentTypes: ['Number'], - lookupReturnType: (name, ast, node) => { - if (name === 'nativeFunction') return returnType; - throw new Error('unknown function'); - }, - lookupFunctionArgumentTypes: (functionName) => { - if (functionName === 'nativeFunction') return argumentTypes; - throw new Error('unknown function'); - }, - needsArgumentType: () => false - }); + }`, + { + output: [1], + argumentTypes: ['Number'], + lookupReturnType: (name, ast, node) => { + if (name === 'nativeFunction') return returnType; + throw new Error('unknown function'); + }, + lookupFunctionArgumentTypes: functionName => { + if (functionName === 'nativeFunction') return argumentTypes; + throw new Error('unknown function'); + }, + needsArgumentType: () => false, + } + ); - assert.equal(node.toString(), 'float kernel(float user_value) {' - + '\nreturn nativeFunction(int(user_value));' - + '\n}'); + assert.equal(node.toString(), 'float kernel(float user_value) {' + '\nreturn nativeFunction(int(user_value));' + '\n}'); }); test('Native function > detects different native argument type float, and cast to it from int', () => { const nativeFunction = `float nativeFunction(float value) { return value + 1.0; }`; const returnType = GLKernel.nativeFunctionReturnType(nativeFunction); const { argumentTypes } = GLKernel.nativeFunctionArguments(nativeFunction); - const node = new WebGLFunctionNode(`function kernel(value) { + const node = new WebGLFunctionNode( + `function kernel(value) { return nativeFunction(value); - }`, { - output: [1], - argumentTypes: ['Integer'], - lookupReturnType: (name, ast, node) => { - if (name === 'nativeFunction') return returnType; - throw new Error('unknown function'); - }, - lookupFunctionArgumentTypes: (functionName) => { - if (functionName === 'nativeFunction') return argumentTypes; - throw new Error('unknown function'); - }, - needsArgumentType: () => false - }); + }`, + { + output: [1], + argumentTypes: ['Integer'], + lookupReturnType: (name, ast, node) => { + if (name === 'nativeFunction') return returnType; + throw new Error('unknown function'); + }, + lookupFunctionArgumentTypes: functionName => { + if (functionName === 'nativeFunction') return argumentTypes; + throw new Error('unknown function'); + }, + needsArgumentType: () => false, + } + ); - assert.equal(node.toString(), 'float kernel(int user_value) {' - + '\nreturn nativeFunction(float(user_value));' - + '\n}'); + assert.equal(node.toString(), 'float kernel(int user_value) {' + '\nreturn nativeFunction(float(user_value));' + '\n}'); }); diff --git a/test/internal/backend/web-gl/kernel-value/dynamic-html-image.js b/test/internal/backend/web-gl/kernel-value/dynamic-html-image.js index 6b38603b..1d017f55 100644 --- a/test/internal/backend/web-gl/kernel-value/dynamic-html-image.js +++ b/test/internal/backend/web-gl/kernel-value/dynamic-html-image.js @@ -10,16 +10,19 @@ test('.updateValue() checks too large height', () => { }, validate: true, }; - const v = new webGLKernelValueMaps.unsigned.dynamic.HTMLImage({ width: 1, height: 1 }, { - kernel: mockKernel, - name: 'test', - type: 'HTMLImage', - origin: 'user', - tactic: 'speed', - onRequestContextHandle: () => 1, - onRequestTexture: () => null, - onRequestIndex: () => 1 - }); + const v = new webGLKernelValueMaps.unsigned.dynamic.HTMLImage( + { width: 1, height: 1 }, + { + kernel: mockKernel, + name: 'test', + type: 'HTMLImage', + origin: 'user', + tactic: 'speed', + onRequestContextHandle: () => 1, + onRequestTexture: () => null, + onRequestIndex: () => 1, + } + ); assert.throws(() => { v.updateValue({ width: 1, height: 2 }); @@ -34,21 +37,24 @@ test('.updateValue() checks too large width', () => { validate: true, }; - const v = new webGLKernelValueMaps.unsigned.dynamic.HTMLImage({ width: 1, height: 1 }, { - kernel: mockKernel, - name: 'test', - type: 'HTMLImage', - origin: 'user', - tactic: 'speed', - onRequestContextHandle: () => 1, - onRequestTexture: () => null, - onRequestIndex: () => 1 - }); + const v = new webGLKernelValueMaps.unsigned.dynamic.HTMLImage( + { width: 1, height: 1 }, + { + kernel: mockKernel, + name: 'test', + type: 'HTMLImage', + origin: 'user', + tactic: 'speed', + onRequestContextHandle: () => 1, + onRequestTexture: () => null, + onRequestIndex: () => 1, + } + ); assert.throws(() => { v.updateValue({ height: 1, width: 2, - }) + }); }, new Error('Argument texture width of 2 larger than maximum size of 1 for your GPU')); }); @@ -69,17 +75,20 @@ test('.updateValue() checks ok height & width', () => { pixelStorei: () => {}, texImage2D: () => {}, }; - const v = new webGLKernelValueMaps.unsigned.dynamic.HTMLImage({ width: 2, height: 2 }, { - kernel: mockKernel, - name: 'test', - type: 'HTMLImage', - origin: 'user', - tactic: 'speed', - context: mockContext, - onRequestContextHandle: () => 1, - onRequestTexture: () => null, - onRequestIndex: () => 1 - }); + const v = new webGLKernelValueMaps.unsigned.dynamic.HTMLImage( + { width: 2, height: 2 }, + { + kernel: mockKernel, + name: 'test', + type: 'HTMLImage', + origin: 'user', + tactic: 'speed', + context: mockContext, + onRequestContextHandle: () => 1, + onRequestTexture: () => null, + onRequestIndex: () => 1, + } + ); v.updateValue({ height: 1, width: 1, diff --git a/test/internal/backend/web-gl/kernel-value/dynamic-memory-optimized-number-texture.js b/test/internal/backend/web-gl/kernel-value/dynamic-memory-optimized-number-texture.js index b0625f66..7a31f507 100644 --- a/test/internal/backend/web-gl/kernel-value/dynamic-memory-optimized-number-texture.js +++ b/test/internal/backend/web-gl/kernel-value/dynamic-memory-optimized-number-texture.js @@ -10,16 +10,19 @@ test('.updateValue() checks too large height', () => { }, validate: true, }; - const v = new webGLKernelValueMaps.unsigned.dynamic.MemoryOptimizedNumberTexture({ size: [1, 1] }, { - kernel: mockKernel, - name: 'test', - type: 'MemoryOptimizedNumberTexture', - origin: 'user', - tactic: 'speed', - onRequestContextHandle: () => 1, - onRequestTexture: () => null, - onRequestIndex: () => 1 - }); + const v = new webGLKernelValueMaps.unsigned.dynamic.MemoryOptimizedNumberTexture( + { size: [1, 1] }, + { + kernel: mockKernel, + name: 'test', + type: 'MemoryOptimizedNumberTexture', + origin: 'user', + tactic: 'speed', + onRequestContextHandle: () => 1, + onRequestTexture: () => null, + onRequestIndex: () => 1, + } + ); assert.throws(() => { v.updateValue({ size: [1, 2] }); @@ -34,20 +37,23 @@ test('.updateValue() checks too large width', () => { validate: true, }; - const v = new webGLKernelValueMaps.unsigned.dynamic.MemoryOptimizedNumberTexture({ size: [1, 1] }, { - kernel: mockKernel, - name: 'test', - type: 'MemoryOptimizedNumberTexture', - origin: 'user', - tactic: 'speed', - onRequestContextHandle: () => 1, - onRequestTexture: () => null, - onRequestIndex: () => 1 - }); + const v = new webGLKernelValueMaps.unsigned.dynamic.MemoryOptimizedNumberTexture( + { size: [1, 1] }, + { + kernel: mockKernel, + name: 'test', + type: 'MemoryOptimizedNumberTexture', + origin: 'user', + tactic: 'speed', + onRequestContextHandle: () => 1, + onRequestTexture: () => null, + onRequestIndex: () => 1, + } + ); assert.throws(() => { v.updateValue({ - size: [2,1] - }) + size: [2, 1], + }); }, new Error('Argument texture width of 2 larger than maximum size of 1 for your GPU')); }); @@ -68,21 +74,24 @@ test('.updateValue() checks ok height & width', () => { pixelStorei: () => {}, texImage2D: () => {}, }; - const v = new webGLKernelValueMaps.unsigned.dynamic.MemoryOptimizedNumberTexture({ size: [2,2], context: mockContext }, { - kernel: mockKernel, - name: 'test', - type: 'MemoryOptimizedNumberTexture', - origin: 'user', - tactic: 'speed', - context: mockContext, - onRequestContextHandle: () => 1, - onRequestTexture: () => null, - onRequestIndex: () => 1 - }); + const v = new webGLKernelValueMaps.unsigned.dynamic.MemoryOptimizedNumberTexture( + { size: [2, 2], context: mockContext }, + { + kernel: mockKernel, + name: 'test', + type: 'MemoryOptimizedNumberTexture', + origin: 'user', + tactic: 'speed', + context: mockContext, + onRequestContextHandle: () => 1, + onRequestTexture: () => null, + onRequestIndex: () => 1, + } + ); v.updateValue({ - size: [1,1], + size: [1, 1], context: mockContext, - texture: {} + texture: {}, }); assert.equal(v.constructor.name, 'WebGLKernelValueDynamicMemoryOptimizedNumberTexture'); diff --git a/test/internal/backend/web-gl/kernel-value/dynamic-number-texture.js b/test/internal/backend/web-gl/kernel-value/dynamic-number-texture.js index 994044f2..f3bf8a62 100644 --- a/test/internal/backend/web-gl/kernel-value/dynamic-number-texture.js +++ b/test/internal/backend/web-gl/kernel-value/dynamic-number-texture.js @@ -10,16 +10,19 @@ test('.updateValue() checks too large height', () => { }, validate: true, }; - const v = new webGLKernelValueMaps.unsigned.dynamic.NumberTexture({ size: [1, 1] }, { - kernel: mockKernel, - name: 'test', - type: 'NumberTexture', - origin: 'user', - tactic: 'speed', - onRequestContextHandle: () => 1, - onRequestTexture: () => null, - onRequestIndex: () => 1 - }); + const v = new webGLKernelValueMaps.unsigned.dynamic.NumberTexture( + { size: [1, 1] }, + { + kernel: mockKernel, + name: 'test', + type: 'NumberTexture', + origin: 'user', + tactic: 'speed', + onRequestContextHandle: () => 1, + onRequestTexture: () => null, + onRequestIndex: () => 1, + } + ); assert.throws(() => { v.updateValue({ size: [1, 2] }); @@ -34,20 +37,23 @@ test('.updateValue() checks too large width', () => { validate: true, }; - const v = new webGLKernelValueMaps.unsigned.dynamic.NumberTexture({ size: [1, 1] }, { - kernel: mockKernel, - name: 'test', - type: 'NumberTexture', - origin: 'user', - tactic: 'speed', - onRequestContextHandle: () => 1, - onRequestTexture: () => null, - onRequestIndex: () => 1 - }); + const v = new webGLKernelValueMaps.unsigned.dynamic.NumberTexture( + { size: [1, 1] }, + { + kernel: mockKernel, + name: 'test', + type: 'NumberTexture', + origin: 'user', + tactic: 'speed', + onRequestContextHandle: () => 1, + onRequestTexture: () => null, + onRequestIndex: () => 1, + } + ); assert.throws(() => { v.updateValue({ - size: [2,1] - }) + size: [2, 1], + }); }, new Error('Argument texture width of 2 larger than maximum size of 1 for your GPU')); }); @@ -68,21 +74,24 @@ test('.updateValue() checks ok height & width', () => { pixelStorei: () => {}, texImage2D: () => {}, }; - const v = new webGLKernelValueMaps.unsigned.dynamic.NumberTexture({ size: [2,2], context: mockContext }, { - kernel: mockKernel, - name: 'test', - type: 'NumberTexture', - origin: 'user', - tactic: 'speed', - context: mockContext, - onRequestContextHandle: () => 1, - onRequestTexture: () => null, - onRequestIndex: () => 1 - }); + const v = new webGLKernelValueMaps.unsigned.dynamic.NumberTexture( + { size: [2, 2], context: mockContext }, + { + kernel: mockKernel, + name: 'test', + type: 'NumberTexture', + origin: 'user', + tactic: 'speed', + context: mockContext, + onRequestContextHandle: () => 1, + onRequestTexture: () => null, + onRequestIndex: () => 1, + } + ); v.updateValue({ - size: [1,1], + size: [1, 1], context: mockContext, - texture: {} + texture: {}, }); assert.equal(v.constructor.name, 'WebGLKernelValueDynamicNumberTexture'); diff --git a/test/internal/backend/web-gl/kernel-value/dynamic-single-array.js b/test/internal/backend/web-gl/kernel-value/dynamic-single-array.js index 98104721..0db64b10 100644 --- a/test/internal/backend/web-gl/kernel-value/dynamic-single-array.js +++ b/test/internal/backend/web-gl/kernel-value/dynamic-single-array.js @@ -10,7 +10,7 @@ test('.updateValue() checks too large', () => { }, validate: true, }; - const v = new webGLKernelValueMaps.single.dynamic.Array([1,2], { + const v = new webGLKernelValueMaps.single.dynamic.Array([1, 2], { kernel: mockKernel, name: 'test', type: 'Array', @@ -18,11 +18,11 @@ test('.updateValue() checks too large', () => { tactic: 'speed', onRequestContextHandle: () => 1, onRequestTexture: () => null, - onRequestIndex: () => 1 + onRequestIndex: () => 1, }); assert.throws(() => { - v.updateValue(new Array([1,2,3,4,5,6,7,8])); + v.updateValue(new Array([1, 2, 3, 4, 5, 6, 7, 8])); }, new Error('Argument texture height of 2 larger than maximum size of 1 for your GPU')); }); @@ -43,7 +43,7 @@ test('.updateValue() checks ok', () => { pixelStorei: () => {}, texImage2D: () => {}, }; - const v = new webGLKernelValueMaps.single.dynamic.Array([1,2], { + const v = new webGLKernelValueMaps.single.dynamic.Array([1, 2], { kernel: mockKernel, name: 'test', type: 'Array', @@ -52,9 +52,9 @@ test('.updateValue() checks ok', () => { context: mockContext, onRequestContextHandle: () => 1, onRequestTexture: () => null, - onRequestIndex: () => 1 + onRequestIndex: () => 1, }); - v.updateValue(new Array([2,1])); + v.updateValue(new Array([2, 1])); assert.equal(v.constructor.name, 'WebGLKernelValueDynamicSingleArray'); }); diff --git a/test/internal/backend/web-gl/kernel-value/dynamic-single-array1d-i.js b/test/internal/backend/web-gl/kernel-value/dynamic-single-array1d-i.js index 2cf1822a..c5652f3e 100644 --- a/test/internal/backend/web-gl/kernel-value/dynamic-single-array1d-i.js +++ b/test/internal/backend/web-gl/kernel-value/dynamic-single-array1d-i.js @@ -10,7 +10,7 @@ test('.updateValue() checks too large', () => { }, validate: true, }; - const v = new webGLKernelValueMaps.single.dynamic["Array1D(2)"]([[1,2]], { + const v = new webGLKernelValueMaps.single.dynamic['Array1D(2)']([[1, 2]], { kernel: mockKernel, name: 'test', type: 'Array1D(2)', @@ -18,11 +18,16 @@ test('.updateValue() checks too large', () => { tactic: 'speed', onRequestContextHandle: () => 1, onRequestTexture: () => null, - onRequestIndex: () => 1 + onRequestIndex: () => 1, }); assert.throws(() => { - v.updateValue([[1,2],[3,4],[5,6],[7,8]]); + v.updateValue([ + [1, 2], + [3, 4], + [5, 6], + [7, 8], + ]); }, new Error('Argument texture height of 2 larger than maximum size of 1 for your GPU')); }); @@ -43,7 +48,7 @@ test('.updateValue() checks ok', () => { pixelStorei: () => {}, texImage2D: () => {}, }; - const v = new webGLKernelValueMaps.single.dynamic["Array1D(2)"]([[1,2]], { + const v = new webGLKernelValueMaps.single.dynamic['Array1D(2)']([[1, 2]], { kernel: mockKernel, name: 'test', type: 'Array1D(2)', @@ -52,9 +57,9 @@ test('.updateValue() checks ok', () => { context: mockContext, onRequestContextHandle: () => 1, onRequestTexture: () => null, - onRequestIndex: () => 1 + onRequestIndex: () => 1, }); - v.updateValue(new Array(new Array([2,1]))); + v.updateValue(new Array(new Array([2, 1]))); assert.equal(v.constructor.name, 'WebGLKernelValueDynamicSingleArray1DI'); }); diff --git a/test/internal/backend/web-gl/kernel-value/dynamic-single-array2d-i.js b/test/internal/backend/web-gl/kernel-value/dynamic-single-array2d-i.js index f1be9d0d..2d7fe4b6 100644 --- a/test/internal/backend/web-gl/kernel-value/dynamic-single-array2d-i.js +++ b/test/internal/backend/web-gl/kernel-value/dynamic-single-array2d-i.js @@ -10,7 +10,7 @@ test('.updateValue() checks too large', () => { }, validate: true, }; - const v = new webGLKernelValueMaps.single.dynamic["Array2D(2)"]([[[1,2]]], { + const v = new webGLKernelValueMaps.single.dynamic['Array2D(2)']([[[1, 2]]], { kernel: mockKernel, name: 'test', type: 'Array2D(2)', @@ -18,11 +18,18 @@ test('.updateValue() checks too large', () => { tactic: 'speed', onRequestContextHandle: () => 1, onRequestTexture: () => null, - onRequestIndex: () => 1 + onRequestIndex: () => 1, }); assert.throws(() => { - v.updateValue([[[1,2],[3,4],[5,6],[7,8]]]); + v.updateValue([ + [ + [1, 2], + [3, 4], + [5, 6], + [7, 8], + ], + ]); }, new Error('Argument texture height of 2 larger than maximum size of 1 for your GPU')); }); @@ -43,7 +50,7 @@ test('.updateValue() checks ok', () => { pixelStorei: () => {}, texImage2D: () => {}, }; - const v = new webGLKernelValueMaps.single.dynamic["Array2D(2)"]([[[1,2]]], { + const v = new webGLKernelValueMaps.single.dynamic['Array2D(2)']([[[1, 2]]], { kernel: mockKernel, name: 'test', type: 'Array2D(2)', @@ -52,9 +59,9 @@ test('.updateValue() checks ok', () => { context: mockContext, onRequestContextHandle: () => 1, onRequestTexture: () => null, - onRequestIndex: () => 1 + onRequestIndex: () => 1, }); - v.updateValue([[[2,1]]]); + v.updateValue([[[2, 1]]]); assert.equal(v.constructor.name, 'WebGLKernelValueDynamicSingleArray2DI'); }); diff --git a/test/internal/backend/web-gl/kernel-value/dynamic-single-array3d-i.js b/test/internal/backend/web-gl/kernel-value/dynamic-single-array3d-i.js index 84c8afa3..9fd8a08f 100644 --- a/test/internal/backend/web-gl/kernel-value/dynamic-single-array3d-i.js +++ b/test/internal/backend/web-gl/kernel-value/dynamic-single-array3d-i.js @@ -10,7 +10,7 @@ test('.updateValue() checks too large', () => { }, validate: true, }; - const v = new webGLKernelValueMaps.single.dynamic["Array3D(2)"]([[[[1,2]]]], { + const v = new webGLKernelValueMaps.single.dynamic['Array3D(2)']([[[[1, 2]]]], { kernel: mockKernel, name: 'test', type: 'Array3D(2)', @@ -18,11 +18,20 @@ test('.updateValue() checks too large', () => { tactic: 'speed', onRequestContextHandle: () => 1, onRequestTexture: () => null, - onRequestIndex: () => 1 + onRequestIndex: () => 1, }); assert.throws(() => { - v.updateValue([[[[1,2],[3,4],[5,6],[7,8]]]]); + v.updateValue([ + [ + [ + [1, 2], + [3, 4], + [5, 6], + [7, 8], + ], + ], + ]); }, new Error('Argument texture height of 2 larger than maximum size of 1 for your GPU')); }); @@ -43,7 +52,7 @@ test('.updateValue() checks ok', () => { pixelStorei: () => {}, texImage2D: () => {}, }; - const v = new webGLKernelValueMaps.single.dynamic["Array3D(2)"]([[[[1,2]]]], { + const v = new webGLKernelValueMaps.single.dynamic['Array3D(2)']([[[[1, 2]]]], { kernel: mockKernel, name: 'test', type: 'Array3D(2)', @@ -52,9 +61,9 @@ test('.updateValue() checks ok', () => { context: mockContext, onRequestContextHandle: () => 1, onRequestTexture: () => null, - onRequestIndex: () => 1 + onRequestIndex: () => 1, }); - v.updateValue([[[[2,1]]]]); + v.updateValue([[[[2, 1]]]]); assert.equal(v.constructor.name, 'WebGLKernelValueDynamicSingleArray3DI'); }); diff --git a/test/internal/backend/web-gl/kernel-value/dynamic-single-input.js b/test/internal/backend/web-gl/kernel-value/dynamic-single-input.js index 3d7d1648..a8a6a9ab 100644 --- a/test/internal/backend/web-gl/kernel-value/dynamic-single-input.js +++ b/test/internal/backend/web-gl/kernel-value/dynamic-single-input.js @@ -10,19 +10,22 @@ test('.updateValue() checks too large height', () => { }, validate: true, }; - const v = new webGLKernelValueMaps.single.dynamic.Input({ size: [1, 1], value: [0] }, { - kernel: mockKernel, - name: 'test', - type: 'Input', - origin: 'user', - tactic: 'speed', - onRequestContextHandle: () => 1, - onRequestTexture: () => null, - onRequestIndex: () => 1 - }); + const v = new webGLKernelValueMaps.single.dynamic.Input( + { size: [1, 1], value: [0] }, + { + kernel: mockKernel, + name: 'test', + type: 'Input', + origin: 'user', + tactic: 'speed', + onRequestContextHandle: () => 1, + onRequestTexture: () => null, + onRequestIndex: () => 1, + } + ); assert.throws(() => { - v.updateValue({ size: [4,4] }); + v.updateValue({ size: [4, 4] }); }, new Error('Argument texture height and width of 2 larger than maximum size of 1 for your GPU')); }); @@ -34,20 +37,23 @@ test('.updateValue() checks too large width', () => { validate: true, }; - const v = new webGLKernelValueMaps.single.dynamic.Input({ size: [1, 1], value: [0] }, { - kernel: mockKernel, - name: 'test', - type: 'Input', - origin: 'user', - tactic: 'speed', - onRequestContextHandle: () => 1, - onRequestTexture: () => null, - onRequestIndex: () => 1 - }); + const v = new webGLKernelValueMaps.single.dynamic.Input( + { size: [1, 1], value: [0] }, + { + kernel: mockKernel, + name: 'test', + type: 'Input', + origin: 'user', + tactic: 'speed', + onRequestContextHandle: () => 1, + onRequestTexture: () => null, + onRequestIndex: () => 1, + } + ); assert.throws(() => { v.updateValue({ - size: [3,3] - }) + size: [3, 3], + }); }, new Error('Argument texture width of 3 larger than maximum size of 1 for your GPU')); }); @@ -68,21 +74,24 @@ test('.updateValue() checks ok height & width', () => { pixelStorei: () => {}, texImage2D: () => {}, }; - const v = new webGLKernelValueMaps.single.dynamic.Input({ size: [2,2], context: mockContext, value: [0] }, { - kernel: mockKernel, - name: 'test', - type: 'Input', - origin: 'user', - tactic: 'speed', - context: mockContext, - onRequestContextHandle: () => 1, - onRequestTexture: () => null, - onRequestIndex: () => 1 - }); + const v = new webGLKernelValueMaps.single.dynamic.Input( + { size: [2, 2], context: mockContext, value: [0] }, + { + kernel: mockKernel, + name: 'test', + type: 'Input', + origin: 'user', + tactic: 'speed', + context: mockContext, + onRequestContextHandle: () => 1, + onRequestTexture: () => null, + onRequestIndex: () => 1, + } + ); v.updateValue({ - size: [1,1], + size: [1, 1], context: mockContext, - value: [0] + value: [0], }); assert.equal(v.constructor.name, 'WebGLKernelValueDynamicSingleInput'); diff --git a/test/internal/backend/web-gl/kernel-value/dynamic-unsigned-array.js b/test/internal/backend/web-gl/kernel-value/dynamic-unsigned-array.js index de73bd30..d73432e3 100644 --- a/test/internal/backend/web-gl/kernel-value/dynamic-unsigned-array.js +++ b/test/internal/backend/web-gl/kernel-value/dynamic-unsigned-array.js @@ -10,7 +10,7 @@ test('.updateValue() checks too large', () => { }, validate: true, }; - const v = new webGLKernelValueMaps.unsigned.dynamic.Array([1,2], { + const v = new webGLKernelValueMaps.unsigned.dynamic.Array([1, 2], { kernel: mockKernel, name: 'test', type: 'Array', @@ -18,11 +18,11 @@ test('.updateValue() checks too large', () => { tactic: 'speed', onRequestContextHandle: () => 1, onRequestTexture: () => null, - onRequestIndex: () => 1 + onRequestIndex: () => 1, }); assert.throws(() => { - v.updateValue(new Array([1,2,3,4,5,6,7,8])); + v.updateValue(new Array([1, 2, 3, 4, 5, 6, 7, 8])); }, new Error('Argument texture width of 4 larger than maximum size of 2 for your GPU')); }); @@ -43,7 +43,7 @@ test('.updateValue() checks ok', () => { pixelStorei: () => {}, texImage2D: () => {}, }; - const v = new webGLKernelValueMaps.unsigned.dynamic.Array([1,2], { + const v = new webGLKernelValueMaps.unsigned.dynamic.Array([1, 2], { kernel: mockKernel, name: 'test', type: 'Array', @@ -52,9 +52,9 @@ test('.updateValue() checks ok', () => { context: mockContext, onRequestContextHandle: () => 1, onRequestTexture: () => null, - onRequestIndex: () => 1 + onRequestIndex: () => 1, }); - v.updateValue(new Array([2,1])); + v.updateValue(new Array([2, 1])); assert.equal(v.constructor.name, 'WebGLKernelValueDynamicUnsignedArray'); }); diff --git a/test/internal/backend/web-gl/kernel-value/dynamic-unsigned-input.js b/test/internal/backend/web-gl/kernel-value/dynamic-unsigned-input.js index b0bdeb00..30326669 100644 --- a/test/internal/backend/web-gl/kernel-value/dynamic-unsigned-input.js +++ b/test/internal/backend/web-gl/kernel-value/dynamic-unsigned-input.js @@ -11,20 +11,23 @@ test('.updateValue() checks too large', () => { validate: true, }; - const v = new webGLKernelValueMaps.unsigned.dynamic.Input({ size: [1, 1], value: [0] }, { - kernel: mockKernel, - name: 'test', - type: 'Input', - origin: 'user', - tactic: 'speed', - onRequestContextHandle: () => 1, - onRequestTexture: () => null, - onRequestIndex: () => 1 - }); + const v = new webGLKernelValueMaps.unsigned.dynamic.Input( + { size: [1, 1], value: [0] }, + { + kernel: mockKernel, + name: 'test', + type: 'Input', + origin: 'user', + tactic: 'speed', + onRequestContextHandle: () => 1, + onRequestTexture: () => null, + onRequestIndex: () => 1, + } + ); assert.throws(() => { v.updateValue({ - size: [8,8], - value: [0] + size: [8, 8], + value: [0], }); }, new Error('Argument texture height and width of 8 larger than maximum size of 4 for your GPU')); }); @@ -46,21 +49,24 @@ test('.updateValue() checks ok', () => { pixelStorei: () => {}, texImage2D: () => {}, }; - const v = new webGLKernelValueMaps.unsigned.dynamic.Input({ size: [2,2], context: mockContext, value: [0] }, { - kernel: mockKernel, - name: 'test', - type: 'Input', - origin: 'user', - tactic: 'speed', - context: mockContext, - onRequestContextHandle: () => 1, - onRequestTexture: () => null, - onRequestIndex: () => 1 - }); + const v = new webGLKernelValueMaps.unsigned.dynamic.Input( + { size: [2, 2], context: mockContext, value: [0] }, + { + kernel: mockKernel, + name: 'test', + type: 'Input', + origin: 'user', + tactic: 'speed', + context: mockContext, + onRequestContextHandle: () => 1, + onRequestTexture: () => null, + onRequestIndex: () => 1, + } + ); v.updateValue({ - size: [1,1], + size: [1, 1], context: mockContext, - value: [0] + value: [0], }); assert.equal(v.constructor.name, 'WebGLKernelValueDynamicUnsignedInput'); }); diff --git a/test/internal/backend/web-gl/kernel-value/html-image.js b/test/internal/backend/web-gl/kernel-value/html-image.js index 2ab7805e..28a85e30 100644 --- a/test/internal/backend/web-gl/kernel-value/html-image.js +++ b/test/internal/backend/web-gl/kernel-value/html-image.js @@ -11,16 +11,19 @@ test('.constructor() checks too large height', () => { validate: true, }; assert.throws(() => { - new webGLKernelValueMaps.unsigned.static.HTMLImage({ width: 1, height: 2 }, { - kernel: mockKernel, - name: 'test', - type: 'HTMLImage', - origin: 'user', - tactic: 'speed', - onRequestContextHandle: () => 1, - onRequestTexture: () => null, - onRequestIndex: () => 1 - }); + new webGLKernelValueMaps.unsigned.static.HTMLImage( + { width: 1, height: 2 }, + { + kernel: mockKernel, + name: 'test', + type: 'HTMLImage', + origin: 'user', + tactic: 'speed', + onRequestContextHandle: () => 1, + onRequestTexture: () => null, + onRequestIndex: () => 1, + } + ); }, new Error('Argument texture height of 2 larger than maximum size of 1 for your GPU')); }); @@ -32,16 +35,19 @@ test('.constructor() checks too large width', () => { validate: true, }; assert.throws(() => { - new webGLKernelValueMaps.unsigned.static.HTMLImage({ width: 2, height: 1 }, { - kernel: mockKernel, - name: 'test', - type: 'HTMLImage', - origin: 'user', - tactic: 'speed', - onRequestContextHandle: () => 1, - onRequestTexture: () => null, - onRequestIndex: () => 1 - }); + new webGLKernelValueMaps.unsigned.static.HTMLImage( + { width: 2, height: 1 }, + { + kernel: mockKernel, + name: 'test', + type: 'HTMLImage', + origin: 'user', + tactic: 'speed', + onRequestContextHandle: () => 1, + onRequestTexture: () => null, + onRequestIndex: () => 1, + } + ); }, new Error('Argument texture width of 2 larger than maximum size of 1 for your GPU')); }); @@ -52,15 +58,18 @@ test('.constructor() checks ok height & width', () => { }, validate: true, }; - const v = new webGLKernelValueMaps.unsigned.static.HTMLImage({ width: 2, height: 2 }, { - kernel: mockKernel, - name: 'test', - type: 'HTMLImage', - origin: 'user', - tactic: 'speed', - onRequestContextHandle: () => 1, - onRequestTexture: () => null, - onRequestIndex: () => 1 - }); + const v = new webGLKernelValueMaps.unsigned.static.HTMLImage( + { width: 2, height: 2 }, + { + kernel: mockKernel, + name: 'test', + type: 'HTMLImage', + origin: 'user', + tactic: 'speed', + onRequestContextHandle: () => 1, + onRequestTexture: () => null, + onRequestIndex: () => 1, + } + ); assert.equal(v.constructor.name, 'WebGLKernelValueHTMLImage'); }); diff --git a/test/internal/backend/web-gl/kernel-value/memory-optimized-number-texture.js b/test/internal/backend/web-gl/kernel-value/memory-optimized-number-texture.js index f399dce3..116967b2 100644 --- a/test/internal/backend/web-gl/kernel-value/memory-optimized-number-texture.js +++ b/test/internal/backend/web-gl/kernel-value/memory-optimized-number-texture.js @@ -11,16 +11,19 @@ test('.constructor() checks too large height', () => { validate: true, }; assert.throws(() => { - new webGLKernelValueMaps.unsigned.static.MemoryOptimizedNumberTexture({ size: [1, 2] }, { - kernel: mockKernel, - name: 'test', - type: 'MemoryOptimizedNumberTexture', - origin: 'user', - tactic: 'speed', - onRequestContextHandle: () => 1, - onRequestTexture: () => null, - onRequestIndex: () => 1 - }); + new webGLKernelValueMaps.unsigned.static.MemoryOptimizedNumberTexture( + { size: [1, 2] }, + { + kernel: mockKernel, + name: 'test', + type: 'MemoryOptimizedNumberTexture', + origin: 'user', + tactic: 'speed', + onRequestContextHandle: () => 1, + onRequestTexture: () => null, + onRequestIndex: () => 1, + } + ); }, new Error('Argument texture height of 2 larger than maximum size of 1 for your GPU')); }); @@ -33,16 +36,19 @@ test('.constructor() checks too large width', () => { }; assert.throws(() => { - new webGLKernelValueMaps.unsigned.static.MemoryOptimizedNumberTexture({ size: [2, 1] }, { - kernel: mockKernel, - name: 'test', - type: 'MemoryOptimizedNumberTexture', - origin: 'user', - tactic: 'speed', - onRequestContextHandle: () => 1, - onRequestTexture: () => null, - onRequestIndex: () => 1 - }); + new webGLKernelValueMaps.unsigned.static.MemoryOptimizedNumberTexture( + { size: [2, 1] }, + { + kernel: mockKernel, + name: 'test', + type: 'MemoryOptimizedNumberTexture', + origin: 'user', + tactic: 'speed', + onRequestContextHandle: () => 1, + onRequestTexture: () => null, + onRequestIndex: () => 1, + } + ); }, new Error('Argument texture width of 2 larger than maximum size of 1 for your GPU')); }); @@ -63,17 +69,20 @@ test('.constructor() checks ok height & width', () => { pixelStorei: () => {}, texImage2D: () => {}, }; - const v = new webGLKernelValueMaps.unsigned.static.MemoryOptimizedNumberTexture({ size: [2,2], context: mockContext }, { - kernel: mockKernel, - name: 'test', - type: 'MemoryOptimizedNumberTexture', - origin: 'user', - tactic: 'speed', - context: mockContext, - onRequestContextHandle: () => 1, - onRequestTexture: () => null, - onRequestIndex: () => 1 - }); + const v = new webGLKernelValueMaps.unsigned.static.MemoryOptimizedNumberTexture( + { size: [2, 2], context: mockContext }, + { + kernel: mockKernel, + name: 'test', + type: 'MemoryOptimizedNumberTexture', + origin: 'user', + tactic: 'speed', + context: mockContext, + onRequestContextHandle: () => 1, + onRequestTexture: () => null, + onRequestIndex: () => 1, + } + ); assert.equal(v.constructor.name, 'WebGLKernelValueMemoryOptimizedNumberTexture'); }); @@ -95,19 +104,26 @@ test('.updateValue() should set uploadValue when a pipeline kernel has no textur pixelStorei: () => {}, texImage2D: () => {}, }; - const v = new webGLKernelValueMaps.unsigned.static.MemoryOptimizedNumberTexture({ size: [2,2], context: mockContext }, { - kernel: mockKernel, - name: 'test', - type: 'MemoryOptimizedNumberTexture', - origin: 'user', - tactic: 'speed', + const v = new webGLKernelValueMaps.unsigned.static.MemoryOptimizedNumberTexture( + { size: [2, 2], context: mockContext }, + { + kernel: mockKernel, + name: 'test', + type: 'MemoryOptimizedNumberTexture', + origin: 'user', + tactic: 'speed', + context: mockContext, + onRequestContextHandle: () => 1, + onRequestTexture: () => null, + onRequestIndex: () => 1, + } + ); + + const newMockTexture = {}; + v.updateValue({ + size: [2, 2], context: mockContext, - onRequestContextHandle: () => 1, - onRequestTexture: () => null, - onRequestIndex: () => 1 + texture: newMockTexture, }); - - const newMockTexture = {} - v.updateValue({ size: [2,2], context: mockContext, texture: newMockTexture }) - assert.equal(v.uploadValue, newMockTexture) + assert.equal(v.uploadValue, newMockTexture); }); diff --git a/test/internal/backend/web-gl/kernel-value/number-texture.js b/test/internal/backend/web-gl/kernel-value/number-texture.js index 86902f06..793ec518 100644 --- a/test/internal/backend/web-gl/kernel-value/number-texture.js +++ b/test/internal/backend/web-gl/kernel-value/number-texture.js @@ -11,16 +11,19 @@ test('.constructor() checks too large height', () => { validate: true, }; assert.throws(() => { - new webGLKernelValueMaps.unsigned.static.NumberTexture({ size: [1, 2] }, { - kernel: mockKernel, - name: 'test', - type: 'NumberTexture', - origin: 'user', - tactic: 'speed', - onRequestContextHandle: () => 1, - onRequestTexture: () => null, - onRequestIndex: () => 1 - }); + new webGLKernelValueMaps.unsigned.static.NumberTexture( + { size: [1, 2] }, + { + kernel: mockKernel, + name: 'test', + type: 'NumberTexture', + origin: 'user', + tactic: 'speed', + onRequestContextHandle: () => 1, + onRequestTexture: () => null, + onRequestIndex: () => 1, + } + ); }, new Error('Argument texture height of 2 larger than maximum size of 1 for your GPU')); }); @@ -33,16 +36,19 @@ test('.constructor() checks too large width', () => { }; assert.throws(() => { - new webGLKernelValueMaps.unsigned.static.NumberTexture({ size: [2, 1] }, { - kernel: mockKernel, - name: 'test', - type: 'NumberTexture', - origin: 'user', - tactic: 'speed', - onRequestContextHandle: () => 1, - onRequestTexture: () => null, - onRequestIndex: () => 1 - }); + new webGLKernelValueMaps.unsigned.static.NumberTexture( + { size: [2, 1] }, + { + kernel: mockKernel, + name: 'test', + type: 'NumberTexture', + origin: 'user', + tactic: 'speed', + onRequestContextHandle: () => 1, + onRequestTexture: () => null, + onRequestIndex: () => 1, + } + ); }, new Error('Argument texture width of 2 larger than maximum size of 1 for your GPU')); }); @@ -63,17 +69,20 @@ test('.constructor() checks ok height & width', () => { pixelStorei: () => {}, texImage2D: () => {}, }; - const v = new webGLKernelValueMaps.unsigned.static.NumberTexture({ size: [2,2], context: mockContext }, { - kernel: mockKernel, - name: 'test', - type: 'NumberTexture', - origin: 'user', - tactic: 'speed', - context: mockContext, - onRequestContextHandle: () => 1, - onRequestTexture: () => null, - onRequestIndex: () => 1 - }); + const v = new webGLKernelValueMaps.unsigned.static.NumberTexture( + { size: [2, 2], context: mockContext }, + { + kernel: mockKernel, + name: 'test', + type: 'NumberTexture', + origin: 'user', + tactic: 'speed', + context: mockContext, + onRequestContextHandle: () => 1, + onRequestTexture: () => null, + onRequestIndex: () => 1, + } + ); assert.equal(v.constructor.name, 'WebGLKernelValueNumberTexture'); }); @@ -95,19 +104,26 @@ test('.updateValue() should set uploadValue when a pipeline kernel has no textur pixelStorei: () => {}, texImage2D: () => {}, }; - const v = new webGLKernelValueMaps.unsigned.static.NumberTexture({ size: [2,2], context: mockContext }, { - kernel: mockKernel, - name: 'test', - type: 'NumberTexture', - origin: 'user', - tactic: 'speed', + const v = new webGLKernelValueMaps.unsigned.static.NumberTexture( + { size: [2, 2], context: mockContext }, + { + kernel: mockKernel, + name: 'test', + type: 'NumberTexture', + origin: 'user', + tactic: 'speed', + context: mockContext, + onRequestContextHandle: () => 1, + onRequestTexture: () => null, + onRequestIndex: () => 1, + } + ); + + const newMockTexture = {}; + v.updateValue({ + size: [2, 2], context: mockContext, - onRequestContextHandle: () => 1, - onRequestTexture: () => null, - onRequestIndex: () => 1 + texture: newMockTexture, }); - - const newMockTexture = {} - v.updateValue({ size: [2,2], context: mockContext, texture: newMockTexture }) - assert.equal(v.uploadValue, newMockTexture) + assert.equal(v.uploadValue, newMockTexture); }); diff --git a/test/internal/backend/web-gl/kernel-value/single-array.js b/test/internal/backend/web-gl/kernel-value/single-array.js index eb4a33a8..73b69daf 100644 --- a/test/internal/backend/web-gl/kernel-value/single-array.js +++ b/test/internal/backend/web-gl/kernel-value/single-array.js @@ -20,7 +20,7 @@ test('.constructor() checks too large height', () => { tactic: 'speed', onRequestContextHandle: () => 1, onRequestTexture: () => null, - onRequestIndex: () => 1 + onRequestIndex: () => 1, }); }, new Error('Argument texture height of 2 larger than maximum size of 1 for your GPU')); }); @@ -42,7 +42,7 @@ test('.constructor() checks ok height & width', () => { pixelStorei: () => {}, texImage2D: () => {}, }; - const v = new webGLKernelValueMaps.single.static.Array([1,2], { + const v = new webGLKernelValueMaps.single.static.Array([1, 2], { kernel: mockKernel, name: 'test', type: 'Array', @@ -51,7 +51,7 @@ test('.constructor() checks ok height & width', () => { context: mockContext, onRequestContextHandle: () => 1, onRequestTexture: () => null, - onRequestIndex: () => 1 + onRequestIndex: () => 1, }); assert.equal(v.constructor.name, 'WebGLKernelValueSingleArray'); }); diff --git a/test/internal/backend/web-gl/kernel-value/single-array1d-i.js b/test/internal/backend/web-gl/kernel-value/single-array1d-i.js index 272d911e..7636a6db 100644 --- a/test/internal/backend/web-gl/kernel-value/single-array1d-i.js +++ b/test/internal/backend/web-gl/kernel-value/single-array1d-i.js @@ -12,7 +12,7 @@ test('.constructor() checks too large height', () => { }; assert.throws(() => { const row = new Float32Array(5); - new webGLKernelValueMaps.single.static["Array1D(2)"]([row], { + new webGLKernelValueMaps.single.static['Array1D(2)']([row], { kernel: mockKernel, name: 'test', type: 'Array1D(2)', @@ -20,7 +20,7 @@ test('.constructor() checks too large height', () => { tactic: 'speed', onRequestContextHandle: () => 1, onRequestTexture: () => null, - onRequestIndex: () => 1 + onRequestIndex: () => 1, }); }, new Error('Argument texture height of 2 larger than maximum size of 1 for your GPU')); }); @@ -42,7 +42,7 @@ test('.constructor() checks ok height & width', () => { pixelStorei: () => {}, texImage2D: () => {}, }; - const v = new webGLKernelValueMaps.single.static["Array1D(2)"]([[1,2]], { + const v = new webGLKernelValueMaps.single.static['Array1D(2)']([[1, 2]], { kernel: mockKernel, name: 'test', type: 'Array1D(2)', @@ -51,7 +51,7 @@ test('.constructor() checks ok height & width', () => { context: mockContext, onRequestContextHandle: () => 1, onRequestTexture: () => null, - onRequestIndex: () => 1 + onRequestIndex: () => 1, }); assert.equal(v.constructor.name, 'WebGLKernelValueSingleArray1DI'); }); diff --git a/test/internal/backend/web-gl/kernel-value/single-array2d-i.js b/test/internal/backend/web-gl/kernel-value/single-array2d-i.js index 911542e5..1098700a 100644 --- a/test/internal/backend/web-gl/kernel-value/single-array2d-i.js +++ b/test/internal/backend/web-gl/kernel-value/single-array2d-i.js @@ -12,7 +12,7 @@ test('.constructor() checks too large height', () => { }; const row = new Float32Array(5); assert.throws(() => { - new webGLKernelValueMaps.single.static["Array2D(2)"]([[row]], { + new webGLKernelValueMaps.single.static['Array2D(2)']([[row]], { kernel: mockKernel, name: 'test', type: 'Array2D(2)', @@ -20,7 +20,7 @@ test('.constructor() checks too large height', () => { tactic: 'speed', onRequestContextHandle: () => 1, onRequestTexture: () => null, - onRequestIndex: () => 1 + onRequestIndex: () => 1, }); }, new Error('Argument texture height of 2 larger than maximum size of 1 for your GPU')); }); @@ -42,7 +42,7 @@ test('.constructor() checks ok height & width', () => { pixelStorei: () => {}, texImage2D: () => {}, }; - const v = new webGLKernelValueMaps.single.static["Array2D(2)"]([[[1,2]]], { + const v = new webGLKernelValueMaps.single.static['Array2D(2)']([[[1, 2]]], { kernel: mockKernel, name: 'test', type: 'Array2D(2)', @@ -51,7 +51,7 @@ test('.constructor() checks ok height & width', () => { context: mockContext, onRequestContextHandle: () => 1, onRequestTexture: () => null, - onRequestIndex: () => 1 + onRequestIndex: () => 1, }); assert.equal(v.constructor.name, 'WebGLKernelValueSingleArray2DI'); }); diff --git a/test/internal/backend/web-gl/kernel-value/single-array3d-i.js b/test/internal/backend/web-gl/kernel-value/single-array3d-i.js index 1666cb2e..4faf9160 100644 --- a/test/internal/backend/web-gl/kernel-value/single-array3d-i.js +++ b/test/internal/backend/web-gl/kernel-value/single-array3d-i.js @@ -12,7 +12,7 @@ test('.constructor() checks too large height', () => { }; assert.throws(() => { const row = new Float32Array(5); - new webGLKernelValueMaps.single.static["Array3D(2)"]([[row]], { + new webGLKernelValueMaps.single.static['Array3D(2)']([[row]], { kernel: mockKernel, name: 'test', type: 'Array3D(2)', @@ -20,7 +20,7 @@ test('.constructor() checks too large height', () => { tactic: 'speed', onRequestContextHandle: () => 1, onRequestTexture: () => null, - onRequestIndex: () => 1 + onRequestIndex: () => 1, }); }, new Error('Argument texture height of 2 larger than maximum size of 1 for your GPU')); }); @@ -42,7 +42,7 @@ test('.constructor() checks ok height & width', () => { pixelStorei: () => {}, texImage2D: () => {}, }; - const v = new webGLKernelValueMaps.single.static["Array3D(2)"]([[[1,2]]], { + const v = new webGLKernelValueMaps.single.static['Array3D(2)']([[[1, 2]]], { kernel: mockKernel, name: 'test', type: 'Array3D(2)', @@ -51,7 +51,7 @@ test('.constructor() checks ok height & width', () => { context: mockContext, onRequestContextHandle: () => 1, onRequestTexture: () => null, - onRequestIndex: () => 1 + onRequestIndex: () => 1, }); assert.equal(v.constructor.name, 'WebGLKernelValueSingleArray3DI'); }); diff --git a/test/internal/backend/web-gl/kernel-value/single-input.js b/test/internal/backend/web-gl/kernel-value/single-input.js index b624ddb1..3c655f76 100644 --- a/test/internal/backend/web-gl/kernel-value/single-input.js +++ b/test/internal/backend/web-gl/kernel-value/single-input.js @@ -11,16 +11,19 @@ test('.constructor() checks too large height', () => { validate: true, }; assert.throws(() => { - new webGLKernelValueMaps.single.static.Input({ size: [5,1], value: [1,2] }, { - kernel: mockKernel, - name: 'test', - type: 'Array', - origin: 'user', - tactic: 'speed', - onRequestContextHandle: () => 1, - onRequestTexture: () => null, - onRequestIndex: () => 1 - }); + new webGLKernelValueMaps.single.static.Input( + { size: [5, 1], value: [1, 2] }, + { + kernel: mockKernel, + name: 'test', + type: 'Array', + origin: 'user', + tactic: 'speed', + onRequestContextHandle: () => 1, + onRequestTexture: () => null, + onRequestIndex: () => 1, + } + ); }, new Error('Argument texture height of 2 larger than maximum size of 1 for your GPU')); }); @@ -41,16 +44,19 @@ test('.constructor() checks ok height & width', () => { pixelStorei: () => {}, texImage2D: () => {}, }; - const v = new webGLKernelValueMaps.single.static.Input({ size: [1,2], value: [1,2] }, { - kernel: mockKernel, - name: 'test', - type: 'Array', - origin: 'user', - tactic: 'speed', - context: mockContext, - onRequestContextHandle: () => 1, - onRequestTexture: () => null, - onRequestIndex: () => 1 - }); + const v = new webGLKernelValueMaps.single.static.Input( + { size: [1, 2], value: [1, 2] }, + { + kernel: mockKernel, + name: 'test', + type: 'Array', + origin: 'user', + tactic: 'speed', + context: mockContext, + onRequestContextHandle: () => 1, + onRequestTexture: () => null, + onRequestIndex: () => 1, + } + ); assert.equal(v.constructor.name, 'WebGLKernelValueSingleInput'); }); diff --git a/test/internal/backend/web-gl/kernel-value/unsigned-array.js b/test/internal/backend/web-gl/kernel-value/unsigned-array.js index a05078d4..327cde52 100644 --- a/test/internal/backend/web-gl/kernel-value/unsigned-array.js +++ b/test/internal/backend/web-gl/kernel-value/unsigned-array.js @@ -11,7 +11,7 @@ test('.constructor() checks too large height', () => { validate: true, }; assert.throws(() => { - new webGLKernelValueMaps.unsigned.static.Array([1,2], { + new webGLKernelValueMaps.unsigned.static.Array([1, 2], { kernel: mockKernel, name: 'test', type: 'Array', @@ -19,7 +19,7 @@ test('.constructor() checks too large height', () => { tactic: 'speed', onRequestContextHandle: () => 1, onRequestTexture: () => null, - onRequestIndex: () => 1 + onRequestIndex: () => 1, }); }, new Error('Argument texture height and width of 2 larger than maximum size of 1 for your GPU')); }); @@ -41,7 +41,7 @@ test('.constructor() checks ok height & width', () => { pixelStorei: () => {}, texImage2D: () => {}, }; - const v = new webGLKernelValueMaps.unsigned.static.Array([1,2], { + const v = new webGLKernelValueMaps.unsigned.static.Array([1, 2], { kernel: mockKernel, name: 'test', type: 'Array', @@ -50,7 +50,7 @@ test('.constructor() checks ok height & width', () => { context: mockContext, onRequestContextHandle: () => 1, onRequestTexture: () => null, - onRequestIndex: () => 1 + onRequestIndex: () => 1, }); assert.equal(v.constructor.name, 'WebGLKernelValueUnsignedArray'); }); diff --git a/test/internal/backend/web-gl/kernel-value/unsigned-input.js b/test/internal/backend/web-gl/kernel-value/unsigned-input.js index 92be0f20..88414e1f 100644 --- a/test/internal/backend/web-gl/kernel-value/unsigned-input.js +++ b/test/internal/backend/web-gl/kernel-value/unsigned-input.js @@ -11,16 +11,19 @@ test('.constructor() checks too large height', () => { validate: true, }; assert.throws(() => { - new webGLKernelValueMaps.unsigned.static.Input({ size: [2,1], value: [1,2] }, { - kernel: mockKernel, - name: 'test', - type: 'Array', - origin: 'user', - tactic: 'speed', - onRequestContextHandle: () => 1, - onRequestTexture: () => null, - onRequestIndex: () => 1 - }); + new webGLKernelValueMaps.unsigned.static.Input( + { size: [2, 1], value: [1, 2] }, + { + kernel: mockKernel, + name: 'test', + type: 'Array', + origin: 'user', + tactic: 'speed', + onRequestContextHandle: () => 1, + onRequestTexture: () => null, + onRequestIndex: () => 1, + } + ); }, new Error('Argument texture height and width of 2 larger than maximum size of 1 for your GPU')); }); @@ -41,16 +44,19 @@ test('.constructor() checks ok height & width', () => { pixelStorei: () => {}, texImage2D: () => {}, }; - const v = new webGLKernelValueMaps.unsigned.static.Input({ size: [1,2], value: [1,2] }, { - kernel: mockKernel, - name: 'test', - type: 'Array', - origin: 'user', - tactic: 'speed', - context: mockContext, - onRequestContextHandle: () => 1, - onRequestTexture: () => null, - onRequestIndex: () => 1 - }); + const v = new webGLKernelValueMaps.unsigned.static.Input( + { size: [1, 2], value: [1, 2] }, + { + kernel: mockKernel, + name: 'test', + type: 'Array', + origin: 'user', + tactic: 'speed', + context: mockContext, + onRequestContextHandle: () => 1, + onRequestTexture: () => null, + onRequestIndex: () => 1, + } + ); assert.equal(v.constructor.name, 'WebGLKernelValueUnsignedInput'); }); diff --git a/test/internal/backend/web-gl/kernel/index.js b/test/internal/backend/web-gl/kernel/index.js index 2ae871db..61486ba3 100644 --- a/test/internal/backend/web-gl/kernel/index.js +++ b/test/internal/backend/web-gl/kernel/index.js @@ -6,7 +6,7 @@ describe('internal: WebGLKernel'); (typeof global !== 'undefined' ? test : skip)('.setupFeatureChecks() if context is available, but .getExtension() is falsey', () => { const mockContext = { - getExtension: null // this is important + getExtension: null, // this is important }; const mockElement = { getContext: () => mockContext, @@ -14,7 +14,7 @@ describe('internal: WebGLKernel'); const mockDocument = { createElement: () => { return mockElement; - } + }, }; global.document = mockDocument; diff --git a/test/internal/backend/web-gl/kernel/setupArguments.js b/test/internal/backend/web-gl/kernel/setupArguments.js index 222dc7b2..f11c9c07 100644 --- a/test/internal/backend/web-gl/kernel/setupArguments.js +++ b/test/internal/backend/web-gl/kernel/setupArguments.js @@ -17,17 +17,7 @@ const gl = { UNPACK_FLIP_Y_WEBGL: 'UNPACK_FLIP_Y_WEBGL', }; function setupArgumentsTestSuite(testSuiteSettings) { - const { - gpuSettings, - argument, - expectedPixels, - expectedBitRatio, - expectedDim, - expectedSize, - expectedType, - expectedArgumentTextureCount, - expectedPixelStorei, - } = testSuiteSettings; + const { gpuSettings, argument, expectedPixels, expectedBitRatio, expectedDim, expectedSize, expectedType, expectedArgumentTextureCount, expectedPixelStorei } = testSuiteSettings; let texImage2DCalled = false; let activeTextureCalled = false; let bindTextureCalled = false; @@ -36,92 +26,95 @@ function setupArgumentsTestSuite(testSuiteSettings) { let uniform3ivCalled = false; let uniform2ivCalled = false; let uniform1iCalled = false; - const mockContext = Object.assign({ - activeTexture: (index) => { - assert.equal(index, 0); - activeTextureCalled = true; - }, - bindTexture: (target, texture) => { - assert.equal(target, 'TEXTURE_2D'); - assert.equal(texture, 'TEXTURE'); - bindTextureCalled = true; - }, - texParameteri: (target, pname, param) => { - switch (texParameteriCalls) { - case 0: - assert.equal(target, 'TEXTURE_2D'); - assert.equal(pname, 'TEXTURE_WRAP_S'); - assert.equal(param, 'CLAMP_TO_EDGE'); - texParameteriCalls++; - break; - case 1: - assert.equal(target, 'TEXTURE_2D'); - assert.equal(pname, 'TEXTURE_WRAP_T'); - assert.equal(param, 'CLAMP_TO_EDGE'); - texParameteriCalls++; - break; - case 2: - assert.equal(target, 'TEXTURE_2D'); - assert.equal(pname, 'TEXTURE_MIN_FILTER'); - assert.equal(param, 'NEAREST'); - texParameteriCalls++; - break; - case 3: - assert.equal(target, 'TEXTURE_2D'); - assert.equal(pname, 'TEXTURE_MAG_FILTER'); - assert.equal(param, 'NEAREST'); - texParameteriCalls++; - break; - default: + const mockContext = Object.assign( + { + activeTexture: index => { + assert.equal(index, 0); + activeTextureCalled = true; + }, + bindTexture: (target, texture) => { + assert.equal(target, 'TEXTURE_2D'); + assert.equal(texture, 'TEXTURE'); + bindTextureCalled = true; + }, + texParameteri: (target, pname, param) => { + switch (texParameteriCalls) { + case 0: + assert.equal(target, 'TEXTURE_2D'); + assert.equal(pname, 'TEXTURE_WRAP_S'); + assert.equal(param, 'CLAMP_TO_EDGE'); + texParameteriCalls++; + break; + case 1: + assert.equal(target, 'TEXTURE_2D'); + assert.equal(pname, 'TEXTURE_WRAP_T'); + assert.equal(param, 'CLAMP_TO_EDGE'); + texParameteriCalls++; + break; + case 2: + assert.equal(target, 'TEXTURE_2D'); + assert.equal(pname, 'TEXTURE_MIN_FILTER'); + assert.equal(param, 'NEAREST'); + texParameteriCalls++; + break; + case 3: + assert.equal(target, 'TEXTURE_2D'); + assert.equal(pname, 'TEXTURE_MAG_FILTER'); + assert.equal(param, 'NEAREST'); + texParameteriCalls++; + break; + default: + throw new Error('called too many times'); + } + }, + pixelStorei: (pname, param) => { + assert.equal(pname, 'UNPACK_FLIP_Y_WEBGL'); + assert.equal(param, expectedPixelStorei); + }, + createTexture: () => 'TEXTURE', + getUniformLocation: (program, name) => { + assert.equal(program, 'program'); + if (getUniformLocationCalls > 3) { throw new Error('called too many times'); - } - }, - pixelStorei: (pname, param) => { - assert.equal(pname, 'UNPACK_FLIP_Y_WEBGL'); - assert.equal(param, expectedPixelStorei); - }, - createTexture: () => 'TEXTURE', - getUniformLocation: (program, name) => { - assert.equal(program, 'program'); - if (getUniformLocationCalls > 3) { - throw new Error('called too many times'); - } - getUniformLocationCalls++; - return { - user_vDim: 'user_vDimLocation', - user_vSize: 'user_vSizeLocation', - user_v: 'user_vLocation', - }[name]; - }, - uniform3iv: (location, value) => { - assert.equal(location, 'user_vDimLocation'); - assert.deepEqual(value, expectedDim); - uniform3ivCalled = true; - }, - uniform2iv: (location, value) => { - assert.equal(location, 'user_vSizeLocation'); - assert.deepEqual(value, expectedSize); - uniform2ivCalled = true; - }, - uniform1i: (location, value) => { - assert.equal(location, 'user_vLocation'); - assert.equal(value, 0); - uniform1iCalled = true; - }, - texImage2D: (target, level, internalFormat, width, height, border, format, type, pixels) => { - assert.equal(target, gl.TEXTURE_2D); - assert.equal(level, 0); - assert.equal(internalFormat, gl.RGBA); - assert.equal(width, expectedSize[0]); - assert.equal(height, expectedSize[1]); - assert.equal(border, 0); - assert.equal(format, gl.RGBA); - assert.equal(type, expectedType); - assert.equal(pixels.length, expectedPixels.length); - assert.deepEqual(pixels, expectedPixels); - texImage2DCalled = true; - } - }, gl); + } + getUniformLocationCalls++; + return { + user_vDim: 'user_vDimLocation', + user_vSize: 'user_vSizeLocation', + user_v: 'user_vLocation', + }[name]; + }, + uniform3iv: (location, value) => { + assert.equal(location, 'user_vDimLocation'); + assert.deepEqual(value, expectedDim); + uniform3ivCalled = true; + }, + uniform2iv: (location, value) => { + assert.equal(location, 'user_vSizeLocation'); + assert.deepEqual(value, expectedSize); + uniform2ivCalled = true; + }, + uniform1i: (location, value) => { + assert.equal(location, 'user_vLocation'); + assert.equal(value, 0); + uniform1iCalled = true; + }, + texImage2D: (target, level, internalFormat, width, height, border, format, type, pixels) => { + assert.equal(target, gl.TEXTURE_2D); + assert.equal(level, 0); + assert.equal(internalFormat, gl.RGBA); + assert.equal(width, expectedSize[0]); + assert.equal(height, expectedSize[1]); + assert.equal(border, 0); + assert.equal(format, gl.RGBA); + assert.equal(type, expectedType); + assert.equal(pixels.length, expectedPixels.length); + assert.deepEqual(pixels, expectedPixels); + texImage2DCalled = true; + }, + }, + gl + ); const source = `function(v) { return v[this.thread.x]; }`; const settings = { context: mockContext, @@ -130,8 +123,8 @@ function setupArgumentsTestSuite(testSuiteSettings) { kernel.constructor = { lookupKernelValueType: WebGLKernel.lookupKernelValueType, features: { - maxTextureSize: 9999 - } + maxTextureSize: 9999, + }, }; const args = [argument]; kernel.program = 'program'; @@ -158,21 +151,21 @@ test('Array with unsigned precision 5 length', () => { setupArgumentsTestSuite({ gpuSettings: { precision: 'unsigned', - output: [4] + output: [4], }, argument: [ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, - 5 + 1, 2, 3, 4, 5, ], expectedBitRatio: 4, - expectedPixels: new Uint8Array(new Float32Array([ - // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5,0,0,0 - ]).buffer), - expectedDim: new Int32Array([5,1,1]), - expectedSize: new Int32Array([4,2]), // 4 * 2 = 8 + expectedPixels: new Uint8Array( + new Float32Array([ + // NOTE: formatted like rectangle on purpose, so you can see how the texture should look + 1, 2, 3, 4, 5, 0, 0, 0, + ]).buffer + ), + expectedDim: new Int32Array([5, 1, 1]), + expectedSize: new Int32Array([4, 2]), // 4 * 2 = 8 expectedType: gl.UNSIGNED_BYTE, expectedArgumentTextureCount: 1, expectedPixelStorei: false, @@ -182,23 +175,21 @@ test('Float32Array with unsigned precision 5 length', () => { setupArgumentsTestSuite({ gpuSettings: { precision: 'unsigned', - output: [4] + output: [4], }, argument: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, - 5 + 1, 2, 3, 4, 5, ]), expectedBitRatio: 4, expectedPixels: new Uint8Array( new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5,0,0,0 + 1, 2, 3, 4, 5, 0, 0, 0, ]).buffer ), - expectedDim: new Int32Array([5,1,1]), - expectedSize: new Int32Array([4,2]), // 4 * 2 * 1 = 8 + expectedDim: new Int32Array([5, 1, 1]), + expectedSize: new Int32Array([4, 2]), // 4 * 2 * 1 = 8 expectedType: gl.UNSIGNED_BYTE, expectedArgumentTextureCount: 1, expectedPixelStorei: false, @@ -208,23 +199,21 @@ test('Uint16Array with unsigned precision 5 length', () => { setupArgumentsTestSuite({ gpuSettings: { precision: 'unsigned', - output: [4] + output: [4], }, argument: new Uint16Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, - 5 + 1, 2, 3, 4, 5, ]), expectedBitRatio: 2, expectedPixels: new Uint8Array( new Uint16Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5,0,0,0 + 1, 2, 3, 4, 5, 0, 0, 0, ]).buffer ), - expectedDim: new Int32Array([5,1,1]), - expectedSize: new Int32Array([2,2]), // 2 * 2 * 2 = 8 + expectedDim: new Int32Array([5, 1, 1]), + expectedSize: new Int32Array([2, 2]), // 2 * 2 * 2 = 8 expectedType: gl.UNSIGNED_BYTE, expectedArgumentTextureCount: 1, expectedPixelStorei: false, @@ -234,20 +223,16 @@ test('Uint8Array with unsigned precision 5 length', () => { setupArgumentsTestSuite({ gpuSettings: { precision: 'unsigned', - output: [5] + output: [5], }, - argument: new Uint8Array([ - 1, 2, 3, 4, - 5 - ]), + argument: new Uint8Array([1, 2, 3, 4, 5]), expectedBitRatio: 1, expectedPixels: new Uint8Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5,0,0,0 + 1, 2, 3, 4, 5, 0, 0, 0, ]), - expectedDim: new Int32Array([5,1,1]), - expectedSize: new Int32Array([1,2]), // 1 * 2 * 4 = 8 + expectedDim: new Int32Array([5, 1, 1]), + expectedSize: new Int32Array([1, 2]), // 1 * 2 * 4 = 8 expectedType: gl.UNSIGNED_BYTE, expectedArgumentTextureCount: 1, expectedPixelStorei: false, @@ -258,21 +243,19 @@ test('Array with single precision', () => { setupArgumentsTestSuite({ gpuSettings: { precision: 'single', - output: [4] + output: [4], }, argument: [ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5 + 1, 2, 3, 4, 5, ], expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5,0,0,0 + 1, 2, 3, 4, 5, 0, 0, 0, ]), - expectedDim: new Int32Array([5,1,1]), - expectedSize: new Int32Array([1,2]), + expectedDim: new Int32Array([5, 1, 1]), + expectedSize: new Int32Array([1, 2]), expectedType: gl.FLOAT, expectedTextureWidth: 1, expectedTextureHeight: 2, @@ -284,21 +267,19 @@ test('Float32Array with single precision', () => { setupArgumentsTestSuite({ gpuSettings: { precision: 'single', - output: [4] + output: [4], }, argument: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5 + 1, 2, 3, 4, 5, ]), expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5,0,0,0 + 1, 2, 3, 4, 5, 0, 0, 0, ]), - expectedDim: new Int32Array([5,1,1]), - expectedSize: new Int32Array([1,2]), + expectedDim: new Int32Array([5, 1, 1]), + expectedSize: new Int32Array([1, 2]), expectedType: gl.FLOAT, expectedTextureWidth: 1, expectedTextureHeight: 2, @@ -310,22 +291,20 @@ test('Uint16Array with single precision', () => { setupArgumentsTestSuite({ gpuSettings: { precision: 'single', - output: [4] + output: [4], }, argument: new Uint16Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5 + 1, 2, 3, 4, 5, ]), // upconverted from 2 expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5,0,0,0 + 1, 2, 3, 4, 5, 0, 0, 0, ]), - expectedDim: new Int32Array([5,1,1]), - expectedSize: new Int32Array([1,2]), + expectedDim: new Int32Array([5, 1, 1]), + expectedSize: new Int32Array([1, 2]), expectedType: gl.FLOAT, expectedArgumentTextureCount: 1, expectedPixelStorei: false, @@ -335,22 +314,20 @@ test('Uint8Array with single precision', () => { setupArgumentsTestSuite({ gpuSettings: { precision: 'single', - output: [4] + output: [4], }, argument: new Uint8Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5 + 1, 2, 3, 4, 5, ]), // upconverted from 1 expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5,0,0,0 + 1, 2, 3, 4, 5, 0, 0, 0, ]), - expectedDim: new Int32Array([5,1,1]), - expectedSize: new Int32Array([1,2]), + expectedDim: new Int32Array([5, 1, 1]), + expectedSize: new Int32Array([1, 2]), expectedType: gl.FLOAT, expectedArgumentTextureCount: 1, expectedPixelStorei: false, @@ -361,18 +338,13 @@ test('Array with unsigned precision length 33', () => { setupArgumentsTestSuite({ gpuSettings: { precision: 'unsigned', - output: [5] + output: [5], }, argument: [ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 1 per RGBA, so only 1 of the 4 channels is used // NOTE: 6x6 - 1, 2, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, - 31, 32, 33 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ], expectedBitRatio: 4, expectedPixels: new Uint8Array( @@ -380,16 +352,11 @@ test('Array with unsigned precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 1 per RGBA, so only 1 of the 4 channels is used // NOTE: 6x6 - 1, 2, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, - 31, 32, 33, 0, 0, 0 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]).buffer ), - expectedDim: new Int32Array([33,1,1]), - expectedSize: new Int32Array([6,6]), // 3 * 3 = 9 * 4 = 34 + expectedDim: new Int32Array([33, 1, 1]), + expectedSize: new Int32Array([6, 6]), // 3 * 3 = 9 * 4 = 34 expectedType: gl.UNSIGNED_BYTE, expectedArgumentTextureCount: 1, expectedPixelStorei: false, @@ -400,18 +367,13 @@ test('Float32Array with unsigned precision length 33', () => { setupArgumentsTestSuite({ gpuSettings: { precision: 'unsigned', - output: [5] + output: [5], }, argument: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 1 per RGBA, so only 1 of the 4 channels is used // NOTE: 6x6 - 1, 2, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, - 31, 32, 33 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ]), expectedBitRatio: 4, expectedPixels: new Uint8Array( @@ -419,16 +381,11 @@ test('Float32Array with unsigned precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 1 per RGBA, so only 1 of the 4 channels is used // NOTE: 6x6 - 1, 2, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, - 31, 32, 33, 0, 0, 0, + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]).buffer ), - expectedDim: new Int32Array([33,1,1]), - expectedSize: new Int32Array([6,6]), // 3 * 3 = 9 * 4 = 34 + expectedDim: new Int32Array([33, 1, 1]), + expectedSize: new Int32Array([6, 6]), // 3 * 3 = 9 * 4 = 34 expectedType: gl.UNSIGNED_BYTE, expectedArgumentTextureCount: 1, expectedPixelStorei: false, @@ -439,17 +396,13 @@ test('Uint16Array with unsigned precision length 33', () => { setupArgumentsTestSuite({ gpuSettings: { precision: 'unsigned', - output: [5] + output: [5], }, argument: new Uint16Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 2 per RGBA, so only 2 of the 4 channels is used // NOTE: 4x5 - 1,2, 3,4, 5,6, 7,8, - 9,10, 11,12, 13,14, 15,16, - 17,18, 19,20, 21,22, 23,24, - 25,26, 27,28, 29,30, 31,32, - 33, + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ]), expectedBitRatio: 2, expectedPixels: new Uint8Array( @@ -457,15 +410,11 @@ test('Uint16Array with unsigned precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 2 per RGBA, so only 2 of the 4 channels is used // NOTE: 4x5 - 1,2, 3,4, 5,6, 7,8, - 9,10, 11,12, 13,14, 15,16, - 17,18, 19,20, 21,22, 23,24, - 25,26, 27,28, 29,30, 31,32, - 33,0, 0,0, 0,0, 0,0 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, 0, 0, 0, 0, ]).buffer ), - expectedDim: new Int32Array([33,1,1]), - expectedSize: new Int32Array([4,5]), // 3 * 3 = 9 * 4 = 34 + expectedDim: new Int32Array([33, 1, 1]), + expectedSize: new Int32Array([4, 5]), // 3 * 3 = 9 * 4 = 34 expectedType: gl.UNSIGNED_BYTE, expectedArgumentTextureCount: 1, expectedPixelStorei: false, @@ -476,28 +425,25 @@ test('Uint8Array with unsigned precision length 33', () => { setupArgumentsTestSuite({ gpuSettings: { precision: 'unsigned', - output: [5] + output: [5], }, argument: new Uint8Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so only 2 of the 4 channels is used // NOTE: 3x3 - 1,2,3,4, 5,6,7,8, 9,10,11,12, - 13,14,15,16, 17,18,19,20, 21,22,23,24, - 25,26, 27,28, 29,30,31,32, 33 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ]), expectedBitRatio: 1, expectedPixels: new Uint8Array( new Uint8Array([ - // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - // NOTE: Packing is 4 per RGBA, so only 2 of the 4 channels is used - // NOTE: 3x3 - 1,2,3,4, 5,6,7,8, 9,10,11,12, - 13,14,15,16, 17,18,19,20, 21,22,23,24, - 25,26, 27,28, 29,30,31,32, 33,0,0,0 - ]).buffer), - expectedDim: new Int32Array([33,1,1]), - expectedSize: new Int32Array([3,3]), // 3 * 3 = 9 * 4 = 34 + // NOTE: formatted like rectangle on purpose, so you can see how the texture should look + // NOTE: Packing is 4 per RGBA, so only 2 of the 4 channels is used + // NOTE: 3x3 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, + ]).buffer + ), + expectedDim: new Int32Array([33, 1, 1]), + expectedSize: new Int32Array([3, 3]), // 3 * 3 = 9 * 4 = 34 expectedType: gl.UNSIGNED_BYTE, expectedArgumentTextureCount: 1, expectedPixelStorei: false, @@ -508,27 +454,23 @@ test('Array with single precision length 33', () => { setupArgumentsTestSuite({ gpuSettings: { precision: 'single', - output: [5] + output: [5], }, argument: [ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1,2,3,4, 5,6,7,8, 9,10,11,12, - 13,14,15,16, 17,18,19,20, 21,22,23,24, - 25,26,27,28, 29,30,31,32, 33 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ], expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1,2,3,4, 5,6,7,8, 9,10,11,12, - 13,14,15,16, 17,18,19,20, 21,22,23,24, - 25,26,27,28, 29,30,31,32, 33,0,0,0 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]), - expectedDim: new Int32Array([33,1,1]), - expectedSize: new Int32Array([3,3]), // 3 * 3 = 9 * 4 = 34 + expectedDim: new Int32Array([33, 1, 1]), + expectedSize: new Int32Array([3, 3]), // 3 * 3 = 9 * 4 = 34 expectedType: gl.FLOAT, expectedArgumentTextureCount: 1, expectedPixelStorei: false, @@ -539,27 +481,23 @@ test('Float32Array with single precision length 33', () => { setupArgumentsTestSuite({ gpuSettings: { precision: 'single', - output: [5] + output: [5], }, argument: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1,2,3,4, 5,6,7,8, 9,10,11,12, - 13,14,15,16, 17,18,19,20, 21,22,23,24, - 25,26,27,28, 29,30,31,32, 33 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ]), expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1,2,3,4, 5,6,7,8, 9,10,11,12, - 13,14,15,16, 17,18,19,20, 21,22,23,24, - 25,26,27,28, 29,30,31,32, 33,0,0,0 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]), - expectedDim: new Int32Array([33,1,1]), - expectedSize: new Int32Array([3,3]), // 3 * 3 = 9 * 4 = 36 + expectedDim: new Int32Array([33, 1, 1]), + expectedSize: new Int32Array([3, 3]), // 3 * 3 = 9 * 4 = 36 expectedType: gl.FLOAT, expectedArgumentTextureCount: 1, expectedPixelStorei: false, @@ -570,15 +508,13 @@ test('Uint16Array with single precision length 33', () => { setupArgumentsTestSuite({ gpuSettings: { precision: 'single', - output: [5] + output: [5], }, argument: new Uint16Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1,2,3,4, 5,6,7,8, 9,10,11,12, - 13,14,15,16, 17,18,19,20, 21,22,23,24, - 25,26,27,28, 29,30,31,32, 33 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ]), // upconverted from 2 expectedBitRatio: 4, @@ -586,12 +522,10 @@ test('Uint16Array with single precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1,2,3,4, 5,6,7,8, 9,10,11,12, - 13,14,15,16, 17,18,19,20, 21,22,23,24, - 25,26,27,28, 29,30,31,32, 33,0,0,0 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]), - expectedDim: new Int32Array([33,1,1]), - expectedSize: new Int32Array([3,3]), // 3 * 3 = 9 * 4 = 36 + expectedDim: new Int32Array([33, 1, 1]), + expectedSize: new Int32Array([3, 3]), // 3 * 3 = 9 * 4 = 36 expectedType: gl.FLOAT, expectedArgumentTextureCount: 1, expectedPixelStorei: false, @@ -602,15 +536,13 @@ test('Uint8Array with single precision length 33', () => { setupArgumentsTestSuite({ gpuSettings: { precision: 'single', - output: [5] + output: [5], }, argument: new Uint8Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1,2,3,4, 5,6,7,8, 9,10,11,12, - 13,14,15,16, 17,18,19,20, 21,22,23,24, - 25,26,27,28, 29,30,31,32, 33 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ]), // upconverted from 1 expectedBitRatio: 4, @@ -618,12 +550,10 @@ test('Uint8Array with single precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1,2,3,4, 5,6,7,8, 9,10,11,12, - 13,14,15,16, 17,18,19,20, 21,22,23,24, - 25,26,27,28, 29,30,31,32, 33,0,0,0 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]), - expectedDim: new Int32Array([33,1,1]), - expectedSize: new Int32Array([3,3]), // 3 * 3 = 9 * 4 = 36 + expectedDim: new Int32Array([33, 1, 1]), + expectedSize: new Int32Array([3, 3]), // 3 * 3 = 9 * 4 = 36 expectedType: gl.FLOAT, expectedArgumentTextureCount: 1, expectedPixelStorei: false, @@ -636,21 +566,24 @@ test('Input(Array) with unsigned precision 5 length', () => { setupArgumentsTestSuite({ gpuSettings: { precision: 'unsigned', - output: [4] + output: [4], }, - argument: input([ - // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, - 5, 0 - ], [2,3]), + argument: input( + [ + // NOTE: formatted like rectangle on purpose, so you can see how the texture should look + 1, 2, 3, 4, 5, 0, + ], + [2, 3] + ), expectedBitRatio: 4, - expectedPixels: new Uint8Array(new Float32Array([ - // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5,0,0,0 - ]).buffer), - expectedDim: new Int32Array([2,3,1]), - expectedSize: new Int32Array([4,2]), // 4 * 2 = 8 + expectedPixels: new Uint8Array( + new Float32Array([ + // NOTE: formatted like rectangle on purpose, so you can see how the texture should look + 1, 2, 3, 4, 5, 0, 0, 0, + ]).buffer + ), + expectedDim: new Int32Array([2, 3, 1]), + expectedSize: new Int32Array([4, 2]), // 4 * 2 = 8 expectedType: gl.UNSIGNED_BYTE, expectedArgumentTextureCount: 1, expectedPixelStorei: false, @@ -660,23 +593,24 @@ test('Input(Float32Array) with unsigned precision 5 length', () => { setupArgumentsTestSuite({ gpuSettings: { precision: 'unsigned', - output: [4] + output: [4], }, - argument: input(new Float32Array([ - // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, - 5 - ]), [5]), + argument: input( + new Float32Array([ + // NOTE: formatted like rectangle on purpose, so you can see how the texture should look + 1, 2, 3, 4, 5, + ]), + [5] + ), expectedBitRatio: 4, expectedPixels: new Uint8Array( new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5,0,0,0 + 1, 2, 3, 4, 5, 0, 0, 0, ]).buffer ), - expectedDim: new Int32Array([5,1,1]), - expectedSize: new Int32Array([4,2]), // 4 * 2 * 1 = 8 + expectedDim: new Int32Array([5, 1, 1]), + expectedSize: new Int32Array([4, 2]), // 4 * 2 * 1 = 8 expectedType: gl.UNSIGNED_BYTE, expectedArgumentTextureCount: 1, expectedPixelStorei: false, @@ -686,23 +620,24 @@ test('Input(Uint16Array) with unsigned precision 5 length', () => { setupArgumentsTestSuite({ gpuSettings: { precision: 'unsigned', - output: [4] + output: [4], }, - argument: input(new Uint16Array([ - // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, - 5, 0, - ]), [2,3]), + argument: input( + new Uint16Array([ + // NOTE: formatted like rectangle on purpose, so you can see how the texture should look + 1, 2, 3, 4, 5, 0, + ]), + [2, 3] + ), expectedBitRatio: 2, expectedPixels: new Uint8Array( new Uint16Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5,0,0,0 + 1, 2, 3, 4, 5, 0, 0, 0, ]).buffer ), - expectedDim: new Int32Array([2,3,1]), - expectedSize: new Int32Array([2,2]), // 2 * 2 * 2 = 8 + expectedDim: new Int32Array([2, 3, 1]), + expectedSize: new Int32Array([2, 2]), // 2 * 2 * 2 = 8 expectedType: gl.UNSIGNED_BYTE, expectedArgumentTextureCount: 1, expectedPixelStorei: false, @@ -712,20 +647,16 @@ test('Input(Uint8Array) with unsigned precision 5 length', () => { setupArgumentsTestSuite({ gpuSettings: { precision: 'unsigned', - output: [5] + output: [5], }, - argument: input(new Uint8Array([ - 1, 2, 3, 4, - 5,0 - ]),[2, 3]), + argument: input(new Uint8Array([1, 2, 3, 4, 5, 0]), [2, 3]), expectedBitRatio: 1, expectedPixels: new Uint8Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5,0,0,0 + 1, 2, 3, 4, 5, 0, 0, 0, ]), - expectedDim: new Int32Array([2,3,1]), - expectedSize: new Int32Array([1,2]), // 1 * 2 * 4 = 8 + expectedDim: new Int32Array([2, 3, 1]), + expectedSize: new Int32Array([1, 2]), // 1 * 2 * 4 = 8 expectedType: gl.UNSIGNED_BYTE, expectedArgumentTextureCount: 1, expectedPixelStorei: false, @@ -736,21 +667,22 @@ test('Input(Array) with single precision', () => { setupArgumentsTestSuite({ gpuSettings: { precision: 'single', - output: [4] + output: [4], }, - argument: input([ - // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5,0 - ], [2,3]), + argument: input( + [ + // NOTE: formatted like rectangle on purpose, so you can see how the texture should look + 1, 2, 3, 4, 5, 0, + ], + [2, 3] + ), expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5,0,0,0 + 1, 2, 3, 4, 5, 0, 0, 0, ]), - expectedDim: new Int32Array([2,3,1]), - expectedSize: new Int32Array([1,2]), + expectedDim: new Int32Array([2, 3, 1]), + expectedSize: new Int32Array([1, 2]), expectedType: gl.FLOAT, expectedTextureWidth: 1, expectedTextureHeight: 2, @@ -762,21 +694,22 @@ test('Input(Float32Array) with single precision', () => { setupArgumentsTestSuite({ gpuSettings: { precision: 'single', - output: [4] + output: [4], }, - argument: input(new Float32Array([ - // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5,0 - ]),[2,3]), + argument: input( + new Float32Array([ + // NOTE: formatted like rectangle on purpose, so you can see how the texture should look + 1, 2, 3, 4, 5, 0, + ]), + [2, 3] + ), expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5,0,0,0 + 1, 2, 3, 4, 5, 0, 0, 0, ]), - expectedDim: new Int32Array([2,3,1]), - expectedSize: new Int32Array([1,2]), + expectedDim: new Int32Array([2, 3, 1]), + expectedSize: new Int32Array([1, 2]), expectedType: gl.FLOAT, expectedTextureWidth: 1, expectedTextureHeight: 2, @@ -788,22 +721,23 @@ test('Input(Uint16Array) with single precision', () => { setupArgumentsTestSuite({ gpuSettings: { precision: 'single', - output: [4] + output: [4], }, - argument: input(new Uint16Array([ - // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5,0 - ]), [2,3]), + argument: input( + new Uint16Array([ + // NOTE: formatted like rectangle on purpose, so you can see how the texture should look + 1, 2, 3, 4, 5, 0, + ]), + [2, 3] + ), // upconverted from 2 expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5,0,0,0 + 1, 2, 3, 4, 5, 0, 0, 0, ]), - expectedDim: new Int32Array([2,3,1]), - expectedSize: new Int32Array([1,2]), + expectedDim: new Int32Array([2, 3, 1]), + expectedSize: new Int32Array([1, 2]), expectedType: gl.FLOAT, expectedArgumentTextureCount: 1, expectedPixelStorei: false, @@ -813,22 +747,23 @@ test('Input(Uint8Array) with single precision', () => { setupArgumentsTestSuite({ gpuSettings: { precision: 'single', - output: [4] + output: [4], }, - argument: input(new Uint8Array([ - // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5,0 - ]), [2,3]), + argument: input( + new Uint8Array([ + // NOTE: formatted like rectangle on purpose, so you can see how the texture should look + 1, 2, 3, 4, 5, 0, + ]), + [2, 3] + ), // upconverted from 1 expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5,0,0,0 + 1, 2, 3, 4, 5, 0, 0, 0, ]), - expectedDim: new Int32Array([2,3,1]), - expectedSize: new Int32Array([1,2]), + expectedDim: new Int32Array([2, 3, 1]), + expectedSize: new Int32Array([1, 2]), expectedType: gl.FLOAT, expectedArgumentTextureCount: 1, expectedPixelStorei: false, @@ -839,35 +774,28 @@ test('Input(Array) with unsigned precision length 33', () => { setupArgumentsTestSuite({ gpuSettings: { precision: 'unsigned', - output: [5] + output: [5], }, - argument: input([ - // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - // NOTE: Packing is 1 per RGBA, so only 1 of the 4 channels is used - // NOTE: 6x6 - 1, 2, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, - 31, 32, 33 - ], [33]), + argument: input( + [ + // NOTE: formatted like rectangle on purpose, so you can see how the texture should look + // NOTE: Packing is 1 per RGBA, so only 1 of the 4 channels is used + // NOTE: 6x6 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + ], + [33] + ), expectedBitRatio: 4, expectedPixels: new Uint8Array( new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 1 per RGBA, so only 1 of the 4 channels is used // NOTE: 6x6 - 1, 2, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, - 31, 32, 33, 0, 0, 0 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]).buffer ), - expectedDim: new Int32Array([33,1,1]), - expectedSize: new Int32Array([6,6]), // 3 * 3 = 9 * 4 = 34 + expectedDim: new Int32Array([33, 1, 1]), + expectedSize: new Int32Array([6, 6]), // 3 * 3 = 9 * 4 = 34 expectedType: gl.UNSIGNED_BYTE, expectedArgumentTextureCount: 1, expectedPixelStorei: false, @@ -878,35 +806,28 @@ test('Input(Float32Array) with unsigned precision length 33', () => { setupArgumentsTestSuite({ gpuSettings: { precision: 'unsigned', - output: [5] + output: [5], }, - argument: input(new Float32Array([ - // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - // NOTE: Packing is 1 per RGBA, so only 1 of the 4 channels is used - // NOTE: 6x6 - 1, 2, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, - 31, 32, 33 - ]), [33]), + argument: input( + new Float32Array([ + // NOTE: formatted like rectangle on purpose, so you can see how the texture should look + // NOTE: Packing is 1 per RGBA, so only 1 of the 4 channels is used + // NOTE: 6x6 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + ]), + [33] + ), expectedBitRatio: 4, expectedPixels: new Uint8Array( new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 1 per RGBA, so only 1 of the 4 channels is used // NOTE: 6x6 - 1, 2, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, - 31, 32, 33, 0, 0, 0, + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]).buffer ), - expectedDim: new Int32Array([33,1,1]), - expectedSize: new Int32Array([6,6]), // 3 * 3 = 9 * 4 = 34 + expectedDim: new Int32Array([33, 1, 1]), + expectedSize: new Int32Array([6, 6]), // 3 * 3 = 9 * 4 = 34 expectedType: gl.UNSIGNED_BYTE, expectedArgumentTextureCount: 1, expectedPixelStorei: false, @@ -917,33 +838,28 @@ test('Input(Uint16Array) with unsigned precision length 33', () => { setupArgumentsTestSuite({ gpuSettings: { precision: 'unsigned', - output: [5] + output: [5], }, - argument: input(new Uint16Array([ - // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - // NOTE: Packing is 2 per RGBA, so only 2 of the 4 channels is used - // NOTE: 4x5 - 1,2, 3,4, 5,6, 7,8, - 9,10, 11,12, 13,14, 15,16, - 17,18, 19,20, 21,22, 23,24, - 25,26, 27,28, 29,30, 31,32, - 33, - ]), [33]), + argument: input( + new Uint16Array([ + // NOTE: formatted like rectangle on purpose, so you can see how the texture should look + // NOTE: Packing is 2 per RGBA, so only 2 of the 4 channels is used + // NOTE: 4x5 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + ]), + [33] + ), expectedBitRatio: 2, expectedPixels: new Uint8Array( new Uint16Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 2 per RGBA, so only 2 of the 4 channels is used // NOTE: 4x5 - 1,2, 3,4, 5,6, 7,8, - 9,10, 11,12, 13,14, 15,16, - 17,18, 19,20, 21,22, 23,24, - 25,26, 27,28, 29,30, 31,32, - 33,0, 0,0, 0,0, 0,0 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, 0, 0, 0, 0, ]).buffer ), - expectedDim: new Int32Array([33,1,1]), - expectedSize: new Int32Array([4,5]), // 3 * 3 = 9 * 4 = 34 + expectedDim: new Int32Array([33, 1, 1]), + expectedSize: new Int32Array([4, 5]), // 3 * 3 = 9 * 4 = 34 expectedType: gl.UNSIGNED_BYTE, expectedArgumentTextureCount: 1, expectedPixelStorei: false, @@ -954,28 +870,28 @@ test('Input(Uint8Array) with unsigned precision length 33', () => { setupArgumentsTestSuite({ gpuSettings: { precision: 'unsigned', - output: [5] + output: [5], }, - argument: input(new Uint8Array([ - // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - // NOTE: Packing is 4 per RGBA, so only 2 of the 4 channels is used - // NOTE: 3x3 - 1,2,3,4, 5,6,7,8, 9,10,11,12, - 13,14,15,16, 17,18,19,20, 21,22,23,24, - 25,26, 27,28, 29,30,31,32, 33 - ]), [33]), + argument: input( + new Uint8Array([ + // NOTE: formatted like rectangle on purpose, so you can see how the texture should look + // NOTE: Packing is 4 per RGBA, so only 2 of the 4 channels is used + // NOTE: 3x3 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + ]), + [33] + ), expectedBitRatio: 1, expectedPixels: new Uint8Array( new Uint8Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so only 2 of the 4 channels is used // NOTE: 3x3 - 1,2,3,4, 5,6,7,8, 9,10,11,12, - 13,14,15,16, 17,18,19,20, 21,22,23,24, - 25,26, 27,28, 29,30,31,32, 33,0,0,0 - ]).buffer), - expectedDim: new Int32Array([33,1,1]), - expectedSize: new Int32Array([3,3]), // 3 * 3 = 9 * 4 = 34 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, + ]).buffer + ), + expectedDim: new Int32Array([33, 1, 1]), + expectedSize: new Int32Array([3, 3]), // 3 * 3 = 9 * 4 = 34 expectedType: gl.UNSIGNED_BYTE, expectedArgumentTextureCount: 1, expectedPixelStorei: false, @@ -986,27 +902,26 @@ test('Input(Array) with single precision length 33', () => { setupArgumentsTestSuite({ gpuSettings: { precision: 'single', - output: [5] + output: [5], }, - argument: input([ - // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used - // NOTE: 3x3 - 1,2,3,4, 5,6,7,8, 9,10,11,12, - 13,14,15,16, 17,18,19,20, 21,22,23,24, - 25,26,27,28, 29,30,31,32, 33 - ], [33]), + argument: input( + [ + // NOTE: formatted like rectangle on purpose, so you can see how the texture should look + // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used + // NOTE: 3x3 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + ], + [33] + ), expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1,2,3,4, 5,6,7,8, 9,10,11,12, - 13,14,15,16, 17,18,19,20, 21,22,23,24, - 25,26,27,28, 29,30,31,32, 33,0,0,0 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]), - expectedDim: new Int32Array([33,1,1]), - expectedSize: new Int32Array([3,3]), // 3 * 3 = 9 * 4 = 34 + expectedDim: new Int32Array([33, 1, 1]), + expectedSize: new Int32Array([3, 3]), // 3 * 3 = 9 * 4 = 34 expectedType: gl.FLOAT, expectedArgumentTextureCount: 1, expectedPixelStorei: false, @@ -1017,27 +932,26 @@ test('Input(Float32Array) with single precision length 33', () => { setupArgumentsTestSuite({ gpuSettings: { precision: 'single', - output: [5] + output: [5], }, - argument: input(new Float32Array([ - // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used - // NOTE: 3x3 - 1,2,3,4, 5,6,7,8, 9,10,11,12, - 13,14,15,16, 17,18,19,20, 21,22,23,24, - 25,26,27,28, 29,30,31,32, 33 - ]), [33]), + argument: input( + new Float32Array([ + // NOTE: formatted like rectangle on purpose, so you can see how the texture should look + // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used + // NOTE: 3x3 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + ]), + [33] + ), expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1,2,3,4, 5,6,7,8, 9,10,11,12, - 13,14,15,16, 17,18,19,20, 21,22,23,24, - 25,26,27,28, 29,30,31,32, 33,0,0,0 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]), - expectedDim: new Int32Array([33,1,1]), - expectedSize: new Int32Array([3,3]), // 3 * 3 = 9 * 4 = 34 + expectedDim: new Int32Array([33, 1, 1]), + expectedSize: new Int32Array([3, 3]), // 3 * 3 = 9 * 4 = 34 expectedType: gl.FLOAT, expectedArgumentTextureCount: 1, expectedPixelStorei: false, @@ -1048,28 +962,27 @@ test('Input(Uint16Array) with single precision length 33', () => { setupArgumentsTestSuite({ gpuSettings: { precision: 'single', - output: [5] + output: [5], }, - argument: input(new Uint16Array([ - // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used - // NOTE: 3x3 - 1,2,3,4, 5,6,7,8, 9,10,11,12, - 13,14,15,16, 17,18,19,20, 21,22,23,24, - 25,26,27,28, 29,30,31,32, 33 - ]), [33]), + argument: input( + new Uint16Array([ + // NOTE: formatted like rectangle on purpose, so you can see how the texture should look + // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used + // NOTE: 3x3 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + ]), + [33] + ), // upconverted from 2 expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1,2,3,4, 5,6,7,8, 9,10,11,12, - 13,14,15,16, 17,18,19,20, 21,22,23,24, - 25,26,27,28, 29,30,31,32, 33,0,0,0 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]), - expectedDim: new Int32Array([33,1,1]), - expectedSize: new Int32Array([3,3]), // 3 * 3 = 9 * 4 = 36 + expectedDim: new Int32Array([33, 1, 1]), + expectedSize: new Int32Array([3, 3]), // 3 * 3 = 9 * 4 = 36 expectedType: gl.FLOAT, expectedArgumentTextureCount: 1, expectedPixelStorei: false, @@ -1080,28 +993,27 @@ test('Input(Uint8Array) with single precision length 33', () => { setupArgumentsTestSuite({ gpuSettings: { precision: 'single', - output: [5] + output: [5], }, - argument: input(new Uint8Array([ - // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - // NOTE: Packing is 4 per RGBA (8 bit, but upconverted to float32), so only 4 of the 4 channels is used - // NOTE: 3x3 - 1,2,3,4, 5,6,7,8, 9,10,11,12, - 13,14,15,16, 17,18,19,20, 21,22,23,24, - 25,26,27,28, 29,30,31,32, 33 - ]), [33]), + argument: input( + new Uint8Array([ + // NOTE: formatted like rectangle on purpose, so you can see how the texture should look + // NOTE: Packing is 4 per RGBA (8 bit, but upconverted to float32), so only 4 of the 4 channels is used + // NOTE: 3x3 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + ]), + [33] + ), // upconverted to float32 expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA (8 bit, but upconverted to float32), so only 4 of the 4 channels is used // NOTE: 3x3 - 1,2,3,4, 5,6,7,8, 9,10,11,12, - 13,14,15,16, 17,18,19,20, 21,22,23,24, - 25,26,27,28, 29,30,31,32, 33,0,0,0 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]), - expectedDim: new Int32Array([33,1,1]), - expectedSize: new Int32Array([3,3]), // 3 * 3 = 9 * 4 = 36 + expectedDim: new Int32Array([33, 1, 1]), + expectedSize: new Int32Array([3, 3]), // 3 * 3 = 9 * 4 = 36 expectedType: gl.FLOAT, expectedArgumentTextureCount: 1, expectedPixelStorei: false, diff --git a/test/internal/backend/web-gl/kernel/setupConstants.js b/test/internal/backend/web-gl/kernel/setupConstants.js index eb575b3f..3e0e4f19 100644 --- a/test/internal/backend/web-gl/kernel/setupConstants.js +++ b/test/internal/backend/web-gl/kernel/setupConstants.js @@ -17,17 +17,7 @@ const gl = { UNPACK_FLIP_Y_WEBGL: 'UNPACK_FLIP_Y_WEBGL', }; function setupConstantsTestSuite(testSuiteSettings) { - const { - gpuSettings, - constant, - expectedPixels, - expectedBitRatio, - expectedDim, - expectedSize, - expectedType, - expectedConstantTextureCount, - expectedPixelStorei, - } = testSuiteSettings; + const { gpuSettings, constant, expectedPixels, expectedBitRatio, expectedDim, expectedSize, expectedType, expectedConstantTextureCount, expectedPixelStorei } = testSuiteSettings; let texImage2DCalled = false; let activeTextureCalled = false; let bindTextureCalled = false; @@ -36,92 +26,95 @@ function setupConstantsTestSuite(testSuiteSettings) { let uniform3ivCalled = false; let uniform2ivCalled = false; let uniform1iCalled = false; - const mockContext = Object.assign({ - activeTexture: (index) => { - assert.equal(index, 0); - activeTextureCalled = true; - }, - bindTexture: (target, texture) => { - assert.equal(target, 'TEXTURE_2D'); - assert.equal(texture, 'TEXTURE'); - bindTextureCalled = true; - }, - texParameteri: (target, pname, param) => { - switch (texParameteriCalls) { - case 0: - assert.equal(target, 'TEXTURE_2D'); - assert.equal(pname, 'TEXTURE_WRAP_S'); - assert.equal(param, 'CLAMP_TO_EDGE'); - texParameteriCalls++; - break; - case 1: - assert.equal(target, 'TEXTURE_2D'); - assert.equal(pname, 'TEXTURE_WRAP_T'); - assert.equal(param, 'CLAMP_TO_EDGE'); - texParameteriCalls++; - break; - case 2: - assert.equal(target, 'TEXTURE_2D'); - assert.equal(pname, 'TEXTURE_MIN_FILTER'); - assert.equal(param, 'NEAREST'); - texParameteriCalls++; - break; - case 3: - assert.equal(target, 'TEXTURE_2D'); - assert.equal(pname, 'TEXTURE_MAG_FILTER'); - assert.equal(param, 'NEAREST'); - texParameteriCalls++; - break; - default: + const mockContext = Object.assign( + { + activeTexture: index => { + assert.equal(index, 0); + activeTextureCalled = true; + }, + bindTexture: (target, texture) => { + assert.equal(target, 'TEXTURE_2D'); + assert.equal(texture, 'TEXTURE'); + bindTextureCalled = true; + }, + texParameteri: (target, pname, param) => { + switch (texParameteriCalls) { + case 0: + assert.equal(target, 'TEXTURE_2D'); + assert.equal(pname, 'TEXTURE_WRAP_S'); + assert.equal(param, 'CLAMP_TO_EDGE'); + texParameteriCalls++; + break; + case 1: + assert.equal(target, 'TEXTURE_2D'); + assert.equal(pname, 'TEXTURE_WRAP_T'); + assert.equal(param, 'CLAMP_TO_EDGE'); + texParameteriCalls++; + break; + case 2: + assert.equal(target, 'TEXTURE_2D'); + assert.equal(pname, 'TEXTURE_MIN_FILTER'); + assert.equal(param, 'NEAREST'); + texParameteriCalls++; + break; + case 3: + assert.equal(target, 'TEXTURE_2D'); + assert.equal(pname, 'TEXTURE_MAG_FILTER'); + assert.equal(param, 'NEAREST'); + texParameteriCalls++; + break; + default: + throw new Error('called too many times'); + } + }, + pixelStorei: (pname, param) => { + assert.equal(pname, 'UNPACK_FLIP_Y_WEBGL'); + assert.equal(param, expectedPixelStorei); + }, + createTexture: () => 'TEXTURE', + getUniformLocation: (program, name) => { + assert.equal(program, 'program'); + if (getUniformLocationCalls > 3) { throw new Error('called too many times'); - } - }, - pixelStorei: (pname, param) => { - assert.equal(pname, 'UNPACK_FLIP_Y_WEBGL'); - assert.equal(param, expectedPixelStorei); - }, - createTexture: () => 'TEXTURE', - getUniformLocation: (program, name) => { - assert.equal(program, 'program'); - if (getUniformLocationCalls > 3) { - throw new Error('called too many times'); - } - getUniformLocationCalls++; - return { - constants_vDim: 'constants_vDimLocation', - constants_vSize: 'constants_vSizeLocation', - constants_v: 'constants_vLocation', - }[name]; - }, - uniform3iv: (location, value) => { - assert.equal(location, 'constants_vDimLocation'); - assert.deepEqual(value, expectedDim); - uniform3ivCalled = true; - }, - uniform2iv: (location, value) => { - assert.equal(location, 'constants_vSizeLocation'); - assert.deepEqual(value, expectedSize); - uniform2ivCalled = true; - }, - uniform1i: (location, value) => { - assert.equal(location, 'constants_vLocation'); - assert.equal(value, 0); - uniform1iCalled = true; - }, - texImage2D: (target, level, internalFormat, width, height, border, format, type, pixels) => { - assert.equal(target, gl.TEXTURE_2D); - assert.equal(level, 0); - assert.equal(internalFormat, gl.RGBA); - assert.equal(width, expectedSize[0]); - assert.equal(height, expectedSize[1]); - assert.equal(border, 0); - assert.equal(format, gl.RGBA); - assert.equal(type, expectedType); - assert.equal(pixels.length, expectedPixels.length); - assert.deepEqual(pixels, expectedPixels); - texImage2DCalled = true; - } - }, gl); + } + getUniformLocationCalls++; + return { + constants_vDim: 'constants_vDimLocation', + constants_vSize: 'constants_vSizeLocation', + constants_v: 'constants_vLocation', + }[name]; + }, + uniform3iv: (location, value) => { + assert.equal(location, 'constants_vDimLocation'); + assert.deepEqual(value, expectedDim); + uniform3ivCalled = true; + }, + uniform2iv: (location, value) => { + assert.equal(location, 'constants_vSizeLocation'); + assert.deepEqual(value, expectedSize); + uniform2ivCalled = true; + }, + uniform1i: (location, value) => { + assert.equal(location, 'constants_vLocation'); + assert.equal(value, 0); + uniform1iCalled = true; + }, + texImage2D: (target, level, internalFormat, width, height, border, format, type, pixels) => { + assert.equal(target, gl.TEXTURE_2D); + assert.equal(level, 0); + assert.equal(internalFormat, gl.RGBA); + assert.equal(width, expectedSize[0]); + assert.equal(height, expectedSize[1]); + assert.equal(border, 0); + assert.equal(format, gl.RGBA); + assert.equal(type, expectedType); + assert.equal(pixels.length, expectedPixels.length); + assert.deepEqual(pixels, expectedPixels); + texImage2DCalled = true; + }, + }, + gl + ); const source = `function(v) { return this.constants.v[this.thread.x]; }`; const settings = { context: mockContext, @@ -130,8 +123,8 @@ function setupConstantsTestSuite(testSuiteSettings) { kernel.constructor = { lookupKernelValueType: WebGLKernel.lookupKernelValueType, features: { - maxTextureSize: 9999 - } + maxTextureSize: 9999, + }, }; kernel.program = 'program'; assert.equal(kernel.constantTextureCount, 0); @@ -157,21 +150,21 @@ test('Array with unsigned precision 5 length', () => { setupConstantsTestSuite({ gpuSettings: { precision: 'unsigned', - output: [4] + output: [4], }, constant: [ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, - 5 + 1, 2, 3, 4, 5, ], expectedBitRatio: 4, - expectedPixels: new Uint8Array(new Float32Array([ - // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5,0,0,0 - ]).buffer), - expectedDim: new Int32Array([5,1,1]), - expectedSize: new Int32Array([4,2]), // 4 * 2 = 8 + expectedPixels: new Uint8Array( + new Float32Array([ + // NOTE: formatted like rectangle on purpose, so you can see how the texture should look + 1, 2, 3, 4, 5, 0, 0, 0, + ]).buffer + ), + expectedDim: new Int32Array([5, 1, 1]), + expectedSize: new Int32Array([4, 2]), // 4 * 2 = 8 expectedType: gl.UNSIGNED_BYTE, expectedConstantTextureCount: 1, expectedPixelStorei: false, @@ -181,23 +174,21 @@ test('Float32Array with unsigned precision 5 length', () => { setupConstantsTestSuite({ gpuSettings: { precision: 'unsigned', - output: [4] + output: [4], }, constant: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, - 5 + 1, 2, 3, 4, 5, ]), expectedBitRatio: 4, expectedPixels: new Uint8Array( new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5,0,0,0 + 1, 2, 3, 4, 5, 0, 0, 0, ]).buffer ), - expectedDim: new Int32Array([5,1,1]), - expectedSize: new Int32Array([4,2]), // 4 * 2 * 1 = 8 + expectedDim: new Int32Array([5, 1, 1]), + expectedSize: new Int32Array([4, 2]), // 4 * 2 * 1 = 8 expectedType: gl.UNSIGNED_BYTE, expectedConstantTextureCount: 1, expectedPixelStorei: false, @@ -207,23 +198,21 @@ test('Uint16Array with unsigned precision 5 length', () => { setupConstantsTestSuite({ gpuSettings: { precision: 'unsigned', - output: [4] + output: [4], }, constant: new Uint16Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, - 5 + 1, 2, 3, 4, 5, ]), expectedBitRatio: 2, expectedPixels: new Uint8Array( new Uint16Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5,0,0,0 + 1, 2, 3, 4, 5, 0, 0, 0, ]).buffer ), - expectedDim: new Int32Array([5,1,1]), - expectedSize: new Int32Array([2,2]), // 2 * 2 * 2 = 8 + expectedDim: new Int32Array([5, 1, 1]), + expectedSize: new Int32Array([2, 2]), // 2 * 2 * 2 = 8 expectedType: gl.UNSIGNED_BYTE, expectedConstantTextureCount: 1, expectedPixelStorei: false, @@ -233,20 +222,16 @@ test('Uint8Array with unsigned precision 5 length', () => { setupConstantsTestSuite({ gpuSettings: { precision: 'unsigned', - output: [5] + output: [5], }, - constant: new Uint8Array([ - 1, 2, 3, 4, - 5 - ]), + constant: new Uint8Array([1, 2, 3, 4, 5]), expectedBitRatio: 1, expectedPixels: new Uint8Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5,0,0,0 + 1, 2, 3, 4, 5, 0, 0, 0, ]), - expectedDim: new Int32Array([5,1,1]), - expectedSize: new Int32Array([1,2]), // 1 * 2 * 4 = 8 + expectedDim: new Int32Array([5, 1, 1]), + expectedSize: new Int32Array([1, 2]), // 1 * 2 * 4 = 8 expectedType: gl.UNSIGNED_BYTE, expectedConstantTextureCount: 1, expectedPixelStorei: false, @@ -257,21 +242,19 @@ test('Array with single precision', () => { setupConstantsTestSuite({ gpuSettings: { precision: 'single', - output: [4] + output: [4], }, constant: [ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5 + 1, 2, 3, 4, 5, ], expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5,0,0,0 + 1, 2, 3, 4, 5, 0, 0, 0, ]), - expectedDim: new Int32Array([5,1,1]), - expectedSize: new Int32Array([1,2]), + expectedDim: new Int32Array([5, 1, 1]), + expectedSize: new Int32Array([1, 2]), expectedType: gl.FLOAT, expectedTextureWidth: 1, expectedTextureHeight: 2, @@ -283,21 +266,19 @@ test('Float32Array with single precision', () => { setupConstantsTestSuite({ gpuSettings: { precision: 'single', - output: [4] + output: [4], }, constant: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5 + 1, 2, 3, 4, 5, ]), expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5,0,0,0 + 1, 2, 3, 4, 5, 0, 0, 0, ]), - expectedDim: new Int32Array([5,1,1]), - expectedSize: new Int32Array([1,2]), + expectedDim: new Int32Array([5, 1, 1]), + expectedSize: new Int32Array([1, 2]), expectedType: gl.FLOAT, expectedTextureWidth: 1, expectedTextureHeight: 2, @@ -309,22 +290,20 @@ test('Uint16Array with single precision', () => { setupConstantsTestSuite({ gpuSettings: { precision: 'single', - output: [4] + output: [4], }, constant: new Uint16Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5 + 1, 2, 3, 4, 5, ]), // upconverted from 2 expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5,0,0,0 + 1, 2, 3, 4, 5, 0, 0, 0, ]), - expectedDim: new Int32Array([5,1,1]), - expectedSize: new Int32Array([1,2]), + expectedDim: new Int32Array([5, 1, 1]), + expectedSize: new Int32Array([1, 2]), expectedType: gl.FLOAT, expectedConstantTextureCount: 1, expectedPixelStorei: false, @@ -334,22 +313,20 @@ test('Uint8Array with single precision', () => { setupConstantsTestSuite({ gpuSettings: { precision: 'single', - output: [4] + output: [4], }, constant: new Uint8Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5 + 1, 2, 3, 4, 5, ]), // upconverted from 1 expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5,0,0,0 + 1, 2, 3, 4, 5, 0, 0, 0, ]), - expectedDim: new Int32Array([5,1,1]), - expectedSize: new Int32Array([1,2]), + expectedDim: new Int32Array([5, 1, 1]), + expectedSize: new Int32Array([1, 2]), expectedType: gl.FLOAT, expectedConstantTextureCount: 1, expectedPixelStorei: false, @@ -360,18 +337,13 @@ test('Array with unsigned precision length 33', () => { setupConstantsTestSuite({ gpuSettings: { precision: 'unsigned', - output: [5] + output: [5], }, constant: [ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 1 per RGBA, so only 1 of the 4 channels is used // NOTE: 6x6 - 1, 2, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, - 31, 32, 33 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ], expectedBitRatio: 4, expectedPixels: new Uint8Array( @@ -379,16 +351,11 @@ test('Array with unsigned precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 1 per RGBA, so only 1 of the 4 channels is used // NOTE: 6x6 - 1, 2, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, - 31, 32, 33, 0, 0, 0 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]).buffer ), - expectedDim: new Int32Array([33,1,1]), - expectedSize: new Int32Array([6,6]), // 3 * 3 = 9 * 4 = 34 + expectedDim: new Int32Array([33, 1, 1]), + expectedSize: new Int32Array([6, 6]), // 3 * 3 = 9 * 4 = 34 expectedType: gl.UNSIGNED_BYTE, expectedConstantTextureCount: 1, expectedPixelStorei: false, @@ -399,18 +366,13 @@ test('Float32Array with unsigned precision length 33', () => { setupConstantsTestSuite({ gpuSettings: { precision: 'unsigned', - output: [5] + output: [5], }, constant: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 1 per RGBA, so only 1 of the 4 channels is used // NOTE: 6x6 - 1, 2, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, - 31, 32, 33 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ]), expectedBitRatio: 4, expectedPixels: new Uint8Array( @@ -418,16 +380,11 @@ test('Float32Array with unsigned precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 1 per RGBA, so only 1 of the 4 channels is used // NOTE: 6x6 - 1, 2, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, - 31, 32, 33, 0, 0, 0, + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]).buffer ), - expectedDim: new Int32Array([33,1,1]), - expectedSize: new Int32Array([6,6]), // 3 * 3 = 9 * 4 = 34 + expectedDim: new Int32Array([33, 1, 1]), + expectedSize: new Int32Array([6, 6]), // 3 * 3 = 9 * 4 = 34 expectedType: gl.UNSIGNED_BYTE, expectedConstantTextureCount: 1, expectedPixelStorei: false, @@ -438,17 +395,13 @@ test('Uint16Array with unsigned precision length 33', () => { setupConstantsTestSuite({ gpuSettings: { precision: 'unsigned', - output: [5] + output: [5], }, constant: new Uint16Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 2 per RGBA, so only 2 of the 4 channels is used // NOTE: 4x5 - 1,2, 3,4, 5,6, 7,8, - 9,10, 11,12, 13,14, 15,16, - 17,18, 19,20, 21,22, 23,24, - 25,26, 27,28, 29,30, 31,32, - 33, + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ]), expectedBitRatio: 2, expectedPixels: new Uint8Array( @@ -456,15 +409,11 @@ test('Uint16Array with unsigned precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 2 per RGBA, so only 2 of the 4 channels is used // NOTE: 4x5 - 1,2, 3,4, 5,6, 7,8, - 9,10, 11,12, 13,14, 15,16, - 17,18, 19,20, 21,22, 23,24, - 25,26, 27,28, 29,30, 31,32, - 33,0, 0,0, 0,0, 0,0 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, 0, 0, 0, 0, ]).buffer ), - expectedDim: new Int32Array([33,1,1]), - expectedSize: new Int32Array([4,5]), // 3 * 3 = 9 * 4 = 34 + expectedDim: new Int32Array([33, 1, 1]), + expectedSize: new Int32Array([4, 5]), // 3 * 3 = 9 * 4 = 34 expectedType: gl.UNSIGNED_BYTE, expectedConstantTextureCount: 1, expectedPixelStorei: false, @@ -475,28 +424,25 @@ test('Uint8Array with unsigned precision length 33', () => { setupConstantsTestSuite({ gpuSettings: { precision: 'unsigned', - output: [5] + output: [5], }, constant: new Uint8Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so only 2 of the 4 channels is used // NOTE: 3x3 - 1,2,3,4, 5,6,7,8, 9,10,11,12, - 13,14,15,16, 17,18,19,20, 21,22,23,24, - 25,26, 27,28, 29,30,31,32, 33 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ]), expectedBitRatio: 1, expectedPixels: new Uint8Array( new Uint8Array([ - // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - // NOTE: Packing is 4 per RGBA, so only 2 of the 4 channels is used - // NOTE: 3x3 - 1,2,3,4, 5,6,7,8, 9,10,11,12, - 13,14,15,16, 17,18,19,20, 21,22,23,24, - 25,26, 27,28, 29,30,31,32, 33,0,0,0 - ]).buffer), - expectedDim: new Int32Array([33,1,1]), - expectedSize: new Int32Array([3,3]), // 3 * 3 = 9 * 4 = 34 + // NOTE: formatted like rectangle on purpose, so you can see how the texture should look + // NOTE: Packing is 4 per RGBA, so only 2 of the 4 channels is used + // NOTE: 3x3 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, + ]).buffer + ), + expectedDim: new Int32Array([33, 1, 1]), + expectedSize: new Int32Array([3, 3]), // 3 * 3 = 9 * 4 = 34 expectedType: gl.UNSIGNED_BYTE, expectedConstantTextureCount: 1, expectedPixelStorei: false, @@ -507,27 +453,23 @@ test('Array with single precision length 33', () => { setupConstantsTestSuite({ gpuSettings: { precision: 'single', - output: [5] + output: [5], }, constant: [ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1,2,3,4, 5,6,7,8, 9,10,11,12, - 13,14,15,16, 17,18,19,20, 21,22,23,24, - 25,26,27,28, 29,30,31,32, 33 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ], expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1,2,3,4, 5,6,7,8, 9,10,11,12, - 13,14,15,16, 17,18,19,20, 21,22,23,24, - 25,26,27,28, 29,30,31,32, 33,0,0,0 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]), - expectedDim: new Int32Array([33,1,1]), - expectedSize: new Int32Array([3,3]), // 3 * 3 = 9 * 4 = 34 + expectedDim: new Int32Array([33, 1, 1]), + expectedSize: new Int32Array([3, 3]), // 3 * 3 = 9 * 4 = 34 expectedType: gl.FLOAT, expectedConstantTextureCount: 1, expectedPixelStorei: false, @@ -538,27 +480,23 @@ test('Float32Array with single precision length 33', () => { setupConstantsTestSuite({ gpuSettings: { precision: 'single', - output: [5] + output: [5], }, constant: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1,2,3,4, 5,6,7,8, 9,10,11,12, - 13,14,15,16, 17,18,19,20, 21,22,23,24, - 25,26,27,28, 29,30,31,32, 33 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ]), expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1,2,3,4, 5,6,7,8, 9,10,11,12, - 13,14,15,16, 17,18,19,20, 21,22,23,24, - 25,26,27,28, 29,30,31,32, 33,0,0,0 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]), - expectedDim: new Int32Array([33,1,1]), - expectedSize: new Int32Array([3,3]), // 3 * 3 = 9 * 4 = 34 + expectedDim: new Int32Array([33, 1, 1]), + expectedSize: new Int32Array([3, 3]), // 3 * 3 = 9 * 4 = 34 expectedType: gl.FLOAT, expectedConstantTextureCount: 1, expectedPixelStorei: false, @@ -569,15 +507,13 @@ test('Uint16Array with single precision length 33', () => { setupConstantsTestSuite({ gpuSettings: { precision: 'single', - output: [5] + output: [5], }, constant: new Uint16Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1,2,3,4, 5,6,7,8, 9,10,11,12, - 13,14,15,16, 17,18,19,20, 21,22,23,24, - 25,26,27,28, 29,30,31,32, 33 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ]), // upconverted from 2 expectedBitRatio: 4, @@ -585,12 +521,10 @@ test('Uint16Array with single precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1,2,3,4, 5,6,7,8, 9,10,11,12, - 13,14,15,16, 17,18,19,20, 21,22,23,24, - 25,26,27,28, 29,30,31,32, 33,0,0,0 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]), - expectedDim: new Int32Array([33,1,1]), - expectedSize: new Int32Array([3,3]), // 3 * 3 = 9 * 4 = 36 + expectedDim: new Int32Array([33, 1, 1]), + expectedSize: new Int32Array([3, 3]), // 3 * 3 = 9 * 4 = 36 expectedType: gl.FLOAT, expectedConstantTextureCount: 1, expectedPixelStorei: false, @@ -601,15 +535,13 @@ test('Uint8Array with single precision length 33', () => { setupConstantsTestSuite({ gpuSettings: { precision: 'single', - output: [5] + output: [5], }, constant: new Uint8Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1,2,3,4, 5,6,7,8, 9,10,11,12, - 13,14,15,16, 17,18,19,20, 21,22,23,24, - 25,26,27,28, 29,30,31,32, 33 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ]), // upconverted from 1 expectedBitRatio: 4, @@ -617,12 +549,10 @@ test('Uint8Array with single precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1,2,3,4, 5,6,7,8, 9,10,11,12, - 13,14,15,16, 17,18,19,20, 21,22,23,24, - 25,26,27,28, 29,30,31,32, 33,0,0,0 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]), - expectedDim: new Int32Array([33,1,1]), - expectedSize: new Int32Array([3,3]), // 3 * 3 = 9 * 4 = 36 + expectedDim: new Int32Array([33, 1, 1]), + expectedSize: new Int32Array([3, 3]), // 3 * 3 = 9 * 4 = 36 expectedType: gl.FLOAT, expectedConstantTextureCount: 1, expectedPixelStorei: false, @@ -635,21 +565,24 @@ test('Input(Array) with unsigned precision 5 length', () => { setupConstantsTestSuite({ gpuSettings: { precision: 'unsigned', - output: [4] + output: [4], }, - constant: input([ - // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, - 5, 0 - ], [2,3]), + constant: input( + [ + // NOTE: formatted like rectangle on purpose, so you can see how the texture should look + 1, 2, 3, 4, 5, 0, + ], + [2, 3] + ), expectedBitRatio: 4, - expectedPixels: new Uint8Array(new Float32Array([ - // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5,0,0,0 - ]).buffer), - expectedDim: new Int32Array([2,3,1]), - expectedSize: new Int32Array([4,2]), // 4 * 2 = 8 + expectedPixels: new Uint8Array( + new Float32Array([ + // NOTE: formatted like rectangle on purpose, so you can see how the texture should look + 1, 2, 3, 4, 5, 0, 0, 0, + ]).buffer + ), + expectedDim: new Int32Array([2, 3, 1]), + expectedSize: new Int32Array([4, 2]), // 4 * 2 = 8 expectedType: gl.UNSIGNED_BYTE, expectedConstantTextureCount: 1, expectedPixelStorei: false, @@ -659,23 +592,24 @@ test('Input(Float32Array) with unsigned precision 5 length', () => { setupConstantsTestSuite({ gpuSettings: { precision: 'unsigned', - output: [4] + output: [4], }, - constant: input(new Float32Array([ - // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, - 5 - ]), [5]), + constant: input( + new Float32Array([ + // NOTE: formatted like rectangle on purpose, so you can see how the texture should look + 1, 2, 3, 4, 5, + ]), + [5] + ), expectedBitRatio: 4, expectedPixels: new Uint8Array( new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5,0,0,0 + 1, 2, 3, 4, 5, 0, 0, 0, ]).buffer ), - expectedDim: new Int32Array([5,1,1]), - expectedSize: new Int32Array([4,2]), // 4 * 2 * 1 = 8 + expectedDim: new Int32Array([5, 1, 1]), + expectedSize: new Int32Array([4, 2]), // 4 * 2 * 1 = 8 expectedType: gl.UNSIGNED_BYTE, expectedConstantTextureCount: 1, expectedPixelStorei: false, @@ -685,23 +619,24 @@ test('Input(Uint16Array) with unsigned precision 5 length', () => { setupConstantsTestSuite({ gpuSettings: { precision: 'unsigned', - output: [4] + output: [4], }, - constant: input(new Uint16Array([ - // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, - 5, 0, - ]), [2,3]), + constant: input( + new Uint16Array([ + // NOTE: formatted like rectangle on purpose, so you can see how the texture should look + 1, 2, 3, 4, 5, 0, + ]), + [2, 3] + ), expectedBitRatio: 2, expectedPixels: new Uint8Array( new Uint16Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5,0,0,0 + 1, 2, 3, 4, 5, 0, 0, 0, ]).buffer ), - expectedDim: new Int32Array([2,3,1]), - expectedSize: new Int32Array([2,2]), // 2 * 2 * 2 = 8 + expectedDim: new Int32Array([2, 3, 1]), + expectedSize: new Int32Array([2, 2]), // 2 * 2 * 2 = 8 expectedType: gl.UNSIGNED_BYTE, expectedConstantTextureCount: 1, expectedPixelStorei: false, @@ -711,20 +646,16 @@ test('Input(Uint8Array) with unsigned precision 5 length', () => { setupConstantsTestSuite({ gpuSettings: { precision: 'unsigned', - output: [5] + output: [5], }, - constant: input(new Uint8Array([ - 1, 2, 3, 4, - 5,0 - ]),[2, 3]), + constant: input(new Uint8Array([1, 2, 3, 4, 5, 0]), [2, 3]), expectedBitRatio: 1, expectedPixels: new Uint8Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5,0,0,0 + 1, 2, 3, 4, 5, 0, 0, 0, ]), - expectedDim: new Int32Array([2,3,1]), - expectedSize: new Int32Array([1,2]), // 1 * 2 * 4 = 8 + expectedDim: new Int32Array([2, 3, 1]), + expectedSize: new Int32Array([1, 2]), // 1 * 2 * 4 = 8 expectedType: gl.UNSIGNED_BYTE, expectedConstantTextureCount: 1, expectedPixelStorei: false, @@ -735,21 +666,22 @@ test('Input(Array) with single precision', () => { setupConstantsTestSuite({ gpuSettings: { precision: 'single', - output: [4] + output: [4], }, - constant: input([ - // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5,0 - ], [2,3]), + constant: input( + [ + // NOTE: formatted like rectangle on purpose, so you can see how the texture should look + 1, 2, 3, 4, 5, 0, + ], + [2, 3] + ), expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5,0,0,0 + 1, 2, 3, 4, 5, 0, 0, 0, ]), - expectedDim: new Int32Array([2,3,1]), - expectedSize: new Int32Array([1,2]), + expectedDim: new Int32Array([2, 3, 1]), + expectedSize: new Int32Array([1, 2]), expectedType: gl.FLOAT, expectedTextureWidth: 1, expectedTextureHeight: 2, @@ -761,21 +693,22 @@ test('Input(Float32Array) with single precision', () => { setupConstantsTestSuite({ gpuSettings: { precision: 'single', - output: [4] + output: [4], }, - constant: input(new Float32Array([ - // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5,0 - ]),[2,3]), + constant: input( + new Float32Array([ + // NOTE: formatted like rectangle on purpose, so you can see how the texture should look + 1, 2, 3, 4, 5, 0, + ]), + [2, 3] + ), expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5,0,0,0 + 1, 2, 3, 4, 5, 0, 0, 0, ]), - expectedDim: new Int32Array([2,3,1]), - expectedSize: new Int32Array([1,2]), + expectedDim: new Int32Array([2, 3, 1]), + expectedSize: new Int32Array([1, 2]), expectedType: gl.FLOAT, expectedTextureWidth: 1, expectedTextureHeight: 2, @@ -787,22 +720,23 @@ test('Input(Uint16Array) with single precision', () => { setupConstantsTestSuite({ gpuSettings: { precision: 'single', - output: [4] + output: [4], }, - constant: input(new Uint16Array([ - // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5,0 - ]), [2,3]), + constant: input( + new Uint16Array([ + // NOTE: formatted like rectangle on purpose, so you can see how the texture should look + 1, 2, 3, 4, 5, 0, + ]), + [2, 3] + ), // upconverted from 2 expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5,0,0,0 + 1, 2, 3, 4, 5, 0, 0, 0, ]), - expectedDim: new Int32Array([2,3,1]), - expectedSize: new Int32Array([1,2]), + expectedDim: new Int32Array([2, 3, 1]), + expectedSize: new Int32Array([1, 2]), expectedType: gl.FLOAT, expectedConstantTextureCount: 1, expectedPixelStorei: false, @@ -812,22 +746,23 @@ test('Input(Uint8Array) with single precision', () => { setupConstantsTestSuite({ gpuSettings: { precision: 'single', - output: [4] + output: [4], }, - constant: input(new Uint8Array([ - // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5,0 - ]), [2,3]), + constant: input( + new Uint8Array([ + // NOTE: formatted like rectangle on purpose, so you can see how the texture should look + 1, 2, 3, 4, 5, 0, + ]), + [2, 3] + ), // upconverted from 1 expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5,0,0,0 + 1, 2, 3, 4, 5, 0, 0, 0, ]), - expectedDim: new Int32Array([2,3,1]), - expectedSize: new Int32Array([1,2]), + expectedDim: new Int32Array([2, 3, 1]), + expectedSize: new Int32Array([1, 2]), expectedType: gl.FLOAT, expectedConstantTextureCount: 1, expectedPixelStorei: false, @@ -838,35 +773,28 @@ test('Input(Array) with unsigned precision length 33', () => { setupConstantsTestSuite({ gpuSettings: { precision: 'unsigned', - output: [5] + output: [5], }, - constant: input([ - // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - // NOTE: Packing is 1 per RGBA, so only 1 of the 4 channels is used - // NOTE: 6x6 - 1, 2, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, - 31, 32, 33 - ], [33]), + constant: input( + [ + // NOTE: formatted like rectangle on purpose, so you can see how the texture should look + // NOTE: Packing is 1 per RGBA, so only 1 of the 4 channels is used + // NOTE: 6x6 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + ], + [33] + ), expectedBitRatio: 4, expectedPixels: new Uint8Array( new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 1 per RGBA, so only 1 of the 4 channels is used // NOTE: 6x6 - 1, 2, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, - 31, 32, 33, 0, 0, 0 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]).buffer ), - expectedDim: new Int32Array([33,1,1]), - expectedSize: new Int32Array([6,6]), // 3 * 3 = 9 * 4 = 34 + expectedDim: new Int32Array([33, 1, 1]), + expectedSize: new Int32Array([6, 6]), // 3 * 3 = 9 * 4 = 34 expectedType: gl.UNSIGNED_BYTE, expectedConstantTextureCount: 1, expectedPixelStorei: false, @@ -877,35 +805,28 @@ test('Input(Float32Array) with unsigned precision length 33', () => { setupConstantsTestSuite({ gpuSettings: { precision: 'unsigned', - output: [5] + output: [5], }, - constant: input(new Float32Array([ - // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - // NOTE: Packing is 1 per RGBA, so only 1 of the 4 channels is used - // NOTE: 6x6 - 1, 2, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, - 31, 32, 33 - ]), [33]), + constant: input( + new Float32Array([ + // NOTE: formatted like rectangle on purpose, so you can see how the texture should look + // NOTE: Packing is 1 per RGBA, so only 1 of the 4 channels is used + // NOTE: 6x6 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + ]), + [33] + ), expectedBitRatio: 4, expectedPixels: new Uint8Array( new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 1 per RGBA, so only 1 of the 4 channels is used // NOTE: 6x6 - 1, 2, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, - 31, 32, 33, 0, 0, 0, + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]).buffer ), - expectedDim: new Int32Array([33,1,1]), - expectedSize: new Int32Array([6,6]), // 3 * 3 = 9 * 4 = 34 + expectedDim: new Int32Array([33, 1, 1]), + expectedSize: new Int32Array([6, 6]), // 3 * 3 = 9 * 4 = 34 expectedType: gl.UNSIGNED_BYTE, expectedConstantTextureCount: 1, expectedPixelStorei: false, @@ -916,33 +837,28 @@ test('Input(Uint16Array) with unsigned precision length 33', () => { setupConstantsTestSuite({ gpuSettings: { precision: 'unsigned', - output: [5] + output: [5], }, - constant: input(new Uint16Array([ - // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - // NOTE: Packing is 2 per RGBA, so only 2 of the 4 channels is used - // NOTE: 4x5 - 1,2, 3,4, 5,6, 7,8, - 9,10, 11,12, 13,14, 15,16, - 17,18, 19,20, 21,22, 23,24, - 25,26, 27,28, 29,30, 31,32, - 33, - ]), [33]), + constant: input( + new Uint16Array([ + // NOTE: formatted like rectangle on purpose, so you can see how the texture should look + // NOTE: Packing is 2 per RGBA, so only 2 of the 4 channels is used + // NOTE: 4x5 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + ]), + [33] + ), expectedBitRatio: 2, expectedPixels: new Uint8Array( new Uint16Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 2 per RGBA, so only 2 of the 4 channels is used // NOTE: 4x5 - 1,2, 3,4, 5,6, 7,8, - 9,10, 11,12, 13,14, 15,16, - 17,18, 19,20, 21,22, 23,24, - 25,26, 27,28, 29,30, 31,32, - 33,0, 0,0, 0,0, 0,0 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, 0, 0, 0, 0, ]).buffer ), - expectedDim: new Int32Array([33,1,1]), - expectedSize: new Int32Array([4,5]), // 3 * 3 = 9 * 4 = 34 + expectedDim: new Int32Array([33, 1, 1]), + expectedSize: new Int32Array([4, 5]), // 3 * 3 = 9 * 4 = 34 expectedType: gl.UNSIGNED_BYTE, expectedConstantTextureCount: 1, expectedPixelStorei: false, @@ -953,28 +869,28 @@ test('Input(Uint8Array) with unsigned precision length 33', () => { setupConstantsTestSuite({ gpuSettings: { precision: 'unsigned', - output: [5] + output: [5], }, - constant: input(new Uint8Array([ - // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - // NOTE: Packing is 4 per RGBA, so only 2 of the 4 channels is used - // NOTE: 3x3 - 1,2,3,4, 5,6,7,8, 9,10,11,12, - 13,14,15,16, 17,18,19,20, 21,22,23,24, - 25,26, 27,28, 29,30,31,32, 33 - ]), [33]), + constant: input( + new Uint8Array([ + // NOTE: formatted like rectangle on purpose, so you can see how the texture should look + // NOTE: Packing is 4 per RGBA, so only 2 of the 4 channels is used + // NOTE: 3x3 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + ]), + [33] + ), expectedBitRatio: 1, expectedPixels: new Uint8Array( new Uint8Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so only 2 of the 4 channels is used // NOTE: 3x3 - 1,2,3,4, 5,6,7,8, 9,10,11,12, - 13,14,15,16, 17,18,19,20, 21,22,23,24, - 25,26, 27,28, 29,30,31,32, 33,0,0,0 - ]).buffer), - expectedDim: new Int32Array([33,1,1]), - expectedSize: new Int32Array([3,3]), // 3 * 3 = 9 * 4 = 34 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, + ]).buffer + ), + expectedDim: new Int32Array([33, 1, 1]), + expectedSize: new Int32Array([3, 3]), // 3 * 3 = 9 * 4 = 34 expectedType: gl.UNSIGNED_BYTE, expectedConstantTextureCount: 1, expectedPixelStorei: false, @@ -985,27 +901,26 @@ test('Input(Array) with single precision length 33', () => { setupConstantsTestSuite({ gpuSettings: { precision: 'single', - output: [5] + output: [5], }, - constant: input([ - // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used - // NOTE: 3x3 - 1,2,3,4, 5,6,7,8, 9,10,11,12, - 13,14,15,16, 17,18,19,20, 21,22,23,24, - 25,26,27,28, 29,30,31,32, 33 - ], [33]), + constant: input( + [ + // NOTE: formatted like rectangle on purpose, so you can see how the texture should look + // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used + // NOTE: 3x3 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + ], + [33] + ), expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1,2,3,4, 5,6,7,8, 9,10,11,12, - 13,14,15,16, 17,18,19,20, 21,22,23,24, - 25,26,27,28, 29,30,31,32, 33,0,0,0 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]), - expectedDim: new Int32Array([33,1,1]), - expectedSize: new Int32Array([3,3]), // 3 * 3 = 9 * 4 = 34 + expectedDim: new Int32Array([33, 1, 1]), + expectedSize: new Int32Array([3, 3]), // 3 * 3 = 9 * 4 = 34 expectedType: gl.FLOAT, expectedConstantTextureCount: 1, expectedPixelStorei: false, @@ -1016,27 +931,26 @@ test('Input(Float32Array) with single precision length 33', () => { setupConstantsTestSuite({ gpuSettings: { precision: 'single', - output: [5] + output: [5], }, - constant: input(new Float32Array([ - // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used - // NOTE: 3x3 - 1,2,3,4, 5,6,7,8, 9,10,11,12, - 13,14,15,16, 17,18,19,20, 21,22,23,24, - 25,26,27,28, 29,30,31,32, 33 - ]), [33]), + constant: input( + new Float32Array([ + // NOTE: formatted like rectangle on purpose, so you can see how the texture should look + // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used + // NOTE: 3x3 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + ]), + [33] + ), expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1,2,3,4, 5,6,7,8, 9,10,11,12, - 13,14,15,16, 17,18,19,20, 21,22,23,24, - 25,26,27,28, 29,30,31,32, 33,0,0,0 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]), - expectedDim: new Int32Array([33,1,1]), - expectedSize: new Int32Array([3,3]), // 3 * 3 = 9 * 4 = 34 + expectedDim: new Int32Array([33, 1, 1]), + expectedSize: new Int32Array([3, 3]), // 3 * 3 = 9 * 4 = 34 expectedType: gl.FLOAT, expectedConstantTextureCount: 1, expectedPixelStorei: false, @@ -1047,28 +961,27 @@ test('Input(Uint16Array) with single precision length 33', () => { setupConstantsTestSuite({ gpuSettings: { precision: 'single', - output: [5] + output: [5], }, - constant: input(new Uint16Array([ - // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used - // NOTE: 3x3 - 1,2,3,4, 5,6,7,8, 9,10,11,12, - 13,14,15,16, 17,18,19,20, 21,22,23,24, - 25,26,27,28, 29,30,31,32, 33 - ]), [33]), + constant: input( + new Uint16Array([ + // NOTE: formatted like rectangle on purpose, so you can see how the texture should look + // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used + // NOTE: 3x3 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + ]), + [33] + ), // upconverted from 2 expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1,2,3,4, 5,6,7,8, 9,10,11,12, - 13,14,15,16, 17,18,19,20, 21,22,23,24, - 25,26,27,28, 29,30,31,32, 33,0,0,0 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]), - expectedDim: new Int32Array([33,1,1]), - expectedSize: new Int32Array([3,3]), // 3 * 3 = 9 * 4 = 36 + expectedDim: new Int32Array([33, 1, 1]), + expectedSize: new Int32Array([3, 3]), // 3 * 3 = 9 * 4 = 36 expectedType: gl.FLOAT, expectedConstantTextureCount: 1, expectedPixelStorei: false, @@ -1079,28 +992,27 @@ test('Input(Uint8Array) with single precision length 33', () => { setupConstantsTestSuite({ gpuSettings: { precision: 'single', - output: [5] + output: [5], }, - constant: input(new Uint8Array([ - // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - // NOTE: Packing is 4 per RGBA (8 bit, but upconverted to float32), so only 4 of the 4 channels is used - // NOTE: 3x3 - 1,2,3,4, 5,6,7,8, 9,10,11,12, - 13,14,15,16, 17,18,19,20, 21,22,23,24, - 25,26,27,28, 29,30,31,32, 33 - ]), [33]), + constant: input( + new Uint8Array([ + // NOTE: formatted like rectangle on purpose, so you can see how the texture should look + // NOTE: Packing is 4 per RGBA (8 bit, but upconverted to float32), so only 4 of the 4 channels is used + // NOTE: 3x3 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + ]), + [33] + ), // upconverted to float32 expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA (8 bit, but upconverted to float32), so only 4 of the 4 channels is used // NOTE: 3x3 - 1,2,3,4, 5,6,7,8, 9,10,11,12, - 13,14,15,16, 17,18,19,20, 21,22,23,24, - 25,26,27,28, 29,30,31,32, 33,0,0,0 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]), - expectedDim: new Int32Array([33,1,1]), - expectedSize: new Int32Array([3,3]), // 3 * 3 = 9 * 4 = 36 + expectedDim: new Int32Array([33, 1, 1]), + expectedSize: new Int32Array([3, 3]), // 3 * 3 = 9 * 4 = 36 expectedType: gl.FLOAT, expectedConstantTextureCount: 1, expectedPixelStorei: false, diff --git a/test/internal/backend/web-gl2/kernel-value/dynamic-html-image-array.js b/test/internal/backend/web-gl2/kernel-value/dynamic-html-image-array.js index a75b2305..02f511bc 100644 --- a/test/internal/backend/web-gl2/kernel-value/dynamic-html-image-array.js +++ b/test/internal/backend/web-gl2/kernel-value/dynamic-html-image-array.js @@ -18,7 +18,7 @@ test('.updateValue() checks too large height', () => { tactic: 'speed', onRequestContextHandle: () => 1, onRequestTexture: () => null, - onRequestIndex: () => 1 + onRequestIndex: () => 1, }); assert.throws(() => { @@ -42,13 +42,15 @@ test('.updateValue() checks too large width', () => { tactic: 'speed', onRequestContextHandle: () => 1, onRequestTexture: () => null, - onRequestIndex: () => 1 + onRequestIndex: () => 1, }); assert.throws(() => { - v.updateValue([{ - height: 1, - width: 2, - }]) + v.updateValue([ + { + height: 1, + width: 2, + }, + ]); }, new Error('Argument texture width of 2 larger than maximum size of 1 for your GPU')); }); @@ -79,12 +81,14 @@ test('.updateValue() checks ok height & width', () => { context: mockContext, onRequestContextHandle: () => 1, onRequestTexture: () => null, - onRequestIndex: () => 1 + onRequestIndex: () => 1, }); - v.updateValue([{ - height: 1, - width: 1, - }]); + v.updateValue([ + { + height: 1, + width: 1, + }, + ]); assert.equal(v.constructor.name, 'WebGL2KernelValueDynamicHTMLImageArray'); }); diff --git a/test/internal/backend/web-gl2/kernel-value/dynamic-single-array.js b/test/internal/backend/web-gl2/kernel-value/dynamic-single-array.js index 150339da..8318eb8c 100644 --- a/test/internal/backend/web-gl2/kernel-value/dynamic-single-array.js +++ b/test/internal/backend/web-gl2/kernel-value/dynamic-single-array.js @@ -10,7 +10,7 @@ test('.updateValue() checks too large', () => { }, validate: true, }; - const v = new webGL2KernelValueMaps.single.dynamic.Array([1,2], { + const v = new webGL2KernelValueMaps.single.dynamic.Array([1, 2], { kernel: mockKernel, name: 'test', type: 'Array', @@ -18,11 +18,11 @@ test('.updateValue() checks too large', () => { tactic: 'speed', onRequestContextHandle: () => 1, onRequestTexture: () => null, - onRequestIndex: () => 1 + onRequestIndex: () => 1, }); assert.throws(() => { - v.updateValue(new Array([1,2,3,4,5,6,7,8])); + v.updateValue(new Array([1, 2, 3, 4, 5, 6, 7, 8])); }, new Error('Argument texture height of 2 larger than maximum size of 1 for your GPU')); }); @@ -43,7 +43,7 @@ test('.updateValue() checks ok', () => { pixelStorei: () => {}, texImage2D: () => {}, }; - const v = new webGL2KernelValueMaps.single.dynamic.Array([1,2], { + const v = new webGL2KernelValueMaps.single.dynamic.Array([1, 2], { kernel: mockKernel, name: 'test', type: 'Array', @@ -52,9 +52,9 @@ test('.updateValue() checks ok', () => { context: mockContext, onRequestContextHandle: () => 1, onRequestTexture: () => null, - onRequestIndex: () => 1 + onRequestIndex: () => 1, }); - v.updateValue(new Array([2,1])); + v.updateValue(new Array([2, 1])); assert.equal(v.constructor.name, 'WebGL2KernelValueDynamicSingleArray'); }); diff --git a/test/internal/backend/web-gl2/kernel-value/dynamic-single-input.js b/test/internal/backend/web-gl2/kernel-value/dynamic-single-input.js index 056c5170..eb4f0cd0 100644 --- a/test/internal/backend/web-gl2/kernel-value/dynamic-single-input.js +++ b/test/internal/backend/web-gl2/kernel-value/dynamic-single-input.js @@ -10,19 +10,22 @@ test('.updateValue() checks too large height', () => { }, validate: true, }; - const v = new webGL2KernelValueMaps.single.dynamic.Input({ size: [5, 5], value: [0] }, { - kernel: mockKernel, - name: 'test', - type: 'Input', - origin: 'user', - tactic: 'speed', - onRequestContextHandle: () => 1, - onRequestTexture: () => null, - onRequestIndex: () => 1 - }); + const v = new webGL2KernelValueMaps.single.dynamic.Input( + { size: [5, 5], value: [0] }, + { + kernel: mockKernel, + name: 'test', + type: 'Input', + origin: 'user', + tactic: 'speed', + onRequestContextHandle: () => 1, + onRequestTexture: () => null, + onRequestIndex: () => 1, + } + ); assert.throws(() => { - v.updateValue({ size: [16,16] }); + v.updateValue({ size: [16, 16] }); }, new Error('Argument texture height and width of 8 larger than maximum size of 4 for your GPU')); }); @@ -34,20 +37,23 @@ test('.updateValue() checks too large width', () => { validate: true, }; - const v = new webGL2KernelValueMaps.single.dynamic.Input({ size: [1, 1], value: [0] }, { - kernel: mockKernel, - name: 'test', - type: 'Input', - origin: 'user', - tactic: 'speed', - onRequestContextHandle: () => 1, - onRequestTexture: () => null, - onRequestIndex: () => 1 - }); + const v = new webGL2KernelValueMaps.single.dynamic.Input( + { size: [1, 1], value: [0] }, + { + kernel: mockKernel, + name: 'test', + type: 'Input', + origin: 'user', + tactic: 'speed', + onRequestContextHandle: () => 1, + onRequestTexture: () => null, + onRequestIndex: () => 1, + } + ); assert.throws(() => { v.updateValue({ - size: [12,12] - }) + size: [12, 12], + }); }, new Error('Argument texture height and width of 6 larger than maximum size of 4 for your GPU')); }); @@ -68,21 +74,24 @@ test('.updateValue() checks ok height & width', () => { pixelStorei: () => {}, texImage2D: () => {}, }; - const v = new webGL2KernelValueMaps.single.dynamic.Input({ size: [2,2], context: mockContext, value: [0] }, { - kernel: mockKernel, - name: 'test', - type: 'Input', - origin: 'user', - tactic: 'speed', - context: mockContext, - onRequestContextHandle: () => 1, - onRequestTexture: () => null, - onRequestIndex: () => 1 - }); + const v = new webGL2KernelValueMaps.single.dynamic.Input( + { size: [2, 2], context: mockContext, value: [0] }, + { + kernel: mockKernel, + name: 'test', + type: 'Input', + origin: 'user', + tactic: 'speed', + context: mockContext, + onRequestContextHandle: () => 1, + onRequestTexture: () => null, + onRequestIndex: () => 1, + } + ); v.updateValue({ - size: [1,1], + size: [1, 1], context: mockContext, - value: [0] + value: [0], }); assert.equal(v.constructor.name, 'WebGL2KernelValueDynamicSingleInput'); diff --git a/test/internal/backend/web-gl2/kernel-value/html-image-array.js b/test/internal/backend/web-gl2/kernel-value/html-image-array.js index 00eb5f69..14cc7dae 100644 --- a/test/internal/backend/web-gl2/kernel-value/html-image-array.js +++ b/test/internal/backend/web-gl2/kernel-value/html-image-array.js @@ -19,7 +19,7 @@ test('.constructor() checks too large height', () => { tactic: 'speed', onRequestContextHandle: () => 1, onRequestTexture: () => null, - onRequestIndex: () => 1 + onRequestIndex: () => 1, }); }, new Error('Argument texture height of 2 larger than maximum size of 1 for your GPU')); }); @@ -40,7 +40,7 @@ test('.constructor() checks too large width', () => { tactic: 'speed', onRequestContextHandle: () => 1, onRequestTexture: () => null, - onRequestIndex: () => 1 + onRequestIndex: () => 1, }); }, new Error('Argument texture width of 2 larger than maximum size of 1 for your GPU')); }); @@ -60,7 +60,7 @@ test('.constructor() checks ok height & width', () => { tactic: 'speed', onRequestContextHandle: () => 1, onRequestTexture: () => null, - onRequestIndex: () => 1 + onRequestIndex: () => 1, }); assert.equal(v.constructor.name, 'WebGL2KernelValueHTMLImageArray'); }); diff --git a/test/internal/backend/web-gl2/kernel-value/single-input.js b/test/internal/backend/web-gl2/kernel-value/single-input.js index 0a769d0a..b53d6260 100644 --- a/test/internal/backend/web-gl2/kernel-value/single-input.js +++ b/test/internal/backend/web-gl2/kernel-value/single-input.js @@ -11,16 +11,19 @@ test('.constructor() checks too large height', () => { validate: true, }; assert.throws(() => { - new webGL2KernelValueMaps.single.static.Input({ size: [8,1], value: [1,2] }, { - kernel: mockKernel, - name: 'test', - type: 'Array', - origin: 'user', - tactic: 'speed', - onRequestContextHandle: () => 1, - onRequestTexture: () => null, - onRequestIndex: () => 1 - }); + new webGL2KernelValueMaps.single.static.Input( + { size: [8, 1], value: [1, 2] }, + { + kernel: mockKernel, + name: 'test', + type: 'Array', + origin: 'user', + tactic: 'speed', + onRequestContextHandle: () => 1, + onRequestTexture: () => null, + onRequestIndex: () => 1, + } + ); }, new Error('Argument texture height of 2 larger than maximum size of 1 for your GPU')); }); @@ -41,16 +44,19 @@ test('.constructor() checks ok height & width', () => { pixelStorei: () => {}, texImage2D: () => {}, }; - const v = new webGL2KernelValueMaps.single.static.Input({ size: [1,2], value: [1,2] }, { - kernel: mockKernel, - name: 'test', - type: 'Array', - origin: 'user', - tactic: 'speed', - context: mockContext, - onRequestContextHandle: () => 1, - onRequestTexture: () => null, - onRequestIndex: () => 1 - }); + const v = new webGL2KernelValueMaps.single.static.Input( + { size: [1, 2], value: [1, 2] }, + { + kernel: mockKernel, + name: 'test', + type: 'Array', + origin: 'user', + tactic: 'speed', + context: mockContext, + onRequestContextHandle: () => 1, + onRequestTexture: () => null, + onRequestIndex: () => 1, + } + ); assert.equal(v.constructor.name, 'WebGL2KernelValueSingleInput'); }); diff --git a/test/internal/backend/web-gl2/kernel/index.js b/test/internal/backend/web-gl2/kernel/index.js index 97221a5c..6d01a405 100644 --- a/test/internal/backend/web-gl2/kernel/index.js +++ b/test/internal/backend/web-gl2/kernel/index.js @@ -5,7 +5,7 @@ describe('internal: WebGL2Kernel'); (typeof global !== 'undefined' ? test : skip)('.setupFeatureChecks() if context is available, but .getExtension() is falsey', () => { const mockContext = { - getExtension: null // this is important + getExtension: null, // this is important }; const mockElement = { getContext: () => mockContext, @@ -13,7 +13,7 @@ describe('internal: WebGL2Kernel'); const mockDocument = { createElement: () => { return mockElement; - } + }, }; global.document = mockDocument; diff --git a/test/internal/backend/web-gl2/kernel/setupArguments.js b/test/internal/backend/web-gl2/kernel/setupArguments.js index 8acd0176..15e94d07 100644 --- a/test/internal/backend/web-gl2/kernel/setupArguments.js +++ b/test/internal/backend/web-gl2/kernel/setupArguments.js @@ -18,17 +18,7 @@ const gl = { UNPACK_FLIP_Y_WEBGL: 'UNPACK_FLIP_Y_WEBGL', }; function setupArgumentsTestSuite(testSuiteSettings) { - const { - gpuSettings, - argument, - expectedPixels, - expectedBitRatio, - expectedDim, - expectedSize, - expectedType, - expectedArgumentTextureCount, - expectedPixelStorei, - } = testSuiteSettings; + const { gpuSettings, argument, expectedPixels, expectedBitRatio, expectedDim, expectedSize, expectedType, expectedArgumentTextureCount, expectedPixelStorei } = testSuiteSettings; let texImage2DCalled = false; let activeTextureCalled = false; let bindTextureCalled = false; @@ -37,92 +27,95 @@ function setupArgumentsTestSuite(testSuiteSettings) { let uniform3ivCalled = false; let uniform2ivCalled = false; let uniform1iCalled = false; - const mockContext = Object.assign({ - activeTexture: (index) => { - assert.equal(index, 0); - activeTextureCalled = true; - }, - bindTexture: (target, texture) => { - assert.equal(target, 'TEXTURE_2D'); - assert.equal(texture, 'TEXTURE'); - bindTextureCalled = true; - }, - texParameteri: (target, pname, param) => { - switch (texParameteriCalls) { - case 0: - assert.equal(target, 'TEXTURE_2D'); - assert.equal(pname, 'TEXTURE_WRAP_S'); - assert.equal(param, 'CLAMP_TO_EDGE'); - texParameteriCalls++; - break; - case 1: - assert.equal(target, 'TEXTURE_2D'); - assert.equal(pname, 'TEXTURE_WRAP_T'); - assert.equal(param, 'CLAMP_TO_EDGE'); - texParameteriCalls++; - break; - case 2: - assert.equal(target, 'TEXTURE_2D'); - assert.equal(pname, 'TEXTURE_MIN_FILTER'); - assert.equal(param, 'NEAREST'); - texParameteriCalls++; - break; - case 3: - assert.equal(target, 'TEXTURE_2D'); - assert.equal(pname, 'TEXTURE_MAG_FILTER'); - assert.equal(param, 'NEAREST'); - texParameteriCalls++; - break; - default: + const mockContext = Object.assign( + { + activeTexture: index => { + assert.equal(index, 0); + activeTextureCalled = true; + }, + bindTexture: (target, texture) => { + assert.equal(target, 'TEXTURE_2D'); + assert.equal(texture, 'TEXTURE'); + bindTextureCalled = true; + }, + texParameteri: (target, pname, param) => { + switch (texParameteriCalls) { + case 0: + assert.equal(target, 'TEXTURE_2D'); + assert.equal(pname, 'TEXTURE_WRAP_S'); + assert.equal(param, 'CLAMP_TO_EDGE'); + texParameteriCalls++; + break; + case 1: + assert.equal(target, 'TEXTURE_2D'); + assert.equal(pname, 'TEXTURE_WRAP_T'); + assert.equal(param, 'CLAMP_TO_EDGE'); + texParameteriCalls++; + break; + case 2: + assert.equal(target, 'TEXTURE_2D'); + assert.equal(pname, 'TEXTURE_MIN_FILTER'); + assert.equal(param, 'NEAREST'); + texParameteriCalls++; + break; + case 3: + assert.equal(target, 'TEXTURE_2D'); + assert.equal(pname, 'TEXTURE_MAG_FILTER'); + assert.equal(param, 'NEAREST'); + texParameteriCalls++; + break; + default: + throw new Error('called too many times'); + } + }, + pixelStorei: (pname, param) => { + assert.equal(pname, 'UNPACK_FLIP_Y_WEBGL'); + assert.equal(param, expectedPixelStorei); + }, + createTexture: () => 'TEXTURE', + getUniformLocation: (program, name) => { + assert.equal(program, 'program'); + if (getUniformLocationCalls > 3) { throw new Error('called too many times'); - } - }, - pixelStorei: (pname, param) => { - assert.equal(pname, 'UNPACK_FLIP_Y_WEBGL'); - assert.equal(param, expectedPixelStorei); - }, - createTexture: () => 'TEXTURE', - getUniformLocation: (program, name) => { - assert.equal(program, 'program'); - if (getUniformLocationCalls > 3) { - throw new Error('called too many times'); - } - getUniformLocationCalls++; - return { - user_vDim: 'user_vDimLocation', - user_vSize: 'user_vSizeLocation', - user_v: 'user_vLocation', - }[name]; - }, - uniform3iv: (location, value) => { - assert.equal(location, 'user_vDimLocation'); - assert.deepEqual(value, expectedDim); - uniform3ivCalled = true; - }, - uniform2iv: (location, value) => { - assert.equal(location, 'user_vSizeLocation'); - assert.deepEqual(value, expectedSize); - uniform2ivCalled = true; - }, - uniform1i: (location, value) => { - assert.equal(location, 'user_vLocation'); - assert.equal(value, 0); - uniform1iCalled = true; - }, - texImage2D: (target, level, internalFormat, width, height, border, format, type, pixels) => { - assert.equal(target, gl.TEXTURE_2D); - assert.equal(level, 0); - assert.equal(internalFormat, gpuSettings.precision === 'single' ? gl.RGBA32F : gl.RGBA); - assert.equal(width, expectedSize[0]); - assert.equal(height, expectedSize[1]); - assert.equal(border, 0); - assert.equal(format, gl.RGBA); - assert.equal(type, expectedType); - assert.equal(pixels.length, expectedPixels.length); - assert.deepEqual(pixels, expectedPixels); - texImage2DCalled = true; - } - }, gl); + } + getUniformLocationCalls++; + return { + user_vDim: 'user_vDimLocation', + user_vSize: 'user_vSizeLocation', + user_v: 'user_vLocation', + }[name]; + }, + uniform3iv: (location, value) => { + assert.equal(location, 'user_vDimLocation'); + assert.deepEqual(value, expectedDim); + uniform3ivCalled = true; + }, + uniform2iv: (location, value) => { + assert.equal(location, 'user_vSizeLocation'); + assert.deepEqual(value, expectedSize); + uniform2ivCalled = true; + }, + uniform1i: (location, value) => { + assert.equal(location, 'user_vLocation'); + assert.equal(value, 0); + uniform1iCalled = true; + }, + texImage2D: (target, level, internalFormat, width, height, border, format, type, pixels) => { + assert.equal(target, gl.TEXTURE_2D); + assert.equal(level, 0); + assert.equal(internalFormat, gpuSettings.precision === 'single' ? gl.RGBA32F : gl.RGBA); + assert.equal(width, expectedSize[0]); + assert.equal(height, expectedSize[1]); + assert.equal(border, 0); + assert.equal(format, gl.RGBA); + assert.equal(type, expectedType); + assert.equal(pixels.length, expectedPixels.length); + assert.deepEqual(pixels, expectedPixels); + texImage2DCalled = true; + }, + }, + gl + ); const source = `function(v) { return v[this.thread.x]; }`; const settings = { context: mockContext, @@ -131,8 +124,8 @@ function setupArgumentsTestSuite(testSuiteSettings) { kernel.constructor = { lookupKernelValueType: WebGL2Kernel.lookupKernelValueType, features: { - maxTextureSize: 9999 - } + maxTextureSize: 9999, + }, }; const args = [argument]; kernel.program = 'program'; @@ -159,21 +152,21 @@ test('Array with unsigned precision 5 length', () => { setupArgumentsTestSuite({ gpuSettings: { precision: 'unsigned', - output: [4] + output: [4], }, argument: [ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, - 5 + 1, 2, 3, 4, 5, ], expectedBitRatio: 4, - expectedPixels: new Uint8Array(new Float32Array([ - // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5,0,0,0 - ]).buffer), - expectedDim: new Int32Array([5,1,1]), - expectedSize: new Int32Array([4,2]), // 4 * 2 = 8 + expectedPixels: new Uint8Array( + new Float32Array([ + // NOTE: formatted like rectangle on purpose, so you can see how the texture should look + 1, 2, 3, 4, 5, 0, 0, 0, + ]).buffer + ), + expectedDim: new Int32Array([5, 1, 1]), + expectedSize: new Int32Array([4, 2]), // 4 * 2 = 8 expectedType: gl.UNSIGNED_BYTE, expectedArgumentTextureCount: 1, expectedPixelStorei: false, @@ -183,23 +176,21 @@ test('Float32Array with unsigned precision 5 length', () => { setupArgumentsTestSuite({ gpuSettings: { precision: 'unsigned', - output: [4] + output: [4], }, argument: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, - 5 + 1, 2, 3, 4, 5, ]), expectedBitRatio: 4, expectedPixels: new Uint8Array( new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5,0,0,0 + 1, 2, 3, 4, 5, 0, 0, 0, ]).buffer ), - expectedDim: new Int32Array([5,1,1]), - expectedSize: new Int32Array([4,2]), // 4 * 2 * 1 = 8 + expectedDim: new Int32Array([5, 1, 1]), + expectedSize: new Int32Array([4, 2]), // 4 * 2 * 1 = 8 expectedType: gl.UNSIGNED_BYTE, expectedArgumentTextureCount: 1, expectedPixelStorei: false, @@ -209,23 +200,21 @@ test('Uint16Array with unsigned precision 5 length', () => { setupArgumentsTestSuite({ gpuSettings: { precision: 'unsigned', - output: [4] + output: [4], }, argument: new Uint16Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, - 5 + 1, 2, 3, 4, 5, ]), expectedBitRatio: 2, expectedPixels: new Uint8Array( new Uint16Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5,0,0,0 + 1, 2, 3, 4, 5, 0, 0, 0, ]).buffer ), - expectedDim: new Int32Array([5,1,1]), - expectedSize: new Int32Array([2,2]), // 2 * 2 * 2 = 8 + expectedDim: new Int32Array([5, 1, 1]), + expectedSize: new Int32Array([2, 2]), // 2 * 2 * 2 = 8 expectedType: gl.UNSIGNED_BYTE, expectedArgumentTextureCount: 1, expectedPixelStorei: false, @@ -235,20 +224,16 @@ test('Uint8Array with unsigned precision 5 length', () => { setupArgumentsTestSuite({ gpuSettings: { precision: 'unsigned', - output: [5] + output: [5], }, - argument: new Uint8Array([ - 1, 2, 3, 4, - 5 - ]), + argument: new Uint8Array([1, 2, 3, 4, 5]), expectedBitRatio: 1, expectedPixels: new Uint8Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5,0,0,0 + 1, 2, 3, 4, 5, 0, 0, 0, ]), - expectedDim: new Int32Array([5,1,1]), - expectedSize: new Int32Array([1,2]), // 1 * 2 * 4 = 8 + expectedDim: new Int32Array([5, 1, 1]), + expectedSize: new Int32Array([1, 2]), // 1 * 2 * 4 = 8 expectedType: gl.UNSIGNED_BYTE, expectedArgumentTextureCount: 1, expectedPixelStorei: false, @@ -259,21 +244,19 @@ test('Array with single precision', () => { setupArgumentsTestSuite({ gpuSettings: { precision: 'single', - output: [4] + output: [4], }, argument: [ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5 + 1, 2, 3, 4, 5, ], expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5,0,0,0 + 1, 2, 3, 4, 5, 0, 0, 0, ]), - expectedDim: new Int32Array([5,1,1]), - expectedSize: new Int32Array([1,2]), + expectedDim: new Int32Array([5, 1, 1]), + expectedSize: new Int32Array([1, 2]), expectedType: gl.FLOAT, expectedTextureWidth: 1, expectedTextureHeight: 2, @@ -285,21 +268,19 @@ test('Float32Array with single precision', () => { setupArgumentsTestSuite({ gpuSettings: { precision: 'single', - output: [4] + output: [4], }, argument: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5 + 1, 2, 3, 4, 5, ]), expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5,0,0,0 + 1, 2, 3, 4, 5, 0, 0, 0, ]), - expectedDim: new Int32Array([5,1,1]), - expectedSize: new Int32Array([1,2]), + expectedDim: new Int32Array([5, 1, 1]), + expectedSize: new Int32Array([1, 2]), expectedType: gl.FLOAT, expectedTextureWidth: 1, expectedTextureHeight: 2, @@ -311,22 +292,20 @@ test('Uint16Array with single precision', () => { setupArgumentsTestSuite({ gpuSettings: { precision: 'single', - output: [4] + output: [4], }, argument: new Uint16Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5 + 1, 2, 3, 4, 5, ]), // upconverted from 2 expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5,0,0,0 + 1, 2, 3, 4, 5, 0, 0, 0, ]), - expectedDim: new Int32Array([5,1,1]), - expectedSize: new Int32Array([1,2]), + expectedDim: new Int32Array([5, 1, 1]), + expectedSize: new Int32Array([1, 2]), expectedType: gl.FLOAT, expectedArgumentTextureCount: 1, expectedPixelStorei: false, @@ -336,22 +315,20 @@ test('Uint8Array with single precision', () => { setupArgumentsTestSuite({ gpuSettings: { precision: 'single', - output: [4] + output: [4], }, argument: new Uint8Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5 + 1, 2, 3, 4, 5, ]), // upconverted from 1 expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5,0,0,0 + 1, 2, 3, 4, 5, 0, 0, 0, ]), - expectedDim: new Int32Array([5,1,1]), - expectedSize: new Int32Array([1,2]), + expectedDim: new Int32Array([5, 1, 1]), + expectedSize: new Int32Array([1, 2]), expectedType: gl.FLOAT, expectedArgumentTextureCount: 1, expectedPixelStorei: false, @@ -362,18 +339,13 @@ test('Array with unsigned precision length 33', () => { setupArgumentsTestSuite({ gpuSettings: { precision: 'unsigned', - output: [5] + output: [5], }, argument: [ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 1 per RGBA, so only 1 of the 4 channels is used // NOTE: 6x6 - 1, 2, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, - 31, 32, 33 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ], expectedBitRatio: 4, expectedPixels: new Uint8Array( @@ -381,16 +353,11 @@ test('Array with unsigned precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 1 per RGBA, so only 1 of the 4 channels is used // NOTE: 6x6 - 1, 2, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, - 31, 32, 33, 0, 0, 0 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]).buffer ), - expectedDim: new Int32Array([33,1,1]), - expectedSize: new Int32Array([6,6]), // 3 * 3 = 9 * 4 = 34 + expectedDim: new Int32Array([33, 1, 1]), + expectedSize: new Int32Array([6, 6]), // 3 * 3 = 9 * 4 = 34 expectedType: gl.UNSIGNED_BYTE, expectedArgumentTextureCount: 1, expectedPixelStorei: false, @@ -401,18 +368,13 @@ test('Float32Array with unsigned precision length 33', () => { setupArgumentsTestSuite({ gpuSettings: { precision: 'unsigned', - output: [5] + output: [5], }, argument: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 1 per RGBA, so only 1 of the 4 channels is used // NOTE: 6x6 - 1, 2, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, - 31, 32, 33 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ]), expectedBitRatio: 4, expectedPixels: new Uint8Array( @@ -420,16 +382,11 @@ test('Float32Array with unsigned precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 1 per RGBA, so only 1 of the 4 channels is used // NOTE: 6x6 - 1, 2, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, - 31, 32, 33, 0, 0, 0, + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]).buffer ), - expectedDim: new Int32Array([33,1,1]), - expectedSize: new Int32Array([6,6]), // 3 * 3 = 9 * 4 = 34 + expectedDim: new Int32Array([33, 1, 1]), + expectedSize: new Int32Array([6, 6]), // 3 * 3 = 9 * 4 = 34 expectedType: gl.UNSIGNED_BYTE, expectedArgumentTextureCount: 1, expectedPixelStorei: false, @@ -440,17 +397,13 @@ test('Uint16Array with unsigned precision length 33', () => { setupArgumentsTestSuite({ gpuSettings: { precision: 'unsigned', - output: [5] + output: [5], }, argument: new Uint16Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 2 per RGBA, so only 2 of the 4 channels is used // NOTE: 4x5 - 1,2, 3,4, 5,6, 7,8, - 9,10, 11,12, 13,14, 15,16, - 17,18, 19,20, 21,22, 23,24, - 25,26, 27,28, 29,30, 31,32, - 33, + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ]), expectedBitRatio: 2, expectedPixels: new Uint8Array( @@ -458,15 +411,11 @@ test('Uint16Array with unsigned precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 2 per RGBA, so only 2 of the 4 channels is used // NOTE: 4x5 - 1,2, 3,4, 5,6, 7,8, - 9,10, 11,12, 13,14, 15,16, - 17,18, 19,20, 21,22, 23,24, - 25,26, 27,28, 29,30, 31,32, - 33,0, 0,0, 0,0, 0,0 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, 0, 0, 0, 0, ]).buffer ), - expectedDim: new Int32Array([33,1,1]), - expectedSize: new Int32Array([4,5]), // 3 * 3 = 9 * 4 = 34 + expectedDim: new Int32Array([33, 1, 1]), + expectedSize: new Int32Array([4, 5]), // 3 * 3 = 9 * 4 = 34 expectedType: gl.UNSIGNED_BYTE, expectedArgumentTextureCount: 1, expectedPixelStorei: false, @@ -477,28 +426,25 @@ test('Uint8Array with unsigned precision length 33', () => { setupArgumentsTestSuite({ gpuSettings: { precision: 'unsigned', - output: [5] + output: [5], }, argument: new Uint8Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so only 2 of the 4 channels is used // NOTE: 3x3 - 1,2,3,4, 5,6,7,8, 9,10,11,12, - 13,14,15,16, 17,18,19,20, 21,22,23,24, - 25,26, 27,28, 29,30,31,32, 33 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ]), expectedBitRatio: 1, expectedPixels: new Uint8Array( new Uint8Array([ - // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - // NOTE: Packing is 4 per RGBA, so only 2 of the 4 channels is used - // NOTE: 3x3 - 1,2,3,4, 5,6,7,8, 9,10,11,12, - 13,14,15,16, 17,18,19,20, 21,22,23,24, - 25,26, 27,28, 29,30,31,32, 33,0,0,0 - ]).buffer), - expectedDim: new Int32Array([33,1,1]), - expectedSize: new Int32Array([3,3]), // 3 * 3 = 9 * 4 = 34 + // NOTE: formatted like rectangle on purpose, so you can see how the texture should look + // NOTE: Packing is 4 per RGBA, so only 2 of the 4 channels is used + // NOTE: 3x3 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, + ]).buffer + ), + expectedDim: new Int32Array([33, 1, 1]), + expectedSize: new Int32Array([3, 3]), // 3 * 3 = 9 * 4 = 34 expectedType: gl.UNSIGNED_BYTE, expectedArgumentTextureCount: 1, expectedPixelStorei: false, @@ -509,27 +455,23 @@ test('Array with single precision length 33', () => { setupArgumentsTestSuite({ gpuSettings: { precision: 'single', - output: [5] + output: [5], }, argument: [ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1,2,3,4, 5,6,7,8, 9,10,11,12, - 13,14,15,16, 17,18,19,20, 21,22,23,24, - 25,26,27,28, 29,30,31,32, 33 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ], expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1,2,3,4, 5,6,7,8, 9,10,11,12, - 13,14,15,16, 17,18,19,20, 21,22,23,24, - 25,26,27,28, 29,30,31,32, 33,0,0,0 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]), - expectedDim: new Int32Array([33,1,1]), - expectedSize: new Int32Array([3,3]), // 3 * 3 = 9 * 4 = 34 + expectedDim: new Int32Array([33, 1, 1]), + expectedSize: new Int32Array([3, 3]), // 3 * 3 = 9 * 4 = 34 expectedType: gl.FLOAT, expectedArgumentTextureCount: 1, expectedPixelStorei: false, @@ -540,27 +482,23 @@ test('Float32Array with single precision length 33', () => { setupArgumentsTestSuite({ gpuSettings: { precision: 'single', - output: [5] + output: [5], }, argument: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1,2,3,4, 5,6,7,8, 9,10,11,12, - 13,14,15,16, 17,18,19,20, 21,22,23,24, - 25,26,27,28, 29,30,31,32, 33 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ]), expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1,2,3,4, 5,6,7,8, 9,10,11,12, - 13,14,15,16, 17,18,19,20, 21,22,23,24, - 25,26,27,28, 29,30,31,32, 33,0,0,0 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]), - expectedDim: new Int32Array([33,1,1]), - expectedSize: new Int32Array([3,3]), // 3 * 3 = 9 * 4 = 36 + expectedDim: new Int32Array([33, 1, 1]), + expectedSize: new Int32Array([3, 3]), // 3 * 3 = 9 * 4 = 36 expectedType: gl.FLOAT, expectedArgumentTextureCount: 1, expectedPixelStorei: false, @@ -571,15 +509,13 @@ test('Uint16Array with single precision length 33', () => { setupArgumentsTestSuite({ gpuSettings: { precision: 'single', - output: [5] + output: [5], }, argument: new Uint16Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1,2,3,4, 5,6,7,8, 9,10,11,12, - 13,14,15,16, 17,18,19,20, 21,22,23,24, - 25,26,27,28, 29,30,31,32, 33 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ]), // upconverted from 2 expectedBitRatio: 4, @@ -587,12 +523,10 @@ test('Uint16Array with single precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1,2,3,4, 5,6,7,8, 9,10,11,12, - 13,14,15,16, 17,18,19,20, 21,22,23,24, - 25,26,27,28, 29,30,31,32, 33,0,0,0 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]), - expectedDim: new Int32Array([33,1,1]), - expectedSize: new Int32Array([3,3]), // 3 * 3 = 9 * 4 = 36 + expectedDim: new Int32Array([33, 1, 1]), + expectedSize: new Int32Array([3, 3]), // 3 * 3 = 9 * 4 = 36 expectedType: gl.FLOAT, expectedArgumentTextureCount: 1, expectedPixelStorei: false, @@ -603,15 +537,13 @@ test('Uint8Array with single precision length 33', () => { setupArgumentsTestSuite({ gpuSettings: { precision: 'single', - output: [5] + output: [5], }, argument: new Uint8Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1,2,3,4, 5,6,7,8, 9,10,11,12, - 13,14,15,16, 17,18,19,20, 21,22,23,24, - 25,26,27,28, 29,30,31,32, 33 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ]), // upconverted from 1 expectedBitRatio: 4, @@ -619,12 +551,10 @@ test('Uint8Array with single precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1,2,3,4, 5,6,7,8, 9,10,11,12, - 13,14,15,16, 17,18,19,20, 21,22,23,24, - 25,26,27,28, 29,30,31,32, 33,0,0,0 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]), - expectedDim: new Int32Array([33,1,1]), - expectedSize: new Int32Array([3,3]), // 3 * 3 = 9 * 4 = 36 + expectedDim: new Int32Array([33, 1, 1]), + expectedSize: new Int32Array([3, 3]), // 3 * 3 = 9 * 4 = 36 expectedType: gl.FLOAT, expectedArgumentTextureCount: 1, expectedPixelStorei: false, @@ -637,21 +567,24 @@ test('Input(Array) with unsigned precision 5 length', () => { setupArgumentsTestSuite({ gpuSettings: { precision: 'unsigned', - output: [4] + output: [4], }, - argument: input([ - // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, - 5, 0 - ], [2,3]), + argument: input( + [ + // NOTE: formatted like rectangle on purpose, so you can see how the texture should look + 1, 2, 3, 4, 5, 0, + ], + [2, 3] + ), expectedBitRatio: 4, - expectedPixels: new Uint8Array(new Float32Array([ - // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5,0,0,0 - ]).buffer), - expectedDim: new Int32Array([2,3,1]), - expectedSize: new Int32Array([4,2]), // 4 * 2 = 8 + expectedPixels: new Uint8Array( + new Float32Array([ + // NOTE: formatted like rectangle on purpose, so you can see how the texture should look + 1, 2, 3, 4, 5, 0, 0, 0, + ]).buffer + ), + expectedDim: new Int32Array([2, 3, 1]), + expectedSize: new Int32Array([4, 2]), // 4 * 2 = 8 expectedType: gl.UNSIGNED_BYTE, expectedArgumentTextureCount: 1, expectedPixelStorei: false, @@ -661,23 +594,24 @@ test('Input(Float32Array) with unsigned precision 5 length', () => { setupArgumentsTestSuite({ gpuSettings: { precision: 'unsigned', - output: [4] + output: [4], }, - argument: input(new Float32Array([ - // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, - 5 - ]), [5]), + argument: input( + new Float32Array([ + // NOTE: formatted like rectangle on purpose, so you can see how the texture should look + 1, 2, 3, 4, 5, + ]), + [5] + ), expectedBitRatio: 4, expectedPixels: new Uint8Array( new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5,0,0,0 + 1, 2, 3, 4, 5, 0, 0, 0, ]).buffer ), - expectedDim: new Int32Array([5,1,1]), - expectedSize: new Int32Array([4,2]), // 4 * 2 * 1 = 8 + expectedDim: new Int32Array([5, 1, 1]), + expectedSize: new Int32Array([4, 2]), // 4 * 2 * 1 = 8 expectedType: gl.UNSIGNED_BYTE, expectedArgumentTextureCount: 1, expectedPixelStorei: false, @@ -687,23 +621,24 @@ test('Input(Uint16Array) with unsigned precision 5 length', () => { setupArgumentsTestSuite({ gpuSettings: { precision: 'unsigned', - output: [4] + output: [4], }, - argument: input(new Uint16Array([ - // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, - 5, 0, - ]), [2,3]), + argument: input( + new Uint16Array([ + // NOTE: formatted like rectangle on purpose, so you can see how the texture should look + 1, 2, 3, 4, 5, 0, + ]), + [2, 3] + ), expectedBitRatio: 2, expectedPixels: new Uint8Array( new Uint16Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5,0,0,0 + 1, 2, 3, 4, 5, 0, 0, 0, ]).buffer ), - expectedDim: new Int32Array([2,3,1]), - expectedSize: new Int32Array([2,2]), // 2 * 2 * 2 = 8 + expectedDim: new Int32Array([2, 3, 1]), + expectedSize: new Int32Array([2, 2]), // 2 * 2 * 2 = 8 expectedType: gl.UNSIGNED_BYTE, expectedArgumentTextureCount: 1, expectedPixelStorei: false, @@ -713,20 +648,16 @@ test('Input(Uint8Array) with unsigned precision 5 length', () => { setupArgumentsTestSuite({ gpuSettings: { precision: 'unsigned', - output: [5] + output: [5], }, - argument: input(new Uint8Array([ - 1, 2, 3, 4, - 5,0 - ]),[2, 3]), + argument: input(new Uint8Array([1, 2, 3, 4, 5, 0]), [2, 3]), expectedBitRatio: 1, expectedPixels: new Uint8Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5,0,0,0 + 1, 2, 3, 4, 5, 0, 0, 0, ]), - expectedDim: new Int32Array([2,3,1]), - expectedSize: new Int32Array([1,2]), // 1 * 2 * 4 = 8 + expectedDim: new Int32Array([2, 3, 1]), + expectedSize: new Int32Array([1, 2]), // 1 * 2 * 4 = 8 expectedType: gl.UNSIGNED_BYTE, expectedArgumentTextureCount: 1, expectedPixelStorei: false, @@ -737,21 +668,22 @@ test('Input(Array) with single precision', () => { setupArgumentsTestSuite({ gpuSettings: { precision: 'single', - output: [4] + output: [4], }, - argument: input([ - // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5,0 - ], [2,3]), + argument: input( + [ + // NOTE: formatted like rectangle on purpose, so you can see how the texture should look + 1, 2, 3, 4, 5, 0, + ], + [2, 3] + ), expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5,0,0,0 + 1, 2, 3, 4, 5, 0, 0, 0, ]), - expectedDim: new Int32Array([2,3,1]), - expectedSize: new Int32Array([1,2]), + expectedDim: new Int32Array([2, 3, 1]), + expectedSize: new Int32Array([1, 2]), expectedType: gl.FLOAT, expectedTextureWidth: 1, expectedTextureHeight: 2, @@ -763,21 +695,22 @@ test('Input(Float32Array) with single precision', () => { setupArgumentsTestSuite({ gpuSettings: { precision: 'single', - output: [4] + output: [4], }, - argument: input(new Float32Array([ - // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5,0 - ]),[2,3]), + argument: input( + new Float32Array([ + // NOTE: formatted like rectangle on purpose, so you can see how the texture should look + 1, 2, 3, 4, 5, 0, + ]), + [2, 3] + ), expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5,0,0,0 + 1, 2, 3, 4, 5, 0, 0, 0, ]), - expectedDim: new Int32Array([2,3,1]), - expectedSize: new Int32Array([1,2]), + expectedDim: new Int32Array([2, 3, 1]), + expectedSize: new Int32Array([1, 2]), expectedType: gl.FLOAT, expectedTextureWidth: 1, expectedTextureHeight: 2, @@ -789,22 +722,23 @@ test('Input(Uint16Array) with single precision', () => { setupArgumentsTestSuite({ gpuSettings: { precision: 'single', - output: [4] + output: [4], }, - argument: input(new Uint16Array([ - // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5,0 - ]), [2,3]), + argument: input( + new Uint16Array([ + // NOTE: formatted like rectangle on purpose, so you can see how the texture should look + 1, 2, 3, 4, 5, 0, + ]), + [2, 3] + ), // upconverted from 2 expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5,0,0,0 + 1, 2, 3, 4, 5, 0, 0, 0, ]), - expectedDim: new Int32Array([2,3,1]), - expectedSize: new Int32Array([1,2]), + expectedDim: new Int32Array([2, 3, 1]), + expectedSize: new Int32Array([1, 2]), expectedType: gl.FLOAT, expectedArgumentTextureCount: 1, expectedPixelStorei: false, @@ -814,22 +748,23 @@ test('Input(Uint8Array) with single precision', () => { setupArgumentsTestSuite({ gpuSettings: { precision: 'single', - output: [4] + output: [4], }, - argument: input(new Uint8Array([ - // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5,0 - ]), [2,3]), + argument: input( + new Uint8Array([ + // NOTE: formatted like rectangle on purpose, so you can see how the texture should look + 1, 2, 3, 4, 5, 0, + ]), + [2, 3] + ), // upconverted from 1 expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5,0,0,0 + 1, 2, 3, 4, 5, 0, 0, 0, ]), - expectedDim: new Int32Array([2,3,1]), - expectedSize: new Int32Array([1,2]), + expectedDim: new Int32Array([2, 3, 1]), + expectedSize: new Int32Array([1, 2]), expectedType: gl.FLOAT, expectedArgumentTextureCount: 1, expectedPixelStorei: false, @@ -840,35 +775,28 @@ test('Input(Array) with unsigned precision length 33', () => { setupArgumentsTestSuite({ gpuSettings: { precision: 'unsigned', - output: [5] + output: [5], }, - argument: input([ - // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - // NOTE: Packing is 1 per RGBA, so only 1 of the 4 channels is used - // NOTE: 6x6 - 1, 2, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, - 31, 32, 33 - ], [33]), + argument: input( + [ + // NOTE: formatted like rectangle on purpose, so you can see how the texture should look + // NOTE: Packing is 1 per RGBA, so only 1 of the 4 channels is used + // NOTE: 6x6 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + ], + [33] + ), expectedBitRatio: 4, expectedPixels: new Uint8Array( new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 1 per RGBA, so only 1 of the 4 channels is used // NOTE: 6x6 - 1, 2, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, - 31, 32, 33, 0, 0, 0 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]).buffer ), - expectedDim: new Int32Array([33,1,1]), - expectedSize: new Int32Array([6,6]), // 3 * 3 = 9 * 4 = 34 + expectedDim: new Int32Array([33, 1, 1]), + expectedSize: new Int32Array([6, 6]), // 3 * 3 = 9 * 4 = 34 expectedType: gl.UNSIGNED_BYTE, expectedArgumentTextureCount: 1, expectedPixelStorei: false, @@ -879,35 +807,28 @@ test('Input(Float32Array) with unsigned precision length 33', () => { setupArgumentsTestSuite({ gpuSettings: { precision: 'unsigned', - output: [5] + output: [5], }, - argument: input(new Float32Array([ - // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - // NOTE: Packing is 1 per RGBA, so only 1 of the 4 channels is used - // NOTE: 6x6 - 1, 2, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, - 31, 32, 33 - ]), [33]), + argument: input( + new Float32Array([ + // NOTE: formatted like rectangle on purpose, so you can see how the texture should look + // NOTE: Packing is 1 per RGBA, so only 1 of the 4 channels is used + // NOTE: 6x6 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + ]), + [33] + ), expectedBitRatio: 4, expectedPixels: new Uint8Array( new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 1 per RGBA, so only 1 of the 4 channels is used // NOTE: 6x6 - 1, 2, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, - 31, 32, 33, 0, 0, 0, + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]).buffer ), - expectedDim: new Int32Array([33,1,1]), - expectedSize: new Int32Array([6,6]), // 3 * 3 = 9 * 4 = 34 + expectedDim: new Int32Array([33, 1, 1]), + expectedSize: new Int32Array([6, 6]), // 3 * 3 = 9 * 4 = 34 expectedType: gl.UNSIGNED_BYTE, expectedArgumentTextureCount: 1, expectedPixelStorei: false, @@ -918,33 +839,28 @@ test('Input(Uint16Array) with unsigned precision length 33', () => { setupArgumentsTestSuite({ gpuSettings: { precision: 'unsigned', - output: [5] + output: [5], }, - argument: input(new Uint16Array([ - // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - // NOTE: Packing is 2 per RGBA, so only 2 of the 4 channels is used - // NOTE: 4x5 - 1,2, 3,4, 5,6, 7,8, - 9,10, 11,12, 13,14, 15,16, - 17,18, 19,20, 21,22, 23,24, - 25,26, 27,28, 29,30, 31,32, - 33, - ]), [33]), + argument: input( + new Uint16Array([ + // NOTE: formatted like rectangle on purpose, so you can see how the texture should look + // NOTE: Packing is 2 per RGBA, so only 2 of the 4 channels is used + // NOTE: 4x5 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + ]), + [33] + ), expectedBitRatio: 2, expectedPixels: new Uint8Array( new Uint16Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 2 per RGBA, so only 2 of the 4 channels is used // NOTE: 4x5 - 1,2, 3,4, 5,6, 7,8, - 9,10, 11,12, 13,14, 15,16, - 17,18, 19,20, 21,22, 23,24, - 25,26, 27,28, 29,30, 31,32, - 33,0, 0,0, 0,0, 0,0 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, 0, 0, 0, 0, ]).buffer ), - expectedDim: new Int32Array([33,1,1]), - expectedSize: new Int32Array([4,5]), // 3 * 3 = 9 * 4 = 34 + expectedDim: new Int32Array([33, 1, 1]), + expectedSize: new Int32Array([4, 5]), // 3 * 3 = 9 * 4 = 34 expectedType: gl.UNSIGNED_BYTE, expectedArgumentTextureCount: 1, expectedPixelStorei: false, @@ -955,28 +871,28 @@ test('Input(Uint8Array) with unsigned precision length 33', () => { setupArgumentsTestSuite({ gpuSettings: { precision: 'unsigned', - output: [5] + output: [5], }, - argument: input(new Uint8Array([ - // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - // NOTE: Packing is 4 per RGBA, so only 2 of the 4 channels is used - // NOTE: 3x3 - 1,2,3,4, 5,6,7,8, 9,10,11,12, - 13,14,15,16, 17,18,19,20, 21,22,23,24, - 25,26, 27,28, 29,30,31,32, 33 - ]), [33]), + argument: input( + new Uint8Array([ + // NOTE: formatted like rectangle on purpose, so you can see how the texture should look + // NOTE: Packing is 4 per RGBA, so only 2 of the 4 channels is used + // NOTE: 3x3 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + ]), + [33] + ), expectedBitRatio: 1, expectedPixels: new Uint8Array( new Uint8Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so only 2 of the 4 channels is used // NOTE: 3x3 - 1,2,3,4, 5,6,7,8, 9,10,11,12, - 13,14,15,16, 17,18,19,20, 21,22,23,24, - 25,26, 27,28, 29,30,31,32, 33,0,0,0 - ]).buffer), - expectedDim: new Int32Array([33,1,1]), - expectedSize: new Int32Array([3,3]), // 3 * 3 = 9 * 4 = 34 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, + ]).buffer + ), + expectedDim: new Int32Array([33, 1, 1]), + expectedSize: new Int32Array([3, 3]), // 3 * 3 = 9 * 4 = 34 expectedType: gl.UNSIGNED_BYTE, expectedArgumentTextureCount: 1, expectedPixelStorei: false, @@ -987,27 +903,26 @@ test('Input(Array) with single precision length 33', () => { setupArgumentsTestSuite({ gpuSettings: { precision: 'single', - output: [5] + output: [5], }, - argument: input([ - // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used - // NOTE: 3x3 - 1,2,3,4, 5,6,7,8, 9,10,11,12, - 13,14,15,16, 17,18,19,20, 21,22,23,24, - 25,26,27,28, 29,30,31,32, 33 - ], [33]), + argument: input( + [ + // NOTE: formatted like rectangle on purpose, so you can see how the texture should look + // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used + // NOTE: 3x3 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + ], + [33] + ), expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1,2,3,4, 5,6,7,8, 9,10,11,12, - 13,14,15,16, 17,18,19,20, 21,22,23,24, - 25,26,27,28, 29,30,31,32, 33,0,0,0 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]), - expectedDim: new Int32Array([33,1,1]), - expectedSize: new Int32Array([3,3]), // 3 * 3 = 9 * 4 = 34 + expectedDim: new Int32Array([33, 1, 1]), + expectedSize: new Int32Array([3, 3]), // 3 * 3 = 9 * 4 = 34 expectedType: gl.FLOAT, expectedArgumentTextureCount: 1, expectedPixelStorei: false, @@ -1018,27 +933,26 @@ test('Input(Float32Array) with single precision length 33', () => { setupArgumentsTestSuite({ gpuSettings: { precision: 'single', - output: [5] + output: [5], }, - argument: input(new Float32Array([ - // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used - // NOTE: 3x3 - 1,2,3,4, 5,6,7,8, 9,10,11,12, - 13,14,15,16, 17,18,19,20, 21,22,23,24, - 25,26,27,28, 29,30,31,32, 33 - ]), [33]), + argument: input( + new Float32Array([ + // NOTE: formatted like rectangle on purpose, so you can see how the texture should look + // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used + // NOTE: 3x3 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + ]), + [33] + ), expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1,2,3,4, 5,6,7,8, 9,10,11,12, - 13,14,15,16, 17,18,19,20, 21,22,23,24, - 25,26,27,28, 29,30,31,32, 33,0,0,0 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]), - expectedDim: new Int32Array([33,1,1]), - expectedSize: new Int32Array([3,3]), // 3 * 3 = 9 * 4 = 34 + expectedDim: new Int32Array([33, 1, 1]), + expectedSize: new Int32Array([3, 3]), // 3 * 3 = 9 * 4 = 34 expectedType: gl.FLOAT, expectedArgumentTextureCount: 1, expectedPixelStorei: false, @@ -1049,28 +963,27 @@ test('Input(Uint16Array) with single precision length 33', () => { setupArgumentsTestSuite({ gpuSettings: { precision: 'single', - output: [5] + output: [5], }, - argument: input(new Uint16Array([ - // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used - // NOTE: 3x3 - 1,2,3,4, 5,6,7,8, 9,10,11,12, - 13,14,15,16, 17,18,19,20, 21,22,23,24, - 25,26,27,28, 29,30,31,32, 33 - ]), [33]), + argument: input( + new Uint16Array([ + // NOTE: formatted like rectangle on purpose, so you can see how the texture should look + // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used + // NOTE: 3x3 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + ]), + [33] + ), // upconverted from 2 expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1,2,3,4, 5,6,7,8, 9,10,11,12, - 13,14,15,16, 17,18,19,20, 21,22,23,24, - 25,26,27,28, 29,30,31,32, 33,0,0,0 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]), - expectedDim: new Int32Array([33,1,1]), - expectedSize: new Int32Array([3,3]), // 3 * 3 = 9 * 4 = 36 + expectedDim: new Int32Array([33, 1, 1]), + expectedSize: new Int32Array([3, 3]), // 3 * 3 = 9 * 4 = 36 expectedType: gl.FLOAT, expectedArgumentTextureCount: 1, expectedPixelStorei: false, @@ -1081,28 +994,27 @@ test('Input(Uint8Array) with single precision length 33', () => { setupArgumentsTestSuite({ gpuSettings: { precision: 'single', - output: [5] + output: [5], }, - argument: input(new Uint8Array([ - // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - // NOTE: Packing is 4 per RGBA (8 bit, but upconverted to float32), so only 4 of the 4 channels is used - // NOTE: 3x3 - 1,2,3,4, 5,6,7,8, 9,10,11,12, - 13,14,15,16, 17,18,19,20, 21,22,23,24, - 25,26,27,28, 29,30,31,32, 33 - ]), [33]), + argument: input( + new Uint8Array([ + // NOTE: formatted like rectangle on purpose, so you can see how the texture should look + // NOTE: Packing is 4 per RGBA (8 bit, but upconverted to float32), so only 4 of the 4 channels is used + // NOTE: 3x3 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + ]), + [33] + ), // upconverted to float32 expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA (8 bit, but upconverted to float32), so only 4 of the 4 channels is used // NOTE: 3x3 - 1,2,3,4, 5,6,7,8, 9,10,11,12, - 13,14,15,16, 17,18,19,20, 21,22,23,24, - 25,26,27,28, 29,30,31,32, 33,0,0,0 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]), - expectedDim: new Int32Array([33,1,1]), - expectedSize: new Int32Array([3,3]), // 3 * 3 = 9 * 4 = 36 + expectedDim: new Int32Array([33, 1, 1]), + expectedSize: new Int32Array([3, 3]), // 3 * 3 = 9 * 4 = 36 expectedType: gl.FLOAT, expectedArgumentTextureCount: 1, expectedPixelStorei: false, diff --git a/test/internal/backend/web-gl2/kernel/setupConstants.js b/test/internal/backend/web-gl2/kernel/setupConstants.js index 9149ed0e..318e0b92 100644 --- a/test/internal/backend/web-gl2/kernel/setupConstants.js +++ b/test/internal/backend/web-gl2/kernel/setupConstants.js @@ -18,17 +18,7 @@ const gl = { UNPACK_FLIP_Y_WEBGL: 'UNPACK_FLIP_Y_WEBGL', }; function setupConstantsTestSuite(testSuiteSettings) { - const { - gpuSettings, - constant, - expectedPixels, - expectedBitRatio, - expectedDim, - expectedSize, - expectedType, - expectedConstantTextureCount, - expectedPixelStorei, - } = testSuiteSettings; + const { gpuSettings, constant, expectedPixels, expectedBitRatio, expectedDim, expectedSize, expectedType, expectedConstantTextureCount, expectedPixelStorei } = testSuiteSettings; let texImage2DCalled = false; let activeTextureCalled = false; let bindTextureCalled = false; @@ -37,92 +27,95 @@ function setupConstantsTestSuite(testSuiteSettings) { let uniform3ivCalled = false; let uniform2ivCalled = false; let uniform1iCalled = false; - const mockContext = Object.assign({ - activeTexture: (index) => { - assert.equal(index, 0); - activeTextureCalled = true; - }, - bindTexture: (target, texture) => { - assert.equal(target, 'TEXTURE_2D'); - assert.equal(texture, 'TEXTURE'); - bindTextureCalled = true; - }, - texParameteri: (target, pname, param) => { - switch (texParameteriCalls) { - case 0: - assert.equal(target, 'TEXTURE_2D'); - assert.equal(pname, 'TEXTURE_WRAP_S'); - assert.equal(param, 'CLAMP_TO_EDGE'); - texParameteriCalls++; - break; - case 1: - assert.equal(target, 'TEXTURE_2D'); - assert.equal(pname, 'TEXTURE_WRAP_T'); - assert.equal(param, 'CLAMP_TO_EDGE'); - texParameteriCalls++; - break; - case 2: - assert.equal(target, 'TEXTURE_2D'); - assert.equal(pname, 'TEXTURE_MIN_FILTER'); - assert.equal(param, 'NEAREST'); - texParameteriCalls++; - break; - case 3: - assert.equal(target, 'TEXTURE_2D'); - assert.equal(pname, 'TEXTURE_MAG_FILTER'); - assert.equal(param, 'NEAREST'); - texParameteriCalls++; - break; - default: + const mockContext = Object.assign( + { + activeTexture: index => { + assert.equal(index, 0); + activeTextureCalled = true; + }, + bindTexture: (target, texture) => { + assert.equal(target, 'TEXTURE_2D'); + assert.equal(texture, 'TEXTURE'); + bindTextureCalled = true; + }, + texParameteri: (target, pname, param) => { + switch (texParameteriCalls) { + case 0: + assert.equal(target, 'TEXTURE_2D'); + assert.equal(pname, 'TEXTURE_WRAP_S'); + assert.equal(param, 'CLAMP_TO_EDGE'); + texParameteriCalls++; + break; + case 1: + assert.equal(target, 'TEXTURE_2D'); + assert.equal(pname, 'TEXTURE_WRAP_T'); + assert.equal(param, 'CLAMP_TO_EDGE'); + texParameteriCalls++; + break; + case 2: + assert.equal(target, 'TEXTURE_2D'); + assert.equal(pname, 'TEXTURE_MIN_FILTER'); + assert.equal(param, 'NEAREST'); + texParameteriCalls++; + break; + case 3: + assert.equal(target, 'TEXTURE_2D'); + assert.equal(pname, 'TEXTURE_MAG_FILTER'); + assert.equal(param, 'NEAREST'); + texParameteriCalls++; + break; + default: + throw new Error('called too many times'); + } + }, + pixelStorei: (pname, param) => { + assert.equal(pname, 'UNPACK_FLIP_Y_WEBGL'); + assert.equal(param, expectedPixelStorei); + }, + createTexture: () => 'TEXTURE', + getUniformLocation: (program, name) => { + assert.equal(program, 'program'); + if (getUniformLocationCalls > 3) { throw new Error('called too many times'); - } - }, - pixelStorei: (pname, param) => { - assert.equal(pname, 'UNPACK_FLIP_Y_WEBGL'); - assert.equal(param, expectedPixelStorei); - }, - createTexture: () => 'TEXTURE', - getUniformLocation: (program, name) => { - assert.equal(program, 'program'); - if (getUniformLocationCalls > 3) { - throw new Error('called too many times'); - } - getUniformLocationCalls++; - return { - constants_vDim: 'constants_vDimLocation', - constants_vSize: 'constants_vSizeLocation', - constants_v: 'constants_vLocation', - }[name]; - }, - uniform3iv: (location, value) => { - assert.equal(location, 'constants_vDimLocation'); - assert.deepEqual(value, expectedDim); - uniform3ivCalled = true; - }, - uniform2iv: (location, value) => { - assert.equal(location, 'constants_vSizeLocation'); - assert.deepEqual(value, expectedSize); - uniform2ivCalled = true; - }, - uniform1i: (location, value) => { - assert.equal(location, 'constants_vLocation'); - assert.equal(value, 0); - uniform1iCalled = true; - }, - texImage2D: (target, level, internalFormat, width, height, border, format, type, pixels) => { - assert.equal(target, gl.TEXTURE_2D); - assert.equal(level, 0); - assert.equal(internalFormat, gpuSettings.precision === 'single' ? gl.RGBA32F : gl.RGBA); - assert.equal(width, expectedSize[0]); - assert.equal(height, expectedSize[1]); - assert.equal(border, 0); - assert.equal(format, gl.RGBA); - assert.equal(type, expectedType); - assert.equal(pixels.length, expectedPixels.length); - assert.deepEqual(pixels, expectedPixels); - texImage2DCalled = true; - } - }, gl); + } + getUniformLocationCalls++; + return { + constants_vDim: 'constants_vDimLocation', + constants_vSize: 'constants_vSizeLocation', + constants_v: 'constants_vLocation', + }[name]; + }, + uniform3iv: (location, value) => { + assert.equal(location, 'constants_vDimLocation'); + assert.deepEqual(value, expectedDim); + uniform3ivCalled = true; + }, + uniform2iv: (location, value) => { + assert.equal(location, 'constants_vSizeLocation'); + assert.deepEqual(value, expectedSize); + uniform2ivCalled = true; + }, + uniform1i: (location, value) => { + assert.equal(location, 'constants_vLocation'); + assert.equal(value, 0); + uniform1iCalled = true; + }, + texImage2D: (target, level, internalFormat, width, height, border, format, type, pixels) => { + assert.equal(target, gl.TEXTURE_2D); + assert.equal(level, 0); + assert.equal(internalFormat, gpuSettings.precision === 'single' ? gl.RGBA32F : gl.RGBA); + assert.equal(width, expectedSize[0]); + assert.equal(height, expectedSize[1]); + assert.equal(border, 0); + assert.equal(format, gl.RGBA); + assert.equal(type, expectedType); + assert.equal(pixels.length, expectedPixels.length); + assert.deepEqual(pixels, expectedPixels); + texImage2DCalled = true; + }, + }, + gl + ); const source = `function(v) { return this.constants.v[this.thread.x]; }`; const settings = { context: mockContext, @@ -131,8 +124,8 @@ function setupConstantsTestSuite(testSuiteSettings) { kernel.constructor = { lookupKernelValueType: WebGL2Kernel.lookupKernelValueType, features: { - maxTextureSize: 9999 - } + maxTextureSize: 9999, + }, }; kernel.program = 'program'; assert.equal(kernel.constantTextureCount, 0); @@ -158,21 +151,21 @@ test('Array with unsigned precision 5 length', () => { setupConstantsTestSuite({ gpuSettings: { precision: 'unsigned', - output: [4] + output: [4], }, constant: [ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, - 5 + 1, 2, 3, 4, 5, ], expectedBitRatio: 4, - expectedPixels: new Uint8Array(new Float32Array([ - // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5,0,0,0 - ]).buffer), - expectedDim: new Int32Array([5,1,1]), - expectedSize: new Int32Array([4,2]), // 4 * 2 = 8 + expectedPixels: new Uint8Array( + new Float32Array([ + // NOTE: formatted like rectangle on purpose, so you can see how the texture should look + 1, 2, 3, 4, 5, 0, 0, 0, + ]).buffer + ), + expectedDim: new Int32Array([5, 1, 1]), + expectedSize: new Int32Array([4, 2]), // 4 * 2 = 8 expectedType: gl.UNSIGNED_BYTE, expectedConstantTextureCount: 1, expectedPixelStorei: false, @@ -182,23 +175,21 @@ test('Float32Array with unsigned precision 5 length', () => { setupConstantsTestSuite({ gpuSettings: { precision: 'unsigned', - output: [4] + output: [4], }, constant: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, - 5 + 1, 2, 3, 4, 5, ]), expectedBitRatio: 4, expectedPixels: new Uint8Array( new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5,0,0,0 + 1, 2, 3, 4, 5, 0, 0, 0, ]).buffer ), - expectedDim: new Int32Array([5,1,1]), - expectedSize: new Int32Array([4,2]), // 4 * 2 * 1 = 8 + expectedDim: new Int32Array([5, 1, 1]), + expectedSize: new Int32Array([4, 2]), // 4 * 2 * 1 = 8 expectedType: gl.UNSIGNED_BYTE, expectedConstantTextureCount: 1, expectedPixelStorei: false, @@ -208,23 +199,21 @@ test('Uint16Array with unsigned precision 5 length', () => { setupConstantsTestSuite({ gpuSettings: { precision: 'unsigned', - output: [4] + output: [4], }, constant: new Uint16Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, - 5 + 1, 2, 3, 4, 5, ]), expectedBitRatio: 2, expectedPixels: new Uint8Array( new Uint16Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5,0,0,0 + 1, 2, 3, 4, 5, 0, 0, 0, ]).buffer ), - expectedDim: new Int32Array([5,1,1]), - expectedSize: new Int32Array([2,2]), // 2 * 2 * 2 = 8 + expectedDim: new Int32Array([5, 1, 1]), + expectedSize: new Int32Array([2, 2]), // 2 * 2 * 2 = 8 expectedType: gl.UNSIGNED_BYTE, expectedConstantTextureCount: 1, expectedPixelStorei: false, @@ -234,20 +223,16 @@ test('Uint8Array with unsigned precision 5 length', () => { setupConstantsTestSuite({ gpuSettings: { precision: 'unsigned', - output: [5] + output: [5], }, - constant: new Uint8Array([ - 1, 2, 3, 4, - 5 - ]), + constant: new Uint8Array([1, 2, 3, 4, 5]), expectedBitRatio: 1, expectedPixels: new Uint8Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5,0,0,0 + 1, 2, 3, 4, 5, 0, 0, 0, ]), - expectedDim: new Int32Array([5,1,1]), - expectedSize: new Int32Array([1,2]), // 1 * 2 * 4 = 8 + expectedDim: new Int32Array([5, 1, 1]), + expectedSize: new Int32Array([1, 2]), // 1 * 2 * 4 = 8 expectedType: gl.UNSIGNED_BYTE, expectedConstantTextureCount: 1, expectedPixelStorei: false, @@ -258,21 +243,19 @@ test('Array with single precision', () => { setupConstantsTestSuite({ gpuSettings: { precision: 'single', - output: [4] + output: [4], }, constant: [ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5 + 1, 2, 3, 4, 5, ], expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5,0,0,0 + 1, 2, 3, 4, 5, 0, 0, 0, ]), - expectedDim: new Int32Array([5,1,1]), - expectedSize: new Int32Array([1,2]), + expectedDim: new Int32Array([5, 1, 1]), + expectedSize: new Int32Array([1, 2]), expectedType: gl.FLOAT, expectedTextureWidth: 1, expectedTextureHeight: 2, @@ -284,21 +267,19 @@ test('Float32Array with single precision', () => { setupConstantsTestSuite({ gpuSettings: { precision: 'single', - output: [4] + output: [4], }, constant: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5 + 1, 2, 3, 4, 5, ]), expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5,0,0,0 + 1, 2, 3, 4, 5, 0, 0, 0, ]), - expectedDim: new Int32Array([5,1,1]), - expectedSize: new Int32Array([1,2]), + expectedDim: new Int32Array([5, 1, 1]), + expectedSize: new Int32Array([1, 2]), expectedType: gl.FLOAT, expectedTextureWidth: 1, expectedTextureHeight: 2, @@ -310,22 +291,20 @@ test('Uint16Array with single precision', () => { setupConstantsTestSuite({ gpuSettings: { precision: 'single', - output: [4] + output: [4], }, constant: new Uint16Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5 + 1, 2, 3, 4, 5, ]), // upconverted from 2 expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5,0,0,0 + 1, 2, 3, 4, 5, 0, 0, 0, ]), - expectedDim: new Int32Array([5,1,1]), - expectedSize: new Int32Array([1,2]), + expectedDim: new Int32Array([5, 1, 1]), + expectedSize: new Int32Array([1, 2]), expectedType: gl.FLOAT, expectedConstantTextureCount: 1, expectedPixelStorei: false, @@ -335,22 +314,20 @@ test('Uint8Array with single precision', () => { setupConstantsTestSuite({ gpuSettings: { precision: 'single', - output: [4] + output: [4], }, constant: new Uint8Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5 + 1, 2, 3, 4, 5, ]), // upconverted from 1 expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5,0,0,0 + 1, 2, 3, 4, 5, 0, 0, 0, ]), - expectedDim: new Int32Array([5,1,1]), - expectedSize: new Int32Array([1,2]), + expectedDim: new Int32Array([5, 1, 1]), + expectedSize: new Int32Array([1, 2]), expectedType: gl.FLOAT, expectedConstantTextureCount: 1, expectedPixelStorei: false, @@ -361,18 +338,13 @@ test('Array with unsigned precision length 33', () => { setupConstantsTestSuite({ gpuSettings: { precision: 'unsigned', - output: [5] + output: [5], }, constant: [ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 1 per RGBA, so only 1 of the 4 channels is used // NOTE: 6x6 - 1, 2, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, - 31, 32, 33 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ], expectedBitRatio: 4, expectedPixels: new Uint8Array( @@ -380,16 +352,11 @@ test('Array with unsigned precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 1 per RGBA, so only 1 of the 4 channels is used // NOTE: 6x6 - 1, 2, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, - 31, 32, 33, 0, 0, 0 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]).buffer ), - expectedDim: new Int32Array([33,1,1]), - expectedSize: new Int32Array([6,6]), // 3 * 3 = 9 * 4 = 34 + expectedDim: new Int32Array([33, 1, 1]), + expectedSize: new Int32Array([6, 6]), // 3 * 3 = 9 * 4 = 34 expectedType: gl.UNSIGNED_BYTE, expectedConstantTextureCount: 1, expectedPixelStorei: false, @@ -400,18 +367,13 @@ test('Float32Array with unsigned precision length 33', () => { setupConstantsTestSuite({ gpuSettings: { precision: 'unsigned', - output: [5] + output: [5], }, constant: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 1 per RGBA, so only 1 of the 4 channels is used // NOTE: 6x6 - 1, 2, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, - 31, 32, 33 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ]), expectedBitRatio: 4, expectedPixels: new Uint8Array( @@ -419,16 +381,11 @@ test('Float32Array with unsigned precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 1 per RGBA, so only 1 of the 4 channels is used // NOTE: 6x6 - 1, 2, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, - 31, 32, 33, 0, 0, 0, + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]).buffer ), - expectedDim: new Int32Array([33,1,1]), - expectedSize: new Int32Array([6,6]), // 3 * 3 = 9 * 4 = 34 + expectedDim: new Int32Array([33, 1, 1]), + expectedSize: new Int32Array([6, 6]), // 3 * 3 = 9 * 4 = 34 expectedType: gl.UNSIGNED_BYTE, expectedConstantTextureCount: 1, expectedPixelStorei: false, @@ -439,17 +396,13 @@ test('Uint16Array with unsigned precision length 33', () => { setupConstantsTestSuite({ gpuSettings: { precision: 'unsigned', - output: [5] + output: [5], }, constant: new Uint16Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 2 per RGBA, so only 2 of the 4 channels is used // NOTE: 4x5 - 1,2, 3,4, 5,6, 7,8, - 9,10, 11,12, 13,14, 15,16, - 17,18, 19,20, 21,22, 23,24, - 25,26, 27,28, 29,30, 31,32, - 33, + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ]), expectedBitRatio: 2, expectedPixels: new Uint8Array( @@ -457,15 +410,11 @@ test('Uint16Array with unsigned precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 2 per RGBA, so only 2 of the 4 channels is used // NOTE: 4x5 - 1,2, 3,4, 5,6, 7,8, - 9,10, 11,12, 13,14, 15,16, - 17,18, 19,20, 21,22, 23,24, - 25,26, 27,28, 29,30, 31,32, - 33,0, 0,0, 0,0, 0,0 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, 0, 0, 0, 0, ]).buffer ), - expectedDim: new Int32Array([33,1,1]), - expectedSize: new Int32Array([4,5]), // 3 * 3 = 9 * 4 = 34 + expectedDim: new Int32Array([33, 1, 1]), + expectedSize: new Int32Array([4, 5]), // 3 * 3 = 9 * 4 = 34 expectedType: gl.UNSIGNED_BYTE, expectedConstantTextureCount: 1, expectedPixelStorei: false, @@ -476,28 +425,25 @@ test('Uint8Array with unsigned precision length 33', () => { setupConstantsTestSuite({ gpuSettings: { precision: 'unsigned', - output: [5] + output: [5], }, constant: new Uint8Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so only 2 of the 4 channels is used // NOTE: 3x3 - 1,2,3,4, 5,6,7,8, 9,10,11,12, - 13,14,15,16, 17,18,19,20, 21,22,23,24, - 25,26, 27,28, 29,30,31,32, 33 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ]), expectedBitRatio: 1, expectedPixels: new Uint8Array( new Uint8Array([ - // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - // NOTE: Packing is 4 per RGBA, so only 2 of the 4 channels is used - // NOTE: 3x3 - 1,2,3,4, 5,6,7,8, 9,10,11,12, - 13,14,15,16, 17,18,19,20, 21,22,23,24, - 25,26, 27,28, 29,30,31,32, 33,0,0,0 - ]).buffer), - expectedDim: new Int32Array([33,1,1]), - expectedSize: new Int32Array([3,3]), // 3 * 3 = 9 * 4 = 34 + // NOTE: formatted like rectangle on purpose, so you can see how the texture should look + // NOTE: Packing is 4 per RGBA, so only 2 of the 4 channels is used + // NOTE: 3x3 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, + ]).buffer + ), + expectedDim: new Int32Array([33, 1, 1]), + expectedSize: new Int32Array([3, 3]), // 3 * 3 = 9 * 4 = 34 expectedType: gl.UNSIGNED_BYTE, expectedConstantTextureCount: 1, expectedPixelStorei: false, @@ -508,27 +454,23 @@ test('Array with single precision length 33', () => { setupConstantsTestSuite({ gpuSettings: { precision: 'single', - output: [5] + output: [5], }, constant: [ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1,2,3,4, 5,6,7,8, 9,10,11,12, - 13,14,15,16, 17,18,19,20, 21,22,23,24, - 25,26,27,28, 29,30,31,32, 33 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ], expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1,2,3,4, 5,6,7,8, 9,10,11,12, - 13,14,15,16, 17,18,19,20, 21,22,23,24, - 25,26,27,28, 29,30,31,32, 33,0,0,0 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]), - expectedDim: new Int32Array([33,1,1]), - expectedSize: new Int32Array([3,3]), // 3 * 3 = 9 * 4 = 34 + expectedDim: new Int32Array([33, 1, 1]), + expectedSize: new Int32Array([3, 3]), // 3 * 3 = 9 * 4 = 34 expectedType: gl.FLOAT, expectedConstantTextureCount: 1, expectedPixelStorei: false, @@ -539,27 +481,23 @@ test('Float32Array with single precision length 33', () => { setupConstantsTestSuite({ gpuSettings: { precision: 'single', - output: [5] + output: [5], }, constant: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1,2,3,4, 5,6,7,8, 9,10,11,12, - 13,14,15,16, 17,18,19,20, 21,22,23,24, - 25,26,27,28, 29,30,31,32, 33 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ]), expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1,2,3,4, 5,6,7,8, 9,10,11,12, - 13,14,15,16, 17,18,19,20, 21,22,23,24, - 25,26,27,28, 29,30,31,32, 33,0,0,0 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]), - expectedDim: new Int32Array([33,1,1]), - expectedSize: new Int32Array([3,3]), // 3 * 3 = 9 * 4 = 34 + expectedDim: new Int32Array([33, 1, 1]), + expectedSize: new Int32Array([3, 3]), // 3 * 3 = 9 * 4 = 34 expectedType: gl.FLOAT, expectedConstantTextureCount: 1, expectedPixelStorei: false, @@ -570,15 +508,13 @@ test('Uint16Array with single precision length 33', () => { setupConstantsTestSuite({ gpuSettings: { precision: 'single', - output: [5] + output: [5], }, constant: new Uint16Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1,2,3,4, 5,6,7,8, 9,10,11,12, - 13,14,15,16, 17,18,19,20, 21,22,23,24, - 25,26,27,28, 29,30,31,32, 33 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ]), // upconverted from 2 expectedBitRatio: 4, @@ -586,12 +522,10 @@ test('Uint16Array with single precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1,2,3,4, 5,6,7,8, 9,10,11,12, - 13,14,15,16, 17,18,19,20, 21,22,23,24, - 25,26,27,28, 29,30,31,32, 33,0,0,0 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]), - expectedDim: new Int32Array([33,1,1]), - expectedSize: new Int32Array([3,3]), // 3 * 3 = 9 * 4 = 36 + expectedDim: new Int32Array([33, 1, 1]), + expectedSize: new Int32Array([3, 3]), // 3 * 3 = 9 * 4 = 36 expectedType: gl.FLOAT, expectedConstantTextureCount: 1, expectedPixelStorei: false, @@ -602,15 +536,13 @@ test('Uint8Array with single precision length 33', () => { setupConstantsTestSuite({ gpuSettings: { precision: 'single', - output: [5] + output: [5], }, constant: new Uint8Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1,2,3,4, 5,6,7,8, 9,10,11,12, - 13,14,15,16, 17,18,19,20, 21,22,23,24, - 25,26,27,28, 29,30,31,32, 33 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ]), // upconverted from 1 expectedBitRatio: 4, @@ -618,12 +550,10 @@ test('Uint8Array with single precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1,2,3,4, 5,6,7,8, 9,10,11,12, - 13,14,15,16, 17,18,19,20, 21,22,23,24, - 25,26,27,28, 29,30,31,32, 33,0,0,0 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]), - expectedDim: new Int32Array([33,1,1]), - expectedSize: new Int32Array([3,3]), // 3 * 3 = 9 * 4 = 36 + expectedDim: new Int32Array([33, 1, 1]), + expectedSize: new Int32Array([3, 3]), // 3 * 3 = 9 * 4 = 36 expectedType: gl.FLOAT, expectedConstantTextureCount: 1, expectedPixelStorei: false, @@ -636,21 +566,24 @@ test('Input(Array) with unsigned precision 5 length', () => { setupConstantsTestSuite({ gpuSettings: { precision: 'unsigned', - output: [4] + output: [4], }, - constant: input([ - // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, - 5, 0 - ], [2,3]), + constant: input( + [ + // NOTE: formatted like rectangle on purpose, so you can see how the texture should look + 1, 2, 3, 4, 5, 0, + ], + [2, 3] + ), expectedBitRatio: 4, - expectedPixels: new Uint8Array(new Float32Array([ - // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5,0,0,0 - ]).buffer), - expectedDim: new Int32Array([2,3,1]), - expectedSize: new Int32Array([4,2]), // 4 * 2 = 8 + expectedPixels: new Uint8Array( + new Float32Array([ + // NOTE: formatted like rectangle on purpose, so you can see how the texture should look + 1, 2, 3, 4, 5, 0, 0, 0, + ]).buffer + ), + expectedDim: new Int32Array([2, 3, 1]), + expectedSize: new Int32Array([4, 2]), // 4 * 2 = 8 expectedType: gl.UNSIGNED_BYTE, expectedConstantTextureCount: 1, expectedPixelStorei: false, @@ -660,23 +593,24 @@ test('Input(Float32Array) with unsigned precision 5 length', () => { setupConstantsTestSuite({ gpuSettings: { precision: 'unsigned', - output: [4] + output: [4], }, - constant: input(new Float32Array([ - // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, - 5 - ]), [5]), + constant: input( + new Float32Array([ + // NOTE: formatted like rectangle on purpose, so you can see how the texture should look + 1, 2, 3, 4, 5, + ]), + [5] + ), expectedBitRatio: 4, expectedPixels: new Uint8Array( new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5,0,0,0 + 1, 2, 3, 4, 5, 0, 0, 0, ]).buffer ), - expectedDim: new Int32Array([5,1,1]), - expectedSize: new Int32Array([4,2]), // 4 * 2 * 1 = 8 + expectedDim: new Int32Array([5, 1, 1]), + expectedSize: new Int32Array([4, 2]), // 4 * 2 * 1 = 8 expectedType: gl.UNSIGNED_BYTE, expectedConstantTextureCount: 1, expectedPixelStorei: false, @@ -686,23 +620,24 @@ test('Input(Uint16Array) with unsigned precision 5 length', () => { setupConstantsTestSuite({ gpuSettings: { precision: 'unsigned', - output: [4] + output: [4], }, - constant: input(new Uint16Array([ - // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, - 5, 0, - ]), [2,3]), + constant: input( + new Uint16Array([ + // NOTE: formatted like rectangle on purpose, so you can see how the texture should look + 1, 2, 3, 4, 5, 0, + ]), + [2, 3] + ), expectedBitRatio: 2, expectedPixels: new Uint8Array( new Uint16Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5,0,0,0 + 1, 2, 3, 4, 5, 0, 0, 0, ]).buffer ), - expectedDim: new Int32Array([2,3,1]), - expectedSize: new Int32Array([2,2]), // 2 * 2 * 2 = 8 + expectedDim: new Int32Array([2, 3, 1]), + expectedSize: new Int32Array([2, 2]), // 2 * 2 * 2 = 8 expectedType: gl.UNSIGNED_BYTE, expectedConstantTextureCount: 1, expectedPixelStorei: false, @@ -712,20 +647,16 @@ test('Input(Uint8Array) with unsigned precision 5 length', () => { setupConstantsTestSuite({ gpuSettings: { precision: 'unsigned', - output: [5] + output: [5], }, - constant: input(new Uint8Array([ - 1, 2, 3, 4, - 5,0 - ]),[2, 3]), + constant: input(new Uint8Array([1, 2, 3, 4, 5, 0]), [2, 3]), expectedBitRatio: 1, expectedPixels: new Uint8Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5,0,0,0 + 1, 2, 3, 4, 5, 0, 0, 0, ]), - expectedDim: new Int32Array([2,3,1]), - expectedSize: new Int32Array([1,2]), // 1 * 2 * 4 = 8 + expectedDim: new Int32Array([2, 3, 1]), + expectedSize: new Int32Array([1, 2]), // 1 * 2 * 4 = 8 expectedType: gl.UNSIGNED_BYTE, expectedConstantTextureCount: 1, expectedPixelStorei: false, @@ -736,21 +667,22 @@ test('Input(Array) with single precision', () => { setupConstantsTestSuite({ gpuSettings: { precision: 'single', - output: [4] + output: [4], }, - constant: input([ - // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5,0 - ], [2,3]), + constant: input( + [ + // NOTE: formatted like rectangle on purpose, so you can see how the texture should look + 1, 2, 3, 4, 5, 0, + ], + [2, 3] + ), expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5,0,0,0 + 1, 2, 3, 4, 5, 0, 0, 0, ]), - expectedDim: new Int32Array([2,3,1]), - expectedSize: new Int32Array([1,2]), + expectedDim: new Int32Array([2, 3, 1]), + expectedSize: new Int32Array([1, 2]), expectedType: gl.FLOAT, expectedTextureWidth: 1, expectedTextureHeight: 2, @@ -762,21 +694,22 @@ test('Input(Float32Array) with single precision', () => { setupConstantsTestSuite({ gpuSettings: { precision: 'single', - output: [4] + output: [4], }, - constant: input(new Float32Array([ - // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5,0 - ]),[2,3]), + constant: input( + new Float32Array([ + // NOTE: formatted like rectangle on purpose, so you can see how the texture should look + 1, 2, 3, 4, 5, 0, + ]), + [2, 3] + ), expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5,0,0,0 + 1, 2, 3, 4, 5, 0, 0, 0, ]), - expectedDim: new Int32Array([2,3,1]), - expectedSize: new Int32Array([1,2]), + expectedDim: new Int32Array([2, 3, 1]), + expectedSize: new Int32Array([1, 2]), expectedType: gl.FLOAT, expectedTextureWidth: 1, expectedTextureHeight: 2, @@ -788,22 +721,23 @@ test('Input(Uint16Array) with single precision', () => { setupConstantsTestSuite({ gpuSettings: { precision: 'single', - output: [4] + output: [4], }, - constant: input(new Uint16Array([ - // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5,0 - ]), [2,3]), + constant: input( + new Uint16Array([ + // NOTE: formatted like rectangle on purpose, so you can see how the texture should look + 1, 2, 3, 4, 5, 0, + ]), + [2, 3] + ), // upconverted from 2 expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5,0,0,0 + 1, 2, 3, 4, 5, 0, 0, 0, ]), - expectedDim: new Int32Array([2,3,1]), - expectedSize: new Int32Array([1,2]), + expectedDim: new Int32Array([2, 3, 1]), + expectedSize: new Int32Array([1, 2]), expectedType: gl.FLOAT, expectedConstantTextureCount: 1, expectedPixelStorei: false, @@ -813,22 +747,23 @@ test('Input(Uint8Array) with single precision', () => { setupConstantsTestSuite({ gpuSettings: { precision: 'single', - output: [4] + output: [4], }, - constant: input(new Uint8Array([ - // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5,0 - ]), [2,3]), + constant: input( + new Uint8Array([ + // NOTE: formatted like rectangle on purpose, so you can see how the texture should look + 1, 2, 3, 4, 5, 0, + ]), + [2, 3] + ), // upconverted from 1 expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1,2,3,4, - 5,0,0,0 + 1, 2, 3, 4, 5, 0, 0, 0, ]), - expectedDim: new Int32Array([2,3,1]), - expectedSize: new Int32Array([1,2]), + expectedDim: new Int32Array([2, 3, 1]), + expectedSize: new Int32Array([1, 2]), expectedType: gl.FLOAT, expectedConstantTextureCount: 1, expectedPixelStorei: false, @@ -839,35 +774,28 @@ test('Input(Array) with unsigned precision length 33', () => { setupConstantsTestSuite({ gpuSettings: { precision: 'unsigned', - output: [5] + output: [5], }, - constant: input([ - // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - // NOTE: Packing is 1 per RGBA, so only 1 of the 4 channels is used - // NOTE: 6x6 - 1, 2, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, - 31, 32, 33 - ], [33]), + constant: input( + [ + // NOTE: formatted like rectangle on purpose, so you can see how the texture should look + // NOTE: Packing is 1 per RGBA, so only 1 of the 4 channels is used + // NOTE: 6x6 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + ], + [33] + ), expectedBitRatio: 4, expectedPixels: new Uint8Array( new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 1 per RGBA, so only 1 of the 4 channels is used // NOTE: 6x6 - 1, 2, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, - 31, 32, 33, 0, 0, 0 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]).buffer ), - expectedDim: new Int32Array([33,1,1]), - expectedSize: new Int32Array([6,6]), // 3 * 3 = 9 * 4 = 34 + expectedDim: new Int32Array([33, 1, 1]), + expectedSize: new Int32Array([6, 6]), // 3 * 3 = 9 * 4 = 34 expectedType: gl.UNSIGNED_BYTE, expectedConstantTextureCount: 1, expectedPixelStorei: false, @@ -878,35 +806,28 @@ test('Input(Float32Array) with unsigned precision length 33', () => { setupConstantsTestSuite({ gpuSettings: { precision: 'unsigned', - output: [5] + output: [5], }, - constant: input(new Float32Array([ - // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - // NOTE: Packing is 1 per RGBA, so only 1 of the 4 channels is used - // NOTE: 6x6 - 1, 2, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, - 31, 32, 33 - ]), [33]), + constant: input( + new Float32Array([ + // NOTE: formatted like rectangle on purpose, so you can see how the texture should look + // NOTE: Packing is 1 per RGBA, so only 1 of the 4 channels is used + // NOTE: 6x6 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + ]), + [33] + ), expectedBitRatio: 4, expectedPixels: new Uint8Array( new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 1 per RGBA, so only 1 of the 4 channels is used // NOTE: 6x6 - 1, 2, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, - 31, 32, 33, 0, 0, 0, + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]).buffer ), - expectedDim: new Int32Array([33,1,1]), - expectedSize: new Int32Array([6,6]), // 3 * 3 = 9 * 4 = 34 + expectedDim: new Int32Array([33, 1, 1]), + expectedSize: new Int32Array([6, 6]), // 3 * 3 = 9 * 4 = 34 expectedType: gl.UNSIGNED_BYTE, expectedConstantTextureCount: 1, expectedPixelStorei: false, @@ -917,33 +838,28 @@ test('Input(Uint16Array) with unsigned precision length 33', () => { setupConstantsTestSuite({ gpuSettings: { precision: 'unsigned', - output: [5] + output: [5], }, - constant: input(new Uint16Array([ - // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - // NOTE: Packing is 2 per RGBA, so only 2 of the 4 channels is used - // NOTE: 4x5 - 1,2, 3,4, 5,6, 7,8, - 9,10, 11,12, 13,14, 15,16, - 17,18, 19,20, 21,22, 23,24, - 25,26, 27,28, 29,30, 31,32, - 33, - ]), [33]), + constant: input( + new Uint16Array([ + // NOTE: formatted like rectangle on purpose, so you can see how the texture should look + // NOTE: Packing is 2 per RGBA, so only 2 of the 4 channels is used + // NOTE: 4x5 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + ]), + [33] + ), expectedBitRatio: 2, expectedPixels: new Uint8Array( new Uint16Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 2 per RGBA, so only 2 of the 4 channels is used // NOTE: 4x5 - 1,2, 3,4, 5,6, 7,8, - 9,10, 11,12, 13,14, 15,16, - 17,18, 19,20, 21,22, 23,24, - 25,26, 27,28, 29,30, 31,32, - 33,0, 0,0, 0,0, 0,0 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, 0, 0, 0, 0, ]).buffer ), - expectedDim: new Int32Array([33,1,1]), - expectedSize: new Int32Array([4,5]), // 3 * 3 = 9 * 4 = 34 + expectedDim: new Int32Array([33, 1, 1]), + expectedSize: new Int32Array([4, 5]), // 3 * 3 = 9 * 4 = 34 expectedType: gl.UNSIGNED_BYTE, expectedConstantTextureCount: 1, expectedPixelStorei: false, @@ -954,28 +870,28 @@ test('Input(Uint8Array) with unsigned precision length 33', () => { setupConstantsTestSuite({ gpuSettings: { precision: 'unsigned', - output: [5] + output: [5], }, - constant: input(new Uint8Array([ - // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - // NOTE: Packing is 4 per RGBA, so only 2 of the 4 channels is used - // NOTE: 3x3 - 1,2,3,4, 5,6,7,8, 9,10,11,12, - 13,14,15,16, 17,18,19,20, 21,22,23,24, - 25,26, 27,28, 29,30,31,32, 33 - ]), [33]), + constant: input( + new Uint8Array([ + // NOTE: formatted like rectangle on purpose, so you can see how the texture should look + // NOTE: Packing is 4 per RGBA, so only 2 of the 4 channels is used + // NOTE: 3x3 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + ]), + [33] + ), expectedBitRatio: 1, expectedPixels: new Uint8Array( new Uint8Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so only 2 of the 4 channels is used // NOTE: 3x3 - 1,2,3,4, 5,6,7,8, 9,10,11,12, - 13,14,15,16, 17,18,19,20, 21,22,23,24, - 25,26, 27,28, 29,30,31,32, 33,0,0,0 - ]).buffer), - expectedDim: new Int32Array([33,1,1]), - expectedSize: new Int32Array([3,3]), // 3 * 3 = 9 * 4 = 34 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, + ]).buffer + ), + expectedDim: new Int32Array([33, 1, 1]), + expectedSize: new Int32Array([3, 3]), // 3 * 3 = 9 * 4 = 34 expectedType: gl.UNSIGNED_BYTE, expectedConstantTextureCount: 1, expectedPixelStorei: false, @@ -986,27 +902,26 @@ test('Input(Array) with single precision length 33', () => { setupConstantsTestSuite({ gpuSettings: { precision: 'single', - output: [5] + output: [5], }, - constant: input([ - // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used - // NOTE: 3x3 - 1,2,3,4, 5,6,7,8, 9,10,11,12, - 13,14,15,16, 17,18,19,20, 21,22,23,24, - 25,26,27,28, 29,30,31,32, 33 - ], [33]), + constant: input( + [ + // NOTE: formatted like rectangle on purpose, so you can see how the texture should look + // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used + // NOTE: 3x3 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + ], + [33] + ), expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1,2,3,4, 5,6,7,8, 9,10,11,12, - 13,14,15,16, 17,18,19,20, 21,22,23,24, - 25,26,27,28, 29,30,31,32, 33,0,0,0 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]), - expectedDim: new Int32Array([33,1,1]), - expectedSize: new Int32Array([3,3]), // 3 * 3 = 9 * 4 = 34 + expectedDim: new Int32Array([33, 1, 1]), + expectedSize: new Int32Array([3, 3]), // 3 * 3 = 9 * 4 = 34 expectedType: gl.FLOAT, expectedConstantTextureCount: 1, expectedPixelStorei: false, @@ -1017,27 +932,26 @@ test('Input(Float32Array) with single precision length 33', () => { setupConstantsTestSuite({ gpuSettings: { precision: 'single', - output: [5] + output: [5], }, - constant: input(new Float32Array([ - // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used - // NOTE: 3x3 - 1,2,3,4, 5,6,7,8, 9,10,11,12, - 13,14,15,16, 17,18,19,20, 21,22,23,24, - 25,26,27,28, 29,30,31,32, 33 - ]), [33]), + constant: input( + new Float32Array([ + // NOTE: formatted like rectangle on purpose, so you can see how the texture should look + // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used + // NOTE: 3x3 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + ]), + [33] + ), expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1,2,3,4, 5,6,7,8, 9,10,11,12, - 13,14,15,16, 17,18,19,20, 21,22,23,24, - 25,26,27,28, 29,30,31,32, 33,0,0,0 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]), - expectedDim: new Int32Array([33,1,1]), - expectedSize: new Int32Array([3,3]), // 3 * 3 = 9 * 4 = 34 + expectedDim: new Int32Array([33, 1, 1]), + expectedSize: new Int32Array([3, 3]), // 3 * 3 = 9 * 4 = 34 expectedType: gl.FLOAT, expectedConstantTextureCount: 1, expectedPixelStorei: false, @@ -1048,28 +962,27 @@ test('Input(Uint16Array) with single precision length 33', () => { setupConstantsTestSuite({ gpuSettings: { precision: 'single', - output: [5] + output: [5], }, - constant: input(new Uint16Array([ - // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used - // NOTE: 3x3 - 1,2,3,4, 5,6,7,8, 9,10,11,12, - 13,14,15,16, 17,18,19,20, 21,22,23,24, - 25,26,27,28, 29,30,31,32, 33 - ]), [33]), + constant: input( + new Uint16Array([ + // NOTE: formatted like rectangle on purpose, so you can see how the texture should look + // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used + // NOTE: 3x3 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + ]), + [33] + ), // upconverted from 2 expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1,2,3,4, 5,6,7,8, 9,10,11,12, - 13,14,15,16, 17,18,19,20, 21,22,23,24, - 25,26,27,28, 29,30,31,32, 33,0,0,0 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]), - expectedDim: new Int32Array([33,1,1]), - expectedSize: new Int32Array([3,3]), // 3 * 3 = 9 * 4 = 36 + expectedDim: new Int32Array([33, 1, 1]), + expectedSize: new Int32Array([3, 3]), // 3 * 3 = 9 * 4 = 36 expectedType: gl.FLOAT, expectedConstantTextureCount: 1, expectedPixelStorei: false, @@ -1080,28 +993,27 @@ test('Input(Uint8Array) with single precision length 33', () => { setupConstantsTestSuite({ gpuSettings: { precision: 'single', - output: [5] + output: [5], }, - constant: input(new Uint8Array([ - // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - // NOTE: Packing is 4 per RGBA (8 bit, but upconverted to float32), so only 4 of the 4 channels is used - // NOTE: 3x3 - 1,2,3,4, 5,6,7,8, 9,10,11,12, - 13,14,15,16, 17,18,19,20, 21,22,23,24, - 25,26,27,28, 29,30,31,32, 33 - ]), [33]), + constant: input( + new Uint8Array([ + // NOTE: formatted like rectangle on purpose, so you can see how the texture should look + // NOTE: Packing is 4 per RGBA (8 bit, but upconverted to float32), so only 4 of the 4 channels is used + // NOTE: 3x3 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + ]), + [33] + ), // upconverted to float32 expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA (8 bit, but upconverted to float32), so only 4 of the 4 channels is used // NOTE: 3x3 - 1,2,3,4, 5,6,7,8, 9,10,11,12, - 13,14,15,16, 17,18,19,20, 21,22,23,24, - 25,26,27,28, 29,30,31,32, 33,0,0,0 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]), - expectedDim: new Int32Array([33,1,1]), - expectedSize: new Int32Array([3,3]), // 3 * 3 = 9 * 4 = 36 + expectedDim: new Int32Array([33, 1, 1]), + expectedSize: new Int32Array([3, 3]), // 3 * 3 = 9 * 4 = 36 expectedType: gl.FLOAT, expectedConstantTextureCount: 1, expectedPixelStorei: false, diff --git a/test/internal/boolean.js b/test/internal/boolean.js index 84c8647f..a4a1d233 100644 --- a/test/internal/boolean.js +++ b/test/internal/boolean.js @@ -5,15 +5,18 @@ describe('internal: boolean'); function booleanLiteral(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function() { - const v = true === true; - if (v) { - return 1; + const kernel = gpu.createKernel( + function () { + const v = true === true; + if (v) { + return 1; + } + return 0; + }, + { + output: [1], } - return 0; - }, { - output: [1], - }); + ); const result = kernel(); assert.ok(result[0]); gpu.destroy(); @@ -43,17 +46,19 @@ test('boolean literal cpu', () => { booleanLiteral('cpu'); }); - function booleanArgumentTrue(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(v) { - if (v) { - return 1; + const kernel = gpu.createKernel( + function (v) { + if (v) { + return 1; + } + return 0; + }, + { + output: [1], } - return 0; - }, { - output: [1], - }); + ); const result = kernel(true); assert.ok(result[0]); gpu.destroy(); @@ -83,17 +88,19 @@ test('boolean argument true cpu', () => { booleanArgumentTrue('cpu'); }); - function booleanArgumentFalse(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(v) { - if (v) { - return 1; + const kernel = gpu.createKernel( + function (v) { + if (v) { + return 1; + } + return 0; + }, + { + output: [1], } - return 0; - }, { - output: [1], - }); + ); const result = kernel(false); assert.notOk(result[0]); gpu.destroy(); @@ -123,18 +130,20 @@ test('boolean argument false cpu', () => { booleanArgumentFalse('cpu'); }); - function booleanVariableTrue(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function() { - const v = true; - if (v) { - return 1; + const kernel = gpu.createKernel( + function () { + const v = true; + if (v) { + return 1; + } + return 0; + }, + { + output: [1], } - return 0; - }, { - output: [1], - }); + ); const result = kernel(); assert.ok(result[0]); gpu.destroy(); @@ -166,15 +175,18 @@ test('boolean variable true cpu', () => { function booleanVariableFalse(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function() { - const v = false; - if (v) { - return 1; + const kernel = gpu.createKernel( + function () { + const v = false; + if (v) { + return 1; + } + return 0; + }, + { + output: [1], } - return 0; - }, { - output: [1], - }); + ); const result = kernel(); assert.notOk(result[0]); gpu.destroy(); @@ -206,15 +218,18 @@ test('boolean variable false cpu', () => { function booleanExpressionTrue(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function() { - const v = 1 > 0; - if (v) { - return 1; + const kernel = gpu.createKernel( + function () { + const v = 1 > 0; + if (v) { + return 1; + } + return 0; + }, + { + output: [1], } - return 0; - }, { - output: [1], - }); + ); const result = kernel(); assert.ok(result[0]); gpu.destroy(); @@ -244,18 +259,20 @@ test('boolean expression true cpu', () => { booleanExpressionTrue('cpu'); }); - function booleanExpressionFalse(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function() { - const v = 1 < 0; - if (v) { - return 1; + const kernel = gpu.createKernel( + function () { + const v = 1 < 0; + if (v) { + return 1; + } + return 0; + }, + { + output: [1], } - return 0; - }, { - output: [1], - }); + ); const result = kernel(); assert.notOk(result[0]); gpu.destroy(); @@ -283,4 +300,4 @@ test('boolean expression false gpu', () => { test('boolean expression false cpu', () => { booleanExpressionFalse('cpu'); -}); \ No newline at end of file +}); diff --git a/test/internal/casting.js b/test/internal/casting.js index 9567e9fa..568c2ddd 100644 --- a/test/internal/casting.js +++ b/test/internal/casting.js @@ -5,16 +5,19 @@ describe('internal: casting'); function castingOffsetByThreadXAndOutputX(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(value) { - // value will be a number - // this.thread.x is an integer - // this.output.x is treated as a literal, so can be either integer or float - // return value will be float - return this.thread.x + (this.output.x * value); - }, { - output: [1], - strictIntegers: true, - }); + const kernel = gpu.createKernel( + function (value) { + // value will be a number + // this.thread.x is an integer + // this.output.x is treated as a literal, so can be either integer or float + // return value will be float + return this.thread.x + this.output.x * value; + }, + { + output: [1], + strictIntegers: true, + } + ); const result = kernel(1); assert.equal(result[0], 1); assert.deepEqual(kernel.argumentTypes, ['Integer']); @@ -33,14 +36,20 @@ function castingOffsetByThreadXAndOutputX(mode) { function handleCastingIntsWithNativeFunctions(mode) { const gpu = new GPU({ mode }); - gpu.addNativeFunction('add', ` + gpu.addNativeFunction( + 'add', + ` int add(int value1, int value2) { return value1 + value2; } - `); - const kernel = gpu.createKernel(function(value1, value2) { - return add(value1, value2); - }, { output: [1] }); + ` + ); + const kernel = gpu.createKernel( + function (value1, value2) { + return add(value1, value2); + }, + { output: [1] } + ); const result = kernel(0.5, 2.5); assert.deepEqual(Array.from(result), [2]); assert.deepEqual(kernel.argumentTypes, ['Float', 'Float']); @@ -57,21 +66,26 @@ function handleCastingIntsWithNativeFunctions(mode) { handleCastingIntsWithNativeFunctions('headlessgl'); }); - function handleCastingFloatsWithNativeFunctions(mode) { const gpu = new GPU({ mode }); - gpu.addNativeFunction('add', ` + gpu.addNativeFunction( + 'add', + ` float add(float value1, float value2) { return value1 + value2; } - `); - const kernel = gpu.createKernel(function(value1, value2) { - return add(value1, value2); - }, { - argumentTypes: ['Integer', 'Integer'], - output: [1], - strictIntegers: true, - }); + ` + ); + const kernel = gpu.createKernel( + function (value1, value2) { + return add(value1, value2); + }, + { + argumentTypes: ['Integer', 'Integer'], + output: [1], + strictIntegers: true, + } + ); const result = kernel(1, 2); assert.deepEqual(Array.from(result), [3]); assert.deepEqual(kernel.argumentTypes, ['Integer', 'Integer']); @@ -88,20 +102,25 @@ function handleCastingFloatsWithNativeFunctions(mode) { handleCastingFloatsWithNativeFunctions('headlessgl'); }); - function handleCastingMixedWithNativeFunctions(mode) { const gpu = new GPU({ mode }); - gpu.addNativeFunction('add', ` + gpu.addNativeFunction( + 'add', + ` float add(float value1, int value2) { return value1 + float(value2); } - `); - const kernel = gpu.createKernel(function(value1, value2) { - return add(value1, value2); - }, { - output: [1], - strictIntegers: true, - }); + ` + ); + const kernel = gpu.createKernel( + function (value1, value2) { + return add(value1, value2); + }, + { + output: [1], + strictIntegers: true, + } + ); const result = kernel(1, 2.5); assert.deepEqual(Array.from(result), [3]); assert.deepEqual(kernel.argumentTypes, ['Integer', 'Float']); @@ -126,14 +145,17 @@ function handleCastingFloat(mode) { } gpu.addFunction(add, { argumentTypes: ['Float', 'Float'], - returnType: 'Float' - }); - const kernel = gpu.createKernel(function(value1, value2) { - return add(value1, value2); - }, { - output: [1], - argumentTypes: ['Integer', 'Integer'], + returnType: 'Float', }); + const kernel = gpu.createKernel( + function (value1, value2) { + return add(value1, value2); + }, + { + output: [1], + argumentTypes: ['Integer', 'Integer'], + } + ); const result = kernel(1, 2); assert.equal(result[0], 3); gpu.destroy(); @@ -151,7 +173,6 @@ function handleCastingFloat(mode) { handleCastingFloat('headlessgl'); }); - function handleCastingBeforeReturn(mode) { const gpu = new GPU({ mode }); @@ -162,9 +183,12 @@ function handleCastingBeforeReturn(mode) { argumentTypes: { v: 'Float' }, returnType: 'Integer', }); - const kernel = gpu.createKernel(function(v) { - return addOne(v); - }, { output: [1] }); + const kernel = gpu.createKernel( + function (v) { + return addOne(v); + }, + { output: [1] } + ); assert.equal(kernel(1)[0], 2); gpu.destroy(); } @@ -179,4 +203,4 @@ function handleCastingBeforeReturn(mode) { (GPU.isHeadlessGLSupported ? test : skip)('handle casting before return headlessgl', () => { handleCastingBeforeReturn('headlessgl'); -}); \ No newline at end of file +}); diff --git a/test/internal/constants-texture-switching.js b/test/internal/constants-texture-switching.js index b05e3aff..a4add14e 100644 --- a/test/internal/constants-texture-switching.js +++ b/test/internal/constants-texture-switching.js @@ -5,21 +5,23 @@ describe('internal: constants texture switching'); function testArray1D2(mode) { const gpu = new GPU({ mode }); - const texture = ( - gpu.createKernel(function() { return [this.thread.x, this.thread.x + 1]; }) + const texture = gpu + .createKernel(function () { + return [this.thread.x, this.thread.x + 1]; + }) .setOutput([10]) .setPipeline(true) - .setPrecision('single') - )(); + .setPrecision('single')(); const expected = texture.toArray(); - const kernel = gpu.createKernel(function() { + const kernel = gpu + .createKernel(function () { return this.constants.value[this.thread.x]; }) .setConstants({ - value: texture + value: texture, }) .setConstantTypes({ - value: 'Array1D(2)' + value: 'Array1D(2)', }) .setOutput([10]) .setPipeline(false) @@ -53,21 +55,23 @@ function testArray1D2(mode) { function testArray1D3(mode) { const gpu = new GPU({ mode }); - const texture = ( - gpu.createKernel(function() { return [this.thread.x, this.thread.x + 1, this.thread.x + 2]; }) + const texture = gpu + .createKernel(function () { + return [this.thread.x, this.thread.x + 1, this.thread.x + 2]; + }) .setOutput([10]) .setPipeline(true) - .setPrecision('single') - )(); + .setPrecision('single')(); const expected = texture.toArray(); - const kernel = gpu.createKernel(function() { + const kernel = gpu + .createKernel(function () { return this.constants.value[this.thread.x]; }) .setConstants({ - value: texture + value: texture, }) .setConstantTypes({ - value: 'Array1D(2)' + value: 'Array1D(2)', }) .setOutput([10]) .setPipeline(false) @@ -101,21 +105,23 @@ function testArray1D3(mode) { function testArray1D4(mode) { const gpu = new GPU({ mode }); - const texture = ( - gpu.createKernel(function() { return [this.thread.x, this.thread.x + 1, this.thread.x + 2, this.thread.x + 3]; }) + const texture = gpu + .createKernel(function () { + return [this.thread.x, this.thread.x + 1, this.thread.x + 2, this.thread.x + 3]; + }) .setOutput([10]) .setPipeline(true) - .setPrecision('single') - )(); + .setPrecision('single')(); const expected = texture.toArray(); - const kernel = gpu.createKernel(function() { + const kernel = gpu + .createKernel(function () { return this.constants.value[this.thread.x]; }) .setConstants({ - value: texture + value: texture, }) .setConstantTypes({ - value: 'Array1D(2)' + value: 'Array1D(2)', }) .setOutput([10]) .setPipeline(false) @@ -149,21 +155,23 @@ function testArray1D4(mode) { function testArray2D2(mode) { const gpu = new GPU({ mode }); - const texture = ( - gpu.createKernel(function() { return [this.thread.x, this.thread.y]; }) + const texture = gpu + .createKernel(function () { + return [this.thread.x, this.thread.y]; + }) .setOutput([10, 10]) .setPipeline(true) - .setPrecision('single') - )(); + .setPrecision('single')(); const expected = texture.toArray(); - const kernel = gpu.createKernel(function() { + const kernel = gpu + .createKernel(function () { return this.constants.value[this.thread.y][this.thread.x]; }) .setConstants({ - value: texture + value: texture, }) .setConstantTypes({ - value: 'Array1D(2)' + value: 'Array1D(2)', }) .setOutput([10, 10]) .setPipeline(false) @@ -197,21 +205,23 @@ function testArray2D2(mode) { function testArray2D3(mode) { const gpu = new GPU({ mode }); - const texture = ( - gpu.createKernel(function() { return [this.thread.x, this.thread.y, this.thread.x * this.thread.y]; }) + const texture = gpu + .createKernel(function () { + return [this.thread.x, this.thread.y, this.thread.x * this.thread.y]; + }) .setOutput([10, 10]) .setPipeline(true) - .setPrecision('single') - )(); + .setPrecision('single')(); const expected = texture.toArray(); - const kernel = gpu.createKernel(function() { + const kernel = gpu + .createKernel(function () { return this.constants.value[this.thread.y][this.thread.x]; }) .setConstants({ - value: texture + value: texture, }) .setConstantTypes({ - value: 'Array1D(2)' + value: 'Array1D(2)', }) .setOutput([10, 10]) .setPipeline(false) @@ -245,28 +255,23 @@ function testArray2D3(mode) { function testArray2D4(mode) { const gpu = new GPU({ mode }); - const texture = ( - gpu.createKernel(function() { - return [ - this.thread.x, - this.thread.y, - this.thread.x * this.thread.y, - this.thread.x / this.thread.y - ]; + const texture = gpu + .createKernel(function () { + return [this.thread.x, this.thread.y, this.thread.x * this.thread.y, this.thread.x / this.thread.y]; }) .setOutput([10, 10]) .setPipeline(true) - .setPrecision('single') - )(); + .setPrecision('single')(); const expected = texture.toArray(); - const kernel = gpu.createKernel(function() { + const kernel = gpu + .createKernel(function () { return this.constants.value[this.thread.y][this.thread.x]; }) .setConstants({ - value: texture + value: texture, }) .setConstantTypes({ - value: 'Array1D(2)' + value: 'Array1D(2)', }) .setOutput([10, 10]) .setPipeline(false) @@ -300,21 +305,23 @@ function testArray2D4(mode) { function testArray3D2(mode) { const gpu = new GPU({ mode }); - const texture = ( - gpu.createKernel(function() { return [this.thread.x, this.thread.x * this.thread.y * this.thread.z]; }) + const texture = gpu + .createKernel(function () { + return [this.thread.x, this.thread.x * this.thread.y * this.thread.z]; + }) .setOutput([10, 10, 10]) .setPipeline(true) - .setPrecision('single') - )(); + .setPrecision('single')(); const expected = texture.toArray(); - const kernel = gpu.createKernel(function() { + const kernel = gpu + .createKernel(function () { return this.constants.value[this.thread.z][this.thread.y][this.thread.x]; }) .setConstants({ - value: texture + value: texture, }) .setConstantTypes({ - value: 'Array1D(2)' + value: 'Array1D(2)', }) .setOutput([10, 10, 10]) .setPipeline(false) @@ -348,21 +355,23 @@ function testArray3D2(mode) { function testArray3D3(mode) { const gpu = new GPU({ mode }); - const texture = ( - gpu.createKernel(function() { return [this.thread.x, this.thread.y, this.thread.z]; }) + const texture = gpu + .createKernel(function () { + return [this.thread.x, this.thread.y, this.thread.z]; + }) .setOutput([10, 10, 10]) .setPipeline(true) - .setPrecision('single') - )(); + .setPrecision('single')(); const expected = texture.toArray(); - const kernel = gpu.createKernel(function() { + const kernel = gpu + .createKernel(function () { return this.constants.value[this.thread.z][this.thread.y][this.thread.x]; }) .setConstants({ - value: texture + value: texture, }) .setConstantTypes({ - value: 'Array1D(2)' + value: 'Array1D(2)', }) .setOutput([10, 10, 10]) .setPipeline(false) @@ -396,28 +405,23 @@ function testArray3D3(mode) { function testArray3D4(mode) { const gpu = new GPU({ mode }); - const texture = ( - gpu.createKernel(function() { - return [ - this.thread.x, - this.thread.y, - this.thread.z, - this.thread.x * this.thread.y * this.thread.z - ]; + const texture = gpu + .createKernel(function () { + return [this.thread.x, this.thread.y, this.thread.z, this.thread.x * this.thread.y * this.thread.z]; }) .setOutput([10, 10, 10]) .setPipeline(true) - .setPrecision('single') - )(); + .setPrecision('single')(); const expected = texture.toArray(); - const kernel = gpu.createKernel(function() { + const kernel = gpu + .createKernel(function () { return this.constants.value[this.thread.z][this.thread.y][this.thread.x]; }) .setConstants({ - value: texture + value: texture, }) .setConstantTypes({ - value: 'Array1D(2)' + value: 'Array1D(2)', }) .setOutput([10, 10, 10]) .setPipeline(false) @@ -447,4 +451,4 @@ function testArray3D4(mode) { (GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('Array3D(4) (GPU only) headlessgl', () => { testArray3D4('headlessgl'); -}); \ No newline at end of file +}); diff --git a/test/internal/constructor-features.js b/test/internal/constructor-features.js index 6ca1e094..de3a1865 100644 --- a/test/internal/constructor-features.js +++ b/test/internal/constructor-features.js @@ -5,9 +5,12 @@ describe('internal: constructor features'); function channelCount(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function() { - return 1; - }, { output: [1] }); + const kernel = gpu.createKernel( + function () { + return 1; + }, + { output: [1] } + ); kernel(); assert.ok(kernel.kernel.constructor.features.channelCount >= 1); gpu.destroy(); @@ -31,4 +34,4 @@ function channelCount(mode) { (GPU.isHeadlessGLSupported ? test : skip)('channelCount headlessgl', () => { channelCount('headlessgl'); -}); \ No newline at end of file +}); diff --git a/test/internal/context-inheritance.js b/test/internal/context-inheritance.js index 7a2604fc..d3abce23 100644 --- a/test/internal/context-inheritance.js +++ b/test/internal/context-inheritance.js @@ -7,11 +7,14 @@ describe('internal: context inheritance'); const canvas = document.createElement('canvas'); const context = canvas.getContext('webgl'); const gpu = new GPU({ context: context }); - const simpleKernel = gpu.createKernel(function() { - return 1 + 1; - }, { - output: [1] - }); + const simpleKernel = gpu.createKernel( + function () { + return 1 + 1; + }, + { + output: [1], + } + ); assert.equal(simpleKernel()[0], 2); assert.equal(gpu.Kernel, WebGLKernel); assert.equal(simpleKernel.context, context); @@ -21,11 +24,14 @@ describe('internal: context inheritance'); const canvas = document.createElement('canvas'); const context = canvas.getContext('webgl2'); const gpu = new GPU({ context: context }); - const simpleKernel = gpu.createKernel(function() { - return 1 + 1; - }, { - output: [1] - }); + const simpleKernel = gpu.createKernel( + function () { + return 1 + 1; + }, + { + output: [1], + } + ); assert.equal(simpleKernel()[0], 2); assert.equal(gpu.Kernel, WebGL2Kernel); assert.equal(simpleKernel.context, context); @@ -34,13 +40,16 @@ describe('internal: context inheritance'); (GPU.isHeadlessGLSupported ? test : skip)('headlessgl', () => { const context = require('gl')(1, 1); const gpu = new GPU({ context: context }); - const simpleKernel = gpu.createKernel(function() { - return 1 + 1; - }, { - output: [1] - }); + const simpleKernel = gpu.createKernel( + function () { + return 1 + 1; + }, + { + output: [1], + } + ); assert.equal(simpleKernel()[0], 2); assert.equal(gpu.Kernel, HeadlessGLKernel); assert.equal(simpleKernel.context, context); gpu.destroy(); -}); \ No newline at end of file +}); diff --git a/test/internal/deep-types.js b/test/internal/deep-types.js index 1cecad79..9afaee96 100644 --- a/test/internal/deep-types.js +++ b/test/internal/deep-types.js @@ -12,9 +12,12 @@ function oneLayerDeepFloat(mode) { } gpu.addFunction(childFunction); - const kernel = gpu.createKernel(function(kernelArgument1) { - return childFunction(kernelArgument1); - }, { output: [1] }); + const kernel = gpu.createKernel( + function (kernelArgument1) { + return childFunction(kernelArgument1); + }, + { output: [1] } + ); sinon.spy(FunctionBuilder.prototype, 'lookupReturnType'); try { const result = kernel(1.5); @@ -46,12 +49,13 @@ function twoLayerDeepFloat(mode) { function child2Function(child2FunctionArgument1) { return child2FunctionArgument1 + 1; } - gpu - .addFunction(child1Function) - .addFunction(child2Function); - const kernel = gpu.createKernel(function(kernelArgument1) { - return child1Function(kernelArgument1); - }, { output: [1] }); + gpu.addFunction(child1Function).addFunction(child2Function); + const kernel = gpu.createKernel( + function (kernelArgument1) { + return child1Function(kernelArgument1); + }, + { output: [1] } + ); sinon.spy(FunctionBuilder.prototype, 'lookupReturnType'); try { const result = kernel(1.5); @@ -85,12 +89,13 @@ function twoArgumentLayerDeepFloat(mode) { function child2Function(child2FunctionArgument1) { return child2FunctionArgument1 + 1; } - gpu - .addFunction(child1Function) - .addFunction(child2Function); - const kernel = gpu.createKernel(function(kernelArgument1) { - return child1Function(child2Function(kernelArgument1)); - }, { output: [1] }); + gpu.addFunction(child1Function).addFunction(child2Function); + const kernel = gpu.createKernel( + function (kernelArgument1) { + return child1Function(child2Function(kernelArgument1)); + }, + { output: [1] } + ); sinon.spy(FunctionBuilder.prototype, 'lookupReturnType'); try { const result = kernel(1.5); @@ -115,7 +120,6 @@ function twoArgumentLayerDeepFloat(mode) { twoArgumentLayerDeepFloat('headlessgl'); }); - function threeLayerDeepFloat(mode) { const gpu = new GPU({ mode }); @@ -130,13 +134,13 @@ function threeLayerDeepFloat(mode) { function child3Function(child3FunctionArgument1) { return child3FunctionArgument1 + 1; } - gpu - .addFunction(child1Function) - .addFunction(child2Function) - .addFunction(child3Function); - const kernel = gpu.createKernel(function(kernelArgument1) { - return child1Function(kernelArgument1); - }, { output: [1] }); + gpu.addFunction(child1Function).addFunction(child2Function).addFunction(child3Function); + const kernel = gpu.createKernel( + function (kernelArgument1) { + return child1Function(kernelArgument1); + }, + { output: [1] } + ); sinon.spy(FunctionBuilder.prototype, 'lookupReturnType'); try { const result = kernel(1.5); @@ -176,13 +180,13 @@ function threeArgumentLayerDeepFloat(mode) { function child3Function(child3FunctionArgument1) { return child3FunctionArgument1 + 1; } - gpu - .addFunction(child1Function) - .addFunction(child2Function) - .addFunction(child3Function); - const kernel = gpu.createKernel(function(kernelArgument1) { - return child1Function(child2Function(child3Function(kernelArgument1))); - }, { output: [1] }); + gpu.addFunction(child1Function).addFunction(child2Function).addFunction(child3Function); + const kernel = gpu.createKernel( + function (kernelArgument1) { + return child1Function(child2Function(child3Function(kernelArgument1))); + }, + { output: [1] } + ); sinon.spy(FunctionBuilder.prototype, 'lookupReturnType'); try { const result = kernel(1.5); @@ -210,9 +214,12 @@ function threeArgumentLayerDeepFloat(mode) { function threeArgumentLayerDeepNumberTexture1(mode) { const gpu = new GPU({ mode }); - const texture = gpu.createKernel(function() { - return 1.5; - }, { output: [1], pipeline: true, precision: 'single' })(); + const texture = gpu.createKernel( + function () { + return 1.5; + }, + { output: [1], pipeline: true, precision: 'single' } + )(); function child1Function(child1FunctionArgument1) { return child1FunctionArgument1 + 1; @@ -225,13 +232,13 @@ function threeArgumentLayerDeepNumberTexture1(mode) { function child3Function(child3FunctionArgument1) { return child3FunctionArgument1[this.thread.x] + 1; } - gpu - .addFunction(child1Function) - .addFunction(child2Function) - .addFunction(child3Function); - const kernel = gpu.createKernel(function(kernelArgument1) { - return child1Function(child2Function(child3Function(kernelArgument1))); - }, { output: [1] }); + gpu.addFunction(child1Function).addFunction(child2Function).addFunction(child3Function); + const kernel = gpu.createKernel( + function (kernelArgument1) { + return child1Function(child2Function(child3Function(kernelArgument1))); + }, + { output: [1] } + ); sinon.spy(FunctionBuilder.prototype, 'lookupReturnType'); try { const result = kernel(texture); @@ -263,11 +270,13 @@ function circlicalLogic(mode) { function child1Function(child1FunctionArgument1) { return child1Function(child1FunctionArgument1); } - gpu - .addFunction(child1Function); - const kernel = gpu.createKernel(function(kernelArgument1) { - return child1Function(kernelArgument1); - }, { output: [1] }); + gpu.addFunction(child1Function); + const kernel = gpu.createKernel( + function (kernelArgument1) { + return child1Function(kernelArgument1); + }, + { output: [1] } + ); assert.throws(() => { kernel(1.5); }); @@ -290,20 +299,26 @@ function arrayTexture1(mode) { return functionValue[this.thread.x] + 1; } gpu.addFunction(addOne); - const texture1 = gpu.createKernel(function() { - return 1; - }, { - output: [1], - precision: 'single', - pipeline: true, - })(); + const texture1 = gpu.createKernel( + function () { + return 1; + }, + { + output: [1], + precision: 'single', + pipeline: true, + } + )(); if (mode !== 'cpu') { assert.equal(texture1.type, 'ArrayTexture(1)'); } - const kernel = gpu.createKernel(function(kernelValue) { - return addOne(kernelValue); - }, { output: [1] }); + const kernel = gpu.createKernel( + function (kernelValue) { + return addOne(kernelValue); + }, + { output: [1] } + ); const result = kernel(texture1); assert.equal(result[0], 2); gpu.destroy(); @@ -336,20 +351,26 @@ function arrayTexture2(mode) { return declaredValue[0] + 1 + declaredValue[1] + 1; } gpu.addFunction(addOne); - const texture1 = gpu.createKernel(function() { - return [1, 2]; - }, { - output: [1], - precision: 'single', - pipeline: true, - })(); + const texture1 = gpu.createKernel( + function () { + return [1, 2]; + }, + { + output: [1], + precision: 'single', + pipeline: true, + } + )(); if (mode !== 'cpu') { assert.equal(texture1.type, 'ArrayTexture(2)'); } - const kernel = gpu.createKernel(function(kernelValue) { - return addOne(kernelValue); - }, { output: [1] }); + const kernel = gpu.createKernel( + function (kernelValue) { + return addOne(kernelValue); + }, + { output: [1] } + ); const result = kernel(texture1); assert.equal(result[0], 5); gpu.destroy(); @@ -379,25 +400,29 @@ function arrayTexture3(mode) { function addOne(functionValue) { const declaredValue = functionValue[this.thread.x]; - return declaredValue[0] + 1 + - declaredValue[1] + 1 + - declaredValue[2] + 1; + return declaredValue[0] + 1 + declaredValue[1] + 1 + declaredValue[2] + 1; } gpu.addFunction(addOne); - const texture1 = gpu.createKernel(function() { - return [1, 2, 3]; - }, { - output: [1], - precision: 'single', - pipeline: true, - })(); + const texture1 = gpu.createKernel( + function () { + return [1, 2, 3]; + }, + { + output: [1], + precision: 'single', + pipeline: true, + } + )(); if (mode !== 'cpu') { assert.equal(texture1.type, 'ArrayTexture(3)'); } - const kernel = gpu.createKernel(function(kernelValue) { - return addOne(kernelValue); - }, { output: [1] }); + const kernel = gpu.createKernel( + function (kernelValue) { + return addOne(kernelValue); + }, + { output: [1] } + ); const result = kernel(texture1); assert.equal(result[0], 9); gpu.destroy(); @@ -427,26 +452,29 @@ function arrayTexture4(mode) { function addOne(functionValue) { const declaredValue = functionValue[this.thread.x]; - return declaredValue[0] + 1 + - declaredValue[1] + 1 + - declaredValue[2] + 1 + - declaredValue[3] + 1; + return declaredValue[0] + 1 + declaredValue[1] + 1 + declaredValue[2] + 1 + declaredValue[3] + 1; } gpu.addFunction(addOne); - const texture1 = gpu.createKernel(function() { - return [1, 2, 3, 4]; - }, { - output: [1], - precision: 'single', - pipeline: true, - })(); + const texture1 = gpu.createKernel( + function () { + return [1, 2, 3, 4]; + }, + { + output: [1], + precision: 'single', + pipeline: true, + } + )(); if (mode !== 'cpu') { assert.equal(texture1.type, 'ArrayTexture(4)'); } - const kernel = gpu.createKernel(function(kernelValue) { - return addOne(kernelValue); - }, { output: [1] }); + const kernel = gpu.createKernel( + function (kernelValue) { + return addOne(kernelValue); + }, + { output: [1] } + ); const result = kernel(texture1); assert.equal(result[0], 14); gpu.destroy(); @@ -489,20 +517,24 @@ function testTortureTest(mode) { function addFloatFloat(addFloatFloatArgument1, addFloatFloatArgument2) { return addFloatFloatArgument1 + addFloatFloatArgument2; } - gpu - .addFunction(addFloatArray) - .addFunction(addArrayFloat) - .addFunction(addArrayArray) - .addFunction(addFloatFloat); + gpu.addFunction(addFloatArray).addFunction(addArrayFloat).addFunction(addArrayArray).addFunction(addFloatFloat); - const texture = gpu.createKernel(function() { return 2; }, { output: [1], precision: 'single' })(); + const texture = gpu.createKernel( + function () { + return 2; + }, + { output: [1], precision: 'single' } + )(); // sinon.spy(FunctionBuilder.prototype, 'lookupArgumentType'); sinon.spy(FunctionBuilder.prototype, 'lookupReturnType'); try { - const kernel = gpu.createKernel(function(v1, v2, v3, v4, v5) { - return addFloatFloat(v4, addArrayFloat(v3, addFloatArray(addArrayArray(v1, v5), v2))); - }, { output: [1] }); + const kernel = gpu.createKernel( + function (v1, v2, v3, v4, v5) { + return addFloatFloat(v4, addArrayFloat(v3, addFloatArray(addArrayArray(v1, v5), v2))); + }, + { output: [1] } + ); const result = kernel([1], texture, [3], 4, new Float32Array([5])); assert.equal(result[0], 1 + 2 + 3 + 4 + 5); @@ -561,13 +593,17 @@ function testKernelMap(mode) { function calc2(v1, v2) { return v1 * v2; } - const kernelMap = gpu.createKernelMap({ - calc1, - calc2, - }, function(outputs, targets) { - const output = outputs[this.thread.x]; - return calc2(calc1(output, targets), output); - }, { output: [1], pipeline: true }); + const kernelMap = gpu.createKernelMap( + { + calc1, + calc2, + }, + function (outputs, targets) { + const output = outputs[this.thread.x]; + return calc2(calc1(output, targets), output); + }, + { output: [1], pipeline: true } + ); try { const result = kernelMap([1], [3]); assert.equal(result.calc1.toArray()[0], 2); @@ -578,7 +614,6 @@ function testKernelMap(mode) { } } - (GPU.isWebGLSupported ? test : skip)('kernel map webgl', () => { testKernelMap('webgl'); }); @@ -589,4 +624,4 @@ function testKernelMap(mode) { (GPU.isHeadlessGLSupported ? test : skip)('kernel map headlessgl', () => { testKernelMap('headlessgl'); -}); \ No newline at end of file +}); diff --git a/test/internal/deprecated.js b/test/internal/deprecated.js index 82600f80..8d950258 100644 --- a/test/internal/deprecated.js +++ b/test/internal/deprecated.js @@ -5,7 +5,7 @@ describe('internal: deprecated'); test('GPU.createKernel settings floatOutput true', () => { const gpu = new GPU(); - const kernel = gpu.createKernel(function() {}, { floatOutput: true }); + const kernel = gpu.createKernel(function () {}, { floatOutput: true }); assert.equal(kernel.precision, 'single'); assert.notOk(kernel.kernel.hasOwnProperty('floatOutput')); gpu.destroy(); @@ -13,7 +13,7 @@ test('GPU.createKernel settings floatOutput true', () => { test('GPU.createKernel settings floatOutput false', () => { const gpu = new GPU(); - const kernel = gpu.createKernel(function() {}, { floatOutput: false }); + const kernel = gpu.createKernel(function () {}, { floatOutput: false }); assert.equal(kernel.precision, 'unsigned'); assert.notOk(kernel.kernel.hasOwnProperty('floatOutput')); gpu.destroy(); @@ -21,7 +21,7 @@ test('GPU.createKernel settings floatOutput false', () => { test('GPU.createKernel settings outputToTexture true', () => { const gpu = new GPU(); - const kernel = gpu.createKernel(function() {}, { outputToTexture: true }); + const kernel = gpu.createKernel(function () {}, { outputToTexture: true }); assert.equal(kernel.pipeline, true); assert.notOk(kernel.kernel.hasOwnProperty('outputToTexture')); gpu.destroy(); @@ -29,7 +29,7 @@ test('GPU.createKernel settings outputToTexture true', () => { test('GPU.createKernel settings outputToTexture false', () => { const gpu = new GPU(); - const kernel = gpu.createKernel(function() {}, { outputToTexture: false }); + const kernel = gpu.createKernel(function () {}, { outputToTexture: false }); assert.equal(kernel.pipeline, false); assert.notOk(kernel.kernel.hasOwnProperty('outputToTexture')); gpu.destroy(); @@ -37,7 +37,7 @@ test('GPU.createKernel settings outputToTexture false', () => { test('GPU.createKernel settings outputImmutable true', () => { const gpu = new GPU(); - const kernel = gpu.createKernel(function() {}, { outputImmutable: true }); + const kernel = gpu.createKernel(function () {}, { outputImmutable: true }); assert.equal(kernel.immutable, true); assert.notOk(kernel.kernel.hasOwnProperty('outputImmutable')); gpu.destroy(); @@ -45,7 +45,7 @@ test('GPU.createKernel settings outputImmutable true', () => { test('GPU.createKernel settings outputImmutable false', () => { const gpu = new GPU(); - const kernel = gpu.createKernel(function() {}, { outputImmutable: false }); + const kernel = gpu.createKernel(function () {}, { outputImmutable: false }); assert.equal(kernel.immutable, false); assert.notOk(kernel.kernel.hasOwnProperty('outputImmutable')); gpu.destroy(); @@ -53,7 +53,7 @@ test('GPU.createKernel settings outputImmutable false', () => { test('GPU.createKernel settings floatTextures true', () => { const gpu = new GPU(); - const kernel = gpu.createKernel(function() {}, { floatTextures: true }); + const kernel = gpu.createKernel(function () {}, { floatTextures: true }); assert.equal(kernel.optimizeFloatMemory, true); assert.notOk(kernel.kernel.hasOwnProperty('floatTextures')); gpu.destroy(); @@ -61,7 +61,7 @@ test('GPU.createKernel settings floatTextures true', () => { test('GPU.createKernel settings floatTextures false', () => { const gpu = new GPU(); - const kernel = gpu.createKernel(function() {}, { floatTextures: false }); + const kernel = gpu.createKernel(function () {}, { floatTextures: false }); assert.equal(kernel.optimizeFloatMemory, false); assert.notOk(kernel.kernel.hasOwnProperty('floatTextures')); gpu.destroy(); @@ -73,7 +73,7 @@ test('Kernel.getCanvas', () => { kernel.initContext = () => {}; kernel.initPlugins = () => {}; kernel.mergeSettings({ - canvas + canvas, }); assert.equal(kernel.getCanvas(), canvas); }); @@ -86,7 +86,7 @@ test('Kernel.getWebGl', () => { kernel.initPlugins = () => {}; kernel.mergeSettings({ canvas, - context + context, }); assert.equal(kernel.getWebGl(), context); }); @@ -95,4 +95,4 @@ test('Kernel.setOutputToTexture', () => { const kernel = new Kernel(`function() {}`); kernel.setOutputToTexture(true); assert.equal(kernel.pipeline, true); -}); \ No newline at end of file +}); diff --git a/test/internal/different-texture-cloning.js b/test/internal/different-texture-cloning.js index 9e494438..34135312 100644 --- a/test/internal/different-texture-cloning.js +++ b/test/internal/different-texture-cloning.js @@ -7,19 +7,20 @@ function testArrayThenArray1D4(mode) { const gpu = new GPU({ mode }); function createTextureOf(value, type) { - return (gpu.createKernel(function(value) { - return value[this.thread.x]; - }, { - output: [1], - pipeline: true, - argumentTypes: { value: type } - }))(value); + return gpu.createKernel( + function (value) { + return value[this.thread.x]; + }, + { + output: [1], + pipeline: true, + argumentTypes: { value: type }, + } + )(value); } const arrayTexture = createTextureOf([1], 'Array'); const arrayTextureClone = arrayTexture.clone(); - const array4Texture = createTextureOf([ - [1, 2, 3, 4] - ], 'Array1D(4)'); + const array4Texture = createTextureOf([[1, 2, 3, 4]], 'Array1D(4)'); const array4TextureClone = array4Texture.clone(); assert.notEqual(arrayTextureClone, array4TextureClone); assert.deepEqual(arrayTextureClone.toArray(), new Float32Array([1])); @@ -47,17 +48,18 @@ function testArray1D4ThenArray(mode) { const gpu = new GPU({ mode }); function createTextureOf(value, type) { - return (gpu.createKernel(function(value) { - return value[this.thread.x]; - }, { - output: [1], - pipeline: true, - argumentTypes: { value: type } - }))(value); + return gpu.createKernel( + function (value) { + return value[this.thread.x]; + }, + { + output: [1], + pipeline: true, + argumentTypes: { value: type }, + } + )(value); } - const array4Texture = createTextureOf([ - [1, 2, 3, 4] - ], 'Array1D(4)'); + const array4Texture = createTextureOf([[1, 2, 3, 4]], 'Array1D(4)'); const array4TextureClone = array4Texture.clone(); const arrayTexture = createTextureOf([1], 'Array'); const arrayTextureClone = arrayTexture.clone(); @@ -81,4 +83,4 @@ test('Array1D(4) then Array auto', () => { (GPU.isHeadlessGLSupported ? test : skip)('Array1D(4) then Array headlessgl', () => { testArray1D4ThenArray('headlessgl'); -}); \ No newline at end of file +}); diff --git a/test/internal/function-builder.js b/test/internal/function-builder.js index c1978be5..1068cf06 100644 --- a/test/internal/function-builder.js +++ b/test/internal/function-builder.js @@ -23,20 +23,20 @@ function threeLayerTemplate(FunctionNode) { new FunctionNode(layerOne.toString(), { output: [1], lookupReturnType: () => 'Number', - lookupFunctionArgumentTypes: () => {} + lookupFunctionArgumentTypes: () => {}, }), new FunctionNode(layerTwo.toString(), { output: [1], lookupReturnType: () => 'Number', - lookupFunctionArgumentTypes: () => {} + lookupFunctionArgumentTypes: () => {}, }), new FunctionNode(layerThree.toString(), { output: [1], lookupReturnType: () => 'Number', - lookupFunctionArgumentTypes: () => {} + lookupFunctionArgumentTypes: () => {}, }), ], - output: [1] + output: [1], }); } @@ -65,104 +65,41 @@ test('traceFunctionCalls: 3 layer test webgl2', () => { /// Test the function tracing of 3 layers test('webglString: 3 layer test cpu', () => { const builder = threeLayerTemplate(CPUFunctionNode); - assert.equal( - builder.getStringFromFunctionNames(['layerOne']), - 'function layerOne() {\nreturn 42;\n}' - ); - assert.equal( - builder.getString('layerOne'), - builder.getStringFromFunctionNames(['layerOne']) - ); - - assert.equal( - builder.getStringFromFunctionNames(['layerOne', 'layerTwo']), - 'function layerOne() {\nreturn 42;\n}\nfunction layerTwo() {\nreturn (layerOne()*2);\n}' - ); - assert.equal( - builder.getString('layerTwo'), - builder.getStringFromFunctionNames(['layerOne', 'layerTwo']) - ); - - assert.equal( - builder.getStringFromFunctionNames(['layerOne', 'layerTwo', 'layerThree']), - 'function layerOne() {\nreturn 42;\n}\nfunction layerTwo() {\nreturn (layerOne()*2);\n}\nfunction layerThree() {\nreturn (layerTwo()*2);\n}' - ); - assert.equal( - builder.getString('layerThree'), - builder.getStringFromFunctionNames(['layerOne', 'layerTwo', 'layerThree']) - ); - assert.equal( - builder.getString(null), - builder.getString('layerThree') - ); + assert.equal(builder.getStringFromFunctionNames(['layerOne']), 'function layerOne() {\nreturn 42;\n}'); + assert.equal(builder.getString('layerOne'), builder.getStringFromFunctionNames(['layerOne'])); + + assert.equal(builder.getStringFromFunctionNames(['layerOne', 'layerTwo']), 'function layerOne() {\nreturn 42;\n}\nfunction layerTwo() {\nreturn (layerOne()*2);\n}'); + assert.equal(builder.getString('layerTwo'), builder.getStringFromFunctionNames(['layerOne', 'layerTwo'])); + + assert.equal(builder.getStringFromFunctionNames(['layerOne', 'layerTwo', 'layerThree']), 'function layerOne() {\nreturn 42;\n}\nfunction layerTwo() {\nreturn (layerOne()*2);\n}\nfunction layerThree() {\nreturn (layerTwo()*2);\n}'); + assert.equal(builder.getString('layerThree'), builder.getStringFromFunctionNames(['layerOne', 'layerTwo', 'layerThree'])); + assert.equal(builder.getString(null), builder.getString('layerThree')); }); test('webglString: 3 layer test webgl', () => { const builder = threeLayerTemplate(WebGLFunctionNode); - assert.equal( - builder.getStringFromFunctionNames(['layerOne']), - 'float layerOne() {\nreturn 42.0;\n}' - ); - assert.equal( - builder.getString('layerOne'), - builder.getStringFromFunctionNames(['layerOne']) - ); - - assert.equal( - builder.getStringFromFunctionNames(['layerOne', 'layerTwo']), - 'float layerOne() {\nreturn 42.0;\n}\nfloat layerTwo() {\nreturn (layerOne()*2.0);\n}' - ); - assert.equal( - builder.getString('layerTwo'), - builder.getStringFromFunctionNames(['layerOne', 'layerTwo']) - ); - - assert.equal( - builder.getStringFromFunctionNames(['layerOne', 'layerTwo', 'layerThree']), - 'float layerOne() {\nreturn 42.0;\n}\nfloat layerTwo() {\nreturn (layerOne()*2.0);\n}\nfloat layerThree() {\nreturn (layerTwo()*2.0);\n}' - ); - assert.equal( - builder.getString('layerThree'), - builder.getStringFromFunctionNames(['layerOne', 'layerTwo', 'layerThree']) - ); - assert.equal( - builder.getString(null), - builder.getString('layerThree') - ); + assert.equal(builder.getStringFromFunctionNames(['layerOne']), 'float layerOne() {\nreturn 42.0;\n}'); + assert.equal(builder.getString('layerOne'), builder.getStringFromFunctionNames(['layerOne'])); + + assert.equal(builder.getStringFromFunctionNames(['layerOne', 'layerTwo']), 'float layerOne() {\nreturn 42.0;\n}\nfloat layerTwo() {\nreturn (layerOne()*2.0);\n}'); + assert.equal(builder.getString('layerTwo'), builder.getStringFromFunctionNames(['layerOne', 'layerTwo'])); + + assert.equal(builder.getStringFromFunctionNames(['layerOne', 'layerTwo', 'layerThree']), 'float layerOne() {\nreturn 42.0;\n}\nfloat layerTwo() {\nreturn (layerOne()*2.0);\n}\nfloat layerThree() {\nreturn (layerTwo()*2.0);\n}'); + assert.equal(builder.getString('layerThree'), builder.getStringFromFunctionNames(['layerOne', 'layerTwo', 'layerThree'])); + assert.equal(builder.getString(null), builder.getString('layerThree')); }); test('webglString: 3 layer test webgl2', () => { const builder = threeLayerTemplate(WebGL2FunctionNode); assert.notEqual(builder, null, 'class creation check'); - assert.equal( - builder.getStringFromFunctionNames(['layerOne']), - 'float layerOne() {\nreturn 42.0;\n}' - ); - assert.equal( - builder.getString('layerOne'), - builder.getStringFromFunctionNames(['layerOne']) - ); - - assert.equal( - builder.getStringFromFunctionNames(['layerOne', 'layerTwo']), - 'float layerOne() {\nreturn 42.0;\n}\nfloat layerTwo() {\nreturn (layerOne()*2.0);\n}' - ); - assert.equal( - builder.getString('layerTwo'), - builder.getStringFromFunctionNames(['layerOne', 'layerTwo']) - ); - - assert.equal( - builder.getStringFromFunctionNames(['layerOne', 'layerTwo', 'layerThree']), - 'float layerOne() {\nreturn 42.0;\n}\nfloat layerTwo() {\nreturn (layerOne()*2.0);\n}\nfloat layerThree() {\nreturn (layerTwo()*2.0);\n}' - ); - assert.equal( - builder.getString('layerThree'), - builder.getStringFromFunctionNames(['layerOne', 'layerTwo', 'layerThree']) - ); - assert.equal( - builder.getString(null), - builder.getString('layerThree') - ); -}); \ No newline at end of file + assert.equal(builder.getStringFromFunctionNames(['layerOne']), 'float layerOne() {\nreturn 42.0;\n}'); + assert.equal(builder.getString('layerOne'), builder.getStringFromFunctionNames(['layerOne'])); + + assert.equal(builder.getStringFromFunctionNames(['layerOne', 'layerTwo']), 'float layerOne() {\nreturn 42.0;\n}\nfloat layerTwo() {\nreturn (layerOne()*2.0);\n}'); + assert.equal(builder.getString('layerTwo'), builder.getStringFromFunctionNames(['layerOne', 'layerTwo'])); + + assert.equal(builder.getStringFromFunctionNames(['layerOne', 'layerTwo', 'layerThree']), 'float layerOne() {\nreturn 42.0;\n}\nfloat layerTwo() {\nreturn (layerOne()*2.0);\n}\nfloat layerThree() {\nreturn (layerTwo()*2.0);\n}'); + assert.equal(builder.getString('layerThree'), builder.getStringFromFunctionNames(['layerOne', 'layerTwo', 'layerThree'])); + assert.equal(builder.getString(null), builder.getString('layerThree')); +}); diff --git a/test/internal/function-composition.js b/test/internal/function-composition.js index 02b116f6..9831793f 100644 --- a/test/internal/function-composition.js +++ b/test/internal/function-composition.js @@ -6,12 +6,15 @@ describe('internal: function composition return values'); function functionCompositionReturnValuesTest(mode) { const gpu = new GPU({ mode }); - return gpu.createKernel(function(oneToFour, fourToOne) { - function add(left, right) { - return left[this.thread.x] + right[this.thread.x]; - } - return add(oneToFour, fourToOne); - }, { output: [4] })([1, 2, 3, 4], [4, 3, 2, 1]); + return gpu.createKernel( + function (oneToFour, fourToOne) { + function add(left, right) { + return left[this.thread.x] + right[this.thread.x]; + } + return add(oneToFour, fourToOne); + }, + { output: [4] } + )([1, 2, 3, 4], [4, 3, 2, 1]); } test('auto', () => { @@ -33,21 +36,23 @@ test('cpu', () => { assert.deepEqual(Array.from(functionCompositionReturnValuesTest('cpu')), [5, 5, 5, 5]); }); - describe('internal: function composition FunctionNode'); function functionCompositionFunctionNode(FunctionNode) { const output = [1]; - const node = new FunctionNode(`function kernel() { + const node = new FunctionNode( + `function kernel() { function inner() { return 1; } return inner(); - }`, { - output, - onNestedFunction: sinon.spy(), - lookupReturnType: () => 'Number', - lookupFunctionArgumentTypes: () => {} - }); + }`, + { + output, + onNestedFunction: sinon.spy(), + lookupReturnType: () => 'Number', + lookupFunctionArgumentTypes: () => {}, + } + ); const string = node.toString(); assert.equal(node.onNestedFunction.callCount, 1); @@ -55,112 +60,79 @@ function functionCompositionFunctionNode(FunctionNode) { } test('CPUFunctionNode', () => { - assert.equal(functionCompositionFunctionNode(CPUFunctionNode), 'function kernel() {' + - '\n' + - '\nreturn inner();' + - '\n}'); + assert.equal(functionCompositionFunctionNode(CPUFunctionNode), 'function kernel() {' + '\n' + '\nreturn inner();' + '\n}'); }); test('WebGLFunctionNode', () => { - assert.equal(functionCompositionFunctionNode(WebGLFunctionNode), 'float kernel() {' + - '\n' + - '\nreturn inner();' + - '\n}'); + assert.equal(functionCompositionFunctionNode(WebGLFunctionNode), 'float kernel() {' + '\n' + '\nreturn inner();' + '\n}'); }); test('WebGL2FunctionNode', () => { - assert.equal(functionCompositionFunctionNode(WebGL2FunctionNode), 'float kernel() {' + - '\n' + - '\nreturn inner();' + - '\n}'); + assert.equal(functionCompositionFunctionNode(WebGL2FunctionNode), 'float kernel() {' + '\n' + '\nreturn inner();' + '\n}'); }); describe('internal: number function composition FunctionBuilder'); function numberFunctionCompositionFunctionBuilder(FunctionNode) { const output = [1]; - const builder = FunctionBuilder.fromKernel({ - source: `function kernel() { + const builder = FunctionBuilder.fromKernel( + { + source: `function kernel() { function inner() { return 1; } return inner(); }`, - argumentTypes: [], - argumentNames: [], - kernelArguments: [], - kernelConstants: [], - output, - leadingReturnStatement: 'resultX[x] = ' - }, FunctionNode); + argumentTypes: [], + argumentNames: [], + kernelArguments: [], + kernelConstants: [], + output, + leadingReturnStatement: 'resultX[x] = ', + }, + FunctionNode + ); return builder.getPrototypeString('kernel'); } test('CPUFunctionNode', () => { - assert.equal(numberFunctionCompositionFunctionBuilder(CPUFunctionNode), 'function inner() {' + - '\nreturn 1;' + - '\n}' + - '\nresultX[x] = inner();\ncontinue;'); + assert.equal(numberFunctionCompositionFunctionBuilder(CPUFunctionNode), 'function inner() {' + '\nreturn 1;' + '\n}' + '\nresultX[x] = inner();\ncontinue;'); }); test('WebGLFunctionNode', () => { - assert.equal(numberFunctionCompositionFunctionBuilder(WebGLFunctionNode), 'float inner() {' + - '\nreturn 1.0;' + - '\n}' + - '\nvoid kernel() {' + - '\n' + - '\nkernelResult = inner();return;' + - '\n}'); + assert.equal(numberFunctionCompositionFunctionBuilder(WebGLFunctionNode), 'float inner() {' + '\nreturn 1.0;' + '\n}' + '\nvoid kernel() {' + '\n' + '\nkernelResult = inner();return;' + '\n}'); }); test('WebGL2FunctionNode', () => { - assert.equal(numberFunctionCompositionFunctionBuilder(WebGL2FunctionNode), 'float inner() {' + - '\nreturn 1.0;' + - '\n}' + - '\nvoid kernel() {' + - '\n' + - '\nkernelResult = inner();return;' + - '\n}'); + assert.equal(numberFunctionCompositionFunctionBuilder(WebGL2FunctionNode), 'float inner() {' + '\nreturn 1.0;' + '\n}' + '\nvoid kernel() {' + '\n' + '\nkernelResult = inner();return;' + '\n}'); }); describe('internal: Array(2) function composition FunctionBuilder'); function array2FunctionCompositionFunctionBuilder(FunctionNode) { const output = [1]; - const builder = FunctionBuilder.fromKernel({ - source: `function kernel() { + const builder = FunctionBuilder.fromKernel( + { + source: `function kernel() { function inner() { return [1,2,3,4]; } return inner()[0]; }`, - argumentTypes: [], - argumentNames: [], - kernelArguments: [], - kernelConstants: [], - output, - leadingReturnStatement: 'resultX[x] = ' - }, FunctionNode); + argumentTypes: [], + argumentNames: [], + kernelArguments: [], + kernelConstants: [], + output, + leadingReturnStatement: 'resultX[x] = ', + }, + FunctionNode + ); return builder.getPrototypeString('kernel'); } test('CPUFunctionNode', () => { - assert.equal(array2FunctionCompositionFunctionBuilder(CPUFunctionNode), 'function inner() {' + - '\nreturn new Float32Array([1, 2, 3, 4]);' + - '\n}' + - '\nresultX[x] = inner()[0];\ncontinue;'); + assert.equal(array2FunctionCompositionFunctionBuilder(CPUFunctionNode), 'function inner() {' + '\nreturn new Float32Array([1, 2, 3, 4]);' + '\n}' + '\nresultX[x] = inner()[0];\ncontinue;'); }); test('WebGLFunctionNode', () => { - assert.equal(array2FunctionCompositionFunctionBuilder(WebGLFunctionNode), 'vec4 inner() {' + - '\nreturn vec4(1.0, 2.0, 3.0, 4.0);' + - '\n}' + - '\nvoid kernel() {' + - '\n' + - '\nkernelResult = inner()[0];return;' + - '\n}'); + assert.equal(array2FunctionCompositionFunctionBuilder(WebGLFunctionNode), 'vec4 inner() {' + '\nreturn vec4(1.0, 2.0, 3.0, 4.0);' + '\n}' + '\nvoid kernel() {' + '\n' + '\nkernelResult = inner()[0];return;' + '\n}'); }); test('WebGL2FunctionNode', () => { - assert.equal(array2FunctionCompositionFunctionBuilder(WebGL2FunctionNode), 'vec4 inner() {' + - '\nreturn vec4(1.0, 2.0, 3.0, 4.0);' + - '\n}' + - '\nvoid kernel() {' + - '\n' + - '\nkernelResult = inner()[0];return;' + - '\n}'); -}); \ No newline at end of file + assert.equal(array2FunctionCompositionFunctionBuilder(WebGL2FunctionNode), 'vec4 inner() {' + '\nreturn vec4(1.0, 2.0, 3.0, 4.0);' + '\n}' + '\nvoid kernel() {' + '\n' + '\nkernelResult = inner()[0];return;' + '\n}'); +}); diff --git a/test/internal/function-node.js b/test/internal/function-node.js index f0cf478c..74dade81 100644 --- a/test/internal/function-node.js +++ b/test/internal/function-node.js @@ -7,58 +7,43 @@ describe('internal: function node'); test('hello_world: just return magic 42 cpu', () => { // Create a function hello node const node = new CPUFunctionNode( - (function() { + function () { return 42; - }).toString(), { name: 'hello_world', output: [1] } + }.toString(), + { name: 'hello_world', output: [1] } ); assert.notEqual(node.getJsAST(), null, 'AST fetch check'); - assert.equal( - node.toString(), - 'function hello_world() {' + - '\nreturn 42;' + - '\n}', - 'function conversion check' - ); + assert.equal(node.toString(), 'function hello_world() {' + '\nreturn 42;' + '\n}', 'function conversion check'); }); test('hello_world: just return magic 42 webgl', () => { // Create a function hello node const node = new WebGLFunctionNode( - (function() { + function () { return 42; - }).toString(), { name: 'hello_world', output: [1] } + }.toString(), + { name: 'hello_world', output: [1] } ); assert.notEqual(node.getJsAST(), null, 'AST fetch check'); - assert.equal( - node.toString(), - 'float hello_world() {' + - '\nreturn 42.0;' + - '\n}', - 'function conversion check' - ); + assert.equal(node.toString(), 'float hello_world() {' + '\nreturn 42.0;' + '\n}', 'function conversion check'); }); test('hello_world: just return magic 42 webgl2', () => { // Create a function hello node const node = new WebGL2FunctionNode( - (function() { + function () { return 42; - }).toString(), { name: 'hello_world', output: [1] } + }.toString(), + { name: 'hello_world', output: [1] } ); assert.notEqual(node.getJsAST(), null, 'AST fetch check'); - assert.equal( - node.toString(), - 'float hello_world() {' + - '\nreturn 42.0;' + - '\n}', - 'function conversion check' - ); + assert.equal(node.toString(), 'float hello_world() {' + '\nreturn 42.0;' + '\n}', 'function conversion check'); }); /// Test creation of function, that calls another function @@ -69,25 +54,20 @@ test('hello_inner: call a function inside a function cpu', () => { // Create a function hello node const node = new CPUFunctionNode( - (function() { + function () { return inner(); - }).toString(), { + }.toString(), + { name: 'hello_inner', output: [1], lookupReturnType: () => 'Number', - lookupFunctionArgumentTypes: () => {} + lookupFunctionArgumentTypes: () => {}, } ); assert.notEqual(node.getJsAST(), null, 'AST fetch check'); - assert.equal( - node.toString(), - 'function hello_inner() {' + - '\nreturn inner();' + - '\n}', - 'function conversion check' - ); + assert.equal(node.toString(), 'function hello_inner() {' + '\nreturn inner();' + '\n}', 'function conversion check'); assert.deepEqual(node.calledFunctions, ['inner']); }); @@ -99,25 +79,20 @@ test('hello_inner: call a function inside a function webgl', () => { // Create a function hello node const node = new WebGLFunctionNode( - (function() { + function () { return inner(); - }).toString(), { + }.toString(), + { name: 'hello_inner', output: [1], lookupReturnType: () => 'Number', - lookupFunctionArgumentTypes: () => {} + lookupFunctionArgumentTypes: () => {}, } ); assert.notEqual(node.getJsAST(), null, 'AST fetch check'); - assert.equal( - node.toString(), - 'float hello_inner() {' + - '\nreturn inner();' + - '\n}', - 'function conversion check' - ); + assert.equal(node.toString(), 'float hello_inner() {' + '\nreturn inner();' + '\n}', 'function conversion check'); assert.deepEqual(node.calledFunctions, ['inner']); }); @@ -130,25 +105,20 @@ test('hello_inner: call a function inside a function webgl2', () => { // Create a function hello node const node = new WebGL2FunctionNode( - (function() { + function () { return inner(); - }).toString(), { + }.toString(), + { name: 'hello_inner', output: [1], lookupReturnType: () => 'Number', - lookupFunctionArgumentTypes: () => {} + lookupFunctionArgumentTypes: () => {}, } ); assert.notEqual(node.getJsAST(), null, 'AST fetch check'); - assert.equal( - node.toString(), - 'float hello_inner() {' + - '\nreturn inner();' + - '\n}', - 'function conversion check' - ); + assert.equal(node.toString(), 'float hello_inner() {' + '\nreturn inner();' + '\n}', 'function conversion check'); assert.deepEqual(node.calledFunctions, ['inner']); }); @@ -157,9 +127,10 @@ test('hello_inner: call a function inside a function webgl2', () => { test('Math.round implementation: A function with arguments cpu', () => { // Math.round node const node = new CPUFunctionNode( - (function(a) { + function (a) { return Math.floor(a + 0.5); - }).toString(), { + }.toString(), + { name: 'foo', output: [1], argumentTypes: ['Number'], @@ -170,13 +141,7 @@ test('Math.round implementation: A function with arguments cpu', () => { assert.notEqual(node.getJsAST(), null, 'AST fetch check'); - assert.equal( - node.toString(), - 'function foo(user_a) {' + - '\nreturn Math.floor((user_a+0.5));' + - '\n}', - 'function conversion check' - ); + assert.equal(node.toString(), 'function foo(user_a) {' + '\nreturn Math.floor((user_a+0.5));' + '\n}', 'function conversion check'); assert.deepEqual(node.calledFunctions, ['Math.floor']); }); @@ -184,24 +149,19 @@ test('Math.round implementation: A function with arguments cpu', () => { test('Math.round implementation: A function with arguments webgl', () => { // Math.round node const node = new WebGLFunctionNode( - (function(a) { + function (a) { return Math.floor(a + 0.5); - }).toString(), { + }.toString(), + { name: 'foo', output: [1], - argumentTypes: ['Number'] + argumentTypes: ['Number'], } ); assert.notEqual(node.getJsAST(), null, 'AST fetch check'); - assert.equal( - node.toString(), - 'float foo(float user_a) {' + - '\nreturn floor((user_a+0.5));' + - '\n}', - 'function conversion check' - ); + assert.equal(node.toString(), 'float foo(float user_a) {' + '\nreturn floor((user_a+0.5));' + '\n}', 'function conversion check'); assert.deepEqual(node.calledFunctions, ['floor']); }); @@ -209,71 +169,56 @@ test('Math.round implementation: A function with arguments webgl', () => { test('Math.round implementation: A function with arguments webgl2', () => { // Math.round node const node = new WebGL2FunctionNode( - (function(a) { + function (a) { return Math.floor(a + 0.5); - }).toString(), { + }.toString(), + { name: 'foo', output: [1], - argumentTypes: ['Number'] + argumentTypes: ['Number'], } ); assert.notEqual(node.getJsAST(), null, 'AST fetch check'); - assert.equal( - node.toString(), - 'float foo(float user_a) {' + - '\nreturn floor((user_a+0.5));' + - '\n}', - 'function conversion check' - ); + assert.equal(node.toString(), 'float foo(float user_a) {' + '\nreturn floor((user_a+0.5));' + '\n}', 'function conversion check'); assert.deepEqual(node.calledFunctions, ['floor']); }); /// Test creation of function, that calls another function, with ARGS -test('Two arguments test webgl', function(assert) { +test('Two arguments test webgl', function (assert) { const node = new WebGLFunctionNode( - (function(a, b) { + function (a, b) { return a + b; - }).toString(), { + }.toString(), + { name: 'add_together', output: [1], - argumentTypes: ['Number', 'Number'] + argumentTypes: ['Number', 'Number'], } ); assert.notEqual(node.getJsAST(), null, 'AST fetch check'); - assert.equal( - node.toString(), - 'float add_together(float user_a, float user_b) {' + - '\nreturn (user_a+user_b);' + - '\n}', - 'function conversion check' - ); + assert.equal(node.toString(), 'float add_together(float user_a, float user_b) {' + '\nreturn (user_a+user_b);' + '\n}', 'function conversion check'); }); -test('Two arguments test webgl2', function(assert) { +test('Two arguments test webgl2', function (assert) { const node = new WebGL2FunctionNode( - (function(a, b) { + function (a, b) { return a + b; - }).toString(), { + }.toString(), + { name: 'add_together', output: [1], - argumentTypes: ['Number', 'Number'] + argumentTypes: ['Number', 'Number'], } ); assert.notEqual(node.getJsAST(), null, 'AST fetch check'); - assert.equal( - node.toString(), - 'float add_together(float user_a, float user_b) {' + - '\nreturn (user_a+user_b);' + - '\n}', - 'function conversion check' - ); + assert.equal(node.toString(), 'float add_together(float user_a, float user_b) {' + '\nreturn (user_a+user_b);' + '\n}', 'function conversion check'); }); /// Test the creation of a hello_world function @@ -305,4 +250,4 @@ test('Automatic naming support webgl2', () => { const node = new WebGL2FunctionNode(hello_world.toString(), { output: [1] }); assert.notEqual(node, null, 'class creation check'); assert.equal(node.name, 'hello_world'); -}); \ No newline at end of file +}); diff --git a/test/internal/function-return-type-detection.js b/test/internal/function-return-type-detection.js index 60406d87..67e91872 100644 --- a/test/internal/function-return-type-detection.js +++ b/test/internal/function-return-type-detection.js @@ -10,10 +10,13 @@ function canDetectNumberFromAddedFunction(mode) { return 1; } gpu.addFunction(number); - const kernel = gpu.createKernel(function() { - const values = number(); - return values + values; - }, { output: [1] }); + const kernel = gpu.createKernel( + function () { + const values = number(); + return values + values; + }, + { output: [1] } + ); const result = kernel(); assert.equal(result[0], 2); @@ -52,10 +55,13 @@ function canDetectArray2FromAddedFunction(mode) { return [1, 2]; } gpu.addFunction(array2); - const kernel = gpu.createKernel(function() { - const values = array2(); - return values[0] + values[1]; - }, { output: [1] }); + const kernel = gpu.createKernel( + function () { + const values = array2(); + return values[0] + values[1]; + }, + { output: [1] } + ); const result = kernel(); assert.equal(result[0], 3); @@ -87,7 +93,6 @@ test('can detect Array(2) cpu', () => { canDetectArray2FromAddedFunction('cpu'); }); - function canDetectArray3FromAddedFunction(mode) { const gpu = new GPU({ mode }); @@ -95,10 +100,13 @@ function canDetectArray3FromAddedFunction(mode) { return [1, 2, 3]; } gpu.addFunction(array2); - const kernel = gpu.createKernel(function() { - const values = array2(); - return values[0] + values[1] + values[2]; - }, { output: [1] }); + const kernel = gpu.createKernel( + function () { + const values = array2(); + return values[0] + values[1] + values[2]; + }, + { output: [1] } + ); const result = kernel(); assert.equal(result[0], 6); @@ -130,7 +138,6 @@ test('can detect Array(3) cpu', () => { canDetectArray3FromAddedFunction('cpu'); }); - function canDetectArray4FromAddedFunction(mode) { const gpu = new GPU({ mode }); @@ -138,10 +145,13 @@ function canDetectArray4FromAddedFunction(mode) { return [1, 2, 3, 4]; } gpu.addFunction(array2); - const kernel = gpu.createKernel(function() { - const values = array2(); - return values[0] + values[1] + values[2] + values[3]; - }, { output: [1] }); + const kernel = gpu.createKernel( + function () { + const values = array2(); + return values[0] + values[1] + values[2] + values[3]; + }, + { output: [1] } + ); const result = kernel(); assert.equal(result[0], 10); @@ -171,4 +181,4 @@ test('can detect Array(4) gpu', () => { test('can detect Array(4) cpu', () => { canDetectArray4FromAddedFunction('cpu'); -}); \ No newline at end of file +}); diff --git a/test/internal/function-tracer.js b/test/internal/function-tracer.js index 8142d59e..79586356 100644 --- a/test/internal/function-tracer.js +++ b/test/internal/function-tracer.js @@ -19,12 +19,15 @@ test('works with BlockStatement', () => { contexts: [], runningContexts: [], newContext: FunctionTracer.prototype.newContext, - scan: (body) => { + scan: body => { called = true; calledBody = body; - } + }, }; - FunctionTracer.prototype.scan.call(mockInstance, { type: 'BlockStatement', body: mockBody }); + FunctionTracer.prototype.scan.call(mockInstance, { + type: 'BlockStatement', + body: mockBody, + }); assert.ok(called); assert.equal(calledBody, mockBody); assert.equal(mockInstance.contexts.length, 1); @@ -36,12 +39,16 @@ test('works with AssignmentExpression', () => { let called = false; let calledSides = []; const mockInstance = { - scan: (side) => { + scan: side => { called = true; calledSides.push(side); - } + }, }; - FunctionTracer.prototype.scan.call(mockInstance, { type: 'AssignmentExpression', left: mockLeft, right: mockRight }); + FunctionTracer.prototype.scan.call(mockInstance, { + type: 'AssignmentExpression', + left: mockLeft, + right: mockRight, + }); assert.ok(called); assert.deepEqual(calledSides, [mockLeft, mockRight]); }); @@ -52,12 +59,16 @@ test('works with LogicalExpression', () => { let called = false; let calledSides = []; const mockInstance = { - scan: (side) => { + scan: side => { called = true; calledSides.push(side); - } + }, }; - FunctionTracer.prototype.scan.call(mockInstance, { type: 'LogicalExpression', left: mockLeft, right: mockRight }); + FunctionTracer.prototype.scan.call(mockInstance, { + type: 'LogicalExpression', + left: mockLeft, + right: mockRight, + }); assert.ok(called); assert.deepEqual(calledSides, [mockLeft, mockRight]); }); @@ -68,12 +79,16 @@ test('works with BinaryExpression', () => { let called = false; let calledSides = []; const mockInstance = { - scan: (side) => { + scan: side => { called = true; calledSides.push(side); - } + }, }; - FunctionTracer.prototype.scan.call(mockInstance, { type: 'BinaryExpression', left: mockLeft, right: mockRight }); + FunctionTracer.prototype.scan.call(mockInstance, { + type: 'BinaryExpression', + left: mockLeft, + right: mockRight, + }); assert.ok(called); assert.deepEqual(calledSides, [mockLeft, mockRight]); }); @@ -83,12 +98,15 @@ test('works with UpdateExpression', () => { let called = false; let calledBody = null; const mockInstance = { - scan: (argument) => { + scan: argument => { called = true; calledBody = argument; - } + }, }; - FunctionTracer.prototype.scan.call(mockInstance, { type: 'UpdateExpression', argument: mockArgument }); + FunctionTracer.prototype.scan.call(mockInstance, { + type: 'UpdateExpression', + argument: mockArgument, + }); assert.ok(called); assert.equal(calledBody, mockArgument); }); @@ -98,12 +116,15 @@ test('works with UnaryExpression', () => { let called = false; let calledArgument = null; const mockInstance = { - scan: (argument) => { + scan: argument => { called = true; calledArgument = argument; - } + }, }; - FunctionTracer.prototype.scan.call(mockInstance, { type: 'UpdateExpression', argument: mockArgument }); + FunctionTracer.prototype.scan.call(mockInstance, { + type: 'UpdateExpression', + argument: mockArgument, + }); assert.ok(called); assert.equal(calledArgument, mockArgument); }); @@ -113,12 +134,15 @@ test('works with VariableDeclaration', () => { let called = false; let calledDeclarations = null; const mockInstance = { - scan: (declarations) => { + scan: declarations => { called = true; calledDeclarations = declarations; - } + }, }; - FunctionTracer.prototype.scan.call(mockInstance, { type: 'VariableDeclaration', declarations: mockDeclarations }); + FunctionTracer.prototype.scan.call(mockInstance, { + type: 'VariableDeclaration', + declarations: mockDeclarations, + }); assert.ok(called); assert.deepEqual(calledDeclarations, mockDeclarations); }); @@ -183,12 +207,15 @@ test('works with FunctionExpression when runningContexts.length = 0', () => { const mockInstance = { runningContexts: [], functions: [], - scan: (body) => { + scan: body => { called = true; calledBody = body; - } + }, }; - FunctionTracer.prototype.scan.call(mockInstance, { type: 'FunctionExpression', body: mockBody }); + FunctionTracer.prototype.scan.call(mockInstance, { + type: 'FunctionExpression', + body: mockBody, + }); assert.ok(called); assert.equal(calledBody, mockBody); assert.equal(mockInstance.functions.length, 0); @@ -201,12 +228,15 @@ test('works with FunctionDeclaration when runningContexts.length = 0', () => { const mockInstance = { runningContexts: [], functions: [], - scan: (body) => { + scan: body => { called = true; calledBody = body; - } + }, }; - FunctionTracer.prototype.scan.call(mockInstance, { type: 'FunctionDeclaration', body: mockBody }); + FunctionTracer.prototype.scan.call(mockInstance, { + type: 'FunctionDeclaration', + body: mockBody, + }); assert.ok(called); assert.equal(calledBody, mockBody); assert.equal(mockInstance.functions.length, 0); @@ -219,7 +249,7 @@ test('works with FunctionExpression when runningContexts.length > 0', () => { runningContexts: [null], scan: () => { throw new Error('should not be called'); - } + }, }; const mockAst = { type: 'FunctionExpression', body: mockBody }; FunctionTracer.prototype.scan.call(mockInstance, mockAst); @@ -234,7 +264,7 @@ test('works with FunctionDeclaration when runningContexts.length > 0', () => { runningContexts: [null], scan: () => { throw new Error('should not be called'); - } + }, }; const mockAst = { type: 'FunctionDeclaration', body: mockBody }; FunctionTracer.prototype.scan.call(mockInstance, mockAst); @@ -242,7 +272,6 @@ test('works with FunctionDeclaration when runningContexts.length > 0', () => { assert.equal(mockInstance.functions[0], mockAst); }); - test('works with IfStatement', () => { const mockTest = {}; const mockConsequent = {}; @@ -250,10 +279,10 @@ test('works with IfStatement', () => { let called = false; let calledArgs = []; const mockInstance = { - scan: (arg) => { + scan: arg => { called = true; calledArgs.push(arg); - } + }, }; FunctionTracer.prototype.scan.call(mockInstance, { type: 'IfStatement', @@ -283,12 +312,16 @@ test('works with DoWhileStatement', () => { contexts: [], runningContexts: [], newContext: FunctionTracer.prototype.newContext, - scan: (arg) => { + scan: arg => { called = true; calledArgs.push(arg); - } + }, }; - FunctionTracer.prototype.scan.call(mockInstance, { type: 'DoWhileStatement', body: mockBody, test: mockTest }); + FunctionTracer.prototype.scan.call(mockInstance, { + type: 'DoWhileStatement', + body: mockBody, + test: mockTest, + }); assert.ok(called); assert.deepEqual(calledArgs, [mockBody, mockTest]); }); @@ -302,12 +335,16 @@ test('works with WhileStatement', () => { contexts: [], runningContexts: [], newContext: FunctionTracer.prototype.newContext, - scan: (arg) => { + scan: arg => { called = true; calledArgs.push(arg); - } + }, }; - FunctionTracer.prototype.scan.call(mockInstance, { type: 'WhileStatement', body: mockBody, test: mockTest }); + FunctionTracer.prototype.scan.call(mockInstance, { + type: 'WhileStatement', + body: mockBody, + test: mockTest, + }); assert.ok(called); assert.deepEqual(calledArgs, [mockBody, mockTest]); }); @@ -326,11 +363,13 @@ test('works with Identifier', () => { FunctionTracer.prototype.scan.call(mockInstance, mockAst); assert.ok(mockGetDeclaration.called); assert.equal(mockGetDeclaration.args[0][0], 'x'); - assert.deepEqual(mockInstance.identifiers, [{ - context: mockInstance.currentContext, - ast: mockAst, - declaration: 123 - }]); + assert.deepEqual(mockInstance.identifiers, [ + { + context: mockInstance.currentContext, + ast: mockAst, + declaration: 123, + }, + ]); assert.equal(mockIsState.args[0][0], 'trackIdentifiers'); }); @@ -340,10 +379,10 @@ test('works with ReturnStatement', () => { let calledArgument = null; const mockInstance = { returnStatements: [], - scan: (argument) => { + scan: argument => { called = true; calledArgument = argument; - } + }, }; const mockAst = { type: 'ReturnStatement', argument: mockArgument }; FunctionTracer.prototype.scan.call(mockInstance, mockAst); @@ -352,7 +391,6 @@ test('works with ReturnStatement', () => { assert.equal(mockInstance.returnStatements[0], mockAst); }); - test('works with MemberExpression', () => { const mockBody = {}; const mockProperty = {}; @@ -364,7 +402,11 @@ test('works with MemberExpression', () => { pushState: mockPushState, popState: mockPopState, }; - FunctionTracer.prototype.scan.call(mockInstance, { type: 'MemberExpression', object: mockBody, property: mockProperty }); + FunctionTracer.prototype.scan.call(mockInstance, { + type: 'MemberExpression', + object: mockBody, + property: mockProperty, + }); assert.ok(mockScan.called); assert.equal(mockScan.args[0][0], mockBody); assert.equal(mockScan.args[1][0], mockProperty); @@ -372,18 +414,20 @@ test('works with MemberExpression', () => { assert.equal(mockPopState.args[0][0], 'memberExpression'); }); - test('works with ExpressionStatement', () => { const mockExpression = {}; let called = false; let calledExpression = null; const mockInstance = { - scan: (body) => { + scan: body => { called = true; calledExpression = body; - } + }, }; - FunctionTracer.prototype.scan.call(mockInstance, { type: 'ExpressionStatement', expression: mockExpression }); + FunctionTracer.prototype.scan.call(mockInstance, { + type: 'ExpressionStatement', + expression: mockExpression, + }); assert.ok(called); assert.equal(calledExpression, mockExpression); }); @@ -394,12 +438,15 @@ test('works with SequenceExpression', () => { let called = false; let calledExpression = null; const mockInstance = { - scan: (body) => { + scan: body => { called = true; calledExpression = body; - } + }, }; - FunctionTracer.prototype.scan.call(mockInstance, { type: 'SequenceExpression', expressions: mockExpressions }); + FunctionTracer.prototype.scan.call(mockInstance, { + type: 'SequenceExpression', + expressions: mockExpressions, + }); assert.ok(called); assert.equal(calledExpression, mockExpressions); }); @@ -412,19 +459,21 @@ test('works with CallExpression', () => { const mockInstance = { currentContext: mockCurrentContext, functionCalls: [], - scan: (_arguments) => { + scan: _arguments => { called = true; calledArguments = _arguments; - } + }, }; const mockAst = { type: 'CallExpression', arguments: mockArguments }; FunctionTracer.prototype.scan.call(mockInstance, mockAst); assert.ok(called); assert.equal(calledArguments, mockArguments); - assert.deepEqual(mockInstance.functionCalls, [{ - context: mockCurrentContext, - ast: mockAst - }]); + assert.deepEqual(mockInstance.functionCalls, [ + { + context: mockCurrentContext, + ast: mockAst, + }, + ]); }); test('works with ArrayExpression', () => { @@ -432,12 +481,15 @@ test('works with ArrayExpression', () => { let called = false; let calledElements = null; const mockInstance = { - scan: (elements) => { + scan: elements => { called = true; calledElements = elements; - } + }, }; - FunctionTracer.prototype.scan.call(mockInstance, { type: 'ArrayExpression', elements: mockElements }); + FunctionTracer.prototype.scan.call(mockInstance, { + type: 'ArrayExpression', + elements: mockElements, + }); assert.ok(called); assert.equal(calledElements, mockElements); }); @@ -449,12 +501,17 @@ test('works with ConditionalExpression', () => { let called = false; let calledArgs = []; const mockInstance = { - scan: (arg) => { + scan: arg => { called = true; calledArgs.push(arg); - } + }, }; - FunctionTracer.prototype.scan.call(mockInstance, { type: 'ConditionalExpression', test: mockTest, alternate: mockAlternate, consequent: mockConsequent }); + FunctionTracer.prototype.scan.call(mockInstance, { + type: 'ConditionalExpression', + test: mockTest, + alternate: mockAlternate, + consequent: mockConsequent, + }); assert.ok(called); assert.deepEqual(calledArgs, [mockTest, mockConsequent, mockConsequent]); }); @@ -465,12 +522,16 @@ test('works with SwitchStatement', () => { let called = false; let calledArgs = []; const mockInstance = { - scan: (arg) => { + scan: arg => { called = true; calledArgs.push(arg); - } + }, }; - FunctionTracer.prototype.scan.call(mockInstance, { type: 'SwitchStatement', discriminant: mockDiscriminant, cases: mockCases }); + FunctionTracer.prototype.scan.call(mockInstance, { + type: 'SwitchStatement', + discriminant: mockDiscriminant, + cases: mockCases, + }); assert.ok(called); assert.deepEqual(calledArgs, [mockDiscriminant, mockCases]); }); @@ -481,12 +542,16 @@ test('works with SwitchCase', () => { let called = false; let calledArgs = []; const mockInstance = { - scan: (arg) => { + scan: arg => { called = true; calledArgs.push(arg); - } + }, }; - FunctionTracer.prototype.scan.call(mockInstance, { type: 'SwitchCase', test: mockTest, consequent: mockConsequent }); + FunctionTracer.prototype.scan.call(mockInstance, { + type: 'SwitchCase', + test: mockTest, + consequent: mockConsequent, + }); assert.ok(called); assert.deepEqual(calledArgs, [mockTest, mockConsequent]); }); @@ -496,16 +561,9 @@ test('does nothing with un-scan-ables', () => { const mockInstance = { scan: () => { called = true; - } + }, }; - [ - 'ThisExpression', - 'Literal', - 'DebuggerStatement', - 'EmptyStatement', - 'BreakStatement', - 'ContinueStatement' - ].forEach(type => { + ['ThisExpression', 'Literal', 'DebuggerStatement', 'EmptyStatement', 'BreakStatement', 'ContinueStatement'].forEach(type => { FunctionTracer.prototype.scan.call(mockInstance, { type }); }); assert.ok(!called); @@ -520,16 +578,13 @@ test('when called with fake type, throws', () => { test('can handle direct arrays', () => { const mockBlockBody = {}; const mockProgramBody = {}; - const asts = [ - { type: 'BlockStatement' }, - { type: 'Program' }, - ]; + const asts = [{ type: 'BlockStatement' }, { type: 'Program' }]; const calledAsts = []; const mockInstance = { - scan: (ast) => { + scan: ast => { calledAsts.push(ast); - } + }, }; FunctionTracer.prototype.scan.call(mockInstance, asts); assert.deepEqual(calledAsts, asts); -}); \ No newline at end of file +}); diff --git a/test/internal/gpu-methods.js b/test/internal/gpu-methods.js index 2753b6c8..baad0d65 100644 --- a/test/internal/gpu-methods.js +++ b/test/internal/gpu-methods.js @@ -23,9 +23,9 @@ test('.createKernelMap() object map with settings', () => { gpu.Kernel = MockKernel; const subKernels = { bobResult: bob, - tomResult: tom + tomResult: tom, }; - const kernelSource = function() {}; + const kernelSource = function () {}; const masterSettings = {}; const kernel = gpu.createKernelMap(subKernels, kernelSource, masterSettings); assert.equal(source, kernelSource.toString()); @@ -36,16 +36,17 @@ test('.createKernelMap() object map with settings', () => { assert.equal(settings.nativeFunctions, gpu.nativeFunctions); assert.equal(settings.gpu, gpu); assert.equal(settings.validate, true); - assert.deepEqual(kernel.subKernels, [{ + assert.deepEqual(kernel.subKernels, [ + { name: 'bob', source: bob.toString(), - property: 'bobResult' + property: 'bobResult', }, { name: 'tom', source: tom.toString(), - property: 'tomResult' - } + property: 'tomResult', + }, ]); }); @@ -68,7 +69,7 @@ test('.createKernelMap() array map with settings', () => { } gpu.Kernel = MockKernel; const subKernels = [bob, tom]; - const kernelSource = function() {}; + const kernelSource = function () {}; const masterSettings = {}; const kernel = gpu.createKernelMap(subKernels, kernelSource, masterSettings); assert.equal(source, kernelSource.toString()); @@ -79,15 +80,16 @@ test('.createKernelMap() array map with settings', () => { assert.equal(settings.nativeFunctions, gpu.nativeFunctions); assert.equal(settings.gpu, gpu); assert.equal(settings.validate, true); - assert.deepEqual(kernel.subKernels, [{ + assert.deepEqual(kernel.subKernels, [ + { name: 'bob', source: bob.toString(), - property: 0 + property: 0, }, { name: 'tom', source: tom.toString(), - property: 1 - } + property: 1, + }, ]); -}); \ No newline at end of file +}); diff --git a/test/internal/implied-else.js b/test/internal/implied-else.js index 2f2d556a..632edb0f 100644 --- a/test/internal/implied-else.js +++ b/test/internal/implied-else.js @@ -5,12 +5,15 @@ describe('internal: Implied else'); function neverReachedWhenEarlyReturn(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(check, v1, v2) { - if (check) { - return v1; - } - return v2; - }, { output: [1] }); + const kernel = gpu.createKernel( + function (check, v1, v2) { + if (check) { + return v1; + } + return v2; + }, + { output: [1] } + ); const result = kernel(true, 123, 321); assert.equal(result[0], 123); gpu.destroy(); @@ -42,12 +45,15 @@ test('never reached when early return cpu', () => { function handlesImpliedElse(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(check, v1, v2) { - if (check) { - return v1; - } - return v2; - }, { output: [1] }); + const kernel = gpu.createKernel( + function (check, v1, v2) { + if (check) { + return v1; + } + return v2; + }, + { output: [1] } + ); const result = kernel(true, 123, 321); assert.equal(result[0], 123); gpu.destroy(); @@ -75,4 +81,4 @@ test('handles implied else gpu', () => { test('handles implied else cpu', () => { handlesImpliedElse('cpu'); -}); \ No newline at end of file +}); diff --git a/test/internal/kernel-run-shortcut.js b/test/internal/kernel-run-shortcut.js index be075f48..043e0d6f 100644 --- a/test/internal/kernel-run-shortcut.js +++ b/test/internal/kernel-run-shortcut.js @@ -6,13 +6,16 @@ describe('internal: kernelRunShortcut'); function testImmutableSavesSwitchedKernel(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(value) { - return value[0] + 1; - }, { - output: [1], - pipeline: true, - immutable: true, - }); + const kernel = gpu.createKernel( + function (value) { + return value[0] + 1; + }, + { + output: [1], + pipeline: true, + immutable: true, + } + ); const one = kernel(new Float32Array([0])); const arrayKernel = kernel.kernel; const arrayKernelSpy = sinon.spy(arrayKernel, 'onRequestSwitchKernel'); @@ -79,4 +82,4 @@ test('immutable saves switched kernel gpu', () => { (GPU.isHeadlessGLSupported ? test : skip)('immutable saves switched kernel headlessgl', () => { testImmutableSavesSwitchedKernel('headlessgl'); -}); \ No newline at end of file +}); diff --git a/test/internal/kernel.js b/test/internal/kernel.js index 164a0c2d..e32d71be 100644 --- a/test/internal/kernel.js +++ b/test/internal/kernel.js @@ -11,10 +11,12 @@ function argumentTypesTest(Kernel) { const kernel = new Kernel(`function(value) { return value[this.thread.x]; }`, { output: [1], functionBuilder: { - addKernel: function() {}, - addFunctions: function() {}, - getPrototypes: function() { return []; }, - addNativeFunctions: function() {} + addKernel: function () {}, + addFunctions: function () {}, + getPrototypes: function () { + return []; + }, + addNativeFunctions: function () {}, }, }); kernel.build([1]); @@ -49,9 +51,9 @@ function setUniform1fTest(Kernel) { uniform1f: () => { if (throws) new Error('This should not get called'); }, - getUniformLocation: (name) => { + getUniformLocation: name => { return name; - } + }, }; const kernel = new Kernel('function() {}', { canvas, context, output: [1] }); let throws = false; @@ -88,9 +90,9 @@ function setUniform1iTest(Kernel) { uniform1i: () => { if (throws) new Error('This should not get called'); }, - getUniformLocation: (name) => { + getUniformLocation: name => { return name; - } + }, }; const kernel = new Kernel('function() {}', { canvas, context, output: [1] }); let throws = false; @@ -127,9 +129,9 @@ function setUniform2fTest(Kernel) { uniform2f: () => { if (throws) new Error('This should not get called'); }, - getUniformLocation: (name) => { + getUniformLocation: name => { return name; - } + }, }; const kernel = new Kernel('function() {}', { canvas, context, output: [1] }); let throws = false; @@ -165,9 +167,9 @@ function setUniform2fvTest(Kernel) { uniform2fv: () => { if (throws) new Error('This should not get called'); }, - getUniformLocation: (name) => { + getUniformLocation: name => { return name; - } + }, }; const kernel = new Kernel('function() {}', { canvas, context, output: [1] }); let throws = false; @@ -203,9 +205,9 @@ function setUniform3fvTest(Kernel) { uniform3fv: () => { if (throws) new Error('This should not get called'); }, - getUniformLocation: (name) => { + getUniformLocation: name => { return name; - } + }, }; const kernel = new Kernel('function() {}', { canvas, context, output: [1] }); let throws = false; @@ -241,9 +243,9 @@ function setUniform4ivTest(Kernel) { uniform4iv: () => { if (throws) new Error('This should not get called'); }, - getUniformLocation: (name) => { + getUniformLocation: name => { return name; - } + }, }; const kernel = new Kernel('function() {}', { canvas, context, output: [1] }); let throws = false; @@ -279,9 +281,9 @@ function setUniform4fvTest(Kernel) { uniform4fv: () => { if (throws) new Error('This should not get called'); }, - getUniformLocation: (name) => { + getUniformLocation: name => { return name; - } + }, }; const kernel = new Kernel('function() {}', { canvas, context, output: [1] }); let throws = false; @@ -314,14 +316,16 @@ test('functionToIFunction with function', () => { name: 'name', source: fn.toString(), argumentTypes: [], - returnType: null + returnType: null, }); }); test('functionToIFunction with function and argumentTypes array', () => { const fn = function name(a, b) {}; const argumentTypes = ['number', 'string']; - const result = Kernel.prototype.functionToIGPUFunction(fn, { argumentTypes }); + const result = Kernel.prototype.functionToIGPUFunction(fn, { + argumentTypes, + }); assert.deepEqual(result, { name: 'name', source: fn.toString(), @@ -333,7 +337,9 @@ test('functionToIFunction with function and argumentTypes array', () => { test('functionToIFunction with function and argumentTypes object', () => { const fn = function name(a, b) {}; const argumentTypes = { a: 'number', b: 'string' }; - const result = Kernel.prototype.functionToIGPUFunction(fn, { argumentTypes }); + const result = Kernel.prototype.functionToIGPUFunction(fn, { + argumentTypes, + }); assert.deepEqual(result, { name: 'name', source: fn.toString(), @@ -344,11 +350,13 @@ test('functionToIFunction with function and argumentTypes object', () => { test('functionToIGPUFunction with function and returnType', () => { const fn = function name(a, b) {}; - const result = Kernel.prototype.functionToIGPUFunction(fn, { returnType: 'string' }); + const result = Kernel.prototype.functionToIGPUFunction(fn, { + returnType: 'string', + }); assert.deepEqual(result, { name: 'name', source: fn.toString(), argumentTypes: [], returnType: 'string', }); -}); \ No newline at end of file +}); diff --git a/test/internal/loop-int.js b/test/internal/loop-int.js index f2636b38..85bd0773 100644 --- a/test/internal/loop-int.js +++ b/test/internal/loop-int.js @@ -14,20 +14,12 @@ test('loop int constant output webgl', () => { isRootKernel: true, output: [1], constantTypes: { - max: 'Integer' + max: 'Integer', }, argumentTypes: ['Array'], lookupFunctionArgumentBitRatio: () => 4, }); - assert.equal( - functionNode.toString(), - 'void kernel() {' + - '\nfloat user_sum=0.0;' + - '\nfor (int user_i=0;(user_i { @@ -45,15 +37,7 @@ test('loop int constant output webgl2', () => { argumentTypes: ['Array'], lookupFunctionArgumentBitRatio: () => 4, }); - assert.equal( - functionNode.toString(), - 'void kernel() {' + - '\nfloat user_sum=0.0;' + - '\nfor (int user_i=0;(user_i { @@ -67,15 +51,10 @@ test('loop int constant output webgl2', () => { const gpu = new GPU({ mode: 'webgl' }); const output = gpu.createKernel(kernel, { constants: { max: 3 }, - output: [1] - })([ - [1, 2, 3] - ]); + output: [1], + })([[1, 2, 3]]); - assert.equal( - output, - 6 - ); + assert.equal(output, 6); gpu.destroy(); }); @@ -90,15 +69,10 @@ test('loop int constant output webgl2', () => { const gpu = new GPU({ mode: 'webgl2' }); const output = gpu.createKernel(kernel, { constants: { max: 3 }, - output: [1] - })([ - [1, 2, 3] - ]); + output: [1], + })([[1, 2, 3]]); - assert.equal( - output, - 6 - ); + assert.equal(output, 6); gpu.destroy(); }); @@ -113,15 +87,10 @@ test('loop int constant output webgl2', () => { const gpu = new GPU({ mode: 'headlessgl' }); const output = gpu.createKernel(kernel, { constants: { max: 3 }, - output: [1] - })([ - [1, 2, 3] - ]); + output: [1], + })([[1, 2, 3]]); - assert.equal( - output, - 6 - ); + assert.equal(output, 6); gpu.destroy(); }); @@ -139,15 +108,7 @@ test('loop int literal output webgl', () => { argumentTypes: ['Array'], lookupFunctionArgumentBitRatio: () => 4, }); - assert.equal( - functionNode.toString(), - 'void kernel() {' + - '\nfloat user_sum=0.0;' + - '\nfor (int user_i=0;(user_i<10);user_i++){' + - '\nuser_sum+=get32(user_a, user_aSize, user_aDim, 0, threadId.x, user_i);}' + - '\n' + - '\nkernelResult = user_sum;return;' + - '\n}'); + assert.equal(functionNode.toString(), 'void kernel() {' + '\nfloat user_sum=0.0;' + '\nfor (int user_i=0;(user_i<10);user_i++){' + '\nuser_sum+=get32(user_a, user_aSize, user_aDim, 0, threadId.x, user_i);}' + '\n' + '\nkernelResult = user_sum;return;' + '\n}'); }); test('loop int literal output webgl2', () => { @@ -164,15 +125,7 @@ test('loop int literal output webgl2', () => { argumentTypes: ['Array'], lookupFunctionArgumentBitRatio: () => 4, }); - assert.equal( - functionNode.toString(), - 'void kernel() {' + - '\nfloat user_sum=0.0;' + - '\nfor (int user_i=0;(user_i<10);user_i++){' + - '\nuser_sum+=get32(user_a, user_aSize, user_aDim, 0, threadId.x, user_i);}' + - '\n' + - '\nkernelResult = user_sum;return;' + - '\n}'); + assert.equal(functionNode.toString(), 'void kernel() {' + '\nfloat user_sum=0.0;' + '\nfor (int user_i=0;(user_i<10);user_i++){' + '\nuser_sum+=get32(user_a, user_aSize, user_aDim, 0, threadId.x, user_i);}' + '\n' + '\nkernelResult = user_sum;return;' + '\n}'); }); (GPU.isWebGLSupported ? test : skip)('loop int literal webgl', () => { @@ -184,13 +137,8 @@ test('loop int literal output webgl2', () => { return sum; } const gpu = new GPU({ mode: 'webgl' }); - const output = gpu.createKernel(kernel, { output: [1] })([ - [1, 2, 3] - ]); - assert.equal( - output, - 6 - ); + const output = gpu.createKernel(kernel, { output: [1] })([[1, 2, 3]]); + assert.equal(output, 6); gpu.destroy(); }); @@ -203,13 +151,8 @@ test('loop int literal output webgl2', () => { return sum; } const gpu = new GPU({ mode: 'webgl2' }); - const output = gpu.createKernel(kernel, { output: [1] })([ - [1, 2, 3] - ]); - assert.equal( - output, - 6 - ); + const output = gpu.createKernel(kernel, { output: [1] })([[1, 2, 3]]); + assert.equal(output, 6); gpu.destroy(); }); @@ -222,13 +165,8 @@ test('loop int literal output webgl2', () => { return sum; } const gpu = new GPU({ mode: 'headlessgl' }); - const output = gpu.createKernel(kernel, { output: [1] })([ - [1, 2, 3] - ]); - assert.equal( - output, - 6 - ); + const output = gpu.createKernel(kernel, { output: [1] })([[1, 2, 3]]); + assert.equal(output, 6); gpu.destroy(); }); @@ -244,20 +182,9 @@ test('loop int parameter output webgl', () => { isRootKernel: true, output: [1], argumentTypes: ['Number', 'Array'], - lookupFunctionArgumentBitRatio: () => 4 + lookupFunctionArgumentBitRatio: () => 4, }); - assert.equal( - functionNode.toString(), - 'void kernel() {' + - '\nfloat user_sum=0.0;' + - '\nint user_i=0;' + - '\nfor (int safeI=0;safeI { @@ -274,18 +201,7 @@ test('loop int parameter output webgl2', () => { argumentTypes: ['Number', 'Array'], lookupFunctionArgumentBitRatio: () => 4, }); - assert.equal( - functionNode.toString(), - 'void kernel() {' + - '\nfloat user_sum=0.0;' + - '\nint user_i=0;' + - '\nfor (int safeI=0;safeI { @@ -297,13 +213,8 @@ test('loop int parameter output webgl2', () => { return sum; } const gpu = new GPU({ mode: 'webgl' }); - const output = gpu.createKernel(kernel, { output: [1] })(3, [ - [1, 2, 3] - ]); - assert.equal( - output, - 6 - ); + const output = gpu.createKernel(kernel, { output: [1] })(3, [[1, 2, 3]]); + assert.equal(output, 6); gpu.destroy(); }); @@ -316,13 +227,8 @@ test('loop int parameter output webgl2', () => { return sum; } const gpu = new GPU({ mode: 'webgl2' }); - const output = gpu.createKernel(kernel, { output: [1] })(3, [ - [1, 2, 3] - ]); - assert.equal( - output, - 6 - ); + const output = gpu.createKernel(kernel, { output: [1] })(3, [[1, 2, 3]]); + assert.equal(output, 6); gpu.destroy(); }); @@ -335,13 +241,8 @@ test('loop int parameter output webgl2', () => { return sum; } const gpu = new GPU({ mode: 'headlessgl' }); - const output = gpu.createKernel(kernel, { output: [1] })(3, [ - [1, 2, 3] - ]); - assert.equal( - output, - 6 - ); + const output = gpu.createKernel(kernel, { output: [1] })(3, [[1, 2, 3]]); + assert.equal(output, 6); gpu.destroy(); }); @@ -357,14 +258,9 @@ test('loop int parameter output webgl2', () => { const output = gpu.createKernel(kernel, { dynamicOutput: true, output: [1], - })([ - [3] - ]); + })([[3]]); - assert.deepEqual( - Array.from(output), - [3] - ); + assert.deepEqual(Array.from(output), [3]); gpu.destroy(); }); @@ -379,15 +275,10 @@ test('loop int parameter output webgl2', () => { const gpu = new GPU({ mode: 'webgl2' }); const output = gpu.createKernel(kernel, { dynamicOutput: true, - output: [1] - })([ - [3] - ]); + output: [1], + })([[3]]); - assert.deepEqual( - Array.from(output), - [3] - ); + assert.deepEqual(Array.from(output), [3]); gpu.destroy(); }); @@ -403,13 +294,8 @@ test('loop int parameter output webgl2', () => { const output = gpu.createKernel(kernel, { dynamicOutput: true, output: [1], - })([ - [3] - ]); + })([[3]]); - assert.deepEqual( - Array.from(output), - [3] - ); + assert.deepEqual(Array.from(output), [3]); gpu.destroy(); -}); \ No newline at end of file +}); diff --git a/test/internal/loop-max.js b/test/internal/loop-max.js index b97464da..f6604db2 100644 --- a/test/internal/loop-max.js +++ b/test/internal/loop-max.js @@ -4,106 +4,85 @@ const { GPU, WebGLFunctionNode, WebGL2FunctionNode } = require('../../src'); describe('internal: loop max'); test('loop max output webgl', () => { - const functionNode = new WebGLFunctionNode((function(a, b) { - let sum = 0; - for (let i = 0; i < a; i++) { - sum += b[this.thread.x][i]; + const functionNode = new WebGLFunctionNode( + function (a, b) { + let sum = 0; + for (let i = 0; i < a; i++) { + sum += b[this.thread.x][i]; + } + return sum; + }.toString(), + { + isRootKernel: true, + name: 'kernel', + output: [1], + argumentTypes: ['Number', 'Array'], + lookupFunctionArgumentBitRatio: () => 4, } - return sum; - }).toString(), { - isRootKernel: true, - name: 'kernel', - output: [1], - argumentTypes: ['Number', 'Array'], - lookupFunctionArgumentBitRatio: () => 4, - }); + ); - assert.equal( - functionNode.toString(), - 'void kernel() {' + - '\nfloat user_sum=0.0;' + - '\nint user_i=0;' + - '\nfor (int safeI=0;safeI { - const functionNode = new WebGL2FunctionNode((function(a, b) { - let sum = 0; - for (let i = 0; i < a; i++) { - sum += b[this.thread.x][i]; + const functionNode = new WebGL2FunctionNode( + function (a, b) { + let sum = 0; + for (let i = 0; i < a; i++) { + sum += b[this.thread.x][i]; + } + return sum; + }.toString(), + { + isRootKernel: true, + name: 'kernel', + output: [1], + argumentTypes: ['Number', 'Array'], + lookupFunctionArgumentBitRatio: () => 4, } - return sum; - }).toString(), { - isRootKernel: true, - name: 'kernel', - output: [1], - argumentTypes: ['Number', 'Array'], - lookupFunctionArgumentBitRatio: () => 4, - }); + ); - assert.equal( - functionNode.toString(), - 'void kernel() {' + - '\nfloat user_sum=0.0;' + - '\nint user_i=0;' + - '\nfor (int safeI=0;safeI { const gpu = new GPU({ mode: 'webgl' }); - const add = gpu.createKernel(function(a, b) { - let sum = 0; - for (let i = 0; i < a; i++) { - sum += b[this.thread.x][i]; - } - return sum; - }).setOutput([1]); + const add = gpu + .createKernel(function (a, b) { + let sum = 0; + for (let i = 0; i < a; i++) { + sum += b[this.thread.x][i]; + } + return sum; + }) + .setOutput([1]); - const output = add(1, [ - [1] - ]); - assert.equal( - output[0], - 1 - ); + const output = add(1, [[1]]); + assert.equal(output[0], 1); gpu.destroy(); }); (GPU.isWebGL2Supported ? test : skip)('loop max webgl2', () => { const gpu = new GPU({ mode: 'webgl2' }); - const add = gpu.createKernel(function(a, b) { - let sum = 0; - for (let i = 0; i < a; i++) { - sum += b[this.thread.x][i]; - } - return sum; - }).setOutput([1]); + const add = gpu + .createKernel(function (a, b) { + let sum = 0; + for (let i = 0; i < a; i++) { + sum += b[this.thread.x][i]; + } + return sum; + }) + .setOutput([1]); - const output = add(1, [ - [1] - ]); - assert.equal( - output[0], - 1 - ); + const output = add(1, [[1]]); + assert.equal(output[0], 1); gpu.destroy(); }); (GPU.isHeadlessGLSupported ? test : skip)('loop max headlessgl', () => { const gpu = new GPU({ mode: 'headlessgl' }); - const add = gpu.createKernel(function(a, b) { + const add = gpu + .createKernel(function (a, b) { let sum = 0; for (let i = 0; i < a; i++) { sum += b[this.thread.x][i]; @@ -112,12 +91,7 @@ test('loop max output webgl2', () => { }) .setOutput([1]); - const output = add(1, [ - [1] - ]); - assert.equal( - output[0], - 1 - ); + const output = add(1, [[1]]); + assert.equal(output[0], 1); gpu.destroy(); -}); \ No newline at end of file +}); diff --git a/test/internal/math.random.js b/test/internal/math.random.js index 39900819..66175258 100644 --- a/test/internal/math.random.js +++ b/test/internal/math.random.js @@ -1,6 +1,9 @@ const { assert, skip, test, module: describe, only } = require('qunit'); const sinon = require('sinon'); -const { GPU, plugins: { mathRandom } } = require('../../src'); +const { + GPU, + plugins: { mathRandom }, +} = require('../../src'); describe('Math.random() unique'); @@ -9,18 +12,24 @@ function mathRandomUnique(mode) { const checkCount = 20; let seed1 = Math.random(); let seed2 = Math.random(); - let stub = sinon.stub(mathRandom, 'onBeforeRun').callsFake((kernel) => { + let stub = sinon.stub(mathRandom, 'onBeforeRun').callsFake(kernel => { kernel.setUniform1f('randomSeed1', seed1); kernel.setUniform1f('randomSeed2', seed2); }); try { - gpu.addNativeFunction('getSeed', `highp float getSeed() { + gpu.addNativeFunction( + 'getSeed', + `highp float getSeed() { return randomSeedShift; - }`); - const kernel = gpu.createKernel(function() { - const v = Math.random(); - return getSeed(); - }, { output: [1] }); + }` + ); + const kernel = gpu.createKernel( + function () { + const v = Math.random(); + return getSeed(); + }, + { output: [1] } + ); const results = []; for (let i = 0; i < checkCount; i++) { const result = kernel(); @@ -29,7 +38,7 @@ function mathRandomUnique(mode) { seed2 = result[0]; assert.ok(stub.called); stub.restore(); - stub.callsFake((kernel) => { + stub.callsFake(kernel => { kernel.setUniform1f('randomSeed1', seed1); kernel.setUniform1f('randomSeed2', seed2); }); @@ -68,7 +77,7 @@ function mathRandomNeverAboveOne(mode) { const checkSource = []; for (let i = 0; i < checkCount; i++) { - checkSource.push(`const check${ i } = Math.random();`); + checkSource.push(`const check${i} = Math.random();`); } for (let i = 0; i < checkCount; i++) { @@ -78,10 +87,13 @@ function mathRandomNeverAboveOne(mode) { } } - const kernel = gpu.createKernel(`function() { + const kernel = gpu.createKernel( + `function() { ${checkSource.join('\n')} return 0; - }`, { output: [1] }); + }`, + { output: [1] } + ); const result = kernel(); assert.ok(result.every(value => value === 0)); @@ -109,4 +121,4 @@ test('never above 1 every time gpu', () => { test('never above 1 every time cpu', () => { mathRandomNeverAboveOne('cpu'); -}); \ No newline at end of file +}); diff --git a/test/internal/matrix-multiply-precision.js b/test/internal/matrix-multiply-precision.js index ced12124..85d7f215 100644 --- a/test/internal/matrix-multiply-precision.js +++ b/test/internal/matrix-multiply-precision.js @@ -24,7 +24,7 @@ function vanillaMatrixMultiply(a, b) { function filledMatrix(width, height) { const matrix = new Array(height); for (let y = 0; y < height; y++) { - const row = matrix[y] = new Float32Array(width); + const row = (matrix[y] = new Float32Array(width)); for (let x = 0; x < width; x++) { row[x] = Math.random() * 10; } @@ -38,19 +38,22 @@ function test512x512Matrix(precision, mode) { const a = filledMatrix(width, height); const b = filledMatrix(width, height); const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(a, b) { - let sum = 0; - for (let i = 0; i < this.constants.width; i++) { - sum += a[this.thread.y][i] * b[i][this.thread.x]; - } - return sum; - }, { - output: [width, height], - precision, - constants: { - width + const kernel = gpu.createKernel( + function (a, b) { + let sum = 0; + for (let i = 0; i < this.constants.width; i++) { + sum += a[this.thread.y][i] * b[i][this.thread.x]; + } + return sum; + }, + { + output: [width, height], + precision, + constants: { + width, + }, } - }); + ); const cpuResult = vanillaMatrixMultiply(a, b, width, height); const gpuResult = kernel(a, b); let closeEnough = true; @@ -98,19 +101,22 @@ function test10x512Matrix(precision, mode) { const a = filledMatrix(width, height); const b = filledMatrix(width, height); const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(a, b) { - let sum = 0; - for (let i = 0; i < this.constants.width; i++) { - sum += a[this.thread.y][i] * b[i][this.thread.x]; - } - return sum; - }, { - output: [width, height], - precision, - constants: { - width + const kernel = gpu.createKernel( + function (a, b) { + let sum = 0; + for (let i = 0; i < this.constants.width; i++) { + sum += a[this.thread.y][i] * b[i][this.thread.x]; + } + return sum; + }, + { + output: [width, height], + precision, + constants: { + width, + }, } - }); + ); const cpuResult = vanillaMatrixMultiply(a, b, width, height); const gpuResult = kernel(a, b); let closeEnough = true; @@ -176,7 +182,6 @@ test('512x512 single precision cpu', () => { test512x512Matrix('single', 'cpu'); }); - (GPU.isSinglePrecisionSupported ? test : skip)('10x512 single precision auto', () => { test10x512Matrix('single'); }); @@ -199,4 +204,4 @@ test('512x512 single precision cpu', () => { test('10x512 single precision cpu', () => { test10x512Matrix('precision', 'cpu'); -}); \ No newline at end of file +}); diff --git a/test/internal/mixed-memory-optimize.js b/test/internal/mixed-memory-optimize.js index fc1b5c23..91e22441 100644 --- a/test/internal/mixed-memory-optimize.js +++ b/test/internal/mixed-memory-optimize.js @@ -4,7 +4,8 @@ const { GPU } = require('../../src'); describe('internal: mixed memory optimize'); function getOffKernel(gpu) { - return gpu.createKernel(function(value) { + return gpu + .createKernel(function (value) { return value[this.thread.x]; }) // getFloatFromSampler2D .setPrecision('single') @@ -14,7 +15,8 @@ function getOffKernel(gpu) { } function getOnKernel(gpu) { - return gpu.createKernel(function(value) { + return gpu + .createKernel(function (value) { return value[this.thread.x]; }) // getMemoryOptimized32 .setPrecision('single') @@ -62,7 +64,6 @@ test('off on off cpu', () => { }); }); - function onOffOn(mode) { const gpu = new GPU({ mode }); const onKernel = getOnKernel(gpu); @@ -107,4 +108,4 @@ test('on off on cpu', () => { assert.throws(() => { onOffOn('cpu'); }); -}); \ No newline at end of file +}); diff --git a/test/internal/modes.js b/test/internal/modes.js index c18730e7..0b3a2348 100644 --- a/test/internal/modes.js +++ b/test/internal/modes.js @@ -58,4 +58,4 @@ test('modes cpu', () => { (GPU.isHeadlessGLSupported ? test : skip)('modes headlessgl', () => { const gpu = new GPU({ mode: 'headlessgl' }); assert.equal(gpu.Kernel, HeadlessGLKernel); -}); \ No newline at end of file +}); diff --git a/test/internal/overloading.js b/test/internal/overloading.js index b413d523..042ffb88 100644 --- a/test/internal/overloading.js +++ b/test/internal/overloading.js @@ -8,22 +8,28 @@ describe('internal: overloading'); // TODO: Look into test('with Han', () => { const gpu = new GPU(); - gpu.addFunction(function dbl(v) { - return v + v; - }, { returnType: "Float", argumentTypes: { v: "Float" } }); + gpu.addFunction( + function dbl(v) { + return v + v; + }, + { returnType: 'Float', argumentTypes: { v: 'Float' } } + ); try { - const kernel = gpu.createKernel(function(v) { - // const output2 = dbl(2); - let sum = 0; - for (let i = 0; i < 1; i++) { - dbl(i); - } - // const output1 - dbl(Math.PI); - return sum; - }, { output: [1] }); + const kernel = gpu.createKernel( + function (v) { + // const output2 = dbl(2); + let sum = 0; + for (let i = 0; i < 1; i++) { + dbl(i); + } + // const output1 + dbl(Math.PI); + return sum; + }, + { output: [1] } + ); } finally { gpu.destroy(); } assert.ok(1); -}); \ No newline at end of file +}); diff --git a/test/internal/precision.js b/test/internal/precision.js index bf2ff6f6..4ef71f5a 100644 --- a/test/internal/precision.js +++ b/test/internal/precision.js @@ -5,15 +5,19 @@ describe('internal: precision'); (GPU.isWebGLSupported ? test : skip)('WebGL Decimal Precision', () => { const gpu = new GPU({ mode: 'webgl' }); - const add = gpu.createKernel(function(a, b) { - return a + b; - }).setOutput([1]); + const add = gpu + .createKernel(function (a, b) { + return a + b; + }) + .setOutput([1]); let addResult = add(0.1, 0.2)[0]; assert.equal(addResult.toFixed(7), (0.1 + 0.2).toFixed(7)); - const reflectValue = gpu.createKernel(function(a) { - return a; - }).setOutput([1]); + const reflectValue = gpu + .createKernel(function (a) { + return a; + }) + .setOutput([1]); //Just for sanity's sake, recurse the value to see if it spirals out of control for (let i = 0; i < 100; i++) { @@ -26,15 +30,19 @@ describe('internal: precision'); (GPU.isWebGL2Supported ? test : skip)('WebGL2 Decimal Precision', () => { const gpu = new GPU({ mode: 'webgl2' }); - const add = gpu.createKernel(function(a, b) { - return a + b; - }).setOutput([1]); + const add = gpu + .createKernel(function (a, b) { + return a + b; + }) + .setOutput([1]); let addResult = add(0.1, 0.2)[0]; assert.equal(addResult.toFixed(7), (0.1 + 0.2).toFixed(7)); - const reflectValue = gpu.createKernel(function(a) { - return a; - }).setOutput([1]); + const reflectValue = gpu + .createKernel(function (a) { + return a; + }) + .setOutput([1]); //Just for sanity's sake, recurse the value to see if it spirals out of control for (let i = 0; i < 100; i++) { @@ -47,15 +55,19 @@ describe('internal: precision'); (GPU.isHeadlessGLSupported ? test : skip)('HeadlessGL Decimal Precision', () => { const gpu = new GPU({ mode: 'headlessgl' }); - const add = gpu.createKernel(function(a, b) { - return a + b; - }).setOutput([1]); + const add = gpu + .createKernel(function (a, b) { + return a + b; + }) + .setOutput([1]); let addResult = add(0.1, 0.2)[0]; assert.equal(addResult.toFixed(7), (0.1 + 0.2).toFixed(7)); - const reflectValue = gpu.createKernel(function(a) { - return a; - }).setOutput([1]); + const reflectValue = gpu + .createKernel(function (a) { + return a; + }) + .setOutput([1]); //Just for sanity's sake, recurse the value to see if it spirals out of control for (let i = 0; i < 100; i++) { @@ -64,4 +76,4 @@ describe('internal: precision'); addResult = newAddResult; } gpu.destroy(); -}); \ No newline at end of file +}); diff --git a/test/internal/recycling.js b/test/internal/recycling.js index 6d4c455a..e4109cfe 100644 --- a/test/internal/recycling.js +++ b/test/internal/recycling.js @@ -6,14 +6,17 @@ describe('internal: recycling'); function testImmutableKernelTextureRecycling(precision, mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(v) { - return v[0] + 1; - }, { - output: [1], - pipeline: true, - immutable: true, - precision, - }); + const kernel = gpu.createKernel( + function (v) { + return v[0] + 1; + }, + { + output: [1], + pipeline: true, + immutable: true, + precision, + } + ); let result = kernel([0]); const newTextureSpy = sinon.spy(kernel.texture.constructor.prototype, 'newTexture'); for (let i = 0; i < 10; i++) { @@ -29,7 +32,7 @@ function testImmutableKernelTextureRecycling(precision, mode) { } test('immutable single precision kernel auto', () => { - testImmutableKernelTextureRecycling('single') + testImmutableKernelTextureRecycling('single'); }); test('immutable single precision kernel gpu', () => { @@ -49,7 +52,7 @@ test('immutable single precision kernel gpu', () => { }); test('immutable unsigned precision kernel auto', () => { - testImmutableKernelTextureRecycling('unsigned') + testImmutableKernelTextureRecycling('unsigned'); }); test('immutable unsigned precision kernel gpu', () => { @@ -74,17 +77,21 @@ function testImmutableMappedKernelTextureRecycling(precision, mode) { function oneOff(value) { return value; } - const kernel = gpu.createKernelMap({ - oneOffValue: oneOff - }, function(value1, value2) { - oneOff(value2[0] - 1); - return value1[0] + 1; - }, { - output: [1], - pipeline: true, - immutable: true, - precision, - }); + const kernel = gpu.createKernelMap( + { + oneOffValue: oneOff, + }, + function (value1, value2) { + oneOff(value2[0] - 1); + return value1[0] + 1; + }, + { + output: [1], + pipeline: true, + immutable: true, + precision, + } + ); let map = kernel([0], [11]); const newTextureSpy = sinon.spy(kernel.texture.constructor.prototype, 'newTexture'); for (let i = 0; i < 10; i++) { @@ -102,7 +109,7 @@ function testImmutableMappedKernelTextureRecycling(precision, mode) { } test('immutable single precision mapped kernel auto', () => { - testImmutableMappedKernelTextureRecycling('single') + testImmutableMappedKernelTextureRecycling('single'); }); test('immutable single precision mapped kernel gpu', () => { @@ -122,7 +129,7 @@ test('immutable single precision mapped kernel gpu', () => { }); test('immutable unsigned precision mapped kernel auto', () => { - testImmutableMappedKernelTextureRecycling('unsigned') + testImmutableMappedKernelTextureRecycling('unsigned'); }); test('immutable unsigned precision mapped kernel gpu', () => { @@ -143,14 +150,17 @@ test('immutable unsigned precision mapped kernel gpu', () => { function testImmutableTextureDelete(precision, done, mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function() { - return this.thread.x; - }, { - output: [1], - pipeline: true, - immutable: true, - precision, - }); + const kernel = gpu.createKernel( + function () { + return this.thread.x; + }, + { + output: [1], + pipeline: true, + immutable: true, + precision, + } + ); const result = kernel(); assert.equal(result.texture._refs, 2); const clone1 = result.clone(); @@ -177,14 +187,13 @@ function testImmutableTextureDelete(precision, done, mode) { result.delete(); assert.equal(result.texture._refs, 1); const spy = sinon.spy(kernel.kernel.context, 'deleteTexture'); - gpu.destroy() - .then(() => { - assert.equal(result.texture._refs, 0); - assert.equal(spy.callCount, 1); - assert.ok(spy.calledWith(result.texture)); - spy.restore(); - done(); - }); + gpu.destroy().then(() => { + assert.equal(result.texture._refs, 0); + assert.equal(spy.callCount, 1); + assert.ok(spy.calledWith(result.texture)); + spy.restore(); + done(); + }); } test('immutable single precision texture delete auto', t => { @@ -229,14 +238,17 @@ test('immutable unsigned precision texture delete gpu', t => { function testImmutableKernelTextureDoesNotLeak(precision, done, mode) { const gpu = new GPU({ mode }); - const toTexture = gpu.createKernel(function(value) { - return value[this.thread.x]; - }, { - output: [1], - pipeline: true, - immutable: true, - precision, - }); + const toTexture = gpu.createKernel( + function (value) { + return value[this.thread.x]; + }, + { + output: [1], + pipeline: true, + immutable: true, + precision, + } + ); const one = toTexture([1]); assert.equal(one.texture._refs, 2); // one's texture will be used in two places at first, in one and toTexture.texture assert.equal(toTexture.texture.texture, one.texture); // very important, a clone was mode, but not a deep clone @@ -252,11 +264,10 @@ function testImmutableKernelTextureDoesNotLeak(precision, done, mode) { assert.equal(two.texture._refs, 1); // still used by toTexture.texture two.delete(); // already deleted assert.equal(two.texture._refs, 1); // still used by toTexture - gpu.destroy() - .then(() => { - assert.equal(two.texture._refs, 0); - done(); - }); + gpu.destroy().then(() => { + assert.equal(two.texture._refs, 0); + done(); + }); } test('immutable unsigned precision kernel.texture does not leak auto', t => { @@ -305,15 +316,19 @@ function testImmutableKernelMappedTexturesDoesNotLeak(precision, done, mode) { function saveValue(value) { return value; } - const toTextures = gpu.createKernelMap([saveValue], function(value1, value2) { - saveValue(value1[this.thread.x]); - return value2[this.thread.x]; - }, { - output: [1], - pipeline: true, - immutable: true, - precision, - }); + const toTextures = gpu.createKernelMap( + [saveValue], + function (value1, value2) { + saveValue(value1[this.thread.x]); + return value2[this.thread.x]; + }, + { + output: [1], + pipeline: true, + immutable: true, + precision, + } + ); const { result: one, 0: two } = toTextures([1], [2]); assert.equal(one.texture._refs, 2); // one's texture will be used in two places at first, in one and toTexture.texture assert.equal(two.texture._refs, 2); // one's texture will be used in two places at first, in one and toTexture.mappedTextures[0] @@ -342,14 +357,13 @@ function testImmutableKernelMappedTexturesDoesNotLeak(precision, done, mode) { four.delete(); // already deleted assert.equal(three.texture._refs, 1); // still used by toTexture assert.equal(four.texture._refs, 1); // still used by toTexture - gpu.destroy() - .then(() => { - assert.equal(one.texture._refs, 0); - assert.equal(two.texture._refs, 0); - assert.equal(three.texture._refs, 0); - assert.equal(four.texture._refs, 0); - done(); - }); + gpu.destroy().then(() => { + assert.equal(one.texture._refs, 0); + assert.equal(two.texture._refs, 0); + assert.equal(three.texture._refs, 0); + assert.equal(four.texture._refs, 0); + done(); + }); } test('immutable unsigned precision kernel.mappedTextures does not leak auto', t => { @@ -394,9 +408,12 @@ test('immutable single precision kernel.mappedTextures does not leak gpu', t => function testCloning(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(value) { - return value[0] + 1; - }, { output: [1], pipeline: true }); + const kernel = gpu.createKernel( + function (value) { + return value[0] + 1; + }, + { output: [1], pipeline: true } + ); const texture = kernel([1]); const { size } = texture; @@ -422,12 +439,15 @@ function testCloning(mode) { function testMutableLeak(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function() { - return 1; - }, { - output: [1], - pipeline: true - }); + const kernel = gpu.createKernel( + function () { + return 1; + }, + { + output: [1], + pipeline: true, + } + ); kernel.build(); const cloneTextureSpy = sinon.spy(kernel.texture.constructor.prototype, 'beforeMutate'); const texture1 = kernel(); @@ -463,13 +483,16 @@ describe('internal: cpu recycling behaviour'); test('recycle CPU array', () => { const gpu = new GPU({ mode: 'cpu' }); - const kernel = gpu.createKernel(function(v) { - return this.thread.x + v[0]; - }, { - output: [1], - pipeline: true, - immutable: false, - }); + const kernel = gpu.createKernel( + function (v) { + return this.thread.x + v[0]; + }, + { + output: [1], + pipeline: true, + immutable: false, + } + ); const result1 = kernel(new Float32Array([1])); assert.equal(result1[0], 1); const result2 = kernel(new Float32Array([2])); @@ -481,13 +504,16 @@ test('recycle CPU array', () => { test('recycle CPU matrix', () => { const gpu = new GPU({ mode: 'cpu' }); - const kernel = gpu.createKernel(function(v) { - return (this.thread.x + (this.thread.y * this.output.x)) + v[0]; - }, { - output: [2, 2], - pipeline: true, - immutable: false, - }); + const kernel = gpu.createKernel( + function (v) { + return this.thread.x + this.thread.y * this.output.x + v[0]; + }, + { + output: [2, 2], + pipeline: true, + immutable: false, + } + ); const result1 = kernel(new Float32Array([1])); assert.equal(result1[0][0], 1); assert.equal(result1[0][1], 2); @@ -505,13 +531,16 @@ test('recycle CPU matrix', () => { test('recycle CPU cube', () => { const gpu = new GPU({ mode: 'cpu' }); - const kernel = gpu.createKernel(function(v) { - return (this.thread.x + (this.thread.y * this.output.x) + (this.thread.z * this.output.y * this.output.x)) + v[0]; - }, { - output: [2, 2, 2], - pipeline: true, - immutable: false, - }); + const kernel = gpu.createKernel( + function (v) { + return this.thread.x + this.thread.y * this.output.x + this.thread.z * this.output.y * this.output.x + v[0]; + }, + { + output: [2, 2, 2], + pipeline: true, + immutable: false, + } + ); const result1 = kernel(new Float32Array([1])); assert.equal(result1[0][0][0], 1); assert.equal(result1[0][0][1], 2); @@ -538,13 +567,16 @@ describe('internal: cpu non-recycling behaviour'); test('non-recycle CPU array', () => { const gpu = new GPU({ mode: 'cpu' }); - const kernel = gpu.createKernel(function(v) { - return this.thread.x + v[0]; - }, { - output: [1], - pipeline: true, - immutable: true, - }); + const kernel = gpu.createKernel( + function (v) { + return this.thread.x + v[0]; + }, + { + output: [1], + pipeline: true, + immutable: true, + } + ); const result1 = kernel(new Float32Array([1])); assert.equal(result1[0], 1); const result2 = kernel(new Float32Array([2])); @@ -557,13 +589,16 @@ test('non-recycle CPU array', () => { test('non-recycle CPU matrix', () => { const gpu = new GPU({ mode: 'cpu' }); - const kernel = gpu.createKernel(function(v) { - return (this.thread.x + (this.thread.y * this.output.x)) + v[0]; - }, { - output: [2, 2], - pipeline: true, - immutable: true, - }); + const kernel = gpu.createKernel( + function (v) { + return this.thread.x + this.thread.y * this.output.x + v[0]; + }, + { + output: [2, 2], + pipeline: true, + immutable: true, + } + ); const result1 = kernel(new Float32Array([1])); assert.equal(result1[0][0], 1); assert.equal(result1[0][1], 2); @@ -587,13 +622,16 @@ test('non-recycle CPU matrix', () => { test('non-recycle CPU cube', () => { const gpu = new GPU({ mode: 'cpu' }); - const kernel = gpu.createKernel(function(v) { - return (this.thread.x + (this.thread.y * this.output.x) + (this.thread.z * this.output.y * this.output.x)) + v[0]; - }, { - output: [2, 2, 2], - pipeline: true, - immutable: true, - }); + const kernel = gpu.createKernel( + function (v) { + return this.thread.x + this.thread.y * this.output.x + this.thread.z * this.output.y * this.output.x + v[0]; + }, + { + output: [2, 2, 2], + pipeline: true, + immutable: true, + } + ); const result1 = kernel(new Float32Array([1])); assert.equal(result1[0][0][0], 1); assert.equal(result1[0][0][1], 2); @@ -628,14 +666,17 @@ test('non-recycle CPU cube', () => { function testSameSourceDestinationFromResultThrows(error, precision, mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(value) { - return value[this.thread.x] + 1; - }, { - output: [1], - pipeline: true, - immutable: false, - precision, - }); + const kernel = gpu.createKernel( + function (value) { + return value[this.thread.x] + 1; + }, + { + output: [1], + pipeline: true, + immutable: false, + precision, + } + ); let result = kernel([0]); assert.equal((result.toArray ? result.toArray() : result)[0], 1); assert.throws(() => kernel(result), error); @@ -695,18 +736,22 @@ test('unsigned precision same source and destination from result mutable throws function testSameSourceDestinationFromMappedResultThrows(error, precision, mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernelMap({ - mappedResult: function map(v) { - return v; + const kernel = gpu.createKernelMap( + { + mappedResult: function map(v) { + return v; + }, + }, + function (value) { + return map(value[this.thread.x] + 1); + }, + { + output: [1], + pipeline: true, + immutable: false, + precision, } - }, function(value) { - return map(value[this.thread.x] + 1); - }, { - output: [1], - pipeline: true, - immutable: false, - precision, - }); + ); let { result, mappedResult } = kernel([0]); assert.equal((mappedResult.toArray ? mappedResult.toArray() : mappedResult)[0], 1); assert.throws(() => kernel(mappedResult), error); @@ -764,9 +809,12 @@ test('unsigned precision same source and destination from mapped result mutable function testOutputTextureIsClonedWhenRecompiling(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(value) { - return value[this.thread.x] + 1; - }, { output: [1], immutable: true, pipeline: true }); + const kernel = gpu.createKernel( + function (value) { + return value[this.thread.x] + 1; + }, + { output: [1], immutable: true, pipeline: true } + ); const result1 = kernel([1]); assert.equal(result1.toArray()[0], 2); const result2 = kernel(result1); @@ -808,12 +856,16 @@ function testMappedOutputTextureIsClonedWhenRecompiling(mode) { function setValue(value) { return value * 10; } - const kernel = gpu.createKernelMap({ - value: setValue, - }, function(value1, value2) { - setValue(value2[this.thread.x]); - return value1[this.thread.x] + 1; - }, { output: [1], immutable: true, pipeline: true }); + const kernel = gpu.createKernelMap( + { + value: setValue, + }, + function (value1, value2) { + setValue(value2[this.thread.x]); + return value1[this.thread.x] + 1; + }, + { output: [1], immutable: true, pipeline: true } + ); const map1 = kernel([1], [1]); assert.equal(map1.result.toArray()[0], 2); assert.equal(map1.value.toArray()[0], 10); @@ -855,4 +907,4 @@ test('mapped output texture is cloned when recompiling gpu', () => { (GPU.isHeadlessGLSupported ? test : skip)('mapped output texture is cloned when recompiling headlessgl', () => { testMappedOutputTextureIsClonedWhenRecompiling('headlessgl'); -}); \ No newline at end of file +}); diff --git a/test/internal/texture-index.js b/test/internal/texture-index.js index cadd111d..b8d9c577 100644 --- a/test/internal/texture-index.js +++ b/test/internal/texture-index.js @@ -5,9 +5,12 @@ describe('internal: texture index'); function createKernelWithNumberConstants(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function() { - return this.constants.v1 + this.constants.v2; - }, { output: [1], constants: { v1: 1, v2: 1 } }); + const kernel = gpu.createKernel( + function () { + return this.constants.v1 + this.constants.v2; + }, + { output: [1], constants: { v1: 1, v2: 1 } } + ); kernel(); assert.equal(kernel.kernelConstants.length, 2); @@ -35,12 +38,14 @@ test('createKernel with number constants auto', () => { createKernelWithNumberConstants('headlessgl'); }); - function createKernelWithArrayConstants(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function() { - return this.constants.v1[this.thread.x] + this.constants.v2[this.thread.x]; - }, { output: [1], constants: { v1: [1], v2: [1] } }); + const kernel = gpu.createKernel( + function () { + return this.constants.v1[this.thread.x] + this.constants.v2[this.thread.x]; + }, + { output: [1], constants: { v1: [1], v2: [1] } } + ); kernel(); const gl = kernel.context; @@ -70,14 +75,20 @@ test('createKernel with array constants auto', () => { function creatKernelWithNumberConstantsAndArrayArguments(mode) { const gpu = new GPU({ mode }); - const textureGetter = gpu.createKernel(function() { - return 1; - }, { output: [1], pipeline: true }); + const textureGetter = gpu.createKernel( + function () { + return 1; + }, + { output: [1], pipeline: true } + ); const texture1 = textureGetter(); const texture2 = textureGetter(); - const kernel = gpu.createKernel(function(value1, value2) { - return value1[this.thread.x] + value2[this.thread.x] + this.constants.v1 + this.constants.v2; - }, { output: [1], constants: { v1: 1, v2: 1 } }); + const kernel = gpu.createKernel( + function (value1, value2) { + return value1[this.thread.x] + value2[this.thread.x] + this.constants.v1 + this.constants.v2; + }, + { output: [1], constants: { v1: 1, v2: 1 } } + ); const output = kernel(texture1, texture2); @@ -118,17 +129,24 @@ function createKernelMapWithArrayConstantsAndTextureArguments(mode) { function calcValue2(v) { return v; } - const textureGetter = gpu.createKernel(function() { - return 1; - }, { output: [1], pipeline: true }); + const textureGetter = gpu.createKernel( + function () { + return 1; + }, + { output: [1], pipeline: true } + ); const texture1 = textureGetter(); const texture2 = textureGetter(); - const kernel = gpu.createKernelMap({ - mappedValue1: calcValue1, - mappedValue2: calcValue2, - }, function(value1, value2) { - return calcValue1(value1[this.thread.x] + value2[this.thread.x]) + calcValue2(this.constants.v1[this.thread.x] + this.constants.v2[this.thread.x]); - }, { output: [1], constants: { v1: [1], v2: [1] } }); + const kernel = gpu.createKernelMap( + { + mappedValue1: calcValue1, + mappedValue2: calcValue2, + }, + function (value1, value2) { + return calcValue1(value1[this.thread.x] + value2[this.thread.x]) + calcValue2(this.constants.v1[this.thread.x] + this.constants.v2[this.thread.x]); + }, + { output: [1], constants: { v1: [1], v2: [1] } } + ); kernel(texture1, texture2); const gl = kernel.context; @@ -156,4 +174,4 @@ test('createKernelMap with array constants & texture arguments auto', () => { }); (GPU.isHeadlessGLSupported ? test : skip)('createKernelMap with array constants & texture arguments headlessgl', () => { createKernelMapWithArrayConstantsAndTextureArguments('headlessgl'); -}); \ No newline at end of file +}); diff --git a/test/internal/underscores.js b/test/internal/underscores.js index 07c676c9..926136be 100644 --- a/test/internal/underscores.js +++ b/test/internal/underscores.js @@ -5,9 +5,12 @@ describe('internal: underscores'); function testNumberArgument(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(value_1) { - return value_1; - }, { output: [1], }); + const kernel = gpu.createKernel( + function (value_1) { + return value_1; + }, + { output: [1] } + ); assert.equal(kernel(1)[0], 1); gpu.destroy(); } @@ -33,9 +36,12 @@ test('number argument cpu', () => { function testArrayArgument(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(value_1) { - return value_1[this.thread.x]; - }, { output: [1], }); + const kernel = gpu.createKernel( + function (value_1) { + return value_1[this.thread.x]; + }, + { output: [1] } + ); assert.equal(kernel([1])[0], 1); gpu.destroy(); } @@ -61,10 +67,18 @@ test('array argument cpu', () => { function testTextureArgument(mode) { const gpu = new GPU({ mode }); - const texture = gpu.createKernel(function() { return 1; }, { output: [1], pipeline: true })(); - const kernel = gpu.createKernel(function(value_1) { - return value_1[this.thread.x]; - }, { output: [1], }); + const texture = gpu.createKernel( + function () { + return 1; + }, + { output: [1], pipeline: true } + )(); + const kernel = gpu.createKernel( + function (value_1) { + return value_1[this.thread.x]; + }, + { output: [1] } + ); assert.equal(kernel(texture)[0], 1); gpu.destroy(); } @@ -88,14 +102,21 @@ test('texture argument cpu', () => { testTextureArgument('cpu'); }); - function testArray2TextureArgument(mode) { const gpu = new GPU({ mode }); - const texture = gpu.createKernel(function() { return [1, 1]; }, { output: [1], pipeline: true })(); - const kernel = gpu.createKernel(function(value_1) { - debugger; - return value_1[this.thread.x]; - }, { output: [1], }); + const texture = gpu.createKernel( + function () { + return [1, 1]; + }, + { output: [1], pipeline: true } + )(); + const kernel = gpu.createKernel( + function (value_1) { + debugger; + return value_1[this.thread.x]; + }, + { output: [1] } + ); assert.deepEqual(kernel(texture)[0], new Float32Array([1, 1])); gpu.destroy(); } @@ -116,17 +137,19 @@ test('array2 texture argument gpu', () => { testArray2TextureArgument('headlessgl'); }); - function testNumberConstant(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function() { - return this.constants.value_1; - }, { - output: [1], - constants: { - value_1: 1 + const kernel = gpu.createKernel( + function () { + return this.constants.value_1; }, - }); + { + output: [1], + constants: { + value_1: 1, + }, + } + ); assert.equal(kernel()[0], 1); gpu.destroy(); } @@ -152,14 +175,17 @@ test('number constant cpu', () => { function testArrayConstant(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function() { - return this.constants.value_1[0]; - }, { - output: [1], - constants: { - value_1: [1] + const kernel = gpu.createKernel( + function () { + return this.constants.value_1[0]; }, - }); + { + output: [1], + constants: { + value_1: [1], + }, + } + ); assert.equal(kernel()[0], 1); gpu.destroy(); } @@ -183,18 +209,25 @@ test('array constant cpu', () => { testArrayConstant('cpu'); }); - function testTextureConstant(mode) { const gpu = new GPU({ mode }); - const texture = gpu.createKernel(function() { return 1; }, { output: [1], pipeline: true })(); - const kernel = gpu.createKernel(function() { - return this.constants.value_1[0]; - }, { - output: [1], - constants: { - value_1: texture + const texture = gpu.createKernel( + function () { + return 1; }, - }); + { output: [1], pipeline: true } + )(); + const kernel = gpu.createKernel( + function () { + return this.constants.value_1[0]; + }, + { + output: [1], + constants: { + value_1: texture, + }, + } + ); assert.equal(kernel()[0], 1); gpu.destroy(); } @@ -213,4 +246,4 @@ test('texture constant gpu', () => { }); (GPU.isHeadlessGLSupported ? test : skip)('texture constant headlessgl', () => { testTextureConstant('headlessgl'); -}); \ No newline at end of file +}); diff --git a/test/internal/utils.js b/test/internal/utils.js index 8d36b10f..24b8ade1 100644 --- a/test/internal/utils.js +++ b/test/internal/utils.js @@ -9,7 +9,7 @@ test('systemEndianness not null', () => { }); test('isFunction', () => { - assert.ok(utils.isFunction(function() {})); + assert.ok(utils.isFunction(function () {})); assert.notOk(utils.isFunction({})); }); @@ -47,47 +47,15 @@ test('getDimensions Array of 6, padded', () => { }); test('getDimensions Array of 6,1,1, padded', () => { - assert.deepEqual(Array.from(utils.getDimensions([ - [ - [1, 1, 1, 1, 1, 1] - ] - ], true)), [6, 1, 1]); + assert.deepEqual(Array.from(utils.getDimensions([[[1, 1, 1, 1, 1, 1]]], true)), [6, 1, 1]); }); test('getDimensions Array of 1,6,1, padded', () => { - assert.deepEqual(Array.from(utils.getDimensions([ - [ - [1], - [1], - [1], - [1], - [1], - [1] - ] - ], true)), [1, 6, 1]); + assert.deepEqual(Array.from(utils.getDimensions([[[1], [1], [1], [1], [1], [1]]], true)), [1, 6, 1]); }); test('getDimensions Array of 1,1,6, padded', () => { - assert.deepEqual(Array.from(utils.getDimensions([ - [ - [1] - ], - [ - [1] - ], - [ - [1] - ], - [ - [1] - ], - [ - [1] - ], - [ - [1] - ] - ], true)), [1, 1, 6]); + assert.deepEqual(Array.from(utils.getDimensions([[[1]], [[1]], [[1]], [[1]], [[1]], [[1]]], true)), [1, 1, 6]); }); test('getMemoryOptimizedFloatTextureSize [6,1,1], bitRatio 4', () => { @@ -162,98 +130,134 @@ test('getMemoryOptimizedPackedTextureSize [1,1,6], bitRatio 1', () => { }); test('getKernelTextureSize for [1,2] output, optimizeFloatMemory = true, and precision = "unsigned"', () => { - const textureSize = utils.getKernelTextureSize({ - optimizeFloatMemory: true, - precision: 'unsigned', - }, [1, 2]); + const textureSize = utils.getKernelTextureSize( + { + optimizeFloatMemory: true, + precision: 'unsigned', + }, + [1, 2] + ); assert.deepEqual(textureSize, new Int32Array([1, 2])); }); test('getKernelTextureSize for [2,3] output, optimizeFloatMemory = true, and precision = "unsigned"', () => { - const textureSize = utils.getKernelTextureSize({ - optimizeFloatMemory: true, - precision: 'unsigned', - }, [2, 3]); + const textureSize = utils.getKernelTextureSize( + { + optimizeFloatMemory: true, + precision: 'unsigned', + }, + [2, 3] + ); assert.deepEqual(textureSize, new Int32Array([2, 3])); }); test('getKernelTextureSize for [4,2] output, optimizeFloatMemory = true, and precision = "unsigned"', () => { - const textureSize = utils.getKernelTextureSize({ - optimizeFloatMemory: true, - precision: 'unsigned', - }, [4, 2]); + const textureSize = utils.getKernelTextureSize( + { + optimizeFloatMemory: true, + precision: 'unsigned', + }, + [4, 2] + ); assert.deepEqual(textureSize, new Int32Array([4, 2])); }); test('getKernelTextureSize for [6,1,1] output, optimizeFloatMemory = true, and precision = "unsigned"', () => { - const textureSize = utils.getKernelTextureSize({ - optimizeFloatMemory: true, - precision: 'unsigned', - }, [6, 1, 1]); + const textureSize = utils.getKernelTextureSize( + { + optimizeFloatMemory: true, + precision: 'unsigned', + }, + [6, 1, 1] + ); assert.deepEqual(textureSize, new Int32Array([2, 3])); }); test('getKernelTextureSize for [1,6,1] output, optimizeFloatMemory = true, and precision = "unsigned"', () => { - const textureSize = utils.getKernelTextureSize({ - optimizeFloatMemory: true, - precision: 'unsigned', - }, [1, 6, 1]); + const textureSize = utils.getKernelTextureSize( + { + optimizeFloatMemory: true, + precision: 'unsigned', + }, + [1, 6, 1] + ); assert.deepEqual(textureSize, new Int32Array([1, 6])); }); test('getKernelTextureSize for [1,1,6] output, optimizeFloatMemory = true, and precision = "unsigned"', () => { - const textureSize = utils.getKernelTextureSize({ - optimizeFloatMemory: true, - precision: 'unsigned', - }, [1, 1, 6]); + const textureSize = utils.getKernelTextureSize( + { + optimizeFloatMemory: true, + precision: 'unsigned', + }, + [1, 1, 6] + ); assert.deepEqual(textureSize, new Int32Array([2, 3])); }); test('getKernelTextureSize for [1,2] output, optimizeFloatMemory = true, and precision = "single"', () => { - const textureSize = utils.getKernelTextureSize({ - optimizeFloatMemory: true, - precision: 'single', - }, [1, 2]); + const textureSize = utils.getKernelTextureSize( + { + optimizeFloatMemory: true, + precision: 'single', + }, + [1, 2] + ); assert.deepEqual(textureSize, new Int32Array([1, 1])); }); test('getKernelTextureSize for [2,3] output, optimizeFloatMemory = true, and precision = "single"', () => { - const textureSize = utils.getKernelTextureSize({ - optimizeFloatMemory: true, - precision: 'single', - }, [2, 3]); + const textureSize = utils.getKernelTextureSize( + { + optimizeFloatMemory: true, + precision: 'single', + }, + [2, 3] + ); assert.deepEqual(textureSize, new Int32Array([1, 2])); }); test('getKernelTextureSize for [4,2] output, optimizeFloatMemory = true, and precision = "single"', () => { - const textureSize = utils.getKernelTextureSize({ - optimizeFloatMemory: true, - precision: 'single', - }, [4, 2]); + const textureSize = utils.getKernelTextureSize( + { + optimizeFloatMemory: true, + precision: 'single', + }, + [4, 2] + ); assert.deepEqual(textureSize, new Int32Array([1, 2])); }); test('getKernelTextureSize for [6,1,1] output, optimizeFloatMemory = true, and precision = "single"', () => { - const textureSize = utils.getKernelTextureSize({ - optimizeFloatMemory: true, - precision: 'single', - }, [6, 1, 1]); + const textureSize = utils.getKernelTextureSize( + { + optimizeFloatMemory: true, + precision: 'single', + }, + [6, 1, 1] + ); assert.deepEqual(textureSize, new Int32Array([1, 2])); }); test('getKernelTextureSize for [1,6,1] output, optimizeFloatMemory = true, and precision = "single"', () => { - const textureSize = utils.getKernelTextureSize({ - optimizeFloatMemory: true, - precision: 'single', - }, [1, 6, 1]); + const textureSize = utils.getKernelTextureSize( + { + optimizeFloatMemory: true, + precision: 'single', + }, + [1, 6, 1] + ); assert.deepEqual(textureSize, new Int32Array([1, 2])); }); test('getKernelTextureSize for [1,1,6] output, optimizeFloatMemory = true, and precision = "single"', () => { - const textureSize = utils.getKernelTextureSize({ - optimizeFloatMemory: true, - precision: 'single', - }, [1, 1, 6]); + const textureSize = utils.getKernelTextureSize( + { + optimizeFloatMemory: true, + precision: 'single', + }, + [1, 1, 6] + ); assert.deepEqual(textureSize, new Int32Array([1, 2])); }); @@ -265,24 +269,14 @@ test('erectPackedFloat', () => { test('erect2DPackedFloat', () => { const array = new Float32Array([0, 1, 2, 3, 4, 5, 6, 7, 8, 0, 0, 0, 0]); const result = utils.erect2DPackedFloat(array, 3, 3); - assert.deepEqual(result, [ - new Float32Array([0, 1, 2]), - new Float32Array([3, 4, 5]), - new Float32Array([6, 7, 8]) - ]); + assert.deepEqual(result, [new Float32Array([0, 1, 2]), new Float32Array([3, 4, 5]), new Float32Array([6, 7, 8])]); }); test('erect3DPackedFloat', () => { const array = new Float32Array([0, 1, 2, 3, 4, 5, 6, 7, 0, 0, 0, 0, 0]); const result = utils.erect3DPackedFloat(array, 2, 2, 2); assert.deepEqual(result, [ - [ - new Float32Array([0, 1]), - new Float32Array([2, 3]), - ], - [ - new Float32Array([4, 5]), - new Float32Array([6, 7]), - ] + [new Float32Array([0, 1]), new Float32Array([2, 3])], + [new Float32Array([4, 5]), new Float32Array([6, 7])], ]); }); test('erectMemoryOptimizedFloat', () => { @@ -293,316 +287,126 @@ test('erectMemoryOptimizedFloat', () => { test('erectMemoryOptimized2DFloat', () => { const array = new Float32Array([0, 1, 2, 3, 4, 5, 6, 7, 8, 0, 0, 0, 0]); const result = utils.erectMemoryOptimized2DFloat(array, 3, 3); - assert.deepEqual(result, [ - new Float32Array([0, 1, 2]), - new Float32Array([3, 4, 5]), - new Float32Array([6, 7, 8]) - ]); + assert.deepEqual(result, [new Float32Array([0, 1, 2]), new Float32Array([3, 4, 5]), new Float32Array([6, 7, 8])]); }); test('erectMemoryOptimized3DFloat', () => { const array = new Float32Array([0, 1, 2, 3, 4, 5, 6, 7, 0, 0, 0, 0, 0]); const result = utils.erectMemoryOptimized3DFloat(array, 2, 2, 2); assert.deepEqual(result, [ - [ - new Float32Array([0, 1]), - new Float32Array([2, 3]), - ], - [ - new Float32Array([4, 5]), - new Float32Array([6, 7]), - ] + [new Float32Array([0, 1]), new Float32Array([2, 3])], + [new Float32Array([4, 5]), new Float32Array([6, 7])], ]); }); test('erectFloat', () => { - const array = new Float32Array([ - 0, 0, 0, 0, - 1, 0, 0, 0, - 2, 0, 0, 0, - 3, 0, 0, 0, - 4, 0, 0, 0, - 5, 0, 0, 0 - ]); + const array = new Float32Array([0, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 4, 0, 0, 0, 5, 0, 0, 0]); const result = utils.erectFloat(array, 6); assert.deepEqual(result, new Float32Array([0, 1, 2, 3, 4, 5])); }); test('erect2DFloat', () => { - const array = new Float32Array([ - 0, 0, 0, 0, - 1, 0, 0, 0, - 2, 0, 0, 0, - 3, 0, 0, 0, - 4, 0, 0, 0, - 5, 0, 0, 0, - 6, 0, 0, 0, - 7, 0, 0, 0, - 8, 0, 0, 0, - 0, 0, 0, 0 - ]); + const array = new Float32Array([0, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 4, 0, 0, 0, 5, 0, 0, 0, 6, 0, 0, 0, 7, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0]); const result = utils.erect2DFloat(array, 3, 3); - assert.deepEqual(result, [ - new Float32Array([0, 1, 2]), - new Float32Array([3, 4, 5]), - new Float32Array([6, 7, 8]) - ]); + assert.deepEqual(result, [new Float32Array([0, 1, 2]), new Float32Array([3, 4, 5]), new Float32Array([6, 7, 8])]); }); test('erect3DFloat', () => { - const array = new Float32Array([ - 0, 0, 0, 0, - 1, 0, 0, 0, - 2, 0, 0, 0, - 3, 0, 0, 0, - 4, 0, 0, 0, - 5, 0, 0, 0, - 6, 0, 0, 0, - 7, 0, 0, 0, - 0, 0, 0, 0 - ]); + const array = new Float32Array([0, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 4, 0, 0, 0, 5, 0, 0, 0, 6, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0]); const result = utils.erect3DFloat(array, 2, 2, 2); assert.deepEqual(result, [ - [ - new Float32Array([0, 1]), - new Float32Array([2, 3]), - ], - [ - new Float32Array([4, 5]), - new Float32Array([6, 7]), - ] + [new Float32Array([0, 1]), new Float32Array([2, 3])], + [new Float32Array([4, 5]), new Float32Array([6, 7])], ]); }); test('erectArray2', () => { - const array = new Float32Array([ - 0, 1, 0, 0, - 2, 3, 0, 0, - 4, 5, 0, 0, - 6, 7, 0, 0 - ]); + const array = new Float32Array([0, 1, 0, 0, 2, 3, 0, 0, 4, 5, 0, 0, 6, 7, 0, 0]); const result = utils.erectArray2(array, 4); - assert.deepEqual(result, [ - new Float32Array([0, 1]), - new Float32Array([2, 3]), - new Float32Array([4, 5]), - new Float32Array([6, 7]), - ]); + assert.deepEqual(result, [new Float32Array([0, 1]), new Float32Array([2, 3]), new Float32Array([4, 5]), new Float32Array([6, 7])]); }); test('erect2DArray2', () => { - const array = new Float32Array([ - 0, 1, 0, 0, - 2, 3, 0, 0, - 4, 5, 0, 0, - 6, 7, 0, 0 - ]); + const array = new Float32Array([0, 1, 0, 0, 2, 3, 0, 0, 4, 5, 0, 0, 6, 7, 0, 0]); const result = utils.erect2DArray2(array, 2, 2); assert.deepEqual(result, [ - [ - new Float32Array([0, 1]), - new Float32Array([2, 3]), - ], - [ - new Float32Array([4, 5]), - new Float32Array([6, 7]), - ] + [new Float32Array([0, 1]), new Float32Array([2, 3])], + [new Float32Array([4, 5]), new Float32Array([6, 7])], ]); }); test('erect3DArray2', () => { - const array = new Float32Array([ - 0, 1, 0, 0, - 2, 3, 0, 0, - 4, 5, 0, 0, - 6, 7, 0, 0, - 8, 9, 0, 0, - 10, 11, 0, 0, - 12, 13, 0, 0, - 14, 15, 0, 0, - ]); + const array = new Float32Array([0, 1, 0, 0, 2, 3, 0, 0, 4, 5, 0, 0, 6, 7, 0, 0, 8, 9, 0, 0, 10, 11, 0, 0, 12, 13, 0, 0, 14, 15, 0, 0]); const result = utils.erect3DArray2(array, 2, 2, 2); assert.deepEqual(result, [ [ - [ - new Float32Array([0, 1]), - new Float32Array([2, 3]), - ], - [ - new Float32Array([4, 5]), - new Float32Array([6, 7]), - ] + [new Float32Array([0, 1]), new Float32Array([2, 3])], + [new Float32Array([4, 5]), new Float32Array([6, 7])], ], [ - [ - new Float32Array([8, 9]), - new Float32Array([10, 11]), - ], - [ - new Float32Array([12, 13]), - new Float32Array([14, 15]), - ] - ] + [new Float32Array([8, 9]), new Float32Array([10, 11])], + [new Float32Array([12, 13]), new Float32Array([14, 15])], + ], ]); }); test('erectArray3', () => { - const array = new Float32Array([ - 0, 1, 2, 0, - 3, 4, 5, 0, - 6, 7, 8, 0, - 9, 10, 11, 0 - ]); + const array = new Float32Array([0, 1, 2, 0, 3, 4, 5, 0, 6, 7, 8, 0, 9, 10, 11, 0]); const result = utils.erectArray3(array, 4); - assert.deepEqual(result, [ - new Float32Array([0, 1, 2]), - new Float32Array([3, 4, 5]), - new Float32Array([6, 7, 8]), - new Float32Array([9, 10, 11]), - ]); + assert.deepEqual(result, [new Float32Array([0, 1, 2]), new Float32Array([3, 4, 5]), new Float32Array([6, 7, 8]), new Float32Array([9, 10, 11])]); }); test('erect2DArray3', () => { - const array = new Float32Array([ - 0, 1, 2, 0, - 3, 4, 5, 0, - 6, 7, 8, 0, - 9, 10, 11, 0, - ]); + const array = new Float32Array([0, 1, 2, 0, 3, 4, 5, 0, 6, 7, 8, 0, 9, 10, 11, 0]); const result = utils.erect2DArray3(array, 2, 2); assert.deepEqual(result, [ - [ - new Float32Array([0, 1, 2]), - new Float32Array([3, 4, 5]), - ], - [ - new Float32Array([6, 7, 8]), - new Float32Array([9, 10, 11]), - ] + [new Float32Array([0, 1, 2]), new Float32Array([3, 4, 5])], + [new Float32Array([6, 7, 8]), new Float32Array([9, 10, 11])], ]); }); test('erect3DArray3', () => { - const array = new Float32Array([ - 0, 1, 2, 0, - 3, 4, 5, 0, - 6, 7, 8, 0, - 9, 10, 11, 0, - 12, 13, 14, 0, - 15, 16, 17, 0, - 18, 19, 20, 0, - 21, 22, 23, 0, - ]); + const array = new Float32Array([0, 1, 2, 0, 3, 4, 5, 0, 6, 7, 8, 0, 9, 10, 11, 0, 12, 13, 14, 0, 15, 16, 17, 0, 18, 19, 20, 0, 21, 22, 23, 0]); const result = utils.erect3DArray3(array, 2, 2, 2); assert.deepEqual(result, [ [ - [ - new Float32Array([0, 1, 2]), - new Float32Array([3, 4, 5]), - ], - [ - new Float32Array([6, 7, 8]), - new Float32Array([9, 10, 11]), - ] + [new Float32Array([0, 1, 2]), new Float32Array([3, 4, 5])], + [new Float32Array([6, 7, 8]), new Float32Array([9, 10, 11])], ], [ - [ - new Float32Array([12, 13, 14]), - new Float32Array([15, 16, 17]), - ], - [ - new Float32Array([18, 19, 20]), - new Float32Array([21, 22, 23]), - ] - ] + [new Float32Array([12, 13, 14]), new Float32Array([15, 16, 17])], + [new Float32Array([18, 19, 20]), new Float32Array([21, 22, 23])], + ], ]); }); test('erectArray4', () => { - const array = new Float32Array([ - 0, 1, 2, 3, - 4, 5, 6, 7, - 8, 9, 10, 11, - 12, 13, 14, 15, - ]); + const array = new Float32Array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]); const result = utils.erectArray4(array, 4); - assert.deepEqual(result, [ - new Float32Array([0, 1, 2, 3]), - new Float32Array([4, 5, 6, 7]), - new Float32Array([8, 9, 10, 11]), - new Float32Array([12, 13, 14, 15]), - ]); - + assert.deepEqual(result, [new Float32Array([0, 1, 2, 3]), new Float32Array([4, 5, 6, 7]), new Float32Array([8, 9, 10, 11]), new Float32Array([12, 13, 14, 15])]); }); test('erect2DArray4', () => { - const array = new Float32Array([ - 0, 1, 2, 3, - 4, 5, 6, 7, - 8, 9, 10, 11, - 12, 13, 14, 15, - ]); + const array = new Float32Array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]); const result = utils.erect2DArray4(array, 2, 2); assert.deepEqual(result, [ - [ - new Float32Array([0, 1, 2, 3]), - new Float32Array([4, 5, 6, 7]), - ], - [ - new Float32Array([8, 9, 10, 11]), - new Float32Array([12, 13, 14, 15]), - ] + [new Float32Array([0, 1, 2, 3]), new Float32Array([4, 5, 6, 7])], + [new Float32Array([8, 9, 10, 11]), new Float32Array([12, 13, 14, 15])], ]); }); test('erect3DArray4', () => { - const array = new Float32Array([ - 0, 1, 2, 3, - 4, 5, 6, 7, - 8, 9, 10, 11, - 12, 13, 14, 15, - 16, 17, 18, 19, - 20, 21, 22, 23, - 24, 25, 26, 27, - 28, 29, 30, 31, - ]); + const array = new Float32Array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31]); const result = utils.erect3DArray4(array, 2, 2, 2); assert.deepEqual(result, [ [ - [ - new Float32Array([0, 1, 2, 3]), - new Float32Array([4, 5, 6, 7]), - ], - [ - new Float32Array([8, 9, 10, 11]), - new Float32Array([12, 13, 14, 15]), - ] + [new Float32Array([0, 1, 2, 3]), new Float32Array([4, 5, 6, 7])], + [new Float32Array([8, 9, 10, 11]), new Float32Array([12, 13, 14, 15])], ], [ - [ - new Float32Array([16, 17, 18, 19]), - new Float32Array([20, 21, 22, 23]), - ], - [ - new Float32Array([24, 25, 26, 27]), - new Float32Array([28, 29, 30, 31]), - ] - ] + [new Float32Array([16, 17, 18, 19]), new Float32Array([20, 21, 22, 23])], + [new Float32Array([24, 25, 26, 27]), new Float32Array([28, 29, 30, 31])], + ], ]); }); test('flattenFunctionToString', () => { // since we use this internally, currently just testing if parsing simply works - [ - utils.erectPackedFloat, - utils.erect2DPackedFloat, - utils.erect3DPackedFloat, - utils.erectMemoryOptimizedFloat, - utils.erectMemoryOptimized2DFloat, - utils.erectMemoryOptimized3DFloat, - utils.erectFloat, - utils.erect2DFloat, - utils.erect3DFloat, - utils.erectArray2, - utils.erect2DArray2, - utils.erect3DArray2, - utils.erectArray3, - utils.erect2DArray3, - utils.erect3DArray3, - utils.erectArray4, - utils.erect2DArray4, - utils.erect3DArray4 - ].forEach(fn => eval(utils.flattenFunctionToString(fn, { - findDependency: () => {}, - thisLookup: () => {}, - }))); + [utils.erectPackedFloat, utils.erect2DPackedFloat, utils.erect3DPackedFloat, utils.erectMemoryOptimizedFloat, utils.erectMemoryOptimized2DFloat, utils.erectMemoryOptimized3DFloat, utils.erectFloat, utils.erect2DFloat, utils.erect3DFloat, utils.erectArray2, utils.erect2DArray2, utils.erect3DArray2, utils.erectArray3, utils.erect2DArray3, utils.erect3DArray3, utils.erectArray4, utils.erect2DArray4, utils.erect3DArray4].forEach(fn => + eval( + utils.flattenFunctionToString(fn, { + findDependency: () => {}, + thisLookup: () => {}, + }) + ) + ); assert.ok(true); }); @@ -614,7 +418,7 @@ test('improper getMinifySafeName usage with arrow function', () => { test('improper getMinifySafeName usage with regular function', () => { assert.throws(() => { - utils.getMinifySafeName(function() {}); + utils.getMinifySafeName(function () {}); }, 'Unrecognized function type.'); }); @@ -626,8 +430,8 @@ test('proper getMinifySafeName usage with arrow function', () => { test('proper getMinifySafeName usage with regular function', () => { function n() {} - const safeName = utils.getMinifySafeName(function() { + const safeName = utils.getMinifySafeName(function () { return n; }); assert.equal(safeName, 'n'); -}); \ No newline at end of file +}); diff --git a/test/issues/114-create-kernel-map-run-second-time.js b/test/issues/114-create-kernel-map-run-second-time.js index 265d3ed8..25c35fa0 100644 --- a/test/issues/114-create-kernel-map-run-second-time.js +++ b/test/issues/114-create-kernel-map-run-second-time.js @@ -11,7 +11,8 @@ function secondKernelMap(mode) { function add(a, b) { return a + b; } - const kernels = gpu.createKernelMap([add], function(a, b) { + const kernels = gpu + .createKernelMap([add], function (a, b) { return add(a[this.thread.x], b[this.thread.x]); }) .setOutput([5]); @@ -25,18 +26,18 @@ function secondKernelMap(mode) { assert.deepEqual(Array.from(G), [2, 4, 6, 8, 10]); gpu.destroy(); } -(GPU.isKernelMapSupported ? test : skip)("Issue #114 - run createKernelMap the second time auto", () => { +(GPU.isKernelMapSupported ? test : skip)('Issue #114 - run createKernelMap the second time auto', () => { secondKernelMap(); }); -(GPU.isKernelMapSupported ? test : skip)("Issue #114 - run createKernelMap the second time gpu", () => { +(GPU.isKernelMapSupported ? test : skip)('Issue #114 - run createKernelMap the second time gpu', () => { secondKernelMap('gpu'); }); -(GPU.isWebGLSupported ? test : skip)("Issue #114 - run createKernelMap the second time webgl", () => { +(GPU.isWebGLSupported ? test : skip)('Issue #114 - run createKernelMap the second time webgl', () => { secondKernelMap('webgl'); }); -(GPU.isWebGL2Supported ? test : skip)("Issue #114 - run createKernelMap the second time webgl2", () => { +(GPU.isWebGL2Supported ? test : skip)('Issue #114 - run createKernelMap the second time webgl2', () => { secondKernelMap('webgl2'); }); -(GPU.isHeadlessGLSupported && GPU.isKernelMapSupported ? test : skip)("Issue #114 - run createKernelMap the second time headlessgl", () => { +(GPU.isHeadlessGLSupported && GPU.isKernelMapSupported ? test : skip)('Issue #114 - run createKernelMap the second time headlessgl', () => { secondKernelMap('headlessgl'); -}); \ No newline at end of file +}); diff --git a/test/issues/116-multiple-kernels-run-again.js b/test/issues/116-multiple-kernels-run-again.js index 8221b8fe..a1514c29 100644 --- a/test/issues/116-multiple-kernels-run-again.js +++ b/test/issues/116-multiple-kernels-run-again.js @@ -17,7 +17,8 @@ function multipleKernels(mode) { const layerForward = []; for (let i = 0; i < 2; i++) { - const kernels = gpu.createKernelMap([add], function(a, b) { + const kernels = gpu + .createKernelMap([add], function (a, b) { return add(a, b, this.thread.x); }) .setOutput([sizes[i + 1]]); // First: 5. Second: 1. @@ -35,26 +36,26 @@ function multipleKernels(mode) { gpu.destroy(); } -(GPU.isKernelMapSupported ? test : skip)("Issue #116 - multiple kernels run again auto", () => { +(GPU.isKernelMapSupported ? test : skip)('Issue #116 - multiple kernels run again auto', () => { multipleKernels(); }); -(GPU.isKernelMapSupported ? test : skip)("Issue #116 - multiple kernels run again gpu", () => { +(GPU.isKernelMapSupported ? test : skip)('Issue #116 - multiple kernels run again gpu', () => { multipleKernels('gpu'); }); -(GPU.isWebGLSupported ? test : skip)("Issue #116 - multiple kernels run again webgl", () => { +(GPU.isWebGLSupported ? test : skip)('Issue #116 - multiple kernels run again webgl', () => { multipleKernels('webgl'); }); -(GPU.isWebGL2Supported ? test : skip)("Issue #116 - multiple kernels run again webgl2", () => { +(GPU.isWebGL2Supported ? test : skip)('Issue #116 - multiple kernels run again webgl2', () => { multipleKernels('webgl2'); }); -(GPU.isHeadlessGLSupported && GPU.isKernelMapSupported ? test : skip)("Issue #116 - multiple kernels run again headlessgl", () => { +(GPU.isHeadlessGLSupported && GPU.isKernelMapSupported ? test : skip)('Issue #116 - multiple kernels run again headlessgl', () => { multipleKernels('headlessgl'); }); -test("Issue #116 - multiple kernels run again cpu", () => { +test('Issue #116 - multiple kernels run again cpu', () => { multipleKernels('cpu'); -}); \ No newline at end of file +}); diff --git a/test/issues/130-typed-array.js b/test/issues/130-typed-array.js index f332ff58..e1ba78dd 100644 --- a/test/issues/130-typed-array.js +++ b/test/issues/130-typed-array.js @@ -5,7 +5,8 @@ describe('issue #130'); function typedArrays(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(changes) { + const kernel = gpu + .createKernel(function (changes) { return changes[this.thread.y][this.thread.x]; }) .setOutput([2, 1]); @@ -19,26 +20,26 @@ function typedArrays(mode) { gpu.destroy(); } -test("Issue #130 - typed array auto", () => { +test('Issue #130 - typed array auto', () => { typedArrays(null); }); -test("Issue #130 - typed array gpu", () => { +test('Issue #130 - typed array gpu', () => { typedArrays('gpu'); }); -(GPU.isWebGLSupported ? test : skip)("Issue #130 - typed array webgl", () => { +(GPU.isWebGLSupported ? test : skip)('Issue #130 - typed array webgl', () => { typedArrays('webgl'); }); -(GPU.isWebGL2Supported ? test : skip)("Issue #130 - typed array webgl2", () => { +(GPU.isWebGL2Supported ? test : skip)('Issue #130 - typed array webgl2', () => { typedArrays('webgl2'); }); -(GPU.isHeadlessGLSupported ? test : skip)("Issue #130 - typed array headlessgl", () => { +(GPU.isHeadlessGLSupported ? test : skip)('Issue #130 - typed array headlessgl', () => { typedArrays('headlessgl'); }); -test("Issue #130 - typed array cpu", () => { +test('Issue #130 - typed array cpu', () => { typedArrays('cpu'); -}); \ No newline at end of file +}); diff --git a/test/issues/147-missing-constant.js b/test/issues/147-missing-constant.js index 409c1f35..4b075ae0 100644 --- a/test/issues/147-missing-constant.js +++ b/test/issues/147-missing-constant.js @@ -10,7 +10,8 @@ function missingConstant(mode) { return this.constants.pi; } gpu.addFunction(getPi); - const kernel = gpu.createKernel(function() { + const kernel = gpu + .createKernel(function () { return getPi(); }) .setOutput([1]) @@ -21,26 +22,26 @@ function missingConstant(mode) { gpu.destroy(); } -test("Issue #147 - missing constant auto", () => { +test('Issue #147 - missing constant auto', () => { missingConstant(null); }); -test("Issue #147 - missing constant gpu", () => { +test('Issue #147 - missing constant gpu', () => { missingConstant('gpu'); }); -(GPU.isWebGLSupported ? test : skip)("Issue #147 - missing constant webgl", () => { +(GPU.isWebGLSupported ? test : skip)('Issue #147 - missing constant webgl', () => { missingConstant('webgl'); }); -(GPU.isWebGL2Supported ? test : skip)("Issue #147 - missing constant webgl2", () => { +(GPU.isWebGL2Supported ? test : skip)('Issue #147 - missing constant webgl2', () => { missingConstant('webgl2'); }); -(GPU.isHeadlessGLSupported ? test : skip)("Issue #147 - missing constant headlessgl", () => { +(GPU.isHeadlessGLSupported ? test : skip)('Issue #147 - missing constant headlessgl', () => { missingConstant('headlessgl'); }); -test("Issue #147 - missing constant cpu", () => { +test('Issue #147 - missing constant cpu', () => { missingConstant('cpu'); -}); \ No newline at end of file +}); diff --git a/test/issues/152-for-vars.js b/test/issues/152-for-vars.js index 2ac0f6af..fdddd3d7 100644 --- a/test/issues/152-for-vars.js +++ b/test/issues/152-for-vars.js @@ -6,7 +6,8 @@ describe('issue #152'); function forVars(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function() { + const kernel = gpu + .createKernel(function () { let sum = 0; for (let i = 0; i < 2; i++) { sum += i; @@ -43,4 +44,4 @@ test('Issue #152 - for vars gpu', () => { (GPU.isHeadlessGLSupported ? test : skip)('Issue #152 - for vars headlessgl', () => { forVars('headlessgl'); -}); \ No newline at end of file +}); diff --git a/test/issues/159-3d.js b/test/issues/159-3d.js index 5296799e..9391f543 100644 --- a/test/issues/159-3d.js +++ b/test/issues/159-3d.js @@ -2,19 +2,23 @@ const { assert, skip, test, module: describe } = require('qunit'); describe('issue # 159'); -(function() { +(function () { const { GPU } = require('../../src'); function threeD(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(grid) { + const kernel = gpu + .createKernel(function (grid) { return grid[this.thread.y][this.thread.x]; }) .setOutput([5, 5]); //This would cause the above to fail - gpu.createKernel(function() { return 0; }) + gpu + .createKernel(function () { + return 0; + }) .setOutput([5, 5, 5]) .build(); @@ -23,16 +27,21 @@ describe('issue # 159'); [1, 2, 3, 4, 5], [2, 3, 4, 5, 6], [3, 4, 5, 6, 7], - [4, 5, 6, 7, 8] + [4, 5, 6, 7, 8], ]); assert.equal(result.length, 5); - assert.deepEqual(result.map(function(v) { return Array.from(v); }), [ - [0, 1, 2, 3, 4], - [1, 2, 3, 4, 5], - [2, 3, 4, 5, 6], - [3, 4, 5, 6, 7], - [4, 5, 6, 7, 8] - ]); + assert.deepEqual( + result.map(function (v) { + return Array.from(v); + }), + [ + [0, 1, 2, 3, 4], + [1, 2, 3, 4, 5], + [2, 3, 4, 5, 6], + [3, 4, 5, 6, 7], + [4, 5, 6, 7, 8], + ] + ); gpu.destroy(); } @@ -59,4 +68,4 @@ describe('issue # 159'); test('Issue #159 - for vars cpu', () => { threeD('cpu'); }); -})(); \ No newline at end of file +})(); diff --git a/test/issues/174-webgl-context-warning.js b/test/issues/174-webgl-context-warning.js index c4598dc9..c037e032 100644 --- a/test/issues/174-webgl-context-warning.js +++ b/test/issues/174-webgl-context-warning.js @@ -6,7 +6,7 @@ describe('issue # 174'); const input = [ [0, 1, 2], [3, 4, 5], - [6, 7, 8] + [6, 7, 8], ]; // recursive! @@ -16,23 +16,29 @@ function manyKernels(mode, kernelCount, t) { kernelCount--; const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(inp) { - return inp[this.thread.y][this.thread.x]; - }, { - output: [3, 3] - }); - const kernel2 = gpu.createKernel(function() { - return this.thread.y * this.thread.x; - }, { - output: [1024, 1024], - pipeline: true - }); + const kernel = gpu.createKernel( + function (inp) { + return inp[this.thread.y][this.thread.x]; + }, + { + output: [3, 3], + } + ); + const kernel2 = gpu.createKernel( + function () { + return this.thread.y * this.thread.x; + }, + { + output: [1024, 1024], + pipeline: true, + } + ); kernel(input); kernel2(); - assert.strictEqual(kernel.context, kernel2.context, "contexts should be the same object"); + assert.strictEqual(kernel.context, kernel2.context, 'contexts should be the same object'); manyKernels(mode, kernelCount, t); const canvas = kernel.canvas; - const eventListener = canvas.addEventListener('webglcontextlost', (e) => { + const eventListener = canvas.addEventListener('webglcontextlost', e => { canvas.removeEventListener('webglcontextlost', eventListener); done(); }); @@ -46,4 +52,4 @@ function manyKernels(mode, kernelCount, t) { (GPU.isWebGL2Supported ? test : skip)('Issue #174 - webgl context leak webgl2', t => { manyKernels('webgl2', 10, t); -}); \ No newline at end of file +}); diff --git a/test/issues/195-read-from-texture2d.js b/test/issues/195-read-from-texture2d.js index 4908bdd6..c38edf94 100644 --- a/test/issues/195-read-from-texture2d.js +++ b/test/issues/195-read-from-texture2d.js @@ -4,7 +4,8 @@ const { GPU } = require('../../src'); describe('issue #195'); function makeKernel(gpu) { - return gpu.createKernel(function(a) { + return gpu + .createKernel(function (a) { return a[this.thread.y][this.thread.x]; }) .setOutput([matrixSize, matrixSize]); @@ -19,39 +20,47 @@ function splitArray(array, part) { } const matrixSize = 4; -const A = splitArray(Array.apply(null, Array(matrixSize * matrixSize)).map((_, i) => i), matrixSize); +const A = splitArray( + Array.apply(null, Array(matrixSize * matrixSize)).map((_, i) => i), + matrixSize +); function readFromTexture(mode) { const gpu = new GPU({ mode }); const noTexture = makeKernel(gpu); - const texture = makeKernel(gpu) - .setPipeline(true); + const texture = makeKernel(gpu).setPipeline(true); const result = noTexture(A); const textureResult = texture(A).toArray(gpu); - assert.deepEqual(result.map((v) => Array.from(v)), A); - assert.deepEqual(textureResult.map((v) => Array.from(v)), A); + assert.deepEqual( + result.map(v => Array.from(v)), + A + ); + assert.deepEqual( + textureResult.map(v => Array.from(v)), + A + ); assert.deepEqual(textureResult, result); gpu.destroy(); } -test("Issue #195 Read from Texture 2D (GPU only) auto", () => { +test('Issue #195 Read from Texture 2D (GPU only) auto', () => { readFromTexture(); }); -test("Issue #195 Read from Texture 2D (GPU only) gpu", () => { +test('Issue #195 Read from Texture 2D (GPU only) gpu', () => { readFromTexture('gpu'); }); -(GPU.isWebGLSupported ? test : skip)("Issue #195 Read from Texture 2D (GPU only) webgl", () => { +(GPU.isWebGLSupported ? test : skip)('Issue #195 Read from Texture 2D (GPU only) webgl', () => { readFromTexture('webgl'); }); -(GPU.isWebGL2Supported ? test : skip)("Issue #195 Read from Texture 2D (GPU Only) webgl2", () => { +(GPU.isWebGL2Supported ? test : skip)('Issue #195 Read from Texture 2D (GPU Only) webgl2', () => { readFromTexture('webgl2'); }); -(GPU.isHeadlessGLSupported ? test : skip)("Issue #195 Read from Texture 2D (GPU Only) headlessgl", () => { +(GPU.isHeadlessGLSupported ? test : skip)('Issue #195 Read from Texture 2D (GPU Only) headlessgl', () => { readFromTexture('headlessgl'); -}); \ No newline at end of file +}); diff --git a/test/issues/207-same-function-reuse.js b/test/issues/207-same-function-reuse.js index 9706aa1f..f70398b3 100644 --- a/test/issues/207-same-function-reuse.js +++ b/test/issues/207-same-function-reuse.js @@ -6,7 +6,8 @@ describe('issue #207'); function sameFunctionReuse(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(kernelArg1, kernelArg2) { + const kernel = gpu + .createKernel(function (kernelArg1, kernelArg2) { function someFun1(someFun1Arg1, someFun1Arg2) { return customAdder(someFun1Arg1, someFun1Arg2); } @@ -51,4 +52,4 @@ test('Issue #207 - same function reuse gpu', () => { test('Issue #207 - same function reuse cpu', () => { sameFunctionReuse('cpu'); -}); \ No newline at end of file +}); diff --git a/test/issues/212-funky-function-support.js b/test/issues/212-funky-function-support.js index 54d94acf..7ab9f304 100644 --- a/test/issues/212-funky-function-support.js +++ b/test/issues/212-funky-function-support.js @@ -8,22 +8,31 @@ function funky(mode) { gpu.addFunction(function add(value1, value2) { return value1 + value2; }); - const kernel = gpu.createKernel(`function(v1, v2) { + const kernel = gpu + .createKernel( + `function(v1, v2) { return (0, _add.add)(v1[this.thread.y][this.thread.x], v2[this.thread.y][this.thread.x]); - }`) + }` + ) .setOutput([2, 2]); - const result = kernel([ - [0, 1], - [1, 2] - ], [ - [0, 1], - [1, 2] - ]); - assert.deepEqual(result.map((v) => Array.from(v)), [ - [0, 2], - [2, 4] - ]); + const result = kernel( + [ + [0, 1], + [1, 2], + ], + [ + [0, 1], + [1, 2], + ] + ); + assert.deepEqual( + result.map(v => Array.from(v)), + [ + [0, 2], + [2, 4], + ] + ); gpu.destroy(); } @@ -49,4 +58,4 @@ test('Issue #212 - funky function support gpu', () => { test('Issue #212 - funky function support cpu', () => { funky('cpu'); -}); \ No newline at end of file +}); diff --git a/test/issues/233-kernel-map-single-precision.js b/test/issues/233-kernel-map-single-precision.js index 29eb225b..6d3fa5a2 100644 --- a/test/issues/233-kernel-map-single-precision.js +++ b/test/issues/233-kernel-map-single-precision.js @@ -8,38 +8,51 @@ describe('issue # 233'); function kernelMapSinglePrecision(mode) { const lst = [1, 2, 3, 4, 5, 6, 7]; const gpu = new GPU({ mode }); - const kernels = gpu.createKernelMap({ - stepA: function(x) { - return x * x; + const kernels = gpu.createKernelMap( + { + stepA: function (x) { + return x * x; + }, + stepB: function (x) { + return x + 1; + }, }, - stepB: function(x) { - return x + 1; - } - }, function(lst) { - const val = lst[this.thread.x]; + function (lst) { + const val = lst[this.thread.x]; - stepA(val); - stepB(val); + stepA(val); + stepB(val); - return val; - }, { - precision: 'single', - output: [lst.length] - }); + return val; + }, + { + precision: 'single', + output: [lst.length], + } + ); const result = kernels(lst); - const unwrap = gpu.createKernel(function(x) { - return x[this.thread.x]; - }, { - output: [lst.length], - precision: 'single', - optimizeFloatMemory: true, - }); + const unwrap = gpu.createKernel( + function (x) { + return x[this.thread.x]; + }, + { + output: [lst.length], + precision: 'single', + optimizeFloatMemory: true, + } + ); const stepAResult = unwrap(result.stepA); const stepBResult = unwrap(result.stepB); - assert.deepEqual(Array.from(stepAResult), lst.map((x) => x * x)); - assert.deepEqual(Array.from(stepBResult), lst.map((x) => x + 1)); + assert.deepEqual( + Array.from(stepAResult), + lst.map(x => x * x) + ); + assert.deepEqual( + Array.from(stepBResult), + lst.map(x => x + 1) + ); assert.deepEqual(Array.from(result.result), lst); gpu.destroy(); } @@ -68,12 +81,11 @@ test('Issue #233 - kernel map with single precision cpu', () => { kernelMapSinglePrecision('cpu'); }); - function kernelMapSinglePrecision2D(mode) { const lst = [ [1, 2, 3], [4, 5, 6], - [7, 8, 9] + [7, 8, 9], ]; const stepAExpected = [ [1, 4, 9], @@ -83,46 +95,71 @@ function kernelMapSinglePrecision2D(mode) { const stepBExpected = [ [2, 3, 4], [5, 6, 7], - [8, 9, 10] + [8, 9, 10], ]; const gpu = new GPU({ mode }); - const kernels = gpu.createKernelMap({ - stepA: function(x) { - return x * x; + const kernels = gpu.createKernelMap( + { + stepA: function (x) { + return x * x; + }, + stepB: function (x) { + return x + 1; + }, }, - stepB: function(x) { - return x + 1; - } - }, function(lst) { - const val = lst[this.thread.y][this.thread.x]; + function (lst) { + const val = lst[this.thread.y][this.thread.x]; - stepA(val); - stepB(val); + stepA(val); + stepB(val); - return val; - }, { - precision: 'single', - output: [3, 3] - }); + return val; + }, + { + precision: 'single', + output: [3, 3], + } + ); const result = kernels(lst); - assert.deepEqual(result.stepA.map(v => Array.from(v)), stepAExpected); - assert.deepEqual(result.stepB.map(v => Array.from(v)), stepBExpected); - assert.deepEqual(result.result.map(v => Array.from(v)), lst); - const memoryOptimize = gpu.createKernel(function(x) { - return x[this.thread.y][this.thread.x]; - }, { - output: [3, 3], - precision: 'single', - optimizeFloatMemory: true, - }); + assert.deepEqual( + result.stepA.map(v => Array.from(v)), + stepAExpected + ); + assert.deepEqual( + result.stepB.map(v => Array.from(v)), + stepBExpected + ); + assert.deepEqual( + result.result.map(v => Array.from(v)), + lst + ); + const memoryOptimize = gpu.createKernel( + function (x) { + return x[this.thread.y][this.thread.x]; + }, + { + output: [3, 3], + precision: 'single', + optimizeFloatMemory: true, + } + ); const stepAOptimized = memoryOptimize(result.stepA); const stepBOptimized = memoryOptimize(result.stepB); const resultOptimized = memoryOptimize(result.result); - assert.deepEqual(stepAOptimized.map(v => Array.from(v)), stepAExpected); - assert.deepEqual(stepBOptimized.map(v => Array.from(v)), stepBExpected); - assert.deepEqual(resultOptimized.map(v => Array.from(v)), lst); + assert.deepEqual( + stepAOptimized.map(v => Array.from(v)), + stepAExpected + ); + assert.deepEqual( + stepBOptimized.map(v => Array.from(v)), + stepBExpected + ); + assert.deepEqual( + resultOptimized.map(v => Array.from(v)), + lst + ); gpu.destroy(); } @@ -155,13 +192,13 @@ function kernelMapSinglePrecision3D(mode) { [ [1, 2, 3], [4, 5, 6], - [7, 8, 9] + [7, 8, 9], ], [ [10, 11, 12], [13, 14, 15], - [16, 17, 18] - ] + [16, 17, 18], + ], ]; const stepAExpected = [ [ @@ -173,51 +210,58 @@ function kernelMapSinglePrecision3D(mode) { [100, 121, 144], [169, 196, 225], [256, 289, 324], - ] + ], ]; const stepBExpected = [ [ [2, 3, 4], [5, 6, 7], - [8, 9, 10] + [8, 9, 10], ], [ [11, 12, 13], [14, 15, 16], - [17, 18, 19] - ] + [17, 18, 19], + ], ]; const gpu = new GPU({ mode }); - const kernels = gpu.createKernelMap({ - stepA: function(x) { - return x * x; + const kernels = gpu.createKernelMap( + { + stepA: function (x) { + return x * x; + }, + stepB: function (x) { + return x + 1; + }, }, - stepB: function(x) { - return x + 1; - } - }, function(lst) { - const val = lst[this.thread.z][this.thread.y][this.thread.x]; + function (lst) { + const val = lst[this.thread.z][this.thread.y][this.thread.x]; - stepA(val); - stepB(val); + stepA(val); + stepB(val); - return val; - }, { - precision: 'single', - output: [3, 3, 2] - }); + return val; + }, + { + precision: 'single', + output: [3, 3, 2], + } + ); const result = kernels(lst); assert.deepEqual(arrayFromCube(result.stepA), stepAExpected); assert.deepEqual(arrayFromCube(result.stepB), stepBExpected); assert.deepEqual(arrayFromCube(result.result), lst); - const memoryOptimize = gpu.createKernel(function(x) { - return x[this.thread.z][this.thread.y][this.thread.x]; - }, { - output: [3, 3, 2], - precision: 'single', - optimizeFloatMemory: true, - }); + const memoryOptimize = gpu.createKernel( + function (x) { + return x[this.thread.z][this.thread.y][this.thread.x]; + }, + { + output: [3, 3, 2], + precision: 'single', + optimizeFloatMemory: true, + } + ); const stepAOptimized = memoryOptimize(result.stepA); const stepBOptimized = memoryOptimize(result.stepB); const resultOptimized = memoryOptimize(result.result); @@ -254,4 +298,4 @@ function kernelMapSinglePrecision3D(mode) { test('Issue #233 - kernel map with single precision 3d cpu', () => { kernelMapSinglePrecision3D('cpu'); -}); \ No newline at end of file +}); diff --git a/test/issues/241-CPU-vs-GPU-maps-output-differently.js b/test/issues/241-CPU-vs-GPU-maps-output-differently.js index 1b270ea5..56c388bb 100644 --- a/test/issues/241-CPU-vs-GPU-maps-output-differently.js +++ b/test/issues/241-CPU-vs-GPU-maps-output-differently.js @@ -8,17 +8,20 @@ describe('issue #241'); const input = [ [0, 1, 2], [3, 4, 5], - [6, 7, 8] + [6, 7, 8], ]; function buildIndexTestKernel(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(inp) { - return inp[this.thread.y][this.thread.x]; - }, { - output: [3, 3] - }); - const result = kernel(input).map((v) => Array.from(v)); + const kernel = gpu.createKernel( + function (inp) { + return inp[this.thread.y][this.thread.x]; + }, + { + output: [3, 3], + } + ); + const result = kernel(input).map(v => Array.from(v)); assert.deepEqual(result, input); gpu.destroy(); } @@ -45,4 +48,4 @@ test('Issue #241 small 2d array input output test gpu', () => { test('Issue #241 small 2d array input output test cpu', () => { buildIndexTestKernel('cpu'); -}); \ No newline at end of file +}); diff --git a/test/issues/259-atan2.js b/test/issues/259-atan2.js index e51b44ee..c9853209 100644 --- a/test/issues/259-atan2.js +++ b/test/issues/259-atan2.js @@ -5,11 +5,14 @@ describe('issue #259'); function buildAtan2KernelResult(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function() { - return Math.atan2(1, 2); - }, { - output: [1], - }); + const kernel = gpu.createKernel( + function () { + return Math.atan2(1, 2); + }, + { + output: [1], + } + ); assert.equal(kernel()[0].toFixed(7), 0.4636476); gpu.destroy(); } @@ -36,4 +39,4 @@ test('Issue #259 atan2 - gpu', () => { test('Issue #259 atan2 - cpu', () => { buildAtan2KernelResult('cpu'); -}); \ No newline at end of file +}); diff --git a/test/issues/263-to-string.js b/test/issues/263-to-string.js index 80554b33..c0d90e4d 100644 --- a/test/issues/263-to-string.js +++ b/test/issues/263-to-string.js @@ -5,11 +5,14 @@ describe('issue #263'); function toString(mode, context, canvas) { const gpu = new GPU({ mode, context, canvas }); - const kernel = gpu.createKernel(function() { - return 1; - }, { - output: [1] - }); + const kernel = gpu.createKernel( + function () { + return 1; + }, + { + output: [1], + } + ); kernel.build(); const string = kernel.toString(); const kernel2 = new Function('return ' + string)()({ context, canvas }); @@ -36,4 +39,4 @@ function toString(mode, context, canvas) { test('Issue #263 toString single function - cpu', () => { toString('cpu'); -}); \ No newline at end of file +}); diff --git a/test/issues/267-immutable-sub-kernels.js b/test/issues/267-immutable-sub-kernels.js index 76d2f4c6..d85ecc0e 100644 --- a/test/issues/267-immutable-sub-kernels.js +++ b/test/issues/267-immutable-sub-kernels.js @@ -5,14 +5,17 @@ describe('issue #267 kernel'); function immutableKernelWithoutFloats(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(v) { - return v[this.thread.x] + 1; - }, { - output: [1], - immutable: true, - pipeline: true, - precision: 'unsigned', - }); + const kernel = gpu.createKernel( + function (v) { + return v[this.thread.x] + 1; + }, + { + output: [1], + immutable: true, + pipeline: true, + precision: 'unsigned', + } + ); // start with a value on CPU const output1 = kernel([1]); @@ -54,14 +57,17 @@ test('Issue #267 immutable kernel output without floats - gpu', () => { function immutableKernelWithFloats(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(v) { - return v[this.thread.x] + 1; - }, { - output: [1], - immutable: true, - pipeline: true, - precision: 'single', - }); + const kernel = gpu.createKernel( + function (v) { + return v[this.thread.x] + 1; + }, + { + output: [1], + immutable: true, + pipeline: true, + precision: 'single', + } + ); // start with a value on CPU // reuse that output, simulating that this value will be monitored, and updated via the same kernel @@ -96,7 +102,6 @@ function immutableKernelWithFloats(mode) { immutableKernelWithFloats('headlessgl'); }); - describe('issue #267 sub kernel'); function immutableSubKernelsWithoutFloats(mode) { @@ -109,14 +114,16 @@ function immutableSubKernelsWithoutFloats(mode) { } const gpu = new GPU({ mode }); - const kernel = gpu.createKernelMap({ + const kernel = gpu.createKernelMap( + { valueOutput1: value1, - valueOutput2: value2 + valueOutput2: value2, }, - function(a, b) { + function (a, b) { value1(a[this.thread.x]); return value2(b[this.thread.x]); - }, { + }, + { output: [1], immutable: true, pipeline: true, @@ -161,8 +168,6 @@ function immutableSubKernelsWithoutFloats(mode) { immutableSubKernelsWithoutFloats('headlessgl'); }); - - describe('issue #267 sub kernels mixed'); function immutableKernelsMixedWithoutFloats(mode) { @@ -175,14 +180,16 @@ function immutableKernelsMixedWithoutFloats(mode) { } const gpu = new GPU({ mode }); - const kernel = gpu.createKernelMap({ + const kernel = gpu.createKernelMap( + { valueOutput1: value1, valueOutput2: value2, }, - function(a, b) { + function (a, b) { value1(a[this.thread.x]); return value2(b[this.thread.x]) + 100; - }, { + }, + { output: [1], immutable: true, pipeline: true, @@ -239,4 +246,4 @@ function immutableKernelsMixedWithoutFloats(mode) { test('Issue #267 immutable kernel & sub-kernel output without floats - cpu', () => { immutableKernelsMixedWithoutFloats('cpu'); -}); \ No newline at end of file +}); diff --git a/test/issues/270-cache.js b/test/issues/270-cache.js index 47c17ba7..611db3af 100644 --- a/test/issues/270-cache.js +++ b/test/issues/270-cache.js @@ -8,9 +8,9 @@ test('Issue #270 WebGlKernel getUniformLocation caches falsey - gpu', () => { const context = { getUniformLocation() { throw new Error('tried to get getUniformLocation when falsey'); - } + }, }; const kernel = new WebGLKernel('function() {}', { canvas, context }); kernel.programUniformLocationCache.test = false; assert.equal(kernel.getUniformLocation('test'), false); -}); \ No newline at end of file +}); diff --git a/test/issues/279-wrong-canvas-size.js b/test/issues/279-wrong-canvas-size.js index 8d2a73fa..18138346 100644 --- a/test/issues/279-wrong-canvas-size.js +++ b/test/issues/279-wrong-canvas-size.js @@ -9,13 +9,15 @@ const HEIGHT = 400; function wrongCanvasSizeOptimized(mode) { const gpu = new GPU({ mode }); - const initMatrix = gpu.createKernel(function(value) { + const initMatrix = gpu + .createKernel(function (value) { return value; }) .setOptimizeFloatMemory(true) .setOutput([WIDTH, HEIGHT]); - const render = gpu.createKernel(function(matrix) { + const render = gpu + .createKernel(function (matrix) { const i = matrix[this.thread.y][this.thread.x]; this.color(i, i, i, 1); }) @@ -50,17 +52,18 @@ test('Issue #279 wrong canvas size optimized - gpu', () => { wrongCanvasSizeOptimized('headlessgl'); }); - function wrongCanvasSizeUnoptimized(mode) { const gpu = new GPU({ mode }); - const initMatrix = gpu.createKernel(function(value) { + const initMatrix = gpu + .createKernel(function (value) { return value; }) .setOptimizeFloatMemory(false) .setOutput([WIDTH, HEIGHT]); - const render = gpu.createKernel(function(matrix) { + const render = gpu + .createKernel(function (matrix) { const i = matrix[this.thread.y][this.thread.x]; this.color(i, i, i, 1); }) @@ -93,4 +96,4 @@ test('Issue #279 wrong canvas size unoptimized - gpu', () => { (GPU.isHeadlessGLSupported ? test : skip)('Issue #279 wrong canvas size unoptimized - headlessgl', () => { wrongCanvasSizeUnoptimized('headlessgl'); -}); \ No newline at end of file +}); diff --git a/test/issues/300-nested-array-index.js b/test/issues/300-nested-array-index.js index b3ecc439..14f0b935 100644 --- a/test/issues/300-nested-array-index.js +++ b/test/issues/300-nested-array-index.js @@ -8,12 +8,14 @@ function nestedArrayIndex(mode) { const gpu2 = new GPU({ mode }); // these 2 should be equivalent - const broken = gpu1.createKernel(function(input, lookup) { + const broken = gpu1 + .createKernel(function (input, lookup) { return lookup[input[this.thread.x]]; }) .setOutput([1]); - const working = gpu2.createKernel(function(input, lookup) { + const working = gpu2 + .createKernel(function (input, lookup) { const idx = input[this.thread.x]; return lookup[idx]; }) @@ -48,4 +50,4 @@ test('Issue #300 nested array index - gpu', () => { test('Issue #300 nested array index - cpu', () => { nestedArrayIndex('cpu'); -}); \ No newline at end of file +}); diff --git a/test/issues/31-nested-var-declare-test.js b/test/issues/31-nested-var-declare-test.js index a5632e5c..2a87d935 100644 --- a/test/issues/31-nested-var-declare-test.js +++ b/test/issues/31-nested-var-declare-test.js @@ -55,8 +55,12 @@ test('Issue #31 - nestedVarRedeclare cpu', () => { test('Issue #31 - nestedVarRedeclare : AST handling webgl', () => { const builder = new FunctionBuilder({ - functionNodes: [new WebGLFunctionNode(nestedVarRedeclareFunction.toString(), { output: [1] })], - output: [1] + functionNodes: [ + new WebGLFunctionNode(nestedVarRedeclareFunction.toString(), { + output: [1], + }), + ], + output: [1], }); assert.throws(() => { builder.getStringFromFunctionNames(['nestedVarRedeclareFunction']); @@ -65,8 +69,12 @@ test('Issue #31 - nestedVarRedeclare : AST handling webgl', () => { test('Issue #31 - nestedVarRedeclare : AST handling webgl2', () => { const builder = new FunctionBuilder({ - functionNodes: [new WebGL2FunctionNode(nestedVarRedeclareFunction.toString(), { output: [1] })], - output: [1] + functionNodes: [ + new WebGL2FunctionNode(nestedVarRedeclareFunction.toString(), { + output: [1], + }), + ], + output: [1], }); assert.throws(() => { builder.getStringFromFunctionNames(['nestedVarRedeclareFunction']); @@ -75,15 +83,18 @@ test('Issue #31 - nestedVarRedeclare : AST handling webgl2', () => { test('Issue #31 - nestedVarRedeclare : AST handling cpu', () => { const builder = new FunctionBuilder({ - functionNodes: [new CPUFunctionNode(nestedVarRedeclareFunction.toString(), { output: [1] })], - output: [1] + functionNodes: [ + new CPUFunctionNode(nestedVarRedeclareFunction.toString(), { + output: [1], + }), + ], + output: [1], }); assert.throws(() => { builder.getStringFromFunctionNames(['nestedVarRedeclareFunction']); }); }); - describe('issue #31 nested declare'); // nested declare function nestedVarDeclareFunction() { @@ -103,7 +114,7 @@ function nestedVarDeclareFunction() { function nestedVarDeclareTest(mode) { const gpu = new GPU({ mode }); const f = gpu.createKernel(nestedVarDeclareFunction, { - output: [1] + output: [1], }); assert.equal(f(), 200, 'basic return function test'); @@ -136,59 +147,58 @@ test('Issue #31 - nestedVarDeclare cpu', () => { test('Issue #31 - nestedVarDeclare : AST handling webgl', () => { const builder = new FunctionBuilder({ - functionNodes: [new WebGLFunctionNode(nestedVarDeclareFunction.toString(), { output: [1] })] + functionNodes: [ + new WebGLFunctionNode(nestedVarDeclareFunction.toString(), { + output: [1], + }), + ], }); assert.equal( builder.getStringFromFunctionNames(['nestedVarDeclareFunction']), 'float nestedVarDeclareFunction() {' + - '\nfloat user_result=0.0;' + - '\nfor (int user_i=0;(user_i<10);++user_i){' + - '\nfor (int user_i=0;(user_i<20);++user_i){' //<-- Note: don't do this in real life! - + - '\nuser_result+=1.0;}' + - '\n}' + - '\n' + - '\nreturn user_result;' + - '\n}' + '\nfloat user_result=0.0;' + + '\nfor (int user_i=0;(user_i<10);++user_i){' + + '\nfor (int user_i=0;(user_i<20);++user_i){' + //<-- Note: don't do this in real life! + '\nuser_result+=1.0;}' + + '\n}' + + '\n' + + '\nreturn user_result;' + + '\n}' ); }); test('Issue #31 - nestedVarDeclare : AST handling webgl2', () => { const builder = new FunctionBuilder({ - functionNodes: [new WebGL2FunctionNode(nestedVarDeclareFunction.toString(), { output: [1] })] + functionNodes: [ + new WebGL2FunctionNode(nestedVarDeclareFunction.toString(), { + output: [1], + }), + ], }); assert.equal( builder.getStringFromFunctionNames(['nestedVarDeclareFunction']), 'float nestedVarDeclareFunction() {' + - '\nfloat user_result=0.0;' + - '\nfor (int user_i=0;(user_i<10);++user_i){' + - '\nfor (int user_i=0;(user_i<20);++user_i){' //<-- Note: don't do this in real life! - + - '\nuser_result+=1.0;}' + - '\n}' + - '\n' + - '\nreturn user_result;' + - '\n}' + '\nfloat user_result=0.0;' + + '\nfor (int user_i=0;(user_i<10);++user_i){' + + '\nfor (int user_i=0;(user_i<20);++user_i){' + //<-- Note: don't do this in real life! + '\nuser_result+=1.0;}' + + '\n}' + + '\n' + + '\nreturn user_result;' + + '\n}' ); }); test('Issue #31 - nestedVarDeclare : AST handling cpu', () => { const builder = new FunctionBuilder({ - functionNodes: [new CPUFunctionNode(nestedVarDeclareFunction.toString(), { output: [1] })] + functionNodes: [ + new CPUFunctionNode(nestedVarDeclareFunction.toString(), { + output: [1], + }), + ], }); - assert.equal( - builder.getStringFromFunctionNames(['nestedVarDeclareFunction']), - 'function nestedVarDeclareFunction() {' + - '\nlet user_result=0;' + - '\nfor (let user_i=0;(user_i<10);++user_i){' + - '\nfor (let user_i=0;(user_i<20);++user_i){' + - '\nuser_result+=1;}' + - '\n}' + - '\n' + - '\nreturn user_result;' + - '\n}' - ); -}); \ No newline at end of file + assert.equal(builder.getStringFromFunctionNames(['nestedVarDeclareFunction']), 'function nestedVarDeclareFunction() {' + '\nlet user_result=0;' + '\nfor (let user_i=0;(user_i<10);++user_i){' + '\nfor (let user_i=0;(user_i<20);++user_i){' + '\nuser_result+=1;}' + '\n}' + '\n' + '\nreturn user_result;' + '\n}'); +}); diff --git a/test/issues/313-variable-lookup.js b/test/issues/313-variable-lookup.js index f04944be..722e403b 100644 --- a/test/issues/313-variable-lookup.js +++ b/test/issues/313-variable-lookup.js @@ -10,16 +10,18 @@ function variableLookup(mode) { const gpu = new GPU({ mode, - functions: [mult2] + functions: [mult2], }); - const render1 = gpu.createKernel(function(input) { - return (mult2(input) + mult2(input * 2) + mult2(input * 1)) // RIGHT + const render1 = gpu + .createKernel(function (input) { + return mult2(input) + mult2(input * 2) + mult2(input * 1); // RIGHT }) .setOutput([1]); - const render2 = gpu.createKernel(function(input) { - return (mult2(input) + mult2(input * 2) + mult2(input)); // WRONG + const render2 = gpu + .createKernel(function (input) { + return mult2(input) + mult2(input * 2) + mult2(input); // WRONG }) .setOutput([1]); @@ -44,4 +46,4 @@ test('Issue #313 Mismatch argument lookup - gpu', () => { }); test('Issue #313 Mismatch argument lookup - cpu', () => { variableLookup('cpu'); -}); \ No newline at end of file +}); diff --git a/test/issues/314-large-input-array-addressing.js b/test/issues/314-large-input-array-addressing.js index ce13f133..5831c2b3 100644 --- a/test/issues/314-large-input-array-addressing.js +++ b/test/issues/314-large-input-array-addressing.js @@ -19,11 +19,15 @@ for (let i = 0; i < DATA_MAX / divisor; i++) { function buildLargeArrayAddressKernel(mode) { const gpu = new GPU({ mode }); - const largeArrayAddressKernel = gpu.createKernel(function(data) { - return data[this.thread.x]; - }, { - precision: 'unsigned', - }) + const largeArrayAddressKernel = gpu + .createKernel( + function (data) { + return data[this.thread.x]; + }, + { + precision: 'unsigned', + } + ) .setOutput([DATA_MAX]); const result = largeArrayAddressKernel(data); @@ -36,7 +40,7 @@ function buildLargeArrayAddressKernel(mode) { break; } } - assert.ok(same, "not all elements are the same, failed on index:" + i); + assert.ok(same, 'not all elements are the same, failed on index:' + i); gpu.destroy(); } @@ -57,4 +61,4 @@ test('Issue #314 Large array addressing - gpu', () => { }); (GPU.isHeadlessGLSupported ? test : skip)('Issue #314 Large array addressing - headlessgl', () => { buildLargeArrayAddressKernel('headlessgl'); -}); \ No newline at end of file +}); diff --git a/test/issues/335-missing-z-index-issue.js b/test/issues/335-missing-z-index-issue.js index 4390027b..e2dacc35 100644 --- a/test/issues/335-missing-z-index-issue.js +++ b/test/issues/335-missing-z-index-issue.js @@ -6,16 +6,13 @@ describe('issue #335'); function missingZIndexIssue(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(value) { + const kernel = gpu + .createKernel(function (value) { return value[this.thread.z][this.thread.y][this.thread.x]; }) .setOutput([1, 1, undefined]); - kernel([ - [ - [1] - ] - ]); + kernel([[[1]]]); gpu.destroy(); } @@ -47,4 +44,4 @@ test('Issue #335 Missing z index issue cpu', () => { assert.throws(() => { missingZIndexIssue('cpu'); }); -}); \ No newline at end of file +}); diff --git a/test/issues/346-uint8array-converted.js b/test/issues/346-uint8array-converted.js index ea285cd3..9b1e501d 100644 --- a/test/issues/346-uint8array-converted.js +++ b/test/issues/346-uint8array-converted.js @@ -14,9 +14,13 @@ for (let i = 0; i < DATA_MAX; i++) { function buildUintArrayInputKernel(mode, data) { const gpu = new GPU({ mode }); - const largeArrayAddressKernel = gpu.createKernel(function(data) { - return data[this.thread.x]; - }, { precision: 'unsigned' }) + const largeArrayAddressKernel = gpu + .createKernel( + function (data) { + return data[this.thread.x]; + }, + { precision: 'unsigned' } + ) .setOutput([DATA_MAX]); const result = largeArrayAddressKernel(data); @@ -28,7 +32,7 @@ function buildUintArrayInputKernel(mode, data) { break; } } - assert.ok(same, "not all elements are the same, failed on index:" + i); + assert.ok(same, 'not all elements are the same, failed on index:' + i); gpu.destroy(); } @@ -54,4 +58,4 @@ function buildUintArrayInputKernel(mode, data) { (GPU.isHeadlessGLSupported ? test : skip)('Issue #346 uint16 input array - headlessgl', () => { buildUintArrayInputKernel('headlessgl', uint16data); -}); \ No newline at end of file +}); diff --git a/test/issues/349-division-by-factors-of-3.js b/test/issues/349-division-by-factors-of-3.js index a0311ff2..d5f73c31 100644 --- a/test/issues/349-division-by-factors-of-3.js +++ b/test/issues/349-division-by-factors-of-3.js @@ -5,12 +5,15 @@ describe('issue #349 divide by 3'); function testDivideByThree(mode) { const gpu = new GPU({ mode }); - const k = gpu.createKernel(function(v1, v2) { - return v1 / v2; - }, { - output: [1], - precision: 'single' - }); + const k = gpu.createKernel( + function (v1, v2) { + return v1 / v2; + }, + { + output: [1], + precision: 'single', + } + ); assert.equal(k(6, 3)[0], 2); gpu.destroy(); } @@ -39,7 +42,6 @@ test('Issue #349 - divide by three cpu', () => { testDivideByThree('cpu'); }); - describe('issue #349 divide by random numbers'); function someRandomWholeNumberDivisions(mode) { @@ -54,12 +56,15 @@ function someRandomWholeNumberDivisions(mode) { dividendData[i] = divisorData[i] * expectedResults[i]; } const gpu = new GPU({ mode }); - const k = gpu.createKernel(function(v1, v2) { - return v1[this.thread.x] / v2[this.thread.x]; - }, { - output: [DATA_MAX], - precision: 'single' - }); + const k = gpu.createKernel( + function (v1, v2) { + return v1[this.thread.x] / v2[this.thread.x]; + }, + { + output: [DATA_MAX], + precision: 'single', + } + ); const result = k(dividendData, divisorData); let same = true; let i = 0; @@ -69,7 +74,7 @@ function someRandomWholeNumberDivisions(mode) { break; } } - assert.ok(same, same ? "" : "not all elements are the same, failed on index:" + i + " " + dividendData[i] + "/" + divisorData[i]); + assert.ok(same, same ? '' : 'not all elements are the same, failed on index:' + i + ' ' + dividendData[i] + '/' + divisorData[i]); gpu.destroy(); } @@ -92,32 +97,30 @@ test('Issue #349 - some random whole number divisions cpu', () => { someRandomWholeNumberDivisions('cpu'); }); - describe('issue #349 disable integer division bug'); function testDisableFixIntegerDivisionBug(mode) { const gpu = new GPU({ mode }); - const idFix = gpu.createKernel(function(v1, v2) { - return v1 / v2; - }, { precision: 'single', output: [1] }); - - const idDixOff = gpu.createKernel(function(v1, v2) { - return v1 / v2; - }, { - output: [1], - precision: 'single', - fixIntegerDivisionAccuracy: false - }); + const idFix = gpu.createKernel( + function (v1, v2) { + return v1 / v2; + }, + { precision: 'single', output: [1] } + ); + + const idDixOff = gpu.createKernel( + function (v1, v2) { + return v1 / v2; + }, + { + output: [1], + precision: 'single', + fixIntegerDivisionAccuracy: false, + } + ); if (!gpu.Kernel.features.isIntegerDivisionAccurate) { - assert.ok( - ( - idFix(6, 3)[0] === 2 && - idFix(6030401, 3991)[0] === 1511 - ) && ( - idDixOff(6, 3)[0] !== 2 || - idDixOff(6030401, 3991)[0] !== 1511 - ), "when bug is present should show bug!"); + assert.ok(idFix(6, 3)[0] === 2 && idFix(6030401, 3991)[0] === 1511 && (idDixOff(6, 3)[0] !== 2 || idDixOff(6030401, 3991)[0] !== 1511), 'when bug is present should show bug!'); } else { assert.ok(idFix(6, 3)[0] === 2 && idDixOff(6, 3)[0] === 2, "when bug isn't present should not show bug!"); } @@ -145,4 +148,4 @@ function testDisableFixIntegerDivisionBug(mode) { test('Issue #349 - test disable fix integer division bug cpu', () => { testDisableFixIntegerDivisionBug('cpu'); -}); \ No newline at end of file +}); diff --git a/test/issues/357-modulus-issue.js b/test/issues/357-modulus-issue.js index 0fabdeb8..868991b2 100644 --- a/test/issues/357-modulus-issue.js +++ b/test/issues/357-modulus-issue.js @@ -8,9 +8,11 @@ function testModKernel(mode) { const gpu = new GPU({ mode }); const nValues = 100; - const myFunc3 = gpu.createKernel(function(x) { - return x[this.thread.x % 3]; - }).setOutput([nValues]); + const myFunc3 = gpu + .createKernel(function (x) { + return x[this.thread.x % 3]; + }) + .setOutput([nValues]); const input = [1, 2, 3]; myFunc3(input); @@ -33,4 +35,4 @@ function testModKernel(mode) { (GPU.isHeadlessGLSupported ? test : skip)('Issue #357 - modulus issue headlessgl', () => { testModKernel('headlessgl'); -}); \ No newline at end of file +}); diff --git a/test/issues/359-addfunction-params-wrong.js b/test/issues/359-addfunction-params-wrong.js index 010fa001..4c630ecf 100644 --- a/test/issues/359-addfunction-params-wrong.js +++ b/test/issues/359-addfunction-params-wrong.js @@ -17,11 +17,14 @@ function testAddFunctionKernel(mode) { gpu.addFunction(clcC); gpu.addFunction(intermediate); - const nestFunctionsKernel = gpu.createKernel(function() { - return intermediate(-1); - }, { - output: [1] - }); + const nestFunctionsKernel = gpu.createKernel( + function () { + return intermediate(-1); + }, + { + output: [1], + } + ); assert.equal(nestFunctionsKernel()[0], 1); @@ -29,13 +32,13 @@ function testAddFunctionKernel(mode) { } (GPU.isWebGLSupported ? test : skip)('Issue #359 - addFunction calls addFunction issue webgl', () => { - testAddFunctionKernel('webgl') + testAddFunctionKernel('webgl'); }); (GPU.isWebGL2Supported ? test : skip)('Issue #359 - addFunction calls addFunction issue webgl2', () => { - testAddFunctionKernel('webgl2') + testAddFunctionKernel('webgl2'); }); (GPU.isHeadlessGLSupported ? test : skip)('Issue #359 - addFunction calls addFunction issue headlessgl', () => { - testAddFunctionKernel('headlessgl') -}); \ No newline at end of file + testAddFunctionKernel('headlessgl'); +}); diff --git a/test/issues/378-only-first-iteration.js b/test/issues/378-only-first-iteration.js index 4e92d2e2..b5214b81 100644 --- a/test/issues/378-only-first-iteration.js +++ b/test/issues/378-only-first-iteration.js @@ -6,7 +6,8 @@ describe('issue #378'); function testOnlyFirstIterationSafari(mode) { const gpu = new GPU({ mode: mode }); const conflictingName = 0.4; - const kernel = gpu.createKernel(function(iter) { + const kernel = gpu + .createKernel(function (iter) { let sum = 0; for (let i = 2; i < iter; i++) { sum = sum + i; @@ -15,7 +16,7 @@ function testOnlyFirstIterationSafari(mode) { }) .setOutput([10]) .setConstants({ - conflictingName: conflictingName + conflictingName: conflictingName, }); const result = kernel(5); @@ -34,4 +35,4 @@ function testOnlyFirstIterationSafari(mode) { (GPU.isHeadlessGLSupported ? test : skip)('Issue #378 - only first iteration safari headlessgl', () => { testOnlyFirstIterationSafari('headlessgl'); -}); \ No newline at end of file +}); diff --git a/test/issues/382-bad-constant.js b/test/issues/382-bad-constant.js index da861f96..ded3b512 100644 --- a/test/issues/382-bad-constant.js +++ b/test/issues/382-bad-constant.js @@ -6,12 +6,13 @@ describe('issue #382'); function testModKernel(mode) { const gpu = new GPU({ mode: mode }); const conflictingName = 0.4; - const kernel = gpu.createKernel(function(a, conflictingName) { + const kernel = gpu + .createKernel(function (a, conflictingName) { return a[this.thread.x] + this.constants.conflictingName + conflictingName; }) .setOutput([1]) .setConstants({ - conflictingName: conflictingName + conflictingName: conflictingName, }); const result = kernel([1], 0.6); @@ -30,4 +31,4 @@ function testModKernel(mode) { (GPU.isHeadlessGLSupported ? test : skip)('Issue #382 - bad constant headlessgl', () => { testModKernel('headlessgl'); -}); \ No newline at end of file +}); diff --git a/test/issues/390-thread-assignment.js b/test/issues/390-thread-assignment.js index eeb85b7a..f3e73bde 100644 --- a/test/issues/390-thread-assignment.js +++ b/test/issues/390-thread-assignment.js @@ -3,19 +3,17 @@ const { WebGLFunctionNode, WebGL2FunctionNode, CPUFunctionNode } = require('../. describe('issue #390'); -test('Issue #390 - thread assignment webgl', function(assert) { - const node = new WebGLFunctionNode(function assignThreadToVar() { - const x = this.thread.x; - const y = this.thread.y; - const sum = x + y; - return sum; - }.toString(), { output: [1], returnType: 'Number' }); - assert.equal(node.toString(), 'float assignThreadToVar() {' + - '\nfloat user_x=float(threadId.x);' + - '\nfloat user_y=float(threadId.y);' + - '\nfloat user_sum=(user_x+user_y);' + - '\nreturn user_sum;' + - '\n}'); +test('Issue #390 - thread assignment webgl', function (assert) { + const node = new WebGLFunctionNode( + function assignThreadToVar() { + const x = this.thread.x; + const y = this.thread.y; + const sum = x + y; + return sum; + }.toString(), + { output: [1], returnType: 'Number' } + ); + assert.equal(node.toString(), 'float assignThreadToVar() {' + '\nfloat user_x=float(threadId.x);' + '\nfloat user_y=float(threadId.y);' + '\nfloat user_sum=(user_x+user_y);' + '\nreturn user_sum;' + '\n}'); const { x, y, sum } = node.contexts[1]; assert.equal(x.name, 'x'); assert.equal(x.valueType, 'Number'); @@ -25,19 +23,17 @@ test('Issue #390 - thread assignment webgl', function(assert) { assert.equal(sum.valueType, 'Number'); }); -test('Issue #390 - thread assignment webgl2', function(assert) { - const node = new WebGL2FunctionNode(function assignThreadToVar() { - const x = this.thread.x; - const y = this.thread.y; - const sum = x + y; - return sum; - }.toString(), { output: [1], returnType: 'Number' }); - assert.equal(node.toString(), 'float assignThreadToVar() {' + - '\nfloat user_x=float(threadId.x);' + - '\nfloat user_y=float(threadId.y);' + - '\nfloat user_sum=(user_x+user_y);' + - '\nreturn user_sum;' + - '\n}'); +test('Issue #390 - thread assignment webgl2', function (assert) { + const node = new WebGL2FunctionNode( + function assignThreadToVar() { + const x = this.thread.x; + const y = this.thread.y; + const sum = x + y; + return sum; + }.toString(), + { output: [1], returnType: 'Number' } + ); + assert.equal(node.toString(), 'float assignThreadToVar() {' + '\nfloat user_x=float(threadId.x);' + '\nfloat user_y=float(threadId.y);' + '\nfloat user_sum=(user_x+user_y);' + '\nreturn user_sum;' + '\n}'); const { x, y, sum } = node.contexts[1]; assert.equal(x.name, 'x'); assert.equal(x.valueType, 'Number'); @@ -47,19 +43,17 @@ test('Issue #390 - thread assignment webgl2', function(assert) { assert.equal(sum.valueType, 'Number'); }); -test('Issue #390 - thread assignment cpu', function(assert) { - const node = new CPUFunctionNode(function assignThreadToVar() { - const x = this.thread.x; - const y = this.thread.y; - const sum = x + y; - return sum; - }.toString(), { output: [1] }); - assert.equal(node.toString(), 'function assignThreadToVar() {' + - '\nconst user_x=_this.thread.x;' + - '\nconst user_y=_this.thread.y;' + - '\nconst user_sum=(user_x+user_y);' + - '\nreturn user_sum;' + - '\n}'); +test('Issue #390 - thread assignment cpu', function (assert) { + const node = new CPUFunctionNode( + function assignThreadToVar() { + const x = this.thread.x; + const y = this.thread.y; + const sum = x + y; + return sum; + }.toString(), + { output: [1] } + ); + assert.equal(node.toString(), 'function assignThreadToVar() {' + '\nconst user_x=_this.thread.x;' + '\nconst user_y=_this.thread.y;' + '\nconst user_sum=(user_x+user_y);' + '\nreturn user_sum;' + '\n}'); const { x, y, z, sum } = node.contexts[1]; assert.equal(x.name, 'x'); assert.equal(x.valueType, 'Integer'); @@ -69,24 +63,20 @@ test('Issue #390 - thread assignment cpu', function(assert) { assert.equal(sum.valueType, 'Number'); }); - -test('Issue #390 (related) - output assignment webgl', function(assert) { - const node = new WebGLFunctionNode(function assignThreadToVar() { - const x = this.output.x; - const y = this.output.y; - const z = this.output.z; - const sum = x + y + z; - return sum; - }.toString(), { - output: [1, 2, 3] - }); - assert.equal(node.toString(), 'float assignThreadToVar() {' + - '\nfloat user_x=1.0;' + - '\nfloat user_y=2.0;' + - '\nfloat user_z=3.0;' + - '\nfloat user_sum=((user_x+user_y)+user_z);' + - '\nreturn user_sum;' + - '\n}'); +test('Issue #390 (related) - output assignment webgl', function (assert) { + const node = new WebGLFunctionNode( + function assignThreadToVar() { + const x = this.output.x; + const y = this.output.y; + const z = this.output.z; + const sum = x + y + z; + return sum; + }.toString(), + { + output: [1, 2, 3], + } + ); + assert.equal(node.toString(), 'float assignThreadToVar() {' + '\nfloat user_x=1.0;' + '\nfloat user_y=2.0;' + '\nfloat user_z=3.0;' + '\nfloat user_sum=((user_x+user_y)+user_z);' + '\nreturn user_sum;' + '\n}'); const { x, y, z, sum } = node.contexts[1]; assert.equal(x.name, 'x'); assert.equal(x.valueType, 'Number'); @@ -98,23 +88,20 @@ test('Issue #390 (related) - output assignment webgl', function(assert) { assert.equal(sum.valueType, 'Number'); }); -test('Issue #390 (related) - output assignment webgl2', function(assert) { - const node = new WebGL2FunctionNode(function assignThreadToVar() { - const x = this.output.x; - const y = this.output.y; - const z = this.output.z; - const sum = x + y + z; - return sum; - }.toString(), { - output: [1, 2, 3] - }); - assert.equal(node.toString(), 'float assignThreadToVar() {' + - '\nfloat user_x=1.0;' + - '\nfloat user_y=2.0;' + - '\nfloat user_z=3.0;' + - '\nfloat user_sum=((user_x+user_y)+user_z);' + - '\nreturn user_sum;' + - '\n}'); +test('Issue #390 (related) - output assignment webgl2', function (assert) { + const node = new WebGL2FunctionNode( + function assignThreadToVar() { + const x = this.output.x; + const y = this.output.y; + const z = this.output.z; + const sum = x + y + z; + return sum; + }.toString(), + { + output: [1, 2, 3], + } + ); + assert.equal(node.toString(), 'float assignThreadToVar() {' + '\nfloat user_x=1.0;' + '\nfloat user_y=2.0;' + '\nfloat user_z=3.0;' + '\nfloat user_sum=((user_x+user_y)+user_z);' + '\nreturn user_sum;' + '\n}'); const context = node.contexts[1]; const { x, y, z, sum } = context; assert.equal(x.name, 'x'); @@ -127,23 +114,20 @@ test('Issue #390 (related) - output assignment webgl2', function(assert) { assert.equal(sum.valueType, 'Number'); }); -test('Issue #390 (related) - output assignment cpu', function(assert) { - const node = new CPUFunctionNode(`function assignThreadToVar() { +test('Issue #390 (related) - output assignment cpu', function (assert) { + const node = new CPUFunctionNode( + `function assignThreadToVar() { const x = this.output.x; const y = this.output.y; const z = this.output.z; const sum = x + y + z; return sum; - }`, { - output: [1, 2, 3] - }); - assert.equal(node.toString(), 'function assignThreadToVar() {' + - '\nconst user_x=outputX;' + - '\nconst user_y=outputY;' + - '\nconst user_z=outputZ;' + - '\nconst user_sum=((user_x+user_y)+user_z);' + - '\nreturn user_sum;' + - '\n}'); + }`, + { + output: [1, 2, 3], + } + ); + assert.equal(node.toString(), 'function assignThreadToVar() {' + '\nconst user_x=outputX;' + '\nconst user_y=outputY;' + '\nconst user_z=outputZ;' + '\nconst user_sum=((user_x+user_y)+user_z);' + '\nreturn user_sum;' + '\n}'); const context = node.contexts[1]; const { x, y, z, sum } = context; assert.equal(context['@contextType'], 'const/let'); @@ -159,4 +143,4 @@ test('Issue #390 (related) - output assignment cpu', function(assert) { assert.equal(sum.name, 'sum'); assert.equal(sum.valueType, 'Number'); -}); \ No newline at end of file +}); diff --git a/test/issues/396-combine-kernels-example.js b/test/issues/396-combine-kernels-example.js index 762e10f6..dd4a8d65 100644 --- a/test/issues/396-combine-kernels-example.js +++ b/test/issues/396-combine-kernels-example.js @@ -5,25 +5,24 @@ describe('issue #396 - combine kernels example'); function combineKernelsExample(mode) { const gpu = new GPU({ mode }); - const add = gpu.createKernel(function(a, b) { - return a[this.thread.x] + b[this.thread.x]; - }).setOutput([5]); - - const multiply = gpu.createKernel(function(a, b) { - return a[this.thread.x] * b[this.thread.x]; - }).setOutput([5]); - - const superKernel = gpu.combineKernels(add, multiply, function(a, b, c) { + const add = gpu + .createKernel(function (a, b) { + return a[this.thread.x] + b[this.thread.x]; + }) + .setOutput([5]); + + const multiply = gpu + .createKernel(function (a, b) { + return a[this.thread.x] * b[this.thread.x]; + }) + .setOutput([5]); + + const superKernel = gpu.combineKernels(add, multiply, function (a, b, c) { return multiply(add(a, b), c); }); const result = superKernel([1, 2, 3, 4, 5], [1, 2, 3, 4, 5], [1, 2, 3, 4, 5]); - assert.deepEqual(Array.from(result), [2, - 8, - 18, - 32, - 50 - ]); + assert.deepEqual(Array.from(result), [2, 8, 18, 32, 50]); gpu.destroy(); } @@ -49,4 +48,4 @@ test('gpu', () => { test('cpu', () => { combineKernelsExample('cpu'); -}); \ No newline at end of file +}); diff --git a/test/issues/399-double-definition.js b/test/issues/399-double-definition.js index 54603f37..88d58927 100644 --- a/test/issues/399-double-definition.js +++ b/test/issues/399-double-definition.js @@ -5,56 +5,62 @@ describe('issue #399'); function doubleDefinitionUnsignedPrecision(mode) { const gpu = new GPU({ mode }); - const toTexture = gpu.createKernel(function(value) { - return value[this.thread.x]; - }, { - precision: 'unsigned', - output: [2], - pipeline: true, - hardcodeConstants: true, - immutable: true - }); + const toTexture = gpu.createKernel( + function (value) { + return value[this.thread.x]; + }, + { + precision: 'unsigned', + output: [2], + pipeline: true, + hardcodeConstants: true, + immutable: true, + } + ); // basically it doesn't die, but builds all the way through to webGL assert.equal(toTexture([0, 1]).constructor.name, 'GLTextureUnsigned'); gpu.destroy(); } (GPU.isWebGLSupported ? test : skip)('Issue #399 - double definition unsigned precision webgl', () => { - doubleDefinitionUnsignedPrecision('webgl') + doubleDefinitionUnsignedPrecision('webgl'); }); (GPU.isWebGL2Supported ? test : skip)('Issue #399 - double definition unsigned precision webgl2', () => { - doubleDefinitionUnsignedPrecision('webgl2') + doubleDefinitionUnsignedPrecision('webgl2'); }); (GPU.isHeadlessGLSupported ? test : skip)('Issue #399 - double definition unsigned precision headlessgl', () => { - doubleDefinitionUnsignedPrecision('headlessgl') + doubleDefinitionUnsignedPrecision('headlessgl'); }); function doubleDefinitionSinglePrecision(mode) { const gpu = new GPU({ mode }); - const toTexture = gpu.createKernel(function(value) { - return value[this.thread.x]; - }, { - precision: 'single', - output: [2], - pipeline: true, - hardcodeConstants: true, - immutable: true - }); + const toTexture = gpu.createKernel( + function (value) { + return value[this.thread.x]; + }, + { + precision: 'single', + output: [2], + pipeline: true, + hardcodeConstants: true, + immutable: true, + } + ); // basically it doesn't die, but builds all the way through to webGL assert.equal(toTexture([0, 1]).constructor.name, 'GLTextureFloat'); gpu.destroy(); } (GPU.isWebGLSupported && GPU.isSinglePrecisionSupported ? test : skip)('Issue #399 - double definition single precision webgl', () => { - doubleDefinitionSinglePrecision('webgl') + doubleDefinitionSinglePrecision('webgl'); }); (GPU.isWebGL2Supported && GPU.isSinglePrecisionSupported ? test : skip)('Issue #399 - double definition single precision webgl2', () => { - doubleDefinitionSinglePrecision('webgl2') + doubleDefinitionSinglePrecision('webgl2'); }); (GPU.isHeadlessGLSupported && GPU.isSinglePrecisionSupported ? test : skip)('Issue #399 - double definition single precision headlessgl', () => { - doubleDefinitionSinglePrecision('headlessgl') -}); \ No newline at end of file + doubleDefinitionSinglePrecision('headlessgl'); +}); diff --git a/test/issues/401-cpu-canvas-check.js b/test/issues/401-cpu-canvas-check.js index 2b8a9b81..e4c752b6 100644 --- a/test/issues/401-cpu-canvas-check.js +++ b/test/issues/401-cpu-canvas-check.js @@ -3,35 +3,43 @@ const { GPU, CPUKernel } = require('../../src'); describe('issue #401'); -test('Issue #401 - cpu no canvas graphical', function(assert) { - assert.throws(function() { - CPUKernel.prototype.build.apply({ - setupConstants: function() {}, - setupArguments: function() {}, - validateSettings: function() {}, - getKernelString: function() {}, - translateSource: function() {}, - buildSignature: function() {}, - graphical: true, - output: [1], - canvas: null - }, []); +test('Issue #401 - cpu no canvas graphical', function (assert) { + assert.throws( + function () { + CPUKernel.prototype.build.apply( + { + setupConstants: function () {}, + setupArguments: function () {}, + validateSettings: function () {}, + getKernelString: function () {}, + translateSource: function () {}, + buildSignature: function () {}, + graphical: true, + output: [1], + canvas: null, + }, + [] + ); }, new Error('no canvas available for using graphical output'), - 'throws when canvas is not available and using graphical output'); + 'throws when canvas is not available and using graphical output' + ); }); -test('Issue #401 - cpu no canvas', function(assert) { - CPUKernel.prototype.build.apply({ - setupConstants: function() {}, - setupArguments: function() {}, - validateSettings: function() {}, - getKernelString: function() {}, - translateSource: function() {}, - buildSignature: function() {}, - graphical: false, - output: [1], - canvas: null - }, []); +test('Issue #401 - cpu no canvas', function (assert) { + CPUKernel.prototype.build.apply( + { + setupConstants: function () {}, + setupArguments: function () {}, + validateSettings: function () {}, + getKernelString: function () {}, + translateSource: function () {}, + buildSignature: function () {}, + graphical: false, + output: [1], + canvas: null, + }, + [] + ); assert.equal(true, true, 'ok when canvas is not available and not using graphical output'); -}); \ No newline at end of file +}); diff --git a/test/issues/410-if-statement.js b/test/issues/410-if-statement.js index da0f86f3..bc42c127 100644 --- a/test/issues/410-if-statement.js +++ b/test/issues/410-if-statement.js @@ -5,7 +5,8 @@ describe('issue #410 - if statement when unsigned on NVidia'); function ifStatement(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(a) { + const kernel = gpu + .createKernel(function (a) { const paramDenom = a[this.thread.x][1] - a[this.thread.x][0]; if (paramDenom === 0) { return 100; @@ -15,13 +16,10 @@ function ifStatement(mode) { .setPrecision('unsigned') .setOutput([2]); - const result = - kernel( - [ - [0, 0], - [0, 2] - ] - ); + const result = kernel([ + [0, 0], + [0, 2], + ]); assert.deepEqual(Array.from(result), [100, 200]); gpu.destroy(); @@ -49,4 +47,4 @@ test('gpu', () => { test('cpu', () => { ifStatement('cpu'); -}); \ No newline at end of file +}); diff --git a/test/issues/422-warnings.js b/test/issues/422-warnings.js index 9ae7d806..d0675813 100644 --- a/test/issues/422-warnings.js +++ b/test/issues/422-warnings.js @@ -5,9 +5,11 @@ describe('issue #422 - warnings'); function warnings(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(a, b) { - return a[this.thread.x] + b[this.thread.x]; - }).setOutput([10]); + const kernel = gpu + .createKernel(function (a, b) { + return a[this.thread.x] + b[this.thread.x]; + }) + .setOutput([10]); assert.deepEqual(Array.from(kernel([0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9])), [0, 2, 4, 6, 8, 10, 12, 14, 16, 18]); gpu.destroy(); } @@ -34,4 +36,4 @@ test('gpu', () => { test('cpu', () => { warnings('cpu'); -}); \ No newline at end of file +}); diff --git a/test/issues/470-modulus-wrong.js b/test/issues/470-modulus-wrong.js index 9363c5fa..ff7010f1 100644 --- a/test/issues/470-modulus-wrong.js +++ b/test/issues/470-modulus-wrong.js @@ -5,14 +5,17 @@ describe('issue #470 - modulus wrong'); function testModulusWrong(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(mod) { - return this.thread.x % mod; - }, { - output: [10], - argumentTypes: { - mod: 'Integer', + const kernel = gpu.createKernel( + function (mod) { + return this.thread.x % mod; }, - }); + { + output: [10], + argumentTypes: { + mod: 'Integer', + }, + } + ); const result = kernel(6); assert.equal(kernel.argumentTypes[0], 'Integer'); @@ -50,4 +53,4 @@ test('gpu', () => { test('cpu', () => { testModulusWrong('cpu'); -}); \ No newline at end of file +}); diff --git a/test/issues/471-canvas-issue.js b/test/issues/471-canvas-issue.js index c7e32612..f1646300 100644 --- a/test/issues/471-canvas-issue.js +++ b/test/issues/471-canvas-issue.js @@ -6,7 +6,7 @@ describe('issue #471 - canvas issue'); function testCanvasIssue(mode) { const gpu = new GPU({ mode }); const render = gpu - .createKernel(function() { + .createKernel(function () { this.color(0, 0, 0, 1); }) .setOutput([200, 200]) @@ -36,4 +36,4 @@ function testCanvasIssue(mode) { (GPU.isCanvasSupported ? test : skip)('cpu', () => { testCanvasIssue('cpu'); -}); \ No newline at end of file +}); diff --git a/test/issues/472-compilation-issue.js b/test/issues/472-compilation-issue.js index 01bee502..2bb1a591 100644 --- a/test/issues/472-compilation-issue.js +++ b/test/issues/472-compilation-issue.js @@ -5,7 +5,7 @@ describe('issue #472 - compilation issue'); function testCompilationIssue(mode) { const gpu = new GPU({ mode }); - const kernelFunction = function(data, wobble) { + const kernelFunction = function (data, wobble) { let x = this.thread.x, y = this.thread.y; @@ -20,12 +20,7 @@ function testCompilationIssue(mode) { output: [2, 2], graphical: true, }); - render(new Uint8ClampedArray([ - 230, 233, 240, 255, - 231, 234, 241, 255, - 232, 235, 242, 255, - 233, 236, 243, 255 - ]), 14 * Math.sin(Date.now() / 400)); + render(new Uint8ClampedArray([230, 233, 240, 255, 231, 234, 241, 255, 232, 235, 242, 255, 233, 236, 243, 255]), 14 * Math.sin(Date.now() / 400)); assert.equal(render.getPixels().length, 2 * 2 * 4); gpu.destroy(); } @@ -52,4 +47,4 @@ test('gpu', () => { (GPU.isCanvasSupported ? test : skip)('cpu', () => { testCompilationIssue('cpu'); -}); \ No newline at end of file +}); diff --git a/test/issues/473-4-pixels.js b/test/issues/473-4-pixels.js index 5db53fdb..16a116a8 100644 --- a/test/issues/473-4-pixels.js +++ b/test/issues/473-4-pixels.js @@ -6,9 +6,10 @@ describe('issue #473 - only 4 pixels are shown'); function testOnly4PixelsAreShownRGBStaticOutput(mode) { const gpu = new GPU({ mode }); const render = gpu.createKernel( - function() { + function () { this.color(1, 1, 1); - }, { + }, + { output: [20, 20], graphical: true, } @@ -49,9 +50,10 @@ test('RGB static output gpu', () => { function testOnly4PixelsAreShownRGBAStaticOutput(mode) { const gpu = new GPU({ mode }); const render = gpu.createKernel( - function() { + function () { this.color(1, 1, 1, 1); - }, { + }, + { output: [20, 20], graphical: true, } @@ -92,9 +94,10 @@ test('RGBA static output gpu', () => { function testOnly4PixelsAreShownRGBDynamicOutput(mode) { const gpu = new GPU({ mode }); const render = gpu.createKernel( - function() { + function () { this.color(1, 1, 1); - }, { + }, + { output: [20, 20], graphical: true, dynamicOutput: true, @@ -143,9 +146,10 @@ test('rgb dynamic output gpu', () => { function testOnly4PixelsAreShownRGBADynamicOutput(mode) { const gpu = new GPU({ mode }); const render = gpu.createKernel( - function() { + function () { this.color(1, 1, 1, 1); - }, { + }, + { output: [20, 20], graphical: true, dynamicOutput: true, @@ -189,4 +193,4 @@ test('rgba dynamic output gpu', () => { (GPU.isCanvasSupported ? test : skip)('rgba dynamic output cpu', () => { testOnly4PixelsAreShownRGBADynamicOutput('cpu'); -}); \ No newline at end of file +}); diff --git a/test/issues/487-dynamic-arguments.js b/test/issues/487-dynamic-arguments.js index 8d9f2e0d..c6e48a88 100644 --- a/test/issues/487-dynamic-arguments.js +++ b/test/issues/487-dynamic-arguments.js @@ -6,16 +6,17 @@ describe('issue #487 - pipeline dynamic arguments'); function testPipelineDynamicArguments(mode) { const gpu = new GPU({ mode: mode }); - const kernel = gpu.createKernel(function(w) { + const kernel = gpu + .createKernel(function (w) { return this.thread.x + this.thread.y * w; }) .setPipeline(true) .setDynamicOutput(true); - const sumRow = gpu.createKernel(function(texture, w) { + const sumRow = gpu + .createKernel(function (texture, w) { let sum = 0; - for (let i = 0; i < w; i++) - sum = sum + texture[this.thread.x][i]; + for (let i = 0; i < w; i++) sum = sum + texture[this.thread.x][i]; return sum; }) .setDynamicArguments(true) @@ -56,4 +57,4 @@ test('(GPU only) gpu', () => { (GPU.isHeadlessGLSupported ? test : skip)('(GPU only) headlessgl', () => { testPipelineDynamicArguments('headlessgl'); -}); \ No newline at end of file +}); diff --git a/test/issues/493-strange-literal.js b/test/issues/493-strange-literal.js index 7353b6fe..f7851671 100644 --- a/test/issues/493-strange-literal.js +++ b/test/issues/493-strange-literal.js @@ -8,28 +8,14 @@ function testStrangeLiteral(mode) { function kernelFunction(array) { const xFactor = (1 - 0) * this.constants.x + this.thread.x * this.constants.y; - const yFactor = (1 - .5) * this.constants.x + this.thread.x * this.constants.y; + const yFactor = (1 - 0.5) * this.constants.x + this.thread.x * this.constants.y; const value = array[this.thread.x]; - return [ - value[0] / xFactor, - value[1] / yFactor, - ]; + return [value[0] / xFactor, value[1] / yFactor]; } - const kernel1 = gpu.createKernel(kernelFunction) - .setArgumentTypes({ array: 'Array1D(2)' }) - .setConstants({ x: 1, y: 1 }) - .setOutput([1]); - assert.deepEqual(kernel1([ - [1, 2] - ]), [new Float32Array([1, 4])]); - const kernel2 = gpu.createKernel(kernelFunction) - .setStrictIntegers(true) - .setArgumentTypes({ array: 'Array1D(2)' }) - .setConstants({ x: 1, y: 1 }) - .setOutput([1]); - assert.deepEqual(kernel2([ - [1, 2] - ]), [new Float32Array([1, 4])]); + const kernel1 = gpu.createKernel(kernelFunction).setArgumentTypes({ array: 'Array1D(2)' }).setConstants({ x: 1, y: 1 }).setOutput([1]); + assert.deepEqual(kernel1([[1, 2]]), [new Float32Array([1, 4])]); + const kernel2 = gpu.createKernel(kernelFunction).setStrictIntegers(true).setArgumentTypes({ array: 'Array1D(2)' }).setConstants({ x: 1, y: 1 }).setOutput([1]); + assert.deepEqual(kernel2([[1, 2]]), [new Float32Array([1, 4])]); gpu.destroy(); } @@ -55,4 +41,4 @@ test('gpu', () => { test('cpu', () => { testStrangeLiteral('cpu'); -}); \ No newline at end of file +}); diff --git a/test/issues/500-sticky-arrays.js b/test/issues/500-sticky-arrays.js index 5a092797..2696ab90 100644 --- a/test/issues/500-sticky-arrays.js +++ b/test/issues/500-sticky-arrays.js @@ -10,9 +10,12 @@ function testStickyArrays(mode) { return image[0]; } gpu.addFunction(processImage); - const kernel = gpu.createKernel(function(image1, image2, image3) { - return [processImage(image1), processImage(image2), processImage(image3)]; - }, { output: [1] }); + const kernel = gpu.createKernel( + function (image1, image2, image3) { + return [processImage(image1), processImage(image2), processImage(image3)]; + }, + { output: [1] } + ); assert.deepEqual(kernel([1], [2], [3]), [new Float32Array([1, 2, 3])]); } @@ -39,4 +42,4 @@ test('gpu', () => { test('cpu', () => { testStickyArrays('cpu'); -}); \ No newline at end of file +}); diff --git a/test/issues/519-sanitize-names.js b/test/issues/519-sanitize-names.js index 6d72d198..6d18ec63 100644 --- a/test/issues/519-sanitize-names.js +++ b/test/issues/519-sanitize-names.js @@ -5,11 +5,14 @@ describe('issue #519 - sanitize names'); function testSanitizeNames(mode) { const gpu = new GPU({ mode }); - const kernel1 = gpu.createKernel(function(value__$, value__, value$, _) { - return value__$ + value__ + value$ + _ + 1; - }, { - output: [1] - }); + const kernel1 = gpu.createKernel( + function (value__$, value__, value$, _) { + return value__$ + value__ + value$ + _ + 1; + }, + { + output: [1], + } + ); assert.equal(kernel1(1, 2, 3, 4)[0], 11); gpu.destroy(); } @@ -36,4 +39,4 @@ test('gpu', () => { test('cpu', () => { testSanitizeNames('cpu'); -}); \ No newline at end of file +}); diff --git a/test/issues/553-permanent-flip.js b/test/issues/553-permanent-flip.js index fc055a76..627f01e7 100644 --- a/test/issues/553-permanent-flip.js +++ b/test/issues/553-permanent-flip.js @@ -5,20 +5,18 @@ describe('issue #553 - permanent flip'); function testFixPermanentFlip(precision, mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(a1, a2, a3, a4) { - return a2[this.thread.x]; - }, { - precision, - output: [4] - }); + const kernel = gpu.createKernel( + function (a1, a2, a3, a4) { + return a2[this.thread.x]; + }, + { + precision, + output: [4], + } + ); const arr = [1, 2, 3, 4]; for (let i = 0; i < 4; i++) { - assert.deepEqual(kernel( - 999, - arr, - new Image(2, 2), - 999, - ), new Float32Array(arr)); + assert.deepEqual(kernel(999, arr, new Image(2, 2), 999), new Float32Array(arr)); } gpu.destroy(); @@ -64,4 +62,4 @@ function testFixPermanentFlip(precision, mode) { (typeof Image === 'undefined' ? skip : test)('cpu single', () => { testFixPermanentFlip('single', 'cpu'); -}); \ No newline at end of file +}); diff --git a/test/issues/556-minify-for-loop.js b/test/issues/556-minify-for-loop.js index 9abaf801..d1a0a908 100644 --- a/test/issues/556-minify-for-loop.js +++ b/test/issues/556-minify-for-loop.js @@ -6,19 +6,20 @@ describe('issue #556 - minify for loop'); const source = 'function w(t,e){for(var r=0,i=0;i 4, - returnType: 'Number' - }); + const node = new WebGLFunctionNode(source, { + constantTypes: { + size: 'Number', + }, + output: [1], + argumentNames: ['t', 'e'], + argumentTypes: ['Array', 'Array'], + lookupFunctionArgumentBitRatio: () => 4, + returnType: 'Number', + }); - assert.equal(node.toString(), `float w(sampler2D user_t,ivec2 user_tSize,ivec3 user_tDim, sampler2D user_e,ivec2 user_eSize,ivec3 user_eDim) { + assert.equal( + node.toString(), + `float w(sampler2D user_t,ivec2 user_tSize,ivec3 user_tDim, sampler2D user_e,ivec2 user_eSize,ivec3 user_eDim) { float user_r=0.0;int user_i=0; for (int safeI=0;safeI { @@ -38,16 +40,11 @@ function testKernel(mode) { const kernel = gpu.createKernel(source, { output: [1, 1], constants: { - size: 1 + size: 1, }, }); - const result = kernel([ - [1] - ], [ - [1] - ]); + const result = kernel([[1]], [[1]]); assert.deepEqual(result, [new Float32Array([1])]); - } test('kernel auto', () => { @@ -72,4 +69,4 @@ test('kernel gpu', () => { test('kernel cpu', () => { testKernel('cpu'); -}); \ No newline at end of file +}); diff --git a/test/issues/560-minification-madness.js b/test/issues/560-minification-madness.js index 82a2f0b8..aa4ada42 100644 --- a/test/issues/560-minification-madness.js +++ b/test/issues/560-minification-madness.js @@ -5,37 +5,24 @@ describe('issue #560 - minification madness'); function testMinificationMadness(mode, canvas) { const gpu = new GPU({ mode, canvas }); - const kernel = gpu.createKernel(function(t, e, i, n, r) { - for ( - var o = this.constants.maxIter, - a = this.constants.canvasWidth, - s = this.constants.canvasHeight, - l = i + (n - i) * (this.thread.y / s), - c = t + (e - t) * (this.thread.x / a), - p = 0, - u = 0, - h = 0, - d = 0; p * p + u * u < 4 && h < o;) - d = p * p - u * u + c, - u = 2 * p * u + l, - p = d, - h++; - h === o ? - this.color(0, 0, 0, 1) : - this.color(r[3 * h] / 255, r[3 * h + 1] / 255, r[3 * h + 2] / 255, 1); - }, { - output: [1, 1], - constants: { - maxIter: 1, - canvasWidth: 1, - canvasHeight: 1, + const kernel = gpu.createKernel( + function (t, e, i, n, r) { + for (var o = this.constants.maxIter, a = this.constants.canvasWidth, s = this.constants.canvasHeight, l = i + (n - i) * (this.thread.y / s), c = t + (e - t) * (this.thread.x / a), p = 0, u = 0, h = 0, d = 0; p * p + u * u < 4 && h < o; ) (d = p * p - u * u + c), (u = 2 * p * u + l), (p = d), h++; + h === o ? this.color(0, 0, 0, 1) : this.color(r[3 * h] / 255, r[3 * h + 1] / 255, r[3 * h + 2] / 255, 1); }, - graphical: true, - }); + { + output: [1, 1], + constants: { + maxIter: 1, + canvasWidth: 1, + canvasHeight: 1, + }, + graphical: true, + } + ); kernel(1, 2, 3, 4, [5]); assert.ok(kernel.getPixels()); - if (kernel.context && kernel.context.getError) - assert.ok(kernel.context.getError() === 0); + if (kernel.context && kernel.context.getError) assert.ok(kernel.context.getError() === 0); gpu.destroy(); } @@ -69,7 +56,7 @@ test('cpu', () => { putImageData: mockPutImageData, }; const mockCanvas = { - getContext: () => mockContext + getContext: () => mockContext, }; testMinificationMadness('cpu', typeof HTMLCanvasElement === 'undefined' ? mockCanvas : null); -}); \ No newline at end of file +}); diff --git a/test/issues/564-boolean.js b/test/issues/564-boolean.js index 21b50f54..2ab4df83 100644 --- a/test/issues/564-boolean.js +++ b/test/issues/564-boolean.js @@ -7,10 +7,11 @@ function testBooleanHandled(fft, mode) { const gpu = new GPU({ mode }); gpu.addNativeFunction('fft', fft, { returnType: 'Array(4)' }); const kernel = gpu.createKernel( - function() { + function () { let s = true; return fft(s); - }, { + }, + { output: [1], } ); @@ -43,7 +44,10 @@ test('gpu', () => { }); test('cpu', () => { - testBooleanHandled(`function fft(horizontal){ + testBooleanHandled( + `function fft(horizontal){ return [1,1,horizontal?1:0,1]; -}`, 'cpu'); -}); \ No newline at end of file +}`, + 'cpu' + ); +}); diff --git a/test/issues/567-wrong-modulus.js b/test/issues/567-wrong-modulus.js index 87750966..ea0a2ba1 100644 --- a/test/issues/567-wrong-modulus.js +++ b/test/issues/567-wrong-modulus.js @@ -5,47 +5,62 @@ describe('issue #567 - wrong modulus'); function testWrongModulus(mode) { const gpu = new GPU({ mode }); - const kernel1 = gpu.createKernel(function() { - return 91 % 7; - }, { - output: [1] - }); + const kernel1 = gpu.createKernel( + function () { + return 91 % 7; + }, + { + output: [1], + } + ); assert.equal(kernel1()[0], 91 % 7); - const kernel2 = gpu.createKernel(function(value1, value2) { - return value1 % value2; - }, { - output: [1], - }); + const kernel2 = gpu.createKernel( + function (value1, value2) { + return value1 % value2; + }, + { + output: [1], + } + ); assert.equal(kernel2(91, 7)[0], 91 % 7); - const kernel3 = gpu.createKernel(function(value1, value2) { - return value1 % value2; - }, { - output: [1], - }); + const kernel3 = gpu.createKernel( + function (value1, value2) { + return value1 % value2; + }, + { + output: [1], + } + ); assert.equal(kernel3(91, 7)[0], 91 % 7); - const kernel4 = gpu.createKernel(function() { - return this.constants.value1 % this.constants.value2; - }, { - output: [1], - constants: { - value1: 91, - value2: 7, + const kernel4 = gpu.createKernel( + function () { + return this.constants.value1 % this.constants.value2; + }, + { + output: [1], + constants: { + value1: 91, + value2: 7, + }, } - }); + ); assert.equal(kernel4()[0].toFixed(2), 91 % 7); - const kernel5 = gpu.createKernel(function() { - return 91 % this.constants.value; - }, { - output: [1], - constants: { - value: 7 + const kernel5 = gpu.createKernel( + function () { + return 91 % this.constants.value; }, - strictIntegers: true - }); + { + output: [1], + constants: { + value: 7, + }, + strictIntegers: true, + } + ); assert.equal(kernel5()[0], 91 % 7); gpu.destroy(); @@ -73,4 +88,4 @@ test('gpu', () => { test('cpu', () => { testWrongModulus('cpu'); -}); \ No newline at end of file +}); diff --git a/test/issues/585-inaccurate-lookups.js b/test/issues/585-inaccurate-lookups.js index bafdcea8..e60df573 100644 --- a/test/issues/585-inaccurate-lookups.js +++ b/test/issues/585-inaccurate-lookups.js @@ -5,11 +5,14 @@ describe('issue #585 - inaccurate lookups'); function testResize(mode) { const gpu = new GPU({ mode }); - const kernel = gpu.createKernel(function(value) { - return value[this.thread.x]; - }, { - output: [4], - }); + const kernel = gpu.createKernel( + function (value) { + return value[this.thread.x]; + }, + { + output: [4], + } + ); const result = kernel([0, 1, 2, 3]); assert.equal(Math.round(result[0]), 0); @@ -41,4 +44,4 @@ test('gpu', () => { test('cpu', () => { testResize('cpu'); -}); \ No newline at end of file +}); diff --git a/test/issues/586-unable-to-resize.js b/test/issues/586-unable-to-resize.js index 804fb29b..87eee1cc 100644 --- a/test/issues/586-unable-to-resize.js +++ b/test/issues/586-unable-to-resize.js @@ -5,23 +5,24 @@ describe('issue #586 - unable to resize'); function testResize(convert, mode) { const gpu = new GPU({ mode }); - const createTexture1 = gpu.createKernel(function() { - return 1; - }, { output: [2, 2], pipeline: false }); - - const createTexture2 = gpu.createKernel(function() { - return 1; - }, { output: [4, 4], pipeline: true }); + const createTexture1 = gpu.createKernel( + function () { + return 1; + }, + { output: [2, 2], pipeline: false } + ); + + const createTexture2 = gpu.createKernel( + function () { + return 1; + }, + { output: [4, 4], pipeline: true } + ); var t1 = createTexture1(); var t2 = createTexture2(); - assert.deepEqual(convert(t2), [ - new Float32Array([1, 1, 1, 1]), - new Float32Array([1, 1, 1, 1]), - new Float32Array([1, 1, 1, 1]), - new Float32Array([1, 1, 1, 1]), - ]); + assert.deepEqual(convert(t2), [new Float32Array([1, 1, 1, 1]), new Float32Array([1, 1, 1, 1]), new Float32Array([1, 1, 1, 1]), new Float32Array([1, 1, 1, 1])]); gpu.destroy(); } @@ -48,4 +49,4 @@ test('gpu', () => { test('cpu', () => { testResize(a => a, 'cpu'); -}); \ No newline at end of file +}); diff --git a/test/issues/608-rewritten-arrays.js b/test/issues/608-rewritten-arrays.js index 7e329107..fc86e193 100644 --- a/test/issues/608-rewritten-arrays.js +++ b/test/issues/608-rewritten-arrays.js @@ -5,50 +5,77 @@ describe('issue #608 - rewritten arrays'); function testRewrittenArrays(mode) { const gpu = new GPU({ mode }); - const kernel1 = gpu.createKernel(function(a, b) { - return a[this.thread.y][this.thread.x]; - }, { - constants: { - c: [21, 23] + const kernel1 = gpu.createKernel( + function (a, b) { + return a[this.thread.y][this.thread.x]; }, - output: [2, 2] - }); - const kernel2 = gpu.createKernel(function(a, b) { - return b[this.thread.y][this.thread.x]; - }, { - constants: { - c: [21, 23] + { + constants: { + c: [21, 23], + }, + output: [2, 2], + } + ); + const kernel2 = gpu.createKernel( + function (a, b) { + return b[this.thread.y][this.thread.x]; }, - output: [2, 2] - }); - const kernel3 = gpu.createKernel(function(a, b) { - return this.constants.c[this.thread.x]; - }, { - constants: { - c: [21, 23] + { + constants: { + c: [21, 23], + }, + output: [2, 2], + } + ); + const kernel3 = gpu.createKernel( + function (a, b) { + return this.constants.c[this.thread.x]; }, - output: [2, 2] - }); + { + constants: { + c: [21, 23], + }, + output: [2, 2], + } + ); const a = [ [2, 3], - [5, 7] + [5, 7], ]; const b = [ [11, 13], - [17, 19] + [17, 19], ]; const cExpected = [ [21, 23], - [21, 23] + [21, 23], ]; // testing twice to ensure constants are reset - assert.deepEqual(kernel1(a, b).map(v => Array.from(v)), a); - assert.deepEqual(kernel2(a, b).map(v => Array.from(v)), b); - assert.deepEqual(kernel3(a, b).map(v => Array.from(v)), cExpected); + assert.deepEqual( + kernel1(a, b).map(v => Array.from(v)), + a + ); + assert.deepEqual( + kernel2(a, b).map(v => Array.from(v)), + b + ); + assert.deepEqual( + kernel3(a, b).map(v => Array.from(v)), + cExpected + ); - assert.deepEqual(kernel1(a, b).map(v => Array.from(v)), a); - assert.deepEqual(kernel2(a, b).map(v => Array.from(v)), b); - assert.deepEqual(kernel3(a, b).map(v => Array.from(v)), cExpected); + assert.deepEqual( + kernel1(a, b).map(v => Array.from(v)), + a + ); + assert.deepEqual( + kernel2(a, b).map(v => Array.from(v)), + b + ); + assert.deepEqual( + kernel3(a, b).map(v => Array.from(v)), + cExpected + ); gpu.destroy(); } @@ -74,4 +101,4 @@ test('gpu', () => { test('cpu', () => { testRewrittenArrays('cpu'); -}); \ No newline at end of file +}); diff --git a/test/issues/91-create-kernel-map-array.js b/test/issues/91-create-kernel-map-array.js index e93a3891..66475cdb 100644 --- a/test/issues/91-create-kernel-map-array.js +++ b/test/issues/91-create-kernel-map-array.js @@ -7,12 +7,12 @@ function getResult(mode) { const A = [ [1, 2], [3, 4], - [5, 6] + [5, 6], ]; const B = [ [6, 5, 4], - [3, 2, 1] + [3, 2, 1], ]; const gpu = new GPU({ mode }); @@ -25,11 +25,15 @@ function getResult(mode) { return sum; } - const kernels = gpu.createKernelMap({ - multiplyResult: multiply - }, function(a, b) { - return multiply(b, a, this.thread.y, this.thread.x); - }) + const kernels = gpu + .createKernelMap( + { + multiplyResult: multiply, + }, + function (a, b) { + return multiply(b, a, this.thread.y, this.thread.x); + } + ) .setOutput([2, 2]); const result = kernels(A, B).result; assert.deepEqual(Array.from(result[0]), [21, 32]); @@ -37,25 +41,25 @@ function getResult(mode) { gpu.destroy(); return kernels; } -(GPU.isWebGL2Supported || (GPU.isHeadlessGLSupported && HeadlessGLKernel.features.kernelMap) ? test : skip)("Issue #91 - type detection auto", () => { +(GPU.isWebGL2Supported || (GPU.isHeadlessGLSupported && HeadlessGLKernel.features.kernelMap) ? test : skip)('Issue #91 - type detection auto', () => { getResult(); }); -(GPU.isWebGL2Supported || (GPU.isHeadlessGLSupported && HeadlessGLKernel.features.kernelMap) ? test : skip)("Issue #91 - type detection gpu", () => { +(GPU.isWebGL2Supported || (GPU.isHeadlessGLSupported && HeadlessGLKernel.features.kernelMap) ? test : skip)('Issue #91 - type detection gpu', () => { getResult('gpu'); }); -(GPU.isWebGLSupported ? test : skip)("Issue #91 - type detection webgl", () => { +(GPU.isWebGLSupported ? test : skip)('Issue #91 - type detection webgl', () => { const kernel = getResult('webgl'); assert.equal(kernel.kernel.constructor, WebGLKernel, 'kernel type is wrong'); }); -(GPU.isWebGL2Supported ? test : skip)("Issue #91 - type detection webgl2", () => { +(GPU.isWebGL2Supported ? test : skip)('Issue #91 - type detection webgl2', () => { const kernel = getResult('webgl2'); assert.equal(kernel.kernel.constructor, WebGL2Kernel, 'kernel type is wrong'); }); -(GPU.isHeadlessGLSupported ? test : skip)("Issue #91 - type detection headlessgl", () => { +(GPU.isHeadlessGLSupported ? test : skip)('Issue #91 - type detection headlessgl', () => { const kernel = getResult('headlessgl'); assert.equal(kernel.kernel.constructor, HeadlessGLKernel, 'kernel type is wrong'); }); -test("Issue #91 - type detection cpu", () => { +test('Issue #91 - type detection cpu', () => { const kernel = getResult('cpu'); assert.equal(kernel.kernel.constructor, CPUKernel, 'kernel type is wrong'); -}); \ No newline at end of file +}); diff --git a/test/issues/96-param-names.js b/test/issues/96-param-names.js index a354901d..a2f35392 100644 --- a/test/issues/96-param-names.js +++ b/test/issues/96-param-names.js @@ -6,13 +6,13 @@ describe('issue #96'); function getResult(mode) { const A = [ [1, 1, 1], - [1, 1, 1] + [1, 1, 1], ]; const B = [ [1, 1], [1, 1], - [1, 1] + [1, 1], ]; const gpu = new GPU({ mode }); @@ -25,11 +25,15 @@ function getResult(mode) { return sum; } - const kernels = gpu.createKernelMap({ - multiplyResult: multiply - }, function(a, b) { - return multiply(b, a, this.thread.y, this.thread.x); - }) + const kernels = gpu + .createKernelMap( + { + multiplyResult: multiply, + }, + function (a, b) { + return multiply(b, a, this.thread.y, this.thread.x); + } + ) .setOutput([B.length, A.length]); const result = kernels(A, B).result; @@ -39,21 +43,21 @@ function getResult(mode) { gpu.destroy(); return result; } -(GPU.isKernelMapSupported ? test : skip)("Issue #96 - param names auto", () => { +(GPU.isKernelMapSupported ? test : skip)('Issue #96 - param names auto', () => { getResult(); }); -(GPU.isKernelMapSupported ? test : skip)("Issue #96 - param names gpu", () => { +(GPU.isKernelMapSupported ? test : skip)('Issue #96 - param names gpu', () => { getResult('gpu'); }); -(GPU.isWebGLSupported ? test : skip)("Issue #96 - param names webgl", () => { +(GPU.isWebGLSupported ? test : skip)('Issue #96 - param names webgl', () => { getResult('webgl'); }); -(GPU.isWebGL2Supported ? test : skip)("Issue #96 - param names webgl2", () => { +(GPU.isWebGL2Supported ? test : skip)('Issue #96 - param names webgl2', () => { getResult('webgl2'); }); -(GPU.isHeadlessGLSupported && GPU.isKernelMapSupported ? test : skip)("Issue #96 - param names headlessgl", () => { +(GPU.isHeadlessGLSupported && GPU.isKernelMapSupported ? test : skip)('Issue #96 - param names headlessgl', () => { getResult('headlessgl'); }); -test("Issue #96 - param names cpu", () => { +test('Issue #96 - param names cpu', () => { getResult('cpu'); -}); \ No newline at end of file +}); diff --git a/test/test-utils.js b/test/test-utils.js index cad40d56..a35ca2fe 100644 --- a/test/test-utils.js +++ b/test/test-utils.js @@ -1,4 +1,3 @@ - const testUtils = { /** * A visual debug utility @@ -9,36 +8,59 @@ const testUtils = { * @return {Object[]} */ splitRGBAToCanvases: (gpu, rgba, width, height) => { - const visualKernelR = gpu.createKernel(function(v) { - const pixel = v[this.thread.y][this.thread.x]; - this.color(pixel.r / 255, 0, 0, 255); - }, { output: [width, height], graphical: true, argumentTypes: { v: 'Array2D(4)' } }); + const visualKernelR = gpu.createKernel( + function (v) { + const pixel = v[this.thread.y][this.thread.x]; + this.color(pixel.r / 255, 0, 0, 255); + }, + { + output: [width, height], + graphical: true, + argumentTypes: { v: 'Array2D(4)' }, + } + ); visualKernelR(rgba); - const visualKernelG = gpu.createKernel(function(v) { - const pixel = v[this.thread.y][this.thread.x]; - this.color(0, pixel.g / 255, 0, 255); - }, { output: [width, height], graphical: true, argumentTypes: { v: 'Array2D(4)' } }); + const visualKernelG = gpu.createKernel( + function (v) { + const pixel = v[this.thread.y][this.thread.x]; + this.color(0, pixel.g / 255, 0, 255); + }, + { + output: [width, height], + graphical: true, + argumentTypes: { v: 'Array2D(4)' }, + } + ); visualKernelG(rgba); - const visualKernelB = gpu.createKernel(function(v) { - const pixel = v[this.thread.y][this.thread.x]; - this.color(0, 0, pixel.b / 255, 255); - }, { output: [width, height], graphical: true, argumentTypes: { v: 'Array2D(4)' } }); + const visualKernelB = gpu.createKernel( + function (v) { + const pixel = v[this.thread.y][this.thread.x]; + this.color(0, 0, pixel.b / 255, 255); + }, + { + output: [width, height], + graphical: true, + argumentTypes: { v: 'Array2D(4)' }, + } + ); visualKernelB(rgba); - const visualKernelA = gpu.createKernel(function(v) { - const pixel = v[this.thread.y][this.thread.x]; - this.color(255, 255, 255, pixel.a / 255); - }, { output: [width, height], graphical: true, argumentTypes: { v: 'Array2D(4)' } }); + const visualKernelA = gpu.createKernel( + function (v) { + const pixel = v[this.thread.y][this.thread.x]; + this.color(255, 255, 255, pixel.a / 255); + }, + { + output: [width, height], + graphical: true, + argumentTypes: { v: 'Array2D(4)' }, + } + ); visualKernelA(rgba); - return [ - visualKernelR.getPixels(), - visualKernelG.getPixels(), - visualKernelB.getPixels(), - visualKernelA.getPixels(), - ]; + return [visualKernelR.getPixels(), visualKernelG.getPixels(), visualKernelB.getPixels(), visualKernelA.getPixels()]; }, }; From eb6ce557dbf237bcad1a23ebd43f46534f9050d3 Mon Sep 17 00:00:00 2001 From: 17097231932 <17097231932@163.com> Date: Sun, 29 Jan 2023 12:45:35 +0800 Subject: [PATCH 06/11] fix: index.js is wrong because of coping error --- src/index.js | 85 ++++++++++++++++------------------------------------ 1 file changed, 26 insertions(+), 59 deletions(-) diff --git a/src/index.js b/src/index.js index 1cc8700a..88d03985 100644 --- a/src/index.js +++ b/src/index.js @@ -1,69 +1,36 @@ -const { expect } = require('chai'); +export { GPU } from './gpu'; +export { alias } from './alias'; +export { utils } from './utils'; +export { Input, input } from './input'; +export { Texture } from './texture'; +export { FunctionBuilder } from './backend/function-builder'; +export { FunctionNode } from './backend/function-node'; +export { CPUFunctionNode } from './backend/cpu/function-node'; +export { CPUKernel } from './backend/cpu/kernel'; -const GPU = require('../src/index.js'); +export { HeadlessGLKernel } from './backend/headless-gl/kernel'; -describe('Test Node GPU', () => { - describe('gpu mode', () => { - it('should find and use gpu runner', () => { - const gpu = new GPU({ mode: 'gpu' }); +export { WebGLFunctionNode } from './backend/web-gl/function-node'; +export { WebGLKernel } from './backend/web-gl/kernel'; +export { kernelValueMaps as webGLKernelValueMaps } from './backend/web-gl/kernel-value-maps'; - const kernel = gpu - .createKernel(function () { - return 1; - }) - .setOutput([1]); +export { WebGL2FunctionNode } from './backend/web-gl2/function-node'; +export { WebGL2Kernel } from './backend/web-gl2/kernel'; +export { kernelValueMaps as webGL2KernelValueMaps } from './backend/web-gl2/kernel-value-maps'; - const result = kernel(); +export { GLKernel } from './backend/gl/kernel'; - expect(gpu.runner.constructor).to.equal(GPU.HeadlessGLRunner); - expect(result[0]).to.equal(1); - }); +export { Kernel } from './backend/kernel'; - it('supports 2x2 size', () => { - const gpu = new GPU({ mode: 'gpu' }); +export { FunctionTracer } from './backend/function-tracer'; - const kernel = gpu - .createKernel(function () { - return this.thread.x * this.thread.y; - }) - .setOutput([2, 2]); +import mathRandom from './plugins/math-random-uniformly-distributed'; - const result = kernel(); +export const plugins = { + mathRandom, +}; - expect(gpu.runner.constructor).to.equal(GPU.HeadlessGLRunner); - expect(result).to.deep.equal([Float32Array.from([0, 0]), Float32Array.from([0, 1])]); - }); - }); +import { setupNode } from './gpu'; +import { HeadlessGLKernel } from './backend/headless-gl/kernel'; - describe('cpu mode', () => { - it('should find and use gpu runner', () => { - const gpu = new GPU({ mode: 'cpu' }); - - const kernel = gpu - .createKernel(function () { - return 1; - }) - .setOutput([1]); - - const result = kernel(); - - expect(gpu.runner.constructor).to.equal(GPU.CPURunner); - expect(result[0]).to.equal(1); - }); - - it('supports 2x2 size', () => { - const gpu = new GPU({ mode: 'cpu' }); - - const kernel = gpu - .createKernel(function () { - return this.thread.x * this.thread.y; - }) - .setOutput([2, 2]); - - const result = kernel(); - - expect(gpu.runner.constructor).to.equal(GPU.CPURunner); - expect(result).to.deep.equal([Float32Array.from([0, 0]), Float32Array.from([0, 1])]); - }); - }); -}); +setupNode(HeadlessGLKernel); From d7bf91816e08409779877724b1e9f4d49b76ff40 Mon Sep 17 00:00:00 2001 From: 17097231932 <17097231932@163.com> Date: Sun, 29 Jan 2023 14:15:43 +0800 Subject: [PATCH 07/11] add commonjs format build for node --- package.json | 14 +- pnpm-lock.yaml | 383 ++++++++++++++++++++++++++++++++++------------- rollup.config.js | 61 ++++---- 3 files changed, 324 insertions(+), 134 deletions(-) diff --git a/package.json b/package.json index 589ee1eb..b095fd90 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,15 @@ "engines": { "node": ">=8.0.0" }, - "main": "./src/index.js", + "main": "./dist/gpu-node.js", + "exports": { + ".": { + "require": "./dist/gpu-node.js", + "import": "./dist/gpu-node.esm.js", + "types": "./src/index.d.ts", + "node": "./dist/gpu-node.js" + } + }, "files": [ "src", "dist" @@ -30,13 +38,13 @@ "@rollup/plugin-terser": "^0.4.0", "benchmark": "^2.1.4", "c8": "^7.12.0", + "esno": "^0.16.3", "prettier": "^2.8.3", "qunit": "^2.9.1", "read-dir-deep": "^7.0.1", "rollup": "^3.12.0", "sinon": "^7.3.2", - "vinyl-buffer": "^1.0.0", - "vinyl-source-stream": "^2.0.0" + "source-map-support": "^0.5.21" }, "scripts": { "test": "qunit test/issues test/internal test/features", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 117d0390..3eafab1e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,6 +8,7 @@ specifiers: acorn: ^7.1.1 benchmark: ^2.1.4 c8: ^7.12.0 + esno: ^0.16.3 gl: ^5.0.3 gl-wiretap: ^0.6.2 gpu-mock.js: ^1.3.0 @@ -16,8 +17,7 @@ specifiers: read-dir-deep: ^7.0.1 rollup: ^3.12.0 sinon: ^7.3.2 - vinyl-buffer: ^1.0.0 - vinyl-source-stream: ^2.0.0 + source-map-support: ^0.5.21 dependencies: acorn: 7.4.1 @@ -32,13 +32,13 @@ devDependencies: '@rollup/plugin-terser': 0.4.0_rollup@3.12.0 benchmark: 2.1.4 c8: 7.12.0 + esno: 0.16.3 prettier: 2.8.3 qunit: 2.19.4 read-dir-deep: 7.0.1 rollup: 3.12.0 sinon: 7.5.0 - vinyl-buffer: 1.0.1 - vinyl-source-stream: 2.0.0 + source-map-support: 0.5.21 packages: @@ -46,6 +46,45 @@ packages: resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==} dev: true + /@esbuild-kit/cjs-loader/2.4.1: + resolution: {integrity: sha512-lhc/XLith28QdW0HpHZvZKkorWgmCNT7sVelMHDj3HFdTfdqkwEKvT+aXVQtNAmCC39VJhunDkWhONWB7335mg==} + dependencies: + '@esbuild-kit/core-utils': 3.0.0 + get-tsconfig: 4.3.0 + dev: true + + /@esbuild-kit/core-utils/3.0.0: + resolution: {integrity: sha512-TXmwH9EFS3DC2sI2YJWJBgHGhlteK0Xyu1VabwetMULfm3oYhbrsWV5yaSr2NTWZIgDGVLHbRf0inxbjXqAcmQ==} + dependencies: + esbuild: 0.15.18 + source-map-support: 0.5.21 + dev: true + + /@esbuild-kit/esm-loader/2.5.4: + resolution: {integrity: sha512-afmtLf6uqxD5IgwCzomtqCYIgz/sjHzCWZFvfS5+FzeYxOURPUo4QcHtqJxbxWOMOogKriZanN/1bJQE/ZL93A==} + dependencies: + '@esbuild-kit/core-utils': 3.0.0 + get-tsconfig: 4.3.0 + dev: true + + /@esbuild/android-arm/0.15.18: + resolution: {integrity: sha512-5GT+kcs2WVGjVs7+boataCkO5Fg0y4kCjzkB5bAip7H4jfnOS3dA6KPiww9W1OEKTKeAcUVhdZGvgI65OXmUnw==} + engines: {node: '>=12'} + cpu: [arm] + os: [android] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-loong64/0.15.18: + resolution: {integrity: sha512-L4jVKS82XVhw2nvzLg/19ClLWg0y27ulRwuP7lcyL6AbUWB5aPglXY3M21mauDQMDfRLs8cQmeT03r/+X3cZYQ==} + engines: {node: '>=12'} + cpu: [loong64] + os: [linux] + requiresBuild: true + dev: true + optional: true + /@gar/promisify/1.1.3: resolution: {integrity: sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw==} dev: false @@ -367,13 +406,6 @@ packages: resolution: {integrity: sha512-B9UhK0DKFZhoTFcfvAzhqsjStvGJp9vYWf3+6SNTtdSQnvIgfkHbgHrg/e4+TH71N2GDu8tpmCVoyfrL1d7ntA==} dev: false - /bl/1.2.3: - resolution: {integrity: sha512-pvcNpa0UU69UT341rO6AYy4FVAIkUHuZXRIWbq+zHnsVcRzDDjIAhGuuYoi0d//cwIwtt4pkpKycWEfjdV+vww==} - dependencies: - readable-stream: 2.3.7 - safe-buffer: 5.2.1 - dev: true - /bl/4.1.0: resolution: {integrity: sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==} dependencies: @@ -483,28 +515,6 @@ packages: wrap-ansi: 7.0.0 dev: true - /clone-buffer/1.0.0: - resolution: {integrity: sha512-KLLTJWrvwIP+OPfMn0x2PheDEP20RPUcGXj/ERegTgdmPEZylALQldygiqrPPu8P45uNuPs7ckmReLY6v/iA5g==} - engines: {node: '>= 0.10'} - dev: true - - /clone-stats/1.0.0: - resolution: {integrity: sha512-au6ydSpg6nsrigcZ4m8Bc9hxjeW+GJ8xh5G3BJCMt4WXe1H10UNaVOamqQTmrx1kjVuxAHIQSNU6hY4Nsn9/ag==} - dev: true - - /clone/2.1.2: - resolution: {integrity: sha512-3Pe/CF1Nn94hyhIYpjtiLhdCoEoz0DqQ+988E9gmeEdQZlojxnOb74wctFyuwWQHzqyf9X7C7MG8juUpqBJT8w==} - engines: {node: '>=0.8'} - dev: true - - /cloneable-readable/1.1.3: - resolution: {integrity: sha512-2EF8zTQOxYq70Y4XKtorQupqF0m49MBz2/yf5Bj+MHjvpG3Hy7sImifnqD6UA+TKYxeSV+u6qqQPawN5UvnpKQ==} - dependencies: - inherits: 2.0.4 - process-nextick-args: 2.0.1 - readable-stream: 2.3.7 - dev: true - /color-convert/2.0.1: resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} engines: {node: '>=7.0.0'} @@ -547,6 +557,7 @@ packages: /core-util-is/1.0.3: resolution: {integrity: sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==} + dev: false /cross-spawn/7.0.3: resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==} @@ -638,11 +649,228 @@ packages: resolution: {integrity: sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==} dev: false + /esbuild-android-64/0.15.18: + resolution: {integrity: sha512-wnpt3OXRhcjfIDSZu9bnzT4/TNTDsOUvip0foZOUBG7QbSt//w3QV4FInVJxNhKc/ErhUxc5z4QjHtMi7/TbgA==} + engines: {node: '>=12'} + cpu: [x64] + os: [android] + requiresBuild: true + dev: true + optional: true + + /esbuild-android-arm64/0.15.18: + resolution: {integrity: sha512-G4xu89B8FCzav9XU8EjsXacCKSG2FT7wW9J6hOc18soEHJdtWu03L3TQDGf0geNxfLTtxENKBzMSq9LlbjS8OQ==} + engines: {node: '>=12'} + cpu: [arm64] + os: [android] + requiresBuild: true + dev: true + optional: true + + /esbuild-darwin-64/0.15.18: + resolution: {integrity: sha512-2WAvs95uPnVJPuYKP0Eqx+Dl/jaYseZEUUT1sjg97TJa4oBtbAKnPnl3b5M9l51/nbx7+QAEtuummJZW0sBEmg==} + engines: {node: '>=12'} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /esbuild-darwin-arm64/0.15.18: + resolution: {integrity: sha512-tKPSxcTJ5OmNb1btVikATJ8NftlyNlc8BVNtyT/UAr62JFOhwHlnoPrhYWz09akBLHI9nElFVfWSTSRsrZiDUA==} + engines: {node: '>=12'} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /esbuild-freebsd-64/0.15.18: + resolution: {integrity: sha512-TT3uBUxkteAjR1QbsmvSsjpKjOX6UkCstr8nMr+q7zi3NuZ1oIpa8U41Y8I8dJH2fJgdC3Dj3CXO5biLQpfdZA==} + engines: {node: '>=12'} + cpu: [x64] + os: [freebsd] + requiresBuild: true + dev: true + optional: true + + /esbuild-freebsd-arm64/0.15.18: + resolution: {integrity: sha512-R/oVr+X3Tkh+S0+tL41wRMbdWtpWB8hEAMsOXDumSSa6qJR89U0S/PpLXrGF7Wk/JykfpWNokERUpCeHDl47wA==} + engines: {node: '>=12'} + cpu: [arm64] + os: [freebsd] + requiresBuild: true + dev: true + optional: true + + /esbuild-linux-32/0.15.18: + resolution: {integrity: sha512-lphF3HiCSYtaa9p1DtXndiQEeQDKPl9eN/XNoBf2amEghugNuqXNZA/ZovthNE2aa4EN43WroO0B85xVSjYkbg==} + engines: {node: '>=12'} + cpu: [ia32] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /esbuild-linux-64/0.15.18: + resolution: {integrity: sha512-hNSeP97IviD7oxLKFuii5sDPJ+QHeiFTFLoLm7NZQligur8poNOWGIgpQ7Qf8Balb69hptMZzyOBIPtY09GZYw==} + engines: {node: '>=12'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /esbuild-linux-arm/0.15.18: + resolution: {integrity: sha512-UH779gstRblS4aoS2qpMl3wjg7U0j+ygu3GjIeTonCcN79ZvpPee12Qun3vcdxX+37O5LFxz39XeW2I9bybMVA==} + engines: {node: '>=12'} + cpu: [arm] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /esbuild-linux-arm64/0.15.18: + resolution: {integrity: sha512-54qr8kg/6ilcxd+0V3h9rjT4qmjc0CccMVWrjOEM/pEcUzt8X62HfBSeZfT2ECpM7104mk4yfQXkosY8Quptug==} + engines: {node: '>=12'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /esbuild-linux-mips64le/0.15.18: + resolution: {integrity: sha512-Mk6Ppwzzz3YbMl/ZZL2P0q1tnYqh/trYZ1VfNP47C31yT0K8t9s7Z077QrDA/guU60tGNp2GOwCQnp+DYv7bxQ==} + engines: {node: '>=12'} + cpu: [mips64el] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /esbuild-linux-ppc64le/0.15.18: + resolution: {integrity: sha512-b0XkN4pL9WUulPTa/VKHx2wLCgvIAbgwABGnKMY19WhKZPT+8BxhZdqz6EgkqCLld7X5qiCY2F/bfpUUlnFZ9w==} + engines: {node: '>=12'} + cpu: [ppc64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /esbuild-linux-riscv64/0.15.18: + resolution: {integrity: sha512-ba2COaoF5wL6VLZWn04k+ACZjZ6NYniMSQStodFKH/Pu6RxzQqzsmjR1t9QC89VYJxBeyVPTaHuBMCejl3O/xg==} + engines: {node: '>=12'} + cpu: [riscv64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /esbuild-linux-s390x/0.15.18: + resolution: {integrity: sha512-VbpGuXEl5FCs1wDVp93O8UIzl3ZrglgnSQ+Hu79g7hZu6te6/YHgVJxCM2SqfIila0J3k0csfnf8VD2W7u2kzQ==} + engines: {node: '>=12'} + cpu: [s390x] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /esbuild-netbsd-64/0.15.18: + resolution: {integrity: sha512-98ukeCdvdX7wr1vUYQzKo4kQ0N2p27H7I11maINv73fVEXt2kyh4K4m9f35U1K43Xc2QGXlzAw0K9yoU7JUjOg==} + engines: {node: '>=12'} + cpu: [x64] + os: [netbsd] + requiresBuild: true + dev: true + optional: true + + /esbuild-openbsd-64/0.15.18: + resolution: {integrity: sha512-yK5NCcH31Uae076AyQAXeJzt/vxIo9+omZRKj1pauhk3ITuADzuOx5N2fdHrAKPxN+zH3w96uFKlY7yIn490xQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [openbsd] + requiresBuild: true + dev: true + optional: true + + /esbuild-sunos-64/0.15.18: + resolution: {integrity: sha512-On22LLFlBeLNj/YF3FT+cXcyKPEI263nflYlAhz5crxtp3yRG1Ugfr7ITyxmCmjm4vbN/dGrb/B7w7U8yJR9yw==} + engines: {node: '>=12'} + cpu: [x64] + os: [sunos] + requiresBuild: true + dev: true + optional: true + + /esbuild-windows-32/0.15.18: + resolution: {integrity: sha512-o+eyLu2MjVny/nt+E0uPnBxYuJHBvho8vWsC2lV61A7wwTWC3jkN2w36jtA+yv1UgYkHRihPuQsL23hsCYGcOQ==} + engines: {node: '>=12'} + cpu: [ia32] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /esbuild-windows-64/0.15.18: + resolution: {integrity: sha512-qinug1iTTaIIrCorAUjR0fcBk24fjzEedFYhhispP8Oc7SFvs+XeW3YpAKiKp8dRpizl4YYAhxMjlftAMJiaUw==} + engines: {node: '>=12'} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /esbuild-windows-arm64/0.15.18: + resolution: {integrity: sha512-q9bsYzegpZcLziq0zgUi5KqGVtfhjxGbnksaBFYmWLxeV/S1fK4OLdq2DFYnXcLMjlZw2L0jLsk1eGoB522WXQ==} + engines: {node: '>=12'} + cpu: [arm64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /esbuild/0.15.18: + resolution: {integrity: sha512-x/R72SmW3sSFRm5zrrIjAhCeQSAWoni3CmHEqfQrZIQTM3lVCdehdwuIqaOtfC2slvpdlLa62GYoN8SxT23m6Q==} + engines: {node: '>=12'} + hasBin: true + requiresBuild: true + optionalDependencies: + '@esbuild/android-arm': 0.15.18 + '@esbuild/linux-loong64': 0.15.18 + esbuild-android-64: 0.15.18 + esbuild-android-arm64: 0.15.18 + esbuild-darwin-64: 0.15.18 + esbuild-darwin-arm64: 0.15.18 + esbuild-freebsd-64: 0.15.18 + esbuild-freebsd-arm64: 0.15.18 + esbuild-linux-32: 0.15.18 + esbuild-linux-64: 0.15.18 + esbuild-linux-arm: 0.15.18 + esbuild-linux-arm64: 0.15.18 + esbuild-linux-mips64le: 0.15.18 + esbuild-linux-ppc64le: 0.15.18 + esbuild-linux-riscv64: 0.15.18 + esbuild-linux-s390x: 0.15.18 + esbuild-netbsd-64: 0.15.18 + esbuild-openbsd-64: 0.15.18 + esbuild-sunos-64: 0.15.18 + esbuild-windows-32: 0.15.18 + esbuild-windows-64: 0.15.18 + esbuild-windows-arm64: 0.15.18 + dev: true + /escalade/3.1.1: resolution: {integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==} engines: {node: '>=6'} dev: true + /esno/0.16.3: + resolution: {integrity: sha512-6slSBEV1lMKcX13DBifvnDFpNno5WXhw4j/ff7RI0y51BZiDqEe5dNhhjhIQ3iCOQuzsm2MbVzmwqbN78BBhPg==} + hasBin: true + dependencies: + tsx: 3.12.2 + dev: true + /estree-walker/2.0.2: resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} dev: true @@ -741,6 +969,10 @@ packages: engines: {node: 6.* || 8.* || >= 10.*} dev: true + /get-tsconfig/4.3.0: + resolution: {integrity: sha512-YCcF28IqSay3fqpIu5y3Krg/utCBHBeoflkZyHj/QcqI2nrLPC3ZegS9CmIo+hJb8K7aiGsuUl7PwWVjNG2HQQ==} + dev: true + /github-from-package/0.0.0: resolution: {integrity: sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==} dev: false @@ -1003,10 +1235,6 @@ packages: /isarray/0.0.1: resolution: {integrity: sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==} - /isarray/1.0.0: - resolution: {integrity: sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==} - dev: true - /isexe/2.0.0: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} @@ -1386,10 +1614,6 @@ packages: hasBin: true dev: true - /process-nextick-args/2.0.1: - resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==} - dev: true - /promise-inflight/1.0.1: resolution: {integrity: sha512-6zWPyEOFaQBJYcGMHBKTKJ3u6TBsnMFOIZSa6ce1e/ZrrsOlnHRHbabMjLiBYKp+n44X9eUI6VUPaukCXHuG4g==} peerDependencies: @@ -1464,18 +1688,6 @@ packages: string_decoder: 0.10.31 dev: false - /readable-stream/2.3.7: - resolution: {integrity: sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==} - dependencies: - core-util-is: 1.0.3 - inherits: 2.0.4 - isarray: 1.0.0 - process-nextick-args: 2.0.1 - safe-buffer: 5.1.2 - string_decoder: 1.1.1 - util-deprecate: 1.0.2 - dev: true - /readable-stream/3.6.0: resolution: {integrity: sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==} engines: {node: '>= 6'} @@ -1485,15 +1697,6 @@ packages: util-deprecate: 1.0.2 dev: false - /remove-trailing-separator/1.1.0: - resolution: {integrity: sha512-/hS+Y0u3aOfIETiaiirUFwDBDzmXPvO+jAfKTitUngIPzdKc6Z0LoFjM/CK5PL4C+eKwHohlHAb6H0VFfmmUsw==} - dev: true - - /replace-ext/1.0.1: - resolution: {integrity: sha512-yD5BHCe7quCgBph4rMQ+0KkIRKwWCrHDOX1p1Gp6HwjPM5kVoCdKGNhN7ydqqsX6lJEnQDKZ/tFMiEdQ1dvPEw==} - engines: {node: '>= 0.10'} - dev: true - /require-directory/2.1.1: resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} engines: {node: '>=0.10.0'} @@ -1538,10 +1741,6 @@ packages: queue-microtask: 1.2.3 dev: true - /safe-buffer/5.1.2: - resolution: {integrity: sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==} - dev: true - /safe-buffer/5.2.1: resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} @@ -1676,12 +1875,6 @@ packages: resolution: {integrity: sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==} dev: false - /string_decoder/1.1.1: - resolution: {integrity: sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==} - dependencies: - safe-buffer: 5.1.2 - dev: true - /string_decoder/1.3.0: resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} dependencies: @@ -1777,13 +1970,6 @@ packages: xtend: 4.0.2 dev: false - /through2/2.0.5: - resolution: {integrity: sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==} - dependencies: - readable-stream: 2.3.7 - xtend: 4.0.2 - dev: true - /tiny-glob/0.2.9: resolution: {integrity: sha512-g/55ssRPUjShh+xkfx9UPDXqhckHEsHr4Vd9zX55oSdGZc/MD0m3sferOkwWtp98bv+kcVfEHtRJgBVJzelrzg==} dependencies: @@ -1798,6 +1984,17 @@ packages: is-number: 7.0.0 dev: true + /tsx/3.12.2: + resolution: {integrity: sha512-ykAEkoBg30RXxeOMVeZwar+JH632dZn9EUJVyJwhfag62k6UO/dIyJEV58YuLF6e5BTdV/qmbQrpkWqjq9cUnQ==} + hasBin: true + dependencies: + '@esbuild-kit/cjs-loader': 2.4.1 + '@esbuild-kit/core-utils': 3.0.0 + '@esbuild-kit/esm-loader': 2.5.4 + optionalDependencies: + fsevents: 2.3.2 + dev: true + /tunnel-agent/0.6.0: resolution: {integrity: sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==} dependencies: @@ -1825,6 +2022,7 @@ packages: /util-deprecate/1.0.2: resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} + dev: false /v8-to-istanbul/9.0.1: resolution: {integrity: sha512-74Y4LqY74kLE6IFyIjPtkSTWzUZmj8tdHT9Ii/26dvQ6K9Dl2NbEfj0XgU2sHCtKgt5VupqhlO/5aWuqS+IY1w==} @@ -1835,32 +2033,6 @@ packages: convert-source-map: 1.9.0 dev: true - /vinyl-buffer/1.0.1: - resolution: {integrity: sha512-LRBE2/g3C1hSHL2k/FynSZcVTRhEw8sb08oKGt/0hukZXwrh2m8nfy+r5yLhGEk7eFFuclhyIuPct/Bxlxk6rg==} - dependencies: - bl: 1.2.3 - through2: 2.0.5 - dev: true - - /vinyl-source-stream/2.0.0: - resolution: {integrity: sha512-Y5f1wRGajOfYukhv8biIGA7iZiY8UOIc3zJ6zcUNIbRG1BVuXzBsfSfe7MUJTttVkuy64k/pGQtJdd/aIt+hbw==} - dependencies: - through2: 2.0.5 - vinyl: 2.2.1 - dev: true - - /vinyl/2.2.1: - resolution: {integrity: sha512-LII3bXRFBZLlezoG5FfZVcXflZgWP/4dCwKtxd5ky9+LOtM4CS3bIRQsmR1KMnMW07jpE8fqR2lcxPZ+8sJIcw==} - engines: {node: '>= 0.10'} - dependencies: - clone: 2.1.2 - clone-buffer: 1.0.0 - clone-stats: 1.0.0 - cloneable-readable: 1.1.3 - remove-trailing-separator: 1.1.0 - replace-ext: 1.0.1 - dev: true - /which/2.0.2: resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} engines: {node: '>= 8'} @@ -1889,6 +2061,7 @@ packages: /xtend/4.0.2: resolution: {integrity: sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==} engines: {node: '>=0.4'} + dev: false /y18n/5.0.8: resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} diff --git a/rollup.config.js b/rollup.config.js index 67f11f65..c7f23d92 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,5 +1,4 @@ import { defineConfig } from 'rollup'; -import replace from '@rollup/plugin-replace'; import resolve from '@rollup/plugin-node-resolve'; import commonjs from '@rollup/plugin-commonjs'; import terser from '@rollup/plugin-terser'; @@ -22,42 +21,52 @@ const banner = `/** * Copyright (c) ${new Date().getFullYear()} gpu.js Team */`; +function createOutput(name, format, opts, minify = false) { + return { + banner, + file: `dist/${name}${minify ? '.min' : ''}.js`, + format, + plugins: minify ? [terser()] : [], + sourcemap: true, + ...opts, + }; +} + function buildBrowser(isCore) { - function makeOutput(minify) { - const coreExt = isCore ? '-core' : ''; - const ext = minify ? '.min.js' : '.js'; - return { - banner, - file: './dist/gpu-browser' + coreExt + ext, - name: 'GPU', - format: 'umd', - plugins: minify ? [terser()] : [], - sourcemap: true, - globals: { - acorn: 'acorn', - }, - }; - } + const id = isCore ? 'gpu-browser-core' : 'gpu-browser'; + const options = isCore ? { name: 'GPU', globals: { acorn: 'acorn' } } : { name: 'GPU' }; return defineConfig({ input: './src/browser.js', - plugins: [ - resolve(), - commonjs(), - replace({ - 'process.version': false, - preventAssignment: true, - }), + plugins: [resolve(), commonjs()], + output: [ + createOutput(id, 'umd', options), + createOutput(id, 'umd', options, true), + createOutput(id + '.esm', 'esm'), ], - output: [makeOutput(false), makeOutput(true)], onwarn(msg, warn) { if (!/Circular/.test(msg)) { warn(msg); } }, - external: isCore ? ['acron'] : [], + external: isCore ? ['acorn'] : [], + }); +} + +function buildNode() { + return defineConfig({ + input: './src/index.js', + plugins: [resolve(), commonjs()], + output: [createOutput('gpu-node', 'cjs'), createOutput('gpu-node.esm', 'esm')], + onwarn(msg, warn) { + if (!/Circular/.test(msg)) { + warn(msg); + } + }, + + external: Object.keys(pkg.dependencies).filter(v => v !== 'gpu-mock.js'), }); } -export default [buildBrowser(true), buildBrowser(false)]; +export default [buildBrowser(true), buildBrowser(false), buildNode()]; From 32b0c35854b0a6c39c5434d6203f3b7378da988d Mon Sep 17 00:00:00 2001 From: 17097231932 <17097231932@163.com> Date: Sun, 29 Jan 2023 14:18:55 +0800 Subject: [PATCH 08/11] change code style for better reading experience --- .prettierrc | 2 +- rollup.config.js | 9 +- scripts/build-tests.js | 3 +- src/alias.js | 4 +- src/backend/cpu/function-node.js | 53 +- src/backend/cpu/kernel-string.js | 200 +++-- src/backend/cpu/kernel.js | 202 ++++- src/backend/function-builder.js | 146 +++- src/backend/function-node.js | 268 +++++- src/backend/function-tracer.js | 27 +- src/backend/gl/kernel-string.js | 238 ++++-- src/backend/gl/kernel.js | 249 +++++- src/backend/gl/texture/array-2-float-2d.js | 6 +- src/backend/gl/texture/array-2-float-3d.js | 7 +- src/backend/gl/texture/array-2-float.js | 6 +- src/backend/gl/texture/array-3-float-2d.js | 6 +- src/backend/gl/texture/array-3-float-3d.js | 7 +- src/backend/gl/texture/array-4-float-2d.js | 6 +- src/backend/gl/texture/array-4-float-3d.js | 7 +- src/backend/gl/texture/float-2d.js | 6 +- src/backend/gl/texture/float-3d.js | 7 +- src/backend/gl/texture/float.js | 8 +- src/backend/gl/texture/index.js | 57 +- src/backend/gl/texture/memory-optimized-2d.js | 6 +- src/backend/gl/texture/memory-optimized-3d.js | 7 +- src/backend/gl/texture/memory-optimized.js | 5 +- src/backend/gl/texture/unsigned-2d.js | 6 +- src/backend/gl/texture/unsigned-3d.js | 7 +- src/backend/gl/texture/unsigned.js | 18 +- src/backend/headless-gl/kernel.js | 60 +- src/backend/kernel-value.js | 22 +- src/backend/kernel.js | 76 +- src/backend/web-gl/function-node.js | 231 ++++-- src/backend/web-gl/kernel-value-maps.js | 12 +- src/backend/web-gl/kernel-value/array.js | 12 +- .../web-gl/kernel-value/dynamic-html-image.js | 6 +- ...dynamic-memory-optimized-number-texture.js | 6 +- .../kernel-value/dynamic-number-texture.js | 6 +- .../kernel-value/dynamic-single-array.js | 14 +- .../kernel-value/dynamic-single-array1d-i.js | 6 +- .../kernel-value/dynamic-single-array2d-i.js | 6 +- .../kernel-value/dynamic-single-array3d-i.js | 6 +- .../kernel-value/dynamic-single-input.js | 14 +- .../kernel-value/dynamic-unsigned-array.js | 14 +- .../kernel-value/dynamic-unsigned-input.js | 14 +- src/backend/web-gl/kernel-value/html-image.js | 15 +- src/backend/web-gl/kernel-value/index.js | 13 +- .../memory-optimized-number-texture.js | 15 +- .../web-gl/kernel-value/number-texture.js | 15 +- .../web-gl/kernel-value/single-array.js | 31 +- .../web-gl/kernel-value/single-array1d-i.js | 31 +- .../web-gl/kernel-value/single-array2d-i.js | 37 +- .../web-gl/kernel-value/single-array3d-i.js | 37 +- .../web-gl/kernel-value/single-input.js | 31 +- .../web-gl/kernel-value/unsigned-array.js | 32 +- .../web-gl/kernel-value/unsigned-input.js | 32 +- src/backend/web-gl/kernel.js | 508 ++++++++++-- src/backend/web-gl2/function-node.js | 5 +- src/backend/web-gl2/kernel-value-maps.js | 12 +- .../kernel-value/dynamic-html-image-array.js | 6 +- .../kernel-value/dynamic-html-image.js | 6 +- ...dynamic-memory-optimized-number-texture.js | 6 +- .../kernel-value/dynamic-number-texture.js | 6 +- .../kernel-value/dynamic-single-array.js | 14 +- .../kernel-value/dynamic-single-array1d-i.js | 6 +- .../kernel-value/dynamic-single-array2d-i.js | 6 +- .../kernel-value/dynamic-single-array3d-i.js | 6 +- .../kernel-value/dynamic-single-input.js | 14 +- .../kernel-value/dynamic-unsigned-array.js | 6 +- .../kernel-value/dynamic-unsigned-input.js | 6 +- .../web-gl2/kernel-value/html-image-array.js | 33 +- .../web-gl2/kernel-value/html-image.js | 6 +- src/backend/web-gl2/kernel-value/integer.js | 4 +- .../memory-optimized-number-texture.js | 6 +- .../web-gl2/kernel-value/number-texture.js | 6 +- .../web-gl2/kernel-value/single-array.js | 18 +- .../web-gl2/kernel-value/single-array1d-i.js | 12 +- .../web-gl2/kernel-value/single-array2d-i.js | 12 +- .../web-gl2/kernel-value/single-array3d-i.js | 12 +- .../web-gl2/kernel-value/single-input.js | 18 +- .../web-gl2/kernel-value/unsigned-array.js | 6 +- .../web-gl2/kernel-value/unsigned-input.js | 6 +- src/backend/web-gl2/kernel.js | 272 ++++-- src/gpu.js | 119 ++- src/index.d.ts | 270 +++++- src/input.js | 25 +- src/kernel-run-shortcut.js | 11 +- src/texture.js | 12 +- src/utils.js | 188 ++++- test/all-template.html | 3 +- test/all.html | 783 ++++++++++++++---- test/browser-test-utils.js | 11 +- test/features/add-custom-function.js | 108 ++- test/features/add-custom-native-function.js | 99 ++- test/features/argument-array-types.js | 244 ++++-- test/features/argument-array1d-types.js | 234 ++++-- test/features/argument-array2d-types.js | 328 +++++--- test/features/argument-array3d-types.js | 244 ++++-- test/features/arithmetic-operators.js | 18 +- test/features/assignment-operators.js | 9 +- test/features/bitwise-operators.js | 504 +++++++---- test/features/canvas.js | 43 +- test/features/clear-textures.js | 45 +- test/features/clone-textures.js | 142 +++- test/features/combine-kernels.js | 154 ++-- test/features/constants-array.js | 6 +- test/features/constants-canvas.js | 8 +- test/features/constants-float.js | 4 +- test/features/constants-image-array.js | 30 +- test/features/constants-image.js | 18 +- test/features/constants-texture.js | 9 +- test/features/cpu-with-textures.js | 318 ++++--- test/features/create-kernel-map.js | 238 ++++-- test/features/destroy.js | 9 +- test/features/destructured-assignment.js | 10 +- test/features/dev-mode.js | 23 +- test/features/dynamic-arguments.js | 647 +++++++++++---- test/features/dynamic-output.js | 430 +++++++--- test/features/function-return.js | 92 +- test/features/get-pixels.js | 72 +- test/features/if-else.js | 12 +- test/features/image.js | 18 +- test/features/infinity.js | 72 +- test/features/input.js | 51 +- test/features/legacy-encoder.js | 177 ++-- test/features/loops.js | 20 +- test/features/math-object.js | 82 +- test/features/nested-function.js | 9 +- test/features/offscreen-canvas.js | 27 +- test/features/optimize-float-memory.js | 366 +++++--- test/features/output.js | 78 +- test/features/raw-output.js | 81 +- test/features/read-color-texture.js | 7 +- test/features/read-from-texture.js | 8 +- test/features/read-image-bitmap.js | 36 +- test/features/read-image-data.js | 31 +- test/features/read-offscreen-canvas.js | 45 +- test/features/return-arrays.js | 576 ++++++++----- test/features/single-precision-textures.js | 698 +++++++++++----- test/features/single-precision.js | 9 +- test/features/ternary.js | 9 +- test/features/to-string/as-file.js | 18 +- .../precision/single/arguments/array.js | 39 +- .../precision/single/arguments/array2.js | 35 +- .../precision/single/arguments/array2d.js | 35 +- .../precision/single/arguments/array2d2.js | 35 +- .../precision/single/arguments/array2d3.js | 35 +- .../precision/single/arguments/array3.js | 35 +- .../precision/single/arguments/array3d.js | 35 +- .../precision/single/arguments/array4.js | 35 +- .../precision/single/arguments/boolean.js | 35 +- .../precision/single/arguments/float.js | 35 +- .../precision/single/arguments/html-canvas.js | 18 +- .../single/arguments/html-image-array.js | 35 +- .../precision/single/arguments/html-image.js | 72 +- .../precision/single/arguments/input.js | 35 +- .../precision/single/arguments/integer.js | 35 +- .../memory-optimized-number-texture.js | 39 +- .../single/arguments/number-texture.js | 35 +- .../precision/single/constants/array.js | 35 +- .../precision/single/constants/array2.js | 35 +- .../precision/single/constants/array2d.js | 35 +- .../precision/single/constants/array3.js | 35 +- .../precision/single/constants/array3d.js | 35 +- .../precision/single/constants/array4.js | 35 +- .../precision/single/constants/boolean.js | 35 +- .../precision/single/constants/float.js | 35 +- .../precision/single/constants/html-canvas.js | 18 +- .../single/constants/html-image-array.js | 40 +- .../precision/single/constants/html-image.js | 77 +- .../precision/single/constants/input.js | 35 +- .../precision/single/constants/integer.js | 35 +- .../memory-optimized-number-texture.js | 49 +- .../single/constants/number-texture.js | 45 +- .../to-string/precision/single/graphical.js | 40 +- .../single/kernel-map/array/array.js | 39 +- .../single/kernel-map/array/array2d.js | 39 +- .../single/kernel-map/array/array3d.js | 39 +- .../array/memory-optimized-number-texture.js | 39 +- .../single/kernel-map/array/number-texture.js | 39 +- .../single/kernel-map/object/array.js | 35 +- .../single/kernel-map/object/array2d.js | 35 +- .../single/kernel-map/object/array3d.js | 35 +- .../object/memory-optimized-number-texture.js | 39 +- .../kernel-map/object/number-texture.js | 39 +- .../precision/single/returns/array.js | 35 +- .../precision/single/returns/array2d.js | 40 +- .../precision/single/returns/array3d.js | 41 +- .../precision/single/returns/texture.js | 35 +- .../unsigned/arguments/html-canvas.js | 18 +- .../unsigned/arguments/html-image-array.js | 7 +- .../unsigned/arguments/html-image.js | 54 +- .../memory-optimized-number-texture.js | 4 +- .../unsigned/constants/html-canvas.js | 18 +- .../unsigned/constants/html-image-array.js | 7 +- .../unsigned/constants/html-image.js | 64 +- .../memory-optimized-number-texture.js | 14 +- .../unsigned/constants/number-texture.js | 10 +- .../to-string/precision/unsigned/graphical.js | 5 +- .../unsigned/kernel-map/array/array.js | 4 +- .../unsigned/kernel-map/array/array2d.js | 4 +- .../unsigned/kernel-map/array/array3d.js | 4 +- .../array/memory-optimized-number-texture.js | 4 +- .../kernel-map/array/number-texture.js | 4 +- .../object/memory-optimized-number-texture.js | 4 +- .../kernel-map/object/number-texture.js | 4 +- .../precision/unsigned/returns/array2d.js | 5 +- .../precision/unsigned/returns/array3d.js | 6 +- .../precision/unsigned/returns/texture.js | 35 +- test/features/type-management.js | 33 +- test/features/unsigned-precision-textures.js | 427 +++++++--- test/features/video.js | 35 +- test/index.js | 10 +- test/internal/argument-texture-switching.js | 604 +++++++++----- test/internal/backend/gl-kernel.js | 107 ++- .../backend/headless-gl/kernel/index.js | 31 +- .../function-node/astBinaryExpression.js | 212 ++++- .../web-gl/function-node/astCallExpression.js | 146 ++-- .../web-gl/function-node/astForStatement.js | 162 +++- .../function-node/astVariableDeclaration.js | 145 +++- .../backend/web-gl/function-node/contexts.js | 8 +- .../firstAvailableTypeFromAst.js | 66 +- .../function-node/getVariableSignature.js | 15 +- .../web-gl/function-node/getVariableType.js | 40 +- ...dynamic-memory-optimized-number-texture.js | 88 +- .../kernel-value/dynamic-single-array3d-i.js | 48 +- .../memory-optimized-number-texture.js | 61 +- test/internal/backend/web-gl/kernel/index.js | 37 +- .../backend/web-gl/kernel/setupArguments.js | 247 ++++-- .../backend/web-gl/kernel/setupConstants.js | 247 ++++-- .../kernel-value/dynamic-html-image-array.js | 71 +- .../web-gl2/kernel-value/html-image-array.js | 69 +- test/internal/backend/web-gl2/kernel/index.js | 37 +- .../backend/web-gl2/kernel/setupArguments.js | 252 ++++-- .../backend/web-gl2/kernel/setupConstants.js | 252 ++++-- test/internal/boolean.js | 63 +- test/internal/casting.js | 144 ++-- test/internal/constants-texture-switching.js | 498 +++++++---- test/internal/context-inheritance.js | 7 +- test/internal/deep-types.js | 470 ++++++++--- test/internal/different-texture-cloning.js | 26 +- test/internal/function-builder.js | 142 +++- test/internal/function-composition.js | 113 ++- test/internal/function-node.js | 76 +- .../function-return-type-detection.js | 36 +- test/internal/function-tracer.js | 49 +- test/internal/implied-else.js | 36 +- test/internal/kernel-run-shortcut.js | 27 +- test/internal/kernel.js | 68 +- test/internal/loop-int.js | 188 +++-- test/internal/loop-max.js | 28 +- test/internal/math.random.js | 34 +- test/internal/matrix-multiply-precision.js | 135 ++- test/internal/mixed-memory-optimize.js | 84 +- test/internal/modes.js | 8 +- test/internal/precision.js | 45 +- test/internal/recycling.js | 588 +++++++++---- test/internal/texture-index.js | 162 ++-- test/internal/underscores.js | 27 +- test/internal/utils.js | 235 +++++- .../114-create-kernel-map-run-second-time.js | 45 +- test/issues/116-multiple-kernels-run-again.js | 45 +- test/issues/130-typed-array.js | 20 +- test/issues/147-missing-constant.js | 27 +- test/issues/152-for-vars.js | 9 +- test/issues/159-3d.js | 9 +- test/issues/174-webgl-context-warning.js | 24 +- test/issues/195-read-from-texture2d.js | 27 +- test/issues/207-same-function-reuse.js | 32 +- test/issues/212-funky-function-support.js | 27 +- .../issues/233-kernel-map-single-precision.js | 135 ++- .../241-CPU-vs-GPU-maps-output-differently.js | 31 +- test/issues/259-atan2.js | 9 +- test/issues/263-to-string.js | 35 +- test/issues/267-immutable-sub-kernels.js | 162 ++-- test/issues/279-wrong-canvas-size.js | 80 +- test/issues/300-nested-array-index.js | 31 +- test/issues/31-nested-var-declare-test.js | 75 +- test/issues/313-variable-lookup.js | 27 +- .../314-large-input-array-addressing.js | 31 +- test/issues/346-uint8array-converted.js | 54 +- test/issues/349-division-by-factors-of-3.js | 169 ++-- test/issues/357-modulus-issue.js | 27 +- test/issues/359-addfunction-params-wrong.js | 27 +- test/issues/378-only-first-iteration.js | 32 +- test/issues/382-bad-constant.js | 22 +- test/issues/390-thread-assignment.js | 69 +- test/issues/396-combine-kernels-example.js | 6 +- test/issues/399-double-definition.js | 54 +- test/issues/401-cpu-canvas-check.js | 6 +- test/issues/422-warnings.js | 7 +- test/issues/472-compilation-issue.js | 8 +- test/issues/473-4-pixels.js | 36 +- test/issues/493-strange-literal.js | 19 +- test/issues/500-sticky-arrays.js | 6 +- test/issues/553-permanent-flip.js | 5 +- test/issues/556-minify-for-loop.js | 3 +- test/issues/560-minification-madness.js | 32 +- test/issues/586-unable-to-resize.js | 7 +- test/issues/91-create-kernel-map-array.js | 63 +- test/issues/96-param-names.js | 18 +- test/test-utils.js | 7 +- 302 files changed, 15519 insertions(+), 6147 deletions(-) diff --git a/.prettierrc b/.prettierrc index a49d667a..7460189a 100644 --- a/.prettierrc +++ b/.prettierrc @@ -5,7 +5,7 @@ "htmlWhitespaceSensitivity": "css", "insertPragma": false, "jsxSingleQuote": false, - "printWidth": 10e3, + "printWidth": 79, "proseWrap": "preserve", "quoteProps": "as-needed", "requirePragma": false, diff --git a/rollup.config.js b/rollup.config.js index c7f23d92..c72718b0 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -34,7 +34,9 @@ function createOutput(name, format, opts, minify = false) { function buildBrowser(isCore) { const id = isCore ? 'gpu-browser-core' : 'gpu-browser'; - const options = isCore ? { name: 'GPU', globals: { acorn: 'acorn' } } : { name: 'GPU' }; + const options = isCore + ? { name: 'GPU', globals: { acorn: 'acorn' } } + : { name: 'GPU' }; return defineConfig({ input: './src/browser.js', @@ -58,7 +60,10 @@ function buildNode() { return defineConfig({ input: './src/index.js', plugins: [resolve(), commonjs()], - output: [createOutput('gpu-node', 'cjs'), createOutput('gpu-node.esm', 'esm')], + output: [ + createOutput('gpu-node', 'cjs'), + createOutput('gpu-node.esm', 'esm'), + ], onwarn(msg, warn) { if (!/Circular/.test(msg)) { warn(msg); diff --git a/scripts/build-tests.js b/scripts/build-tests.js index 97fa30d9..9e86d1e8 100644 --- a/scripts/build-tests.js +++ b/scripts/build-tests.js @@ -10,7 +10,8 @@ try { } catch (e) {} const rootPath = path.resolve(process.cwd(), folder); -const warning = '\n '; +const warning = + '\n '; const tags = readDirDeepSync(rootPath, { patterns: ['**/*.js'], ignore: ['*.js'], diff --git a/src/alias.js b/src/alias.js index 6437070b..6cf284e3 100644 --- a/src/alias.js +++ b/src/alias.js @@ -8,7 +8,9 @@ import { utils } from './utils'; */ export function alias(name, source) { const fnString = source.toString(); - return new Function(`return function ${name} (${utils.getArgumentNamesFromString(fnString).join(', ')}) { + return new Function(`return function ${name} (${utils + .getArgumentNamesFromString(fnString) + .join(', ')}) { ${utils.getFunctionBodyFromString(fnString)} }`)(); } diff --git a/src/backend/cpu/function-node.js b/src/backend/cpu/function-node.js index 26508839..d1f94c55 100644 --- a/src/backend/cpu/function-node.js +++ b/src/backend/cpu/function-node.js @@ -89,7 +89,10 @@ export class CPUFunctionNode extends FunctionNode { astLiteral(ast, retArr) { // Reject non numeric literals if (isNaN(ast.value)) { - throw this.astErrorOutput('Non-numeric literal not supported : ' + ast.value, ast); + throw this.astErrorOutput( + 'Non-numeric literal not supported : ' + ast.value, + ast + ); } retArr.push(ast.value); @@ -120,7 +123,10 @@ export class CPUFunctionNode extends FunctionNode { */ astIdentifierExpression(idtNode, retArr) { if (idtNode.type !== 'Identifier') { - throw this.astErrorOutput('IdentifierExpression - not an Identifier', idtNode); + throw this.astErrorOutput( + 'IdentifierExpression - not an Identifier', + idtNode + ); } switch (idtNode.name) { @@ -192,7 +198,11 @@ export class CPUFunctionNode extends FunctionNode { } if (isSafe) { - retArr.push(`for (${initArr.join('')};${testArr.join('')};${updateArr.join('')}){\n`); + retArr.push( + `for (${initArr.join('')};${testArr.join('')};${updateArr.join( + '' + )}){\n` + ); retArr.push(bodyArr.join('')); retArr.push('}\n'); } else { @@ -200,7 +210,9 @@ export class CPUFunctionNode extends FunctionNode { if (initArr.length > 0) { retArr.push(initArr.join(''), ';\n'); } - retArr.push(`for (let ${iVariableName}=0;${iVariableName} 0) { retArr.push(`if (!${testArr.join('')}) break;\n`); } @@ -267,7 +279,10 @@ export class CPUFunctionNode extends FunctionNode { astAssignmentExpression(assNode, retArr) { const declaration = this.getDeclaration(assNode.left); if (declaration && !declaration.assignable) { - throw this.astErrorOutput(`Variable ${assNode.left.name} is not assignable here`, assNode); + throw this.astErrorOutput( + `Variable ${assNode.left.name} is not assignable here`, + assNode + ); } this.astGeneric(assNode.left, retArr); retArr.push(assNode.operator); @@ -344,7 +359,10 @@ export class CPUFunctionNode extends FunctionNode { if (ifNode.alternate) { retArr.push('else '); - if (ifNode.alternate.type === 'BlockStatement' || ifNode.alternate.type === 'IfStatement') { + if ( + ifNode.alternate.type === 'BlockStatement' || + ifNode.alternate.type === 'IfStatement' + ) { this.astGeneric(ifNode.alternate, retArr); } else { retArr.push(' {\n'); @@ -398,7 +416,16 @@ export class CPUFunctionNode extends FunctionNode { * @returns {Array} the append retArr */ astMemberExpression(mNode, retArr) { - const { signature, type, property, xProperty, yProperty, zProperty, name, origin } = this.getMemberExpressionDetails(mNode); + const { + signature, + type, + property, + xProperty, + yProperty, + zProperty, + name, + origin, + } = this.getMemberExpressionDetails(mNode); switch (signature) { case 'this.thread.value': retArr.push(`_this.thread.${name}`); @@ -505,14 +532,22 @@ export class CPUFunctionNode extends FunctionNode { size = isInput ? constant.size : null; } else { isInput = this.isInput(name); - size = isInput ? this.argumentSizes[this.argumentNames.indexOf(name)] : null; + size = isInput + ? this.argumentSizes[this.argumentNames.indexOf(name)] + : null; } retArr.push(`${markupName}`); if (zProperty && yProperty) { if (isInput) { retArr.push('[('); this.astGeneric(zProperty, retArr); - retArr.push(`*${this.dynamicArguments ? '(outputY * outputX)' : size[1] * size[0]})+(`); + retArr.push( + `*${ + this.dynamicArguments + ? '(outputY * outputX)' + : size[1] * size[0] + })+(` + ); this.astGeneric(yProperty, retArr); retArr.push(`*${this.dynamicArguments ? 'outputX' : size[0]})+`); this.astGeneric(xProperty, retArr); diff --git a/src/backend/cpu/kernel-string.js b/src/backend/cpu/kernel-string.js index b67f4b16..05fb31ed 100644 --- a/src/backend/cpu/kernel-string.js +++ b/src/backend/cpu/kernel-string.js @@ -19,7 +19,11 @@ function constantsToString(constants, types) { case 'Matrix(2)': case 'Matrix(3)': case 'Matrix(4)': - results.push(`${name}:new ${constant.constructor.name}(${JSON.stringify(Array.from(constant))})`); + results.push( + `${name}:new ${constant.constructor.name}(${JSON.stringify( + Array.from(constant) + )})` + ); break; } } @@ -33,53 +37,82 @@ export function cpuKernelString(cpuKernel, name) { const useFunctionKeyword = !/^function/.test(cpuKernel.color.toString()); - header.push(' const { context, canvas, constants: incomingConstants } = settings;', ` const output = new Int32Array(${JSON.stringify(Array.from(cpuKernel.output))});`, ` const _constantTypes = ${JSON.stringify(cpuKernel.constantTypes)};`, ` const _constants = ${constantsToString(cpuKernel.constants, cpuKernel.constantTypes)};`); + header.push( + ' const { context, canvas, constants: incomingConstants } = settings;', + ` const output = new Int32Array(${JSON.stringify( + Array.from(cpuKernel.output) + )});`, + ` const _constantTypes = ${JSON.stringify(cpuKernel.constantTypes)};`, + ` const _constants = ${constantsToString( + cpuKernel.constants, + cpuKernel.constantTypes + )};` + ); - thisProperties.push(' constants: _constants,', ' context,', ' output,', ' thread: {x: 0, y: 0, z: 0},'); + thisProperties.push( + ' constants: _constants,', + ' context,', + ' output,', + ' thread: {x: 0, y: 0, z: 0},' + ); if (cpuKernel.graphical) { - header.push(` const _imageData = context.createImageData(${cpuKernel.output[0]}, ${cpuKernel.output[1]});`); - header.push(` const _colorData = new Uint8ClampedArray(${cpuKernel.output[0]} * ${cpuKernel.output[1]} * 4);`); + header.push( + ` const _imageData = context.createImageData(${cpuKernel.output[0]}, ${cpuKernel.output[1]});` + ); + header.push( + ` const _colorData = new Uint8ClampedArray(${cpuKernel.output[0]} * ${cpuKernel.output[1]} * 4);` + ); - const colorFn = utils.flattenFunctionToString((useFunctionKeyword ? 'function ' : '') + cpuKernel.color.toString(), { - thisLookup: propertyName => { - switch (propertyName) { - case '_colorData': - return '_colorData'; - case '_imageData': - return '_imageData'; - case 'output': - return 'output'; - case 'thread': - return 'this.thread'; - } - return JSON.stringify(cpuKernel[propertyName]); - }, - findDependency: (object, name) => { - return null; - }, - }); + const colorFn = utils.flattenFunctionToString( + (useFunctionKeyword ? 'function ' : '') + cpuKernel.color.toString(), + { + thisLookup: propertyName => { + switch (propertyName) { + case '_colorData': + return '_colorData'; + case '_imageData': + return '_imageData'; + case 'output': + return 'output'; + case 'thread': + return 'this.thread'; + } + return JSON.stringify(cpuKernel[propertyName]); + }, + findDependency: (object, name) => { + return null; + }, + } + ); - const getPixelsFn = utils.flattenFunctionToString((useFunctionKeyword ? 'function ' : '') + cpuKernel.getPixels.toString(), { - thisLookup: propertyName => { - switch (propertyName) { - case '_colorData': - return '_colorData'; - case '_imageData': - return '_imageData'; - case 'output': - return 'output'; - case 'thread': - return 'this.thread'; - } - return JSON.stringify(cpuKernel[propertyName]); - }, - findDependency: () => { - return null; - }, - }); + const getPixelsFn = utils.flattenFunctionToString( + (useFunctionKeyword ? 'function ' : '') + cpuKernel.getPixels.toString(), + { + thisLookup: propertyName => { + switch (propertyName) { + case '_colorData': + return '_colorData'; + case '_imageData': + return '_imageData'; + case 'output': + return 'output'; + case 'thread': + return 'this.thread'; + } + return JSON.stringify(cpuKernel[propertyName]); + }, + findDependency: () => { + return null; + }, + } + ); - thisProperties.push(' _imageData,', ' _colorData,', ` color: ${colorFn},`); + thisProperties.push( + ' _imageData,', + ' _colorData,', + ` color: ${colorFn},` + ); beforeReturn.push(` kernel.getPixels = ${getPixelsFn};`); } @@ -89,42 +122,59 @@ export function cpuKernelString(cpuKernel, name) { for (let i = 0; i < constantKeys.length; i++) { constantTypes.push(cpuKernel.constantTypes[constantKeys]); } - if (cpuKernel.argumentTypes.indexOf('HTMLImageArray') !== -1 || constantTypes.indexOf('HTMLImageArray') !== -1) { - const flattenedImageTo3DArray = utils.flattenFunctionToString((useFunctionKeyword ? 'function ' : '') + cpuKernel._imageTo3DArray.toString(), { - doNotDefine: ['canvas'], - findDependency: (object, name) => { - if (object === 'this') { - return (useFunctionKeyword ? 'function ' : '') + cpuKernel[name].toString(); - } - return null; - }, - thisLookup: propertyName => { - switch (propertyName) { - case 'canvas': - return; - case 'context': - return 'context'; - } - }, - }); + if ( + cpuKernel.argumentTypes.indexOf('HTMLImageArray') !== -1 || + constantTypes.indexOf('HTMLImageArray') !== -1 + ) { + const flattenedImageTo3DArray = utils.flattenFunctionToString( + (useFunctionKeyword ? 'function ' : '') + + cpuKernel._imageTo3DArray.toString(), + { + doNotDefine: ['canvas'], + findDependency: (object, name) => { + if (object === 'this') { + return ( + (useFunctionKeyword ? 'function ' : '') + + cpuKernel[name].toString() + ); + } + return null; + }, + thisLookup: propertyName => { + switch (propertyName) { + case 'canvas': + return; + case 'context': + return 'context'; + } + }, + } + ); beforeReturn.push(flattenedImageTo3DArray); thisProperties.push(` _mediaTo2DArray,`); thisProperties.push(` _imageTo3DArray,`); - } else if (cpuKernel.argumentTypes.indexOf('HTMLImage') !== -1 || constantTypes.indexOf('HTMLImage') !== -1) { - const flattenedImageTo2DArray = utils.flattenFunctionToString((useFunctionKeyword ? 'function ' : '') + cpuKernel._mediaTo2DArray.toString(), { - findDependency: (object, name) => { - return null; - }, - thisLookup: propertyName => { - switch (propertyName) { - case 'canvas': - return 'settings.canvas'; - case 'context': - return 'settings.context'; - } - throw new Error('unhandled thisLookup'); - }, - }); + } else if ( + cpuKernel.argumentTypes.indexOf('HTMLImage') !== -1 || + constantTypes.indexOf('HTMLImage') !== -1 + ) { + const flattenedImageTo2DArray = utils.flattenFunctionToString( + (useFunctionKeyword ? 'function ' : '') + + cpuKernel._mediaTo2DArray.toString(), + { + findDependency: (object, name) => { + return null; + }, + thisLookup: propertyName => { + switch (propertyName) { + case 'canvas': + return 'settings.canvas'; + case 'context': + return 'settings.context'; + } + throw new Error('unhandled thisLookup'); + }, + } + ); beforeReturn.push(flattenedImageTo2DArray); thisProperties.push(` _mediaTo2DArray,`); } diff --git a/src/backend/cpu/kernel.js b/src/backend/cpu/kernel.js index 2b3720b5..fc0afc95 100644 --- a/src/backend/cpu/kernel.js +++ b/src/backend/cpu/kernel.js @@ -36,7 +36,9 @@ export class CPUKernel extends Kernel { } static nativeFunctionReturnType() { - throw new Error(`Looking up native function return type not supported on ${this.name}`); + throw new Error( + `Looking up native function return type not supported on ${this.name}` + ); } static combineKernels(combinedKernel) { @@ -44,7 +46,9 @@ export class CPUKernel extends Kernel { } static getSignature(kernel, argumentTypes) { - return 'cpu' + (argumentTypes.length > 0 ? ':' + argumentTypes.join(',') : ''); + return ( + 'cpu' + (argumentTypes.length > 0 ? ':' + argumentTypes.join(',') : '') + ); } constructor(source, settings) { @@ -87,16 +91,23 @@ export class CPUKernel extends Kernel { validateSettings(args) { if (!this.output || this.output.length === 0) { if (args.length !== 1) { - throw new Error('Auto output only supported for kernels with only one input'); + throw new Error( + 'Auto output only supported for kernels with only one input' + ); } const argType = utils.getVariableType(args[0], this.strictIntegers); if (argType === 'Array') { this.output = utils.getDimensions(argType); - } else if (argType === 'NumberTexture' || argType === 'ArrayTexture(4)') { + } else if ( + argType === 'NumberTexture' || + argType === 'ArrayTexture(4)' + ) { this.output = args[0].output; } else { - throw new Error('Auto output not supported for input type: ' + argType); + throw new Error( + 'Auto output not supported for input type: ' + argType + ); } } @@ -110,12 +121,17 @@ export class CPUKernel extends Kernel { } translateSource() { - this.leadingReturnStatement = this.output.length > 1 ? 'resultX[x] = ' : 'result[x] = '; + this.leadingReturnStatement = + this.output.length > 1 ? 'resultX[x] = ' : 'result[x] = '; if (this.subKernels) { const followingReturnStatement = []; for (let i = 0; i < this.subKernels.length; i++) { const { name } = this.subKernels[i]; - followingReturnStatement.push(this.output.length > 1 ? `resultX_${name}[x] = subKernelResult_${name};\n` : `result_${name}[x] = subKernelResult_${name};\n`); + followingReturnStatement.push( + this.output.length > 1 + ? `resultX_${name}[x] = subKernelResult_${name};\n` + : `result_${name}[x] = subKernelResult_${name};\n` + ); } this.followingReturnStatement = followingReturnStatement.join(''); } @@ -223,11 +239,17 @@ export class CPUKernel extends Kernel { const _this = this; ${this._resultKernelHeader()} ${this._processConstants()} - return (${this.argumentNames.map(argumentName => 'user_' + argumentName).join(', ')}) => { + return (${this.argumentNames + .map(argumentName => 'user_' + argumentName) + .join(', ')}) => { ${this._prependedString.join('')} ${this._earlyThrows()} ${this._processArguments()} - ${this.graphical ? this._graphicalKernelBody(kernelThreadString) : this._resultKernelBody(kernelThreadString)} + ${ + this.graphical + ? this._graphicalKernelBody(kernelThreadString) + : this._resultKernelBody(kernelThreadString) + } ${translatedSources.length > 0 ? translatedSources.join('\n') : ''} };`); } @@ -244,7 +266,9 @@ export class CPUKernel extends Kernel { * @returns {String} result */ _getLoopMaxString() { - return this.loopMaxIterations ? ` ${parseInt(this.loopMaxIterations)};` : ' 1000;'; + return this.loopMaxIterations + ? ` ${parseInt(this.loopMaxIterations)};` + : ' 1000;'; } _processConstants() { @@ -260,13 +284,19 @@ export class CPUKernel extends Kernel { case 'ImageBitmap': case 'ImageData': case 'HTMLVideo': - result.push(` const constants_${p} = this._mediaTo2DArray(this.constants.${p});\n`); + result.push( + ` const constants_${p} = this._mediaTo2DArray(this.constants.${p});\n` + ); break; case 'HTMLImageArray': - result.push(` const constants_${p} = this._imageTo3DArray(this.constants.${p});\n`); + result.push( + ` const constants_${p} = this._imageTo3DArray(this.constants.${p});\n` + ); break; case 'Input': - result.push(` const constants_${p} = this.constants.${p}.value;\n`); + result.push( + ` const constants_${p} = this.constants.${p}.value;\n` + ); break; default: result.push(` const constants_${p} = this.constants.${p};\n`); @@ -289,10 +319,18 @@ export class CPUKernel extends Kernel { const checks = []; for (let i = 0; i < arrayArguments.length; i++) { const argumentName = arrayArguments[i]; - const checkSubKernels = this._mapSubKernels(subKernel => `user_${argumentName} === result_${subKernel.name}`).join(' || '); - checks.push(`user_${argumentName} === result${checkSubKernels ? ` || ${checkSubKernels}` : ''}`); + const checkSubKernels = this._mapSubKernels( + subKernel => `user_${argumentName} === result_${subKernel.name}` + ).join(' || '); + checks.push( + `user_${argumentName} === result${ + checkSubKernels ? ` || ${checkSubKernels}` : '' + }` + ); } - return `if (${checks.join(' || ')}) throw new Error('Source and destination arrays are the same. Use immutable = true');`; + return `if (${checks.join( + ' || ' + )}) throw new Error('Source and destination arrays are the same. Use immutable = true');`; } _processArguments() { @@ -306,10 +344,14 @@ export class CPUKernel extends Kernel { case 'ImageBitmap': case 'ImageData': case 'HTMLVideo': - result.push(` ${variableName} = this._mediaTo2DArray(${variableName});\n`); + result.push( + ` ${variableName} = this._mediaTo2DArray(${variableName});\n` + ); break; case 'HTMLImageArray': - result.push(` ${variableName} = this._imageTo3DArray(${variableName});\n`); + result.push( + ` ${variableName} = this._imageTo3DArray(${variableName});\n` + ); break; case 'Input': result.push(` ${variableName} = ${variableName}.value;\n`); @@ -383,7 +425,9 @@ export class CPUKernel extends Kernel { getPixels(flip) { const [width, height] = this.output; // cpu is not flipped by default - return flip ? utils.flipPixels(this._imageData.data, width, height) : this._imageData.data.slice(0); + return flip + ? utils.flipPixels(this._imageData.data, width, height) + : this._imageData.data.slice(0); } _imageTo3DArray(images) { @@ -411,11 +455,26 @@ export class CPUKernel extends Kernel { _resultKernelBody(kernelString) { switch (this.output.length) { case 1: - return (!this.immutable && this.pipeline ? this._resultMutableKernel1DLoop(kernelString) : this._resultImmutableKernel1DLoop(kernelString)) + this._kernelOutput(); + return ( + (!this.immutable && this.pipeline + ? this._resultMutableKernel1DLoop(kernelString) + : this._resultImmutableKernel1DLoop(kernelString)) + + this._kernelOutput() + ); case 2: - return (!this.immutable && this.pipeline ? this._resultMutableKernel2DLoop(kernelString) : this._resultImmutableKernel2DLoop(kernelString)) + this._kernelOutput(); + return ( + (!this.immutable && this.pipeline + ? this._resultMutableKernel2DLoop(kernelString) + : this._resultImmutableKernel2DLoop(kernelString)) + + this._kernelOutput() + ); case 3: - return (!this.immutable && this.pipeline ? this._resultMutableKernel3DLoop(kernelString) : this._resultImmutableKernel3DLoop(kernelString)) + this._kernelOutput(); + return ( + (!this.immutable && this.pipeline + ? this._resultMutableKernel3DLoop(kernelString) + : this._resultImmutableKernel3DLoop(kernelString)) + + this._kernelOutput() + ); default: throw new Error('unsupported size kernel'); } @@ -424,7 +483,10 @@ export class CPUKernel extends Kernel { _graphicalKernelBody(kernelThreadString) { switch (this.output.length) { case 2: - return this._graphicalKernel2DLoop(kernelThreadString) + this._graphicalOutput(); + return ( + this._graphicalKernel2DLoop(kernelThreadString) + + this._graphicalOutput() + ); default: throw new Error('unsupported size kernel'); } @@ -460,8 +522,13 @@ export class CPUKernel extends Kernel { const constructorString = this._getKernelResultTypeConstructorString(); return ` const outputX = _this.output[0]; const result = new ${constructorString}(outputX); - ${this._mapSubKernels(subKernel => `const result_${subKernel.name} = new ${constructorString}(outputX);\n`).join(' ')} - ${this._mapSubKernels(subKernel => `let subKernelResult_${subKernel.name};\n`).join(' ')} + ${this._mapSubKernels( + subKernel => + `const result_${subKernel.name} = new ${constructorString}(outputX);\n` + ).join(' ')} + ${this._mapSubKernels( + subKernel => `let subKernelResult_${subKernel.name};\n` + ).join(' ')} for (let x = 0; x < outputX; x++) { this.thread.x = x; this.thread.y = 0; @@ -474,8 +541,13 @@ export class CPUKernel extends Kernel { const constructorString = this._getKernelResultTypeConstructorString(); return ` const outputX = _this.output[0]; const result = new ${constructorString}(outputX); - ${this._mapSubKernels(subKernel => `const result_${subKernel.name} = new ${constructorString}(outputX);\n`).join(' ')} - ${this._mapSubKernels(subKernel => `let subKernelResult_${subKernel.name};\n`).join(' ')}`; + ${this._mapSubKernels( + subKernel => + `const result_${subKernel.name} = new ${constructorString}(outputX);\n` + ).join(' ')} + ${this._mapSubKernels( + subKernel => `let subKernelResult_${subKernel.name};\n` + ).join(' ')}`; } _resultMutableKernel1DLoop(kernelString) { @@ -493,13 +565,20 @@ export class CPUKernel extends Kernel { return ` const outputX = _this.output[0]; const outputY = _this.output[1]; const result = new Array(outputY); - ${this._mapSubKernels(subKernel => `const result_${subKernel.name} = new Array(outputY);\n`).join(' ')} - ${this._mapSubKernels(subKernel => `let subKernelResult_${subKernel.name};\n`).join(' ')} + ${this._mapSubKernels( + subKernel => `const result_${subKernel.name} = new Array(outputY);\n` + ).join(' ')} + ${this._mapSubKernels( + subKernel => `let subKernelResult_${subKernel.name};\n` + ).join(' ')} for (let y = 0; y < outputY; y++) { this.thread.z = 0; this.thread.y = y; const resultX = result[y] = new ${constructorString}(outputX); - ${this._mapSubKernels(subKernel => `const resultX_${subKernel.name} = result_${subKernel.name}[y] = new ${constructorString}(outputX);\n`).join('')} + ${this._mapSubKernels( + subKernel => + `const resultX_${subKernel.name} = result_${subKernel.name}[y] = new ${constructorString}(outputX);\n` + ).join('')} for (let x = 0; x < outputX; x++) { this.thread.x = x; ${kernelString} @@ -512,11 +591,18 @@ export class CPUKernel extends Kernel { return ` const outputX = _this.output[0]; const outputY = _this.output[1]; const result = new Array(outputY); - ${this._mapSubKernels(subKernel => `const result_${subKernel.name} = new Array(outputY);\n`).join(' ')} - ${this._mapSubKernels(subKernel => `let subKernelResult_${subKernel.name};\n`).join(' ')} + ${this._mapSubKernels( + subKernel => `const result_${subKernel.name} = new Array(outputY);\n` + ).join(' ')} + ${this._mapSubKernels( + subKernel => `let subKernelResult_${subKernel.name};\n` + ).join(' ')} for (let y = 0; y < outputY; y++) { const resultX = result[y] = new ${constructorString}(outputX); - ${this._mapSubKernels(subKernel => `const resultX_${subKernel.name} = result_${subKernel.name}[y] = new ${constructorString}(outputX);\n`).join('')} + ${this._mapSubKernels( + subKernel => + `const resultX_${subKernel.name} = result_${subKernel.name}[y] = new ${constructorString}(outputX);\n` + ).join('')} }`; } @@ -528,7 +614,10 @@ export class CPUKernel extends Kernel { this.thread.z = 0; this.thread.y = y; const resultX = result[y]; - ${this._mapSubKernels(subKernel => `const resultX_${subKernel.name} = result_${subKernel.name}[y] = new ${constructorString}(outputX);\n`).join('')} + ${this._mapSubKernels( + subKernel => + `const resultX_${subKernel.name} = result_${subKernel.name}[y] = new ${constructorString}(outputX);\n` + ).join('')} for (let x = 0; x < outputX; x++) { this.thread.x = x; ${kernelString} @@ -555,16 +644,26 @@ export class CPUKernel extends Kernel { const outputY = _this.output[1]; const outputZ = _this.output[2]; const result = new Array(outputZ); - ${this._mapSubKernels(subKernel => `const result_${subKernel.name} = new Array(outputZ);\n`).join(' ')} - ${this._mapSubKernels(subKernel => `let subKernelResult_${subKernel.name};\n`).join(' ')} + ${this._mapSubKernels( + subKernel => `const result_${subKernel.name} = new Array(outputZ);\n` + ).join(' ')} + ${this._mapSubKernels( + subKernel => `let subKernelResult_${subKernel.name};\n` + ).join(' ')} for (let z = 0; z < outputZ; z++) { this.thread.z = z; const resultY = result[z] = new Array(outputY); - ${this._mapSubKernels(subKernel => `const resultY_${subKernel.name} = result_${subKernel.name}[z] = new Array(outputY);\n`).join(' ')} + ${this._mapSubKernels( + subKernel => + `const resultY_${subKernel.name} = result_${subKernel.name}[z] = new Array(outputY);\n` + ).join(' ')} for (let y = 0; y < outputY; y++) { this.thread.y = y; const resultX = resultY[y] = new ${constructorString}(outputX); - ${this._mapSubKernels(subKernel => `const resultX_${subKernel.name} = resultY_${subKernel.name}[y] = new ${constructorString}(outputX);\n`).join(' ')} + ${this._mapSubKernels( + subKernel => + `const resultX_${subKernel.name} = resultY_${subKernel.name}[y] = new ${constructorString}(outputX);\n` + ).join(' ')} for (let x = 0; x < outputX; x++) { this.thread.x = x; ${kernelString} @@ -579,14 +678,24 @@ export class CPUKernel extends Kernel { const outputY = _this.output[1]; const outputZ = _this.output[2]; const result = new Array(outputZ); - ${this._mapSubKernels(subKernel => `const result_${subKernel.name} = new Array(outputZ);\n`).join(' ')} - ${this._mapSubKernels(subKernel => `let subKernelResult_${subKernel.name};\n`).join(' ')} + ${this._mapSubKernels( + subKernel => `const result_${subKernel.name} = new Array(outputZ);\n` + ).join(' ')} + ${this._mapSubKernels( + subKernel => `let subKernelResult_${subKernel.name};\n` + ).join(' ')} for (let z = 0; z < outputZ; z++) { const resultY = result[z] = new Array(outputY); - ${this._mapSubKernels(subKernel => `const resultY_${subKernel.name} = result_${subKernel.name}[z] = new Array(outputY);\n`).join(' ')} + ${this._mapSubKernels( + subKernel => + `const resultY_${subKernel.name} = result_${subKernel.name}[z] = new Array(outputY);\n` + ).join(' ')} for (let y = 0; y < outputY; y++) { const resultX = resultY[y] = new ${constructorString}(outputX); - ${this._mapSubKernels(subKernel => `const resultX_${subKernel.name} = resultY_${subKernel.name}[y] = new ${constructorString}(outputX);\n`).join(' ')} + ${this._mapSubKernels( + subKernel => + `const resultX_${subKernel.name} = resultY_${subKernel.name}[y] = new ${constructorString}(outputX);\n` + ).join(' ')} } }`; } @@ -615,7 +724,9 @@ export class CPUKernel extends Kernel { } return `\n return { result: result, - ${this.subKernels.map(subKernel => `${subKernel.property}: result_${subKernel.name}`).join(',\n ')} + ${this.subKernels + .map(subKernel => `${subKernel.property}: result_${subKernel.name}`) + .join(',\n ')} };`; } @@ -633,7 +744,10 @@ export class CPUKernel extends Kernel { toJSON() { const json = super.toJSON(); - json.functionNodes = FunctionBuilder.fromKernel(this, CPUFunctionNode).toJSON(); + json.functionNodes = FunctionBuilder.fromKernel( + this, + CPUFunctionNode + ).toJSON(); return json; } diff --git a/src/backend/function-builder.js b/src/backend/function-builder.js index 06724d76..cdf0d990 100644 --- a/src/backend/function-builder.js +++ b/src/backend/function-builder.js @@ -13,7 +13,29 @@ export class FunctionBuilder { * @static */ static fromKernel(kernel, FunctionNode, extraNodeOptions) { - const { kernelArguments, kernelConstants, argumentNames, argumentSizes, argumentBitRatios, constants, constantBitRatios, debug, loopMaxIterations, nativeFunctions, output, optimizeFloatMemory, precision, plugins, source, subKernels, functions, leadingReturnStatement, followingReturnStatement, dynamicArguments, dynamicOutput } = kernel; + const { + kernelArguments, + kernelConstants, + argumentNames, + argumentSizes, + argumentBitRatios, + constants, + constantBitRatios, + debug, + loopMaxIterations, + nativeFunctions, + output, + optimizeFloatMemory, + precision, + plugins, + source, + subKernels, + functions, + leadingReturnStatement, + followingReturnStatement, + dynamicArguments, + dynamicOutput, + } = kernel; const argumentTypes = new Array(kernelArguments.length); const constantTypes = {}; @@ -36,7 +58,11 @@ export class FunctionBuilder { }; const lookupReturnType = (functionName, ast, requestingNode) => { - return functionBuilder.lookupReturnType(functionName, ast, requestingNode); + return functionBuilder.lookupReturnType( + functionName, + ast, + requestingNode + ); }; const lookupFunctionArgumentTypes = functionName => { @@ -44,23 +70,53 @@ export class FunctionBuilder { }; const lookupFunctionArgumentName = (functionName, argumentIndex) => { - return functionBuilder.lookupFunctionArgumentName(functionName, argumentIndex); + return functionBuilder.lookupFunctionArgumentName( + functionName, + argumentIndex + ); }; const lookupFunctionArgumentBitRatio = (functionName, argumentName) => { - return functionBuilder.lookupFunctionArgumentBitRatio(functionName, argumentName); + return functionBuilder.lookupFunctionArgumentBitRatio( + functionName, + argumentName + ); }; - const triggerImplyArgumentType = (functionName, i, argumentType, requestingNode) => { - functionBuilder.assignArgumentType(functionName, i, argumentType, requestingNode); + const triggerImplyArgumentType = ( + functionName, + i, + argumentType, + requestingNode + ) => { + functionBuilder.assignArgumentType( + functionName, + i, + argumentType, + requestingNode + ); }; - const triggerImplyArgumentBitRatio = (functionName, argumentName, calleeFunctionName, argumentIndex) => { - functionBuilder.assignArgumentBitRatio(functionName, argumentName, calleeFunctionName, argumentIndex); + const triggerImplyArgumentBitRatio = ( + functionName, + argumentName, + calleeFunctionName, + argumentIndex + ) => { + functionBuilder.assignArgumentBitRatio( + functionName, + argumentName, + calleeFunctionName, + argumentIndex + ); }; const onFunctionCall = (functionName, calleeFunctionName, args) => { - functionBuilder.trackFunctionCall(functionName, calleeFunctionName, args); + functionBuilder.trackFunctionCall( + functionName, + calleeFunctionName, + args + ); }; const onNestedFunction = (ast, source) => { @@ -130,7 +186,10 @@ export class FunctionBuilder { }); if (typeof source === 'object' && source.functionNodes) { - return new FunctionBuilder().fromJSON(source.functionNodes, FunctionNode); + return new FunctionBuilder().fromJSON( + source.functionNodes, + FunctionNode + ); } const rootNode = new FunctionNode(source, rootNodeOptions); @@ -269,7 +328,10 @@ export class FunctionBuilder { * if dependent function is already in the list, because a function depends on it, and because it has * already been traced, we know that we must move the dependent function to the end of the the retList. * */ - const dependantNativeFunctionName = retList.splice(nativeFunctionIndex, 1)[0]; + const dependantNativeFunctionName = retList.splice( + nativeFunctionIndex, + 1 + )[0]; retList.push(dependantNativeFunctionName); } return retList; @@ -318,7 +380,9 @@ export class FunctionBuilder { this.rootNode.toString(); } if (functionName) { - return this.getPrototypesFromFunctionNames(this.traceFunctionCalls(functionName, []).reverse()); + return this.getPrototypesFromFunctionNames( + this.traceFunctionCalls(functionName, []).reverse() + ); } return this.getPrototypesFromFunctionNames(Object.keys(this.functionMap)); } @@ -383,7 +447,10 @@ export class FunctionBuilder { this.functionMap = {}; for (let i = 0; i < jsonFunctionNodes.length; i++) { const jsonFunctionNode = jsonFunctionNodes[i]; - this.functionMap[jsonFunctionNode.settings.name] = new FunctionNode(jsonFunctionNode.ast, jsonFunctionNode.settings); + this.functionMap[jsonFunctionNode.settings.name] = new FunctionNode( + jsonFunctionNode.ast, + jsonFunctionNode.settings + ); } return this; } @@ -395,14 +462,18 @@ export class FunctionBuilder { */ getString(functionName) { if (functionName) { - return this.getStringFromFunctionNames(this.traceFunctionCalls(functionName).reverse()); + return this.getStringFromFunctionNames( + this.traceFunctionCalls(functionName).reverse() + ); } return this.getStringFromFunctionNames(Object.keys(this.functionMap)); } lookupReturnType(functionName, ast, requestingNode) { if (ast.type !== 'CallExpression') { - throw new Error(`expected ast type of "CallExpression", but is ${ast.type}`); + throw new Error( + `expected ast type of "CallExpression", but is ${ast.type}` + ); } if (this._isNativeFunction(functionName)) { return this._lookupNativeFunctionReturnType(functionName); @@ -467,7 +538,8 @@ export class FunctionBuilder { _getNativeFunction(functionName) { for (let i = 0; i < this.nativeFunctions.length; i++) { - if (this.nativeFunctions[i].name === functionName) return this.nativeFunctions[i]; + if (this.nativeFunctions[i].name === functionName) + return this.nativeFunctions[i]; } return null; } @@ -546,25 +618,38 @@ export class FunctionBuilder { * @param {number} argumentIndex * @return {number|null} */ - assignArgumentBitRatio(functionName, argumentName, calleeFunctionName, argumentIndex) { + assignArgumentBitRatio( + functionName, + argumentName, + calleeFunctionName, + argumentIndex + ) { const node = this._getFunction(functionName); if (this._isNativeFunction(calleeFunctionName)) return null; const calleeNode = this._getFunction(calleeFunctionName); const i = node.argumentNames.indexOf(argumentName); if (i === -1) { - throw new Error(`Argument ${argumentName} not found in arguments from function ${functionName}`); + throw new Error( + `Argument ${argumentName} not found in arguments from function ${functionName}` + ); } const bitRatio = node.argumentBitRatios[i]; if (typeof bitRatio !== 'number') { - throw new Error(`Bit ratio for argument ${argumentName} not found in function ${functionName}`); + throw new Error( + `Bit ratio for argument ${argumentName} not found in function ${functionName}` + ); } if (!calleeNode.argumentBitRatios) { - calleeNode.argumentBitRatios = new Array(calleeNode.argumentNames.length); + calleeNode.argumentBitRatios = new Array( + calleeNode.argumentNames.length + ); } const calleeBitRatio = calleeNode.argumentBitRatios[i]; if (typeof calleeBitRatio === 'number') { if (calleeBitRatio !== bitRatio) { - throw new Error(`Incompatible bit ratio found at function ${functionName} at argument ${argumentName}`); + throw new Error( + `Incompatible bit ratio found at function ${functionName} at argument ${argumentName}` + ); } return calleeBitRatio; } @@ -582,22 +667,33 @@ export class FunctionBuilder { } getKernelResultType() { - return this.rootNode.returnType || this.rootNode.getType(this.rootNode.ast); + return ( + this.rootNode.returnType || this.rootNode.getType(this.rootNode.ast) + ); } getSubKernelResultType(index) { const subKernelNode = this.subKernelNodes[index]; let called = false; - for (let functionCallIndex = 0; functionCallIndex < this.rootNode.functionCalls.length; functionCallIndex++) { + for ( + let functionCallIndex = 0; + functionCallIndex < this.rootNode.functionCalls.length; + functionCallIndex++ + ) { const functionCall = this.rootNode.functionCalls[functionCallIndex]; if (functionCall.ast.callee.name === subKernelNode.name) { called = true; } } if (!called) { - throw new Error(`SubKernel ${subKernelNode.name} never called by kernel`); + throw new Error( + `SubKernel ${subKernelNode.name} never called by kernel` + ); } - return subKernelNode.returnType || subKernelNode.getType(subKernelNode.getJsAST()); + return ( + subKernelNode.returnType || + subKernelNode.getType(subKernelNode.getJsAST()) + ); } getReturnTypes() { diff --git a/src/backend/function-node.js b/src/backend/function-node.js index 06333476..c8e2ecf5 100644 --- a/src/backend/function-node.js +++ b/src/backend/function-node.js @@ -20,7 +20,12 @@ export class FunctionNode { settings = settings || {}; this.source = source; this.ast = null; - this.name = typeof source === 'string' ? (settings.isRootKernel ? 'kernel' : settings.name || utils.getFunctionNameFromString(source)) : null; + this.name = + typeof source === 'string' + ? settings.isRootKernel + ? 'kernel' + : settings.name || utils.getFunctionNameFromString(source) + : null; this.calledFunctions = []; this.constants = {}; this.constantTypes = {}; @@ -45,7 +50,10 @@ export class FunctionNode { this.optimizeFloatMemory = null; this.precision = null; this.loopMaxIterations = null; - this.argumentNames = typeof this.source === 'string' ? utils.getArgumentNamesFromString(this.source) : null; + this.argumentNames = + typeof this.source === 'string' + ? utils.getArgumentNamesFromString(this.source) + : null; this.argumentTypes = []; this.argumentSizes = []; this.argumentBitRatios = null; @@ -87,8 +95,13 @@ export class FunctionNode { throw new Error('this.name could not be set'); } - if (this.argumentTypes.length > 0 && this.argumentTypes.length !== this.argumentNames.length) { - throw new Error(`argumentTypes count of ${this.argumentTypes.length} exceeds ${this.argumentNames.length}`); + if ( + this.argumentTypes.length > 0 && + this.argumentTypes.length !== this.argumentNames.length + ) { + throw new Error( + `argumentTypes count of ${this.argumentTypes.length} exceeds ${this.argumentNames.length}` + ); } if (this.output.length < 1) { @@ -106,7 +119,9 @@ export class FunctionNode { } isInput(argumentName) { - return this.argumentTypes[this.argumentNames.indexOf(argumentName)] === 'Input'; + return ( + this.argumentTypes[this.argumentNames.indexOf(argumentName)] === 'Input' + ); } pushState(state) { @@ -153,14 +168,22 @@ export class FunctionNode { return this.astMemberExpressionUnroll(ast.property); } - return this.astMemberExpressionUnroll(ast.object) + '.' + this.astMemberExpressionUnroll(ast.property); + return ( + this.astMemberExpressionUnroll(ast.object) + + '.' + + this.astMemberExpressionUnroll(ast.property) + ); } } //babel sniffing if (ast.hasOwnProperty('expressions')) { const firstExpression = ast.expressions[0]; - if (firstExpression.type === 'Literal' && firstExpression.value === 0 && ast.expressions.length === 2) { + if ( + firstExpression.type === 'Literal' && + firstExpression.value === 0 && + ast.expressions.length === 2 + ) { return this.astMemberExpressionUnroll(ast.expressions[1]); } } @@ -208,7 +231,8 @@ export class FunctionNode { } traceFunctionAST(ast) { - const { contexts, declarations, functions, identifiers, functionCalls } = new FunctionTracer(ast); + const { contexts, declarations, functions, identifiers, functionCalls } = + new FunctionTracer(ast); this.contexts = contexts; this.identifiers = identifiers; this.functionCalls = functionCalls; @@ -317,7 +341,9 @@ export class FunctionNode { toString() { if (this._string) return this._string; - return (this._string = this.astGeneric(this.getJsAST(), []).join('').trim()); + return (this._string = this.astGeneric(this.getJsAST(), []) + .join('') + .trim()); } toJSON() { @@ -385,15 +411,27 @@ export class FunctionNode { return 'Number'; } if (!ast.callee || !ast.callee.name) { - if (ast.callee.type === 'SequenceExpression' && ast.callee.expressions[ast.callee.expressions.length - 1].property.name) { - const functionName = ast.callee.expressions[ast.callee.expressions.length - 1].property.name; + if ( + ast.callee.type === 'SequenceExpression' && + ast.callee.expressions[ast.callee.expressions.length - 1].property + .name + ) { + const functionName = + ast.callee.expressions[ast.callee.expressions.length - 1] + .property.name; this.inferArgumentTypesIfNeeded(functionName, ast.arguments); return this.lookupReturnType(functionName, ast, this); } if (this.getVariableSignature(ast.callee, true) === 'this.color') { return null; } - if (ast.callee.type === 'MemberExpression' && ast.callee.object && ast.callee.property && ast.callee.property.name && ast.arguments) { + if ( + ast.callee.type === 'MemberExpression' && + ast.callee.object && + ast.callee.property && + ast.callee.property.name && + ast.arguments + ) { const functionName = ast.callee.property.name; this.inferArgumentTypesIfNeeded(functionName, ast.arguments); return this.lookupReturnType(functionName, ast, this); @@ -458,7 +496,10 @@ export class FunctionNode { lastType = this.getType(declaration); } if (!lastType) { - throw this.astErrorOutput(`Unable to find type for declaration`, ast); + throw this.astErrorOutput( + `Unable to find type for declaration`, + ast + ); } return lastType; } @@ -469,7 +510,10 @@ export class FunctionNode { } if (!declaration.valueType) { - throw this.astErrorOutput(`Unable to find declarator valueType`, ast); + throw this.astErrorOutput( + `Unable to find declarator valueType`, + ast + ); } return declaration.valueType; @@ -508,11 +552,17 @@ export class FunctionNode { case 'value[]': return this.getLookupType(this.getCheckVariableType(ast.object)); case 'value[][]': - return this.getLookupType(this.getCheckVariableType(ast.object.object)); + return this.getLookupType( + this.getCheckVariableType(ast.object.object) + ); case 'value[][][]': - return this.getLookupType(this.getCheckVariableType(ast.object.object.object)); + return this.getLookupType( + this.getCheckVariableType(ast.object.object.object) + ); case 'value[][][][]': - return this.getLookupType(this.getCheckVariableType(ast.object.object.object.object)); + return this.getLookupType( + this.getCheckVariableType(ast.object.object.object.object) + ); case 'value.thread.value': case 'this.thread.value': return 'Integer'; @@ -521,13 +571,23 @@ export class FunctionNode { case 'this.constants.value': return this.getConstantType(ast.property.name); case 'this.constants.value[]': - return this.getLookupType(this.getConstantType(ast.object.property.name)); + return this.getLookupType( + this.getConstantType(ast.object.property.name) + ); case 'this.constants.value[][]': - return this.getLookupType(this.getConstantType(ast.object.object.property.name)); + return this.getLookupType( + this.getConstantType(ast.object.object.property.name) + ); case 'this.constants.value[][][]': - return this.getLookupType(this.getConstantType(ast.object.object.object.property.name)); + return this.getLookupType( + this.getConstantType(ast.object.object.object.property.name) + ); case 'this.constants.value[][][][]': - return this.getLookupType(this.getConstantType(ast.object.object.object.object.property.name)); + return this.getLookupType( + this.getConstantType( + ast.object.object.object.object.property.name + ) + ); case 'fn()[]': case 'fn()[][]': case 'fn()[][][]': @@ -541,7 +601,9 @@ export class FunctionNode { case 'g': case 'b': case 'a': - return this.getLookupType(this.getCheckVariableType(ast.object)); + return this.getLookupType( + this.getCheckVariableType(ast.object) + ); } case '[][]': return 'Number'; @@ -588,13 +650,75 @@ export class FunctionNode { } isAstMathVariable(ast) { - const mathProperties = ['E', 'PI', 'SQRT2', 'SQRT1_2', 'LN2', 'LN10', 'LOG2E', 'LOG10E']; - return ast.type === 'MemberExpression' && ast.object && ast.object.type === 'Identifier' && ast.object.name === 'Math' && ast.property && ast.property.type === 'Identifier' && mathProperties.indexOf(ast.property.name) > -1; + const mathProperties = [ + 'E', + 'PI', + 'SQRT2', + 'SQRT1_2', + 'LN2', + 'LN10', + 'LOG2E', + 'LOG10E', + ]; + return ( + ast.type === 'MemberExpression' && + ast.object && + ast.object.type === 'Identifier' && + ast.object.name === 'Math' && + ast.property && + ast.property.type === 'Identifier' && + mathProperties.indexOf(ast.property.name) > -1 + ); } isAstMathFunction(ast) { - const mathFunctions = ['abs', 'acos', 'acosh', 'asin', 'asinh', 'atan', 'atan2', 'atanh', 'cbrt', 'ceil', 'clz32', 'cos', 'cosh', 'expm1', 'exp', 'floor', 'fround', 'imul', 'log', 'log2', 'log10', 'log1p', 'max', 'min', 'pow', 'random', 'round', 'sign', 'sin', 'sinh', 'sqrt', 'tan', 'tanh', 'trunc']; - return ast.type === 'CallExpression' && ast.callee && ast.callee.type === 'MemberExpression' && ast.callee.object && ast.callee.object.type === 'Identifier' && ast.callee.object.name === 'Math' && ast.callee.property && ast.callee.property.type === 'Identifier' && mathFunctions.indexOf(ast.callee.property.name) > -1; + const mathFunctions = [ + 'abs', + 'acos', + 'acosh', + 'asin', + 'asinh', + 'atan', + 'atan2', + 'atanh', + 'cbrt', + 'ceil', + 'clz32', + 'cos', + 'cosh', + 'expm1', + 'exp', + 'floor', + 'fround', + 'imul', + 'log', + 'log2', + 'log10', + 'log1p', + 'max', + 'min', + 'pow', + 'random', + 'round', + 'sign', + 'sin', + 'sinh', + 'sqrt', + 'tan', + 'tanh', + 'trunc', + ]; + return ( + ast.type === 'CallExpression' && + ast.callee && + ast.callee.type === 'MemberExpression' && + ast.callee.object && + ast.callee.object.type === 'Identifier' && + ast.callee.object.name === 'Math' && + ast.callee.property && + ast.callee.property.type === 'Identifier' && + mathFunctions.indexOf(ast.callee.property.name) > -1 + ); } isAstVariable(ast) { @@ -606,7 +730,9 @@ export class FunctionNode { } isSafeDependencies(dependencies) { - return dependencies && dependencies.every ? dependencies.every(dependency => dependency.isSafe) : true; + return dependencies && dependencies.every + ? dependencies.every(dependency => dependency.isSafe) + : true; } /** @@ -641,7 +767,12 @@ export class FunctionNode { dependencies.push({ origin: 'literal', value: ast.value, - isSafe: isNotSafe === true ? false : ast.value > -Infinity && ast.value < Infinity && !isNaN(ast.value), + isSafe: + isNotSafe === true + ? false + : ast.value > -Infinity && + ast.value < Infinity && + !isNaN(ast.value), }); break; case 'VariableDeclarator': @@ -652,7 +783,9 @@ export class FunctionNode { dependencies.push({ name: ast.name, origin: 'declaration', - isSafe: isNotSafe ? false : this.isSafeDependencies(declaration.dependencies), + isSafe: isNotSafe + ? false + : this.isSafeDependencies(declaration.dependencies), }); } else if (this.argumentNames.indexOf(ast.name) > -1) { dependencies.push({ @@ -665,7 +798,11 @@ export class FunctionNode { } break; case 'FunctionDeclaration': - return this.getDependencies(ast.body.body[ast.body.body.length - 1], dependencies, isNotSafe); + return this.getDependencies( + ast.body.body[ast.body.body.length - 1], + dependencies, + isNotSafe + ); case 'ReturnStatement': return this.getDependencies(ast.argument, dependencies); case 'BinaryExpression': @@ -701,7 +838,11 @@ export class FunctionNode { this.getDependencies(ast.object.object, dependencies, isNotSafe); break; case 'value[][][]': - this.getDependencies(ast.object.object.object, dependencies, isNotSafe); + this.getDependencies( + ast.object.object.object, + dependencies, + isNotSafe + ); break; case 'this.output.value': if (this.dynamicOutput) { @@ -731,7 +872,10 @@ export class FunctionNode { case 'SequenceExpression': return this.getDependencies(ast.expressions, dependencies, isNotSafe); default: - throw this.astErrorOutput(`Unhandled type ${ast.type} in getDependencies`, ast); + throw this.astErrorOutput( + `Unhandled type ${ast.type} in getDependencies`, + ast + ); } return dependencies; } @@ -751,12 +895,24 @@ export class FunctionNode { } else if (ast.type === 'ThisExpression') { signature.unshift('this'); } else if (ast.property && ast.property.name) { - if (ast.property.name === 'x' || ast.property.name === 'y' || ast.property.name === 'z') { - signature.unshift(returnRawValue ? '.' + ast.property.name : '.value'); - } else if (ast.property.name === 'constants' || ast.property.name === 'thread' || ast.property.name === 'output') { + if ( + ast.property.name === 'x' || + ast.property.name === 'y' || + ast.property.name === 'z' + ) { + signature.unshift( + returnRawValue ? '.' + ast.property.name : '.value' + ); + } else if ( + ast.property.name === 'constants' || + ast.property.name === 'thread' || + ast.property.name === 'output' + ) { signature.unshift('.' + ast.property.name); } else { - signature.unshift(returnRawValue ? '.' + ast.property.name : '.value'); + signature.unshift( + returnRawValue ? '.' + ast.property.name : '.value' + ); } } else if (ast.name) { signature.unshift(returnRawValue ? ast.name : 'value'); @@ -775,7 +931,26 @@ export class FunctionNode { return signatureString; } - const allowedExpressions = ['value', 'value[]', 'value[][]', 'value[][][]', 'value[][][][]', 'value.value', 'value.thread.value', 'this.thread.value', 'this.output.value', 'this.constants.value', 'this.constants.value[]', 'this.constants.value[][]', 'this.constants.value[][][]', 'this.constants.value[][][][]', 'fn()[]', 'fn()[][]', 'fn()[][][]', '[][]']; + const allowedExpressions = [ + 'value', + 'value[]', + 'value[][]', + 'value[][][]', + 'value[][][][]', + 'value.value', + 'value.thread.value', + 'this.thread.value', + 'this.output.value', + 'this.constants.value', + 'this.constants.value[]', + 'this.constants.value[][]', + 'this.constants.value[][][]', + 'this.constants.value[][][][]', + 'fn()[]', + 'fn()[][]', + 'fn()[][][]', + '[][]', + ]; if (allowedExpressions.indexOf(signatureString) > -1) { return signatureString; } @@ -880,8 +1055,11 @@ export class FunctionNode { const debugString = utils.getAstString(this.source, ast); const leadingSource = this.source.substr(ast.start); const splitLines = leadingSource.split(/\n/); - const lineBefore = splitLines.length > 0 ? splitLines[splitLines.length - 1] : 0; - return new Error(`${error} on line ${splitLines.length}, position ${lineBefore.length}:\n ${debugString}`); + const lineBefore = + splitLines.length > 0 ? splitLines[splitLines.length - 1] : 0; + return new Error( + `${error} on line ${splitLines.length}, position ${lineBefore.length}:\n ${debugString}` + ); } astDebuggerStatement(arrNode, retArr) { @@ -1118,7 +1296,10 @@ export class FunctionNode { */ getMemberExpressionDetails(ast) { if (ast.type !== 'MemberExpression') { - throw this.astErrorOutput(`Expression ${ast.type} not a MemberExpression`, ast); + throw this.astErrorOutput( + `Expression ${ast.type} not a MemberExpression`, + ast + ); } let name = null; let type = null; @@ -1301,7 +1482,12 @@ export class FunctionNode { while (stack.length > 0) { const atNode = stack[0]; - if (atNode.type === 'VariableDeclarator' && atNode.id && atNode.id.name && atNode.id.name === astToFind.name) { + if ( + atNode.type === 'VariableDeclarator' && + atNode.id && + atNode.id.name && + atNode.id.name === astToFind.name + ) { return atNode; } stack.shift(); diff --git a/src/backend/function-tracer.js b/src/backend/function-tracer.js index f63129b8..9c2dd46d 100644 --- a/src/backend/function-tracer.js +++ b/src/backend/function-tracer.js @@ -65,13 +65,20 @@ export class FunctionTracer { } newContext(run) { - const newContext = Object.assign({ '@contextType': 'const/let' }, this.currentContext); + const newContext = Object.assign( + { '@contextType': 'const/let' }, + this.currentContext + ); this.contexts.push(newContext); this.runningContexts.push(newContext); run(); const { currentFunctionContext } = this; for (const p in currentFunctionContext) { - if (!currentFunctionContext.hasOwnProperty(p) || newContext.hasOwnProperty(p)) continue; + if ( + !currentFunctionContext.hasOwnProperty(p) || + newContext.hasOwnProperty(p) + ) + continue; newContext[p] = currentFunctionContext[p]; } this.runningContexts.pop(); @@ -100,10 +107,16 @@ export class FunctionTracer { */ getDeclaration(name) { const { currentContext, currentFunctionContext, runningContexts } = this; - const declaration = currentContext[name] || currentFunctionContext[name] || null; + const declaration = + currentContext[name] || currentFunctionContext[name] || null; - if (!declaration && currentContext === currentFunctionContext && runningContexts.length > 0) { - const previousRunningContext = runningContexts[runningContexts.length - 2]; + if ( + !declaration && + currentContext === currentFunctionContext && + runningContexts.length > 0 + ) { + const previousRunningContext = + runningContexts[runningContexts.length - 2]; if (previousRunningContext[name]) { return previousRunningContext[name]; } @@ -177,7 +190,9 @@ export class FunctionTracer { origin: 'declaration', inForLoopInit, inForLoopTest: null, - assignable: currentContext === this.currentFunctionContext || (!inForLoopInit && !currentContext.hasOwnProperty(ast.id.name)), + assignable: + currentContext === this.currentFunctionContext || + (!inForLoopInit && !currentContext.hasOwnProperty(ast.id.name)), suggestedType: null, valueType: null, dependencies: null, diff --git a/src/backend/gl/kernel-string.js b/src/backend/gl/kernel-string.js index 46099816..9efbd2bc 100644 --- a/src/backend/gl/kernel-string.js +++ b/src/backend/gl/kernel-string.js @@ -18,7 +18,13 @@ function toStringWithoutUtils(fn) { * @param {string} [destroyContextString] * @returns {string} */ -export function glKernelString(Kernel, args, originKernel, setupContextString, destroyContextString) { +export function glKernelString( + Kernel, + args, + originKernel, + setupContextString, + destroyContextString +) { if (!originKernel.built) { originKernel.build.apply(originKernel, args); } @@ -41,11 +47,20 @@ export function glKernelString(Kernel, args, originKernel, setupContextString, d onReadPixels: targetName => { if (kernel.subKernels) { if (!subKernelsResultVariableSetup) { - postResult.push(` const result = { result: ${getRenderString(targetName, kernel)} };`); + postResult.push( + ` const result = { result: ${getRenderString( + targetName, + kernel + )} };` + ); subKernelsResultVariableSetup = true; } else { const property = kernel.subKernels[subKernelsResultIndex++].property; - postResult.push(` result${isNaN(property) ? '.' + property : `[${property}]`} = ${getRenderString(targetName, kernel)};`); + postResult.push( + ` result${ + isNaN(property) ? '.' + property : `[${property}]` + } = ${getRenderString(targetName, kernel)};` + ); } if (subKernelsResultIndex === kernel.subKernels.length) { postResult.push(' return result;'); @@ -59,11 +74,23 @@ export function glKernelString(Kernel, args, originKernel, setupContextString, d } }, onUnrecognizedArgumentLookup: argument => { - const argumentName = findKernelValue(argument, kernel.kernelArguments, [], context, uploadedValues); + const argumentName = findKernelValue( + argument, + kernel.kernelArguments, + [], + context, + uploadedValues + ); if (argumentName) { return argumentName; } - const constantName = findKernelValue(argument, kernel.kernelConstants, constants ? Object.keys(constants).map(key => constants[key]) : [], context, uploadedValues); + const constantName = findKernelValue( + argument, + kernel.kernelConstants, + constants ? Object.keys(constants).map(key => constants[key]) : [], + context, + uploadedValues + ); if (constantName) { return constantName; } @@ -72,7 +99,27 @@ export function glKernelString(Kernel, args, originKernel, setupContextString, d }); let subKernelsResultVariableSetup = false; let subKernelsResultIndex = 0; - const { source, canvas, output, pipeline, graphical, loopMaxIterations, constants, optimizeFloatMemory, precision, fixIntegerDivisionAccuracy, functions, nativeFunctions, subKernels, immutable, argumentTypes, constantTypes, kernelArguments, kernelConstants, tactic } = originKernel; + const { + source, + canvas, + output, + pipeline, + graphical, + loopMaxIterations, + constants, + optimizeFloatMemory, + precision, + fixIntegerDivisionAccuracy, + functions, + nativeFunctions, + subKernels, + immutable, + argumentTypes, + constantTypes, + kernelArguments, + kernelConstants, + tactic, + } = originKernel; const kernel = new Kernel(source, { canvas, context, @@ -114,16 +161,25 @@ export function glKernelString(Kernel, args, originKernel, setupContextString, d case 'HTMLCanvas': case 'HTMLImage': case 'HTMLVideo': - context.insertVariable(`uploadValue_${kernelArgument.name}`, kernelArgument.uploadValue); + context.insertVariable( + `uploadValue_${kernelArgument.name}`, + kernelArgument.uploadValue + ); break; case 'HTMLImageArray': for (let imageIndex = 0; imageIndex < args[i].length; imageIndex++) { const arg = args[i]; - context.insertVariable(`uploadValue_${kernelArgument.name}[${imageIndex}]`, arg[imageIndex]); + context.insertVariable( + `uploadValue_${kernelArgument.name}[${imageIndex}]`, + arg[imageIndex] + ); } break; case 'Input': - context.insertVariable(`uploadValue_${kernelArgument.name}`, kernelArgument.uploadValue); + context.insertVariable( + `uploadValue_${kernelArgument.name}`, + kernelArgument.uploadValue + ); break; case 'MemoryOptimizedNumberTexture': case 'NumberTexture': @@ -140,10 +196,15 @@ export function glKernelString(Kernel, args, originKernel, setupContextString, d case 'ArrayTexture(2)': case 'ArrayTexture(3)': case 'ArrayTexture(4)': - context.insertVariable(`uploadValue_${kernelArgument.name}`, args[i].texture); + context.insertVariable( + `uploadValue_${kernelArgument.name}`, + args[i].texture + ); break; default: - throw new Error(`unhandled kernelArgumentType insertion for glWiretap of type ${kernelArgument.type}`); + throw new Error( + `unhandled kernelArgumentType insertion for glWiretap of type ${kernelArgument.type}` + ); } }); result.push('/** start of injected functions **/'); @@ -153,10 +214,18 @@ export function glKernelString(Kernel, args, originKernel, setupContextString, d result.push(`function ${toStringWithoutUtils(utils.flatten4dArrayTo)}`); result.push(`function ${toStringWithoutUtils(utils.isArray)}`); if (kernel.renderOutput !== kernel.renderTexture && kernel.formatValues) { - result.push(` const renderOutput = function ${toStringWithoutUtils(kernel.formatValues)};`); + result.push( + ` const renderOutput = function ${toStringWithoutUtils( + kernel.formatValues + )};` + ); } result.push('/** end of injected functions **/'); - result.push(` const innerKernel = function (${kernel.kernelArguments.map(kernelArgument => kernelArgument.varName).join(', ')}) {`); + result.push( + ` const innerKernel = function (${kernel.kernelArguments + .map(kernelArgument => kernelArgument.varName) + .join(', ')}) {` + ); context.setIndent(4); kernel.run.apply(kernel, args); if (kernel.renderKernels) { @@ -166,7 +235,10 @@ export function glKernelString(Kernel, args, originKernel, setupContextString, d } result.push(' /** start setup uploads for kernel values **/'); kernel.kernelArguments.forEach(kernelArgument => { - result.push(' ' + kernelArgument.getStringValueHandler().split('\n').join('\n ')); + result.push( + ' ' + + kernelArgument.getStringValueHandler().split('\n').join('\n ') + ); }); result.push(' /** end setup uploads for kernel values **/'); result.push(context.toString()); @@ -175,30 +247,44 @@ export function glKernelString(Kernel, args, originKernel, setupContextString, d const framebufferName = context.getContextVariableName(kernel.framebuffer); if (kernel.renderKernels) { const results = kernel.renderKernels(); - const textureName = context.getContextVariableName(kernel.texture.texture); + const textureName = context.getContextVariableName( + kernel.texture.texture + ); result.push(` return { result: { texture: ${textureName}, type: '${results.result.type}', - toArray: ${getToArrayString(results.result, textureName, framebufferName)} + toArray: ${getToArrayString( + results.result, + textureName, + framebufferName + )} },`); const { subKernels, mappedTextures } = kernel; for (let i = 0; i < subKernels.length; i++) { const texture = mappedTextures[i]; const subKernel = subKernels[i]; const subKernelResult = results[subKernel.property]; - const subKernelTextureName = context.getContextVariableName(texture.texture); + const subKernelTextureName = context.getContextVariableName( + texture.texture + ); result.push(` ${subKernel.property}: { texture: ${subKernelTextureName}, type: '${subKernelResult.type}', - toArray: ${getToArrayString(subKernelResult, subKernelTextureName, framebufferName)} + toArray: ${getToArrayString( + subKernelResult, + subKernelTextureName, + framebufferName + )} },`); } result.push(` };`); } else { const rendered = kernel.renderOutput(); - const textureName = context.getContextVariableName(kernel.texture.texture); + const textureName = context.getContextVariableName( + kernel.texture.texture + ); result.push(` return { texture: ${textureName}, type: '${rendered.type}', @@ -206,7 +292,9 @@ export function glKernelString(Kernel, args, originKernel, setupContextString, d };`); } } - result.push(` ${destroyContextString ? '\n' + destroyContextString + ' ' : ''}`); + result.push( + ` ${destroyContextString ? '\n' + destroyContextString + ' ' : ''}` + ); result.push(postResult.join('\n')); result.push(' };'); if (kernel.graphical) { @@ -228,7 +316,10 @@ ${result.join('\n')} } function getRenderString(targetName, kernel) { - const readBackValue = kernel.precision === 'single' ? targetName : `new Float32Array(${targetName}.buffer)`; + const readBackValue = + kernel.precision === 'single' + ? targetName + : `new Float32Array(${targetName}.buffer)`; if (kernel.output[2]) { return `renderOutput(${readBackValue}, ${kernel.output[0]}, ${kernel.output[1]}, ${kernel.output[2]})`; } @@ -242,55 +333,63 @@ function getRenderString(targetName, kernel) { function getGetPixelsString(kernel) { const getPixels = kernel.getPixels.toString(); const useFunctionKeyword = !/^function/.test(getPixels); - return utils.flattenFunctionToString(`${useFunctionKeyword ? 'function ' : ''}${getPixels}`, { - findDependency: (object, name) => { - if (object === 'utils') { - return `const ${name} = ${utils[name].toString()};`; - } - return null; - }, - thisLookup: property => { - if (property === 'context') { + return utils.flattenFunctionToString( + `${useFunctionKeyword ? 'function ' : ''}${getPixels}`, + { + findDependency: (object, name) => { + if (object === 'utils') { + return `const ${name} = ${utils[name].toString()};`; + } return null; - } - if (kernel.hasOwnProperty(property)) { - return JSON.stringify(kernel[property]); - } - throw new Error(`unhandled thisLookup ${property}`); - }, - }); + }, + thisLookup: property => { + if (property === 'context') { + return null; + } + if (kernel.hasOwnProperty(property)) { + return JSON.stringify(kernel[property]); + } + throw new Error(`unhandled thisLookup ${property}`); + }, + } + ); } function getToArrayString(kernelResult, textureName, framebufferName) { const toArray = kernelResult.toArray.toString(); const useFunctionKeyword = !/^function/.test(toArray); - const flattenedFunctions = utils.flattenFunctionToString(`${useFunctionKeyword ? 'function ' : ''}${toArray}`, { - findDependency: (object, name) => { - if (object === 'utils') { - return `const ${name} = ${utils[name].toString()};`; - } else if (object === 'this') { - if (name === 'framebuffer') { - return ''; + const flattenedFunctions = utils.flattenFunctionToString( + `${useFunctionKeyword ? 'function ' : ''}${toArray}`, + { + findDependency: (object, name) => { + if (object === 'utils') { + return `const ${name} = ${utils[name].toString()};`; + } else if (object === 'this') { + if (name === 'framebuffer') { + return ''; + } + return `${useFunctionKeyword ? 'function ' : ''}${kernelResult[ + name + ].toString()}`; + } else { + throw new Error('unhandled fromObject'); } - return `${useFunctionKeyword ? 'function ' : ''}${kernelResult[name].toString()}`; - } else { - throw new Error('unhandled fromObject'); - } - }, - thisLookup: (property, isDeclaration) => { - if (property === 'texture') { - return textureName; - } - if (property === 'context') { - if (isDeclaration) return null; - return 'gl'; - } - if (kernelResult.hasOwnProperty(property)) { - return JSON.stringify(kernelResult[property]); - } - throw new Error(`unhandled thisLookup ${property}`); - }, - }); + }, + thisLookup: (property, isDeclaration) => { + if (property === 'texture') { + return textureName; + } + if (property === 'context') { + if (isDeclaration) return null; + return 'gl'; + } + if (kernelResult.hasOwnProperty(property)) { + return JSON.stringify(kernelResult[property]); + } + throw new Error(`unhandled thisLookup ${property}`); + }, + } + ); return `() => { function framebuffer() { return ${framebufferName}; }; ${flattenedFunctions} @@ -307,7 +406,13 @@ function getToArrayString(kernelResult, textureName, framebufferName) { * @param {KernelVariable[]} uploadedValues * @return {string|null} */ -function findKernelValue(argument, kernelValues, values, context, uploadedValues) { +function findKernelValue( + argument, + kernelValues, + values, + context, + uploadedValues +) { if (argument === null) return null; if (kernelValues === null) return null; switch (typeof argument) { @@ -315,7 +420,10 @@ function findKernelValue(argument, kernelValues, values, context, uploadedValues case 'number': return null; } - if (typeof HTMLImageElement !== 'undefined' && argument instanceof HTMLImageElement) { + if ( + typeof HTMLImageElement !== 'undefined' && + argument instanceof HTMLImageElement + ) { for (let i = 0; i < kernelValues.length; i++) { const kernelValue = kernelValues[i]; if (kernelValue.type !== 'HTMLImageArray' && kernelValue) continue; diff --git a/src/backend/gl/kernel.js b/src/backend/gl/kernel.js index 7f833704..5864298e 100644 --- a/src/backend/gl/kernel.js +++ b/src/backend/gl/kernel.js @@ -93,7 +93,12 @@ export class GLKernel extends Kernel { kernel.run.apply(kernel, args); const result = kernel.renderOutput(); kernel.destroy(true); - return Math.round(result[0]) === 0 && Math.round(result[1]) === 1 && Math.round(result[2]) === 2 && Math.round(result[3]) === 3; + return ( + Math.round(result[0]) === 0 && + Math.round(result[1]) === 1 && + Math.round(result[2]) === 2 && + Math.round(result[3]) === 3 + ); } /** @@ -122,12 +127,30 @@ export class GLKernel extends Kernel { kernelMap: isDrawBuffers, channelCount: this.getChannelCount(), maxTextureSize: this.getMaxTextureSize(), - lowIntPrecision: gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.LOW_INT), - lowFloatPrecision: gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.LOW_FLOAT), - mediumIntPrecision: gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.MEDIUM_INT), - mediumFloatPrecision: gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.MEDIUM_FLOAT), - highIntPrecision: gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.HIGH_INT), - highFloatPrecision: gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.HIGH_FLOAT), + lowIntPrecision: gl.getShaderPrecisionFormat( + gl.FRAGMENT_SHADER, + gl.LOW_INT + ), + lowFloatPrecision: gl.getShaderPrecisionFormat( + gl.FRAGMENT_SHADER, + gl.LOW_FLOAT + ), + mediumIntPrecision: gl.getShaderPrecisionFormat( + gl.FRAGMENT_SHADER, + gl.MEDIUM_INT + ), + mediumFloatPrecision: gl.getShaderPrecisionFormat( + gl.FRAGMENT_SHADER, + gl.MEDIUM_FLOAT + ), + highIntPrecision: gl.getShaderPrecisionFormat( + gl.FRAGMENT_SHADER, + gl.HIGH_INT + ), + highFloatPrecision: gl.getShaderPrecisionFormat( + gl.FRAGMENT_SHADER, + gl.HIGH_FLOAT + ), }); } @@ -139,7 +162,10 @@ export class GLKernel extends Kernel { } static getSignature(kernel, argumentTypes) { - return kernel.getVariablePrecisionString() + (argumentTypes.length > 0 ? ':' + argumentTypes.join(',') : ''); + return ( + kernel.getVariablePrecisionString() + + (argumentTypes.length > 0 ? ':' + argumentTypes.join(',') : '') + ); } /** @@ -166,7 +192,11 @@ export class GLKernel extends Kernel { * @deprecated */ setFloatTextures(flag) { - utils.warnDeprecated('method', 'setFloatTextures', 'setOptimizeFloatMemory'); + utils.warnDeprecated( + 'method', + 'setFloatTextures', + 'setOptimizeFloatMemory' + ); this.floatTextures = flag; return this; } @@ -195,7 +225,11 @@ export class GLKernel extends Kernel { states.push('MULTI_LINE_COMMENT'); i += 2; continue; - } else if (state === 'MULTI_LINE_COMMENT' && char === '*' && nextChar === '/') { + } else if ( + state === 'MULTI_LINE_COMMENT' && + char === '*' && + nextChar === '/' + ) { states.pop(); i += 2; continue; @@ -203,7 +237,11 @@ export class GLKernel extends Kernel { // end MULTI_LINE_COMMENT handling // begin COMMENT handling - else if (state === 'FUNCTION_ARGUMENTS' && char === '/' && nextChar === '/') { + else if ( + state === 'FUNCTION_ARGUMENTS' && + char === '/' && + nextChar === '/' + ) { states.push('COMMENT'); i += 2; continue; @@ -224,31 +262,61 @@ export class GLKernel extends Kernel { states.pop(); break; } - if (char === 'f' && nextChar === 'l' && source[i + 2] === 'o' && source[i + 3] === 'a' && source[i + 4] === 't' && source[i + 5] === ' ') { + if ( + char === 'f' && + nextChar === 'l' && + source[i + 2] === 'o' && + source[i + 3] === 'a' && + source[i + 4] === 't' && + source[i + 5] === ' ' + ) { states.push('DECLARE_VARIABLE'); argumentType = 'float'; argumentName = ''; i += 6; continue; - } else if (char === 'i' && nextChar === 'n' && source[i + 2] === 't' && source[i + 3] === ' ') { + } else if ( + char === 'i' && + nextChar === 'n' && + source[i + 2] === 't' && + source[i + 3] === ' ' + ) { states.push('DECLARE_VARIABLE'); argumentType = 'int'; argumentName = ''; i += 4; continue; - } else if (char === 'v' && nextChar === 'e' && source[i + 2] === 'c' && source[i + 3] === '2' && source[i + 4] === ' ') { + } else if ( + char === 'v' && + nextChar === 'e' && + source[i + 2] === 'c' && + source[i + 3] === '2' && + source[i + 4] === ' ' + ) { states.push('DECLARE_VARIABLE'); argumentType = 'vec2'; argumentName = ''; i += 5; continue; - } else if (char === 'v' && nextChar === 'e' && source[i + 2] === 'c' && source[i + 3] === '3' && source[i + 4] === ' ') { + } else if ( + char === 'v' && + nextChar === 'e' && + source[i + 2] === 'c' && + source[i + 3] === '3' && + source[i + 4] === ' ' + ) { states.push('DECLARE_VARIABLE'); argumentType = 'vec3'; argumentName = ''; i += 5; continue; - } else if (char === 'v' && nextChar === 'e' && source[i + 2] === 'c' && source[i + 3] === '4' && source[i + 4] === ' ') { + } else if ( + char === 'v' && + nextChar === 'e' && + source[i + 2] === 'c' && + source[i + 3] === '4' && + source[i + 4] === ' ' + ) { states.push('DECLARE_VARIABLE'); argumentType = 'vec4'; argumentName = ''; @@ -305,7 +373,15 @@ export class GLKernel extends Kernel { context.readPixels(0, 0, w, h * 4, context.RGBA, context.FLOAT, result); } else { const bytes = new Uint8Array(texSize[0] * texSize[1] * 4); - context.readPixels(0, 0, texSize[0], texSize[1], context.RGBA, context.UNSIGNED_BYTE, bytes); + context.readPixels( + 0, + 0, + texSize[0], + texSize[1], + context.RGBA, + context.UNSIGNED_BYTE, + bytes + ); result = new Float32Array(bytes.buffer); } @@ -316,7 +392,10 @@ export class GLKernel extends Kernel { } else if (lastKernel.output.length === 2) { return utils.splitArray(result, lastKernel.output[0]); } else if (lastKernel.output.length === 3) { - const cube = utils.splitArray(result, lastKernel.output[0] * lastKernel.output[1]); + const cube = utils.splitArray( + result, + lastKernel.output[0] * lastKernel.output[1] + ); return cube.map(function (x) { return utils.splitArray(x, lastKernel.output[0]); }); @@ -345,13 +424,20 @@ export class GLKernel extends Kernel { checkTextureSize() { const { features } = this.constructor; - if (this.texSize[0] > features.maxTextureSize || this.texSize[1] > features.maxTextureSize) { - throw new Error(`Texture size [${this.texSize[0]},${this.texSize[1]}] generated by kernel is larger than supported size [${features.maxTextureSize},${features.maxTextureSize}]`); + if ( + this.texSize[0] > features.maxTextureSize || + this.texSize[1] > features.maxTextureSize + ) { + throw new Error( + `Texture size [${this.texSize[0]},${this.texSize[1]}] generated by kernel is larger than supported size [${features.maxTextureSize},${features.maxTextureSize}]` + ); } } translateSource() { - throw new Error(`"translateSource" not defined on ${this.constructor.name}`); + throw new Error( + `"translateSource" not defined on ${this.constructor.name}` + ); } /** @@ -760,19 +846,31 @@ export class GLKernel extends Kernel { } getMainResultNumberTexture() { - return utils.linesToString(this.getMainResultKernelNumberTexture()) + utils.linesToString(this.getMainResultSubKernelNumberTexture()); + return ( + utils.linesToString(this.getMainResultKernelNumberTexture()) + + utils.linesToString(this.getMainResultSubKernelNumberTexture()) + ); } getMainResultArray2Texture() { - return utils.linesToString(this.getMainResultKernelArray2Texture()) + utils.linesToString(this.getMainResultSubKernelArray2Texture()); + return ( + utils.linesToString(this.getMainResultKernelArray2Texture()) + + utils.linesToString(this.getMainResultSubKernelArray2Texture()) + ); } getMainResultArray3Texture() { - return utils.linesToString(this.getMainResultKernelArray3Texture()) + utils.linesToString(this.getMainResultSubKernelArray3Texture()); + return ( + utils.linesToString(this.getMainResultKernelArray3Texture()) + + utils.linesToString(this.getMainResultSubKernelArray3Texture()) + ); } getMainResultArray4Texture() { - return utils.linesToString(this.getMainResultKernelArray4Texture()) + utils.linesToString(this.getMainResultSubKernelArray4Texture()); + return ( + utils.linesToString(this.getMainResultKernelArray4Texture()) + + utils.linesToString(this.getMainResultSubKernelArray4Texture()) + ); } /** @@ -780,7 +878,10 @@ export class GLKernel extends Kernel { * @return {string} */ getFloatTacticDeclaration() { - const variablePrecision = this.getVariablePrecisionString(this.texSize, this.tactic); + const variablePrecision = this.getVariablePrecisionString( + this.texSize, + this.tactic + ); return `precision ${variablePrecision} float;\n`; } @@ -789,7 +890,11 @@ export class GLKernel extends Kernel { * @return {string} */ getIntTacticDeclaration() { - return `precision ${this.getVariablePrecisionString(this.texSize, this.tactic, true)} int;\n`; + return `precision ${this.getVariablePrecisionString( + this.texSize, + this.tactic, + true + )} int;\n`; } /** @@ -797,21 +902,36 @@ export class GLKernel extends Kernel { * @return {string} */ getSampler2DTacticDeclaration() { - return `precision ${this.getVariablePrecisionString(this.texSize, this.tactic)} sampler2D;\n`; + return `precision ${this.getVariablePrecisionString( + this.texSize, + this.tactic + )} sampler2D;\n`; } getSampler2DArrayTacticDeclaration() { - return `precision ${this.getVariablePrecisionString(this.texSize, this.tactic)} sampler2DArray;\n`; + return `precision ${this.getVariablePrecisionString( + this.texSize, + this.tactic + )} sampler2DArray;\n`; } renderTexture() { return this.immutable ? this.texture.clone() : this.texture; } readPackedPixelsToUint8Array() { - if (this.precision !== 'unsigned') throw new Error('Requires this.precision to be "unsigned"'); + if (this.precision !== 'unsigned') + throw new Error('Requires this.precision to be "unsigned"'); const { texSize, context: gl } = this; const result = new Uint8Array(texSize[0] * texSize[1] * 4); - gl.readPixels(0, 0, texSize[0], texSize[1], gl.RGBA, gl.UNSIGNED_BYTE, result); + gl.readPixels( + 0, + 0, + texSize[0], + texSize[1], + gl.RGBA, + gl.UNSIGNED_BYTE, + result + ); return result; } @@ -820,7 +940,8 @@ export class GLKernel extends Kernel { } readFloatPixelsToFloat32Array() { - if (this.precision !== 'single') throw new Error('Requires this.precision to be "single"'); + if (this.precision !== 'single') + throw new Error('Requires this.precision to be "single"'); const { texSize, context: gl } = this; const w = texSize[0]; const h = texSize[1]; @@ -840,7 +961,9 @@ export class GLKernel extends Kernel { const pixels = new Uint8Array(width * height * 4); gl.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, pixels); // flipped by default, so invert - return new Uint8ClampedArray((flip ? pixels : utils.flipPixels(pixels, width, height)).buffer); + return new Uint8ClampedArray( + (flip ? pixels : utils.flipPixels(pixels, width, height)).buffer + ); } renderKernelsToArrays() { @@ -879,9 +1002,15 @@ export class GLKernel extends Kernel { const newOutput = this.toKernelOutput(output); if (this.program) { if (!this.dynamicOutput) { - throw new Error('Resizing a kernel with dynamicOutput: false is not possible'); + throw new Error( + 'Resizing a kernel with dynamicOutput: false is not possible' + ); } - const newThreadDim = [newOutput[0], newOutput[1] || 1, newOutput[2] || 1]; + const newThreadDim = [ + newOutput[0], + newOutput[1] || 1, + newOutput[2] || 1, + ]; const newTexSize = utils.getKernelTextureSize( { optimizeFloatMemory: this.optimizeFloatMemory, @@ -891,11 +1020,19 @@ export class GLKernel extends Kernel { ); const oldTexSize = this.texSize; if (oldTexSize) { - const oldPrecision = this.getVariablePrecisionString(oldTexSize, this.tactic); - const newPrecision = this.getVariablePrecisionString(newTexSize, this.tactic); + const oldPrecision = this.getVariablePrecisionString( + oldTexSize, + this.tactic + ); + const newPrecision = this.getVariablePrecisionString( + newTexSize, + this.tactic + ); if (oldPrecision !== newPrecision) { if (this.debug) { - console.warn('Precision requirement changed, asking GPU instance to recompile'); + console.warn( + 'Precision requirement changed, asking GPU instance to recompile' + ); } this.switchKernels({ type: 'outputPrecisionMismatch', @@ -934,7 +1071,12 @@ export class GLKernel extends Kernel { return this; } renderValues() { - return this.formatValues(this.transferValues(), this.output[0], this.output[1], this.output[2]); + return this.formatValues( + this.transferValues(), + this.output[0], + this.output[1], + this.output[2] + ); } switchKernels(reason) { if (this.switchingKernels) { @@ -943,12 +1085,25 @@ export class GLKernel extends Kernel { this.switchingKernels = [reason]; } } - getVariablePrecisionString(textureSize = this.texSize, tactic = this.tactic, isInt = false) { + getVariablePrecisionString( + textureSize = this.texSize, + tactic = this.tactic, + isInt = false + ) { if (!tactic) { if (!this.constructor.features.isSpeedTacticSupported) return 'highp'; - const low = this.constructor.features[isInt ? 'lowIntPrecision' : 'lowFloatPrecision']; - const medium = this.constructor.features[isInt ? 'mediumIntPrecision' : 'mediumFloatPrecision']; - const high = this.constructor.features[isInt ? 'highIntPrecision' : 'highFloatPrecision']; + const low = + this.constructor.features[ + isInt ? 'lowIntPrecision' : 'lowFloatPrecision' + ]; + const medium = + this.constructor.features[ + isInt ? 'mediumIntPrecision' : 'mediumFloatPrecision' + ]; + const high = + this.constructor.features[ + isInt ? 'highIntPrecision' : 'highFloatPrecision' + ]; const requiredSize = Math.log2(textureSize[0] * textureSize[1]); if (requiredSize <= low.rangeMax) { return 'lowp'; @@ -957,7 +1112,9 @@ export class GLKernel extends Kernel { } else if (requiredSize <= high.rangeMax) { return 'highp'; } else { - throw new Error(`The required size exceeds that of the ability of your system`); + throw new Error( + `The required size exceeds that of the ability of your system` + ); } } switch (tactic) { @@ -968,7 +1125,9 @@ export class GLKernel extends Kernel { case 'precision': return 'highp'; default: - throw new Error(`Unknown tactic "${tactic}" use "speed", "balanced", "precision", or empty for auto`); + throw new Error( + `Unknown tactic "${tactic}" use "speed", "balanced", "precision", or empty for auto` + ); } } diff --git a/src/backend/gl/texture/array-2-float-2d.js b/src/backend/gl/texture/array-2-float-2d.js index 7fb9f80f..663293d2 100644 --- a/src/backend/gl/texture/array-2-float-2d.js +++ b/src/backend/gl/texture/array-2-float-2d.js @@ -7,6 +7,10 @@ export class GLTextureArray2Float2D extends GLTextureFloat { this.type = 'ArrayTexture(2)'; } toArray() { - return utils.erect2DArray2(this.renderValues(), this.output[0], this.output[1]); + return utils.erect2DArray2( + this.renderValues(), + this.output[0], + this.output[1] + ); } } diff --git a/src/backend/gl/texture/array-2-float-3d.js b/src/backend/gl/texture/array-2-float-3d.js index 25510f93..197d5ae7 100644 --- a/src/backend/gl/texture/array-2-float-3d.js +++ b/src/backend/gl/texture/array-2-float-3d.js @@ -7,6 +7,11 @@ export class GLTextureArray2Float3D extends GLTextureFloat { this.type = 'ArrayTexture(2)'; } toArray() { - return utils.erect3DArray2(this.renderValues(), this.output[0], this.output[1], this.output[2]); + return utils.erect3DArray2( + this.renderValues(), + this.output[0], + this.output[1], + this.output[2] + ); } } diff --git a/src/backend/gl/texture/array-2-float.js b/src/backend/gl/texture/array-2-float.js index 7fe7442f..6af8b537 100644 --- a/src/backend/gl/texture/array-2-float.js +++ b/src/backend/gl/texture/array-2-float.js @@ -7,6 +7,10 @@ export class GLTextureArray2Float extends GLTextureFloat { this.type = 'ArrayTexture(2)'; } toArray() { - return utils.erectArray2(this.renderValues(), this.output[0], this.output[1]); + return utils.erectArray2( + this.renderValues(), + this.output[0], + this.output[1] + ); } } diff --git a/src/backend/gl/texture/array-3-float-2d.js b/src/backend/gl/texture/array-3-float-2d.js index b4e72b52..af2f4c12 100644 --- a/src/backend/gl/texture/array-3-float-2d.js +++ b/src/backend/gl/texture/array-3-float-2d.js @@ -7,6 +7,10 @@ export class GLTextureArray3Float2D extends GLTextureFloat { this.type = 'ArrayTexture(3)'; } toArray() { - return utils.erect2DArray3(this.renderValues(), this.output[0], this.output[1]); + return utils.erect2DArray3( + this.renderValues(), + this.output[0], + this.output[1] + ); } } diff --git a/src/backend/gl/texture/array-3-float-3d.js b/src/backend/gl/texture/array-3-float-3d.js index b4cdbaf3..b359f993 100644 --- a/src/backend/gl/texture/array-3-float-3d.js +++ b/src/backend/gl/texture/array-3-float-3d.js @@ -7,6 +7,11 @@ export class GLTextureArray3Float3D extends GLTextureFloat { this.type = 'ArrayTexture(3)'; } toArray() { - return utils.erect3DArray3(this.renderValues(), this.output[0], this.output[1], this.output[2]); + return utils.erect3DArray3( + this.renderValues(), + this.output[0], + this.output[1], + this.output[2] + ); } } diff --git a/src/backend/gl/texture/array-4-float-2d.js b/src/backend/gl/texture/array-4-float-2d.js index 9a1df32c..3510c427 100644 --- a/src/backend/gl/texture/array-4-float-2d.js +++ b/src/backend/gl/texture/array-4-float-2d.js @@ -7,6 +7,10 @@ export class GLTextureArray4Float2D extends GLTextureFloat { this.type = 'ArrayTexture(4)'; } toArray() { - return utils.erect2DArray4(this.renderValues(), this.output[0], this.output[1]); + return utils.erect2DArray4( + this.renderValues(), + this.output[0], + this.output[1] + ); } } diff --git a/src/backend/gl/texture/array-4-float-3d.js b/src/backend/gl/texture/array-4-float-3d.js index 1c6496cc..51095734 100644 --- a/src/backend/gl/texture/array-4-float-3d.js +++ b/src/backend/gl/texture/array-4-float-3d.js @@ -7,6 +7,11 @@ export class GLTextureArray4Float3D extends GLTextureFloat { this.type = 'ArrayTexture(4)'; } toArray() { - return utils.erect3DArray4(this.renderValues(), this.output[0], this.output[1], this.output[2]); + return utils.erect3DArray4( + this.renderValues(), + this.output[0], + this.output[1], + this.output[2] + ); } } diff --git a/src/backend/gl/texture/float-2d.js b/src/backend/gl/texture/float-2d.js index 3ec329af..21f78f62 100644 --- a/src/backend/gl/texture/float-2d.js +++ b/src/backend/gl/texture/float-2d.js @@ -7,6 +7,10 @@ export class GLTextureFloat2D extends GLTextureFloat { this.type = 'ArrayTexture(1)'; } toArray() { - return utils.erect2DFloat(this.renderValues(), this.output[0], this.output[1]); + return utils.erect2DFloat( + this.renderValues(), + this.output[0], + this.output[1] + ); } } diff --git a/src/backend/gl/texture/float-3d.js b/src/backend/gl/texture/float-3d.js index 2d29a43e..77e173b5 100644 --- a/src/backend/gl/texture/float-3d.js +++ b/src/backend/gl/texture/float-3d.js @@ -7,6 +7,11 @@ export class GLTextureFloat3D extends GLTextureFloat { this.type = 'ArrayTexture(1)'; } toArray() { - return utils.erect3DFloat(this.renderValues(), this.output[0], this.output[1], this.output[2]); + return utils.erect3DFloat( + this.renderValues(), + this.output[0], + this.output[1], + this.output[2] + ); } } diff --git a/src/backend/gl/texture/float.js b/src/backend/gl/texture/float.js index 68214993..2dfe91d6 100644 --- a/src/backend/gl/texture/float.js +++ b/src/backend/gl/texture/float.js @@ -13,7 +13,13 @@ export class GLTextureFloat extends GLTexture { const gl = this.context; const size = this.size; gl.bindFramebuffer(gl.FRAMEBUFFER, this.framebuffer()); - gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.texture, 0); + gl.framebufferTexture2D( + gl.FRAMEBUFFER, + gl.COLOR_ATTACHMENT0, + gl.TEXTURE_2D, + this.texture, + 0 + ); const result = new Float32Array(size[0] * size[1] * 4); gl.readPixels(0, 0, size[0], size[1], gl.RGBA, gl.FLOAT, result); return result; diff --git a/src/backend/gl/texture/index.js b/src/backend/gl/texture/index.js index f9fe6de1..4214d2e2 100644 --- a/src/backend/gl/texture/index.js +++ b/src/backend/gl/texture/index.js @@ -40,10 +40,26 @@ export class GLTexture extends Texture { } gl.bindFramebuffer(gl.FRAMEBUFFER, this.framebuffer()); selectTexture(gl, texture); - gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0); + gl.framebufferTexture2D( + gl.FRAMEBUFFER, + gl.COLOR_ATTACHMENT0, + gl.TEXTURE_2D, + texture, + 0 + ); const target = gl.createTexture(); selectTexture(gl, target); - gl.texImage2D(gl.TEXTURE_2D, 0, this.internalFormat, size[0], size[1], 0, this.textureFormat, this.textureType, null); + gl.texImage2D( + gl.TEXTURE_2D, + 0, + this.internalFormat, + size[0], + size[1], + 0, + this.textureFormat, + this.textureType, + null + ); gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, 0, 0, 0, 0, size[0], size[1]); target._refs = 1; this.texture = target; @@ -62,7 +78,17 @@ export class GLTexture extends Texture { } const target = gl.createTexture(); selectTexture(gl, target); - gl.texImage2D(gl.TEXTURE_2D, 0, this.internalFormat, size[0], size[1], 0, this.textureFormat, this.textureType, null); + gl.texImage2D( + gl.TEXTURE_2D, + 0, + this.internalFormat, + size[0], + size[1], + 0, + this.textureFormat, + this.textureType, + null + ); target._refs = 1; this.texture = target; } @@ -75,13 +101,29 @@ export class GLTexture extends Texture { selectTexture(gl, target); const size = this.size; target._refs = 1; - gl.texImage2D(gl.TEXTURE_2D, 0, this.internalFormat, size[0], size[1], 0, this.textureFormat, this.textureType, null); + gl.texImage2D( + gl.TEXTURE_2D, + 0, + this.internalFormat, + size[0], + size[1], + 0, + this.textureFormat, + this.textureType, + null + ); } const { context: gl, texture } = this; gl.bindFramebuffer(gl.FRAMEBUFFER, this.framebuffer()); gl.bindTexture(gl.TEXTURE_2D, texture); selectTexture(gl, texture); - gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0); + gl.framebufferTexture2D( + gl.FRAMEBUFFER, + gl.COLOR_ATTACHMENT0, + gl.TEXTURE_2D, + texture, + 0 + ); gl.clearColor(0, 0, 0, 0); gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); } @@ -103,7 +145,10 @@ export class GLTexture extends Texture { framebuffer() { if (!this._framebuffer) { - this._framebuffer = this.kernel.getRawValueFramebuffer(this.size[0], this.size[1]); + this._framebuffer = this.kernel.getRawValueFramebuffer( + this.size[0], + this.size[1] + ); } return this._framebuffer; } diff --git a/src/backend/gl/texture/memory-optimized-2d.js b/src/backend/gl/texture/memory-optimized-2d.js index e2e8db68..aab68e60 100644 --- a/src/backend/gl/texture/memory-optimized-2d.js +++ b/src/backend/gl/texture/memory-optimized-2d.js @@ -7,6 +7,10 @@ export class GLTextureMemoryOptimized2D extends GLTextureFloat { this.type = 'MemoryOptimizedNumberTexture'; } toArray() { - return utils.erectMemoryOptimized2DFloat(this.renderValues(), this.output[0], this.output[1]); + return utils.erectMemoryOptimized2DFloat( + this.renderValues(), + this.output[0], + this.output[1] + ); } } diff --git a/src/backend/gl/texture/memory-optimized-3d.js b/src/backend/gl/texture/memory-optimized-3d.js index 8935f702..611d227f 100644 --- a/src/backend/gl/texture/memory-optimized-3d.js +++ b/src/backend/gl/texture/memory-optimized-3d.js @@ -7,6 +7,11 @@ export class GLTextureMemoryOptimized3D extends GLTextureFloat { this.type = 'MemoryOptimizedNumberTexture'; } toArray() { - return utils.erectMemoryOptimized3DFloat(this.renderValues(), this.output[0], this.output[1], this.output[2]); + return utils.erectMemoryOptimized3DFloat( + this.renderValues(), + this.output[0], + this.output[1], + this.output[2] + ); } } diff --git a/src/backend/gl/texture/memory-optimized.js b/src/backend/gl/texture/memory-optimized.js index 56088acb..efb486ec 100644 --- a/src/backend/gl/texture/memory-optimized.js +++ b/src/backend/gl/texture/memory-optimized.js @@ -7,6 +7,9 @@ export class GLTextureMemoryOptimized extends GLTextureFloat { this.type = 'MemoryOptimizedNumberTexture'; } toArray() { - return utils.erectMemoryOptimizedFloat(this.renderValues(), this.output[0]); + return utils.erectMemoryOptimizedFloat( + this.renderValues(), + this.output[0] + ); } } diff --git a/src/backend/gl/texture/unsigned-2d.js b/src/backend/gl/texture/unsigned-2d.js index 59dcbc74..96823b93 100644 --- a/src/backend/gl/texture/unsigned-2d.js +++ b/src/backend/gl/texture/unsigned-2d.js @@ -7,6 +7,10 @@ export class GLTextureUnsigned2D extends GLTextureUnsigned { this.type = 'NumberTexture'; } toArray() { - return utils.erect2DPackedFloat(this.renderValues(), this.output[0], this.output[1]); + return utils.erect2DPackedFloat( + this.renderValues(), + this.output[0], + this.output[1] + ); } } diff --git a/src/backend/gl/texture/unsigned-3d.js b/src/backend/gl/texture/unsigned-3d.js index c72b6364..c7b3a317 100644 --- a/src/backend/gl/texture/unsigned-3d.js +++ b/src/backend/gl/texture/unsigned-3d.js @@ -7,6 +7,11 @@ export class GLTextureUnsigned3D extends GLTextureUnsigned { this.type = 'NumberTexture'; } toArray() { - return utils.erect3DPackedFloat(this.renderValues(), this.output[0], this.output[1], this.output[2]); + return utils.erect3DPackedFloat( + this.renderValues(), + this.output[0], + this.output[1], + this.output[2] + ); } } diff --git a/src/backend/gl/texture/unsigned.js b/src/backend/gl/texture/unsigned.js index ff401371..16800904 100644 --- a/src/backend/gl/texture/unsigned.js +++ b/src/backend/gl/texture/unsigned.js @@ -12,9 +12,23 @@ export class GLTextureUnsigned extends GLTexture { renderRawOutput() { const { context: gl } = this; gl.bindFramebuffer(gl.FRAMEBUFFER, this.framebuffer()); - gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.texture, 0); + gl.framebufferTexture2D( + gl.FRAMEBUFFER, + gl.COLOR_ATTACHMENT0, + gl.TEXTURE_2D, + this.texture, + 0 + ); const result = new Uint8Array(this.size[0] * this.size[1] * 4); - gl.readPixels(0, 0, this.size[0], this.size[1], gl.RGBA, gl.UNSIGNED_BYTE, result); + gl.readPixels( + 0, + 0, + this.size[0], + this.size[1], + gl.RGBA, + gl.UNSIGNED_BYTE, + result + ); return result; } renderValues() { diff --git a/src/backend/headless-gl/kernel.js b/src/backend/headless-gl/kernel.js index f01d74a6..0b8babd4 100644 --- a/src/backend/headless-gl/kernel.js +++ b/src/backend/headless-gl/kernel.js @@ -27,13 +27,23 @@ export class HeadlessGLKernel extends WebGLKernel { }); if (!testContext || !testContext.getExtension) return; testExtensions = { - STACKGL_resize_drawingbuffer: testContext.getExtension('STACKGL_resize_drawingbuffer'), - STACKGL_destroy_context: testContext.getExtension('STACKGL_destroy_context'), + STACKGL_resize_drawingbuffer: testContext.getExtension( + 'STACKGL_resize_drawingbuffer' + ), + STACKGL_destroy_context: testContext.getExtension( + 'STACKGL_destroy_context' + ), OES_texture_float: testContext.getExtension('OES_texture_float'), - OES_texture_float_linear: testContext.getExtension('OES_texture_float_linear'), - OES_element_index_uint: testContext.getExtension('OES_element_index_uint'), + OES_texture_float_linear: testContext.getExtension( + 'OES_texture_float_linear' + ), + OES_element_index_uint: testContext.getExtension( + 'OES_element_index_uint' + ), WEBGL_draw_buffers: testContext.getExtension('WEBGL_draw_buffers'), - WEBGL_color_buffer_float: testContext.getExtension('WEBGL_color_buffer_float'), + WEBGL_color_buffer_float: testContext.getExtension( + 'WEBGL_color_buffer_float' + ), }; features = this.getFeatures(); } catch (e) { @@ -58,7 +68,11 @@ export class HeadlessGLKernel extends WebGLKernel { } static getChannelCount() { - return testExtensions.WEBGL_draw_buffers ? testContext.getParameter(testExtensions.WEBGL_draw_buffers.MAX_DRAW_BUFFERS_WEBGL) : 1; + return testExtensions.WEBGL_draw_buffers + ? testContext.getParameter( + testExtensions.WEBGL_draw_buffers.MAX_DRAW_BUFFERS_WEBGL + ) + : 1; } static getMaxTextureSize() { @@ -89,11 +103,19 @@ export class HeadlessGLKernel extends WebGLKernel { initExtensions() { this.extensions = { - STACKGL_resize_drawingbuffer: this.context.getExtension('STACKGL_resize_drawingbuffer'), - STACKGL_destroy_context: this.context.getExtension('STACKGL_destroy_context'), + STACKGL_resize_drawingbuffer: this.context.getExtension( + 'STACKGL_resize_drawingbuffer' + ), + STACKGL_destroy_context: this.context.getExtension( + 'STACKGL_destroy_context' + ), OES_texture_float: this.context.getExtension('OES_texture_float'), - OES_texture_float_linear: this.context.getExtension('OES_texture_float_linear'), - OES_element_index_uint: this.context.getExtension('OES_element_index_uint'), + OES_texture_float_linear: this.context.getExtension( + 'OES_texture_float_linear' + ), + OES_element_index_uint: this.context.getExtension( + 'OES_element_index_uint' + ), WEBGL_draw_buffers: this.context.getExtension('WEBGL_draw_buffers'), }; } @@ -101,7 +123,10 @@ export class HeadlessGLKernel extends WebGLKernel { build() { super.build.apply(this, arguments); if (!this.fallbackRequested) { - this.extensions.STACKGL_resize_drawingbuffer.resize(this.maxTexSize[0], this.maxTexSize[1]); + this.extensions.STACKGL_resize_drawingbuffer.resize( + this.maxTexSize[0], + this.maxTexSize[1] + ); } } @@ -127,13 +152,22 @@ export class HeadlessGLKernel extends WebGLKernel { toString() { const setupContextString = `const gl = context || require('gl')(1, 1);\n`; const destroyContextString = ` if (!context) { gl.getExtension('STACKGL_destroy_context').destroy(); }\n`; - return glKernelString(this.constructor, arguments, this, setupContextString, destroyContextString); + return glKernelString( + this.constructor, + arguments, + this, + setupContextString, + destroyContextString + ); } setOutput(output) { super.setOutput(output); if (this.graphical && this.extensions.STACKGL_resize_drawingbuffer) { - this.extensions.STACKGL_resize_drawingbuffer.resize(this.maxTexSize[0], this.maxTexSize[1]); + this.extensions.STACKGL_resize_drawingbuffer.resize( + this.maxTexSize[0], + this.maxTexSize[1] + ); } return this; } diff --git a/src/backend/kernel-value.js b/src/backend/kernel-value.js index 7c37f9d2..6ce6986f 100644 --- a/src/backend/kernel-value.js +++ b/src/backend/kernel-value.js @@ -7,7 +7,18 @@ export class KernelValue { * @param {IKernelValueSettings} settings */ constructor(value, settings) { - const { name, kernel, context, checkContext, onRequestContextHandle, onUpdateValueMismatch, origin, strictIntegers, type, tactic } = settings; + const { + name, + kernel, + context, + checkContext, + onRequestContextHandle, + onUpdateValueMismatch, + origin, + strictIntegers, + type, + tactic, + } = settings; if (!name) { throw new Error('name not set'); } @@ -18,7 +29,9 @@ export class KernelValue { throw new Error('origin not set'); } if (origin !== 'user' && origin !== 'constants') { - throw new Error(`origin must be "user" or "constants" value is "${origin}"`); + throw new Error( + `origin must be "user" or "constants" value is "${origin}"` + ); } if (!onRequestContextHandle) { throw new Error('onRequestContextHandle is not set'); @@ -34,7 +47,10 @@ export class KernelValue { this.size = value.size || null; this.index = null; this.context = context; - this.checkContext = checkContext !== null && checkContext !== undefined ? checkContext : true; + this.checkContext = + checkContext !== null && checkContext !== undefined + ? checkContext + : true; this.contextHandle = null; this.onRequestContextHandle = onRequestContextHandle; this.onUpdateValueMismatch = onUpdateValueMismatch; diff --git a/src/backend/kernel.js b/src/backend/kernel.js index 6bc37f0d..d54cd225 100644 --- a/src/backend/kernel.js +++ b/src/backend/kernel.js @@ -63,7 +63,10 @@ export class Kernel { * Name of the arguments found from parsing source argument * @type {String[]} */ - this.argumentNames = typeof source === 'string' ? utils.getArgumentNamesFromString(source) : null; + this.argumentNames = + typeof source === 'string' + ? utils.getArgumentNamesFromString(source) + : null; this.argumentTypes = null; this.argumentSizes = null; this.argumentBitRatios = null; @@ -317,10 +320,17 @@ export class Kernel { * @return {Kernel} */ addFunction(source, settings = {}) { - if (source.name && source.source && source.argumentTypes && 'returnType' in source) { + if ( + source.name && + source.source && + source.argumentTypes && + 'returnType' in source + ) { this.functions.push(source); } else if ('settings' in source && 'source' in source) { - this.functions.push(this.functionToIGPUFunction(source.source, source.settings)); + this.functions.push( + this.functionToIGPUFunction(source.source, source.settings) + ); } else if (typeof source === 'string' || typeof source === 'function') { this.functions.push(this.functionToIGPUFunction(source, settings)); } else { @@ -336,14 +346,18 @@ export class Kernel { * @param {IGPUFunctionSettings} [settings] */ addNativeFunction(name, source, settings = {}) { - const { argumentTypes, argumentNames } = settings.argumentTypes ? splitArgumentTypes(settings.argumentTypes) : this.constructor.nativeFunctionArguments(source) || {}; + const { argumentTypes, argumentNames } = settings.argumentTypes + ? splitArgumentTypes(settings.argumentTypes) + : this.constructor.nativeFunctionArguments(source) || {}; this.nativeFunctions.push({ name, source, settings, argumentTypes, argumentNames, - returnType: settings.returnType || this.constructor.nativeFunctionReturnType(source), + returnType: + settings.returnType || + this.constructor.nativeFunctionReturnType(source), }); return this; } @@ -404,7 +418,10 @@ export class Kernel { if (this.constants) { for (let name in this.constants) { if (needsConstantTypes) { - const type = utils.getVariableType(this.constants[name], this.strictIntegers); + const type = utils.getVariableType( + this.constants[name], + this.strictIntegers + ); this.constantTypes[name] = type; this.kernelConstants.push({ name, @@ -710,7 +727,8 @@ export class Kernel { for (const p in argumentTypes) { if (!argumentTypes.hasOwnProperty(p)) continue; const argumentIndex = this.argumentNames.indexOf(p); - if (argumentIndex === -1) throw new Error(`unable to find argument ${p}`); + if (argumentIndex === -1) + throw new Error(`unable to find argument ${p}`); this.argumentTypes[argumentIndex] = argumentTypes[p]; } } @@ -729,7 +747,9 @@ export class Kernel { requestFallback(args) { if (!this.onRequestFallback) { - throw new Error(`"onRequestFallback" not defined on ${this.constructor.name}`); + throw new Error( + `"onRequestFallback" not defined on ${this.constructor.name}` + ); } this.fallbackRequested = true; return this.onRequestFallback(args); @@ -740,7 +760,9 @@ export class Kernel { * @abstract */ validateSettings() { - throw new Error(`"validateSettings" not defined on ${this.constructor.name}`); + throw new Error( + `"validateSettings" not defined on ${this.constructor.name}` + ); } /** @@ -753,8 +775,10 @@ export class Kernel { if (this.subKernels === null) { this.subKernels = []; } - if (!subKernel.source) throw new Error('subKernel missing "source" property'); - if (!subKernel.property && isNaN(subKernel.property)) throw new Error('subKernel missing "property" property'); + if (!subKernel.source) + throw new Error('subKernel missing "source" property'); + if (!subKernel.property && isNaN(subKernel.property)) + throw new Error('subKernel missing "property" property'); if (!subKernel.name) throw new Error('subKernel missing "name" property'); this.subKernels.push(subKernel); return this; @@ -806,11 +830,15 @@ export class Kernel { } checkOutput() { - if (!this.output || !utils.isArray(this.output)) throw new Error('kernel.output not an array'); - if (this.output.length < 1) throw new Error('kernel.output is empty, needs at least 1 value'); + if (!this.output || !utils.isArray(this.output)) + throw new Error('kernel.output not an array'); + if (this.output.length < 1) + throw new Error('kernel.output is empty, needs at least 1 value'); for (let i = 0; i < this.output.length; i++) { if (isNaN(this.output[i]) || this.output[i] < 1) { - throw new Error(`${this.constructor.name}.output[${i}] incorrectly defined as \`${this.output[i]}\`, needs to be numeric, and greater than 0`); + throw new Error( + `${this.constructor.name}.output[${i}] incorrectly defined as \`${this.output[i]}\`, needs to be numeric, and greater than 0` + ); } } } @@ -843,7 +871,9 @@ export class Kernel { argumentNames: this.argumentNames, argumentsTypes: this.argumentTypes, constants: this.constants, - pluginNames: this.plugins ? this.plugins.map(plugin => plugin.name) : null, + pluginNames: this.plugins + ? this.plugins.map(plugin => plugin.name) + : null, returnType: this.returnType, }, }; @@ -854,7 +884,10 @@ export class Kernel { */ buildSignature(args) { const Constructor = this.constructor; - this.signature = Constructor.getSignature(this, Constructor.getArgumentTypes(this, args)); + this.signature = Constructor.getSignature( + this, + Constructor.getArgumentTypes(this, args) + ); } /** @@ -902,14 +935,19 @@ export class Kernel { * @returns {IGPUFunction} */ functionToIGPUFunction(source, settings = {}) { - if (typeof source !== 'string' && typeof source !== 'function') throw new Error('source not a string or function'); - const sourceString = typeof source === 'string' ? source : source.toString(); + if (typeof source !== 'string' && typeof source !== 'function') + throw new Error('source not a string or function'); + const sourceString = + typeof source === 'string' ? source : source.toString(); let argumentTypes = []; if (Array.isArray(settings.argumentTypes)) { argumentTypes = settings.argumentTypes; } else if (typeof settings.argumentTypes === 'object') { - argumentTypes = utils.getArgumentNamesFromString(sourceString).map(name => settings.argumentTypes[name]) || []; + argumentTypes = + utils + .getArgumentNamesFromString(sourceString) + .map(name => settings.argumentTypes[name]) || []; } else { argumentTypes = settings.argumentTypes || []; } diff --git a/src/backend/web-gl/function-node.js b/src/backend/web-gl/function-node.js index 0314d2e6..84e85164 100644 --- a/src/backend/web-gl/function-node.js +++ b/src/backend/web-gl/function-node.js @@ -86,10 +86,14 @@ export class WebGLFunctionNode extends FunctionNode { if (i > 0) { retArr.push(', '); } - let argumentType = this.argumentTypes[this.argumentNames.indexOf(argumentName)]; + let argumentType = + this.argumentTypes[this.argumentNames.indexOf(argumentName)]; // The type is too loose ended, here we decide to solidify a type, lets go with float if (!argumentType) { - throw this.astErrorOutput(`Unknown argument ${argumentName} type`, ast); + throw this.astErrorOutput( + `Unknown argument ${argumentName} type`, + ast + ); } if (argumentType === 'LiteralInteger') { this.argumentTypes[i] = argumentType = 'Number'; @@ -101,7 +105,9 @@ export class WebGLFunctionNode extends FunctionNode { const name = utils.sanitizeName(argumentName); if (type === 'sampler2D' || type === 'sampler2DArray') { // mash needed arguments together, since now we have end to end inference - retArr.push(`${type} user_${name},ivec2 user_${name}Size,ivec3 user_${name}Dim`); + retArr.push( + `${type} user_${name},ivec2 user_${name}Size,ivec3 user_${name}Dim` + ); } else { retArr.push(`${type} user_${name}`); } @@ -129,7 +135,8 @@ export class WebGLFunctionNode extends FunctionNode { * @returns {Array} the append retArr */ astReturnStatement(ast, retArr) { - if (!ast.argument) throw this.astErrorOutput('Unexpected return statement', ast); + if (!ast.argument) + throw this.astErrorOutput('Unexpected return statement', ast); this.pushState('skip-literal-correction'); const type = this.getType(ast.argument); this.popState('skip-literal-correction'); @@ -191,7 +198,10 @@ export class WebGLFunctionNode extends FunctionNode { this.astGeneric(ast.argument, result); break; default: - throw this.astErrorOutput(`unhandled return type ${this.returnType}`, ast); + throw this.astErrorOutput( + `unhandled return type ${this.returnType}`, + ast + ); } if (this.isRootKernel) { @@ -217,22 +227,34 @@ export class WebGLFunctionNode extends FunctionNode { astLiteral(ast, retArr) { // Reject non numeric literals if (isNaN(ast.value)) { - throw this.astErrorOutput('Non-numeric literal not supported : ' + ast.value, ast); + throw this.astErrorOutput( + 'Non-numeric literal not supported : ' + ast.value, + ast + ); } const key = this.astKey(ast); if (Number.isInteger(ast.value)) { - if (this.isState('casting-to-integer') || this.isState('building-integer')) { + if ( + this.isState('casting-to-integer') || + this.isState('building-integer') + ) { this.literalTypes[key] = 'Integer'; retArr.push(`${ast.value}`); - } else if (this.isState('casting-to-float') || this.isState('building-float')) { + } else if ( + this.isState('casting-to-float') || + this.isState('building-float') + ) { this.literalTypes[key] = 'Number'; retArr.push(`${ast.value}.0`); } else { this.literalTypes[key] = 'Number'; retArr.push(`${ast.value}.0`); } - } else if (this.isState('casting-to-integer') || this.isState('building-integer')) { + } else if ( + this.isState('casting-to-integer') || + this.isState('building-integer') + ) { this.literalTypes[key] = 'Integer'; retArr.push(Math.round(ast.value)); } else { @@ -308,7 +330,10 @@ export class WebGLFunctionNode extends FunctionNode { this.popState('building-float'); break; case 'LiteralInteger & LiteralInteger': - if (this.isState('casting-to-integer') || this.isState('building-integer')) { + if ( + this.isState('casting-to-integer') || + this.isState('building-integer') + ) { this.pushState('building-integer'); this.astGeneric(ast.left, retArr); retArr.push(operatorMap[ast.operator] || ast.operator); @@ -325,7 +350,10 @@ export class WebGLFunctionNode extends FunctionNode { case 'Integer & Float': case 'Integer & Number': - if (ast.operator === '>' || (ast.operator === '<' && ast.right.type === 'Literal')) { + if ( + ast.operator === '>' || + (ast.operator === '<' && ast.right.type === 'Literal') + ) { // if right value is actually a float, don't loose that information, cast left to right rather than the usual right to left if (!Number.isInteger(ast.right.value)) { this.pushState('building-float'); @@ -347,7 +375,10 @@ export class WebGLFunctionNode extends FunctionNode { if (literalType === 'Integer') { retArr.push(literalResult.join('')); } else { - throw this.astErrorOutput(`Unhandled binary expression with literal`, ast); + throw this.astErrorOutput( + `Unhandled binary expression with literal`, + ast + ); } } else { retArr.push('int('); @@ -423,7 +454,10 @@ export class WebGLFunctionNode extends FunctionNode { break; default: - throw this.astErrorOutput(`Unhandled binary expression between ${key}`, ast); + throw this.astErrorOutput( + `Unhandled binary expression between ${key}`, + ast + ); } retArr.push(')'); @@ -436,7 +470,9 @@ export class WebGLFunctionNode extends FunctionNode { return bitwiseResult; } const upconvertableOperators = { - '%': this.fixIntegerDivisionAccuracy ? 'integerCorrectionModulo' : 'modulo', + '%': this.fixIntegerDivisionAccuracy + ? 'integerCorrectionModulo' + : 'modulo', '**': 'pow', }; const foundOperator = upconvertableOperators[ast.operator]; @@ -597,7 +633,10 @@ export class WebGLFunctionNode extends FunctionNode { */ astIdentifierExpression(idtNode, retArr) { if (idtNode.type !== 'Identifier') { - throw this.astErrorOutput('IdentifierExpression - not an Identifier', idtNode); + throw this.astErrorOutput( + 'IdentifierExpression - not an Identifier', + idtNode + ); } const type = this.getType(idtNode); @@ -677,7 +716,11 @@ export class WebGLFunctionNode extends FunctionNode { if (isSafe) { const initString = initArr.join(''); const initNeedsSemiColon = initString[initString.length - 1] !== ';'; - retArr.push(`for (${initString}${initNeedsSemiColon ? ';' : ''}${testArr.join('')};${updateArr.join('')}){\n`); + retArr.push( + `for (${initString}${initNeedsSemiColon ? ';' : ''}${testArr.join( + '' + )};${updateArr.join('')}){\n` + ); retArr.push(bodyArr.join('')); retArr.push('}\n'); } else { @@ -685,7 +728,9 @@ export class WebGLFunctionNode extends FunctionNode { if (initArr.length > 0) { retArr.push(initArr.join(''), '\n'); } - retArr.push(`for (int ${iVariableName}=0;${iVariableName} 0) { retArr.push(`if (!${testArr.join('')}) break;\n`); } @@ -708,7 +753,9 @@ export class WebGLFunctionNode extends FunctionNode { } const iVariableName = this.getInternalVariableName('safeI'); - retArr.push(`for (int ${iVariableName}=0;${iVariableName} 0) { for (let i = 0; i < this.plugins.length; i++) { const plugin = this.plugins[i]; - if (plugin.functionMatch === 'Math.random()' && plugin.functionReplace) { + if ( + plugin.functionMatch === 'Math.random()' && + plugin.functionReplace + ) { retArr.push(plugin.functionReplace); return retArr; } @@ -1442,10 +1556,17 @@ export class WebGLFunctionNode extends FunctionNode { if (targetType === argumentType) { if (argument.type === 'Identifier') { retArr.push(`user_${utils.sanitizeName(argument.name)}`); - } else if (argument.type === 'ArrayExpression' || argument.type === 'MemberExpression' || argument.type === 'CallExpression') { + } else if ( + argument.type === 'ArrayExpression' || + argument.type === 'MemberExpression' || + argument.type === 'CallExpression' + ) { this.astGeneric(argument, retArr); } else { - throw this.astErrorOutput(`Unhandled argument type ${argument.type}`, ast); + throw this.astErrorOutput( + `Unhandled argument type ${argument.type}`, + ast + ); } continue; } @@ -1464,15 +1585,27 @@ export class WebGLFunctionNode extends FunctionNode { case 'Array': case 'Input': if (targetType === argumentType) { - if (argument.type !== 'Identifier') throw this.astErrorOutput(`Unhandled argument type ${argument.type}`, ast); - this.triggerImplyArgumentBitRatio(this.name, argument.name, functionName, i); + if (argument.type !== 'Identifier') + throw this.astErrorOutput( + `Unhandled argument type ${argument.type}`, + ast + ); + this.triggerImplyArgumentBitRatio( + this.name, + argument.name, + functionName, + i + ); const name = utils.sanitizeName(argument.name); retArr.push(`user_${name},user_${name}Size,user_${name}Dim`); continue; } break; } - throw this.astErrorOutput(`Unhandled argument combination of ${argumentType} and ${targetType} for argument named "${argument.name}"`, ast); + throw this.astErrorOutput( + `Unhandled argument combination of ${argumentType} and ${targetType} for argument named "${argument.name}"`, + ast + ); } } // Close arguments space diff --git a/src/backend/web-gl/kernel-value-maps.js b/src/backend/web-gl/kernel-value-maps.js index 66b9ca3d..ea9c080e 100644 --- a/src/backend/web-gl/kernel-value-maps.js +++ b/src/backend/web-gl/kernel-value-maps.js @@ -64,7 +64,8 @@ export const kernelValueMaps = { 'ArrayTexture(2)': WebGLKernelValueDynamicNumberTexture, 'ArrayTexture(3)': WebGLKernelValueDynamicNumberTexture, 'ArrayTexture(4)': WebGLKernelValueDynamicNumberTexture, - MemoryOptimizedNumberTexture: WebGLKernelValueDynamicMemoryOptimizedNumberTexture, + MemoryOptimizedNumberTexture: + WebGLKernelValueDynamicMemoryOptimizedNumberTexture, HTMLCanvas: WebGLKernelValueDynamicHTMLImage, OffscreenCanvas: WebGLKernelValueDynamicHTMLImage, HTMLImage: WebGLKernelValueDynamicHTMLImage, @@ -96,7 +97,8 @@ export const kernelValueMaps = { 'ArrayTexture(2)': WebGLKernelValueNumberTexture, 'ArrayTexture(3)': WebGLKernelValueNumberTexture, 'ArrayTexture(4)': WebGLKernelValueNumberTexture, - MemoryOptimizedNumberTexture: WebGLKernelValueMemoryOptimizedNumberTexture, + MemoryOptimizedNumberTexture: + WebGLKernelValueMemoryOptimizedNumberTexture, HTMLCanvas: WebGLKernelValueHTMLImage, OffscreenCanvas: WebGLKernelValueHTMLImage, HTMLImage: WebGLKernelValueHTMLImage, @@ -130,7 +132,8 @@ export const kernelValueMaps = { 'ArrayTexture(2)': WebGLKernelValueDynamicNumberTexture, 'ArrayTexture(3)': WebGLKernelValueDynamicNumberTexture, 'ArrayTexture(4)': WebGLKernelValueDynamicNumberTexture, - MemoryOptimizedNumberTexture: WebGLKernelValueDynamicMemoryOptimizedNumberTexture, + MemoryOptimizedNumberTexture: + WebGLKernelValueDynamicMemoryOptimizedNumberTexture, HTMLCanvas: WebGLKernelValueDynamicHTMLImage, OffscreenCanvas: WebGLKernelValueDynamicHTMLImage, HTMLImage: WebGLKernelValueDynamicHTMLImage, @@ -162,7 +165,8 @@ export const kernelValueMaps = { 'ArrayTexture(2)': WebGLKernelValueNumberTexture, 'ArrayTexture(3)': WebGLKernelValueNumberTexture, 'ArrayTexture(4)': WebGLKernelValueNumberTexture, - MemoryOptimizedNumberTexture: WebGLKernelValueMemoryOptimizedNumberTexture, + MemoryOptimizedNumberTexture: + WebGLKernelValueMemoryOptimizedNumberTexture, HTMLCanvas: WebGLKernelValueHTMLImage, OffscreenCanvas: WebGLKernelValueHTMLImage, HTMLImage: WebGLKernelValueHTMLImage, diff --git a/src/backend/web-gl/kernel-value/array.js b/src/backend/web-gl/kernel-value/array.js index 7c2b4e66..04f25ae3 100644 --- a/src/backend/web-gl/kernel-value/array.js +++ b/src/backend/web-gl/kernel-value/array.js @@ -15,11 +15,17 @@ export class WebGLKernelArray extends WebGLKernelValue { const { maxTextureSize } = this.kernel.constructor.features; if (width > maxTextureSize || height > maxTextureSize) { if (width > height) { - throw new Error(`Argument texture width of ${width} larger than maximum size of ${maxTextureSize} for your GPU`); + throw new Error( + `Argument texture width of ${width} larger than maximum size of ${maxTextureSize} for your GPU` + ); } else if (width < height) { - throw new Error(`Argument texture height of ${height} larger than maximum size of ${maxTextureSize} for your GPU`); + throw new Error( + `Argument texture height of ${height} larger than maximum size of ${maxTextureSize} for your GPU` + ); } else { - throw new Error(`Argument texture height and width of ${height} larger than maximum size of ${maxTextureSize} for your GPU`); + throw new Error( + `Argument texture height and width of ${height} larger than maximum size of ${maxTextureSize} for your GPU` + ); } } } diff --git a/src/backend/web-gl/kernel-value/dynamic-html-image.js b/src/backend/web-gl/kernel-value/dynamic-html-image.js index 47bdd870..1b985f21 100644 --- a/src/backend/web-gl/kernel-value/dynamic-html-image.js +++ b/src/backend/web-gl/kernel-value/dynamic-html-image.js @@ -3,7 +3,11 @@ import { WebGLKernelValueHTMLImage } from './html-image'; export class WebGLKernelValueDynamicHTMLImage extends WebGLKernelValueHTMLImage { getSource() { - return utils.linesToString([`uniform sampler2D ${this.id}`, `uniform ivec2 ${this.sizeId}`, `uniform ivec3 ${this.dimensionsId}`]); + return utils.linesToString([ + `uniform sampler2D ${this.id}`, + `uniform ivec2 ${this.sizeId}`, + `uniform ivec3 ${this.dimensionsId}`, + ]); } updateValue(value) { diff --git a/src/backend/web-gl/kernel-value/dynamic-memory-optimized-number-texture.js b/src/backend/web-gl/kernel-value/dynamic-memory-optimized-number-texture.js index ca7f0252..f093f76c 100644 --- a/src/backend/web-gl/kernel-value/dynamic-memory-optimized-number-texture.js +++ b/src/backend/web-gl/kernel-value/dynamic-memory-optimized-number-texture.js @@ -3,7 +3,11 @@ import { WebGLKernelValueMemoryOptimizedNumberTexture } from './memory-optimized export class WebGLKernelValueDynamicMemoryOptimizedNumberTexture extends WebGLKernelValueMemoryOptimizedNumberTexture { getSource() { - return utils.linesToString([`uniform sampler2D ${this.id}`, `uniform ivec2 ${this.sizeId}`, `uniform ivec3 ${this.dimensionsId}`]); + return utils.linesToString([ + `uniform sampler2D ${this.id}`, + `uniform ivec2 ${this.sizeId}`, + `uniform ivec3 ${this.dimensionsId}`, + ]); } updateValue(inputTexture) { diff --git a/src/backend/web-gl/kernel-value/dynamic-number-texture.js b/src/backend/web-gl/kernel-value/dynamic-number-texture.js index 047ed53a..75b18735 100644 --- a/src/backend/web-gl/kernel-value/dynamic-number-texture.js +++ b/src/backend/web-gl/kernel-value/dynamic-number-texture.js @@ -3,7 +3,11 @@ import { WebGLKernelValueNumberTexture } from './number-texture'; export class WebGLKernelValueDynamicNumberTexture extends WebGLKernelValueNumberTexture { getSource() { - return utils.linesToString([`uniform sampler2D ${this.id}`, `uniform ivec2 ${this.sizeId}`, `uniform ivec3 ${this.dimensionsId}`]); + return utils.linesToString([ + `uniform sampler2D ${this.id}`, + `uniform ivec2 ${this.sizeId}`, + `uniform ivec3 ${this.dimensionsId}`, + ]); } updateValue(value) { diff --git a/src/backend/web-gl/kernel-value/dynamic-single-array.js b/src/backend/web-gl/kernel-value/dynamic-single-array.js index 41abba36..f27c41c8 100644 --- a/src/backend/web-gl/kernel-value/dynamic-single-array.js +++ b/src/backend/web-gl/kernel-value/dynamic-single-array.js @@ -3,13 +3,21 @@ import { WebGLKernelValueSingleArray } from './single-array'; export class WebGLKernelValueDynamicSingleArray extends WebGLKernelValueSingleArray { getSource() { - return utils.linesToString([`uniform sampler2D ${this.id}`, `uniform ivec2 ${this.sizeId}`, `uniform ivec3 ${this.dimensionsId}`]); + return utils.linesToString([ + `uniform sampler2D ${this.id}`, + `uniform ivec2 ${this.sizeId}`, + `uniform ivec3 ${this.dimensionsId}`, + ]); } updateValue(value) { this.dimensions = utils.getDimensions(value, true); - this.textureSize = utils.getMemoryOptimizedFloatTextureSize(this.dimensions, this.bitRatio); - this.uploadArrayLength = this.textureSize[0] * this.textureSize[1] * this.bitRatio; + this.textureSize = utils.getMemoryOptimizedFloatTextureSize( + this.dimensions, + this.bitRatio + ); + this.uploadArrayLength = + this.textureSize[0] * this.textureSize[1] * this.bitRatio; this.checkSize(this.textureSize[0], this.textureSize[1]); this.uploadValue = new Float32Array(this.uploadArrayLength); this.kernel.setUniform3iv(this.dimensionsId, this.dimensions); diff --git a/src/backend/web-gl/kernel-value/dynamic-single-array1d-i.js b/src/backend/web-gl/kernel-value/dynamic-single-array1d-i.js index d05ff219..338f4e68 100644 --- a/src/backend/web-gl/kernel-value/dynamic-single-array1d-i.js +++ b/src/backend/web-gl/kernel-value/dynamic-single-array1d-i.js @@ -3,7 +3,11 @@ import { WebGLKernelValueSingleArray1DI } from './single-array1d-i'; export class WebGLKernelValueDynamicSingleArray1DI extends WebGLKernelValueSingleArray1DI { getSource() { - return utils.linesToString([`uniform sampler2D ${this.id}`, `uniform ivec2 ${this.sizeId}`, `uniform ivec3 ${this.dimensionsId}`]); + return utils.linesToString([ + `uniform sampler2D ${this.id}`, + `uniform ivec2 ${this.sizeId}`, + `uniform ivec3 ${this.dimensionsId}`, + ]); } updateValue(value) { diff --git a/src/backend/web-gl/kernel-value/dynamic-single-array2d-i.js b/src/backend/web-gl/kernel-value/dynamic-single-array2d-i.js index d47e31a8..28d52727 100644 --- a/src/backend/web-gl/kernel-value/dynamic-single-array2d-i.js +++ b/src/backend/web-gl/kernel-value/dynamic-single-array2d-i.js @@ -3,7 +3,11 @@ import { WebGLKernelValueSingleArray2DI } from './single-array2d-i'; export class WebGLKernelValueDynamicSingleArray2DI extends WebGLKernelValueSingleArray2DI { getSource() { - return utils.linesToString([`uniform sampler2D ${this.id}`, `uniform ivec2 ${this.sizeId}`, `uniform ivec3 ${this.dimensionsId}`]); + return utils.linesToString([ + `uniform sampler2D ${this.id}`, + `uniform ivec2 ${this.sizeId}`, + `uniform ivec3 ${this.dimensionsId}`, + ]); } updateValue(value) { diff --git a/src/backend/web-gl/kernel-value/dynamic-single-array3d-i.js b/src/backend/web-gl/kernel-value/dynamic-single-array3d-i.js index aa358d32..2a5c1932 100644 --- a/src/backend/web-gl/kernel-value/dynamic-single-array3d-i.js +++ b/src/backend/web-gl/kernel-value/dynamic-single-array3d-i.js @@ -3,7 +3,11 @@ import { WebGLKernelValueSingleArray3DI } from './single-array3d-i'; export class WebGLKernelValueDynamicSingleArray3DI extends WebGLKernelValueSingleArray3DI { getSource() { - return utils.linesToString([`uniform sampler2D ${this.id}`, `uniform ivec2 ${this.sizeId}`, `uniform ivec3 ${this.dimensionsId}`]); + return utils.linesToString([ + `uniform sampler2D ${this.id}`, + `uniform ivec2 ${this.sizeId}`, + `uniform ivec3 ${this.dimensionsId}`, + ]); } updateValue(value) { diff --git a/src/backend/web-gl/kernel-value/dynamic-single-input.js b/src/backend/web-gl/kernel-value/dynamic-single-input.js index 26767940..0331d588 100644 --- a/src/backend/web-gl/kernel-value/dynamic-single-input.js +++ b/src/backend/web-gl/kernel-value/dynamic-single-input.js @@ -3,14 +3,22 @@ import { WebGLKernelValueSingleInput } from './single-input'; export class WebGLKernelValueDynamicSingleInput extends WebGLKernelValueSingleInput { getSource() { - return utils.linesToString([`uniform sampler2D ${this.id}`, `uniform ivec2 ${this.sizeId}`, `uniform ivec3 ${this.dimensionsId}`]); + return utils.linesToString([ + `uniform sampler2D ${this.id}`, + `uniform ivec2 ${this.sizeId}`, + `uniform ivec3 ${this.dimensionsId}`, + ]); } updateValue(value) { let [w, h, d] = value.size; this.dimensions = new Int32Array([w || 1, h || 1, d || 1]); - this.textureSize = utils.getMemoryOptimizedFloatTextureSize(this.dimensions, this.bitRatio); - this.uploadArrayLength = this.textureSize[0] * this.textureSize[1] * this.bitRatio; + this.textureSize = utils.getMemoryOptimizedFloatTextureSize( + this.dimensions, + this.bitRatio + ); + this.uploadArrayLength = + this.textureSize[0] * this.textureSize[1] * this.bitRatio; this.checkSize(this.textureSize[0], this.textureSize[1]); this.uploadValue = new Float32Array(this.uploadArrayLength); this.kernel.setUniform3iv(this.dimensionsId, this.dimensions); diff --git a/src/backend/web-gl/kernel-value/dynamic-unsigned-array.js b/src/backend/web-gl/kernel-value/dynamic-unsigned-array.js index febe30de..802b4f07 100644 --- a/src/backend/web-gl/kernel-value/dynamic-unsigned-array.js +++ b/src/backend/web-gl/kernel-value/dynamic-unsigned-array.js @@ -3,13 +3,21 @@ import { WebGLKernelValueUnsignedArray } from './unsigned-array'; export class WebGLKernelValueDynamicUnsignedArray extends WebGLKernelValueUnsignedArray { getSource() { - return utils.linesToString([`uniform sampler2D ${this.id}`, `uniform ivec2 ${this.sizeId}`, `uniform ivec3 ${this.dimensionsId}`]); + return utils.linesToString([ + `uniform sampler2D ${this.id}`, + `uniform ivec2 ${this.sizeId}`, + `uniform ivec3 ${this.dimensionsId}`, + ]); } updateValue(value) { this.dimensions = utils.getDimensions(value, true); - this.textureSize = utils.getMemoryOptimizedPackedTextureSize(this.dimensions, this.bitRatio); - this.uploadArrayLength = this.textureSize[0] * this.textureSize[1] * (4 / this.bitRatio); + this.textureSize = utils.getMemoryOptimizedPackedTextureSize( + this.dimensions, + this.bitRatio + ); + this.uploadArrayLength = + this.textureSize[0] * this.textureSize[1] * (4 / this.bitRatio); this.checkSize(this.textureSize[0], this.textureSize[1]); const Type = this.getTransferArrayType(value); this.preUploadValue = new Type(this.uploadArrayLength); diff --git a/src/backend/web-gl/kernel-value/dynamic-unsigned-input.js b/src/backend/web-gl/kernel-value/dynamic-unsigned-input.js index 6cc36c50..83d236ac 100644 --- a/src/backend/web-gl/kernel-value/dynamic-unsigned-input.js +++ b/src/backend/web-gl/kernel-value/dynamic-unsigned-input.js @@ -3,14 +3,22 @@ import { WebGLKernelValueUnsignedInput } from './unsigned-input'; export class WebGLKernelValueDynamicUnsignedInput extends WebGLKernelValueUnsignedInput { getSource() { - return utils.linesToString([`uniform sampler2D ${this.id}`, `uniform ivec2 ${this.sizeId}`, `uniform ivec3 ${this.dimensionsId}`]); + return utils.linesToString([ + `uniform sampler2D ${this.id}`, + `uniform ivec2 ${this.sizeId}`, + `uniform ivec3 ${this.dimensionsId}`, + ]); } updateValue(value) { let [w, h, d] = value.size; this.dimensions = new Int32Array([w || 1, h || 1, d || 1]); - this.textureSize = utils.getMemoryOptimizedPackedTextureSize(this.dimensions, this.bitRatio); - this.uploadArrayLength = this.textureSize[0] * this.textureSize[1] * (4 / this.bitRatio); + this.textureSize = utils.getMemoryOptimizedPackedTextureSize( + this.dimensions, + this.bitRatio + ); + this.uploadArrayLength = + this.textureSize[0] * this.textureSize[1] * (4 / this.bitRatio); this.checkSize(this.textureSize[0], this.textureSize[1]); const Type = this.getTransferArrayType(value.value); this.preUploadValue = new Type(this.uploadArrayLength); diff --git a/src/backend/web-gl/kernel-value/html-image.js b/src/backend/web-gl/kernel-value/html-image.js index 9777d34b..308ed2a2 100644 --- a/src/backend/web-gl/kernel-value/html-image.js +++ b/src/backend/web-gl/kernel-value/html-image.js @@ -16,7 +16,11 @@ export class WebGLKernelValueHTMLImage extends WebGLKernelArray { } getSource() { - return utils.linesToString([`uniform sampler2D ${this.id}`, `ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`, `ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`]); + return utils.linesToString([ + `uniform sampler2D ${this.id}`, + `ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`, + `ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`, + ]); } updateValue(inputImage) { @@ -28,7 +32,14 @@ export class WebGLKernelValueHTMLImage extends WebGLKernelArray { gl.activeTexture(this.contextHandle); gl.bindTexture(gl.TEXTURE_2D, this.texture); gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true); - gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, (this.uploadValue = inputImage)); + gl.texImage2D( + gl.TEXTURE_2D, + 0, + gl.RGBA, + gl.RGBA, + gl.UNSIGNED_BYTE, + (this.uploadValue = inputImage) + ); this.kernel.setUniform1i(this.id, this.index); } } diff --git a/src/backend/web-gl/kernel-value/index.js b/src/backend/web-gl/kernel-value/index.js index c9ca7945..38a82e92 100644 --- a/src/backend/web-gl/kernel-value/index.js +++ b/src/backend/web-gl/kernel-value/index.js @@ -43,7 +43,9 @@ export class WebGLKernelValue extends KernelValue { case Float64Array: return value.constructor; } - console.warn('Unfamiliar constructor type. Will go ahead and use, but likley this may result in a transfer of zeros'); + console.warn( + 'Unfamiliar constructor type. Will go ahead and use, but likley this may result in a transfer of zeros' + ); return value.constructor; } @@ -51,11 +53,16 @@ export class WebGLKernelValue extends KernelValue { * Used for when we want a string output of our kernel, so we can still input values to the kernel */ getStringValueHandler() { - throw new Error(`"getStringValueHandler" not implemented on ${this.constructor.name}`); + throw new Error( + `"getStringValueHandler" not implemented on ${this.constructor.name}` + ); } getVariablePrecisionString() { - return this.kernel.getVariablePrecisionString(this.textureSize || undefined, this.tactic || undefined); + return this.kernel.getVariablePrecisionString( + this.textureSize || undefined, + this.tactic || undefined + ); } destroy() {} diff --git a/src/backend/web-gl/kernel-value/memory-optimized-number-texture.js b/src/backend/web-gl/kernel-value/memory-optimized-number-texture.js index 84f615b1..c89a54c5 100644 --- a/src/backend/web-gl/kernel-value/memory-optimized-number-texture.js +++ b/src/backend/web-gl/kernel-value/memory-optimized-number-texture.js @@ -23,7 +23,11 @@ export class WebGLKernelValueMemoryOptimizedNumberTexture extends WebGLKernelArr } getSource() { - return utils.linesToString([`uniform sampler2D ${this.id}`, `ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`, `ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`]); + return utils.linesToString([ + `uniform sampler2D ${this.id}`, + `ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`, + `ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`, + ]); } /** @@ -35,7 +39,9 @@ export class WebGLKernelValueMemoryOptimizedNumberTexture extends WebGLKernelArr return; } if (this.checkContext && inputTexture.context !== this.context) { - throw new Error(`Value ${this.name} (${this.type}) must be from same context`); + throw new Error( + `Value ${this.name} (${this.type}) must be from same context` + ); } const { kernel, context: gl } = this; @@ -43,7 +49,10 @@ export class WebGLKernelValueMemoryOptimizedNumberTexture extends WebGLKernelArr if (kernel.immutable) { kernel.updateTextureArgumentRefs(this, inputTexture); } else { - if (kernel.texture && kernel.texture.texture === inputTexture.texture) { + if ( + kernel.texture && + kernel.texture.texture === inputTexture.texture + ) { throw new Error(sameError); } else if (kernel.mappedTextures) { const { mappedTextures } = kernel; diff --git a/src/backend/web-gl/kernel-value/number-texture.js b/src/backend/web-gl/kernel-value/number-texture.js index 5eded24a..0c49470c 100644 --- a/src/backend/web-gl/kernel-value/number-texture.js +++ b/src/backend/web-gl/kernel-value/number-texture.js @@ -24,7 +24,11 @@ export class WebGLKernelValueNumberTexture extends WebGLKernelArray { } getSource() { - return utils.linesToString([`uniform sampler2D ${this.id}`, `ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`, `ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`]); + return utils.linesToString([ + `uniform sampler2D ${this.id}`, + `ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`, + `ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`, + ]); } /** @@ -37,7 +41,9 @@ export class WebGLKernelValueNumberTexture extends WebGLKernelArray { return; } if (this.checkContext && inputTexture.context !== this.context) { - throw new Error(`Value ${this.name} (${this.type}) must be from same context`); + throw new Error( + `Value ${this.name} (${this.type}) must be from same context` + ); } const { kernel, context: gl } = this; @@ -45,7 +51,10 @@ export class WebGLKernelValueNumberTexture extends WebGLKernelArray { if (kernel.immutable) { kernel.updateTextureArgumentRefs(this, inputTexture); } else { - if (kernel.texture && kernel.texture.texture === inputTexture.texture) { + if ( + kernel.texture && + kernel.texture.texture === inputTexture.texture + ) { throw new Error(sameError); } else if (kernel.mappedTextures) { const { mappedTextures } = kernel; diff --git a/src/backend/web-gl/kernel-value/single-array.js b/src/backend/web-gl/kernel-value/single-array.js index ec4c985c..deddb64d 100644 --- a/src/backend/web-gl/kernel-value/single-array.js +++ b/src/backend/web-gl/kernel-value/single-array.js @@ -6,18 +6,29 @@ export class WebGLKernelValueSingleArray extends WebGLKernelArray { super(value, settings); this.bitRatio = 4; this.dimensions = utils.getDimensions(value, true); - this.textureSize = utils.getMemoryOptimizedFloatTextureSize(this.dimensions, this.bitRatio); - this.uploadArrayLength = this.textureSize[0] * this.textureSize[1] * this.bitRatio; + this.textureSize = utils.getMemoryOptimizedFloatTextureSize( + this.dimensions, + this.bitRatio + ); + this.uploadArrayLength = + this.textureSize[0] * this.textureSize[1] * this.bitRatio; this.checkSize(this.textureSize[0], this.textureSize[1]); this.uploadValue = new Float32Array(this.uploadArrayLength); } getStringValueHandler() { - return utils.linesToString([`const uploadValue_${this.name} = new Float32Array(${this.uploadArrayLength})`, `flattenTo(${this.varName}, uploadValue_${this.name})`]); + return utils.linesToString([ + `const uploadValue_${this.name} = new Float32Array(${this.uploadArrayLength})`, + `flattenTo(${this.varName}, uploadValue_${this.name})`, + ]); } getSource() { - return utils.linesToString([`uniform sampler2D ${this.id}`, `ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`, `ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`]); + return utils.linesToString([ + `uniform sampler2D ${this.id}`, + `ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`, + `ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`, + ]); } updateValue(value) { @@ -30,7 +41,17 @@ export class WebGLKernelValueSingleArray extends WebGLKernelArray { gl.activeTexture(this.contextHandle); gl.bindTexture(gl.TEXTURE_2D, this.texture); gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false); - gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, this.textureSize[0], this.textureSize[1], 0, gl.RGBA, gl.FLOAT, this.uploadValue); + gl.texImage2D( + gl.TEXTURE_2D, + 0, + gl.RGBA, + this.textureSize[0], + this.textureSize[1], + 0, + gl.RGBA, + gl.FLOAT, + this.uploadValue + ); this.kernel.setUniform1i(this.id, this.index); } } diff --git a/src/backend/web-gl/kernel-value/single-array1d-i.js b/src/backend/web-gl/kernel-value/single-array1d-i.js index 12518d0e..e896b4e4 100644 --- a/src/backend/web-gl/kernel-value/single-array1d-i.js +++ b/src/backend/web-gl/kernel-value/single-array1d-i.js @@ -10,19 +10,30 @@ export class WebGLKernelValueSingleArray1DI extends WebGLKernelArray { setShape(value) { const valueDimensions = utils.getDimensions(value, true); - this.textureSize = utils.getMemoryOptimizedFloatTextureSize(valueDimensions, this.bitRatio); + this.textureSize = utils.getMemoryOptimizedFloatTextureSize( + valueDimensions, + this.bitRatio + ); this.dimensions = new Int32Array([valueDimensions[1], 1, 1]); - this.uploadArrayLength = this.textureSize[0] * this.textureSize[1] * this.bitRatio; + this.uploadArrayLength = + this.textureSize[0] * this.textureSize[1] * this.bitRatio; this.checkSize(this.textureSize[0], this.textureSize[1]); this.uploadValue = new Float32Array(this.uploadArrayLength); } getStringValueHandler() { - return utils.linesToString([`const uploadValue_${this.name} = new Float32Array(${this.uploadArrayLength})`, `flattenTo(${this.varName}, uploadValue_${this.name})`]); + return utils.linesToString([ + `const uploadValue_${this.name} = new Float32Array(${this.uploadArrayLength})`, + `flattenTo(${this.varName}, uploadValue_${this.name})`, + ]); } getSource() { - return utils.linesToString([`uniform sampler2D ${this.id}`, `ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`, `ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`]); + return utils.linesToString([ + `uniform sampler2D ${this.id}`, + `ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`, + `ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`, + ]); } updateValue(value) { @@ -35,7 +46,17 @@ export class WebGLKernelValueSingleArray1DI extends WebGLKernelArray { gl.activeTexture(this.contextHandle); gl.bindTexture(gl.TEXTURE_2D, this.texture); gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false); - gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, this.textureSize[0], this.textureSize[1], 0, gl.RGBA, gl.FLOAT, this.uploadValue); + gl.texImage2D( + gl.TEXTURE_2D, + 0, + gl.RGBA, + this.textureSize[0], + this.textureSize[1], + 0, + gl.RGBA, + gl.FLOAT, + this.uploadValue + ); this.kernel.setUniform1i(this.id, this.index); } } diff --git a/src/backend/web-gl/kernel-value/single-array2d-i.js b/src/backend/web-gl/kernel-value/single-array2d-i.js index 20b24bf3..4d6447bb 100644 --- a/src/backend/web-gl/kernel-value/single-array2d-i.js +++ b/src/backend/web-gl/kernel-value/single-array2d-i.js @@ -10,19 +10,34 @@ export class WebGLKernelValueSingleArray2DI extends WebGLKernelArray { setShape(value) { const valueDimensions = utils.getDimensions(value, true); - this.textureSize = utils.getMemoryOptimizedFloatTextureSize(valueDimensions, this.bitRatio); - this.dimensions = new Int32Array([valueDimensions[1], valueDimensions[2], 1]); - this.uploadArrayLength = this.textureSize[0] * this.textureSize[1] * this.bitRatio; + this.textureSize = utils.getMemoryOptimizedFloatTextureSize( + valueDimensions, + this.bitRatio + ); + this.dimensions = new Int32Array([ + valueDimensions[1], + valueDimensions[2], + 1, + ]); + this.uploadArrayLength = + this.textureSize[0] * this.textureSize[1] * this.bitRatio; this.checkSize(this.textureSize[0], this.textureSize[1]); this.uploadValue = new Float32Array(this.uploadArrayLength); } getStringValueHandler() { - return utils.linesToString([`const uploadValue_${this.name} = new Float32Array(${this.uploadArrayLength})`, `flattenTo(${this.varName}, uploadValue_${this.name})`]); + return utils.linesToString([ + `const uploadValue_${this.name} = new Float32Array(${this.uploadArrayLength})`, + `flattenTo(${this.varName}, uploadValue_${this.name})`, + ]); } getSource() { - return utils.linesToString([`uniform sampler2D ${this.id}`, `ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`, `ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`]); + return utils.linesToString([ + `uniform sampler2D ${this.id}`, + `ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`, + `ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`, + ]); } updateValue(value) { @@ -35,7 +50,17 @@ export class WebGLKernelValueSingleArray2DI extends WebGLKernelArray { gl.activeTexture(this.contextHandle); gl.bindTexture(gl.TEXTURE_2D, this.texture); gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false); - gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, this.textureSize[0], this.textureSize[1], 0, gl.RGBA, gl.FLOAT, this.uploadValue); + gl.texImage2D( + gl.TEXTURE_2D, + 0, + gl.RGBA, + this.textureSize[0], + this.textureSize[1], + 0, + gl.RGBA, + gl.FLOAT, + this.uploadValue + ); this.kernel.setUniform1i(this.id, this.index); } } diff --git a/src/backend/web-gl/kernel-value/single-array3d-i.js b/src/backend/web-gl/kernel-value/single-array3d-i.js index b6b0a4ce..c9dc1eac 100644 --- a/src/backend/web-gl/kernel-value/single-array3d-i.js +++ b/src/backend/web-gl/kernel-value/single-array3d-i.js @@ -10,19 +10,34 @@ export class WebGLKernelValueSingleArray3DI extends WebGLKernelArray { setShape(value) { const valueDimensions = utils.getDimensions(value, true); - this.textureSize = utils.getMemoryOptimizedFloatTextureSize(valueDimensions, this.bitRatio); - this.dimensions = new Int32Array([valueDimensions[1], valueDimensions[2], valueDimensions[3]]); - this.uploadArrayLength = this.textureSize[0] * this.textureSize[1] * this.bitRatio; + this.textureSize = utils.getMemoryOptimizedFloatTextureSize( + valueDimensions, + this.bitRatio + ); + this.dimensions = new Int32Array([ + valueDimensions[1], + valueDimensions[2], + valueDimensions[3], + ]); + this.uploadArrayLength = + this.textureSize[0] * this.textureSize[1] * this.bitRatio; this.checkSize(this.textureSize[0], this.textureSize[1]); this.uploadValue = new Float32Array(this.uploadArrayLength); } getStringValueHandler() { - return utils.linesToString([`const uploadValue_${this.name} = new Float32Array(${this.uploadArrayLength})`, `flattenTo(${this.varName}, uploadValue_${this.name})`]); + return utils.linesToString([ + `const uploadValue_${this.name} = new Float32Array(${this.uploadArrayLength})`, + `flattenTo(${this.varName}, uploadValue_${this.name})`, + ]); } getSource() { - return utils.linesToString([`uniform sampler2D ${this.id}`, `ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`, `ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`]); + return utils.linesToString([ + `uniform sampler2D ${this.id}`, + `ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`, + `ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`, + ]); } updateValue(value) { @@ -35,7 +50,17 @@ export class WebGLKernelValueSingleArray3DI extends WebGLKernelArray { gl.activeTexture(this.contextHandle); gl.bindTexture(gl.TEXTURE_2D, this.texture); gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false); - gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, this.textureSize[0], this.textureSize[1], 0, gl.RGBA, gl.FLOAT, this.uploadValue); + gl.texImage2D( + gl.TEXTURE_2D, + 0, + gl.RGBA, + this.textureSize[0], + this.textureSize[1], + 0, + gl.RGBA, + gl.FLOAT, + this.uploadValue + ); this.kernel.setUniform1i(this.id, this.index); } } diff --git a/src/backend/web-gl/kernel-value/single-input.js b/src/backend/web-gl/kernel-value/single-input.js index 18e0c4ee..a26d2908 100644 --- a/src/backend/web-gl/kernel-value/single-input.js +++ b/src/backend/web-gl/kernel-value/single-input.js @@ -7,18 +7,29 @@ export class WebGLKernelValueSingleInput extends WebGLKernelArray { this.bitRatio = 4; let [w, h, d] = value.size; this.dimensions = new Int32Array([w || 1, h || 1, d || 1]); - this.textureSize = utils.getMemoryOptimizedFloatTextureSize(this.dimensions, this.bitRatio); - this.uploadArrayLength = this.textureSize[0] * this.textureSize[1] * this.bitRatio; + this.textureSize = utils.getMemoryOptimizedFloatTextureSize( + this.dimensions, + this.bitRatio + ); + this.uploadArrayLength = + this.textureSize[0] * this.textureSize[1] * this.bitRatio; this.checkSize(this.textureSize[0], this.textureSize[1]); this.uploadValue = new Float32Array(this.uploadArrayLength); } getStringValueHandler() { - return utils.linesToString([`const uploadValue_${this.name} = new Float32Array(${this.uploadArrayLength})`, `flattenTo(${this.varName}.value, uploadValue_${this.name})`]); + return utils.linesToString([ + `const uploadValue_${this.name} = new Float32Array(${this.uploadArrayLength})`, + `flattenTo(${this.varName}.value, uploadValue_${this.name})`, + ]); } getSource() { - return utils.linesToString([`uniform sampler2D ${this.id}`, `ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`, `ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`]); + return utils.linesToString([ + `uniform sampler2D ${this.id}`, + `ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`, + `ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`, + ]); } updateValue(input) { @@ -31,7 +42,17 @@ export class WebGLKernelValueSingleInput extends WebGLKernelArray { gl.activeTexture(this.contextHandle); gl.bindTexture(gl.TEXTURE_2D, this.texture); gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false); - gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, this.textureSize[0], this.textureSize[1], 0, gl.RGBA, gl.FLOAT, this.uploadValue); + gl.texImage2D( + gl.TEXTURE_2D, + 0, + gl.RGBA, + this.textureSize[0], + this.textureSize[1], + 0, + gl.RGBA, + gl.FLOAT, + this.uploadValue + ); this.kernel.setUniform1i(this.id, this.index); } } diff --git a/src/backend/web-gl/kernel-value/unsigned-array.js b/src/backend/web-gl/kernel-value/unsigned-array.js index 8c1158e0..34a46e2e 100644 --- a/src/backend/web-gl/kernel-value/unsigned-array.js +++ b/src/backend/web-gl/kernel-value/unsigned-array.js @@ -6,8 +6,12 @@ export class WebGLKernelValueUnsignedArray extends WebGLKernelArray { super(value, settings); this.bitRatio = this.getBitRatio(value); this.dimensions = utils.getDimensions(value, true); - this.textureSize = utils.getMemoryOptimizedPackedTextureSize(this.dimensions, this.bitRatio); - this.uploadArrayLength = this.textureSize[0] * this.textureSize[1] * (4 / this.bitRatio); + this.textureSize = utils.getMemoryOptimizedPackedTextureSize( + this.dimensions, + this.bitRatio + ); + this.uploadArrayLength = + this.textureSize[0] * this.textureSize[1] * (4 / this.bitRatio); this.checkSize(this.textureSize[0], this.textureSize[1]); this.TranserArrayType = this.getTransferArrayType(value); this.preUploadValue = new this.TranserArrayType(this.uploadArrayLength); @@ -15,11 +19,19 @@ export class WebGLKernelValueUnsignedArray extends WebGLKernelArray { } getStringValueHandler() { - return utils.linesToString([`const preUploadValue_${this.name} = new ${this.TranserArrayType.name}(${this.uploadArrayLength})`, `const uploadValue_${this.name} = new Uint8Array(preUploadValue_${this.name}.buffer)`, `flattenTo(${this.varName}, preUploadValue_${this.name})`]); + return utils.linesToString([ + `const preUploadValue_${this.name} = new ${this.TranserArrayType.name}(${this.uploadArrayLength})`, + `const uploadValue_${this.name} = new Uint8Array(preUploadValue_${this.name}.buffer)`, + `flattenTo(${this.varName}, preUploadValue_${this.name})`, + ]); } getSource() { - return utils.linesToString([`uniform sampler2D ${this.id}`, `ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`, `ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`]); + return utils.linesToString([ + `uniform sampler2D ${this.id}`, + `ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`, + `ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`, + ]); } updateValue(value) { @@ -32,7 +44,17 @@ export class WebGLKernelValueUnsignedArray extends WebGLKernelArray { gl.activeTexture(this.contextHandle); gl.bindTexture(gl.TEXTURE_2D, this.texture); gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false); - gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, this.textureSize[0], this.textureSize[1], 0, gl.RGBA, gl.UNSIGNED_BYTE, this.uploadValue); + gl.texImage2D( + gl.TEXTURE_2D, + 0, + gl.RGBA, + this.textureSize[0], + this.textureSize[1], + 0, + gl.RGBA, + gl.UNSIGNED_BYTE, + this.uploadValue + ); this.kernel.setUniform1i(this.id, this.index); } } diff --git a/src/backend/web-gl/kernel-value/unsigned-input.js b/src/backend/web-gl/kernel-value/unsigned-input.js index 8a9eaa62..4ab39d5d 100644 --- a/src/backend/web-gl/kernel-value/unsigned-input.js +++ b/src/backend/web-gl/kernel-value/unsigned-input.js @@ -7,8 +7,12 @@ export class WebGLKernelValueUnsignedInput extends WebGLKernelArray { this.bitRatio = this.getBitRatio(value); const [w, h, d] = value.size; this.dimensions = new Int32Array([w || 1, h || 1, d || 1]); - this.textureSize = utils.getMemoryOptimizedPackedTextureSize(this.dimensions, this.bitRatio); - this.uploadArrayLength = this.textureSize[0] * this.textureSize[1] * (4 / this.bitRatio); + this.textureSize = utils.getMemoryOptimizedPackedTextureSize( + this.dimensions, + this.bitRatio + ); + this.uploadArrayLength = + this.textureSize[0] * this.textureSize[1] * (4 / this.bitRatio); this.checkSize(this.textureSize[0], this.textureSize[1]); this.TranserArrayType = this.getTransferArrayType(value.value); this.preUploadValue = new this.TranserArrayType(this.uploadArrayLength); @@ -16,11 +20,19 @@ export class WebGLKernelValueUnsignedInput extends WebGLKernelArray { } getStringValueHandler() { - return utils.linesToString([`const preUploadValue_${this.name} = new ${this.TranserArrayType.name}(${this.uploadArrayLength})`, `const uploadValue_${this.name} = new Uint8Array(preUploadValue_${this.name}.buffer)`, `flattenTo(${this.varName}.value, preUploadValue_${this.name})`]); + return utils.linesToString([ + `const preUploadValue_${this.name} = new ${this.TranserArrayType.name}(${this.uploadArrayLength})`, + `const uploadValue_${this.name} = new Uint8Array(preUploadValue_${this.name}.buffer)`, + `flattenTo(${this.varName}.value, preUploadValue_${this.name})`, + ]); } getSource() { - return utils.linesToString([`uniform sampler2D ${this.id}`, `ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`, `ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`]); + return utils.linesToString([ + `uniform sampler2D ${this.id}`, + `ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`, + `ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`, + ]); } updateValue(input) { @@ -33,7 +45,17 @@ export class WebGLKernelValueUnsignedInput extends WebGLKernelArray { gl.activeTexture(this.contextHandle); gl.bindTexture(gl.TEXTURE_2D, this.texture); gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false); - gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, this.textureSize[0], this.textureSize[1], 0, gl.RGBA, gl.UNSIGNED_BYTE, this.uploadValue); + gl.texImage2D( + gl.TEXTURE_2D, + 0, + gl.RGBA, + this.textureSize[0], + this.textureSize[1], + 0, + gl.RGBA, + gl.UNSIGNED_BYTE, + this.uploadValue + ); this.kernel.setUniform1i(this.id, this.index); } } diff --git a/src/backend/web-gl/kernel.js b/src/backend/web-gl/kernel.js index b12993d4..d994921c 100644 --- a/src/backend/web-gl/kernel.js +++ b/src/backend/web-gl/kernel.js @@ -61,12 +61,18 @@ export class WebGLKernel extends GLKernel { testCanvas = new OffscreenCanvas(0, 0); } if (!testCanvas) return; - testContext = testCanvas.getContext('webgl') || testCanvas.getContext('experimental-webgl'); + testContext = + testCanvas.getContext('webgl') || + testCanvas.getContext('experimental-webgl'); if (!testContext || !testContext.getExtension) return; testExtensions = { OES_texture_float: testContext.getExtension('OES_texture_float'), - OES_texture_float_linear: testContext.getExtension('OES_texture_float_linear'), - OES_element_index_uint: testContext.getExtension('OES_element_index_uint'), + OES_texture_float_linear: testContext.getExtension( + 'OES_texture_float_linear' + ), + OES_element_index_uint: testContext.getExtension( + 'OES_element_index_uint' + ), WEBGL_draw_buffers: testContext.getExtension('WEBGL_draw_buffers'), }; features = this.getFeatures(); @@ -88,7 +94,11 @@ export class WebGLKernel extends GLKernel { } static getChannelCount() { - return testExtensions.WEBGL_draw_buffers ? testContext.getParameter(testExtensions.WEBGL_draw_buffers.MAX_DRAW_BUFFERS_WEBGL) : 1; + return testExtensions.WEBGL_draw_buffers + ? testContext.getParameter( + testExtensions.WEBGL_draw_buffers.MAX_DRAW_BUFFERS_WEBGL + ) + : 1; } static getMaxTextureSize() { @@ -198,7 +208,10 @@ export class WebGLKernel extends GLKernel { depth: false, antialias: false, }; - return this.canvas.getContext('webgl', settings) || this.canvas.getContext('experimental-webgl', settings); + return ( + this.canvas.getContext('webgl', settings) || + this.canvas.getContext('experimental-webgl', settings) + ); } /** @@ -223,7 +236,9 @@ export class WebGLKernel extends GLKernel { //TODO: in context of JSON support, pluginNames may not exist here for (let i = 0; i < plugins.length; i++) { const plugin = plugins[i]; - const usePlugin = settings.pluginNames.some(pluginName => pluginName === plugin.name); + const usePlugin = settings.pluginNames.some( + pluginName => pluginName === plugin.name + ); if (usePlugin) { pluginsToUse.push(plugin); } @@ -236,10 +251,16 @@ export class WebGLKernel extends GLKernel { initExtensions() { this.extensions = { OES_texture_float: this.context.getExtension('OES_texture_float'), - OES_texture_float_linear: this.context.getExtension('OES_texture_float_linear'), - OES_element_index_uint: this.context.getExtension('OES_element_index_uint'), + OES_texture_float_linear: this.context.getExtension( + 'OES_texture_float_linear' + ), + OES_element_index_uint: this.context.getExtension( + 'OES_element_index_uint' + ), WEBGL_draw_buffers: this.context.getExtension('WEBGL_draw_buffers'), - WEBGL_color_buffer_float: this.context.getExtension('WEBGL_color_buffer_float'), + WEBGL_color_buffer_float: this.context.getExtension( + 'WEBGL_color_buffer_float' + ), }; } @@ -265,17 +286,28 @@ export class WebGLKernel extends GLKernel { throw new Error('Float textures are not supported'); } else if (this.precision === 'single' && !features.isFloatRead) { throw new Error('Single precision not supported'); - } else if (!this.graphical && this.precision === null && features.isTextureFloat) { + } else if ( + !this.graphical && + this.precision === null && + features.isTextureFloat + ) { this.precision = features.isFloatRead ? 'single' : 'unsigned'; } - if (this.subKernels && this.subKernels.length > 0 && !this.extensions.WEBGL_draw_buffers) { + if ( + this.subKernels && + this.subKernels.length > 0 && + !this.extensions.WEBGL_draw_buffers + ) { throw new Error('could not instantiate draw buffers extension'); } if (this.fixIntegerDivisionAccuracy === null) { this.fixIntegerDivisionAccuracy = !features.isIntegerDivisionAccurate; - } else if (this.fixIntegerDivisionAccuracy && features.isIntegerDivisionAccurate) { + } else if ( + this.fixIntegerDivisionAccuracy && + features.isIntegerDivisionAccurate + ) { this.fixIntegerDivisionAccuracy = false; } @@ -283,7 +315,9 @@ export class WebGLKernel extends GLKernel { if (!this.output || this.output.length === 0) { if (args.length !== 1) { - throw new Error('Auto output only supported for kernels with only one input'); + throw new Error( + 'Auto output only supported for kernels with only one input' + ); } const argType = utils.getVariableType(args[0], this.strictIntegers); @@ -300,7 +334,9 @@ export class WebGLKernel extends GLKernel { this.output = args[0].output; break; default: - throw new Error('Auto output not supported for input type: ' + argType); + throw new Error( + 'Auto output not supported for input type: ' + argType + ); } } @@ -311,7 +347,9 @@ export class WebGLKernel extends GLKernel { if (this.precision === 'precision') { this.precision = 'unsigned'; - console.warn('Cannot use graphical mode and single precision at the same time'); + console.warn( + 'Cannot use graphical mode and single precision at the same time' + ); } this.texSize = utils.clone(this.output); @@ -384,7 +422,9 @@ export class WebGLKernel extends GLKernel { }); }; const onRequestContextHandle = () => { - return gl.TEXTURE0 + this.constantTextureCount + this.argumentTextureCount++; + return ( + gl.TEXTURE0 + this.constantTextureCount + this.argumentTextureCount++ + ); }; for (let index = 0; index < args.length; index++) { @@ -397,7 +437,12 @@ export class WebGLKernel extends GLKernel { } else { type = this.argumentTypes[index]; } - const KernelValue = this.constructor.lookupKernelValueType(type, this.dynamicArguments ? 'dynamic' : 'static', this.precision, args[index]); + const KernelValue = this.constructor.lookupKernelValueType( + type, + this.dynamicArguments ? 'dynamic' : 'static', + this.precision, + args[index] + ); if (KernelValue === null) { return this.requestFallback(args); } @@ -447,7 +492,12 @@ export class WebGLKernel extends GLKernel { } else { type = this.constantTypes[name]; } - const KernelValue = this.constructor.lookupKernelValueType(type, 'static', this.precision, value); + const KernelValue = this.constructor.lookupKernelValueType( + type, + 'static', + this.precision, + value + ); if (KernelValue === null) { return this.requestFallback(args); } @@ -527,10 +577,14 @@ export class WebGLKernel extends GLKernel { } if (!gl.getShaderParameter(vertShader, gl.COMPILE_STATUS)) { - throw new Error('Error compiling vertex shader: ' + gl.getShaderInfoLog(vertShader)); + throw new Error( + 'Error compiling vertex shader: ' + gl.getShaderInfoLog(vertShader) + ); } if (!gl.getShaderParameter(fragShader, gl.COMPILE_STATUS)) { - throw new Error('Error compiling fragment shader: ' + gl.getShaderInfoLog(fragShader)); + throw new Error( + 'Error compiling fragment shader: ' + gl.getShaderInfoLog(fragShader) + ); } const program = (this.program = gl.createProgram()); @@ -551,7 +605,11 @@ export class WebGLKernel extends GLKernel { if (!buffer) { buffer = this.buffer = gl.createBuffer(); gl.bindBuffer(gl.ARRAY_BUFFER, buffer); - gl.bufferData(gl.ARRAY_BUFFER, vertices.byteLength + texCoords.byteLength, gl.STATIC_DRAW); + gl.bufferData( + gl.ARRAY_BUFFER, + vertices.byteLength + texCoords.byteLength, + gl.STATIC_DRAW + ); } else { gl.bindBuffer(gl.ARRAY_BUFFER, buffer); } @@ -564,7 +622,14 @@ export class WebGLKernel extends GLKernel { gl.vertexAttribPointer(aPosLoc, 2, gl.FLOAT, false, 0, 0); const aTexCoordLoc = gl.getAttribLocation(this.program, 'aTexCoord'); gl.enableVertexAttribArray(aTexCoordLoc); - gl.vertexAttribPointer(aTexCoordLoc, 2, gl.FLOAT, false, 0, texCoordOffset); + gl.vertexAttribPointer( + aTexCoordLoc, + 2, + gl.FLOAT, + false, + 0, + texCoordOffset + ); gl.bindFramebuffer(gl.FRAMEBUFFER, this.framebuffer); let i = 0; @@ -583,9 +648,13 @@ export class WebGLKernel extends GLKernel { } translateSource() { - const functionBuilder = FunctionBuilder.fromKernel(this, WebGLFunctionNode, { - fixIntegerDivisionAccuracy: this.fixIntegerDivisionAccuracy, - }); + const functionBuilder = FunctionBuilder.fromKernel( + this, + WebGLFunctionNode, + { + fixIntegerDivisionAccuracy: this.fixIntegerDivisionAccuracy, + } + ); this.translatedSource = functionBuilder.getPrototypeString('kernel'); this.setupReturnTypes(functionBuilder); } @@ -606,7 +675,12 @@ export class WebGLKernel extends GLKernel { } run() { - const { kernelArguments, texSize, forceUploadKernelConstants, context: gl } = this; + const { + kernelArguments, + texSize, + forceUploadKernelConstants, + context: gl, + } = this; gl.useProgram(this.program); gl.scissor(0, 0, texSize[0], texSize[1]); @@ -615,7 +689,11 @@ export class WebGLKernel extends GLKernel { this.setUniform2iv('uTexSize', texSize); } - this.setUniform2f('ratio', texSize[0] / this.maxTexSize[0], texSize[1] / this.maxTexSize[1]); + this.setUniform2f( + 'ratio', + texSize[0] / this.maxTexSize[0], + texSize[1] / this.maxTexSize[1] + ); for (let i = 0; i < forceUploadKernelConstants.length; i++) { const constant = forceUploadKernelConstants[i]; @@ -691,7 +769,13 @@ export class WebGLKernel extends GLKernel { _replaceOutputTexture() { if (this.texture.beforeMutate() || this._textureSwitched) { const gl = this.context; - gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.texture.texture, 0); + gl.framebufferTexture2D( + gl.FRAMEBUFFER, + gl.COLOR_ATTACHMENT0, + gl.TEXTURE_2D, + this.texture.texture, + 0 + ); this._textureSwitched = false; } } @@ -704,11 +788,19 @@ export class WebGLKernel extends GLKernel { const texSize = this.texSize; if (this.texture) { // here we inherit from an already existing kernel, so go ahead and just bind textures to the framebuffer - gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.texture.texture, 0); + gl.framebufferTexture2D( + gl.FRAMEBUFFER, + gl.COLOR_ATTACHMENT0, + gl.TEXTURE_2D, + this.texture.texture, + 0 + ); return; } const texture = this.createTexture(); - gl.activeTexture(gl.TEXTURE0 + this.constantTextureCount + this.argumentTextureCount); + gl.activeTexture( + gl.TEXTURE0 + this.constantTextureCount + this.argumentTextureCount + ); gl.bindTexture(gl.TEXTURE_2D, texture); gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); @@ -716,11 +808,37 @@ export class WebGLKernel extends GLKernel { gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST); const format = this.getInternalFormat(); if (this.precision === 'single') { - gl.texImage2D(gl.TEXTURE_2D, 0, format, texSize[0], texSize[1], 0, gl.RGBA, gl.FLOAT, null); + gl.texImage2D( + gl.TEXTURE_2D, + 0, + format, + texSize[0], + texSize[1], + 0, + gl.RGBA, + gl.FLOAT, + null + ); } else { - gl.texImage2D(gl.TEXTURE_2D, 0, format, texSize[0], texSize[1], 0, format, gl.UNSIGNED_BYTE, null); + gl.texImage2D( + gl.TEXTURE_2D, + 0, + format, + texSize[0], + texSize[1], + 0, + format, + gl.UNSIGNED_BYTE, + null + ); } - gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0); + gl.framebufferTexture2D( + gl.FRAMEBUFFER, + gl.COLOR_ATTACHMENT0, + gl.TEXTURE_2D, + texture, + 0 + ); this.texture = new this.TextureConstructor({ texture, size: texSize, @@ -742,7 +860,13 @@ export class WebGLKernel extends GLKernel { for (let i = 0; i < this.mappedTextures.length; i++) { const mappedTexture = this.mappedTextures[i]; if (mappedTexture.beforeMutate() || this._mappedTextureSwitched[i]) { - gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0 + i + 1, gl.TEXTURE_2D, mappedTexture.texture, 0); + gl.framebufferTexture2D( + gl.FRAMEBUFFER, + gl.COLOR_ATTACHMENT0 + i + 1, + gl.TEXTURE_2D, + mappedTexture.texture, + 0 + ); this._mappedTextureSwitched[i] = false; } } @@ -756,7 +880,13 @@ export class WebGLKernel extends GLKernel { if (this.mappedTextures) { // here we inherit from an already existing kernel, so go ahead and just bind textures to the framebuffer for (let i = 0; i < this.subKernels.length; i++) { - gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0 + i + 1, gl.TEXTURE_2D, this.mappedTextures[i].texture, 0); + gl.framebufferTexture2D( + gl.FRAMEBUFFER, + gl.COLOR_ATTACHMENT0 + i + 1, + gl.TEXTURE_2D, + this.mappedTextures[i].texture, + 0 + ); } return; } @@ -766,18 +896,46 @@ export class WebGLKernel extends GLKernel { for (let i = 0; i < this.subKernels.length; i++) { const texture = this.createTexture(); this.drawBuffersMap.push(gl.COLOR_ATTACHMENT0 + i + 1); - gl.activeTexture(gl.TEXTURE0 + this.constantTextureCount + this.argumentTextureCount + i); + gl.activeTexture( + gl.TEXTURE0 + this.constantTextureCount + this.argumentTextureCount + i + ); gl.bindTexture(gl.TEXTURE_2D, texture); gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST); gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST); if (this.precision === 'single') { - gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, texSize[0], texSize[1], 0, gl.RGBA, gl.FLOAT, null); + gl.texImage2D( + gl.TEXTURE_2D, + 0, + gl.RGBA, + texSize[0], + texSize[1], + 0, + gl.RGBA, + gl.FLOAT, + null + ); } else { - gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, texSize[0], texSize[1], 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + gl.texImage2D( + gl.TEXTURE_2D, + 0, + gl.RGBA, + texSize[0], + texSize[1], + 0, + gl.RGBA, + gl.UNSIGNED_BYTE, + null + ); } - gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0 + i + 1, gl.TEXTURE_2D, texture, 0); + gl.framebufferTexture2D( + gl.FRAMEBUFFER, + gl.COLOR_ATTACHMENT0 + i + 1, + gl.TEXTURE_2D, + texture, + 0 + ); this.mappedTextures.push( new this.TextureConstructor({ @@ -857,7 +1015,11 @@ export class WebGLKernel extends GLKernel { setUniform3fv(name, value) { if (this.uniform3fvCache.hasOwnProperty(name)) { const cache = this.uniform3fvCache[name]; - if (value[0] === cache[0] && value[1] === cache[1] && value[2] === cache[2]) { + if ( + value[0] === cache[0] && + value[1] === cache[1] && + value[2] === cache[2] + ) { return; } } @@ -869,7 +1031,11 @@ export class WebGLKernel extends GLKernel { setUniform3iv(name, value) { if (this.uniform3ivCache.hasOwnProperty(name)) { const cache = this.uniform3ivCache[name]; - if (value[0] === cache[0] && value[1] === cache[1] && value[2] === cache[2]) { + if ( + value[0] === cache[0] && + value[1] === cache[1] && + value[2] === cache[2] + ) { return; } } @@ -881,7 +1047,12 @@ export class WebGLKernel extends GLKernel { setUniform4fv(name, value) { if (this.uniform4fvCache.hasOwnProperty(name)) { const cache = this.uniform4fvCache[name]; - if (value[0] === cache[0] && value[1] === cache[1] && value[2] === cache[2] && value[3] === cache[3]) { + if ( + value[0] === cache[0] && + value[1] === cache[1] && + value[2] === cache[2] && + value[3] === cache[3] + ) { return; } } @@ -893,7 +1064,12 @@ export class WebGLKernel extends GLKernel { setUniform4iv(name, value) { if (this.uniform4ivCache.hasOwnProperty(name)) { const cache = this.uniform4ivCache[name]; - if (value[0] === cache[0] && value[1] === cache[1] && value[2] === cache[2] && value[3] === cache[3]) { + if ( + value[0] === cache[0] && + value[1] === cache[1] && + value[2] === cache[2] && + value[3] === cache[3] + ) { return; } } @@ -911,7 +1087,8 @@ export class WebGLKernel extends GLKernel { if (this.programUniformLocationCache.hasOwnProperty(name)) { return this.programUniformLocationCache[name]; } - return (this.programUniformLocationCache[name] = this.context.getUniformLocation(this.program, name)); + return (this.programUniformLocationCache[name] = + this.context.getUniformLocation(this.program, name)); } /** @@ -938,7 +1115,8 @@ export class WebGLKernel extends GLKernel { FLOAT_TACTIC_DECLARATION: this.getFloatTacticDeclaration(), INT_TACTIC_DECLARATION: this.getIntTacticDeclaration(), SAMPLER_2D_TACTIC_DECLARATION: this.getSampler2DTacticDeclaration(), - SAMPLER_2D_ARRAY_TACTIC_DECLARATION: this.getSampler2DArrayTacticDeclaration(), + SAMPLER_2D_ARRAY_TACTIC_DECLARATION: + this.getSampler2DArrayTacticDeclaration(), }; } @@ -954,7 +1132,8 @@ export class WebGLKernel extends GLKernel { FLOAT_TACTIC_DECLARATION: this.getFloatTacticDeclaration(), INT_TACTIC_DECLARATION: this.getIntTacticDeclaration(), SAMPLER_2D_TACTIC_DECLARATION: this.getSampler2DTacticDeclaration(), - SAMPLER_2D_ARRAY_TACTIC_DECLARATION: this.getSampler2DArrayTacticDeclaration(), + SAMPLER_2D_ARRAY_TACTIC_DECLARATION: + this.getSampler2DArrayTacticDeclaration(), }; } @@ -965,7 +1144,9 @@ export class WebGLKernel extends GLKernel { * @returns {String} result */ _getHeaderString() { - return this.subKernels !== null ? '#extension GL_EXT_draw_buffers : require\n' : ''; + return this.subKernels !== null + ? '#extension GL_EXT_draw_buffers : require\n' + : ''; } /** @@ -973,12 +1154,20 @@ export class WebGLKernel extends GLKernel { * @returns {String} result */ _getLoopMaxString() { - return this.loopMaxIterations ? ` ${parseInt(this.loopMaxIterations)};\n` : ' 1000;\n'; + return this.loopMaxIterations + ? ` ${parseInt(this.loopMaxIterations)};\n` + : ' 1000;\n'; } _getPluginsString() { if (!this.plugins) return '\n'; - return this.plugins.map(plugin => (plugin.source && this.source.match(plugin.functionMatch) ? plugin.source : '')).join('\n'); + return this.plugins + .map(plugin => + plugin.source && this.source.match(plugin.functionMatch) + ? plugin.source + : '' + ) + .join('\n'); } /** @@ -991,7 +1180,10 @@ export class WebGLKernel extends GLKernel { if (this.dynamicOutput) { result.push('uniform ivec3 uOutputDim', 'uniform ivec2 uTexSize'); } else { - result.push(`ivec3 uOutputDim = ivec3(${threadDim[0]}, ${threadDim[1]}, ${threadDim[2]})`, `ivec2 uTexSize = ivec2(${texSize[0]}, ${texSize[1]})`); + result.push( + `ivec3 uOutputDim = ivec3(${threadDim[0]}, ${threadDim[1]}, ${threadDim[2]})`, + `ivec2 uTexSize = ivec2(${texSize[0]}, ${texSize[1]})` + ); } return utils.linesToString(result); } @@ -1133,7 +1325,11 @@ float integerCorrectionModulo(float number, float divisor) { case 'Integer': for (let i = 0; i < subKernels.length; i++) { const subKernel = subKernels[i]; - result.push(subKernel.returnType === 'Integer' ? `int subKernelResult_${subKernel.name} = 0` : `float subKernelResult_${subKernel.name} = 0.0`); + result.push( + subKernel.returnType === 'Integer' + ? `int subKernelResult_${subKernel.name} = 0` + : `float subKernelResult_${subKernel.name} = 0.0` + ); } break; case 'Array(2)': @@ -1158,7 +1354,11 @@ float integerCorrectionModulo(float number, float divisor) { } getMainResultGraphical() { - return utils.linesToString([' threadId = indexTo3D(index, uOutputDim)', ' kernel()', ' gl_FragColor = actualColor']); + return utils.linesToString([ + ' threadId = indexTo3D(index, uOutputDim)', + ' kernel()', + ' gl_FragColor = actualColor', + ]); } getMainResultPackedPixels() { @@ -1167,9 +1367,14 @@ float integerCorrectionModulo(float number, float divisor) { case 'Number': case 'Integer': case 'Float': - return this.getMainResultKernelPackedPixels() + this.getMainResultSubKernelPackedPixels(); + return ( + this.getMainResultKernelPackedPixels() + + this.getMainResultSubKernelPackedPixels() + ); default: - throw new Error(`packed output only usable with Numbers, "${this.returnType}" specified`); + throw new Error( + `packed output only usable with Numbers, "${this.returnType}" specified` + ); } } @@ -1177,7 +1382,13 @@ float integerCorrectionModulo(float number, float divisor) { * @return {String} */ getMainResultKernelPackedPixels() { - return utils.linesToString([' threadId = indexTo3D(index, uOutputDim)', ' kernel()', ` gl_FragData[0] = ${this.useLegacyEncoder ? 'legacyEncode32' : 'encode32'}(kernelResult)`]); + return utils.linesToString([ + ' threadId = indexTo3D(index, uOutputDim)', + ' kernel()', + ` gl_FragData[0] = ${ + this.useLegacyEncoder ? 'legacyEncode32' : 'encode32' + }(kernelResult)`, + ]); } /** @@ -1189,9 +1400,17 @@ float integerCorrectionModulo(float number, float divisor) { for (let i = 0; i < this.subKernels.length; i++) { const subKernel = this.subKernels[i]; if (subKernel.returnType === 'Integer') { - result.push(` gl_FragData[${i + 1}] = ${this.useLegacyEncoder ? 'legacyEncode32' : 'encode32'}(float(subKernelResult_${this.subKernels[i].name}))`); + result.push( + ` gl_FragData[${i + 1}] = ${ + this.useLegacyEncoder ? 'legacyEncode32' : 'encode32' + }(float(subKernelResult_${this.subKernels[i].name}))` + ); } else { - result.push(` gl_FragData[${i + 1}] = ${this.useLegacyEncoder ? 'legacyEncode32' : 'encode32'}(subKernelResult_${this.subKernels[i].name})`); + result.push( + ` gl_FragData[${i + 1}] = ${ + this.useLegacyEncoder ? 'legacyEncode32' : 'encode32' + }(subKernelResult_${this.subKernels[i].name})` + ); } } return utils.linesToString(result); @@ -1215,14 +1434,20 @@ float integerCorrectionModulo(float number, float divisor) { } break; default: - throw new Error(`optimized output only usable with Numbers, ${this.returnType} specified`); + throw new Error( + `optimized output only usable with Numbers, ${this.returnType} specified` + ); } return utils.linesToString(result); } getMainResultKernelMemoryOptimizedFloats(result, channel) { - result.push(' threadId = indexTo3D(index, uOutputDim)', ' kernel()', ` gl_FragData[0].${channel} = kernelResult`); + result.push( + ' threadId = indexTo3D(index, uOutputDim)', + ' kernel()', + ` gl_FragData[0].${channel} = kernelResult` + ); } getMainResultSubKernelMemoryOptimizedFloats(result, channel) { @@ -1230,15 +1455,27 @@ float integerCorrectionModulo(float number, float divisor) { for (let i = 0; i < this.subKernels.length; i++) { const subKernel = this.subKernels[i]; if (subKernel.returnType === 'Integer') { - result.push(` gl_FragData[${i + 1}].${channel} = float(subKernelResult_${this.subKernels[i].name})`); + result.push( + ` gl_FragData[${i + 1}].${channel} = float(subKernelResult_${ + this.subKernels[i].name + })` + ); } else { - result.push(` gl_FragData[${i + 1}].${channel} = subKernelResult_${this.subKernels[i].name}`); + result.push( + ` gl_FragData[${i + 1}].${channel} = subKernelResult_${ + this.subKernels[i].name + }` + ); } } } getMainResultKernelNumberTexture() { - return [' threadId = indexTo3D(index, uOutputDim)', ' kernel()', ' gl_FragData[0][0] = kernelResult']; + return [ + ' threadId = indexTo3D(index, uOutputDim)', + ' kernel()', + ' gl_FragData[0][0] = kernelResult', + ]; } getMainResultSubKernelNumberTexture() { @@ -1247,42 +1484,80 @@ float integerCorrectionModulo(float number, float divisor) { for (let i = 0; i < this.subKernels.length; ++i) { const subKernel = this.subKernels[i]; if (subKernel.returnType === 'Integer') { - result.push(` gl_FragData[${i + 1}][0] = float(subKernelResult_${subKernel.name})`); + result.push( + ` gl_FragData[${i + 1}][0] = float(subKernelResult_${ + subKernel.name + })` + ); } else { - result.push(` gl_FragData[${i + 1}][0] = subKernelResult_${subKernel.name}`); + result.push( + ` gl_FragData[${i + 1}][0] = subKernelResult_${subKernel.name}` + ); } } return result; } getMainResultKernelArray2Texture() { - return [' threadId = indexTo3D(index, uOutputDim)', ' kernel()', ' gl_FragData[0][0] = kernelResult[0]', ' gl_FragData[0][1] = kernelResult[1]']; + return [ + ' threadId = indexTo3D(index, uOutputDim)', + ' kernel()', + ' gl_FragData[0][0] = kernelResult[0]', + ' gl_FragData[0][1] = kernelResult[1]', + ]; } getMainResultSubKernelArray2Texture() { const result = []; if (!this.subKernels) return result; for (let i = 0; i < this.subKernels.length; ++i) { - result.push(` gl_FragData[${i + 1}][0] = subKernelResult_${this.subKernels[i].name}[0]`, ` gl_FragData[${i + 1}][1] = subKernelResult_${this.subKernels[i].name}[1]`); + result.push( + ` gl_FragData[${i + 1}][0] = subKernelResult_${ + this.subKernels[i].name + }[0]`, + ` gl_FragData[${i + 1}][1] = subKernelResult_${ + this.subKernels[i].name + }[1]` + ); } return result; } getMainResultKernelArray3Texture() { - return [' threadId = indexTo3D(index, uOutputDim)', ' kernel()', ' gl_FragData[0][0] = kernelResult[0]', ' gl_FragData[0][1] = kernelResult[1]', ' gl_FragData[0][2] = kernelResult[2]']; + return [ + ' threadId = indexTo3D(index, uOutputDim)', + ' kernel()', + ' gl_FragData[0][0] = kernelResult[0]', + ' gl_FragData[0][1] = kernelResult[1]', + ' gl_FragData[0][2] = kernelResult[2]', + ]; } getMainResultSubKernelArray3Texture() { const result = []; if (!this.subKernels) return result; for (let i = 0; i < this.subKernels.length; ++i) { - result.push(` gl_FragData[${i + 1}][0] = subKernelResult_${this.subKernels[i].name}[0]`, ` gl_FragData[${i + 1}][1] = subKernelResult_${this.subKernels[i].name}[1]`, ` gl_FragData[${i + 1}][2] = subKernelResult_${this.subKernels[i].name}[2]`); + result.push( + ` gl_FragData[${i + 1}][0] = subKernelResult_${ + this.subKernels[i].name + }[0]`, + ` gl_FragData[${i + 1}][1] = subKernelResult_${ + this.subKernels[i].name + }[1]`, + ` gl_FragData[${i + 1}][2] = subKernelResult_${ + this.subKernels[i].name + }[2]` + ); } return result; } getMainResultKernelArray4Texture() { - return [' threadId = indexTo3D(index, uOutputDim)', ' kernel()', ' gl_FragData[0] = kernelResult']; + return [ + ' threadId = indexTo3D(index, uOutputDim)', + ' kernel()', + ' gl_FragData[0] = kernelResult', + ]; } getMainResultSubKernelArray4Texture() { @@ -1295,25 +1570,63 @@ float integerCorrectionModulo(float number, float divisor) { for (let i = 0; i < this.subKernels.length; ++i) { const subKernel = this.subKernels[i]; if (subKernel.returnType === 'Integer') { - result.push(` gl_FragData[${i + 1}] = float(subKernelResult_${this.subKernels[i].name})`); + result.push( + ` gl_FragData[${i + 1}] = float(subKernelResult_${ + this.subKernels[i].name + })` + ); } else { - result.push(` gl_FragData[${i + 1}] = subKernelResult_${this.subKernels[i].name}`); + result.push( + ` gl_FragData[${i + 1}] = subKernelResult_${ + this.subKernels[i].name + }` + ); } } break; case 'Array(2)': for (let i = 0; i < this.subKernels.length; ++i) { - result.push(` gl_FragData[${i + 1}][0] = subKernelResult_${this.subKernels[i].name}[0]`, ` gl_FragData[${i + 1}][1] = subKernelResult_${this.subKernels[i].name}[1]`); + result.push( + ` gl_FragData[${i + 1}][0] = subKernelResult_${ + this.subKernels[i].name + }[0]`, + ` gl_FragData[${i + 1}][1] = subKernelResult_${ + this.subKernels[i].name + }[1]` + ); } break; case 'Array(3)': for (let i = 0; i < this.subKernels.length; ++i) { - result.push(` gl_FragData[${i + 1}][0] = subKernelResult_${this.subKernels[i].name}[0]`, ` gl_FragData[${i + 1}][1] = subKernelResult_${this.subKernels[i].name}[1]`, ` gl_FragData[${i + 1}][2] = subKernelResult_${this.subKernels[i].name}[2]`); + result.push( + ` gl_FragData[${i + 1}][0] = subKernelResult_${ + this.subKernels[i].name + }[0]`, + ` gl_FragData[${i + 1}][1] = subKernelResult_${ + this.subKernels[i].name + }[1]`, + ` gl_FragData[${i + 1}][2] = subKernelResult_${ + this.subKernels[i].name + }[2]` + ); } break; case 'Array(4)': for (let i = 0; i < this.subKernels.length; ++i) { - result.push(` gl_FragData[${i + 1}][0] = subKernelResult_${this.subKernels[i].name}[0]`, ` gl_FragData[${i + 1}][1] = subKernelResult_${this.subKernels[i].name}[1]`, ` gl_FragData[${i + 1}][2] = subKernelResult_${this.subKernels[i].name}[2]`, ` gl_FragData[${i + 1}][3] = subKernelResult_${this.subKernels[i].name}[3]`); + result.push( + ` gl_FragData[${i + 1}][0] = subKernelResult_${ + this.subKernels[i].name + }[0]`, + ` gl_FragData[${i + 1}][1] = subKernelResult_${ + this.subKernels[i].name + }[1]`, + ` gl_FragData[${i + 1}][2] = subKernelResult_${ + this.subKernels[i].name + }[2]`, + ` gl_FragData[${i + 1}][3] = subKernelResult_${ + this.subKernels[i].name + }[3]` + ); } break; } @@ -1326,12 +1639,15 @@ float integerCorrectionModulo(float number, float divisor) { * @param {Object} map - Variables/Constants associated with shader */ replaceArtifacts(src, map) { - return src.replace(/[ ]*__([A-Z]+[0-9]*([_]?[A-Z]*[0-9]?)*)__;\n/g, (match, artifact) => { - if (map.hasOwnProperty(artifact)) { - return map[artifact]; + return src.replace( + /[ ]*__([A-Z]+[0-9]*([_]?[A-Z]*[0-9]?)*)__;\n/g, + (match, artifact) => { + if (map.hasOwnProperty(artifact)) { + return map[artifact]; + } + throw `unhandled artifact ${artifact}`; } - throw `unhandled artifact ${artifact}`; - }); + ); } /** @@ -1346,7 +1662,10 @@ float integerCorrectionModulo(float number, float divisor) { if (this.compiledFragmentShader !== null) { return this.compiledFragmentShader; } - return (this.compiledFragmentShader = this.replaceArtifacts(this.constructor.fragmentShader, this._getFragShaderArtifactMap(args))); + return (this.compiledFragmentShader = this.replaceArtifacts( + this.constructor.fragmentShader, + this._getFragShaderArtifactMap(args) + )); } /** @@ -1358,7 +1677,10 @@ float integerCorrectionModulo(float number, float divisor) { if (this.compiledVertexShader !== null) { return this.compiledVertexShader; } - return (this.compiledVertexShader = this.replaceArtifacts(this.constructor.vertexShader, this._getVertShaderArtifactMap(args))); + return (this.compiledVertexShader = this.replaceArtifacts( + this.constructor.vertexShader, + this._getVertShaderArtifactMap(args) + )); } /** @@ -1366,7 +1688,12 @@ float integerCorrectionModulo(float number, float divisor) { */ toString() { const setupContextString = utils.linesToString([`const gl = context`]); - return glKernelString(this.constructor, arguments, this, setupContextString); + return glKernelString( + this.constructor, + arguments, + this, + setupContextString + ); } destroy(removeCanvasReferences) { @@ -1379,7 +1706,9 @@ float integerCorrectionModulo(float number, float divisor) { } for (const width in this.rawValueFramebuffers) { for (const height in this.rawValueFramebuffers[width]) { - this.context.deleteFramebuffer(this.rawValueFramebuffers[width][height]); + this.context.deleteFramebuffer( + this.rawValueFramebuffers[width][height] + ); delete this.rawValueFramebuffers[width][height]; } delete this.rawValueFramebuffers[width]; @@ -1395,7 +1724,9 @@ float integerCorrectionModulo(float number, float divisor) { } if (this.texture) { this.texture.delete(); - const textureCacheIndex = this.textureCache.indexOf(this.texture.texture); + const textureCacheIndex = this.textureCache.indexOf( + this.texture.texture + ); if (textureCacheIndex > -1) { this.textureCache.splice(textureCacheIndex, 1); } @@ -1405,7 +1736,9 @@ float integerCorrectionModulo(float number, float divisor) { for (let i = 0; i < this.mappedTextures.length; i++) { const mappedTexture = this.mappedTextures[i]; mappedTexture.delete(); - const textureCacheIndex = this.textureCache.indexOf(mappedTexture.texture); + const textureCacheIndex = this.textureCache.indexOf( + mappedTexture.texture + ); if (textureCacheIndex > -1) { this.textureCache.splice(textureCacheIndex, 1); } @@ -1461,7 +1794,10 @@ float integerCorrectionModulo(float number, float divisor) { */ toJSON() { const json = super.toJSON(); - json.functionNodes = FunctionBuilder.fromKernel(this, WebGLFunctionNode).toJSON(); + json.functionNodes = FunctionBuilder.fromKernel( + this, + WebGLFunctionNode + ).toJSON(); json.settings.threadDim = this.threadDim; return json; } diff --git a/src/backend/web-gl2/function-node.js b/src/backend/web-gl2/function-node.js index deaa7cd8..ca4e0b09 100644 --- a/src/backend/web-gl2/function-node.js +++ b/src/backend/web-gl2/function-node.js @@ -16,7 +16,10 @@ export class WebGL2FunctionNode extends WebGLFunctionNode { */ astIdentifierExpression(idtNode, retArr) { if (idtNode.type !== 'Identifier') { - throw this.astErrorOutput('IdentifierExpression - not an Identifier', idtNode); + throw this.astErrorOutput( + 'IdentifierExpression - not an Identifier', + idtNode + ); } const type = this.getType(idtNode); diff --git a/src/backend/web-gl2/kernel-value-maps.js b/src/backend/web-gl2/kernel-value-maps.js index 655fdf68..a2467913 100644 --- a/src/backend/web-gl2/kernel-value-maps.js +++ b/src/backend/web-gl2/kernel-value-maps.js @@ -67,7 +67,8 @@ export const kernelValueMaps = { 'ArrayTexture(2)': WebGL2KernelValueDynamicNumberTexture, 'ArrayTexture(3)': WebGL2KernelValueDynamicNumberTexture, 'ArrayTexture(4)': WebGL2KernelValueDynamicNumberTexture, - MemoryOptimizedNumberTexture: WebGL2KernelValueDynamicMemoryOptimizedNumberTexture, + MemoryOptimizedNumberTexture: + WebGL2KernelValueDynamicMemoryOptimizedNumberTexture, HTMLCanvas: WebGL2KernelValueDynamicHTMLImage, OffscreenCanvas: WebGL2KernelValueDynamicHTMLImage, HTMLImage: WebGL2KernelValueDynamicHTMLImage, @@ -99,7 +100,8 @@ export const kernelValueMaps = { 'ArrayTexture(2)': WebGL2KernelValueNumberTexture, 'ArrayTexture(3)': WebGL2KernelValueNumberTexture, 'ArrayTexture(4)': WebGL2KernelValueNumberTexture, - MemoryOptimizedNumberTexture: WebGL2KernelValueDynamicMemoryOptimizedNumberTexture, + MemoryOptimizedNumberTexture: + WebGL2KernelValueDynamicMemoryOptimizedNumberTexture, HTMLCanvas: WebGL2KernelValueHTMLImage, OffscreenCanvas: WebGL2KernelValueHTMLImage, HTMLImage: WebGL2KernelValueHTMLImage, @@ -133,7 +135,8 @@ export const kernelValueMaps = { 'ArrayTexture(2)': WebGL2KernelValueDynamicNumberTexture, 'ArrayTexture(3)': WebGL2KernelValueDynamicNumberTexture, 'ArrayTexture(4)': WebGL2KernelValueDynamicNumberTexture, - MemoryOptimizedNumberTexture: WebGL2KernelValueDynamicMemoryOptimizedNumberTexture, + MemoryOptimizedNumberTexture: + WebGL2KernelValueDynamicMemoryOptimizedNumberTexture, HTMLCanvas: WebGL2KernelValueDynamicHTMLImage, OffscreenCanvas: WebGL2KernelValueDynamicHTMLImage, HTMLImage: WebGL2KernelValueDynamicHTMLImage, @@ -165,7 +168,8 @@ export const kernelValueMaps = { 'ArrayTexture(2)': WebGL2KernelValueNumberTexture, 'ArrayTexture(3)': WebGL2KernelValueNumberTexture, 'ArrayTexture(4)': WebGL2KernelValueNumberTexture, - MemoryOptimizedNumberTexture: WebGL2KernelValueMemoryOptimizedNumberTexture, + MemoryOptimizedNumberTexture: + WebGL2KernelValueMemoryOptimizedNumberTexture, HTMLCanvas: WebGL2KernelValueHTMLImage, OffscreenCanvas: WebGL2KernelValueHTMLImage, HTMLImage: WebGL2KernelValueHTMLImage, diff --git a/src/backend/web-gl2/kernel-value/dynamic-html-image-array.js b/src/backend/web-gl2/kernel-value/dynamic-html-image-array.js index b202c640..efece4b3 100644 --- a/src/backend/web-gl2/kernel-value/dynamic-html-image-array.js +++ b/src/backend/web-gl2/kernel-value/dynamic-html-image-array.js @@ -4,7 +4,11 @@ import { WebGL2KernelValueHTMLImageArray } from './html-image-array'; export class WebGL2KernelValueDynamicHTMLImageArray extends WebGL2KernelValueHTMLImageArray { getSource() { const variablePrecision = this.getVariablePrecisionString(); - return utils.linesToString([`uniform ${variablePrecision} sampler2DArray ${this.id}`, `uniform ${variablePrecision} ivec2 ${this.sizeId}`, `uniform ${variablePrecision} ivec3 ${this.dimensionsId}`]); + return utils.linesToString([ + `uniform ${variablePrecision} sampler2DArray ${this.id}`, + `uniform ${variablePrecision} ivec2 ${this.sizeId}`, + `uniform ${variablePrecision} ivec3 ${this.dimensionsId}`, + ]); } updateValue(images) { diff --git a/src/backend/web-gl2/kernel-value/dynamic-html-image.js b/src/backend/web-gl2/kernel-value/dynamic-html-image.js index 14bce760..4397b7bd 100644 --- a/src/backend/web-gl2/kernel-value/dynamic-html-image.js +++ b/src/backend/web-gl2/kernel-value/dynamic-html-image.js @@ -4,6 +4,10 @@ import { WebGLKernelValueDynamicHTMLImage } from '../../web-gl/kernel-value/dyna export class WebGL2KernelValueDynamicHTMLImage extends WebGLKernelValueDynamicHTMLImage { getSource() { const variablePrecision = this.getVariablePrecisionString(); - return utils.linesToString([`uniform ${variablePrecision} sampler2D ${this.id}`, `uniform ${variablePrecision} ivec2 ${this.sizeId}`, `uniform ${variablePrecision} ivec3 ${this.dimensionsId}`]); + return utils.linesToString([ + `uniform ${variablePrecision} sampler2D ${this.id}`, + `uniform ${variablePrecision} ivec2 ${this.sizeId}`, + `uniform ${variablePrecision} ivec3 ${this.dimensionsId}`, + ]); } } diff --git a/src/backend/web-gl2/kernel-value/dynamic-memory-optimized-number-texture.js b/src/backend/web-gl2/kernel-value/dynamic-memory-optimized-number-texture.js index 26fb4640..5a536767 100644 --- a/src/backend/web-gl2/kernel-value/dynamic-memory-optimized-number-texture.js +++ b/src/backend/web-gl2/kernel-value/dynamic-memory-optimized-number-texture.js @@ -3,6 +3,10 @@ import { WebGLKernelValueDynamicMemoryOptimizedNumberTexture } from '../../web-g export class WebGL2KernelValueDynamicMemoryOptimizedNumberTexture extends WebGLKernelValueDynamicMemoryOptimizedNumberTexture { getSource() { - return utils.linesToString([`uniform sampler2D ${this.id}`, `uniform ivec2 ${this.sizeId}`, `uniform ivec3 ${this.dimensionsId}`]); + return utils.linesToString([ + `uniform sampler2D ${this.id}`, + `uniform ivec2 ${this.sizeId}`, + `uniform ivec3 ${this.dimensionsId}`, + ]); } } diff --git a/src/backend/web-gl2/kernel-value/dynamic-number-texture.js b/src/backend/web-gl2/kernel-value/dynamic-number-texture.js index 3ce83ae5..ad900156 100644 --- a/src/backend/web-gl2/kernel-value/dynamic-number-texture.js +++ b/src/backend/web-gl2/kernel-value/dynamic-number-texture.js @@ -4,6 +4,10 @@ import { WebGLKernelValueDynamicNumberTexture } from '../../web-gl/kernel-value/ export class WebGL2KernelValueDynamicNumberTexture extends WebGLKernelValueDynamicNumberTexture { getSource() { const variablePrecision = this.getVariablePrecisionString(); - return utils.linesToString([`uniform ${variablePrecision} sampler2D ${this.id}`, `uniform ${variablePrecision} ivec2 ${this.sizeId}`, `uniform ${variablePrecision} ivec3 ${this.dimensionsId}`]); + return utils.linesToString([ + `uniform ${variablePrecision} sampler2D ${this.id}`, + `uniform ${variablePrecision} ivec2 ${this.sizeId}`, + `uniform ${variablePrecision} ivec3 ${this.dimensionsId}`, + ]); } } diff --git a/src/backend/web-gl2/kernel-value/dynamic-single-array.js b/src/backend/web-gl2/kernel-value/dynamic-single-array.js index cf58a8c9..07382f59 100644 --- a/src/backend/web-gl2/kernel-value/dynamic-single-array.js +++ b/src/backend/web-gl2/kernel-value/dynamic-single-array.js @@ -4,13 +4,21 @@ import { WebGL2KernelValueSingleArray } from '../../web-gl2/kernel-value/single- export class WebGL2KernelValueDynamicSingleArray extends WebGL2KernelValueSingleArray { getSource() { const variablePrecision = this.getVariablePrecisionString(); - return utils.linesToString([`uniform ${variablePrecision} sampler2D ${this.id}`, `uniform ${variablePrecision} ivec2 ${this.sizeId}`, `uniform ${variablePrecision} ivec3 ${this.dimensionsId}`]); + return utils.linesToString([ + `uniform ${variablePrecision} sampler2D ${this.id}`, + `uniform ${variablePrecision} ivec2 ${this.sizeId}`, + `uniform ${variablePrecision} ivec3 ${this.dimensionsId}`, + ]); } updateValue(value) { this.dimensions = utils.getDimensions(value, true); - this.textureSize = utils.getMemoryOptimizedFloatTextureSize(this.dimensions, this.bitRatio); - this.uploadArrayLength = this.textureSize[0] * this.textureSize[1] * this.bitRatio; + this.textureSize = utils.getMemoryOptimizedFloatTextureSize( + this.dimensions, + this.bitRatio + ); + this.uploadArrayLength = + this.textureSize[0] * this.textureSize[1] * this.bitRatio; this.checkSize(this.textureSize[0], this.textureSize[1]); this.uploadValue = new Float32Array(this.uploadArrayLength); this.kernel.setUniform3iv(this.dimensionsId, this.dimensions); diff --git a/src/backend/web-gl2/kernel-value/dynamic-single-array1d-i.js b/src/backend/web-gl2/kernel-value/dynamic-single-array1d-i.js index 97f27f27..0a4c939e 100644 --- a/src/backend/web-gl2/kernel-value/dynamic-single-array1d-i.js +++ b/src/backend/web-gl2/kernel-value/dynamic-single-array1d-i.js @@ -4,7 +4,11 @@ import { WebGL2KernelValueSingleArray1DI } from '../../web-gl2/kernel-value/sing export class WebGL2KernelValueDynamicSingleArray1DI extends WebGL2KernelValueSingleArray1DI { getSource() { const variablePrecision = this.getVariablePrecisionString(); - return utils.linesToString([`uniform ${variablePrecision} sampler2D ${this.id}`, `uniform ${variablePrecision} ivec2 ${this.sizeId}`, `uniform ${variablePrecision} ivec3 ${this.dimensionsId}`]); + return utils.linesToString([ + `uniform ${variablePrecision} sampler2D ${this.id}`, + `uniform ${variablePrecision} ivec2 ${this.sizeId}`, + `uniform ${variablePrecision} ivec3 ${this.dimensionsId}`, + ]); } updateValue(value) { diff --git a/src/backend/web-gl2/kernel-value/dynamic-single-array2d-i.js b/src/backend/web-gl2/kernel-value/dynamic-single-array2d-i.js index 54cf7678..78bb2a7d 100644 --- a/src/backend/web-gl2/kernel-value/dynamic-single-array2d-i.js +++ b/src/backend/web-gl2/kernel-value/dynamic-single-array2d-i.js @@ -4,7 +4,11 @@ import { WebGL2KernelValueSingleArray2DI } from '../../web-gl2/kernel-value/sing export class WebGL2KernelValueDynamicSingleArray2DI extends WebGL2KernelValueSingleArray2DI { getSource() { const variablePrecision = this.getVariablePrecisionString(); - return utils.linesToString([`uniform ${variablePrecision} sampler2D ${this.id}`, `uniform ${variablePrecision} ivec2 ${this.sizeId}`, `uniform ${variablePrecision} ivec3 ${this.dimensionsId}`]); + return utils.linesToString([ + `uniform ${variablePrecision} sampler2D ${this.id}`, + `uniform ${variablePrecision} ivec2 ${this.sizeId}`, + `uniform ${variablePrecision} ivec3 ${this.dimensionsId}`, + ]); } updateValue(value) { diff --git a/src/backend/web-gl2/kernel-value/dynamic-single-array3d-i.js b/src/backend/web-gl2/kernel-value/dynamic-single-array3d-i.js index ea19628a..7890be03 100644 --- a/src/backend/web-gl2/kernel-value/dynamic-single-array3d-i.js +++ b/src/backend/web-gl2/kernel-value/dynamic-single-array3d-i.js @@ -4,7 +4,11 @@ import { WebGL2KernelValueSingleArray3DI } from '../../web-gl2/kernel-value/sing export class WebGL2KernelValueDynamicSingleArray3DI extends WebGL2KernelValueSingleArray3DI { getSource() { const variablePrecision = this.getVariablePrecisionString(); - return utils.linesToString([`uniform ${variablePrecision} sampler2D ${this.id}`, `uniform ${variablePrecision} ivec2 ${this.sizeId}`, `uniform ${variablePrecision} ivec3 ${this.dimensionsId}`]); + return utils.linesToString([ + `uniform ${variablePrecision} sampler2D ${this.id}`, + `uniform ${variablePrecision} ivec2 ${this.sizeId}`, + `uniform ${variablePrecision} ivec3 ${this.dimensionsId}`, + ]); } updateValue(value) { diff --git a/src/backend/web-gl2/kernel-value/dynamic-single-input.js b/src/backend/web-gl2/kernel-value/dynamic-single-input.js index 8d331e18..e2fe650c 100644 --- a/src/backend/web-gl2/kernel-value/dynamic-single-input.js +++ b/src/backend/web-gl2/kernel-value/dynamic-single-input.js @@ -4,14 +4,22 @@ import { WebGL2KernelValueSingleInput } from '../../web-gl2/kernel-value/single- export class WebGL2KernelValueDynamicSingleInput extends WebGL2KernelValueSingleInput { getSource() { const variablePrecision = this.getVariablePrecisionString(); - return utils.linesToString([`uniform ${variablePrecision} sampler2D ${this.id}`, `uniform ${variablePrecision} ivec2 ${this.sizeId}`, `uniform ${variablePrecision} ivec3 ${this.dimensionsId}`]); + return utils.linesToString([ + `uniform ${variablePrecision} sampler2D ${this.id}`, + `uniform ${variablePrecision} ivec2 ${this.sizeId}`, + `uniform ${variablePrecision} ivec3 ${this.dimensionsId}`, + ]); } updateValue(value) { let [w, h, d] = value.size; this.dimensions = new Int32Array([w || 1, h || 1, d || 1]); - this.textureSize = utils.getMemoryOptimizedFloatTextureSize(this.dimensions, this.bitRatio); - this.uploadArrayLength = this.textureSize[0] * this.textureSize[1] * this.bitRatio; + this.textureSize = utils.getMemoryOptimizedFloatTextureSize( + this.dimensions, + this.bitRatio + ); + this.uploadArrayLength = + this.textureSize[0] * this.textureSize[1] * this.bitRatio; this.checkSize(this.textureSize[0], this.textureSize[1]); this.uploadValue = new Float32Array(this.uploadArrayLength); this.kernel.setUniform3iv(this.dimensionsId, this.dimensions); diff --git a/src/backend/web-gl2/kernel-value/dynamic-unsigned-array.js b/src/backend/web-gl2/kernel-value/dynamic-unsigned-array.js index 24fb8189..2e24ca70 100644 --- a/src/backend/web-gl2/kernel-value/dynamic-unsigned-array.js +++ b/src/backend/web-gl2/kernel-value/dynamic-unsigned-array.js @@ -4,6 +4,10 @@ import { WebGLKernelValueDynamicUnsignedArray } from '../../web-gl/kernel-value/ export class WebGL2KernelValueDynamicUnsignedArray extends WebGLKernelValueDynamicUnsignedArray { getSource() { const variablePrecision = this.getVariablePrecisionString(); - return utils.linesToString([`uniform ${variablePrecision} sampler2D ${this.id}`, `uniform ${variablePrecision} ivec2 ${this.sizeId}`, `uniform ${variablePrecision} ivec3 ${this.dimensionsId}`]); + return utils.linesToString([ + `uniform ${variablePrecision} sampler2D ${this.id}`, + `uniform ${variablePrecision} ivec2 ${this.sizeId}`, + `uniform ${variablePrecision} ivec3 ${this.dimensionsId}`, + ]); } } diff --git a/src/backend/web-gl2/kernel-value/dynamic-unsigned-input.js b/src/backend/web-gl2/kernel-value/dynamic-unsigned-input.js index 0cdf91db..6dbae9d1 100644 --- a/src/backend/web-gl2/kernel-value/dynamic-unsigned-input.js +++ b/src/backend/web-gl2/kernel-value/dynamic-unsigned-input.js @@ -4,6 +4,10 @@ import { WebGLKernelValueDynamicUnsignedInput } from '../../web-gl/kernel-value/ export class WebGL2KernelValueDynamicUnsignedInput extends WebGLKernelValueDynamicUnsignedInput { getSource() { const variablePrecision = this.getVariablePrecisionString(); - return utils.linesToString([`uniform ${variablePrecision} sampler2D ${this.id}`, `uniform ${variablePrecision} ivec2 ${this.sizeId}`, `uniform ${variablePrecision} ivec3 ${this.dimensionsId}`]); + return utils.linesToString([ + `uniform ${variablePrecision} sampler2D ${this.id}`, + `uniform ${variablePrecision} ivec2 ${this.sizeId}`, + `uniform ${variablePrecision} ivec3 ${this.dimensionsId}`, + ]); } } diff --git a/src/backend/web-gl2/kernel-value/html-image-array.js b/src/backend/web-gl2/kernel-value/html-image-array.js index 282c26f5..e4644a37 100644 --- a/src/backend/web-gl2/kernel-value/html-image-array.js +++ b/src/backend/web-gl2/kernel-value/html-image-array.js @@ -21,7 +21,11 @@ export class WebGL2KernelValueHTMLImageArray extends WebGLKernelArray { } getSource() { const variablePrecision = this.getVariablePrecisionString(); - return utils.linesToString([`uniform ${variablePrecision} sampler2DArray ${this.id}`, `${variablePrecision} ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`, `${variablePrecision} ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`]); + return utils.linesToString([ + `uniform ${variablePrecision} sampler2DArray ${this.id}`, + `${variablePrecision} ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`, + `${variablePrecision} ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`, + ]); } updateValue(images) { @@ -30,12 +34,35 @@ export class WebGL2KernelValueHTMLImageArray extends WebGLKernelArray { gl.bindTexture(gl.TEXTURE_2D_ARRAY, this.texture); gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true); // Upload the images into the texture. - gl.texImage3D(gl.TEXTURE_2D_ARRAY, 0, gl.RGBA, images[0].width, images[0].height, images.length, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + gl.texImage3D( + gl.TEXTURE_2D_ARRAY, + 0, + gl.RGBA, + images[0].width, + images[0].height, + images.length, + 0, + gl.RGBA, + gl.UNSIGNED_BYTE, + null + ); for (let i = 0; i < images.length; i++) { const xOffset = 0; const yOffset = 0; const imageDepth = 1; - gl.texSubImage3D(gl.TEXTURE_2D_ARRAY, 0, xOffset, yOffset, i, images[i].width, images[i].height, imageDepth, gl.RGBA, gl.UNSIGNED_BYTE, (this.uploadValue = images[i])); + gl.texSubImage3D( + gl.TEXTURE_2D_ARRAY, + 0, + xOffset, + yOffset, + i, + images[i].width, + images[i].height, + imageDepth, + gl.RGBA, + gl.UNSIGNED_BYTE, + (this.uploadValue = images[i]) + ); } this.kernel.setUniform1i(this.id, this.index); } diff --git a/src/backend/web-gl2/kernel-value/html-image.js b/src/backend/web-gl2/kernel-value/html-image.js index 22441756..5b8d3936 100644 --- a/src/backend/web-gl2/kernel-value/html-image.js +++ b/src/backend/web-gl2/kernel-value/html-image.js @@ -4,6 +4,10 @@ import { WebGLKernelValueHTMLImage } from '../../web-gl/kernel-value/html-image' export class WebGL2KernelValueHTMLImage extends WebGLKernelValueHTMLImage { getSource() { const variablePrecision = this.getVariablePrecisionString(); - return utils.linesToString([`uniform ${variablePrecision} sampler2D ${this.id}`, `${variablePrecision} ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`, `${variablePrecision} ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`]); + return utils.linesToString([ + `uniform ${variablePrecision} sampler2D ${this.id}`, + `${variablePrecision} ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`, + `${variablePrecision} ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`, + ]); } } diff --git a/src/backend/web-gl2/kernel-value/integer.js b/src/backend/web-gl2/kernel-value/integer.js index 0f2ec3db..ad4bde4b 100644 --- a/src/backend/web-gl2/kernel-value/integer.js +++ b/src/backend/web-gl2/kernel-value/integer.js @@ -4,7 +4,9 @@ export class WebGL2KernelValueInteger extends WebGLKernelValueInteger { getSource(value) { const variablePrecision = this.getVariablePrecisionString(); if (this.origin === 'constants') { - return `const ${variablePrecision} int ${this.id} = ${parseInt(value)};\n`; + return `const ${variablePrecision} int ${this.id} = ${parseInt( + value + )};\n`; } return `uniform ${variablePrecision} int ${this.id};\n`; } diff --git a/src/backend/web-gl2/kernel-value/memory-optimized-number-texture.js b/src/backend/web-gl2/kernel-value/memory-optimized-number-texture.js index 7fe3f01b..9feab067 100644 --- a/src/backend/web-gl2/kernel-value/memory-optimized-number-texture.js +++ b/src/backend/web-gl2/kernel-value/memory-optimized-number-texture.js @@ -5,6 +5,10 @@ export class WebGL2KernelValueMemoryOptimizedNumberTexture extends WebGLKernelVa getSource() { const { id, sizeId, textureSize, dimensionsId, dimensions } = this; const variablePrecision = this.getVariablePrecisionString(); - return utils.linesToString([`uniform sampler2D ${id}`, `${variablePrecision} ivec2 ${sizeId} = ivec2(${textureSize[0]}, ${textureSize[1]})`, `${variablePrecision} ivec3 ${dimensionsId} = ivec3(${dimensions[0]}, ${dimensions[1]}, ${dimensions[2]})`]); + return utils.linesToString([ + `uniform sampler2D ${id}`, + `${variablePrecision} ivec2 ${sizeId} = ivec2(${textureSize[0]}, ${textureSize[1]})`, + `${variablePrecision} ivec3 ${dimensionsId} = ivec3(${dimensions[0]}, ${dimensions[1]}, ${dimensions[2]})`, + ]); } } diff --git a/src/backend/web-gl2/kernel-value/number-texture.js b/src/backend/web-gl2/kernel-value/number-texture.js index f9d2a8ae..9f7e137c 100644 --- a/src/backend/web-gl2/kernel-value/number-texture.js +++ b/src/backend/web-gl2/kernel-value/number-texture.js @@ -5,6 +5,10 @@ export class WebGL2KernelValueNumberTexture extends WebGLKernelValueNumberTextur getSource() { const { id, sizeId, textureSize, dimensionsId, dimensions } = this; const variablePrecision = this.getVariablePrecisionString(); - return utils.linesToString([`uniform ${variablePrecision} sampler2D ${id}`, `${variablePrecision} ivec2 ${sizeId} = ivec2(${textureSize[0]}, ${textureSize[1]})`, `${variablePrecision} ivec3 ${dimensionsId} = ivec3(${dimensions[0]}, ${dimensions[1]}, ${dimensions[2]})`]); + return utils.linesToString([ + `uniform ${variablePrecision} sampler2D ${id}`, + `${variablePrecision} ivec2 ${sizeId} = ivec2(${textureSize[0]}, ${textureSize[1]})`, + `${variablePrecision} ivec3 ${dimensionsId} = ivec3(${dimensions[0]}, ${dimensions[1]}, ${dimensions[2]})`, + ]); } } diff --git a/src/backend/web-gl2/kernel-value/single-array.js b/src/backend/web-gl2/kernel-value/single-array.js index 38dea15a..d846eb3e 100644 --- a/src/backend/web-gl2/kernel-value/single-array.js +++ b/src/backend/web-gl2/kernel-value/single-array.js @@ -4,7 +4,11 @@ import { WebGLKernelValueSingleArray } from '../../web-gl/kernel-value/single-ar export class WebGL2KernelValueSingleArray extends WebGLKernelValueSingleArray { getSource() { const variablePrecision = this.getVariablePrecisionString(); - return utils.linesToString([`uniform ${variablePrecision} sampler2D ${this.id}`, `${variablePrecision} ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`, `${variablePrecision} ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`]); + return utils.linesToString([ + `uniform ${variablePrecision} sampler2D ${this.id}`, + `${variablePrecision} ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`, + `${variablePrecision} ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`, + ]); } updateValue(value) { @@ -17,7 +21,17 @@ export class WebGL2KernelValueSingleArray extends WebGLKernelValueSingleArray { gl.activeTexture(this.contextHandle); gl.bindTexture(gl.TEXTURE_2D, this.texture); gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false); - gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA32F, this.textureSize[0], this.textureSize[1], 0, gl.RGBA, gl.FLOAT, this.uploadValue); + gl.texImage2D( + gl.TEXTURE_2D, + 0, + gl.RGBA32F, + this.textureSize[0], + this.textureSize[1], + 0, + gl.RGBA, + gl.FLOAT, + this.uploadValue + ); this.kernel.setUniform1i(this.id, this.index); } } diff --git a/src/backend/web-gl2/kernel-value/single-array1d-i.js b/src/backend/web-gl2/kernel-value/single-array1d-i.js index f78c9401..f8b6bfb6 100644 --- a/src/backend/web-gl2/kernel-value/single-array1d-i.js +++ b/src/backend/web-gl2/kernel-value/single-array1d-i.js @@ -12,7 +12,17 @@ export class WebGL2KernelValueSingleArray1DI extends WebGLKernelValueSingleArray gl.activeTexture(this.contextHandle); gl.bindTexture(gl.TEXTURE_2D, this.texture); gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false); - gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA32F, this.textureSize[0], this.textureSize[1], 0, gl.RGBA, gl.FLOAT, this.uploadValue); + gl.texImage2D( + gl.TEXTURE_2D, + 0, + gl.RGBA32F, + this.textureSize[0], + this.textureSize[1], + 0, + gl.RGBA, + gl.FLOAT, + this.uploadValue + ); this.kernel.setUniform1i(this.id, this.index); } } diff --git a/src/backend/web-gl2/kernel-value/single-array2d-i.js b/src/backend/web-gl2/kernel-value/single-array2d-i.js index 7567e47c..7a75f606 100644 --- a/src/backend/web-gl2/kernel-value/single-array2d-i.js +++ b/src/backend/web-gl2/kernel-value/single-array2d-i.js @@ -12,7 +12,17 @@ export class WebGL2KernelValueSingleArray2DI extends WebGLKernelValueSingleArray gl.activeTexture(this.contextHandle); gl.bindTexture(gl.TEXTURE_2D, this.texture); gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false); - gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA32F, this.textureSize[0], this.textureSize[1], 0, gl.RGBA, gl.FLOAT, this.uploadValue); + gl.texImage2D( + gl.TEXTURE_2D, + 0, + gl.RGBA32F, + this.textureSize[0], + this.textureSize[1], + 0, + gl.RGBA, + gl.FLOAT, + this.uploadValue + ); this.kernel.setUniform1i(this.id, this.index); } } diff --git a/src/backend/web-gl2/kernel-value/single-array3d-i.js b/src/backend/web-gl2/kernel-value/single-array3d-i.js index fb4bddc2..c7878b18 100644 --- a/src/backend/web-gl2/kernel-value/single-array3d-i.js +++ b/src/backend/web-gl2/kernel-value/single-array3d-i.js @@ -12,7 +12,17 @@ export class WebGL2KernelValueSingleArray3DI extends WebGLKernelValueSingleArray gl.activeTexture(this.contextHandle); gl.bindTexture(gl.TEXTURE_2D, this.texture); gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false); - gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA32F, this.textureSize[0], this.textureSize[1], 0, gl.RGBA, gl.FLOAT, this.uploadValue); + gl.texImage2D( + gl.TEXTURE_2D, + 0, + gl.RGBA32F, + this.textureSize[0], + this.textureSize[1], + 0, + gl.RGBA, + gl.FLOAT, + this.uploadValue + ); this.kernel.setUniform1i(this.id, this.index); } } diff --git a/src/backend/web-gl2/kernel-value/single-input.js b/src/backend/web-gl2/kernel-value/single-input.js index e2ce5599..97eeaf2b 100644 --- a/src/backend/web-gl2/kernel-value/single-input.js +++ b/src/backend/web-gl2/kernel-value/single-input.js @@ -4,7 +4,11 @@ import { WebGLKernelValueSingleInput } from '../../web-gl/kernel-value/single-in export class WebGL2KernelValueSingleInput extends WebGLKernelValueSingleInput { getSource() { const variablePrecision = this.getVariablePrecisionString(); - return utils.linesToString([`uniform ${variablePrecision} sampler2D ${this.id}`, `${variablePrecision} ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`, `${variablePrecision} ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`]); + return utils.linesToString([ + `uniform ${variablePrecision} sampler2D ${this.id}`, + `${variablePrecision} ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`, + `${variablePrecision} ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`, + ]); } updateValue(input) { @@ -13,7 +17,17 @@ export class WebGL2KernelValueSingleInput extends WebGLKernelValueSingleInput { gl.activeTexture(this.contextHandle); gl.bindTexture(gl.TEXTURE_2D, this.texture); gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false); - gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA32F, this.textureSize[0], this.textureSize[1], 0, gl.RGBA, gl.FLOAT, this.uploadValue); + gl.texImage2D( + gl.TEXTURE_2D, + 0, + gl.RGBA32F, + this.textureSize[0], + this.textureSize[1], + 0, + gl.RGBA, + gl.FLOAT, + this.uploadValue + ); this.kernel.setUniform1i(this.id, this.index); } } diff --git a/src/backend/web-gl2/kernel-value/unsigned-array.js b/src/backend/web-gl2/kernel-value/unsigned-array.js index 6ffa3025..02c380ee 100644 --- a/src/backend/web-gl2/kernel-value/unsigned-array.js +++ b/src/backend/web-gl2/kernel-value/unsigned-array.js @@ -4,6 +4,10 @@ import { WebGLKernelValueUnsignedArray } from '../../web-gl/kernel-value/unsigne export class WebGL2KernelValueUnsignedArray extends WebGLKernelValueUnsignedArray { getSource() { const variablePrecision = this.getVariablePrecisionString(); - return utils.linesToString([`uniform ${variablePrecision} sampler2D ${this.id}`, `${variablePrecision} ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`, `${variablePrecision} ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`]); + return utils.linesToString([ + `uniform ${variablePrecision} sampler2D ${this.id}`, + `${variablePrecision} ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`, + `${variablePrecision} ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`, + ]); } } diff --git a/src/backend/web-gl2/kernel-value/unsigned-input.js b/src/backend/web-gl2/kernel-value/unsigned-input.js index 16e04d50..b93c1ff5 100644 --- a/src/backend/web-gl2/kernel-value/unsigned-input.js +++ b/src/backend/web-gl2/kernel-value/unsigned-input.js @@ -4,6 +4,10 @@ import { WebGLKernelValueUnsignedInput } from '../../web-gl/kernel-value/unsigne export class WebGL2KernelValueUnsignedInput extends WebGLKernelValueUnsignedInput { getSource() { const variablePrecision = this.getVariablePrecisionString(); - return utils.linesToString([`uniform ${variablePrecision} sampler2D ${this.id}`, `${variablePrecision} ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`, `${variablePrecision} ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`]); + return utils.linesToString([ + `uniform ${variablePrecision} sampler2D ${this.id}`, + `${variablePrecision} ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`, + `${variablePrecision} ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`, + ]); } } diff --git a/src/backend/web-gl2/kernel.js b/src/backend/web-gl2/kernel.js index a972d2b5..4e0b1512 100644 --- a/src/backend/web-gl2/kernel.js +++ b/src/backend/web-gl2/kernel.js @@ -48,8 +48,12 @@ export class WebGL2Kernel extends WebGLKernel { testContext = testCanvas.getContext('webgl2'); if (!testContext || !testContext.getExtension) return; testExtensions = { - EXT_color_buffer_float: testContext.getExtension('EXT_color_buffer_float'), - OES_texture_float_linear: testContext.getExtension('OES_texture_float_linear'), + EXT_color_buffer_float: testContext.getExtension( + 'EXT_color_buffer_float' + ), + OES_texture_float_linear: testContext.getExtension( + 'OES_texture_float_linear' + ), }; features = this.getFeatures(); } @@ -77,12 +81,30 @@ export class WebGL2Kernel extends WebGLKernel { isDrawBuffers: true, channelCount: this.getChannelCount(), maxTextureSize: this.getMaxTextureSize(), - lowIntPrecision: gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.LOW_INT), - lowFloatPrecision: gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.LOW_FLOAT), - mediumIntPrecision: gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.MEDIUM_INT), - mediumFloatPrecision: gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.MEDIUM_FLOAT), - highIntPrecision: gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.HIGH_INT), - highFloatPrecision: gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.HIGH_FLOAT), + lowIntPrecision: gl.getShaderPrecisionFormat( + gl.FRAGMENT_SHADER, + gl.LOW_INT + ), + lowFloatPrecision: gl.getShaderPrecisionFormat( + gl.FRAGMENT_SHADER, + gl.LOW_FLOAT + ), + mediumIntPrecision: gl.getShaderPrecisionFormat( + gl.FRAGMENT_SHADER, + gl.MEDIUM_INT + ), + mediumFloatPrecision: gl.getShaderPrecisionFormat( + gl.FRAGMENT_SHADER, + gl.MEDIUM_FLOAT + ), + highIntPrecision: gl.getShaderPrecisionFormat( + gl.FRAGMENT_SHADER, + gl.HIGH_INT + ), + highFloatPrecision: gl.getShaderPrecisionFormat( + gl.FRAGMENT_SHADER, + gl.HIGH_FLOAT + ), }); } @@ -140,8 +162,12 @@ export class WebGL2Kernel extends WebGLKernel { initExtensions() { this.extensions = { - EXT_color_buffer_float: this.context.getExtension('EXT_color_buffer_float'), - OES_texture_float_linear: this.context.getExtension('OES_texture_float_linear'), + EXT_color_buffer_float: this.context.getExtension( + 'EXT_color_buffer_float' + ), + OES_texture_float_linear: this.context.getExtension( + 'OES_texture_float_linear' + ), }; } @@ -170,7 +196,10 @@ export class WebGL2Kernel extends WebGLKernel { if (this.fixIntegerDivisionAccuracy === null) { this.fixIntegerDivisionAccuracy = !features.isIntegerDivisionAccurate; - } else if (this.fixIntegerDivisionAccuracy && features.isIntegerDivisionAccurate) { + } else if ( + this.fixIntegerDivisionAccuracy && + features.isIntegerDivisionAccurate + ) { this.fixIntegerDivisionAccuracy = false; } @@ -178,7 +207,9 @@ export class WebGL2Kernel extends WebGLKernel { if (!this.output || this.output.length === 0) { if (args.length !== 1) { - throw new Error('Auto output only supported for kernels with only one input'); + throw new Error( + 'Auto output only supported for kernels with only one input' + ); } const argType = utils.getVariableType(args[0], this.strictIntegers); @@ -195,7 +226,9 @@ export class WebGL2Kernel extends WebGLKernel { this.output = args[0].output; break; default: - throw new Error('Auto output not supported for input type: ' + argType); + throw new Error( + 'Auto output not supported for input type: ' + argType + ); } } @@ -205,13 +238,19 @@ export class WebGL2Kernel extends WebGLKernel { } if (this.precision === 'single') { - console.warn('Cannot use graphical mode and single precision at the same time'); + console.warn( + 'Cannot use graphical mode and single precision at the same time' + ); this.precision = 'unsigned'; } this.texSize = utils.clone(this.output); return; - } else if (!this.graphical && this.precision === null && features.isTextureFloat) { + } else if ( + !this.graphical && + this.precision === null && + features.isTextureFloat + ) { this.precision = 'single'; } @@ -227,9 +266,13 @@ export class WebGL2Kernel extends WebGLKernel { } translateSource() { - const functionBuilder = FunctionBuilder.fromKernel(this, WebGL2FunctionNode, { - fixIntegerDivisionAccuracy: this.fixIntegerDivisionAccuracy, - }); + const functionBuilder = FunctionBuilder.fromKernel( + this, + WebGL2FunctionNode, + { + fixIntegerDivisionAccuracy: this.fixIntegerDivisionAccuracy, + } + ); this.translatedSource = functionBuilder.getPrototypeString('kernel'); this.setupReturnTypes(functionBuilder); } @@ -285,13 +328,21 @@ export class WebGL2Kernel extends WebGLKernel { const gl = this.context; if (this.texture) { // here we inherit from an already existing kernel, so go ahead and just bind textures to the framebuffer - gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.texture.texture, 0); + gl.framebufferTexture2D( + gl.FRAMEBUFFER, + gl.COLOR_ATTACHMENT0, + gl.TEXTURE_2D, + this.texture.texture, + 0 + ); return; } gl.bindFramebuffer(gl.FRAMEBUFFER, this.framebuffer); const texture = gl.createTexture(); const texSize = this.texSize; - gl.activeTexture(gl.TEXTURE0 + this.constantTextureCount + this.argumentTextureCount); + gl.activeTexture( + gl.TEXTURE0 + this.constantTextureCount + this.argumentTextureCount + ); gl.bindTexture(gl.TEXTURE_2D, texture); gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.REPEAT); gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.REPEAT); @@ -301,9 +352,25 @@ export class WebGL2Kernel extends WebGLKernel { if (this.precision === 'single') { gl.texStorage2D(gl.TEXTURE_2D, 1, format, texSize[0], texSize[1]); } else { - gl.texImage2D(gl.TEXTURE_2D, 0, format, texSize[0], texSize[1], 0, format, gl.UNSIGNED_BYTE, null); + gl.texImage2D( + gl.TEXTURE_2D, + 0, + format, + texSize[0], + texSize[1], + 0, + format, + gl.UNSIGNED_BYTE, + null + ); } - gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0); + gl.framebufferTexture2D( + gl.FRAMEBUFFER, + gl.COLOR_ATTACHMENT0, + gl.TEXTURE_2D, + texture, + 0 + ); this.texture = new this.TextureConstructor({ texture, size: texSize, @@ -321,7 +388,13 @@ export class WebGL2Kernel extends WebGLKernel { if (this.mappedTextures) { // here we inherit from an already existing kernel, so go ahead and just bind textures to the framebuffer for (let i = 0; i < this.subKernels.length; i++) { - gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0 + i + 1, gl.TEXTURE_2D, this.mappedTextures[i].texture, 0); + gl.framebufferTexture2D( + gl.FRAMEBUFFER, + gl.COLOR_ATTACHMENT0 + i + 1, + gl.TEXTURE_2D, + this.mappedTextures[i].texture, + 0 + ); } return; } @@ -331,7 +404,9 @@ export class WebGL2Kernel extends WebGLKernel { for (let i = 0; i < this.subKernels.length; i++) { const texture = this.createTexture(); this.drawBuffersMap.push(gl.COLOR_ATTACHMENT0 + i + 1); - gl.activeTexture(gl.TEXTURE0 + this.constantTextureCount + this.argumentTextureCount + i); + gl.activeTexture( + gl.TEXTURE0 + this.constantTextureCount + this.argumentTextureCount + i + ); gl.bindTexture(gl.TEXTURE_2D, texture); gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); @@ -343,9 +418,25 @@ export class WebGL2Kernel extends WebGLKernel { gl.texStorage2D(gl.TEXTURE_2D, 1, format, texSize[0], texSize[1]); // gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA32F, texSize[0], texSize[1], 0, gl.RGBA, gl.FLOAT, null); } else { - gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, texSize[0], texSize[1], 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + gl.texImage2D( + gl.TEXTURE_2D, + 0, + gl.RGBA, + texSize[0], + texSize[1], + 0, + gl.RGBA, + gl.UNSIGNED_BYTE, + null + ); } - gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0 + i + 1, gl.TEXTURE_2D, texture, 0); + gl.framebufferTexture2D( + gl.FRAMEBUFFER, + gl.COLOR_ATTACHMENT0 + i + 1, + gl.TEXTURE_2D, + texture, + 0 + ); this.mappedTextures.push( new this.TextureConstructor({ @@ -379,7 +470,10 @@ export class WebGL2Kernel extends WebGLKernel { */ _getTextureCoordinate() { const subKernels = this.subKernels; - const variablePrecision = this.getVariablePrecisionString(this.texSize, this.tactic); + const variablePrecision = this.getVariablePrecisionString( + this.texSize, + this.tactic + ); if (subKernels === null || subKernels.length < 1) { return `in ${variablePrecision} vec2 vTexCoord;\n`; } else { @@ -416,22 +510,36 @@ export class WebGL2Kernel extends WebGLKernel { case 'Integer': for (let i = 0; i < subKernels.length; i++) { const subKernel = subKernels[i]; - result.push(subKernel.returnType === 'Integer' ? `int subKernelResult_${subKernel.name} = 0` : `float subKernelResult_${subKernel.name} = 0.0`, `layout(location = ${i + 1}) out vec4 data${i + 1}`); + result.push( + subKernel.returnType === 'Integer' + ? `int subKernelResult_${subKernel.name} = 0` + : `float subKernelResult_${subKernel.name} = 0.0`, + `layout(location = ${i + 1}) out vec4 data${i + 1}` + ); } break; case 'Array(2)': for (let i = 0; i < subKernels.length; i++) { - result.push(`vec2 subKernelResult_${subKernels[i].name}`, `layout(location = ${i + 1}) out vec4 data${i + 1}`); + result.push( + `vec2 subKernelResult_${subKernels[i].name}`, + `layout(location = ${i + 1}) out vec4 data${i + 1}` + ); } break; case 'Array(3)': for (let i = 0; i < subKernels.length; i++) { - result.push(`vec3 subKernelResult_${subKernels[i].name}`, `layout(location = ${i + 1}) out vec4 data${i + 1}`); + result.push( + `vec3 subKernelResult_${subKernels[i].name}`, + `layout(location = ${i + 1}) out vec4 data${i + 1}` + ); } break; case 'Array(4)': for (let i = 0; i < subKernels.length; i++) { - result.push(`vec4 subKernelResult_${subKernels[i].name}`, `layout(location = ${i + 1}) out vec4 data${i + 1}`); + result.push( + `vec4 subKernelResult_${subKernels[i].name}`, + `layout(location = ${i + 1}) out vec4 data${i + 1}` + ); } break; } @@ -443,7 +551,11 @@ export class WebGL2Kernel extends WebGLKernel { } getMainResultGraphical() { - return utils.linesToString([' threadId = indexTo3D(index, uOutputDim)', ' kernel()', ' data0 = actualColor']); + return utils.linesToString([ + ' threadId = indexTo3D(index, uOutputDim)', + ' kernel()', + ' data0 = actualColor', + ]); } getMainResultPackedPixels() { @@ -452,9 +564,14 @@ export class WebGL2Kernel extends WebGLKernel { case 'Number': case 'Integer': case 'Float': - return this.getMainResultKernelPackedPixels() + this.getMainResultSubKernelPackedPixels(); + return ( + this.getMainResultKernelPackedPixels() + + this.getMainResultSubKernelPackedPixels() + ); default: - throw new Error(`packed output only usable with Numbers, "${this.returnType}" specified`); + throw new Error( + `packed output only usable with Numbers, "${this.returnType}" specified` + ); } } @@ -462,7 +579,13 @@ export class WebGL2Kernel extends WebGLKernel { * @return {String} */ getMainResultKernelPackedPixels() { - return utils.linesToString([' threadId = indexTo3D(index, uOutputDim)', ' kernel()', ` data0 = ${this.useLegacyEncoder ? 'legacyEncode32' : 'encode32'}(kernelResult)`]); + return utils.linesToString([ + ' threadId = indexTo3D(index, uOutputDim)', + ' kernel()', + ` data0 = ${ + this.useLegacyEncoder ? 'legacyEncode32' : 'encode32' + }(kernelResult)`, + ]); } /** @@ -474,16 +597,28 @@ export class WebGL2Kernel extends WebGLKernel { for (let i = 0; i < this.subKernels.length; i++) { const subKernel = this.subKernels[i]; if (subKernel.returnType === 'Integer') { - result.push(` data${i + 1} = ${this.useLegacyEncoder ? 'legacyEncode32' : 'encode32'}(float(subKernelResult_${this.subKernels[i].name}))`); + result.push( + ` data${i + 1} = ${ + this.useLegacyEncoder ? 'legacyEncode32' : 'encode32' + }(float(subKernelResult_${this.subKernels[i].name}))` + ); } else { - result.push(` data${i + 1} = ${this.useLegacyEncoder ? 'legacyEncode32' : 'encode32'}(subKernelResult_${this.subKernels[i].name})`); + result.push( + ` data${i + 1} = ${ + this.useLegacyEncoder ? 'legacyEncode32' : 'encode32' + }(subKernelResult_${this.subKernels[i].name})` + ); } } return utils.linesToString(result); } getMainResultKernelMemoryOptimizedFloats(result, channel) { - result.push(' threadId = indexTo3D(index, uOutputDim)', ' kernel()', ` data0.${channel} = kernelResult`); + result.push( + ' threadId = indexTo3D(index, uOutputDim)', + ' kernel()', + ` data0.${channel} = kernelResult` + ); } getMainResultSubKernelMemoryOptimizedFloats(result, channel) { @@ -491,15 +626,25 @@ export class WebGL2Kernel extends WebGLKernel { for (let i = 0; i < this.subKernels.length; i++) { const subKernel = this.subKernels[i]; if (subKernel.returnType === 'Integer') { - result.push(` data${i + 1}.${channel} = float(subKernelResult_${subKernel.name})`); + result.push( + ` data${i + 1}.${channel} = float(subKernelResult_${ + subKernel.name + })` + ); } else { - result.push(` data${i + 1}.${channel} = subKernelResult_${subKernel.name}`); + result.push( + ` data${i + 1}.${channel} = subKernelResult_${subKernel.name}` + ); } } } getMainResultKernelNumberTexture() { - return [' threadId = indexTo3D(index, uOutputDim)', ' kernel()', ' data0[0] = kernelResult']; + return [ + ' threadId = indexTo3D(index, uOutputDim)', + ' kernel()', + ' data0[0] = kernelResult', + ]; } getMainResultSubKernelNumberTexture() { @@ -508,7 +653,9 @@ export class WebGL2Kernel extends WebGLKernel { for (let i = 0; i < this.subKernels.length; ++i) { const subKernel = this.subKernels[i]; if (subKernel.returnType === 'Integer') { - result.push(` data${i + 1}[0] = float(subKernelResult_${subKernel.name})`); + result.push( + ` data${i + 1}[0] = float(subKernelResult_${subKernel.name})` + ); } else { result.push(` data${i + 1}[0] = subKernelResult_${subKernel.name}`); } @@ -517,7 +664,12 @@ export class WebGL2Kernel extends WebGLKernel { } getMainResultKernelArray2Texture() { - return [' threadId = indexTo3D(index, uOutputDim)', ' kernel()', ' data0[0] = kernelResult[0]', ' data0[1] = kernelResult[1]']; + return [ + ' threadId = indexTo3D(index, uOutputDim)', + ' kernel()', + ' data0[0] = kernelResult[0]', + ' data0[1] = kernelResult[1]', + ]; } getMainResultSubKernelArray2Texture() { @@ -525,13 +677,22 @@ export class WebGL2Kernel extends WebGLKernel { if (!this.subKernels) return result; for (let i = 0; i < this.subKernels.length; ++i) { const subKernel = this.subKernels[i]; - result.push(` data${i + 1}[0] = subKernelResult_${subKernel.name}[0]`, ` data${i + 1}[1] = subKernelResult_${subKernel.name}[1]`); + result.push( + ` data${i + 1}[0] = subKernelResult_${subKernel.name}[0]`, + ` data${i + 1}[1] = subKernelResult_${subKernel.name}[1]` + ); } return result; } getMainResultKernelArray3Texture() { - return [' threadId = indexTo3D(index, uOutputDim)', ' kernel()', ' data0[0] = kernelResult[0]', ' data0[1] = kernelResult[1]', ' data0[2] = kernelResult[2]']; + return [ + ' threadId = indexTo3D(index, uOutputDim)', + ' kernel()', + ' data0[0] = kernelResult[0]', + ' data0[1] = kernelResult[1]', + ' data0[2] = kernelResult[2]', + ]; } getMainResultSubKernelArray3Texture() { @@ -539,20 +700,30 @@ export class WebGL2Kernel extends WebGLKernel { if (!this.subKernels) return result; for (let i = 0; i < this.subKernels.length; ++i) { const subKernel = this.subKernels[i]; - result.push(` data${i + 1}[0] = subKernelResult_${subKernel.name}[0]`, ` data${i + 1}[1] = subKernelResult_${subKernel.name}[1]`, ` data${i + 1}[2] = subKernelResult_${subKernel.name}[2]`); + result.push( + ` data${i + 1}[0] = subKernelResult_${subKernel.name}[0]`, + ` data${i + 1}[1] = subKernelResult_${subKernel.name}[1]`, + ` data${i + 1}[2] = subKernelResult_${subKernel.name}[2]` + ); } return result; } getMainResultKernelArray4Texture() { - return [' threadId = indexTo3D(index, uOutputDim)', ' kernel()', ' data0 = kernelResult']; + return [ + ' threadId = indexTo3D(index, uOutputDim)', + ' kernel()', + ' data0 = kernelResult', + ]; } getMainResultSubKernelArray4Texture() { const result = []; if (!this.subKernels) return result; for (let i = 0; i < this.subKernels.length; ++i) { - result.push(` data${i + 1} = subKernelResult_${this.subKernels[i].name}`); + result.push( + ` data${i + 1} = subKernelResult_${this.subKernels[i].name}` + ); } return result; } @@ -567,7 +738,10 @@ export class WebGL2Kernel extends WebGLKernel { */ toJSON() { const json = super.toJSON(); - json.functionNodes = FunctionBuilder.fromKernel(this, WebGL2FunctionNode).toJSON(); + json.functionNodes = FunctionBuilder.fromKernel( + this, + WebGL2FunctionNode + ).toJSON(); json.settings.threadDim = this.threadDim; return json; } diff --git a/src/gpu.js b/src/gpu.js index 2b8a39b4..5865c596 100644 --- a/src/gpu.js +++ b/src/gpu.js @@ -57,14 +57,20 @@ export class GPU { * @returns {boolean} */ static get isKernelMapSupported() { - return kernelOrder.some(Kernel => Kernel.isSupported && Kernel.features.kernelMap); + return kernelOrder.some( + Kernel => Kernel.isSupported && Kernel.features.kernelMap + ); } /** * @desc TRUE is platform supports OffscreenCanvas */ static get isOffscreenCanvasSupported() { - return (typeof Worker !== 'undefined' && typeof OffscreenCanvas !== 'undefined') || typeof importScripts !== 'undefined'; + return ( + (typeof Worker !== 'undefined' && + typeof OffscreenCanvas !== 'undefined') || + typeof importScripts !== 'undefined' + ); } /** @@ -85,7 +91,9 @@ export class GPU { * @desc TRUE if platform supports HeadlessGL */ static get isHeadlessGLSupported() { - return 'headlessgl' in internalKernels && internalKernels.headlessgl.isSupported; + return ( + 'headlessgl' in internalKernels && internalKernels.headlessgl.isSupported + ); } /** @@ -108,7 +116,12 @@ export class GPU { * @returns {boolean} */ static get isSinglePrecisionSupported() { - return kernelOrder.some(Kernel => Kernel.isSupported && Kernel.features.isFloatRead && Kernel.features.isTextureFloat); + return kernelOrder.some( + Kernel => + Kernel.isSupported && + Kernel.features.isFloatRead && + Kernel.features.isTextureFloat + ); } /** @@ -163,7 +176,9 @@ export class GPU { const ExternalKernel = kernelOrder[i]; if (ExternalKernel.isContextMatch(this.context)) { if (!ExternalKernel.isSupported) { - throw new Error(`Kernel type ${ExternalKernel.name} not supported`); + throw new Error( + `Kernel type ${ExternalKernel.name} not supported` + ); } Kernel = ExternalKernel; break; @@ -188,7 +203,9 @@ export class GPU { Kernel = CPUKernel; } if (!Kernel) { - throw new Error(`A requested mode of "${this.mode}" and is not supported`); + throw new Error( + `A requested mode of "${this.mode}" and is not supported` + ); } } else { for (let i = 0; i < kernelOrder.length; i++) { @@ -218,13 +235,20 @@ export class GPU { if (typeof source === 'undefined') { throw new Error('Missing source parameter'); } - if (typeof source !== 'object' && !utils.isFunction(source) && typeof source !== 'string') { + if ( + typeof source !== 'object' && + !utils.isFunction(source) && + typeof source !== 'string' + ) { throw new Error('source parameter not a function'); } const kernels = this.kernels; if (this.mode === 'dev') { - const devKernel = gpuMock(source, upgradeDeprecatedCreateKernelSettings(settings)); + const devKernel = gpuMock( + source, + upgradeDeprecatedCreateKernelSettings(settings) + ); kernels.push(devKernel); return devKernel; } @@ -234,7 +258,9 @@ export class GPU { const settingsCopy = upgradeDeprecatedCreateKernelSettings(settings) || {}; // handle conversion of argumentTypes if (settings && typeof settings.argumentTypes === 'object') { - settingsCopy.argumentTypes = Object.keys(settings.argumentTypes).map(argumentName => settings.argumentTypes[argumentName]); + settingsCopy.argumentTypes = Object.keys(settings.argumentTypes).map( + argumentName => settings.argumentTypes[argumentName] + ); } function onRequestFallback(args) { @@ -299,38 +325,41 @@ export class GPU { return existingKernel; } - const newKernel = (switchableKernels[signature] = new Constructor(source, { - argumentTypes, - constantTypes: _kernel.constantTypes, - graphical: _kernel.graphical, - loopMaxIterations: _kernel.loopMaxIterations, - constants: _kernel.constants, - dynamicOutput: _kernel.dynamicOutput, - dynamicArgument: _kernel.dynamicArguments, - context: _kernel.context, - canvas: _kernel.canvas, - output: newOutput || _kernel.output, - precision: _kernel.precision, - pipeline: _kernel.pipeline, - immutable: _kernel.immutable, - optimizeFloatMemory: _kernel.optimizeFloatMemory, - fixIntegerDivisionAccuracy: _kernel.fixIntegerDivisionAccuracy, - functions: _kernel.functions, - nativeFunctions: _kernel.nativeFunctions, - injectedNative: _kernel.injectedNative, - subKernels: _kernel.subKernels, - strictIntegers: _kernel.strictIntegers, - debug: _kernel.debug, - gpu: _kernel.gpu, - validate, - returnType: _kernel.returnType, - tactic: _kernel.tactic, - onRequestFallback, - onRequestSwitchKernel, - texture: _kernel.texture, - mappedTextures: _kernel.mappedTextures, - drawBuffersMap: _kernel.drawBuffersMap, - })); + const newKernel = (switchableKernels[signature] = new Constructor( + source, + { + argumentTypes, + constantTypes: _kernel.constantTypes, + graphical: _kernel.graphical, + loopMaxIterations: _kernel.loopMaxIterations, + constants: _kernel.constants, + dynamicOutput: _kernel.dynamicOutput, + dynamicArgument: _kernel.dynamicArguments, + context: _kernel.context, + canvas: _kernel.canvas, + output: newOutput || _kernel.output, + precision: _kernel.precision, + pipeline: _kernel.pipeline, + immutable: _kernel.immutable, + optimizeFloatMemory: _kernel.optimizeFloatMemory, + fixIntegerDivisionAccuracy: _kernel.fixIntegerDivisionAccuracy, + functions: _kernel.functions, + nativeFunctions: _kernel.nativeFunctions, + injectedNative: _kernel.injectedNative, + subKernels: _kernel.subKernels, + strictIntegers: _kernel.strictIntegers, + debug: _kernel.debug, + gpu: _kernel.gpu, + validate, + returnType: _kernel.returnType, + tactic: _kernel.tactic, + onRequestFallback, + onRequestSwitchKernel, + texture: _kernel.texture, + mappedTextures: _kernel.mappedTextures, + drawBuffersMap: _kernel.drawBuffersMap, + } + )); newKernel.build.apply(newKernel, args); kernelRun.replaceKernel(newKernel); kernels.push(newKernel); @@ -421,7 +450,9 @@ export class GPU { const settingsCopy = upgradeDeprecatedCreateKernelSettings(settings); // handle conversion of argumentTypes if (settings && typeof settings.argumentTypes === 'object') { - settingsCopy.argumentTypes = Object.keys(settings.argumentTypes).map(argumentName => settings.argumentTypes[argumentName]); + settingsCopy.argumentTypes = Object.keys(settings.argumentTypes).map( + argumentName => settings.argumentTypes[argumentName] + ); } if (Array.isArray(arguments[0])) { @@ -524,7 +555,9 @@ export class GPU { */ addNativeFunction(name, source, settings) { if (this.kernels.length > 0) { - throw new Error('Cannot call "addNativeFunction" after "createKernels" has been called.'); + throw new Error( + 'Cannot call "addNativeFunction" after "createKernels" has been called.' + ); } this.nativeFunctions.push(Object.assign({ name, source }, settings)); return this; diff --git a/src/index.d.ts b/src/index.d.ts index d7b8dc02..c509167f 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -13,13 +13,61 @@ export class GPU { nativeFunctions: IGPUNativeFunction[]; setFunctions(flag: any): this; setNativeFunctions(flag: IGPUNativeFunction[]): this; - addFunction(kernel: GPUFunction, settings?: IGPUFunctionSettings): this; - addNativeFunction(name: string, source: string, settings?: IGPUFunctionSettings): this; + addFunction< + ArgTypes extends ThreadKernelVariable[] = ThreadKernelVariable[], + ConstantsType = {} + >( + kernel: GPUFunction, + settings?: IGPUFunctionSettings + ): this; + addNativeFunction( + name: string, + source: string, + settings?: IGPUFunctionSettings + ): this; combineKernels(...kernels: KernelFunction[]): IKernelRunShortcut; - combineKernels(...kernels: KF[]): ((...args: Parameters) => ReturnType[] | ReturnType[][] | ReturnType[][][] | Texture | void) & IKernelRunShortcutBase; - createKernel(kernel: KernelFunction, settings?: IGPUKernelSettings): IKernelRunShortcut; - createKernel(kernel: KernelType, settings?: IGPUKernelSettings): ((...args: Parameters) => ReturnType[] | ReturnType[][] | ReturnType[][][] | Texture | void) & IKernelRunShortcutBase; - createKernelMap(subKernels: ISubKernelObject, rootKernel: ThreadFunction, settings?: IGPUKernelSettings): ((this: IKernelFunctionThis, ...args: ArgTypes) => IMappedKernelResult) & IKernelMapRunShortcut; + combineKernels( + ...kernels: KF[] + ): (( + ...args: Parameters + ) => + | ReturnType[] + | ReturnType[][] + | ReturnType[][][] + | Texture + | void) & + IKernelRunShortcutBase; + createKernel< + ArgTypes extends ThreadKernelVariable[], + ConstantsT extends IConstantsThis + >( + kernel: KernelFunction, + settings?: IGPUKernelSettings + ): IKernelRunShortcut; + createKernel( + kernel: KernelType, + settings?: IGPUKernelSettings + ): (( + ...args: Parameters + ) => + | ReturnType[] + | ReturnType[][] + | ReturnType[][][] + | Texture + | void) & + IKernelRunShortcutBase; + createKernelMap< + ArgTypes extends ThreadKernelVariable[], + ConstantsType = null + >( + subKernels: ISubKernelObject, + rootKernel: ThreadFunction, + settings?: IGPUKernelSettings + ): (( + this: IKernelFunctionThis, + ...args: ArgTypes + ) => IMappedKernelResult) & + IKernelMapRunShortcut; destroy(): Promise; Kernel: typeof Kernel; mode: string; @@ -28,11 +76,15 @@ export class GPU { } export interface ISubKernelObject { - [targetLocation: string]: ((...args: ThreadKernelVariable[]) => ThreadFunctionResult) | ((...args: any[]) => ThreadFunctionResult); + [targetLocation: string]: + | ((...args: ThreadKernelVariable[]) => ThreadFunctionResult) + | ((...args: any[]) => ThreadFunctionResult); } export interface ISubKernelArray { - [index: number]: ((...args: ThreadKernelVariable[]) => ThreadFunctionResult) | ((...args: any[]) => ThreadFunctionResult); + [index: number]: + | ((...args: ThreadKernelVariable[]) => ThreadFunctionResult) + | ((...args: any[]) => ThreadFunctionResult); } export interface ISubKernelsResults { @@ -79,7 +131,28 @@ export interface IGPUSettings { // format: 'Float32Array' | 'Float16Array' | 'Float' // WE WANT THIS! } -export type GPUVariableType = 'Array' | 'Array(2)' | 'Array(3)' | 'Array(4)' | 'Array1D(2)' | 'Array2D(2)' | 'Array3D(2)' | 'Array1D(3)' | 'Array2D(3)' | 'Array3D(3)' | 'Array1D(4)' | 'Array2D(4)' | 'Array3D(4)' | 'Boolean' | 'HTMLCanvas' | 'HTMLImage' | 'HTMLImageArray' | 'Number' | 'Float' | 'Integer' | GPUTextureType; +export type GPUVariableType = + | 'Array' + | 'Array(2)' + | 'Array(3)' + | 'Array(4)' + | 'Array1D(2)' + | 'Array2D(2)' + | 'Array3D(2)' + | 'Array1D(3)' + | 'Array2D(3)' + | 'Array3D(3)' + | 'Array1D(4)' + | 'Array2D(4)' + | 'Array3D(4)' + | 'Boolean' + | 'HTMLCanvas' + | 'HTMLImage' + | 'HTMLImageArray' + | 'Number' + | 'Float' + | 'Integer' + | GPUTextureType; export type GPUTextureType = 'NumberTexture' | 'ArrayTexture(4)'; @@ -127,10 +200,17 @@ export class Kernel { mappedTextures?: Texture[]; TextureConstructor: typeof Texture; getPixels(flip?: boolean): Uint8ClampedArray[]; - getVariablePrecisionString(textureSize?: number[], tactic?: Tactic, isInt?: boolean): string; + getVariablePrecisionString( + textureSize?: number[], + tactic?: Tactic, + isInt?: boolean + ): string; prependString(value: string): void; hasPrependString(value: string): boolean; - constructor(kernel: KernelFunction | IKernelJSON | string, settings?: IDirectKernelSettings); + constructor( + kernel: KernelFunction | IKernelJSON | string, + settings?: IDirectKernelSettings + ); onRequestSwitchKernel?: Kernel; onActivate(previousKernel: Kernel): void; build(...args: KernelVariable[]): void; @@ -154,7 +234,10 @@ export class Kernel { setImmutable(flag: boolean): this; setCanvas(flag: any): this; setContext(flag: any): this; - addFunction(flag: GPUFunction, settings?: IFunctionSettings): this; + addFunction( + flag: GPUFunction, + settings?: IFunctionSettings + ): this; setFunctions(flag: any): this; setNativeFunctions(flag: IGPUNativeFunction[]): this; setStrictIntegers(flag: boolean): this; @@ -166,8 +249,19 @@ export class Kernel { setUniform1f(name: string, value: number): void; setUniform2f(name: string, value1: number, value2: number): void; - setUniform3f(name: string, value1: number, value2: number, value3: number): void; - setUniform4f(name: string, value1: number, value2: number, value3: number, value4: number): void; + setUniform3f( + name: string, + value1: number, + value2: number, + value3: number + ): void; + setUniform4f( + name: string, + value1: number, + value2: number, + value3: number, + value4: number + ): void; setUniform2fv(name: string, value: [number, number]): void; setUniform3fv(name: string, value: [number, number, number]): void; @@ -175,17 +269,41 @@ export class Kernel { setUniform1i(name: string, value: number): void; setUniform2i(name: string, value1: number, value2: number): void; - setUniform3i(name: string, value1: number, value2: number, value3: number): void; - setUniform4i(name: string, value1: number, value2: number, value3: number, value4: number): void; + setUniform3i( + name: string, + value1: number, + value2: number, + value3: number + ): void; + setUniform4i( + name: string, + value1: number, + value2: number, + value3: number, + value4: number + ): void; setUniform2iv(name: string, value: [number, number]): void; setUniform3iv(name: string, value: [number, number, number]): void; setUniform4iv(name: string, value: [number, number, number, number]): void; } -export type GPUFunction = ThreadFunction | IFunction | IGPUFunction | string[]; +export type GPUFunction< + ArgTypes extends ThreadKernelVariable[] = ThreadKernelVariable[], + ConstantsType = {} +> = + | ThreadFunction + | IFunction + | IGPUFunction + | string[]; -export type ThreadFunction = (this: IKernelFunctionThis, ...args: ArgTypes) => ThreadFunctionResult; +export type ThreadFunction< + ArgTypes extends ThreadKernelVariable[] = ThreadKernelVariable[], + ConstantsType = {} +> = ( + this: IKernelFunctionThis, + ...args: ArgTypes +) => ThreadFunctionResult; export type Precision = 'single' | 'unsigned'; @@ -291,7 +409,10 @@ export interface IKernelRunShortcutBase extends Kernel { export interface IKernelRunShortcut extends IKernelRunShortcutBase {} -export interface IKernelMapRunShortcut extends IKernelRunShortcutBase<{ result: KernelOutput } & { [key in keyof SubKernelType]: KernelOutput }> {} +export interface IKernelMapRunShortcut + extends IKernelRunShortcutBase< + { result: KernelOutput } & { [key in keyof SubKernelType]: KernelOutput } + > {} export interface IKernelFeatures { isFloatRead: boolean; @@ -320,11 +441,58 @@ export interface IKernelFunctionThis { color(r: number, g: number, b: number, a: number): void; } -export type KernelVariable = boolean | number | Texture | Input | HTMLCanvasElement | OffscreenCanvas | HTMLVideoElement | HTMLImageElement | HTMLImageElement[] | ImageBitmap | ImageData | Float32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | KernelOutput; - -export type ThreadFunctionResult = number | number[] | number[][] | [number, number] | [number, number, number] | [number, number, number, number] | Pixel | Boolean; - -export type ThreadKernelVariable = boolean | number | number[] | number[][] | number[][][] | Float32Array | Float32Array[] | Float32Array[][] | Pixel | Pixel[][] | [number, number] | [number, number][] | [number, number][][] | [number, number][][][] | [number, number, number] | [number, number, number][] | [number, number, number][][] | [number, number, number][][][] | [number, number, number, number] | [number, number, number, number][] | [number, number, number, number][][] | [number, number, number, number][][][]; +export type KernelVariable = + | boolean + | number + | Texture + | Input + | HTMLCanvasElement + | OffscreenCanvas + | HTMLVideoElement + | HTMLImageElement + | HTMLImageElement[] + | ImageBitmap + | ImageData + | Float32Array + | Uint8Array + | Uint16Array + | Uint32Array + | Uint8ClampedArray + | KernelOutput; + +export type ThreadFunctionResult = + | number + | number[] + | number[][] + | [number, number] + | [number, number, number] + | [number, number, number, number] + | Pixel + | Boolean; + +export type ThreadKernelVariable = + | boolean + | number + | number[] + | number[][] + | number[][][] + | Float32Array + | Float32Array[] + | Float32Array[][] + | Pixel + | Pixel[][] + | [number, number] + | [number, number][] + | [number, number][][] + | [number, number][][][] + | [number, number, number] + | [number, number, number][] + | [number, number, number][][] + | [number, number, number][][][] + | [number, number, number, number] + | [number, number, number, number][] + | [number, number, number, number][][] + | [number, number, number, number][][][]; export type Pixel = { r: number; @@ -338,11 +506,32 @@ export type Pixel = { // ...args: ArgT // ) => KernelOutput); -export interface KernelFunction { +export interface KernelFunction< + ArgT extends ThreadKernelVariable[] = ThreadKernelVariable[], + ConstantsT = {} +> { (this: IKernelFunctionThis, ...args: ArgT): KernelOutput; } -export type KernelOutput = void | number | number[] | number[][] | number[][][] | Float32Array | Float32Array[] | Float32Array[][] | [number, number][] | [number, number, number][] | [number, number, number, number][] | [number, number][][] | [number, number, number][][] | [number, number, number, number][][] | [number, number][][][] | [number, number, number][][][] | [number, number, number, number][][][] | Texture; +export type KernelOutput = + | void + | number + | number[] + | number[][] + | number[][][] + | Float32Array + | Float32Array[] + | Float32Array[][] + | [number, number][] + | [number, number, number][] + | [number, number, number, number][] + | [number, number][][] + | [number, number, number][][] + | [number, number, number, number][][] + | [number, number][][][] + | [number, number, number][][][] + | [number, number, number, number][][][] + | Texture; export interface IFunction { source: string; @@ -380,7 +569,11 @@ export interface ISubKernel { } export class FunctionBuilder { - static fromKernel(kernel: Kernel, FunctionNode: FunctionNode, extraNodeOptions?: any): FunctionBuilder; + static fromKernel( + kernel: Kernel, + FunctionNode: FunctionNode, + extraNodeOptions?: any + ): FunctionBuilder; constructor(settings: IFunctionBuilderSettings); addFunctionNode(functionNode: FunctionNode): void; traceFunctionCalls(functionName: string, retList?: string[]): string[]; @@ -431,7 +624,22 @@ export class Texture { kernel: Kernel; } -export type TextureArrayOutput = number[] | number[][] | number[][][] | Float32Array | Float32Array[] | Float32Array[][] | [number, number][] | [number, number][][] | [number, number][][][] | [number, number, number][] | [number, number, number][][] | [number, number, number][][][] | [number, number, number, number][] | [number, number, number, number][][] | [number, number, number, number][][][]; +export type TextureArrayOutput = + | number[] + | number[][] + | number[][][] + | Float32Array + | Float32Array[] + | Float32Array[][] + | [number, number][] + | [number, number][][] + | [number, number][][][] + | [number, number, number][] + | [number, number, number][][] + | [number, number, number][][][] + | [number, number, number, number][] + | [number, number, number, number][][] + | [number, number, number, number][][][]; export interface IPlugin { source: string; @@ -442,7 +650,11 @@ export interface IPlugin { onBeforeRun: (kernel: Kernel) => void; } -export type OutputDimensions = [number] | [number, number] | [number, number, number] | Int32Array; +export type OutputDimensions = + | [number] + | [number, number] + | [number, number, number] + | Int32Array; export type TextureDimensions = [number, number]; export class Input { diff --git a/src/input.js b/src/input.js index 65660701..7af22f56 100644 --- a/src/input.js +++ b/src/input.js @@ -19,11 +19,19 @@ export class Input { const [w, h, d] = this.size; if (d) { if (this.value.length !== w * h * d) { - throw new Error(`Input size ${this.value.length} does not match ${w} * ${h} * ${d} = ${h * w * d}`); + throw new Error( + `Input size ${ + this.value.length + } does not match ${w} * ${h} * ${d} = ${h * w * d}` + ); } } else if (h) { if (this.value.length !== w * h) { - throw new Error(`Input size ${this.value.length} does not match ${w} * ${h} = ${h * w}`); + throw new Error( + `Input size ${this.value.length} does not match ${w} * ${h} = ${ + h * w + }` + ); } } else { if (this.value.length !== w) { @@ -35,9 +43,18 @@ export class Input { toArray() { const [w, h, d] = this.size; if (d) { - return utils.erectMemoryOptimized3DFloat(this.value.subarray ? this.value : new Float32Array(this.value), w, h, d); + return utils.erectMemoryOptimized3DFloat( + this.value.subarray ? this.value : new Float32Array(this.value), + w, + h, + d + ); } else if (h) { - return utils.erectMemoryOptimized2DFloat(this.value.subarray ? this.value : new Float32Array(this.value), w, h); + return utils.erectMemoryOptimized2DFloat( + this.value.subarray ? this.value : new Float32Array(this.value), + w, + h + ); } else { return this.value; } diff --git a/src/kernel-run-shortcut.js b/src/kernel-run-shortcut.js index 18a60d88..3a956573 100644 --- a/src/kernel-run-shortcut.js +++ b/src/kernel-run-shortcut.js @@ -12,7 +12,11 @@ export function kernelRunShortcut(kernel) { let result = kernel.run.apply(kernel, arguments); if (kernel.switchingKernels) { const reasons = kernel.resetSwitchingKernels(); - const newKernel = kernel.onRequestSwitchKernel(reasons, arguments, kernel); + const newKernel = kernel.onRequestSwitchKernel( + reasons, + arguments, + kernel + ); shortcut.kernel = kernel = newKernel; result = newKernel.run.apply(newKernel, arguments); } @@ -61,7 +65,10 @@ function bindKernelToShortcut(kernel, shortcut) { const property = properties[i]; if (property[0] === '_' && property[1] === '_') continue; if (typeof kernel[property] === 'function') { - if (property.substring(0, 3) === 'add' || property.substring(0, 3) === 'set') { + if ( + property.substring(0, 3) === 'add' || + property.substring(0, 3) === 'set' + ) { shortcut[property] = function () { shortcut.kernel[property].apply(shortcut.kernel, arguments); return shortcut; diff --git a/src/texture.js b/src/texture.js index 15a9e9d1..fd9b6ebe 100644 --- a/src/texture.js +++ b/src/texture.js @@ -4,7 +4,17 @@ */ export class Texture { constructor(settings) { - const { texture, size, dimensions, output, context, type = 'NumberTexture', kernel, internalFormat, textureFormat } = settings; + const { + texture, + size, + dimensions, + output, + context, + type = 'NumberTexture', + kernel, + internalFormat, + textureFormat, + } = settings; if (!output) throw new Error('settings property "output" required.'); if (!context) throw new Error('settings property "context" required.'); if (!texture) throw new Error('settings property "texture" required.'); diff --git a/src/utils.js b/src/utils.js index 6654dc0d..ab50ca50 100644 --- a/src/utils.js +++ b/src/utils.js @@ -67,7 +67,10 @@ export const utils = { }, getFunctionBodyFromString(funcStr) { - return funcStr.substring(funcStr.indexOf('{') + 1, funcStr.lastIndexOf('}')); + return funcStr.substring( + funcStr.indexOf('{') + 1, + funcStr.lastIndexOf('}') + ); }, /** @@ -77,7 +80,9 @@ export const utils = { */ getArgumentNamesFromString(fn) { const fnStr = fn.replace(STRIP_COMMENTS, ''); - let result = fnStr.slice(fnStr.indexOf('(') + 1, fnStr.indexOf(')')).match(ARGUMENT_NAMES); + let result = fnStr + .slice(fnStr.indexOf('(') + 1, fnStr.indexOf(')')) + .match(ARGUMENT_NAMES); if (result === null) { result = []; } @@ -90,7 +95,12 @@ export const utils = { * @returns {Object|Array} Cloned object */ clone(obj) { - if (obj === null || typeof obj !== 'object' || obj.hasOwnProperty('isActiveClone')) return obj; + if ( + obj === null || + typeof obj !== 'object' || + obj.hasOwnProperty('isActiveClone') + ) + return obj; const temp = obj.constructor(); // changed @@ -152,11 +162,20 @@ export const utils = { } } else if (value.hasOwnProperty('type')) { return value.type; - } else if (typeof OffscreenCanvas !== 'undefined' && value instanceof OffscreenCanvas) { + } else if ( + typeof OffscreenCanvas !== 'undefined' && + value instanceof OffscreenCanvas + ) { return 'OffscreenCanvas'; - } else if (typeof ImageBitmap !== 'undefined' && value instanceof ImageBitmap) { + } else if ( + typeof ImageBitmap !== 'undefined' && + value instanceof ImageBitmap + ) { return 'ImageBitmap'; - } else if (typeof ImageData !== 'undefined' && value instanceof ImageData) { + } else if ( + typeof ImageData !== 'undefined' && + value instanceof ImageData + ) { return 'ImageData'; } return 'Unknown'; @@ -199,7 +218,13 @@ export const utils = { * @returns {TextureDimensions} */ getMemoryOptimizedFloatTextureSize(dimensions, bitRatio) { - const totalArea = utils.roundTo((dimensions[0] || 1) * (dimensions[1] || 1) * (dimensions[2] || 1) * (dimensions[3] || 1), 4); + const totalArea = utils.roundTo( + (dimensions[0] || 1) * + (dimensions[1] || 1) * + (dimensions[2] || 1) * + (dimensions[3] || 1), + 4 + ); const texelCount = totalArea / bitRatio; return utils.closestSquareDimensions(texelCount); }, @@ -333,7 +358,9 @@ export const utils = { splitArray(array, part) { const result = []; for (let i = 0; i < array.length; i += part) { - result.push(new array.constructor(array.buffer, i * 4 + array.byteOffset, part)); + result.push( + new array.constructor(array.buffer, i * 4 + array.byteOffset, part) + ); } return result; }, @@ -378,9 +405,13 @@ export const utils = { }, warnDeprecated(type, oldName, newName) { if (newName) { - console.warn(`You are using a deprecated ${type} "${oldName}". It has been replaced with "${newName}". Fixing, but please upgrade as it will soon be removed.`); + console.warn( + `You are using a deprecated ${type} "${oldName}". It has been replaced with "${newName}". Fixing, but please upgrade as it will soon be removed.` + ); } else { - console.warn(`You are using a deprecated ${type} "${oldName}". It has been removed. Fixing, but please upgrade as it will soon be removed.`); + console.warn( + `You are using a deprecated ${type} "${oldName}". It has been removed. Fixing, but please upgrade as it will soon be removed.` + ); } }, flipPixels: (pixels, width, height) => { @@ -642,9 +673,14 @@ export const utils = { } switch (ast.type) { case 'Program': - return flatten(ast.body) + (ast.body[0].type === 'VariableDeclaration' ? ';' : ''); + return ( + flatten(ast.body) + + (ast.body[0].type === 'VariableDeclaration' ? ';' : '') + ); case 'FunctionDeclaration': - return `function ${ast.id.name}(${ast.params.map(flatten).join(', ')}) ${flatten(ast.body)}`; + return `function ${ast.id.name}(${ast.params + .map(flatten) + .join(', ')}) ${flatten(ast.body)}`; case 'BlockStatement': { const result = []; indent += 2; @@ -680,26 +716,46 @@ export const utils = { } case 'CallExpression': { if (ast.callee.property.name === 'subarray') { - return `${flatten(ast.callee.object)}.${flatten(ast.callee.property)}(${ast.arguments.map(value => flatten(value)).join(', ')})`; + return `${flatten(ast.callee.object)}.${flatten( + ast.callee.property + )}(${ast.arguments.map(value => flatten(value)).join(', ')})`; } - if (ast.callee.object.name === 'gl' || ast.callee.object.name === 'context') { - return `${flatten(ast.callee.object)}.${flatten(ast.callee.property)}(${ast.arguments.map(value => flatten(value)).join(', ')})`; + if ( + ast.callee.object.name === 'gl' || + ast.callee.object.name === 'context' + ) { + return `${flatten(ast.callee.object)}.${flatten( + ast.callee.property + )}(${ast.arguments.map(value => flatten(value)).join(', ')})`; } if (ast.callee.object.type === 'ThisExpression') { - functionDependencies.push(findDependency('this', ast.callee.property.name)); - return `${ast.callee.property.name}(${ast.arguments.map(value => flatten(value)).join(', ')})`; + functionDependencies.push( + findDependency('this', ast.callee.property.name) + ); + return `${ast.callee.property.name}(${ast.arguments + .map(value => flatten(value)) + .join(', ')})`; } else if (ast.callee.object.name) { - const foundSource = findDependency(ast.callee.object.name, ast.callee.property.name); + const foundSource = findDependency( + ast.callee.object.name, + ast.callee.property.name + ); if (foundSource === null) { // we're not flattening it - return `${ast.callee.object.name}.${ast.callee.property.name}(${ast.arguments.map(value => flatten(value)).join(', ')})`; + return `${ast.callee.object.name}.${ + ast.callee.property.name + }(${ast.arguments.map(value => flatten(value)).join(', ')})`; } else { functionDependencies.push(foundSource); // we're flattening it - return `${ast.callee.property.name}(${ast.arguments.map(value => flatten(value)).join(', ')})`; + return `${ast.callee.property.name}(${ast.arguments + .map(value => flatten(value)) + .join(', ')})`; } } else if (ast.callee.object.type === 'MemberExpression') { - return `${flatten(ast.callee.object)}.${ast.callee.property.name}(${ast.arguments.map(value => flatten(value)).join(', ')})`; + return `${flatten(ast.callee.object)}.${ + ast.callee.property.name + }(${ast.arguments.map(value => flatten(value)).join(', ')})`; } else { throw new Error('unknown ast.callee'); } @@ -719,7 +775,9 @@ export const utils = { case 'SequenceExpression': return `(${flatten(ast.expressions)})`; case 'ArrowFunctionExpression': - return `(${ast.params.map(flatten).join(', ')}) => ${flatten(ast.body)}`; + return `(${ast.params.map(flatten).join(', ')}) => ${flatten( + ast.body + )}`; case 'Literal': return ast.raw; case 'Identifier': @@ -735,9 +793,13 @@ export const utils = { case 'ThisExpression': return 'this'; case 'NewExpression': - return `new ${flatten(ast.callee)}(${ast.arguments.map(value => flatten(value)).join(', ')})`; + return `new ${flatten(ast.callee)}(${ast.arguments + .map(value => flatten(value)) + .join(', ')})`; case 'ForStatement': - return `for (${flatten(ast.init)};${flatten(ast.test)};${flatten(ast.update)}) ${flatten(ast.body)}`; + return `for (${flatten(ast.init)};${flatten(ast.test)};${flatten( + ast.update + )}) ${flatten(ast.body)}`; case 'AssignmentExpression': return `${flatten(ast.left)}${ast.operator}${flatten(ast.right)}`; case 'UpdateExpression': @@ -753,7 +815,9 @@ export const utils = { case 'DebuggerStatement': return 'debugger;'; case 'ConditionalExpression': - return `${flatten(ast.test)}?${flatten(ast.consequent)}:${flatten(ast.alternate)}`; + return `${flatten(ast.test)}?${flatten(ast.consequent)}:${flatten( + ast.alternate + )}`; case 'Property': if (ast.kind === 'init') { return flatten(ast.key); @@ -769,7 +833,12 @@ export const utils = { if (!flattened[functionDependency]) { flattened[functionDependency] = true; } - functionDependency ? flattenedFunctionDependencies.push(utils.flattenFunctionToString(functionDependency, settings) + '\n') : ''; + functionDependency + ? flattenedFunctionDependencies.push( + utils.flattenFunctionToString(functionDependency, settings) + + '\n' + ) + : ''; } return flattenedFunctionDependencies.join('') + result; } @@ -777,16 +846,36 @@ export const utils = { }, normalizeDeclarations: ast => { - if (ast.type !== 'VariableDeclaration') throw new Error('Ast is not of type "VariableDeclaration"'); + if (ast.type !== 'VariableDeclaration') + throw new Error('Ast is not of type "VariableDeclaration"'); const normalizedDeclarations = []; - for (let declarationIndex = 0; declarationIndex < ast.declarations.length; declarationIndex++) { + for ( + let declarationIndex = 0; + declarationIndex < ast.declarations.length; + declarationIndex++ + ) { const declaration = ast.declarations[declarationIndex]; - if (declaration.id && declaration.id.type === 'ObjectPattern' && declaration.id.properties) { + if ( + declaration.id && + declaration.id.type === 'ObjectPattern' && + declaration.id.properties + ) { const { properties } = declaration.id; - for (let propertyIndex = 0; propertyIndex < properties.length; propertyIndex++) { + for ( + let propertyIndex = 0; + propertyIndex < properties.length; + propertyIndex++ + ) { const property = properties[propertyIndex]; - if (property.value.type === 'ObjectPattern' && property.value.properties) { - for (let subPropertyIndex = 0; subPropertyIndex < property.value.properties.length; subPropertyIndex++) { + if ( + property.value.type === 'ObjectPattern' && + property.value.properties + ) { + for ( + let subPropertyIndex = 0; + subPropertyIndex < property.value.properties.length; + subPropertyIndex++ + ) { const subProperty = property.value.properties[subPropertyIndex]; if (subProperty.type === 'Property') { normalizedDeclarations.push({ @@ -822,7 +911,10 @@ export const utils = { type: 'VariableDeclarator', id: { type: 'Identifier', - name: property.value && property.value.name ? property.value.name : property.key.name, + name: + property.value && property.value.name + ? property.value.name + : property.key.name, }, init: { type: 'MemberExpression', @@ -838,9 +930,17 @@ export const utils = { throw new Error('unexpected state'); } } - } else if (declaration.id && declaration.id.type === 'ArrayPattern' && declaration.id.elements) { + } else if ( + declaration.id && + declaration.id.type === 'ArrayPattern' && + declaration.id.elements + ) { const { elements } = declaration.id; - for (let elementIndex = 0; elementIndex < elements.length; elementIndex++) { + for ( + let elementIndex = 0; + elementIndex < elements.length; + elementIndex++ + ) { const element = elements[elementIndex]; if (element.type === 'Identifier') { normalizedDeclarations.push({ @@ -924,7 +1024,12 @@ export const utils = { argumentTypes: { a: 'HTMLImage' }, } ); - const result = [rKernel(image), gKernel(image), bKernel(image), aKernel(image)]; + const result = [ + rKernel(image), + gKernel(image), + bKernel(image), + aKernel(image), + ]; result.rKernel = rKernel; result.gKernel = gKernel; result.bKernel = bKernel; @@ -993,7 +1098,12 @@ export const utils = { } ); visualKernelA(rgba); - return [visualKernelR.canvas, visualKernelG.canvas, visualKernelB.canvas, visualKernelA.canvas]; + return [ + visualKernelR.canvas, + visualKernelG.canvas, + visualKernelB.canvas, + visualKernelA.canvas, + ]; }, getMinifySafeName: fn => { @@ -1002,7 +1112,9 @@ export const utils = { const { init } = ast.body[0].declarations[0]; return init.body.name || init.body.body[0].argument.name; } catch (e) { - throw new Error('Unrecognized function type. Please use `() => yourFunctionVariableHere` or function() { return yourFunctionVariableHere; }'); + throw new Error( + 'Unrecognized function type. Please use `() => yourFunctionVariableHere` or function() { return yourFunctionVariableHere; }' + ); } }, sanitizeName: function (name) { diff --git a/test/all-template.html b/test/all-template.html index 7f2f9536..f00e1cfb 100644 --- a/test/all-template.html +++ b/test/all-template.html @@ -29,7 +29,8 @@ if (module === 'sinon') return sinon; if (module === 'qunit') return QUnit; if (module === 'acorn') return acorn; - if (module.match(/[.][.]\/browser-test-utils$/)) return browserTestUtils; + if (module.match(/[.][.]\/browser-test-utils$/)) + return browserTestUtils; throw new Error('cannot find ' + module); }; diff --git a/test/all.html b/test/all.html index e2e6260b..2678878f 100644 --- a/test/all.html +++ b/test/all.html @@ -29,7 +29,8 @@ if (module === 'sinon') return sinon; if (module === 'qunit') return QUnit; if (module === 'acorn') return acorn; - if (module.match(/[.][.]\/browser-test-utils$/)) return browserTestUtils; + if (module.match(/[.][.]\/browser-test-utils$/)) + return browserTestUtils; throw new Error('cannot find ' + module); }; @@ -38,7 +39,10 @@ - + @@ -78,7 +82,10 @@ - + @@ -95,27 +102,45 @@ - + - + - + - + - + - + @@ -124,7 +149,10 @@ - + @@ -133,8 +161,14 @@ - - + + @@ -142,27 +176,51 @@ - - - + + + - + - + - + - + - + @@ -183,146 +241,557 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/browser-test-utils.js b/test/browser-test-utils.js index 00deb4e1..45255f7d 100644 --- a/test/browser-test-utils.js +++ b/test/browser-test-utils.js @@ -15,7 +15,12 @@ function imageToArray(image) { const row = []; result.unshift(row); for (let x = 0; x < image.width; x++) { - const pixel = new Float32Array([data[i++], data[i++], data[i++], data[i++]]); + const pixel = new Float32Array([ + data[i++], + data[i++], + data[i++], + data[i++], + ]); row.push(pixel); } } @@ -45,7 +50,9 @@ function check2DImage(result, expected, channel) { for (let y = 0; y < height; y++) { for (let x = 0; x < width; x++) { if (result[y][x] !== expected[y][x][channel]) { - throw new Error(`result[${y}][${x}] value does not match expected value of ${expected[y][x][channel]}`); + throw new Error( + `result[${y}][${x}] value does not match expected value of ${expected[y][x][channel]}` + ); } } } diff --git a/test/features/add-custom-function.js b/test/features/add-custom-function.js index a2387242..2687173e 100644 --- a/test/features/add-custom-function.js +++ b/test/features/add-custom-function.js @@ -40,13 +40,19 @@ test('in GPU instance settings gpu', () => { inGPUInstanceSettings('webgl'); }); -(GPU.isWebGL2Supported ? test : skip)('in GPU instance settings webgl2', () => { - inGPUInstanceSettings('webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'in GPU instance settings webgl2', + () => { + inGPUInstanceSettings('webgl2'); + } +); -(GPU.isHeadlessGLSupported ? test : skip)('in GPU instance settings headlessgl', () => { - inGPUInstanceSettings('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'in GPU instance settings headlessgl', + () => { + inGPUInstanceSettings('headlessgl'); + } +); test('in GPU instance settings cpu', () => { inGPUInstanceSettings('cpu'); @@ -85,17 +91,26 @@ test('with GPU addFunction method gpu', () => { withGPUAddFunctionMethod('gpu'); }); -(GPU.isWebGLSupported ? test : skip)('with GPU addFunction method webgl', () => { - withGPUAddFunctionMethod('webgl'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'with GPU addFunction method webgl', + () => { + withGPUAddFunctionMethod('webgl'); + } +); -(GPU.isWebGL2Supported ? test : skip)('with GPU addFunction method webgl2', () => { - withGPUAddFunctionMethod('webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'with GPU addFunction method webgl2', + () => { + withGPUAddFunctionMethod('webgl2'); + } +); -(GPU.isHeadlessGLSupported ? test : skip)('with GPU addFunction method headlessgl', () => { - withGPUAddFunctionMethod('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'with GPU addFunction method headlessgl', + () => { + withGPUAddFunctionMethod('headlessgl'); + } +); test('with GPU addFunction method cpu', () => { withGPUAddFunctionMethod('cpu'); @@ -135,17 +150,26 @@ test('in Kernel instance settings gpu', () => { inKernelInstanceSettings('gpu'); }); -(GPU.isWebGLSupported ? test : skip)('in Kernel instance settings webgl', () => { - inKernelInstanceSettings('webgl'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'in Kernel instance settings webgl', + () => { + inKernelInstanceSettings('webgl'); + } +); -(GPU.isWebGL2Supported ? test : skip)('in Kernel instance settings webgl2', () => { - inKernelInstanceSettings('webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'in Kernel instance settings webgl2', + () => { + inKernelInstanceSettings('webgl2'); + } +); -(GPU.isHeadlessGLSupported ? test : skip)('in Kernel instance settings headlessgl', () => { - inKernelInstanceSettings('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'in Kernel instance settings headlessgl', + () => { + inKernelInstanceSettings('headlessgl'); + } +); test('in Kernel instance settings cpu', () => { inKernelInstanceSettings('cpu'); @@ -186,17 +210,26 @@ test('with Kernel addFunction method gpu', () => { withKernelAddFunctionMethod('gpu'); }); -(GPU.isWebGLSupported ? test : skip)('with Kernel addFunction method webgl', () => { - withKernelAddFunctionMethod('webgl'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'with Kernel addFunction method webgl', + () => { + withKernelAddFunctionMethod('webgl'); + } +); -(GPU.isWebGL2Supported ? test : skip)('with Kernel addFunction method webgl2', () => { - withKernelAddFunctionMethod('webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'with Kernel addFunction method webgl2', + () => { + withKernelAddFunctionMethod('webgl2'); + } +); -(GPU.isHeadlessGLSupported ? test : skip)('with Kernel addFunction method headlessgl', () => { - withKernelAddFunctionMethod('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'with Kernel addFunction method headlessgl', + () => { + withKernelAddFunctionMethod('headlessgl'); + } +); test('with Kernel addFunction method cpu', () => { withKernelAddFunctionMethod('cpu'); @@ -314,9 +347,12 @@ test('sumABThisOutputX gpu', () => { sumABThisOutputX('webgl2'); }); -(GPU.isHeadlessGLSupported ? test : skip)('sumABThisOutputX headlessgl', () => { - sumABThisOutputX('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'sumABThisOutputX headlessgl', + () => { + sumABThisOutputX('headlessgl'); + } +); test('sumABThisOutputX cpu', () => { sumABThisOutputX('cpu'); diff --git a/test/features/add-custom-native-function.js b/test/features/add-custom-native-function.js index ef3c436c..f3e7f414 100644 --- a/test/features/add-custom-native-function.js +++ b/test/features/add-custom-native-function.js @@ -114,13 +114,19 @@ test('divideOverride (GPU only) gpu', () => { divideOverride('webgl'); }); -(GPU.isWebGL2Supported ? test : skip)('divideOverride (GPU only) webgl2', () => { - divideOverride('webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'divideOverride (GPU only) webgl2', + () => { + divideOverride('webgl2'); + } +); -(GPU.isHeadlessGLSupported ? test : skip)('divideOverride (GPU only) headlessgl', () => { - divideOverride('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'divideOverride (GPU only) headlessgl', + () => { + divideOverride('headlessgl'); + } +); describe('features: argument casting'); @@ -170,17 +176,26 @@ test('argumentCasting (GPU only) gpu', () => { argumentCasting('gpu'); }); -(GPU.isWebGLSupported ? test : skip)('argumentCasting (GPU only) webgl', () => { - argumentCasting('webgl'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'argumentCasting (GPU only) webgl', + () => { + argumentCasting('webgl'); + } +); -(GPU.isWebGL2Supported ? test : skip)('argumentCasting (GPU only) webgl2', () => { - argumentCasting('webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'argumentCasting (GPU only) webgl2', + () => { + argumentCasting('webgl2'); + } +); -(GPU.isHeadlessGLSupported ? test : skip)('argumentCasting (GPU only) headlessgl', () => { - argumentCasting('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'argumentCasting (GPU only) headlessgl', + () => { + argumentCasting('headlessgl'); + } +); describe('features: mixed argument casting'); @@ -230,17 +245,26 @@ test('mixedArgumentCasting (GPU only) gpu', () => { mixedArgumentCasting('gpu'); }); -(GPU.isWebGLSupported ? test : skip)('mixedArgumentCasting (GPU only) webgl', () => { - mixedArgumentCasting('webgl'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'mixedArgumentCasting (GPU only) webgl', + () => { + mixedArgumentCasting('webgl'); + } +); -(GPU.isWebGL2Supported ? test : skip)('mixedArgumentCasting (GPU only) webgl2', () => { - mixedArgumentCasting('webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'mixedArgumentCasting (GPU only) webgl2', + () => { + mixedArgumentCasting('webgl2'); + } +); -(GPU.isHeadlessGLSupported ? test : skip)('mixedArgumentCasting (GPU only) headlessgl', () => { - mixedArgumentCasting('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'mixedArgumentCasting (GPU only) headlessgl', + () => { + mixedArgumentCasting('headlessgl'); + } +); describe('features: return type casting'); @@ -290,17 +314,26 @@ test('returnTypeCasting (GPU only) gpu', () => { returnTypeCasting('gpu'); }); -(GPU.isWebGLSupported ? test : skip)('returnTypeCasting (GPU only) webgl', () => { - returnTypeCasting('webgl'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'returnTypeCasting (GPU only) webgl', + () => { + returnTypeCasting('webgl'); + } +); -(GPU.isWebGL2Supported ? test : skip)('returnTypeCasting (GPU only) webgl2', () => { - returnTypeCasting('webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'returnTypeCasting (GPU only) webgl2', + () => { + returnTypeCasting('webgl2'); + } +); -(GPU.isHeadlessGLSupported ? test : skip)('returnTypeCasting (GPU only) headlessgl', () => { - returnTypeCasting('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'returnTypeCasting (GPU only) headlessgl', + () => { + returnTypeCasting('headlessgl'); + } +); describe('features: Adding nativeFunctions directly on kernel'); diff --git a/test/features/argument-array-types.js b/test/features/argument-array-types.js index 2b7cbb8c..f96d7501 100644 --- a/test/features/argument-array-types.js +++ b/test/features/argument-array-types.js @@ -20,25 +20,40 @@ function testSinglePrecisionArray2(mode) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported ? test : skip)('single precision Array(2) auto', () => { - testSinglePrecisionArray2(); -}); - -(GPU.isSinglePrecisionSupported ? test : skip)('single precision Array(2) gpu', () => { - testSinglePrecisionArray2('gpu'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('single precision Array(2) webgl', () => { - testSinglePrecisionArray2('webgl'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('single precision Array(2) webgl2', () => { - testSinglePrecisionArray2('webgl2'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('single precision Array(2) headlessgl', () => { - testSinglePrecisionArray2('headlessgl'); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'single precision Array(2) auto', + () => { + testSinglePrecisionArray2(); + } +); + +(GPU.isSinglePrecisionSupported ? test : skip)( + 'single precision Array(2) gpu', + () => { + testSinglePrecisionArray2('gpu'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'single precision Array(2) webgl', + () => { + testSinglePrecisionArray2('webgl'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'single precision Array(2) webgl2', + () => { + testSinglePrecisionArray2('webgl2'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'single precision Array(2) headlessgl', + () => { + testSinglePrecisionArray2('headlessgl'); + } +); test('single precision Array(2) cpu', () => { testSinglePrecisionArray2('cpu'); @@ -69,17 +84,26 @@ test('unsigned precision Array(2) gpu', () => { testUnsignedPrecisionArray2('gpu'); }); -(GPU.isWebGLSupported ? test : skip)('unsigned precision Array(2) webgl', () => { - testUnsignedPrecisionArray2('webgl'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'unsigned precision Array(2) webgl', + () => { + testUnsignedPrecisionArray2('webgl'); + } +); -(GPU.isWebGL2Supported ? test : skip)('unsigned precision Array(2) webgl2', () => { - testUnsignedPrecisionArray2('webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'unsigned precision Array(2) webgl2', + () => { + testUnsignedPrecisionArray2('webgl2'); + } +); -(GPU.isHeadlessGLSupported ? test : skip)('unsigned precision Array(2) headlessgl', () => { - testUnsignedPrecisionArray2('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'unsigned precision Array(2) headlessgl', + () => { + testUnsignedPrecisionArray2('headlessgl'); + } +); test('unsigned precision Array(2) cpu', () => { testUnsignedPrecisionArray2('cpu'); @@ -102,25 +126,40 @@ function testSinglePrecisionArray3(mode) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported ? test : skip)('single precision Array(3) auto', () => { - testSinglePrecisionArray3(); -}); - -(GPU.isSinglePrecisionSupported ? test : skip)('single precision Array(3) gpu', () => { - testSinglePrecisionArray3('gpu'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('single precision Array(3) webgl', () => { - testSinglePrecisionArray3('webgl'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('single precision Array(3) webgl2', () => { - testSinglePrecisionArray3('webgl2'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('single precision Array(3) headlessgl', () => { - testSinglePrecisionArray3('headlessgl'); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'single precision Array(3) auto', + () => { + testSinglePrecisionArray3(); + } +); + +(GPU.isSinglePrecisionSupported ? test : skip)( + 'single precision Array(3) gpu', + () => { + testSinglePrecisionArray3('gpu'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'single precision Array(3) webgl', + () => { + testSinglePrecisionArray3('webgl'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'single precision Array(3) webgl2', + () => { + testSinglePrecisionArray3('webgl2'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'single precision Array(3) headlessgl', + () => { + testSinglePrecisionArray3('headlessgl'); + } +); test('single precision Array(3) cpu', () => { testSinglePrecisionArray3('cpu'); @@ -151,17 +190,26 @@ test('unsigned precision Array(3) gpu', () => { testUnsignedPrecisionArray3('gpu'); }); -(GPU.isWebGLSupported ? test : skip)('unsigned precision Array(3) webgl', () => { - testUnsignedPrecisionArray3('webgl'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'unsigned precision Array(3) webgl', + () => { + testUnsignedPrecisionArray3('webgl'); + } +); -(GPU.isWebGL2Supported ? test : skip)('unsigned precision Array(3) webgl2', () => { - testUnsignedPrecisionArray3('webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'unsigned precision Array(3) webgl2', + () => { + testUnsignedPrecisionArray3('webgl2'); + } +); -(GPU.isHeadlessGLSupported ? test : skip)('unsigned precision Array(3) headlessgl', () => { - testUnsignedPrecisionArray3('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'unsigned precision Array(3) headlessgl', + () => { + testUnsignedPrecisionArray3('headlessgl'); + } +); test('unsigned precision Array(3) cpu', () => { testUnsignedPrecisionArray3('cpu'); @@ -184,25 +232,40 @@ function testSinglePrecisionArray4(mode) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported ? test : skip)('single precision Array(4) auto', () => { - testSinglePrecisionArray4(); -}); - -(GPU.isSinglePrecisionSupported ? test : skip)('single precision Array(4) gpu', () => { - testSinglePrecisionArray4('gpu'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('single precision Array(4) webgl', () => { - testSinglePrecisionArray4('webgl'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('single precision Array(4) webgl2', () => { - testSinglePrecisionArray4('webgl2'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('single precision Array(4) headlessgl', () => { - testSinglePrecisionArray4('headlessgl'); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'single precision Array(4) auto', + () => { + testSinglePrecisionArray4(); + } +); + +(GPU.isSinglePrecisionSupported ? test : skip)( + 'single precision Array(4) gpu', + () => { + testSinglePrecisionArray4('gpu'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'single precision Array(4) webgl', + () => { + testSinglePrecisionArray4('webgl'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'single precision Array(4) webgl2', + () => { + testSinglePrecisionArray4('webgl2'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'single precision Array(4) headlessgl', + () => { + testSinglePrecisionArray4('headlessgl'); + } +); test('single precision Array(4) cpu', () => { testSinglePrecisionArray4('cpu'); @@ -233,17 +296,26 @@ test('unsigned precision Array(4) gpu', () => { testUnsignedPrecisionArray4('gpu'); }); -(GPU.isWebGLSupported ? test : skip)('unsigned precision Array(4) webgl', () => { - testUnsignedPrecisionArray4('webgl'); -}); - -(GPU.isWebGL2Supported ? test : skip)('unsigned precision Array(4) webgl2', () => { - testUnsignedPrecisionArray4('webgl2'); -}); - -(GPU.isHeadlessGLSupported ? test : skip)('unsigned precision Array(4) headlessgl', () => { - testUnsignedPrecisionArray4('headlessgl'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'unsigned precision Array(4) webgl', + () => { + testUnsignedPrecisionArray4('webgl'); + } +); + +(GPU.isWebGL2Supported ? test : skip)( + 'unsigned precision Array(4) webgl2', + () => { + testUnsignedPrecisionArray4('webgl2'); + } +); + +(GPU.isHeadlessGLSupported ? test : skip)( + 'unsigned precision Array(4) headlessgl', + () => { + testUnsignedPrecisionArray4('headlessgl'); + } +); test('unsigned precision Array(4) cpu', () => { testUnsignedPrecisionArray4('cpu'); diff --git a/test/features/argument-array1d-types.js b/test/features/argument-array1d-types.js index e88bb61d..bcfd8ac7 100644 --- a/test/features/argument-array1d-types.js +++ b/test/features/argument-array1d-types.js @@ -15,31 +15,51 @@ function testSinglePrecisionArray1D2(mode) { precision: 'single', } ); - const value = [new Float32Array([1, 2]), new Float32Array([3, 4]), new Float32Array([5, 6]), new Float32Array([7, 8])]; + const value = [ + new Float32Array([1, 2]), + new Float32Array([3, 4]), + new Float32Array([5, 6]), + new Float32Array([7, 8]), + ]; const result = kernel(value); assert.deepEqual(result, value); gpu.destroy(); } -(GPU.isSinglePrecisionSupported ? test : skip)('single precision Array1D(2) auto', () => { - testSinglePrecisionArray1D2(); -}); - -(GPU.isSinglePrecisionSupported ? test : skip)('single precision Array1D(2) gpu', () => { - testSinglePrecisionArray1D2('gpu'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('single precision Array1D(2) webgl', () => { - testSinglePrecisionArray1D2('webgl'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('single precision Array1D(2) webgl2', () => { - testSinglePrecisionArray1D2('webgl2'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('single precision Array1D(2) headlessgl', () => { - testSinglePrecisionArray1D2('headlessgl'); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'single precision Array1D(2) auto', + () => { + testSinglePrecisionArray1D2(); + } +); + +(GPU.isSinglePrecisionSupported ? test : skip)( + 'single precision Array1D(2) gpu', + () => { + testSinglePrecisionArray1D2('gpu'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'single precision Array1D(2) webgl', + () => { + testSinglePrecisionArray1D2('webgl'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'single precision Array1D(2) webgl2', + () => { + testSinglePrecisionArray1D2('webgl2'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'single precision Array1D(2) headlessgl', + () => { + testSinglePrecisionArray1D2('headlessgl'); + } +); test('single precision Array1D(2) cpu', () => { testSinglePrecisionArray1D2('cpu'); @@ -57,7 +77,12 @@ function testUnsignedPrecisionArray1D2(mode) { precision: 'unsigned', } ); - const value = [new Float32Array([1, 2]), new Float32Array([3, 4]), new Float32Array([5, 6]), new Float32Array([7, 8])]; + const value = [ + new Float32Array([1, 2]), + new Float32Array([3, 4]), + new Float32Array([5, 6]), + new Float32Array([7, 8]), + ]; const result = kernel(value); assert.deepEqual(result, value); gpu.destroy(); @@ -71,17 +96,26 @@ test('fallback unsigned precision Array1D(2) gpu', () => { testUnsignedPrecisionArray1D2('gpu'); }); -(GPU.isWebGLSupported ? test : skip)('fallback unsigned precision Array1D(2) webgl', () => { - testUnsignedPrecisionArray1D2('webgl'); -}); - -(GPU.isWebGL2Supported ? test : skip)('fallback unsigned precision Array1D(2) webgl2', () => { - testUnsignedPrecisionArray1D2('webgl2'); -}); - -(GPU.isHeadlessGLSupported ? test : skip)('fallback unsigned precision Array1D(2) headlessgl', () => { - testUnsignedPrecisionArray1D2('headlessgl'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'fallback unsigned precision Array1D(2) webgl', + () => { + testUnsignedPrecisionArray1D2('webgl'); + } +); + +(GPU.isWebGL2Supported ? test : skip)( + 'fallback unsigned precision Array1D(2) webgl2', + () => { + testUnsignedPrecisionArray1D2('webgl2'); + } +); + +(GPU.isHeadlessGLSupported ? test : skip)( + 'fallback unsigned precision Array1D(2) headlessgl', + () => { + testUnsignedPrecisionArray1D2('headlessgl'); + } +); test('fallback unsigned precision Array1D(2) cpu', () => { testUnsignedPrecisionArray1D2('cpu'); @@ -99,31 +133,51 @@ function testSinglePrecisionArray1D3(mode) { precision: 'single', } ); - const value = [new Float32Array([1, 2, 3]), new Float32Array([4, 5, 6]), new Float32Array([7, 8, 9]), new Float32Array([10, 11, 12])]; + const value = [ + new Float32Array([1, 2, 3]), + new Float32Array([4, 5, 6]), + new Float32Array([7, 8, 9]), + new Float32Array([10, 11, 12]), + ]; const result = kernel(value); assert.deepEqual(result, value); gpu.destroy(); } -(GPU.isSinglePrecisionSupported ? test : skip)('single precision Array1D(3) auto', () => { - testSinglePrecisionArray1D3(); -}); - -(GPU.isSinglePrecisionSupported ? test : skip)('single precision Array1D(3) gpu', () => { - testSinglePrecisionArray1D3('gpu'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('single precision Array1D(3) webgl', () => { - testSinglePrecisionArray1D3('webgl'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('single precision Array1D(3) webgl2', () => { - testSinglePrecisionArray1D3('webgl2'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('single precision Array1D(3) headlessgl', () => { - testSinglePrecisionArray1D3('headlessgl'); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'single precision Array1D(3) auto', + () => { + testSinglePrecisionArray1D3(); + } +); + +(GPU.isSinglePrecisionSupported ? test : skip)( + 'single precision Array1D(3) gpu', + () => { + testSinglePrecisionArray1D3('gpu'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'single precision Array1D(3) webgl', + () => { + testSinglePrecisionArray1D3('webgl'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'single precision Array1D(3) webgl2', + () => { + testSinglePrecisionArray1D3('webgl2'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'single precision Array1D(3) headlessgl', + () => { + testSinglePrecisionArray1D3('headlessgl'); + } +); test('single precision Array1D(3) cpu', () => { testSinglePrecisionArray1D3('cpu'); @@ -141,7 +195,12 @@ function testUnsignedPrecisionArray1D3(mode) { precision: 'unsigned', } ); - const value = [new Float32Array([1, 2, 3]), new Float32Array([4, 5, 6]), new Float32Array([7, 8, 9]), new Float32Array([10, 11, 12])]; + const value = [ + new Float32Array([1, 2, 3]), + new Float32Array([4, 5, 6]), + new Float32Array([7, 8, 9]), + new Float32Array([10, 11, 12]), + ]; const result = kernel(value); assert.deepEqual(result, value); assert.deepEqual(result, value); @@ -156,17 +215,26 @@ test('fallback unsigned precision Array1D(3) gpu', () => { testUnsignedPrecisionArray1D3('gpu'); }); -(GPU.isWebGLSupported ? test : skip)('fallback unsigned precision Array1D(3) webgl', () => { - testUnsignedPrecisionArray1D3('webgl'); -}); - -(GPU.isWebGL2Supported ? test : skip)('fallback unsigned precision Array1D(3) webgl2', () => { - testUnsignedPrecisionArray1D3('webgl2'); -}); - -(GPU.isHeadlessGLSupported ? test : skip)('fallback unsigned precision Array1D(3) headlessgl', () => { - testUnsignedPrecisionArray1D3('headlessgl'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'fallback unsigned precision Array1D(3) webgl', + () => { + testUnsignedPrecisionArray1D3('webgl'); + } +); + +(GPU.isWebGL2Supported ? test : skip)( + 'fallback unsigned precision Array1D(3) webgl2', + () => { + testUnsignedPrecisionArray1D3('webgl2'); + } +); + +(GPU.isHeadlessGLSupported ? test : skip)( + 'fallback unsigned precision Array1D(3) headlessgl', + () => { + testUnsignedPrecisionArray1D3('headlessgl'); + } +); test('fallback unsigned precision Array1D(3) cpu', () => { testUnsignedPrecisionArray1D3('cpu'); @@ -184,7 +252,12 @@ function testUnsignedPrecisionArray1D4(mode) { precision: 'unsigned', } ); - const value = [new Float32Array([1, 2, 3, 4]), new Float32Array([5, 6, 7, 8]), new Float32Array([9, 10, 11, 12]), new Float32Array([13, 14, 15, 16])]; + const value = [ + new Float32Array([1, 2, 3, 4]), + new Float32Array([5, 6, 7, 8]), + new Float32Array([9, 10, 11, 12]), + new Float32Array([13, 14, 15, 16]), + ]; const result = kernel(value); assert.deepEqual(result, value); assert.deepEqual(result, value); @@ -199,17 +272,26 @@ test('fallback unsigned precision Array1D(4) gpu', () => { testUnsignedPrecisionArray1D4('gpu'); }); -(GPU.isWebGLSupported ? test : skip)('fallback unsigned precision Array1D(4) webgl', () => { - testUnsignedPrecisionArray1D4('webgl'); -}); - -(GPU.isWebGL2Supported ? test : skip)('fallback unsigned precision Array1D(4) webgl2', () => { - testUnsignedPrecisionArray1D4('webgl2'); -}); - -(GPU.isHeadlessGLSupported ? test : skip)('fallback unsigned precision Array1D(4) headlessgl', () => { - testUnsignedPrecisionArray1D4('headlessgl'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'fallback unsigned precision Array1D(4) webgl', + () => { + testUnsignedPrecisionArray1D4('webgl'); + } +); + +(GPU.isWebGL2Supported ? test : skip)( + 'fallback unsigned precision Array1D(4) webgl2', + () => { + testUnsignedPrecisionArray1D4('webgl2'); + } +); + +(GPU.isHeadlessGLSupported ? test : skip)( + 'fallback unsigned precision Array1D(4) headlessgl', + () => { + testUnsignedPrecisionArray1D4('headlessgl'); + } +); test('fallback unsigned precision Array1D(4) cpu', () => { testUnsignedPrecisionArray1D4('cpu'); diff --git a/test/features/argument-array2d-types.js b/test/features/argument-array2d-types.js index 28eb1cdf..98334f3e 100644 --- a/test/features/argument-array2d-types.js +++ b/test/features/argument-array2d-types.js @@ -16,33 +16,58 @@ function testSinglePrecisionArray2D2(mode) { } ); const value = [ - [new Float32Array([1, 2]), new Float32Array([3, 4]), new Float32Array([5, 6]), new Float32Array([7, 8])], - [new Float32Array([9, 10]), new Float32Array([11, 12]), new Float32Array([13, 14]), new Float32Array([15, 16])], + [ + new Float32Array([1, 2]), + new Float32Array([3, 4]), + new Float32Array([5, 6]), + new Float32Array([7, 8]), + ], + [ + new Float32Array([9, 10]), + new Float32Array([11, 12]), + new Float32Array([13, 14]), + new Float32Array([15, 16]), + ], ]; const result = kernel(value); assert.deepEqual(result, value); gpu.destroy(); } -(GPU.isSinglePrecisionSupported ? test : skip)('single precision Array2D(2) auto', () => { - testSinglePrecisionArray2D2(); -}); - -(GPU.isSinglePrecisionSupported ? test : skip)('single precision Array2D(2) gpu', () => { - testSinglePrecisionArray2D2('gpu'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('single precision Array2D(2) webgl', () => { - testSinglePrecisionArray2D2('webgl'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('single precision Array2D(2) webgl2', () => { - testSinglePrecisionArray2D2('webgl2'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('single precision Array2D(2) headlessgl', () => { - testSinglePrecisionArray2D2('headlessgl'); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'single precision Array2D(2) auto', + () => { + testSinglePrecisionArray2D2(); + } +); + +(GPU.isSinglePrecisionSupported ? test : skip)( + 'single precision Array2D(2) gpu', + () => { + testSinglePrecisionArray2D2('gpu'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'single precision Array2D(2) webgl', + () => { + testSinglePrecisionArray2D2('webgl'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'single precision Array2D(2) webgl2', + () => { + testSinglePrecisionArray2D2('webgl2'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'single precision Array2D(2) headlessgl', + () => { + testSinglePrecisionArray2D2('headlessgl'); + } +); test('single precision Array2D(2) cpu', () => { testSinglePrecisionArray2D2('cpu'); @@ -61,8 +86,18 @@ function testUnsignedPrecisionArray2D2(mode) { } ); const value = [ - [new Float32Array([1, 2]), new Float32Array([3, 4]), new Float32Array([5, 6]), new Float32Array([7, 8])], - [new Float32Array([9, 10]), new Float32Array([11, 12]), new Float32Array([13, 14]), new Float32Array([15, 16])], + [ + new Float32Array([1, 2]), + new Float32Array([3, 4]), + new Float32Array([5, 6]), + new Float32Array([7, 8]), + ], + [ + new Float32Array([9, 10]), + new Float32Array([11, 12]), + new Float32Array([13, 14]), + new Float32Array([15, 16]), + ], ]; const result = kernel(value); assert.deepEqual(result, value); @@ -77,17 +112,26 @@ test('fallback unsigned precision Array2D(2) gpu', () => { testUnsignedPrecisionArray2D2('gpu'); }); -(GPU.isWebGLSupported ? test : skip)('fallback unsigned precision Array2D(2) webgl', () => { - testUnsignedPrecisionArray2D2('webgl'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'fallback unsigned precision Array2D(2) webgl', + () => { + testUnsignedPrecisionArray2D2('webgl'); + } +); -(GPU.isWebGL2Supported ? test : skip)('fallback unsigned precision Array2D(2) webgl2', () => { - testUnsignedPrecisionArray2D2('webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'fallback unsigned precision Array2D(2) webgl2', + () => { + testUnsignedPrecisionArray2D2('webgl2'); + } +); -(GPU.isHeadlessGLSupported ? test : skip)('fallback unsigned precision Array(2) headlessgl', () => { - testUnsignedPrecisionArray2D2('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'fallback unsigned precision Array(2) headlessgl', + () => { + testUnsignedPrecisionArray2D2('headlessgl'); + } +); test('fallback unsigned precision Array2D(2) cpu', () => { testUnsignedPrecisionArray2D2('cpu'); @@ -106,33 +150,58 @@ function testSinglePrecisionArray2D3(mode) { } ); const value = [ - [new Float32Array([1, 2, 3]), new Float32Array([4, 5, 6]), new Float32Array([7, 8, 9]), new Float32Array([10, 11, 12])], - [new Float32Array([13, 14, 15]), new Float32Array([16, 17, 18]), new Float32Array([19, 20, 21]), new Float32Array([22, 23, 25])], + [ + new Float32Array([1, 2, 3]), + new Float32Array([4, 5, 6]), + new Float32Array([7, 8, 9]), + new Float32Array([10, 11, 12]), + ], + [ + new Float32Array([13, 14, 15]), + new Float32Array([16, 17, 18]), + new Float32Array([19, 20, 21]), + new Float32Array([22, 23, 25]), + ], ]; const result = kernel(value); assert.deepEqual(result, value); gpu.destroy(); } -(GPU.isSinglePrecisionSupported ? test : skip)('single precision Array2D(3) auto', () => { - testSinglePrecisionArray2D3(); -}); - -(GPU.isSinglePrecisionSupported ? test : skip)('single precision Array2D(3) gpu', () => { - testSinglePrecisionArray2D3('gpu'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('single precision Array2D(3) webgl', () => { - testSinglePrecisionArray2D3('webgl'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('single precision Array2D(3) webgl2', () => { - testSinglePrecisionArray2D3('webgl2'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('single precision Array2D(3) headlessgl', () => { - testSinglePrecisionArray2D3('headlessgl'); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'single precision Array2D(3) auto', + () => { + testSinglePrecisionArray2D3(); + } +); + +(GPU.isSinglePrecisionSupported ? test : skip)( + 'single precision Array2D(3) gpu', + () => { + testSinglePrecisionArray2D3('gpu'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'single precision Array2D(3) webgl', + () => { + testSinglePrecisionArray2D3('webgl'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'single precision Array2D(3) webgl2', + () => { + testSinglePrecisionArray2D3('webgl2'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'single precision Array2D(3) headlessgl', + () => { + testSinglePrecisionArray2D3('headlessgl'); + } +); test('single precision Array2D(3) cpu', () => { testSinglePrecisionArray2D3('cpu'); @@ -151,8 +220,18 @@ function testUnsignedPrecisionArray2D3(mode) { } ); const value = [ - [new Float32Array([1, 2, 3]), new Float32Array([4, 5, 6]), new Float32Array([7, 8, 9]), new Float32Array([10, 11, 12])], - [new Float32Array([13, 14, 15]), new Float32Array([16, 17, 18]), new Float32Array([19, 20, 21]), new Float32Array([22, 23, 25])], + [ + new Float32Array([1, 2, 3]), + new Float32Array([4, 5, 6]), + new Float32Array([7, 8, 9]), + new Float32Array([10, 11, 12]), + ], + [ + new Float32Array([13, 14, 15]), + new Float32Array([16, 17, 18]), + new Float32Array([19, 20, 21]), + new Float32Array([22, 23, 25]), + ], ]; const result = kernel(value); assert.deepEqual(result, value); @@ -167,17 +246,26 @@ test('fallback unsigned precision Array2D(3) gpu', () => { testUnsignedPrecisionArray2D3('gpu'); }); -(GPU.isWebGLSupported ? test : skip)('fallback unsigned precision Array2D(3) webgl', () => { - testUnsignedPrecisionArray2D3('webgl'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'fallback unsigned precision Array2D(3) webgl', + () => { + testUnsignedPrecisionArray2D3('webgl'); + } +); -(GPU.isWebGL2Supported ? test : skip)('fallback unsigned precision Array2D(3) webgl2', () => { - testUnsignedPrecisionArray2D3('webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'fallback unsigned precision Array2D(3) webgl2', + () => { + testUnsignedPrecisionArray2D3('webgl2'); + } +); -(GPU.isHeadlessGLSupported ? test : skip)('fallback unsigned precision Array(3) headlessgl', () => { - testUnsignedPrecisionArray2D3('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'fallback unsigned precision Array(3) headlessgl', + () => { + testUnsignedPrecisionArray2D3('headlessgl'); + } +); test('fallback unsigned precision Array2D(3) cpu', () => { testUnsignedPrecisionArray2D3('cpu'); @@ -196,33 +284,58 @@ function testSinglePrecisionArray2D4(mode) { } ); const value = [ - [new Float32Array([1, 2, 3, 4]), new Float32Array([5, 6, 7, 8]), new Float32Array([9, 10, 11, 12]), new Float32Array([13, 14, 15, 16])], - [new Float32Array([17, 18, 19, 20]), new Float32Array([21, 22, 23, 24]), new Float32Array([25, 26, 27, 28]), new Float32Array([29, 30, 31, 32])], + [ + new Float32Array([1, 2, 3, 4]), + new Float32Array([5, 6, 7, 8]), + new Float32Array([9, 10, 11, 12]), + new Float32Array([13, 14, 15, 16]), + ], + [ + new Float32Array([17, 18, 19, 20]), + new Float32Array([21, 22, 23, 24]), + new Float32Array([25, 26, 27, 28]), + new Float32Array([29, 30, 31, 32]), + ], ]; const result = kernel(value); assert.deepEqual(result, value); gpu.destroy(); } -(GPU.isSinglePrecisionSupported ? test : skip)('single precision Array2D(4) auto', () => { - testSinglePrecisionArray2D4(); -}); - -(GPU.isSinglePrecisionSupported ? test : skip)('single precision Array2D(4) gpu', () => { - testSinglePrecisionArray2D4('gpu'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('single precision Array2D(4) webgl', () => { - testSinglePrecisionArray2D4('webgl'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('single precision Array2D(4) webgl2', () => { - testSinglePrecisionArray2D4('webgl2'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('single precision Array2D(4) headlessgl', () => { - testSinglePrecisionArray2D4('headlessgl'); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'single precision Array2D(4) auto', + () => { + testSinglePrecisionArray2D4(); + } +); + +(GPU.isSinglePrecisionSupported ? test : skip)( + 'single precision Array2D(4) gpu', + () => { + testSinglePrecisionArray2D4('gpu'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'single precision Array2D(4) webgl', + () => { + testSinglePrecisionArray2D4('webgl'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'single precision Array2D(4) webgl2', + () => { + testSinglePrecisionArray2D4('webgl2'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'single precision Array2D(4) headlessgl', + () => { + testSinglePrecisionArray2D4('headlessgl'); + } +); test('single precision Array2D(4) cpu', () => { testSinglePrecisionArray2D4('cpu'); @@ -241,8 +354,18 @@ function testUnsignedPrecisionArray2D4(mode) { } ); const value = [ - [new Float32Array([1, 2, 3, 4]), new Float32Array([5, 6, 7, 8]), new Float32Array([9, 10, 11, 12]), new Float32Array([13, 14, 15, 16])], - [new Float32Array([17, 18, 19, 20]), new Float32Array([21, 22, 23, 24]), new Float32Array([25, 26, 27, 28]), new Float32Array([29, 30, 31, 32])], + [ + new Float32Array([1, 2, 3, 4]), + new Float32Array([5, 6, 7, 8]), + new Float32Array([9, 10, 11, 12]), + new Float32Array([13, 14, 15, 16]), + ], + [ + new Float32Array([17, 18, 19, 20]), + new Float32Array([21, 22, 23, 24]), + new Float32Array([25, 26, 27, 28]), + new Float32Array([29, 30, 31, 32]), + ], ]; const result = kernel(value); assert.deepEqual(result, value); @@ -257,17 +380,26 @@ test('fallback unsigned precision Array2D(4) gpu', () => { testUnsignedPrecisionArray2D4('gpu'); }); -(GPU.isWebGLSupported ? test : skip)('fallback unsigned precision Array2D(4) webgl', () => { - testUnsignedPrecisionArray2D4('webgl'); -}); - -(GPU.isWebGL2Supported ? test : skip)('fallback unsigned precision Array2D(4) webgl2', () => { - testUnsignedPrecisionArray2D4('webgl2'); -}); - -(GPU.isHeadlessGLSupported ? test : skip)('fallback unsigned precision Array(4) headlessgl', () => { - testUnsignedPrecisionArray2D4('headlessgl'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'fallback unsigned precision Array2D(4) webgl', + () => { + testUnsignedPrecisionArray2D4('webgl'); + } +); + +(GPU.isWebGL2Supported ? test : skip)( + 'fallback unsigned precision Array2D(4) webgl2', + () => { + testUnsignedPrecisionArray2D4('webgl2'); + } +); + +(GPU.isHeadlessGLSupported ? test : skip)( + 'fallback unsigned precision Array(4) headlessgl', + () => { + testUnsignedPrecisionArray2D4('headlessgl'); + } +); test('fallback unsigned precision Array2D(4) cpu', () => { testUnsignedPrecisionArray2D4('cpu'); diff --git a/test/features/argument-array3d-types.js b/test/features/argument-array3d-types.js index 282882a3..7cad15a3 100644 --- a/test/features/argument-array3d-types.js +++ b/test/features/argument-array3d-types.js @@ -34,25 +34,40 @@ function testSinglePrecisionArray3D2(mode) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported ? test : skip)('single precision Array3D(2) auto', () => { - testSinglePrecisionArray3D2(); -}); - -(GPU.isSinglePrecisionSupported ? test : skip)('single precision Array3D(2) gpu', () => { - testSinglePrecisionArray3D2('gpu'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('single precision Array3D(2) webgl', () => { - testSinglePrecisionArray3D2('webgl'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('single precision Array3D(2) webgl2', () => { - testSinglePrecisionArray3D2('webgl2'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('single precision Array3D(2) headlessgl', () => { - testSinglePrecisionArray3D2('headlessgl'); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'single precision Array3D(2) auto', + () => { + testSinglePrecisionArray3D2(); + } +); + +(GPU.isSinglePrecisionSupported ? test : skip)( + 'single precision Array3D(2) gpu', + () => { + testSinglePrecisionArray3D2('gpu'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'single precision Array3D(2) webgl', + () => { + testSinglePrecisionArray3D2('webgl'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'single precision Array3D(2) webgl2', + () => { + testSinglePrecisionArray3D2('webgl2'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'single precision Array3D(2) headlessgl', + () => { + testSinglePrecisionArray3D2('headlessgl'); + } +); test('single precision Array3D(2) cpu', () => { testSinglePrecisionArray3D2('cpu'); @@ -97,17 +112,26 @@ test('fallback unsigned precision Array3D(3) gpu', () => { testUnsignedPrecisionArray3D2('gpu'); }); -(GPU.isWebGLSupported ? test : skip)('fallback unsigned precision Array3D(3) webgl', () => { - testUnsignedPrecisionArray3D2('webgl'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'fallback unsigned precision Array3D(3) webgl', + () => { + testUnsignedPrecisionArray3D2('webgl'); + } +); -(GPU.isWebGL2Supported ? test : skip)('fallback unsigned precision Array3D(3) webgl2', () => { - testUnsignedPrecisionArray3D2('webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'fallback unsigned precision Array3D(3) webgl2', + () => { + testUnsignedPrecisionArray3D2('webgl2'); + } +); -(GPU.isHeadlessGLSupported ? test : skip)('fallback unsigned precision Array3D(3) headlessgl', () => { - testUnsignedPrecisionArray3D2('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'fallback unsigned precision Array3D(3) headlessgl', + () => { + testUnsignedPrecisionArray3D2('headlessgl'); + } +); test('fallback unsigned precision Array3D(3) cpu', () => { testUnsignedPrecisionArray3D2('cpu'); @@ -144,25 +168,40 @@ function testSinglePrecisionArray3D3(mode) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported ? test : skip)('single precision Array3D(3) auto', () => { - testSinglePrecisionArray3D3(); -}); - -(GPU.isSinglePrecisionSupported ? test : skip)('single precision Array3D(3) gpu', () => { - testSinglePrecisionArray3D3('gpu'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('single precision Array3D(3) webgl', () => { - testSinglePrecisionArray3D3('webgl'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('single precision Array3D(3) webgl2', () => { - testSinglePrecisionArray3D3('webgl2'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('single precision Array3D(3) headlessgl', () => { - testSinglePrecisionArray3D3('headlessgl'); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'single precision Array3D(3) auto', + () => { + testSinglePrecisionArray3D3(); + } +); + +(GPU.isSinglePrecisionSupported ? test : skip)( + 'single precision Array3D(3) gpu', + () => { + testSinglePrecisionArray3D3('gpu'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'single precision Array3D(3) webgl', + () => { + testSinglePrecisionArray3D3('webgl'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'single precision Array3D(3) webgl2', + () => { + testSinglePrecisionArray3D3('webgl2'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'single precision Array3D(3) headlessgl', + () => { + testSinglePrecisionArray3D3('headlessgl'); + } +); test('single precision Array3D(3) cpu', () => { testSinglePrecisionArray3D3('cpu'); @@ -207,17 +246,26 @@ test('fallback unsigned precision Array3D(3) gpu', () => { testUnsignedPrecisionArray3D3('gpu'); }); -(GPU.isWebGLSupported ? test : skip)('fallback unsigned precision Array3D(3) webgl', () => { - testUnsignedPrecisionArray3D3('webgl'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'fallback unsigned precision Array3D(3) webgl', + () => { + testUnsignedPrecisionArray3D3('webgl'); + } +); -(GPU.isWebGL2Supported ? test : skip)('fallback unsigned precision Array3D(3) webgl2', () => { - testUnsignedPrecisionArray3D3('webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'fallback unsigned precision Array3D(3) webgl2', + () => { + testUnsignedPrecisionArray3D3('webgl2'); + } +); -(GPU.isHeadlessGLSupported ? test : skip)('fallback unsigned precision Array3D(3) headlessgl', () => { - testUnsignedPrecisionArray3D3('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'fallback unsigned precision Array3D(3) headlessgl', + () => { + testUnsignedPrecisionArray3D3('headlessgl'); + } +); test('fallback unsigned precision Array3D(3) cpu', () => { testUnsignedPrecisionArray3D3('cpu'); @@ -254,25 +302,40 @@ function testSinglePrecisionArray3D4(mode) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported ? test : skip)('single precision Array3D(4) auto', () => { - testSinglePrecisionArray3D4(); -}); - -(GPU.isSinglePrecisionSupported ? test : skip)('single precision Array3D(4) gpu', () => { - testSinglePrecisionArray3D4('gpu'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('single precision Array3D(4) webgl', () => { - testSinglePrecisionArray3D4('webgl'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('single precision Array3D(4) webgl2', () => { - testSinglePrecisionArray3D4('webgl2'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('single precision Array3D(4) headlessgl', () => { - testSinglePrecisionArray3D4('headlessgl'); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'single precision Array3D(4) auto', + () => { + testSinglePrecisionArray3D4(); + } +); + +(GPU.isSinglePrecisionSupported ? test : skip)( + 'single precision Array3D(4) gpu', + () => { + testSinglePrecisionArray3D4('gpu'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'single precision Array3D(4) webgl', + () => { + testSinglePrecisionArray3D4('webgl'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'single precision Array3D(4) webgl2', + () => { + testSinglePrecisionArray3D4('webgl2'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'single precision Array3D(4) headlessgl', + () => { + testSinglePrecisionArray3D4('headlessgl'); + } +); test('single precision Array3D(4) cpu', () => { testSinglePrecisionArray3D4('cpu'); @@ -317,17 +380,26 @@ test('fallback unsigned precision Array3D(4) gpu', () => { testUnsignedPrecisionArray3D4('gpu'); }); -(GPU.isWebGLSupported ? test : skip)('fallback unsigned precision Array3D(4) webgl', () => { - testUnsignedPrecisionArray3D4('webgl'); -}); - -(GPU.isWebGL2Supported ? test : skip)('fallback unsigned precision Array3D(4) webgl2', () => { - testUnsignedPrecisionArray3D4('webgl2'); -}); - -(GPU.isHeadlessGLSupported ? test : skip)('fallback unsigned precision Array3D(4) headlessgl', () => { - testUnsignedPrecisionArray3D4('headlessgl'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'fallback unsigned precision Array3D(4) webgl', + () => { + testUnsignedPrecisionArray3D4('webgl'); + } +); + +(GPU.isWebGL2Supported ? test : skip)( + 'fallback unsigned precision Array3D(4) webgl2', + () => { + testUnsignedPrecisionArray3D4('webgl2'); + } +); + +(GPU.isHeadlessGLSupported ? test : skip)( + 'fallback unsigned precision Array3D(4) headlessgl', + () => { + testUnsignedPrecisionArray3D4('headlessgl'); + } +); test('fallback unsigned precision Array3D(4) cpu', () => { testUnsignedPrecisionArray3D4('cpu'); diff --git a/test/features/arithmetic-operators.js b/test/features/arithmetic-operators.js index 2e9d6334..743674d6 100644 --- a/test/features/arithmetic-operators.js +++ b/test/features/arithmetic-operators.js @@ -329,9 +329,12 @@ test('increment early return auto', () => { incrementEarlyReturn('webgl2'); }); -(GPU.isHeadlessGLSupported ? test : skip)('increment early return headlessgl', () => { - incrementEarlyReturn('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'increment early return headlessgl', + () => { + incrementEarlyReturn('headlessgl'); + } +); test('increment early return cpu', () => { incrementEarlyReturn('cpu'); @@ -409,9 +412,12 @@ test('decrement early return auto', () => { decrementEarlyReturn('webgl2'); }); -(GPU.isHeadlessGLSupported ? test : skip)('decrement early return headlessgl', () => { - decrementEarlyReturn('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'decrement early return headlessgl', + () => { + decrementEarlyReturn('headlessgl'); + } +); test('decrement early return cpu', () => { decrementEarlyReturn('cpu'); diff --git a/test/features/assignment-operators.js b/test/features/assignment-operators.js index a04a48f4..4c10f053 100644 --- a/test/features/assignment-operators.js +++ b/test/features/assignment-operators.js @@ -279,9 +279,12 @@ test('exponential equal auto', () => { exponentialEqual('webgl2'); }); -(GPU.isHeadlessGLSupported ? test : skip)('exponential equal headlessgl', () => { - exponentialEqual('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'exponential equal headlessgl', + () => { + exponentialEqual('headlessgl'); + } +); test('exponential equal cpu', () => { exponentialEqual('cpu'); diff --git a/test/features/bitwise-operators.js b/test/features/bitwise-operators.js index 77bce858..a0403f84 100644 --- a/test/features/bitwise-operators.js +++ b/test/features/bitwise-operators.js @@ -21,25 +21,40 @@ function testBitwiseAndSinglePrecision(mode) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported ? test : skip)('bitwise AND single precision auto', () => { - testBitwiseAndSinglePrecision(); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'bitwise AND single precision auto', + () => { + testBitwiseAndSinglePrecision(); + } +); -(GPU.isSinglePrecisionSupported ? test : skip)('bitwise AND single precision gpu', () => { - testBitwiseAndSinglePrecision('gpu'); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'bitwise AND single precision gpu', + () => { + testBitwiseAndSinglePrecision('gpu'); + } +); -(GPU.isWebGLSupported && GPU.isSinglePrecisionSupported ? test : skip)('bitwise AND single precision webgl', () => { - testBitwiseAndSinglePrecision('webgl'); -}); +(GPU.isWebGLSupported && GPU.isSinglePrecisionSupported ? test : skip)( + 'bitwise AND single precision webgl', + () => { + testBitwiseAndSinglePrecision('webgl'); + } +); -(GPU.isWebGL2Supported ? test : skip)('bitwise AND single precision webgl2', () => { - testBitwiseAndSinglePrecision('webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'bitwise AND single precision webgl2', + () => { + testBitwiseAndSinglePrecision('webgl2'); + } +); -(GPU.isHeadlessGLSupported && GPU.isSinglePrecisionSupported ? test : skip)('bitwise AND single precision headlessgl', () => { - testBitwiseAndSinglePrecision('headlessgl'); -}); +(GPU.isHeadlessGLSupported && GPU.isSinglePrecisionSupported ? test : skip)( + 'bitwise AND single precision headlessgl', + () => { + testBitwiseAndSinglePrecision('headlessgl'); + } +); test('bitwise AND single precision cpu', () => { testBitwiseAndSinglePrecision('cpu'); @@ -71,17 +86,26 @@ test('bitwise AND unsigned precision gpu', () => { testBitwiseAndUnsignedPrecision('gpu'); }); -(GPU.isWebGLSupported ? test : skip)('bitwise AND unsigned precision webgl', () => { - testBitwiseAndUnsignedPrecision('webgl'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'bitwise AND unsigned precision webgl', + () => { + testBitwiseAndUnsignedPrecision('webgl'); + } +); -(GPU.isWebGL2Supported ? test : skip)('bitwise AND unsigned precision webgl2', () => { - testBitwiseAndUnsignedPrecision('webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'bitwise AND unsigned precision webgl2', + () => { + testBitwiseAndUnsignedPrecision('webgl2'); + } +); -(GPU.isHeadlessGLSupported ? test : skip)('bitwise AND unsigned precision headlessgl', () => { - testBitwiseAndUnsignedPrecision('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'bitwise AND unsigned precision headlessgl', + () => { + testBitwiseAndUnsignedPrecision('headlessgl'); + } +); test('bitwise AND unsigned precision cpu', () => { testBitwiseAndUnsignedPrecision('cpu'); @@ -105,25 +129,40 @@ function testBitwiseOrSinglePrecision(mode) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported ? test : skip)('bitwise OR single precision auto', () => { - testBitwiseOrSinglePrecision(); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'bitwise OR single precision auto', + () => { + testBitwiseOrSinglePrecision(); + } +); -(GPU.isSinglePrecisionSupported ? test : skip)('bitwise OR single precision gpu', () => { - testBitwiseOrSinglePrecision('gpu'); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'bitwise OR single precision gpu', + () => { + testBitwiseOrSinglePrecision('gpu'); + } +); -(GPU.isWebGLSupported && GPU.isSinglePrecisionSupported ? test : skip)('bitwise OR single precision webgl', () => { - testBitwiseOrSinglePrecision('webgl'); -}); +(GPU.isWebGLSupported && GPU.isSinglePrecisionSupported ? test : skip)( + 'bitwise OR single precision webgl', + () => { + testBitwiseOrSinglePrecision('webgl'); + } +); -(GPU.isWebGL2Supported ? test : skip)('bitwise OR single precision webgl2', () => { - testBitwiseOrSinglePrecision('webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'bitwise OR single precision webgl2', + () => { + testBitwiseOrSinglePrecision('webgl2'); + } +); -(GPU.isHeadlessGLSupported && GPU.isSinglePrecisionSupported ? test : skip)('bitwise OR single precision headlessgl', () => { - testBitwiseOrSinglePrecision('headlessgl'); -}); +(GPU.isHeadlessGLSupported && GPU.isSinglePrecisionSupported ? test : skip)( + 'bitwise OR single precision headlessgl', + () => { + testBitwiseOrSinglePrecision('headlessgl'); + } +); test('bitwise OR single precision cpu', () => { testBitwiseOrSinglePrecision('cpu'); @@ -155,17 +194,26 @@ test('bitwise OR unsigned precision gpu', () => { testBitwiseOrUnsignedPrecision('gpu'); }); -(GPU.isWebGLSupported ? test : skip)('bitwise OR unsigned precision webgl', () => { - testBitwiseOrUnsignedPrecision('webgl'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'bitwise OR unsigned precision webgl', + () => { + testBitwiseOrUnsignedPrecision('webgl'); + } +); -(GPU.isWebGL2Supported ? test : skip)('bitwise OR unsigned precision webgl2', () => { - testBitwiseOrUnsignedPrecision('webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'bitwise OR unsigned precision webgl2', + () => { + testBitwiseOrUnsignedPrecision('webgl2'); + } +); -(GPU.isHeadlessGLSupported ? test : skip)('bitwise OR unsigned precision headlessgl', () => { - testBitwiseOrUnsignedPrecision('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'bitwise OR unsigned precision headlessgl', + () => { + testBitwiseOrUnsignedPrecision('headlessgl'); + } +); test('bitwise OR unsigned precision cpu', () => { testBitwiseOrUnsignedPrecision('cpu'); @@ -189,25 +237,40 @@ function testBitwiseXORSinglePrecision(mode) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported ? test : skip)('bitwise XOR single precision auto', () => { - testBitwiseXORSinglePrecision(); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'bitwise XOR single precision auto', + () => { + testBitwiseXORSinglePrecision(); + } +); -(GPU.isSinglePrecisionSupported ? test : skip)('bitwise XOR single precision gpu', () => { - testBitwiseXORSinglePrecision('gpu'); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'bitwise XOR single precision gpu', + () => { + testBitwiseXORSinglePrecision('gpu'); + } +); -(GPU.isWebGLSupported && GPU.isSinglePrecisionSupported ? test : skip)('bitwise XOR single precision webgl', () => { - testBitwiseXORSinglePrecision('webgl'); -}); +(GPU.isWebGLSupported && GPU.isSinglePrecisionSupported ? test : skip)( + 'bitwise XOR single precision webgl', + () => { + testBitwiseXORSinglePrecision('webgl'); + } +); -(GPU.isWebGL2Supported ? test : skip)('bitwise XOR single precision webgl2', () => { - testBitwiseXORSinglePrecision('webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'bitwise XOR single precision webgl2', + () => { + testBitwiseXORSinglePrecision('webgl2'); + } +); -(GPU.isHeadlessGLSupported && GPU.isSinglePrecisionSupported ? test : skip)('bitwise XOR single precision headlessgl', () => { - testBitwiseXORSinglePrecision('headlessgl'); -}); +(GPU.isHeadlessGLSupported && GPU.isSinglePrecisionSupported ? test : skip)( + 'bitwise XOR single precision headlessgl', + () => { + testBitwiseXORSinglePrecision('headlessgl'); + } +); test('bitwise XOR single precision cpu', () => { testBitwiseXORSinglePrecision('cpu'); @@ -239,17 +302,26 @@ test('bitwise XOR unsigned precision gpu', () => { testBitwiseXORUnsignedPrecision('gpu'); }); -(GPU.isWebGLSupported ? test : skip)('bitwise XOR unsigned precision webgl', () => { - testBitwiseXORUnsignedPrecision('webgl'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'bitwise XOR unsigned precision webgl', + () => { + testBitwiseXORUnsignedPrecision('webgl'); + } +); -(GPU.isWebGL2Supported ? test : skip)('bitwise XOR unsigned precision webgl2', () => { - testBitwiseXORUnsignedPrecision('webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'bitwise XOR unsigned precision webgl2', + () => { + testBitwiseXORUnsignedPrecision('webgl2'); + } +); -(GPU.isHeadlessGLSupported ? test : skip)('bitwise XOR unsigned precision headlessgl', () => { - testBitwiseXORUnsignedPrecision('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'bitwise XOR unsigned precision headlessgl', + () => { + testBitwiseXORUnsignedPrecision('headlessgl'); + } +); test('bitwise XOR unsigned precision cpu', () => { testBitwiseXORUnsignedPrecision('cpu'); @@ -271,25 +343,40 @@ function testBitwiseNotSinglePrecision(mode) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported ? test : skip)('bitwise NOT single precision auto', () => { - testBitwiseNotSinglePrecision(); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'bitwise NOT single precision auto', + () => { + testBitwiseNotSinglePrecision(); + } +); -(GPU.isSinglePrecisionSupported ? test : skip)('bitwise NOT single precision gpu', () => { - testBitwiseNotSinglePrecision('gpu'); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'bitwise NOT single precision gpu', + () => { + testBitwiseNotSinglePrecision('gpu'); + } +); -(GPU.isWebGLSupported && GPU.isSinglePrecisionSupported ? test : skip)('bitwise NOT single precision webgl', () => { - testBitwiseNotSinglePrecision('webgl'); -}); +(GPU.isWebGLSupported && GPU.isSinglePrecisionSupported ? test : skip)( + 'bitwise NOT single precision webgl', + () => { + testBitwiseNotSinglePrecision('webgl'); + } +); -(GPU.isWebGL2Supported ? test : skip)('bitwise NOT single precision webgl2', () => { - testBitwiseNotSinglePrecision('webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'bitwise NOT single precision webgl2', + () => { + testBitwiseNotSinglePrecision('webgl2'); + } +); -(GPU.isHeadlessGLSupported && GPU.isSinglePrecisionSupported ? test : skip)('bitwise NOT single precision headlessgl', () => { - testBitwiseNotSinglePrecision('headlessgl'); -}); +(GPU.isHeadlessGLSupported && GPU.isSinglePrecisionSupported ? test : skip)( + 'bitwise NOT single precision headlessgl', + () => { + testBitwiseNotSinglePrecision('headlessgl'); + } +); test('bitwise NOT single precision cpu', () => { testBitwiseNotSinglePrecision('cpu'); @@ -319,17 +406,26 @@ test('bitwise NOT unsigned precision gpu', () => { testBitwiseNotUnsignedPrecision('gpu'); }); -(GPU.isWebGLSupported ? test : skip)('bitwise NOT unsigned precision webgl', () => { - testBitwiseNotUnsignedPrecision('webgl'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'bitwise NOT unsigned precision webgl', + () => { + testBitwiseNotUnsignedPrecision('webgl'); + } +); -(GPU.isWebGL2Supported ? test : skip)('bitwise NOT unsigned precision webgl2', () => { - testBitwiseNotUnsignedPrecision('webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'bitwise NOT unsigned precision webgl2', + () => { + testBitwiseNotUnsignedPrecision('webgl2'); + } +); -(GPU.isHeadlessGLSupported ? test : skip)('bitwise NOT unsigned precision headlessgl', () => { - testBitwiseNotUnsignedPrecision('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'bitwise NOT unsigned precision headlessgl', + () => { + testBitwiseNotUnsignedPrecision('headlessgl'); + } +); test('bitwise NOT unsigned precision cpu', () => { testBitwiseNotUnsignedPrecision('cpu'); @@ -353,25 +449,40 @@ function testBitwiseZeroFillLeftShiftSinglePrecision(mode) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported ? test : skip)('bitwise zero fill left shift single precision auto', () => { - testBitwiseZeroFillLeftShiftSinglePrecision(); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'bitwise zero fill left shift single precision auto', + () => { + testBitwiseZeroFillLeftShiftSinglePrecision(); + } +); -(GPU.isSinglePrecisionSupported ? test : skip)('bitwise zero fill left shift single precision gpu', () => { - testBitwiseZeroFillLeftShiftSinglePrecision('gpu'); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'bitwise zero fill left shift single precision gpu', + () => { + testBitwiseZeroFillLeftShiftSinglePrecision('gpu'); + } +); -(GPU.isWebGLSupported && GPU.isSinglePrecisionSupported ? test : skip)('bitwise zero fill left shift single precision webgl', () => { - testBitwiseZeroFillLeftShiftSinglePrecision('webgl'); -}); +(GPU.isWebGLSupported && GPU.isSinglePrecisionSupported ? test : skip)( + 'bitwise zero fill left shift single precision webgl', + () => { + testBitwiseZeroFillLeftShiftSinglePrecision('webgl'); + } +); -(GPU.isWebGL2Supported ? test : skip)('bitwise zero fill left shift single precision webgl2', () => { - testBitwiseZeroFillLeftShiftSinglePrecision('webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'bitwise zero fill left shift single precision webgl2', + () => { + testBitwiseZeroFillLeftShiftSinglePrecision('webgl2'); + } +); -(GPU.isHeadlessGLSupported && GPU.isSinglePrecisionSupported ? test : skip)('bitwise zero fill left shift single precision headlessgl', () => { - testBitwiseZeroFillLeftShiftSinglePrecision('headlessgl'); -}); +(GPU.isHeadlessGLSupported && GPU.isSinglePrecisionSupported ? test : skip)( + 'bitwise zero fill left shift single precision headlessgl', + () => { + testBitwiseZeroFillLeftShiftSinglePrecision('headlessgl'); + } +); test('bitwise zero fill left shift single precision cpu', () => { testBitwiseZeroFillLeftShiftSinglePrecision('cpu'); @@ -403,17 +514,26 @@ test('bitwise zero fill left shift unsigned precision gpu', () => { testBitwiseZeroFillLeftShiftUnsignedPrecision('gpu'); }); -(GPU.isWebGLSupported ? test : skip)('bitwise zero fill left shift unsigned precision webgl', () => { - testBitwiseZeroFillLeftShiftUnsignedPrecision('webgl'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'bitwise zero fill left shift unsigned precision webgl', + () => { + testBitwiseZeroFillLeftShiftUnsignedPrecision('webgl'); + } +); -(GPU.isWebGL2Supported ? test : skip)('bitwise zero fill left shift unsigned precision webgl2', () => { - testBitwiseZeroFillLeftShiftUnsignedPrecision('webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'bitwise zero fill left shift unsigned precision webgl2', + () => { + testBitwiseZeroFillLeftShiftUnsignedPrecision('webgl2'); + } +); -(GPU.isHeadlessGLSupported ? test : skip)('bitwise zero fill left shift unsigned precision headlessgl', () => { - testBitwiseZeroFillLeftShiftUnsignedPrecision('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'bitwise zero fill left shift unsigned precision headlessgl', + () => { + testBitwiseZeroFillLeftShiftUnsignedPrecision('headlessgl'); + } +); test('bitwise zero fill left shift unsigned precision cpu', () => { testBitwiseZeroFillLeftShiftUnsignedPrecision('cpu'); @@ -437,25 +557,40 @@ function testBitwiseSignedRightShiftSinglePrecision(mode) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported ? test : skip)('bitwise signed fill right shift single precision auto', () => { - testBitwiseSignedRightShiftSinglePrecision(); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'bitwise signed fill right shift single precision auto', + () => { + testBitwiseSignedRightShiftSinglePrecision(); + } +); -(GPU.isSinglePrecisionSupported ? test : skip)('bitwise signed fill right shift single precision gpu', () => { - testBitwiseSignedRightShiftSinglePrecision('gpu'); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'bitwise signed fill right shift single precision gpu', + () => { + testBitwiseSignedRightShiftSinglePrecision('gpu'); + } +); -(GPU.isWebGLSupported && GPU.isSinglePrecisionSupported ? test : skip)('bitwise signed fill right shift single precision webgl', () => { - testBitwiseSignedRightShiftSinglePrecision('webgl'); -}); +(GPU.isWebGLSupported && GPU.isSinglePrecisionSupported ? test : skip)( + 'bitwise signed fill right shift single precision webgl', + () => { + testBitwiseSignedRightShiftSinglePrecision('webgl'); + } +); -(GPU.isWebGL2Supported ? test : skip)('bitwise signed fill right shift single precision webgl2', () => { - testBitwiseSignedRightShiftSinglePrecision('webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'bitwise signed fill right shift single precision webgl2', + () => { + testBitwiseSignedRightShiftSinglePrecision('webgl2'); + } +); -(GPU.isHeadlessGLSupported && GPU.isSinglePrecisionSupported ? test : skip)('bitwise signed fill right shift single precision headlessgl', () => { - testBitwiseSignedRightShiftSinglePrecision('headlessgl'); -}); +(GPU.isHeadlessGLSupported && GPU.isSinglePrecisionSupported ? test : skip)( + 'bitwise signed fill right shift single precision headlessgl', + () => { + testBitwiseSignedRightShiftSinglePrecision('headlessgl'); + } +); test('bitwise signed fill right shift single precision cpu', () => { testBitwiseSignedRightShiftSinglePrecision('cpu'); @@ -487,17 +622,26 @@ test('bitwise signed fill right shift unsigned precision gpu', () => { testBitwiseSignedRightShiftUnsignedPrecision('gpu'); }); -(GPU.isWebGLSupported ? test : skip)('bitwise signed fill right shift unsigned precision webgl', () => { - testBitwiseSignedRightShiftUnsignedPrecision('webgl'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'bitwise signed fill right shift unsigned precision webgl', + () => { + testBitwiseSignedRightShiftUnsignedPrecision('webgl'); + } +); -(GPU.isWebGL2Supported ? test : skip)('bitwise signed fill right shift unsigned precision webgl2', () => { - testBitwiseSignedRightShiftUnsignedPrecision('webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'bitwise signed fill right shift unsigned precision webgl2', + () => { + testBitwiseSignedRightShiftUnsignedPrecision('webgl2'); + } +); -(GPU.isHeadlessGLSupported ? test : skip)('bitwise signed fill right shift unsigned precision headlessgl', () => { - testBitwiseSignedRightShiftUnsignedPrecision('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'bitwise signed fill right shift unsigned precision headlessgl', + () => { + testBitwiseSignedRightShiftUnsignedPrecision('headlessgl'); + } +); test('bitwise signed fill right shift unsigned precision cpu', () => { testBitwiseSignedRightShiftUnsignedPrecision('cpu'); @@ -521,25 +665,40 @@ function testBitwiseZeroFillRightShiftSinglePrecision(mode) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported ? test : skip)('bitwise zero fill right shift single precision auto', () => { - testBitwiseZeroFillRightShiftSinglePrecision(); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'bitwise zero fill right shift single precision auto', + () => { + testBitwiseZeroFillRightShiftSinglePrecision(); + } +); -(GPU.isSinglePrecisionSupported ? test : skip)('bitwise zero fill right shift single precision gpu', () => { - testBitwiseZeroFillRightShiftSinglePrecision('gpu'); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'bitwise zero fill right shift single precision gpu', + () => { + testBitwiseZeroFillRightShiftSinglePrecision('gpu'); + } +); -(GPU.isWebGLSupported && GPU.isSinglePrecisionSupported ? test : skip)('bitwise zero fill right shift single precision webgl', () => { - testBitwiseZeroFillRightShiftSinglePrecision('webgl'); -}); +(GPU.isWebGLSupported && GPU.isSinglePrecisionSupported ? test : skip)( + 'bitwise zero fill right shift single precision webgl', + () => { + testBitwiseZeroFillRightShiftSinglePrecision('webgl'); + } +); -(GPU.isWebGL2Supported ? test : skip)('bitwise zero fill right shift single precision webgl2', () => { - testBitwiseZeroFillRightShiftSinglePrecision('webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'bitwise zero fill right shift single precision webgl2', + () => { + testBitwiseZeroFillRightShiftSinglePrecision('webgl2'); + } +); -(GPU.isHeadlessGLSupported && GPU.isSinglePrecisionSupported ? test : skip)('bitwise zero fill right shift single precision headlessgl', () => { - testBitwiseZeroFillRightShiftSinglePrecision('headlessgl'); -}); +(GPU.isHeadlessGLSupported && GPU.isSinglePrecisionSupported ? test : skip)( + 'bitwise zero fill right shift single precision headlessgl', + () => { + testBitwiseZeroFillRightShiftSinglePrecision('headlessgl'); + } +); test('bitwise zero fill right shift single precision cpu', () => { testBitwiseZeroFillRightShiftSinglePrecision('cpu'); @@ -571,17 +730,26 @@ test('bitwise zero fill right shift unsigned precision gpu', () => { testBitwiseZeroFillRightShiftUnsignedPrecision('gpu'); }); -(GPU.isWebGLSupported ? test : skip)('bitwise zero fill right shift unsigned precision webgl', () => { - testBitwiseZeroFillRightShiftUnsignedPrecision('webgl'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'bitwise zero fill right shift unsigned precision webgl', + () => { + testBitwiseZeroFillRightShiftUnsignedPrecision('webgl'); + } +); -(GPU.isWebGL2Supported ? test : skip)('bitwise zero fill right shift unsigned precision webgl2', () => { - testBitwiseZeroFillRightShiftUnsignedPrecision('webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'bitwise zero fill right shift unsigned precision webgl2', + () => { + testBitwiseZeroFillRightShiftUnsignedPrecision('webgl2'); + } +); -(GPU.isHeadlessGLSupported ? test : skip)('bitwise zero fill right shift unsigned precision headlessgl', () => { - testBitwiseZeroFillRightShiftUnsignedPrecision('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'bitwise zero fill right shift unsigned precision headlessgl', + () => { + testBitwiseZeroFillRightShiftUnsignedPrecision('headlessgl'); + } +); test('bitwise zero fill right shift unsigned precision cpu', () => { testBitwiseZeroFillRightShiftUnsignedPrecision('cpu'); diff --git a/test/features/canvas.js b/test/features/canvas.js index 028a5dc1..f841b387 100644 --- a/test/features/canvas.js +++ b/test/features/canvas.js @@ -29,11 +29,15 @@ function canvasArgumentTest(mode) { canvasArgumentTest('gpu'); }); -(GPU.isWebGLSupported && typeof HTMLCanvasElement !== 'undefined' ? test : skip)('webgl', () => { +(GPU.isWebGLSupported && typeof HTMLCanvasElement !== 'undefined' + ? test + : skip)('webgl', () => { canvasArgumentTest('webgl'); }); -(GPU.isWebGL2Supported && typeof HTMLCanvasElement !== 'undefined' ? test : skip)('webgl2', () => { +(GPU.isWebGL2Supported && typeof HTMLCanvasElement !== 'undefined' + ? test + : skip)('webgl2', () => { canvasArgumentTest('webgl2'); }); @@ -59,22 +63,35 @@ function canvasManuallyDefinedArgumentTest(mode) { gpu.destroy(); } -(typeof HTMLCanvasElement !== 'undefined' ? test : skip)('manually defined auto', () => { - canvasManuallyDefinedArgumentTest(); -}); +(typeof HTMLCanvasElement !== 'undefined' ? test : skip)( + 'manually defined auto', + () => { + canvasManuallyDefinedArgumentTest(); + } +); -(typeof HTMLCanvasElement !== 'undefined' ? test : skip)('manually defined gpu', () => { - canvasManuallyDefinedArgumentTest('gpu'); -}); +(typeof HTMLCanvasElement !== 'undefined' ? test : skip)( + 'manually defined gpu', + () => { + canvasManuallyDefinedArgumentTest('gpu'); + } +); -(GPU.isWebGLSupported && typeof HTMLCanvasElement !== 'undefined' ? test : skip)('manually defined webgl', () => { +(GPU.isWebGLSupported && typeof HTMLCanvasElement !== 'undefined' + ? test + : skip)('manually defined webgl', () => { canvasManuallyDefinedArgumentTest('webgl'); }); -(GPU.isWebGL2Supported && typeof HTMLCanvasElement !== 'undefined' ? test : skip)('manually defined webgl2', () => { +(GPU.isWebGL2Supported && typeof HTMLCanvasElement !== 'undefined' + ? test + : skip)('manually defined webgl2', () => { canvasManuallyDefinedArgumentTest('webgl2'); }); -(typeof HTMLCanvasElement !== 'undefined' ? test : skip)('manually defined cpu', () => { - canvasManuallyDefinedArgumentTest('cpu'); -}); +(typeof HTMLCanvasElement !== 'undefined' ? test : skip)( + 'manually defined cpu', + () => { + canvasManuallyDefinedArgumentTest('cpu'); + } +); diff --git a/test/features/clear-textures.js b/test/features/clear-textures.js index d3e7d05a..4e394fb0 100644 --- a/test/features/clear-textures.js +++ b/test/features/clear-textures.js @@ -39,25 +39,37 @@ test('unsigned precision auto', () => { clearTexture('unsigned', 'webgl2'); }); -(GPU.isHeadlessGLSupported ? test : skip)('unsigned precision headlessgl', () => { - clearTexture('unsigned', 'headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'unsigned precision headlessgl', + () => { + clearTexture('unsigned', 'headlessgl'); + } +); (GPU.isSinglePrecisionSupported ? test : skip)('single precision auto', () => { clearTexture('single'); }); -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('single precision webgl', () => { - clearTexture('single', 'webgl'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'single precision webgl', + () => { + clearTexture('single', 'webgl'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('single precision webgl2', () => { - clearTexture('single', 'webgl2'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'single precision webgl2', + () => { + clearTexture('single', 'webgl2'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('single precision headlessgl', () => { - clearTexture('single', 'headlessgl'); -}); +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'single precision headlessgl', + () => { + clearTexture('single', 'headlessgl'); + } +); function clearClonedTexture(mode) { const gpu = new GPU({ mode }); @@ -95,6 +107,9 @@ test('clear cloned texture gpu', () => { clearClonedTexture('webgl2'); }); -(GPU.isHeadlessGLSupported ? test : skip)('clear cloned texture headlessgl', () => { - clearClonedTexture('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'clear cloned texture headlessgl', + () => { + clearClonedTexture('headlessgl'); + } +); diff --git a/test/features/clone-textures.js b/test/features/clone-textures.js index 4efaad25..7e7e4d05 100644 --- a/test/features/clone-textures.js +++ b/test/features/clone-textures.js @@ -38,25 +38,40 @@ test('1D unsigned precision auto', () => { copy1DTexture('unsigned', 'webgl2'); }); -(GPU.isHeadlessGLSupported ? test : skip)('1D unsigned precision headlessgl', () => { - copy1DTexture('unsigned', 'headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + '1D unsigned precision headlessgl', + () => { + copy1DTexture('unsigned', 'headlessgl'); + } +); -(GPU.isSinglePrecisionSupported ? test : skip)('1D single precision auto', () => { - copy1DTexture('single'); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + '1D single precision auto', + () => { + copy1DTexture('single'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('1D single precision webgl', () => { - copy1DTexture('single', 'webgl'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + '1D single precision webgl', + () => { + copy1DTexture('single', 'webgl'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('1D single precision webgl2', () => { - copy1DTexture('single', 'webgl2'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + '1D single precision webgl2', + () => { + copy1DTexture('single', 'webgl2'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('1D single precision headlessgl', () => { - copy1DTexture('single', 'headlessgl'); -}); +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + '1D single precision headlessgl', + () => { + copy1DTexture('single', 'headlessgl'); + } +); function copy2DTexture(precision, mode) { const gpu = new GPU({ mode }); @@ -93,25 +108,40 @@ test('2D unsigned precision auto', () => { copy2DTexture('unsigned', 'webgl2'); }); -(GPU.isHeadlessGLSupported ? test : skip)('2D unsigned precision headlessgl', () => { - copy2DTexture('unsigned', 'headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + '2D unsigned precision headlessgl', + () => { + copy2DTexture('unsigned', 'headlessgl'); + } +); -(GPU.isSinglePrecisionSupported ? test : skip)('2D single precision auto', () => { - copy2DTexture('single'); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + '2D single precision auto', + () => { + copy2DTexture('single'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('2D single precision webgl', () => { - copy2DTexture('single', 'webgl'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + '2D single precision webgl', + () => { + copy2DTexture('single', 'webgl'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('2D single precision webgl2', () => { - copy2DTexture('single', 'webgl2'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + '2D single precision webgl2', + () => { + copy2DTexture('single', 'webgl2'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('2D single precision headlessgl', () => { - copy2DTexture('single', 'headlessgl'); -}); +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + '2D single precision headlessgl', + () => { + copy2DTexture('single', 'headlessgl'); + } +); function copy3DTexture(precision, mode) { const gpu = new GPU({ mode }); @@ -119,7 +149,12 @@ function copy3DTexture(precision, mode) { function makeTexture() { return gpu.createKernel( function () { - return this.thread.x + this.thread.y * this.output.x * (this.output.x * this.output.y * this.thread.z); + return ( + this.thread.x + + this.thread.y * + this.output.x * + (this.output.x * this.output.y * this.thread.z) + ); }, { output: [5, 5, 5], @@ -148,22 +183,37 @@ test('3D unsigned precision auto', () => { copy3DTexture('unsigned', 'webgl2'); }); -(GPU.isHeadlessGLSupported ? test : skip)('3D unsigned precision headlessgl', () => { - copy3DTexture('unsigned', 'headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + '3D unsigned precision headlessgl', + () => { + copy3DTexture('unsigned', 'headlessgl'); + } +); -(GPU.isSinglePrecisionSupported ? test : skip)('3D single precision auto', () => { - copy3DTexture('single'); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + '3D single precision auto', + () => { + copy3DTexture('single'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('3D single precision webgl', () => { - copy3DTexture('single', 'webgl'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + '3D single precision webgl', + () => { + copy3DTexture('single', 'webgl'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('3D single precision webgl2', () => { - copy3DTexture('single', 'webgl2'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + '3D single precision webgl2', + () => { + copy3DTexture('single', 'webgl2'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('3D single precision headlessgl', () => { - copy3DTexture('single', 'headlessgl'); -}); +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + '3D single precision headlessgl', + () => { + copy3DTexture('single', 'headlessgl'); + } +); diff --git a/test/features/combine-kernels.js b/test/features/combine-kernels.js index b6788954..acab8862 100644 --- a/test/features/combine-kernels.js +++ b/test/features/combine-kernels.js @@ -20,11 +20,19 @@ function combineKernels(mode) { { output: [5] } ); - const superKernel = gpu.combineKernels(kernel1, kernel2, function (array1, array2, array3) { - return kernel2(kernel1(array1, array2), array3); - }); + const superKernel = gpu.combineKernels( + kernel1, + kernel2, + function (array1, array2, array3) { + return kernel2(kernel1(array1, array2), array3); + } + ); - const result = superKernel([1, 2, 3, 4, 5], [1, 2, 3, 4, 5], [1, 2, 3, 4, 5]); + const result = superKernel( + [1, 2, 3, 4, 5], + [1, 2, 3, 4, 5], + [1, 2, 3, 4, 5] + ); assert.deepEqual(Array.from(result), [2, 8, 18, 32, 50]); gpu.destroy(); } @@ -70,34 +78,57 @@ function combineKernelsSinglePrecision(mode) { { output: [5], precision: 'single' } ); - const superKernel = gpu.combineKernels(kernel1, kernel2, function (array1, array2, array3) { - return kernel2(kernel1(array1, array2), array3); - }); + const superKernel = gpu.combineKernels( + kernel1, + kernel2, + function (array1, array2, array3) { + return kernel2(kernel1(array1, array2), array3); + } + ); - const result = superKernel([1, 2, 3, 4, 5], [1, 2, 3, 4, 5], [1, 2, 3, 4, 5]); + const result = superKernel( + [1, 2, 3, 4, 5], + [1, 2, 3, 4, 5], + [1, 2, 3, 4, 5] + ); assert.deepEqual(Array.from(result), [2, 8, 18, 32, 50]); gpu.destroy(); } -(GPU.isSinglePrecisionSupported ? test : skip)('combine kernel single precision auto', () => { - combineKernelsSinglePrecision(); -}); - -(GPU.isSinglePrecisionSupported ? test : skip)('combine kernel single precision gpu', () => { - combineKernelsSinglePrecision('gpu'); -}); - -(GPU.isWebGLSupported && GPU.isSinglePrecisionSupported ? test : skip)('combine kernel single precision webgl', () => { - combineKernelsSinglePrecision('webgl'); -}); - -(GPU.isWebGL2Supported && GPU.isSinglePrecisionSupported ? test : skip)('combine kernel single precision webgl2', () => { - combineKernelsSinglePrecision('webgl2'); -}); - -(GPU.isHeadlessGLSupported && GPU.isSinglePrecisionSupported ? test : skip)('combine kernel single precision headlessgl', () => { - combineKernelsSinglePrecision('headlessgl'); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'combine kernel single precision auto', + () => { + combineKernelsSinglePrecision(); + } +); + +(GPU.isSinglePrecisionSupported ? test : skip)( + 'combine kernel single precision gpu', + () => { + combineKernelsSinglePrecision('gpu'); + } +); + +(GPU.isWebGLSupported && GPU.isSinglePrecisionSupported ? test : skip)( + 'combine kernel single precision webgl', + () => { + combineKernelsSinglePrecision('webgl'); + } +); + +(GPU.isWebGL2Supported && GPU.isSinglePrecisionSupported ? test : skip)( + 'combine kernel single precision webgl2', + () => { + combineKernelsSinglePrecision('webgl2'); + } +); + +(GPU.isHeadlessGLSupported && GPU.isSinglePrecisionSupported ? test : skip)( + 'combine kernel single precision headlessgl', + () => { + combineKernelsSinglePrecision('headlessgl'); + } +); test('combine kernel single precision cpu', () => { combineKernelsSinglePrecision('cpu'); @@ -128,34 +159,57 @@ function combineKernelsOptimizeFloatMemory(mode) { } ); - const superKernel = gpu.combineKernels(kernel1, kernel2, function (array1, array2, array3) { - return kernel2(kernel1(array1, array2), array3); - }); + const superKernel = gpu.combineKernels( + kernel1, + kernel2, + function (array1, array2, array3) { + return kernel2(kernel1(array1, array2), array3); + } + ); - const result = superKernel([1, 2, 3, 4, 5], [1, 2, 3, 4, 5], [1, 2, 3, 4, 5]); + const result = superKernel( + [1, 2, 3, 4, 5], + [1, 2, 3, 4, 5], + [1, 2, 3, 4, 5] + ); assert.deepEqual(Array.from(result), [2, 8, 18, 32, 50]); gpu.destroy(); } -(GPU.isSinglePrecisionSupported ? test : skip)('combine kernel float textures auto', () => { - combineKernelsOptimizeFloatMemory(); -}); - -(GPU.isSinglePrecisionSupported ? test : skip)('combine kernel float textures gpu', () => { - combineKernelsOptimizeFloatMemory('gpu'); -}); - -(GPU.isWebGLSupported && GPU.isSinglePrecisionSupported ? test : skip)('combine kernel float textures webgl', () => { - combineKernelsOptimizeFloatMemory('webgl'); -}); - -(GPU.isWebGL2Supported && GPU.isSinglePrecisionSupported ? test : skip)('combine kernel float textures webgl2', () => { - combineKernelsOptimizeFloatMemory('webgl2'); -}); - -(GPU.isHeadlessGLSupported && GPU.isSinglePrecisionSupported ? test : skip)('combine kernel float textures headlessgl', () => { - combineKernelsOptimizeFloatMemory('headlessgl'); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'combine kernel float textures auto', + () => { + combineKernelsOptimizeFloatMemory(); + } +); + +(GPU.isSinglePrecisionSupported ? test : skip)( + 'combine kernel float textures gpu', + () => { + combineKernelsOptimizeFloatMemory('gpu'); + } +); + +(GPU.isWebGLSupported && GPU.isSinglePrecisionSupported ? test : skip)( + 'combine kernel float textures webgl', + () => { + combineKernelsOptimizeFloatMemory('webgl'); + } +); + +(GPU.isWebGL2Supported && GPU.isSinglePrecisionSupported ? test : skip)( + 'combine kernel float textures webgl2', + () => { + combineKernelsOptimizeFloatMemory('webgl2'); + } +); + +(GPU.isHeadlessGLSupported && GPU.isSinglePrecisionSupported ? test : skip)( + 'combine kernel float textures headlessgl', + () => { + combineKernelsOptimizeFloatMemory('headlessgl'); + } +); test('combine kernel float textures cpu', () => { combineKernelsOptimizeFloatMemory('cpu'); diff --git a/test/features/constants-array.js b/test/features/constants-array.js index fc1f4e3c..253ab9ad 100644 --- a/test/features/constants-array.js +++ b/test/features/constants-array.js @@ -16,7 +16,11 @@ function feature(mode) { } ); const result = tryConst(); - assert.deepEqual(Array.from(result), [200, 200], 'array constant passed test'); + assert.deepEqual( + Array.from(result), + [200, 200], + 'array constant passed test' + ); gpu.destroy(); } diff --git a/test/features/constants-canvas.js b/test/features/constants-canvas.js index 49399835..f6f09be4 100644 --- a/test/features/constants-canvas.js +++ b/test/features/constants-canvas.js @@ -31,11 +31,15 @@ function canvasConstantTest(mode) { canvasConstantTest('gpu'); }); -(GPU.isWebGLSupported && typeof HTMLCanvasElement !== 'undefined' ? test : skip)('webgl', () => { +(GPU.isWebGLSupported && typeof HTMLCanvasElement !== 'undefined' + ? test + : skip)('webgl', () => { canvasConstantTest('webgl'); }); -(GPU.isWebGL2Supported && typeof HTMLCanvasElement !== 'undefined' ? test : skip)('webgl2', () => { +(GPU.isWebGL2Supported && typeof HTMLCanvasElement !== 'undefined' + ? test + : skip)('webgl2', () => { canvasConstantTest('webgl2'); }); diff --git a/test/features/constants-float.js b/test/features/constants-float.js index f35cb6fc..2d92a808 100644 --- a/test/features/constants-float.js +++ b/test/features/constants-float.js @@ -17,7 +17,9 @@ function floatConstantTest(mode) { ); const result = tryConst(); const match = new Float32Array([200.01, 200.01]); - const test = result[0].toFixed(1) === match[0].toFixed(1) && result[1].toFixed(1) === match[1].toFixed(1); + const test = + result[0].toFixed(1) === match[0].toFixed(1) && + result[1].toFixed(1) === match[1].toFixed(1); assert.ok(test, 'float constant passed test'); gpu.destroy(); } diff --git a/test/features/constants-image-array.js b/test/features/constants-image-array.js index cdf77922..756b0c58 100644 --- a/test/features/constants-image-array.js +++ b/test/features/constants-image-array.js @@ -48,23 +48,33 @@ function feature(mode, done) { }; } -(GPU.isGPUHTMLImageArraySupported && typeof Image !== 'undefined' ? test : skip)('auto', t => { +(GPU.isGPUHTMLImageArraySupported && typeof Image !== 'undefined' + ? test + : skip)('auto', t => { feature(null, t.async()); }); -(GPU.isGPUHTMLImageArraySupported && typeof Image !== 'undefined' ? test : skip)('gpu', t => { +(GPU.isGPUHTMLImageArraySupported && typeof Image !== 'undefined' + ? test + : skip)('gpu', t => { feature('gpu', t.async()); }); -(GPU.isWebGLSupported && typeof Image !== 'undefined' ? test : skip)('webgl', t => { - assert.throws(() => { - feature('webgl'); - }, 'imageArray are not compatible with webgl'); -}); +(GPU.isWebGLSupported && typeof Image !== 'undefined' ? test : skip)( + 'webgl', + t => { + assert.throws(() => { + feature('webgl'); + }, 'imageArray are not compatible with webgl'); + } +); -(GPU.isWebGL2Supported && typeof Image !== 'undefined' ? test : skip)('webgl2', t => { - feature('webgl2', t.async()); -}); +(GPU.isWebGL2Supported && typeof Image !== 'undefined' ? test : skip)( + 'webgl2', + t => { + feature('webgl2', t.async()); + } +); (typeof Image !== 'undefined' ? test : skip)('cpu', t => { feature('cpu', t.async()); diff --git a/test/features/constants-image.js b/test/features/constants-image.js index 5637a1e3..4943c7b9 100644 --- a/test/features/constants-image.js +++ b/test/features/constants-image.js @@ -46,13 +46,19 @@ function imageConstantTest(mode, done) { imageConstantTest('gpu', t.async()); }); -(GPU.isWebGLSupported && typeof Image !== 'undefined' ? test : skip)('webgl', t => { - imageConstantTest('webgl', t.async()); -}); +(GPU.isWebGLSupported && typeof Image !== 'undefined' ? test : skip)( + 'webgl', + t => { + imageConstantTest('webgl', t.async()); + } +); -(GPU.isWebGL2Supported && typeof Image !== 'undefined' ? test : skip)('webgl2', t => { - imageConstantTest('webgl2', t.async()); -}); +(GPU.isWebGL2Supported && typeof Image !== 'undefined' ? test : skip)( + 'webgl2', + t => { + imageConstantTest('webgl2', t.async()); + } +); (typeof Image !== 'undefined' ? test : skip)('cpu', t => { imageConstantTest('cpu', t.async()); diff --git a/test/features/constants-texture.js b/test/features/constants-texture.js index 014e38c2..07d2fcde 100644 --- a/test/features/constants-texture.js +++ b/test/features/constants-texture.js @@ -74,7 +74,10 @@ function test2D(mode) { ) .setOutput([2, 2]); const result = tryConst(); - const expected = [new Float32Array([200, 200]), new Float32Array([200, 200])]; + const expected = [ + new Float32Array([200, 200]), + new Float32Array([200, 200]), + ]; assert.deepEqual(result, expected, 'texture constant passed test'); gpu.destroy(); } @@ -117,7 +120,9 @@ function test3D(mode) { const tryConst = gpu .createKernel( function () { - return this.constants.texture[this.thread.z][this.thread.y][this.thread.x]; + return this.constants.texture[this.thread.z][this.thread.y][ + this.thread.x + ]; }, { constants: { texture }, diff --git a/test/features/cpu-with-textures.js b/test/features/cpu-with-textures.js index 4d1a8cf8..72a959c5 100644 --- a/test/features/cpu-with-textures.js +++ b/test/features/cpu-with-textures.js @@ -38,25 +38,40 @@ function cpuWithTexturesNumberWithSinglePrecision(mode) { gpu.destroy(); } -(GPU.isGPUSupported && GPU.isSinglePrecisionSupported ? test : skip)('number with single precision auto', () => { - cpuWithTexturesNumberWithSinglePrecision(); -}); - -(GPU.isGPUSupported && GPU.isSinglePrecisionSupported ? test : skip)('number with single precision gpu', () => { - cpuWithTexturesNumberWithSinglePrecision('gpu'); -}); - -(GPU.isWebGLSupported && GPU.isSinglePrecisionSupported ? test : skip)('number with single precision webgl', () => { - cpuWithTexturesNumberWithSinglePrecision('webgl'); -}); - -(GPU.isWebGL2Supported && GPU.isSinglePrecisionSupported ? test : skip)('number with single precision webgl2', () => { - cpuWithTexturesNumberWithSinglePrecision('webgl2'); -}); - -(GPU.isHeadlessGLSupported && GPU.isSinglePrecisionSupported ? test : skip)('number with single precision headlessgl', () => { - cpuWithTexturesNumberWithSinglePrecision('headlessgl'); -}); +(GPU.isGPUSupported && GPU.isSinglePrecisionSupported ? test : skip)( + 'number with single precision auto', + () => { + cpuWithTexturesNumberWithSinglePrecision(); + } +); + +(GPU.isGPUSupported && GPU.isSinglePrecisionSupported ? test : skip)( + 'number with single precision gpu', + () => { + cpuWithTexturesNumberWithSinglePrecision('gpu'); + } +); + +(GPU.isWebGLSupported && GPU.isSinglePrecisionSupported ? test : skip)( + 'number with single precision webgl', + () => { + cpuWithTexturesNumberWithSinglePrecision('webgl'); + } +); + +(GPU.isWebGL2Supported && GPU.isSinglePrecisionSupported ? test : skip)( + 'number with single precision webgl2', + () => { + cpuWithTexturesNumberWithSinglePrecision('webgl2'); + } +); + +(GPU.isHeadlessGLSupported && GPU.isSinglePrecisionSupported ? test : skip)( + 'number with single precision headlessgl', + () => { + cpuWithTexturesNumberWithSinglePrecision('headlessgl'); + } +); function cpuWithTexturesMemoryOptimizedNumberWithSinglePrecision(mode) { const gpu = new GPU({ mode }); @@ -94,25 +109,40 @@ function cpuWithTexturesMemoryOptimizedNumberWithSinglePrecision(mode) { gpu.destroy(); } -(GPU.isGPUSupported && GPU.isSinglePrecisionSupported ? test : skip)('memory optimized number with single precision auto', () => { - cpuWithTexturesMemoryOptimizedNumberWithSinglePrecision(); -}); - -(GPU.isGPUSupported && GPU.isSinglePrecisionSupported ? test : skip)('memory optimized number with single precision gpu', () => { - cpuWithTexturesMemoryOptimizedNumberWithSinglePrecision('gpu'); -}); - -(GPU.isWebGLSupported && GPU.isSinglePrecisionSupported ? test : skip)('memory optimized number with single precision webgl', () => { - cpuWithTexturesMemoryOptimizedNumberWithSinglePrecision('webgl'); -}); - -(GPU.isWebGL2Supported && GPU.isSinglePrecisionSupported ? test : skip)('memory optimized number with single precision webgl2', () => { - cpuWithTexturesMemoryOptimizedNumberWithSinglePrecision('webgl2'); -}); - -(GPU.isHeadlessGLSupported && GPU.isSinglePrecisionSupported ? test : skip)('memory optimized number with single precision headlessgl', () => { - cpuWithTexturesMemoryOptimizedNumberWithSinglePrecision('headlessgl'); -}); +(GPU.isGPUSupported && GPU.isSinglePrecisionSupported ? test : skip)( + 'memory optimized number with single precision auto', + () => { + cpuWithTexturesMemoryOptimizedNumberWithSinglePrecision(); + } +); + +(GPU.isGPUSupported && GPU.isSinglePrecisionSupported ? test : skip)( + 'memory optimized number with single precision gpu', + () => { + cpuWithTexturesMemoryOptimizedNumberWithSinglePrecision('gpu'); + } +); + +(GPU.isWebGLSupported && GPU.isSinglePrecisionSupported ? test : skip)( + 'memory optimized number with single precision webgl', + () => { + cpuWithTexturesMemoryOptimizedNumberWithSinglePrecision('webgl'); + } +); + +(GPU.isWebGL2Supported && GPU.isSinglePrecisionSupported ? test : skip)( + 'memory optimized number with single precision webgl2', + () => { + cpuWithTexturesMemoryOptimizedNumberWithSinglePrecision('webgl2'); + } +); + +(GPU.isHeadlessGLSupported && GPU.isSinglePrecisionSupported ? test : skip)( + 'memory optimized number with single precision headlessgl', + () => { + cpuWithTexturesMemoryOptimizedNumberWithSinglePrecision('headlessgl'); + } +); function cpuWithTexturesArray2WithSinglePrecision(mode) { const gpu = new GPU({ mode }); @@ -167,25 +197,40 @@ function cpuWithTexturesArray2WithSinglePrecision(mode) { gpu.destroy(); } -(GPU.isGPUSupported && GPU.isSinglePrecisionSupported ? test : skip)('Array(2) with single precision auto', () => { - cpuWithTexturesArray2WithSinglePrecision(); -}); - -(GPU.isGPUSupported && GPU.isSinglePrecisionSupported ? test : skip)('Array(2) with single precision gpu', () => { - cpuWithTexturesArray2WithSinglePrecision('gpu'); -}); - -(GPU.isWebGLSupported && GPU.isSinglePrecisionSupported ? test : skip)('Array(2) with single precision webgl', () => { - cpuWithTexturesArray2WithSinglePrecision('webgl'); -}); - -(GPU.isWebGL2Supported && GPU.isSinglePrecisionSupported ? test : skip)('Array(2) with single precision webgl2', () => { - cpuWithTexturesArray2WithSinglePrecision('webgl2'); -}); - -(GPU.isHeadlessGLSupported && GPU.isSinglePrecisionSupported ? test : skip)('Array(2) with single precision headlessgl', () => { - cpuWithTexturesArray2WithSinglePrecision('headlessgl'); -}); +(GPU.isGPUSupported && GPU.isSinglePrecisionSupported ? test : skip)( + 'Array(2) with single precision auto', + () => { + cpuWithTexturesArray2WithSinglePrecision(); + } +); + +(GPU.isGPUSupported && GPU.isSinglePrecisionSupported ? test : skip)( + 'Array(2) with single precision gpu', + () => { + cpuWithTexturesArray2WithSinglePrecision('gpu'); + } +); + +(GPU.isWebGLSupported && GPU.isSinglePrecisionSupported ? test : skip)( + 'Array(2) with single precision webgl', + () => { + cpuWithTexturesArray2WithSinglePrecision('webgl'); + } +); + +(GPU.isWebGL2Supported && GPU.isSinglePrecisionSupported ? test : skip)( + 'Array(2) with single precision webgl2', + () => { + cpuWithTexturesArray2WithSinglePrecision('webgl2'); + } +); + +(GPU.isHeadlessGLSupported && GPU.isSinglePrecisionSupported ? test : skip)( + 'Array(2) with single precision headlessgl', + () => { + cpuWithTexturesArray2WithSinglePrecision('headlessgl'); + } +); function cpuWithTexturesArray3WithSinglePrecision(mode) { const gpu = new GPU({ mode }); @@ -240,25 +285,40 @@ function cpuWithTexturesArray3WithSinglePrecision(mode) { gpu.destroy(); } -(GPU.isGPUSupported && GPU.isSinglePrecisionSupported ? test : skip)('Array(3) with single precision auto', () => { - cpuWithTexturesArray3WithSinglePrecision(); -}); - -(GPU.isGPUSupported && GPU.isSinglePrecisionSupported ? test : skip)('Array(3) with single precision gpu', () => { - cpuWithTexturesArray3WithSinglePrecision('gpu'); -}); - -(GPU.isWebGLSupported && GPU.isSinglePrecisionSupported ? test : skip)('Array(3) with single precision webgl', () => { - cpuWithTexturesArray3WithSinglePrecision('webgl'); -}); - -(GPU.isWebGL2Supported && GPU.isSinglePrecisionSupported ? test : skip)('Array(3) with single precision webgl2', () => { - cpuWithTexturesArray3WithSinglePrecision('webgl2'); -}); - -(GPU.isHeadlessGLSupported && GPU.isSinglePrecisionSupported ? test : skip)('Array(3) with single precision headlessgl', () => { - cpuWithTexturesArray3WithSinglePrecision('headlessgl'); -}); +(GPU.isGPUSupported && GPU.isSinglePrecisionSupported ? test : skip)( + 'Array(3) with single precision auto', + () => { + cpuWithTexturesArray3WithSinglePrecision(); + } +); + +(GPU.isGPUSupported && GPU.isSinglePrecisionSupported ? test : skip)( + 'Array(3) with single precision gpu', + () => { + cpuWithTexturesArray3WithSinglePrecision('gpu'); + } +); + +(GPU.isWebGLSupported && GPU.isSinglePrecisionSupported ? test : skip)( + 'Array(3) with single precision webgl', + () => { + cpuWithTexturesArray3WithSinglePrecision('webgl'); + } +); + +(GPU.isWebGL2Supported && GPU.isSinglePrecisionSupported ? test : skip)( + 'Array(3) with single precision webgl2', + () => { + cpuWithTexturesArray3WithSinglePrecision('webgl2'); + } +); + +(GPU.isHeadlessGLSupported && GPU.isSinglePrecisionSupported ? test : skip)( + 'Array(3) with single precision headlessgl', + () => { + cpuWithTexturesArray3WithSinglePrecision('headlessgl'); + } +); function cpuWithTexturesArray4WithSinglePrecision(mode) { const gpu = new GPU({ mode }); @@ -313,25 +373,40 @@ function cpuWithTexturesArray4WithSinglePrecision(mode) { gpu.destroy(); } -(GPU.isGPUSupported && GPU.isSinglePrecisionSupported ? test : skip)('Array(4) with single precision auto', () => { - cpuWithTexturesArray4WithSinglePrecision(); -}); - -(GPU.isGPUSupported && GPU.isSinglePrecisionSupported ? test : skip)('Array(4) with single precision gpu', () => { - cpuWithTexturesArray4WithSinglePrecision('gpu'); -}); - -(GPU.isWebGLSupported && GPU.isSinglePrecisionSupported ? test : skip)('Array(4) with single precision webgl', () => { - cpuWithTexturesArray4WithSinglePrecision('webgl'); -}); - -(GPU.isWebGL2Supported && GPU.isSinglePrecisionSupported ? test : skip)('Array(4) with single precision webgl2', () => { - cpuWithTexturesArray4WithSinglePrecision('webgl2'); -}); - -(GPU.isHeadlessGLSupported && GPU.isSinglePrecisionSupported ? test : skip)('Array(4) with single precision headlessgl', () => { - cpuWithTexturesArray4WithSinglePrecision('headlessgl'); -}); +(GPU.isGPUSupported && GPU.isSinglePrecisionSupported ? test : skip)( + 'Array(4) with single precision auto', + () => { + cpuWithTexturesArray4WithSinglePrecision(); + } +); + +(GPU.isGPUSupported && GPU.isSinglePrecisionSupported ? test : skip)( + 'Array(4) with single precision gpu', + () => { + cpuWithTexturesArray4WithSinglePrecision('gpu'); + } +); + +(GPU.isWebGLSupported && GPU.isSinglePrecisionSupported ? test : skip)( + 'Array(4) with single precision webgl', + () => { + cpuWithTexturesArray4WithSinglePrecision('webgl'); + } +); + +(GPU.isWebGL2Supported && GPU.isSinglePrecisionSupported ? test : skip)( + 'Array(4) with single precision webgl2', + () => { + cpuWithTexturesArray4WithSinglePrecision('webgl2'); + } +); + +(GPU.isHeadlessGLSupported && GPU.isSinglePrecisionSupported ? test : skip)( + 'Array(4) with single precision headlessgl', + () => { + cpuWithTexturesArray4WithSinglePrecision('headlessgl'); + } +); function cpuWithTexturesNumberWithUnsignedPrecision(mode) { const gpu = new GPU({ mode }); @@ -368,22 +443,37 @@ function cpuWithTexturesNumberWithUnsignedPrecision(mode) { gpu.destroy(); } -(GPU.isGPUSupported && GPU.isSinglePrecisionSupported ? test : skip)('number with unsigned precision auto', () => { - cpuWithTexturesNumberWithUnsignedPrecision(); -}); - -(GPU.isGPUSupported && GPU.isSinglePrecisionSupported ? test : skip)('number with unsigned precision gpu', () => { - cpuWithTexturesNumberWithUnsignedPrecision('gpu'); -}); - -(GPU.isWebGLSupported && GPU.isSinglePrecisionSupported ? test : skip)('number with unsigned precision webgl', () => { - cpuWithTexturesNumberWithUnsignedPrecision('webgl'); -}); - -(GPU.isWebGL2Supported && GPU.isSinglePrecisionSupported ? test : skip)('number with unsigned precision webgl2', () => { - cpuWithTexturesNumberWithUnsignedPrecision('webgl2'); -}); - -(GPU.isHeadlessGLSupported && GPU.isSinglePrecisionSupported ? test : skip)('number with unsigned precision headlessgl', () => { - cpuWithTexturesNumberWithUnsignedPrecision('headlessgl'); -}); +(GPU.isGPUSupported && GPU.isSinglePrecisionSupported ? test : skip)( + 'number with unsigned precision auto', + () => { + cpuWithTexturesNumberWithUnsignedPrecision(); + } +); + +(GPU.isGPUSupported && GPU.isSinglePrecisionSupported ? test : skip)( + 'number with unsigned precision gpu', + () => { + cpuWithTexturesNumberWithUnsignedPrecision('gpu'); + } +); + +(GPU.isWebGLSupported && GPU.isSinglePrecisionSupported ? test : skip)( + 'number with unsigned precision webgl', + () => { + cpuWithTexturesNumberWithUnsignedPrecision('webgl'); + } +); + +(GPU.isWebGL2Supported && GPU.isSinglePrecisionSupported ? test : skip)( + 'number with unsigned precision webgl2', + () => { + cpuWithTexturesNumberWithUnsignedPrecision('webgl2'); + } +); + +(GPU.isHeadlessGLSupported && GPU.isSinglePrecisionSupported ? test : skip)( + 'number with unsigned precision headlessgl', + () => { + cpuWithTexturesNumberWithUnsignedPrecision('headlessgl'); + } +); diff --git a/test/features/create-kernel-map.js b/test/features/create-kernel-map.js index c0519ec8..b7cca528 100644 --- a/test/features/create-kernel-map.js +++ b/test/features/create-kernel-map.js @@ -17,7 +17,10 @@ function createPropertyKernels(gpu, output) { divideResult: divide, }, function (k1, k2, k3) { - return divide(adder(k1[this.thread.x], k2[this.thread.x]), k3[this.thread.x]); + return divide( + adder(k1[this.thread.x], k2[this.thread.x]), + k3[this.thread.x] + ); } ) .setOutput(output); @@ -33,7 +36,10 @@ function createArrayKernels(gpu, output) { } return gpu .createKernelMap([add, divide], function (k1, k2, k3) { - return divide(add(k1[this.thread.x], k2[this.thread.x]), k3[this.thread.x]); + return divide( + add(k1[this.thread.x], k2[this.thread.x]), + k3[this.thread.x] + ); }) .setOutput(output); } @@ -60,25 +66,40 @@ function createKernelMapObject1Dimension1Length(mode) { gpu.destroy(); } -(GPU.isKernelMapSupported ? test : skip)('createKernelMap object 1 dimension 1 length auto', () => { - createKernelMapObject1Dimension1Length(); -}); +(GPU.isKernelMapSupported ? test : skip)( + 'createKernelMap object 1 dimension 1 length auto', + () => { + createKernelMapObject1Dimension1Length(); + } +); -(GPU.isKernelMapSupported ? test : skip)('createKernelMap object 1 dimension 1 length gpu', () => { - createKernelMapObject1Dimension1Length('gpu'); -}); +(GPU.isKernelMapSupported ? test : skip)( + 'createKernelMap object 1 dimension 1 length gpu', + () => { + createKernelMapObject1Dimension1Length('gpu'); + } +); -(GPU.isWebGLSupported ? test : skip)('createKernelMap object 1 dimension 1 length webgl', () => { - createKernelMapObject1Dimension1Length('webgl'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'createKernelMap object 1 dimension 1 length webgl', + () => { + createKernelMapObject1Dimension1Length('webgl'); + } +); -(GPU.isWebGL2Supported ? test : skip)('createKernelMap object 1 dimension 1 length webgl2', () => { - createKernelMapObject1Dimension1Length('webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'createKernelMap object 1 dimension 1 length webgl2', + () => { + createKernelMapObject1Dimension1Length('webgl2'); + } +); -(GPU.isHeadlessGLSupported && GPU.isKernelMapSupported ? test : skip)('createKernelMap object 1 dimension 1 length headlessgl', () => { - createKernelMapObject1Dimension1Length('headlessgl'); -}); +(GPU.isHeadlessGLSupported && GPU.isKernelMapSupported ? test : skip)( + 'createKernelMap object 1 dimension 1 length headlessgl', + () => { + createKernelMapObject1Dimension1Length('headlessgl'); + } +); test('createKernelMap object 1 dimension 1 length cpu', () => { createKernelMapObject1Dimension1Length('cpu'); @@ -98,25 +119,40 @@ function createKernelMapArray1Dimension1Length(mode) { gpu.destroy(); } -(GPU.isKernelMapSupported ? test : skip)('createKernelMap array 1 dimension 1 length auto', () => { - createKernelMapArray1Dimension1Length(); -}); +(GPU.isKernelMapSupported ? test : skip)( + 'createKernelMap array 1 dimension 1 length auto', + () => { + createKernelMapArray1Dimension1Length(); + } +); -(GPU.isKernelMapSupported ? test : skip)('createKernelMap array 1 dimension 1 length gpu', () => { - createKernelMapArray1Dimension1Length('gpu'); -}); +(GPU.isKernelMapSupported ? test : skip)( + 'createKernelMap array 1 dimension 1 length gpu', + () => { + createKernelMapArray1Dimension1Length('gpu'); + } +); -(GPU.isWebGLSupported ? test : skip)('createKernelMap array 1 dimension 1 length webgl', () => { - createKernelMapArray1Dimension1Length('webgl'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'createKernelMap array 1 dimension 1 length webgl', + () => { + createKernelMapArray1Dimension1Length('webgl'); + } +); -(GPU.isWebGL2Supported ? test : skip)('createKernelMap array 1 dimension 1 length webgl2', () => { - createKernelMapArray1Dimension1Length('webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'createKernelMap array 1 dimension 1 length webgl2', + () => { + createKernelMapArray1Dimension1Length('webgl2'); + } +); -(GPU.isHeadlessGLSupported && GPU.isKernelMapSupported ? test : skip)('createKernelMap array 1 dimension 1 length headlessgl', () => { - createKernelMapArray1Dimension1Length('headlessgl'); -}); +(GPU.isHeadlessGLSupported && GPU.isKernelMapSupported ? test : skip)( + 'createKernelMap array 1 dimension 1 length headlessgl', + () => { + createKernelMapArray1Dimension1Length('headlessgl'); + } +); test('createKernelMap array 1 dimension 1 length cpu', () => { createKernelMapArray1Dimension1Length('cpu'); @@ -126,7 +162,11 @@ function createKernelMapObject1Dimension5Length(mode) { const gpu = new GPU({ mode }); const superKernel = createPropertyKernels(gpu, [5]); const kernel = createKernel(gpu, [5]); - const output = superKernel([1, 2, 3, 4, 5], [1, 2, 3, 4, 5], [1, 2, 3, 4, 5]); + const output = superKernel( + [1, 2, 3, 4, 5], + [1, 2, 3, 4, 5], + [1, 2, 3, 4, 5] + ); const result = Array.from(output.result); const addResult = Array.from(kernel(output.addResult)); const divideResult = Array.from(kernel(output.divideResult)); @@ -136,25 +176,40 @@ function createKernelMapObject1Dimension5Length(mode) { gpu.destroy(); } -(GPU.isKernelMapSupported ? test : skip)('createKernelMap object 1 dimension 5 length auto', () => { - createKernelMapObject1Dimension5Length(); -}); +(GPU.isKernelMapSupported ? test : skip)( + 'createKernelMap object 1 dimension 5 length auto', + () => { + createKernelMapObject1Dimension5Length(); + } +); -(GPU.isKernelMapSupported ? test : skip)('createKernelMap object 1 dimension 5 length gpu', () => { - createKernelMapObject1Dimension5Length('gpu'); -}); +(GPU.isKernelMapSupported ? test : skip)( + 'createKernelMap object 1 dimension 5 length gpu', + () => { + createKernelMapObject1Dimension5Length('gpu'); + } +); -(GPU.isWebGLSupported ? test : skip)('createKernelMap object 1 dimension 5 length webgl', () => { - createKernelMapObject1Dimension5Length('webgl'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'createKernelMap object 1 dimension 5 length webgl', + () => { + createKernelMapObject1Dimension5Length('webgl'); + } +); -(GPU.isWebGL2Supported ? test : skip)('createKernelMap object 1 dimension 5 length webgl2', () => { - createKernelMapObject1Dimension5Length('webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'createKernelMap object 1 dimension 5 length webgl2', + () => { + createKernelMapObject1Dimension5Length('webgl2'); + } +); -(GPU.isHeadlessGLSupported && GPU.isKernelMapSupported ? test : skip)('createKernelMap object 1 dimension 5 length headlessgl', () => { - createKernelMapObject1Dimension5Length('headlessgl'); -}); +(GPU.isHeadlessGLSupported && GPU.isKernelMapSupported ? test : skip)( + 'createKernelMap object 1 dimension 5 length headlessgl', + () => { + createKernelMapObject1Dimension5Length('headlessgl'); + } +); test('createKernelMap object 1 dimension 5 length cpu', () => { createKernelMapObject1Dimension5Length('cpu'); @@ -164,7 +219,11 @@ function createKernelMapArrayAuto(mode) { const gpu = new GPU({ mode }); const superKernel = createArrayKernels(gpu, [5]); const kernel = createKernel(gpu, [5]); - const output = superKernel([1, 2, 3, 4, 5], [1, 2, 3, 4, 5], [1, 2, 3, 4, 5]); + const output = superKernel( + [1, 2, 3, 4, 5], + [1, 2, 3, 4, 5], + [1, 2, 3, 4, 5] + ); const result = Array.from(output.result); const addResult = Array.from(kernel(output[0])); const divideResult = Array.from(kernel(output[1])); @@ -189,9 +248,12 @@ function createKernelMapArrayAuto(mode) { createKernelMapArrayAuto('webgl2'); }); -(GPU.isHeadlessGLSupported && GPU.isKernelMapSupported ? test : skip)('createKernelMap array headlessgl', () => { - createKernelMapArrayAuto('headlessgl'); -}); +(GPU.isHeadlessGLSupported && GPU.isKernelMapSupported ? test : skip)( + 'createKernelMap array headlessgl', + () => { + createKernelMapArrayAuto('headlessgl'); + } +); test('createKernelMap array cpu', () => { createKernelMapArrayAuto('cpu'); @@ -233,17 +295,23 @@ function createKernelMap3DAuto(mode) { createKernelMap3DAuto('gpu'); }); -(GPU.isWebGLSupported && GPU.isKernelMapSupported ? test : skip)('createKernelMap 3d webgl', () => { - createKernelMap3DAuto('webgl'); -}); +(GPU.isWebGLSupported && GPU.isKernelMapSupported ? test : skip)( + 'createKernelMap 3d webgl', + () => { + createKernelMap3DAuto('webgl'); + } +); (GPU.isWebGL2Supported ? test : skip)('createKernelMap 3d webgl2', () => { createKernelMap3DAuto('webgl2'); }); -(GPU.isHeadlessGLSupported && GPU.isKernelMapSupported ? test : skip)('createKernelMap 3d headlessgl', () => { - createKernelMap3DAuto('headlessgl'); -}); +(GPU.isHeadlessGLSupported && GPU.isKernelMapSupported ? test : skip)( + 'createKernelMap 3d headlessgl', + () => { + createKernelMap3DAuto('headlessgl'); + } +); test('createKernelMap 3d cpu', () => { createKernelMap3DAuto('cpu'); @@ -286,13 +354,19 @@ test('createKernelMap Array(2) gpu', () => { createKernelMapArray2('webgl'); }); -(GPU.isWebGL2Supported ? test : skip)('createKernelMap Array(2) webgl2', () => { - createKernelMapArray2('webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'createKernelMap Array(2) webgl2', + () => { + createKernelMapArray2('webgl2'); + } +); -(GPU.isHeadlessGLSupported ? test : skip)('createKernelMap Array(2) headlessgl', () => { - createKernelMapArray2('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'createKernelMap Array(2) headlessgl', + () => { + createKernelMapArray2('headlessgl'); + } +); test('createKernelMap Array(2) cpu', () => { createKernelMapArray2('cpu'); @@ -335,13 +409,19 @@ test('createKernelMap Array(3) gpu', () => { createKernelMapArray3('webgl'); }); -(GPU.isWebGL2Supported ? test : skip)('createKernelMap Array(3) webgl2', () => { - createKernelMapArray3('webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'createKernelMap Array(3) webgl2', + () => { + createKernelMapArray3('webgl2'); + } +); -(GPU.isHeadlessGLSupported ? test : skip)('createKernelMap Array(3) headlessgl', () => { - createKernelMapArray3('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'createKernelMap Array(3) headlessgl', + () => { + createKernelMapArray3('headlessgl'); + } +); test('createKernelMap Array(3) cpu', () => { createKernelMapArray3('cpu'); @@ -384,13 +464,19 @@ test('createKernelMap Array(4) gpu', () => { createKernelMapArray4('webgl'); }); -(GPU.isWebGL2Supported ? test : skip)('createKernelMap Array(4) webgl2', () => { - createKernelMapArray4('webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'createKernelMap Array(4) webgl2', + () => { + createKernelMapArray4('webgl2'); + } +); -(GPU.isHeadlessGLSupported ? test : skip)('createKernelMap Array(4) headlessgl', () => { - createKernelMapArray4('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'createKernelMap Array(4) headlessgl', + () => { + createKernelMapArray4('headlessgl'); + } +); test('createKernelMap Array(4) cpu', () => { createKernelMapArray4('cpu'); diff --git a/test/features/destroy.js b/test/features/destroy.js index 8597f1d0..8f041635 100644 --- a/test/features/destroy.js +++ b/test/features/destroy.js @@ -67,7 +67,8 @@ function testTexturesAreDestroyed(done, mode) { context: mockContext, destroyExtensions: () => {}, }; - mockKernelInstance.destroy = WebGLKernel.prototype.destroy.bind(mockKernelInstance); + mockKernelInstance.destroy = + WebGLKernel.prototype.destroy.bind(mockKernelInstance); GPU.prototype.destroy.call({ kernels: [mockKernelInstance] }).then(() => { assert.equal(deleteTextureMock.callCount, 3); assert.ok(true); @@ -94,7 +95,8 @@ function testKernelTextureIsDeleted(done) { context: mockContext, destroyExtensions: () => {}, }; - mockKernelInstance.destroy = WebGLKernel.prototype.destroy.bind(mockKernelInstance); + mockKernelInstance.destroy = + WebGLKernel.prototype.destroy.bind(mockKernelInstance); GPU.prototype.destroy.call({ kernels: [mockKernelInstance] }).then(() => { assert.equal(mockTextureDelete.callCount, 1); assert.ok(true); @@ -132,7 +134,8 @@ function testKernelMappedTexturesAreDeleted(done) { destroyExtensions: () => {}, }; mockGPU.kernels.push(mockKernelInstance); - mockKernelInstance.destroy = WebGLKernel.prototype.destroy.bind(mockKernelInstance); + mockKernelInstance.destroy = + WebGLKernel.prototype.destroy.bind(mockKernelInstance); GPU.prototype.destroy .call({ kernels: [mockKernelInstance] }) .then(() => { diff --git a/test/features/destructured-assignment.js b/test/features/destructured-assignment.js index 38c0e588..b7456e50 100644 --- a/test/features/destructured-assignment.js +++ b/test/features/destructured-assignment.js @@ -14,7 +14,10 @@ function testObject(mode) { }, { output: [2, 2] } ); - assert.deepEqual(kernel(), [new Float32Array([0, 1]), new Float32Array([1, 2])]); + assert.deepEqual(kernel(), [ + new Float32Array([0, 1]), + new Float32Array([1, 2]), + ]); } test('object auto', () => { @@ -50,7 +53,10 @@ function testNestedObject(mode) { }, { output: [2, 2] } ); - assert.deepEqual(kernel(), [new Float32Array([0, 1]), new Float32Array([1, 2])]); + assert.deepEqual(kernel(), [ + new Float32Array([0, 1]), + new Float32Array([1, 2]), + ]); } test('nested object auto', () => { diff --git a/test/features/dev-mode.js b/test/features/dev-mode.js index 238dad87..693bbb39 100644 --- a/test/features/dev-mode.js +++ b/test/features/dev-mode.js @@ -105,7 +105,10 @@ test('works with input array', () => { }, { output: [4] } ); - assert.deepEqual(kernel(input([1, 2, 3, 4], [4])), new Float32Array([1, 2, 3, 4])); + assert.deepEqual( + kernel(input([1, 2, 3, 4], [4])), + new Float32Array([1, 2, 3, 4]) + ); gpu.destroy(); }); @@ -117,7 +120,10 @@ test('works with input matrix', () => { }, { output: [4, 2] } ); - assert.deepEqual(kernel(input([1, 2, 3, 4, 5, 6, 7, 8], [4, 2])), [new Float32Array([1, 2, 3, 4]), new Float32Array([5, 6, 7, 8])]); + assert.deepEqual(kernel(input([1, 2, 3, 4, 5, 6, 7, 8], [4, 2])), [ + new Float32Array([1, 2, 3, 4]), + new Float32Array([5, 6, 7, 8]), + ]); gpu.destroy(); }); @@ -129,10 +135,15 @@ test('works with input cube', () => { }, { output: [4, 2, 2] } ); - assert.deepEqual(kernel(input([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], [4, 2, 2])), [ - [new Float32Array([1, 2, 3, 4]), new Float32Array([5, 6, 7, 8])], - [new Float32Array([9, 10, 11, 12]), new Float32Array([13, 14, 15, 16])], - ]); + assert.deepEqual( + kernel( + input([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], [4, 2, 2]) + ), + [ + [new Float32Array([1, 2, 3, 4]), new Float32Array([5, 6, 7, 8])], + [new Float32Array([9, 10, 11, 12]), new Float32Array([13, 14, 15, 16])], + ] + ); gpu.destroy(); }); diff --git a/test/features/dynamic-arguments.js b/test/features/dynamic-arguments.js index e5838c92..e454a5c8 100644 --- a/test/features/dynamic-arguments.js +++ b/test/features/dynamic-arguments.js @@ -47,13 +47,19 @@ function testHTMLImage(done, mode) { testHTMLImage(t.async()); }); -(typeof Image !== 'undefined' && GPU.isWebGLSupported ? test : skip)('HTML Image webgl', t => { - testHTMLImage(t.async(), 'webgl'); -}); +(typeof Image !== 'undefined' && GPU.isWebGLSupported ? test : skip)( + 'HTML Image webgl', + t => { + testHTMLImage(t.async(), 'webgl'); + } +); -(typeof Image !== 'undefined' && GPU.isWebGL2Supported ? test : skip)('HTML Image webgl2', t => { - testHTMLImage(t.async(), 'webgl2'); -}); +(typeof Image !== 'undefined' && GPU.isWebGL2Supported ? test : skip)( + 'HTML Image webgl2', + t => { + testHTMLImage(t.async(), 'webgl2'); + } +); (typeof Image !== 'undefined' ? test : skip)('HTML Image cpu', t => { testHTMLImage(t.async(), 'cpu'); @@ -112,38 +118,69 @@ function testMemoryOptimizedNumberTexture(mode) { .setOptimizeFloatMemory(true) .setOutput([4, 4]); - assert.deepEqual(kernel(texture4X4), [new Float32Array([1, 2, 3, 4]), new Float32Array([5, 6, 7, 8]), new Float32Array([9, 10, 11, 12]), new Float32Array([13, 14, 15, 16])]); + assert.deepEqual(kernel(texture4X4), [ + new Float32Array([1, 2, 3, 4]), + new Float32Array([5, 6, 7, 8]), + new Float32Array([9, 10, 11, 12]), + new Float32Array([13, 14, 15, 16]), + ]); kernel.setOutput([3, 3]); - assert.deepEqual(kernel(texture3X3), [new Float32Array([1, 2, 3]), new Float32Array([4, 5, 6]), new Float32Array([7, 8, 9])]); + assert.deepEqual(kernel(texture3X3), [ + new Float32Array([1, 2, 3]), + new Float32Array([4, 5, 6]), + new Float32Array([7, 8, 9]), + ]); kernel.setOutput([2, 2]); - assert.deepEqual(kernel(texture2X2), [new Float32Array([1, 2]), new Float32Array([3, 4])]); - - assert.ok(kernel.kernelArguments[0].constructor.name.match('DynamicMemoryOptimizedNumberTexture')); + assert.deepEqual(kernel(texture2X2), [ + new Float32Array([1, 2]), + new Float32Array([3, 4]), + ]); + + assert.ok( + kernel.kernelArguments[0].constructor.name.match( + 'DynamicMemoryOptimizedNumberTexture' + ) + ); gpu.destroy(); } -(GPU.isSinglePrecisionSupported ? test : skip)('MemoryOptimizedNumberTexture (GPU only) auto', () => { - testMemoryOptimizedNumberTexture(); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'MemoryOptimizedNumberTexture (GPU only) auto', + () => { + testMemoryOptimizedNumberTexture(); + } +); -(GPU.isSinglePrecisionSupported ? test : skip)('MemoryOptimizedNumberTexture (GPU only) gpu', () => { - testMemoryOptimizedNumberTexture('gpu'); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'MemoryOptimizedNumberTexture (GPU only) gpu', + () => { + testMemoryOptimizedNumberTexture('gpu'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('MemoryOptimizedNumberTexture (GPU only) webgl', () => { - testMemoryOptimizedNumberTexture('webgl'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'MemoryOptimizedNumberTexture (GPU only) webgl', + () => { + testMemoryOptimizedNumberTexture('webgl'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('MemoryOptimizedNumberTexture (GPU only) webgl2', () => { - testMemoryOptimizedNumberTexture('webgl2'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'MemoryOptimizedNumberTexture (GPU only) webgl2', + () => { + testMemoryOptimizedNumberTexture('webgl2'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('MemoryOptimizedNumberTexture (GPU only) headlessgl', () => { - testMemoryOptimizedNumberTexture('headlessgl'); -}); +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'MemoryOptimizedNumberTexture (GPU only) headlessgl', + () => { + testMemoryOptimizedNumberTexture('headlessgl'); + } +); function testNumberTexture(mode) { const gpu = new GPU({ mode }); @@ -194,38 +231,65 @@ function testNumberTexture(mode) { .setDynamicOutput(true) .setOutput([4, 4]); - assert.deepEqual(kernel(texture4X4), [new Float32Array([1, 2, 3, 4]), new Float32Array([5, 6, 7, 8]), new Float32Array([9, 10, 11, 12]), new Float32Array([13, 14, 15, 16])]); + assert.deepEqual(kernel(texture4X4), [ + new Float32Array([1, 2, 3, 4]), + new Float32Array([5, 6, 7, 8]), + new Float32Array([9, 10, 11, 12]), + new Float32Array([13, 14, 15, 16]), + ]); kernel.setOutput([3, 3]); - assert.deepEqual(kernel(texture3X3), [new Float32Array([1, 2, 3]), new Float32Array([4, 5, 6]), new Float32Array([7, 8, 9])]); + assert.deepEqual(kernel(texture3X3), [ + new Float32Array([1, 2, 3]), + new Float32Array([4, 5, 6]), + new Float32Array([7, 8, 9]), + ]); kernel.setOutput([2, 2]); - assert.deepEqual(kernel(texture2X2), [new Float32Array([1, 2]), new Float32Array([3, 4])]); + assert.deepEqual(kernel(texture2X2), [ + new Float32Array([1, 2]), + new Float32Array([3, 4]), + ]); assert.ok(kernel.kernelArguments[0].constructor.name.match('NumberTexture')); gpu.destroy(); } -(GPU.isSinglePrecisionSupported ? test : skip)('NumberTexture (GPU only) auto', () => { - testNumberTexture(); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'NumberTexture (GPU only) auto', + () => { + testNumberTexture(); + } +); -(GPU.isSinglePrecisionSupported ? test : skip)('NumberTexture (GPU only) gpu', () => { - testNumberTexture('gpu'); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'NumberTexture (GPU only) gpu', + () => { + testNumberTexture('gpu'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('NumberTexture (GPU only) webgl', () => { - testNumberTexture('webgl'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'NumberTexture (GPU only) webgl', + () => { + testNumberTexture('webgl'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('NumberTexture (GPU only) webgl2', () => { - testNumberTexture('webgl2'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'NumberTexture (GPU only) webgl2', + () => { + testNumberTexture('webgl2'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('NumberTexture (GPU only) headlessgl', () => { - testNumberTexture('headlessgl'); -}); +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'NumberTexture (GPU only) headlessgl', + () => { + testNumberTexture('headlessgl'); + } +); function testMixedNumberTexture(mode) { const gpu = new GPU({ mode }); @@ -278,38 +342,65 @@ function testMixedNumberTexture(mode) { .setDynamicOutput(true) .setOutput([4, 4]); - assert.deepEqual(kernel(texture4X4), [new Float32Array([1, 2, 3, 4]), new Float32Array([5, 6, 7, 8]), new Float32Array([9, 10, 11, 12]), new Float32Array([13, 14, 15, 16])]); + assert.deepEqual(kernel(texture4X4), [ + new Float32Array([1, 2, 3, 4]), + new Float32Array([5, 6, 7, 8]), + new Float32Array([9, 10, 11, 12]), + new Float32Array([13, 14, 15, 16]), + ]); kernel.setOutput([3, 3]); - assert.deepEqual(kernel(texture3X3), [new Float32Array([1, 2, 3]), new Float32Array([4, 5, 6]), new Float32Array([7, 8, 9])]); + assert.deepEqual(kernel(texture3X3), [ + new Float32Array([1, 2, 3]), + new Float32Array([4, 5, 6]), + new Float32Array([7, 8, 9]), + ]); kernel.setOutput([2, 2]); - assert.deepEqual(kernel(texture2X2), [new Float32Array([1, 2]), new Float32Array([3, 4])]); + assert.deepEqual(kernel(texture2X2), [ + new Float32Array([1, 2]), + new Float32Array([3, 4]), + ]); assert.ok(kernel.kernelArguments[0].constructor.name.match('NumberTexture')); gpu.destroy(); } -(GPU.isSinglePrecisionSupported ? test : skip)('Mixed NumberTexture (GPU only) auto', () => { - testMixedNumberTexture(); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'Mixed NumberTexture (GPU only) auto', + () => { + testMixedNumberTexture(); + } +); -(GPU.isSinglePrecisionSupported ? test : skip)('Mixed NumberTexture (GPU only) gpu', () => { - testMixedNumberTexture('gpu'); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'Mixed NumberTexture (GPU only) gpu', + () => { + testMixedNumberTexture('gpu'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('Mixed NumberTexture (GPU only) webgl', () => { - testMixedNumberTexture('webgl'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'Mixed NumberTexture (GPU only) webgl', + () => { + testMixedNumberTexture('webgl'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('Mixed NumberTexture (GPU only) webgl2', () => { - testMixedNumberTexture('webgl2'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'Mixed NumberTexture (GPU only) webgl2', + () => { + testMixedNumberTexture('webgl2'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('Mixed NumberTexture (GPU only) headlessgl', () => { - testMixedNumberTexture('headlessgl'); -}); +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'Mixed NumberTexture (GPU only) headlessgl', + () => { + testMixedNumberTexture('headlessgl'); + } +); function testSingleArray1D2(mode) { const gpu = new GPU({ mode }); @@ -326,7 +417,12 @@ function testSingleArray1D2(mode) { const expected1 = [new Float32Array([1, 2]), new Float32Array([3, 4])]; kernel.setOutput([expected1.length]); assert.deepEqual(kernel(expected1), expected1); - const expected2 = [new Float32Array([1, 2]), new Float32Array([3, 4]), new Float32Array([5, 6]), new Float32Array([7, 8])]; + const expected2 = [ + new Float32Array([1, 2]), + new Float32Array([3, 4]), + new Float32Array([5, 6]), + new Float32Array([7, 8]), + ]; kernel.setOutput([expected2.length]); assert.deepEqual(kernel(expected2), expected2); gpu.destroy(); @@ -371,7 +467,12 @@ function testSingleArray1D3(mode) { const expected1 = [new Float32Array([1, 2, 3]), new Float32Array([4, 5, 6])]; kernel.setOutput([expected1.length]); assert.deepEqual(kernel(expected1), expected1); - const expected2 = [new Float32Array([1, 2, 3]), new Float32Array([4, 5, 6]), new Float32Array([7, 8, 9]), new Float32Array([10, 11, 12])]; + const expected2 = [ + new Float32Array([1, 2, 3]), + new Float32Array([4, 5, 6]), + new Float32Array([7, 8, 9]), + new Float32Array([10, 11, 12]), + ]; kernel.setOutput([expected2.length]); assert.deepEqual(kernel(expected2), expected2); gpu.destroy(); @@ -413,10 +514,18 @@ function testSingleArray1D4(mode) { dynamicOutput: true, } ); - const expected1 = [new Float32Array([1, 2, 3, 4]), new Float32Array([5, 6, 7, 8])]; + const expected1 = [ + new Float32Array([1, 2, 3, 4]), + new Float32Array([5, 6, 7, 8]), + ]; kernel.setOutput([expected1.length]); assert.deepEqual(kernel(expected1), expected1); - const expected2 = [new Float32Array([1, 2, 3, 4]), new Float32Array([5, 6, 7, 8]), new Float32Array([9, 10, 11, 12]), new Float32Array([13, 14, 15, 16])]; + const expected2 = [ + new Float32Array([1, 2, 3, 4]), + new Float32Array([5, 6, 7, 8]), + new Float32Array([9, 10, 11, 12]), + new Float32Array([13, 14, 15, 16]), + ]; kernel.setOutput([expected2.length]); assert.deepEqual(kernel(expected2), expected2); gpu.destroy(); @@ -465,8 +574,18 @@ function testSingleArray2D2(mode) { kernel.setOutput([expected1[0].length, expected1.length]); assert.deepEqual(kernel(expected1), expected1); const expected2 = [ - [new Float32Array([1, 2]), new Float32Array([3, 4]), new Float32Array([5, 6]), new Float32Array([7, 8])], - [new Float32Array([9, 10]), new Float32Array([11, 12]), new Float32Array([13, 14]), new Float32Array([15, 16])], + [ + new Float32Array([1, 2]), + new Float32Array([3, 4]), + new Float32Array([5, 6]), + new Float32Array([7, 8]), + ], + [ + new Float32Array([9, 10]), + new Float32Array([11, 12]), + new Float32Array([13, 14]), + new Float32Array([15, 16]), + ], ]; kernel.setOutput([expected2[0].length, expected2.length]); assert.deepEqual(kernel(expected2), expected2); @@ -516,8 +635,18 @@ function testSingleArray2D3(mode) { kernel.setOutput([expected1[0].length, expected1.length]); assert.deepEqual(kernel(expected1), expected1); const expected2 = [ - [new Float32Array([1, 2, 3]), new Float32Array([4, 5, 6]), new Float32Array([7, 8, 9]), new Float32Array([10, 11, 12])], - [new Float32Array([13, 14, 15]), new Float32Array([16, 17, 18]), new Float32Array([19, 20, 21]), new Float32Array([22, 23, 24])], + [ + new Float32Array([1, 2, 3]), + new Float32Array([4, 5, 6]), + new Float32Array([7, 8, 9]), + new Float32Array([10, 11, 12]), + ], + [ + new Float32Array([13, 14, 15]), + new Float32Array([16, 17, 18]), + new Float32Array([19, 20, 21]), + new Float32Array([22, 23, 24]), + ], ]; kernel.setOutput([expected2[0].length, expected2.length]); assert.deepEqual(kernel(expected2), expected2); @@ -567,8 +696,18 @@ function testSingleArray2D4(mode) { kernel.setOutput([expected1[0].length, expected1.length]); assert.deepEqual(kernel(expected1), expected1); const expected2 = [ - [new Float32Array([1, 2, 3, 4]), new Float32Array([5, 6, 7, 8]), new Float32Array([9, 10, 11, 12]), new Float32Array([13, 14, 15, 16])], - [new Float32Array([17, 18, 19, 20]), new Float32Array([21, 22, 23, 24]), new Float32Array([25, 26, 27, 28]), new Float32Array([29, 30, 31, 32])], + [ + new Float32Array([1, 2, 3, 4]), + new Float32Array([5, 6, 7, 8]), + new Float32Array([9, 10, 11, 12]), + new Float32Array([13, 14, 15, 16]), + ], + [ + new Float32Array([17, 18, 19, 20]), + new Float32Array([21, 22, 23, 24]), + new Float32Array([25, 26, 27, 28]), + new Float32Array([29, 30, 31, 32]), + ], ]; kernel.setOutput([expected2[0].length, expected2.length]); assert.deepEqual(kernel(expected2), expected2); @@ -621,19 +760,47 @@ function testSingleArray3D2(mode) { [new Float32Array([13, 14]), new Float32Array([15, 16])], ], ]; - kernel.setOutput([expected1[0][0].length, expected1[0].length, expected1.length]); + kernel.setOutput([ + expected1[0][0].length, + expected1[0].length, + expected1.length, + ]); assert.deepEqual(kernel(expected1), expected1); const expected2 = [ [ - [new Float32Array([1, 2]), new Float32Array([3, 4]), new Float32Array([5, 6]), new Float32Array([7, 8])], - [new Float32Array([9, 10]), new Float32Array([11, 12]), new Float32Array([13, 14]), new Float32Array([15, 16])], + [ + new Float32Array([1, 2]), + new Float32Array([3, 4]), + new Float32Array([5, 6]), + new Float32Array([7, 8]), + ], + [ + new Float32Array([9, 10]), + new Float32Array([11, 12]), + new Float32Array([13, 14]), + new Float32Array([15, 16]), + ], ], [ - [new Float32Array([17, 18]), new Float32Array([19, 20]), new Float32Array([21, 22]), new Float32Array([23, 24])], - [new Float32Array([25, 26]), new Float32Array([27, 28]), new Float32Array([29, 30]), new Float32Array([31, 32])], + [ + new Float32Array([17, 18]), + new Float32Array([19, 20]), + new Float32Array([21, 22]), + new Float32Array([23, 24]), + ], + [ + new Float32Array([25, 26]), + new Float32Array([27, 28]), + new Float32Array([29, 30]), + new Float32Array([31, 32]), + ], ], ]; - kernel.setOutput([expected2[0][0].length, expected2[0].length, expected2.length]); + kernel.setOutput([ + expected2[0][0].length, + expected2[0].length, + expected2.length, + ]); assert.deepEqual(kernel(expected2), expected2); gpu.destroy(); } @@ -684,19 +851,47 @@ function testSingleArray3D3(mode) { [new Float32Array([19, 20, 21]), new Float32Array([22, 23, 24])], ], ]; - kernel.setOutput([expected1[0][0].length, expected1[0].length, expected1.length]); + kernel.setOutput([ + expected1[0][0].length, + expected1[0].length, + expected1.length, + ]); assert.deepEqual(kernel(expected1), expected1); const expected2 = [ [ - [new Float32Array([1, 2, 3]), new Float32Array([4, 5, 6]), new Float32Array([7, 8, 9]), new Float32Array([10, 11, 12])], - [new Float32Array([13, 14, 15]), new Float32Array([16, 17, 18]), new Float32Array([19, 20, 21]), new Float32Array([22, 23, 24])], + [ + new Float32Array([1, 2, 3]), + new Float32Array([4, 5, 6]), + new Float32Array([7, 8, 9]), + new Float32Array([10, 11, 12]), + ], + [ + new Float32Array([13, 14, 15]), + new Float32Array([16, 17, 18]), + new Float32Array([19, 20, 21]), + new Float32Array([22, 23, 24]), + ], ], [ - [new Float32Array([25, 26, 27]), new Float32Array([28, 29, 30]), new Float32Array([31, 32, 33]), new Float32Array([34, 35, 36])], - [new Float32Array([37, 38, 39]), new Float32Array([40, 41, 42]), new Float32Array([43, 44, 45]), new Float32Array([46, 47, 48])], + [ + new Float32Array([25, 26, 27]), + new Float32Array([28, 29, 30]), + new Float32Array([31, 32, 33]), + new Float32Array([34, 35, 36]), + ], + [ + new Float32Array([37, 38, 39]), + new Float32Array([40, 41, 42]), + new Float32Array([43, 44, 45]), + new Float32Array([46, 47, 48]), + ], ], ]; - kernel.setOutput([expected2[0][0].length, expected2[0].length, expected2.length]); + kernel.setOutput([ + expected2[0][0].length, + expected2[0].length, + expected2.length, + ]); assert.deepEqual(kernel(expected2), expected2); gpu.destroy(); } @@ -747,19 +942,47 @@ function testSingleArray3D4(mode) { [new Float32Array([25, 26, 27, 28]), new Float32Array([29, 30, 31, 32])], ], ]; - kernel.setOutput([expected1[0][0].length, expected1[0].length, expected1.length]); + kernel.setOutput([ + expected1[0][0].length, + expected1[0].length, + expected1.length, + ]); assert.deepEqual(kernel(expected1), expected1); const expected2 = [ [ - [new Float32Array([1, 2, 3, 4]), new Float32Array([5, 6, 7, 8]), new Float32Array([9, 10, 11, 12]), new Float32Array([13, 14, 15, 16])], - [new Float32Array([17, 18, 19, 20]), new Float32Array([21, 22, 23, 24]), new Float32Array([25, 26, 27, 28]), new Float32Array([29, 30, 31, 32])], + [ + new Float32Array([1, 2, 3, 4]), + new Float32Array([5, 6, 7, 8]), + new Float32Array([9, 10, 11, 12]), + new Float32Array([13, 14, 15, 16]), + ], + [ + new Float32Array([17, 18, 19, 20]), + new Float32Array([21, 22, 23, 24]), + new Float32Array([25, 26, 27, 28]), + new Float32Array([29, 30, 31, 32]), + ], ], [ - [new Float32Array([33, 34, 35, 36]), new Float32Array([37, 38, 39, 40]), new Float32Array([41, 42, 43, 44]), new Float32Array([45, 46, 47, 48])], - [new Float32Array([49, 50, 51, 52]), new Float32Array([53, 54, 56, 57]), new Float32Array([58, 59, 60, 61]), new Float32Array([62, 63, 64, 65])], + [ + new Float32Array([33, 34, 35, 36]), + new Float32Array([37, 38, 39, 40]), + new Float32Array([41, 42, 43, 44]), + new Float32Array([45, 46, 47, 48]), + ], + [ + new Float32Array([49, 50, 51, 52]), + new Float32Array([53, 54, 56, 57]), + new Float32Array([58, 59, 60, 61]), + new Float32Array([62, 63, 64, 65]), + ], ], ]; - kernel.setOutput([expected2[0][0].length, expected2[0].length, expected2.length]); + kernel.setOutput([ + expected2[0][0].length, + expected2[0].length, + expected2.length, + ]); assert.deepEqual(kernel(expected2), expected2); gpu.destroy(); } @@ -821,13 +1044,19 @@ test('unsigned precision Array gpu', () => { testUnsignedPrecisionArray('webgl'); }); -(GPU.isWebGL2Supported ? test : skip)('unsigned precision Array webgl2', () => { - testUnsignedPrecisionArray('webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'unsigned precision Array webgl2', + () => { + testUnsignedPrecisionArray('webgl2'); + } +); -(GPU.isHeadlessGLSupported ? test : skip)('unsigned precision Array headlessgl', () => { - testUnsignedPrecisionArray('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'unsigned precision Array headlessgl', + () => { + testUnsignedPrecisionArray('headlessgl'); + } +); test('unsigned precision Array cpu', () => { testUnsignedPrecisionArray('cpu'); @@ -854,25 +1083,40 @@ function testSinglePrecisionArray(mode) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported ? test : skip)('single precision Array auto', () => { - testSinglePrecisionArray(); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'single precision Array auto', + () => { + testSinglePrecisionArray(); + } +); -(GPU.isSinglePrecisionSupported ? test : skip)('single precision Array gpu', () => { - testSinglePrecisionArray('gpu'); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'single precision Array gpu', + () => { + testSinglePrecisionArray('gpu'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('single precision Array webgl', () => { - testSinglePrecisionArray('webgl'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'single precision Array webgl', + () => { + testSinglePrecisionArray('webgl'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('single precision Array webgl2', () => { - testSinglePrecisionArray('webgl2'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'single precision Array webgl2', + () => { + testSinglePrecisionArray('webgl2'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('single precision Array headlessgl', () => { - testSinglePrecisionArray('headlessgl'); -}); +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'single precision Array headlessgl', + () => { + testSinglePrecisionArray('headlessgl'); + } +); test('single precision Array cpu', () => { testSinglePrecisionArray('cpu'); @@ -935,13 +1179,19 @@ test('unsigned precision Matrix gpu', () => { testUnsignedPrecisionMatrix('webgl'); }); -(GPU.isWebGL2Supported ? test : skip)('unsigned precision Matrix webgl2', () => { - testUnsignedPrecisionMatrix('webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'unsigned precision Matrix webgl2', + () => { + testUnsignedPrecisionMatrix('webgl2'); + } +); -(GPU.isHeadlessGLSupported ? test : skip)('unsigned precision Matrix headlessgl', () => { - testUnsignedPrecisionMatrix('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'unsigned precision Matrix headlessgl', + () => { + testUnsignedPrecisionMatrix('headlessgl'); + } +); test('unsigned precision Matrix cpu', () => { testUnsignedPrecisionMatrix('cpu'); @@ -991,25 +1241,40 @@ function testSinglePrecisionMatrix(mode) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported ? test : skip)('single precision Matrix auto', () => { - testSinglePrecisionMatrix(); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'single precision Matrix auto', + () => { + testSinglePrecisionMatrix(); + } +); -(GPU.isSinglePrecisionSupported ? test : skip)('single precision Matrix gpu', () => { - testSinglePrecisionMatrix('gpu'); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'single precision Matrix gpu', + () => { + testSinglePrecisionMatrix('gpu'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('single precision Matrix webgl', () => { - testSinglePrecisionMatrix('webgl'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'single precision Matrix webgl', + () => { + testSinglePrecisionMatrix('webgl'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('single precision Matrix webgl2', () => { - testSinglePrecisionMatrix('webgl2'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'single precision Matrix webgl2', + () => { + testSinglePrecisionMatrix('webgl2'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('single precision Matrix headlessgl', () => { - testSinglePrecisionMatrix('headlessgl'); -}); +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'single precision Matrix headlessgl', + () => { + testSinglePrecisionMatrix('headlessgl'); + } +); test('single precision Matrix cpu', () => { testSinglePrecisionMatrix('cpu'); @@ -1026,16 +1291,31 @@ function testUnsignedPrecisionInputMatrix(mode) { .setDynamicOutput(true) .setOutput([4, 4]); - let matrix = input([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], [4, 4]); - assert.deepEqual(kernel(matrix), [new Float32Array([1, 2, 3, 4]), new Float32Array([5, 6, 7, 8]), new Float32Array([9, 10, 11, 12]), new Float32Array([13, 14, 15, 16])]); + let matrix = input( + [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], + [4, 4] + ); + assert.deepEqual(kernel(matrix), [ + new Float32Array([1, 2, 3, 4]), + new Float32Array([5, 6, 7, 8]), + new Float32Array([9, 10, 11, 12]), + new Float32Array([13, 14, 15, 16]), + ]); kernel.setOutput([3, 3]); matrix = input([1, 2, 3, 4, 5, 6, 7, 8, 9], [3, 3]); - assert.deepEqual(kernel(matrix), [new Float32Array([1, 2, 3]), new Float32Array([4, 5, 6]), new Float32Array([7, 8, 9])]); + assert.deepEqual(kernel(matrix), [ + new Float32Array([1, 2, 3]), + new Float32Array([4, 5, 6]), + new Float32Array([7, 8, 9]), + ]); kernel.setOutput([2, 2]); matrix = input([1, 2, 3, 4], [2, 2]); - assert.deepEqual(kernel(matrix), [new Float32Array([1, 2]), new Float32Array([3, 4])]); + assert.deepEqual(kernel(matrix), [ + new Float32Array([1, 2]), + new Float32Array([3, 4]), + ]); gpu.destroy(); } @@ -1047,17 +1327,26 @@ test('unsigned precision Input Matrix gpu', () => { testUnsignedPrecisionInputMatrix('gpu'); }); -(GPU.isWebGLSupported ? test : skip)('unsigned precision Input Matrix webgl', () => { - testUnsignedPrecisionInputMatrix('webgl'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'unsigned precision Input Matrix webgl', + () => { + testUnsignedPrecisionInputMatrix('webgl'); + } +); -(GPU.isWebGL2Supported ? test : skip)('unsigned precision Input Matrix webgl2', () => { - testUnsignedPrecisionInputMatrix('webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'unsigned precision Input Matrix webgl2', + () => { + testUnsignedPrecisionInputMatrix('webgl2'); + } +); -(GPU.isHeadlessGLSupported ? test : skip)('unsigned precision Input Matrix headlessgl', () => { - testUnsignedPrecisionInputMatrix('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'unsigned precision Input Matrix headlessgl', + () => { + testUnsignedPrecisionInputMatrix('headlessgl'); + } +); test('unsigned precision Input Matrix cpu', () => { testUnsignedPrecisionInputMatrix('cpu'); @@ -1073,38 +1362,68 @@ function testSinglePrecisionInputMatrix(mode) { .setDynamicOutput(true) .setOutput([4, 4]); - let matrix = input([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], [4, 4]); - assert.deepEqual(kernel(matrix), [new Float32Array([1, 2, 3, 4]), new Float32Array([5, 6, 7, 8]), new Float32Array([9, 10, 11, 12]), new Float32Array([13, 14, 15, 16])]); + let matrix = input( + [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], + [4, 4] + ); + assert.deepEqual(kernel(matrix), [ + new Float32Array([1, 2, 3, 4]), + new Float32Array([5, 6, 7, 8]), + new Float32Array([9, 10, 11, 12]), + new Float32Array([13, 14, 15, 16]), + ]); kernel.setOutput([3, 3]); matrix = input([1, 2, 3, 4, 5, 6, 7, 8, 9], [3, 3]); - assert.deepEqual(kernel(matrix), [new Float32Array([1, 2, 3]), new Float32Array([4, 5, 6]), new Float32Array([7, 8, 9])]); + assert.deepEqual(kernel(matrix), [ + new Float32Array([1, 2, 3]), + new Float32Array([4, 5, 6]), + new Float32Array([7, 8, 9]), + ]); kernel.setOutput([2, 2]); matrix = input([1, 2, 3, 4], [2, 2]); - assert.deepEqual(kernel(matrix), [new Float32Array([1, 2]), new Float32Array([3, 4])]); + assert.deepEqual(kernel(matrix), [ + new Float32Array([1, 2]), + new Float32Array([3, 4]), + ]); gpu.destroy(); } -(GPU.isSinglePrecisionSupported ? test : skip)('single precision Input Matrix auto', () => { - testSinglePrecisionInputMatrix(); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'single precision Input Matrix auto', + () => { + testSinglePrecisionInputMatrix(); + } +); -(GPU.isSinglePrecisionSupported ? test : skip)('single precision Input Matrix gpu', () => { - testSinglePrecisionInputMatrix('gpu'); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'single precision Input Matrix gpu', + () => { + testSinglePrecisionInputMatrix('gpu'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('single precision Input Matrix webgl', () => { - testSinglePrecisionInputMatrix('webgl'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'single precision Input Matrix webgl', + () => { + testSinglePrecisionInputMatrix('webgl'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('single precision Input Matrix webgl2', () => { - testSinglePrecisionInputMatrix('webgl2'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'single precision Input Matrix webgl2', + () => { + testSinglePrecisionInputMatrix('webgl2'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('single precision Input Matrix headlessgl', () => { - testSinglePrecisionInputMatrix('headlessgl'); -}); +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'single precision Input Matrix headlessgl', + () => { + testSinglePrecisionInputMatrix('headlessgl'); + } +); test('single precision Input Matrix cpu', () => { testSinglePrecisionInputMatrix('cpu'); diff --git a/test/features/dynamic-output.js b/test/features/dynamic-output.js index 696aecc3..e20d9c82 100644 --- a/test/features/dynamic-output.js +++ b/test/features/dynamic-output.js @@ -21,7 +21,10 @@ function dynamicOutput1DGrows(mode) { kernel.setOutput([10]); result = kernel(); assert.equal(result.length, 10); - assert.deepEqual(Array.from(result), [10, 11, 12, 13, 14, 15, 16, 17, 18, 19]); + assert.deepEqual( + Array.from(result), + [10, 11, 12, 13, 14, 15, 16, 17, 18, 19] + ); assert.deepEqual(Array.from(kernel.output), [10]); gpu.destroy(); @@ -43,9 +46,12 @@ test('dynamic output 1d grows gpu', () => { dynamicOutput1DGrows('webgl2'); }); -(GPU.isHeadlessGLSupported ? test : skip)('dynamic output 1d grows headlessgl', () => { - dynamicOutput1DGrows('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'dynamic output 1d grows headlessgl', + () => { + dynamicOutput1DGrows('headlessgl'); + } +); test('dynamic output 1d grows cpu', () => { dynamicOutput1DGrows('cpu'); @@ -63,7 +69,10 @@ function dynamicOutput1DShrinks(mode) { kernel.setOutput([10]); let result = kernel(); assert.equal(result.length, 10); - assert.deepEqual(Array.from(result), [10, 11, 12, 13, 14, 15, 16, 17, 18, 19]); + assert.deepEqual( + Array.from(result), + [10, 11, 12, 13, 14, 15, 16, 17, 18, 19] + ); assert.deepEqual(Array.from(kernel.output), [10]); kernel.setOutput([5]); @@ -87,13 +96,19 @@ test('dynamic output 1d shrinks gpu', () => { dynamicOutput1DShrinks('webgl'); }); -(GPU.isWebGL2Supported ? test : skip)('dynamic output 1d shrinks webgl2', () => { - dynamicOutput1DShrinks('webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'dynamic output 1d shrinks webgl2', + () => { + dynamicOutput1DShrinks('webgl2'); + } +); -(GPU.isHeadlessGLSupported ? test : skip)('dynamic output 1d shrinks headlessgl', () => { - dynamicOutput1DShrinks('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'dynamic output 1d shrinks headlessgl', + () => { + dynamicOutput1DShrinks('headlessgl'); + } +); test('dynamic output 1d shrinks cpu', () => { dynamicOutput1DShrinks('cpu'); @@ -125,8 +140,14 @@ function dynamicOutput1DKernelMapGrows(mode) { result = kernel(); assert.equal(result.result.length, 10); assert.equal(result.result2.length, 10); - assert.deepEqual(Array.from(result.result), [10, 11, 12, 13, 14, 15, 16, 17, 18, 19]); - assert.deepEqual(Array.from(result.result2), [10, 11, 12, 13, 14, 15, 16, 17, 18, 19]); + assert.deepEqual( + Array.from(result.result), + [10, 11, 12, 13, 14, 15, 16, 17, 18, 19] + ); + assert.deepEqual( + Array.from(result.result2), + [10, 11, 12, 13, 14, 15, 16, 17, 18, 19] + ); assert.deepEqual(Array.from(kernel.output), [10]); gpu.destroy(); @@ -140,17 +161,26 @@ test('dynamic output 1d kernel map grows gpu', () => { dynamicOutput1DKernelMapGrows('gpu'); }); -(GPU.isWebGLSupported ? test : skip)('dynamic output 1d kernel map grows webgl', () => { - dynamicOutput1DKernelMapGrows('webgl'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'dynamic output 1d kernel map grows webgl', + () => { + dynamicOutput1DKernelMapGrows('webgl'); + } +); -(GPU.isWebGL2Supported ? test : skip)('dynamic output 1d kernel map grows webgl2', () => { - dynamicOutput1DKernelMapGrows('webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'dynamic output 1d kernel map grows webgl2', + () => { + dynamicOutput1DKernelMapGrows('webgl2'); + } +); -(GPU.isHeadlessGLSupported ? test : skip)('dynamic output 1d kernel map grows headlessgl', () => { - dynamicOutput1DKernelMapGrows('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'dynamic output 1d kernel map grows headlessgl', + () => { + dynamicOutput1DKernelMapGrows('headlessgl'); + } +); test('dynamic output 1d kernel map grows cpu', () => { dynamicOutput1DKernelMapGrows('cpu'); @@ -174,8 +204,14 @@ function dynamicOutput1DKernelMapShrinks(mode) { let result = kernel(); assert.equal(result.result.length, 10); assert.equal(result.result2.length, 10); - assert.deepEqual(Array.from(result.result), [10, 11, 12, 13, 14, 15, 16, 17, 18, 19]); - assert.deepEqual(Array.from(result.result2), [10, 11, 12, 13, 14, 15, 16, 17, 18, 19]); + assert.deepEqual( + Array.from(result.result), + [10, 11, 12, 13, 14, 15, 16, 17, 18, 19] + ); + assert.deepEqual( + Array.from(result.result2), + [10, 11, 12, 13, 14, 15, 16, 17, 18, 19] + ); assert.deepEqual(Array.from(kernel.output), [10]); kernel.setOutput([5]); @@ -197,17 +233,26 @@ test('dynamic output 1d kernel map shrinks gpu', () => { dynamicOutput1DKernelMapShrinks('gpu'); }); -(GPU.isWebGLSupported ? test : skip)('dynamic output 1d kernel map shrinks webgl', () => { - dynamicOutput1DKernelMapShrinks('webgl'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'dynamic output 1d kernel map shrinks webgl', + () => { + dynamicOutput1DKernelMapShrinks('webgl'); + } +); -(GPU.isWebGL2Supported ? test : skip)('dynamic output 1d kernel map shrinks webgl2', () => { - dynamicOutput1DKernelMapShrinks('webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'dynamic output 1d kernel map shrinks webgl2', + () => { + dynamicOutput1DKernelMapShrinks('webgl2'); + } +); -(GPU.isHeadlessGLSupported ? test : skip)('dynamic output 1d kernel map shrinks headlessgl', () => { - dynamicOutput1DKernelMapShrinks('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'dynamic output 1d kernel map shrinks headlessgl', + () => { + dynamicOutput1DKernelMapShrinks('headlessgl'); + } +); test('dynamic output 1d kernel map shrinks cpu', () => { dynamicOutput1DKernelMapShrinks('cpu'); @@ -266,9 +311,12 @@ test('dynamic output 2d grows gpu', () => { dynamicOutput2DGrows('webgl2'); }); -(GPU.isHeadlessGLSupported ? test : skip)('dynamic output 2d grows headlessgl', () => { - dynamicOutput2DGrows('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'dynamic output 2d grows headlessgl', + () => { + dynamicOutput2DGrows('headlessgl'); + } +); test('dynamic output 2d grows cpu', () => { dynamicOutput2DGrows('cpu'); @@ -323,13 +371,19 @@ test('dynamic output 2d shrinks gpu', () => { dynamicOutput2DShrinks('webgl'); }); -(GPU.isWebGL2Supported ? test : skip)('dynamic output 2d shrinks webgl2', () => { - dynamicOutput2DShrinks('webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'dynamic output 2d shrinks webgl2', + () => { + dynamicOutput2DShrinks('webgl2'); + } +); -(GPU.isHeadlessGLSupported ? test : skip)('dynamic output 2d shrinks headlessgl', () => { - dynamicOutput2DShrinks('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'dynamic output 2d shrinks headlessgl', + () => { + dynamicOutput2DShrinks('headlessgl'); + } +); test('dynamic output 2d shrinks cpu', () => { dynamicOutput2DShrinks('cpu'); @@ -344,7 +398,9 @@ function dynamicOutput2DKernelMapGrows(mode) { }, }, function () { - return map(this.output.x + this.output.y + this.thread.x + this.thread.y); + return map( + this.output.x + this.output.y + this.thread.x + this.thread.y + ); }, { dynamicOutput: true } ); @@ -402,17 +458,26 @@ test('dynamic output 2d kernel map grows gpu', () => { dynamicOutput2DKernelMapGrows('gpu'); }); -(GPU.isWebGLSupported ? test : skip)('dynamic output 2d kernel map grows webgl', () => { - dynamicOutput2DKernelMapGrows('webgl'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'dynamic output 2d kernel map grows webgl', + () => { + dynamicOutput2DKernelMapGrows('webgl'); + } +); -(GPU.isWebGL2Supported ? test : skip)('dynamic output 2d kernel map grows webgl2', () => { - dynamicOutput2DKernelMapGrows('webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'dynamic output 2d kernel map grows webgl2', + () => { + dynamicOutput2DKernelMapGrows('webgl2'); + } +); -(GPU.isHeadlessGLSupported ? test : skip)('dynamic output 2d kernel map grows headlessgl', () => { - dynamicOutput2DKernelMapGrows('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'dynamic output 2d kernel map grows headlessgl', + () => { + dynamicOutput2DKernelMapGrows('headlessgl'); + } +); test('dynamic output 2d kernel map grows cpu', () => { dynamicOutput2DKernelMapGrows('cpu'); @@ -427,7 +492,9 @@ function dynamicOutput2DKernelMapShrinks(mode) { }, }, function () { - return map(this.output.x + this.output.y + this.thread.x + this.thread.y); + return map( + this.output.x + this.output.y + this.thread.x + this.thread.y + ); }, { dynamicOutput: true } ); @@ -489,13 +556,19 @@ test('dynamic output 2d shrinks gpu', () => { dynamicOutput2DShrinks('webgl'); }); -(GPU.isWebGL2Supported ? test : skip)('dynamic output 2d shrinks webgl2', () => { - dynamicOutput2DShrinks('webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'dynamic output 2d shrinks webgl2', + () => { + dynamicOutput2DShrinks('webgl2'); + } +); -(GPU.isHeadlessGLSupported ? test : skip)('dynamic output 2d shrinks headlessgl', () => { - dynamicOutput2DShrinks('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'dynamic output 2d shrinks headlessgl', + () => { + dynamicOutput2DShrinks('headlessgl'); + } +); test('dynamic output 2d shrinks cpu', () => { dynamicOutput2DShrinks('cpu'); @@ -515,14 +588,27 @@ function dynamicOutput2DGraphicalGrows(mode) { kernel(); let result = kernel.getPixels(); assert.equal(result.length, 2 * 2 * 4); - assert.deepEqual(Array.from(result), [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]); + assert.deepEqual( + Array.from(result), + [ + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, + ] + ); assert.deepEqual(Array.from(kernel.output), [2, 2]); kernel.setOutput([3, 3]); kernel(); result = kernel.getPixels(); assert.equal(result.length, 3 * 3 * 4); - assert.deepEqual(Array.from(result), [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]); + assert.deepEqual( + Array.from(result), + [ + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, + ] + ); assert.deepEqual(Array.from(kernel.output), [3, 3]); gpu.destroy(); @@ -536,21 +622,33 @@ test('dynamic output 2d graphical grows gpu', () => { dynamicOutput2DGraphicalGrows('gpu'); }); -(GPU.isWebGLSupported ? test : skip)('dynamic output 2d graphical grows webgl', () => { - dynamicOutput2DGraphicalGrows('webgl'); -}); - -(GPU.isWebGL2Supported ? test : skip)('dynamic output 2d graphical grows webgl2', () => { - dynamicOutput2DGraphicalGrows('webgl2'); -}); - -(GPU.isHeadlessGLSupported ? test : skip)('dynamic output 2d graphical grows headlessgl', () => { - dynamicOutput2DGraphicalGrows('headlessgl'); -}); - -(GPU.isCanvasSupported ? test : skip)('dynamic output 2d graphical grows cpu', () => { - dynamicOutput2DGraphicalGrows('cpu'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'dynamic output 2d graphical grows webgl', + () => { + dynamicOutput2DGraphicalGrows('webgl'); + } +); + +(GPU.isWebGL2Supported ? test : skip)( + 'dynamic output 2d graphical grows webgl2', + () => { + dynamicOutput2DGraphicalGrows('webgl2'); + } +); + +(GPU.isHeadlessGLSupported ? test : skip)( + 'dynamic output 2d graphical grows headlessgl', + () => { + dynamicOutput2DGraphicalGrows('headlessgl'); + } +); + +(GPU.isCanvasSupported ? test : skip)( + 'dynamic output 2d graphical grows cpu', + () => { + dynamicOutput2DGraphicalGrows('cpu'); + } +); function dynamicOutput2DGraphicalShrinks(mode) { const gpu = new GPU({ mode }); @@ -565,14 +663,27 @@ function dynamicOutput2DGraphicalShrinks(mode) { kernel(); let result = kernel.getPixels(); assert.equal(result.length, 3 * 3 * 4); - assert.deepEqual(Array.from(result), [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]); + assert.deepEqual( + Array.from(result), + [ + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, + ] + ); assert.deepEqual(Array.from(kernel.output), [3, 3]); kernel.setOutput([2, 2]); kernel(); result = kernel.getPixels(); assert.equal(result.length, 2 * 2 * 4); - assert.deepEqual(Array.from(result), [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]); + assert.deepEqual( + Array.from(result), + [ + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, + ] + ); assert.deepEqual(Array.from(kernel.output), [2, 2]); gpu.destroy(); @@ -586,27 +697,46 @@ test('dynamic output 2d graphical shrinks gpu', () => { dynamicOutput2DGraphicalShrinks('gpu'); }); -(GPU.isWebGLSupported ? test : skip)('dynamic output 2d graphical shrinks webgl', () => { - dynamicOutput2DGraphicalShrinks('webgl'); -}); - -(GPU.isWebGL2Supported ? test : skip)('dynamic output 2d graphical shrinks webgl2', () => { - dynamicOutput2DGraphicalShrinks('webgl2'); -}); - -(GPU.isHeadlessGLSupported ? test : skip)('dynamic output 2d graphical shrinks headlessgl', () => { - dynamicOutput2DGraphicalShrinks('headlessgl'); -}); - -(GPU.isCanvasSupported ? test : skip)('dynamic output 2d graphical shrinks cpu', () => { - dynamicOutput2DGraphicalShrinks('cpu'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'dynamic output 2d graphical shrinks webgl', + () => { + dynamicOutput2DGraphicalShrinks('webgl'); + } +); + +(GPU.isWebGL2Supported ? test : skip)( + 'dynamic output 2d graphical shrinks webgl2', + () => { + dynamicOutput2DGraphicalShrinks('webgl2'); + } +); + +(GPU.isHeadlessGLSupported ? test : skip)( + 'dynamic output 2d graphical shrinks headlessgl', + () => { + dynamicOutput2DGraphicalShrinks('headlessgl'); + } +); + +(GPU.isCanvasSupported ? test : skip)( + 'dynamic output 2d graphical shrinks cpu', + () => { + dynamicOutput2DGraphicalShrinks('cpu'); + } +); function dynamicOutput3DGrows(mode) { const gpu = new GPU({ mode }); const kernel = gpu.createKernel( function () { - return this.output.x + this.output.y + this.thread.z + this.thread.x + this.thread.y + this.thread.z; + return ( + this.output.x + + this.output.y + + this.thread.z + + this.thread.x + + this.thread.y + + this.thread.z + ); }, { dynamicOutput: true } ); @@ -673,9 +803,12 @@ test('dynamic output 3d grows gpu', () => { dynamicOutput3DGrows('webgl2'); }); -(GPU.isHeadlessGLSupported ? test : skip)('dynamic output 3d grows headlessgl', () => { - dynamicOutput3DGrows('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'dynamic output 3d grows headlessgl', + () => { + dynamicOutput3DGrows('headlessgl'); + } +); test('dynamic output 3d grows cpu', () => { dynamicOutput3DGrows('cpu'); @@ -685,7 +818,14 @@ function dynamicOutput3DShrinks(mode) { const gpu = new GPU({ mode }); const kernel = gpu.createKernel( function () { - return this.output.x + this.output.y + this.thread.z + this.thread.x + this.thread.y + this.thread.z; + return ( + this.output.x + + this.output.y + + this.thread.z + + this.thread.x + + this.thread.y + + this.thread.z + ); }, { dynamicOutput: true } ); @@ -748,13 +888,19 @@ test('dynamic output 3d shrinks gpu', () => { dynamicOutput3DShrinks('webgl'); }); -(GPU.isWebGL2Supported ? test : skip)('dynamic output 3d shrinks webgl2', () => { - dynamicOutput3DShrinks('webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'dynamic output 3d shrinks webgl2', + () => { + dynamicOutput3DShrinks('webgl2'); + } +); -(GPU.isHeadlessGLSupported ? test : skip)('dynamic output 3d shrinks headlessgl', () => { - dynamicOutput3DShrinks('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'dynamic output 3d shrinks headlessgl', + () => { + dynamicOutput3DShrinks('headlessgl'); + } +); test('dynamic output 3d shrinks cpu', () => { dynamicOutput3DShrinks('cpu'); @@ -769,7 +915,14 @@ function dynamicOutput3DKernelMapGrows(mode) { }, }, function () { - return map(this.output.x + this.output.y + this.thread.z + this.thread.x + this.thread.y + this.thread.z); + return map( + this.output.x + + this.output.y + + this.thread.z + + this.thread.x + + this.thread.y + + this.thread.z + ); }, { dynamicOutput: true } ); @@ -863,17 +1016,26 @@ test('dynamic output 3d kernel map grows gpu', () => { dynamicOutput3DKernelMapGrows('gpu'); }); -(GPU.isWebGLSupported ? test : skip)('dynamic output 3d kernel map grows webgl', () => { - dynamicOutput3DKernelMapGrows('webgl'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'dynamic output 3d kernel map grows webgl', + () => { + dynamicOutput3DKernelMapGrows('webgl'); + } +); -(GPU.isWebGL2Supported ? test : skip)('dynamic output 3d kernel map grows webgl2', () => { - dynamicOutput3DKernelMapGrows('webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'dynamic output 3d kernel map grows webgl2', + () => { + dynamicOutput3DKernelMapGrows('webgl2'); + } +); -(GPU.isHeadlessGLSupported ? test : skip)('dynamic output 3d kernel map grows headlessgl', () => { - dynamicOutput3DKernelMapGrows('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'dynamic output 3d kernel map grows headlessgl', + () => { + dynamicOutput3DKernelMapGrows('headlessgl'); + } +); test('dynamic output 3d kernel map grows cpu', () => { dynamicOutput3DKernelMapGrows('cpu'); @@ -888,7 +1050,14 @@ function dynamicOutput3DKernelMapShrinks(mode) { }, }, function () { - return map(this.output.x + this.output.y + this.thread.z + this.thread.x + this.thread.y + this.thread.z); + return map( + this.output.x + + this.output.y + + this.thread.z + + this.thread.x + + this.thread.y + + this.thread.z + ); }, { dynamicOutput: true } ); @@ -982,17 +1151,26 @@ test('dynamic output 3d kernel map shrinks gpu', () => { dynamicOutput3DKernelMapShrinks('gpu'); }); -(GPU.isWebGLSupported ? test : skip)('dynamic output 3d kernel map shrinks webgl', () => { - dynamicOutput3DKernelMapShrinks('webgl'); -}); - -(GPU.isWebGL2Supported ? test : skip)('dynamic output 3d kernel map shrinks webgl2', () => { - dynamicOutput3DKernelMapShrinks('webgl2'); -}); - -(GPU.isHeadlessGLSupported ? test : skip)('dynamic output 3d kernel map shrinks headlessgl', () => { - dynamicOutput3DKernelMapShrinks('headlessgl'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'dynamic output 3d kernel map shrinks webgl', + () => { + dynamicOutput3DKernelMapShrinks('webgl'); + } +); + +(GPU.isWebGL2Supported ? test : skip)( + 'dynamic output 3d kernel map shrinks webgl2', + () => { + dynamicOutput3DKernelMapShrinks('webgl2'); + } +); + +(GPU.isHeadlessGLSupported ? test : skip)( + 'dynamic output 3d kernel map shrinks headlessgl', + () => { + dynamicOutput3DKernelMapShrinks('headlessgl'); + } +); test('dynamic output 3d kernel map shrinks cpu', () => { dynamicOutput3DKernelMapShrinks('cpu'); diff --git a/test/features/function-return.js b/test/features/function-return.js index 6a919a9b..fcf92180 100644 --- a/test/features/function-return.js +++ b/test/features/function-return.js @@ -66,17 +66,26 @@ function functionReturnArray2(mode) { functionReturnArray2('gpu'); }); -(GPU.isWebGLSupported && GPU.isSinglePrecisionSupported ? test : skip)('Array(2) webgl', () => { - functionReturnArray2('webgl'); -}); - -(GPU.isWebGL2Supported && GPU.isSinglePrecisionSupported ? test : skip)('Array(2) webgl2', () => { - functionReturnArray2('webgl2'); -}); - -(GPU.isHeadlessGLSupported && GPU.isSinglePrecisionSupported ? test : skip)('Array(2) headlessgl', () => { - functionReturnArray2('headlessgl'); -}); +(GPU.isWebGLSupported && GPU.isSinglePrecisionSupported ? test : skip)( + 'Array(2) webgl', + () => { + functionReturnArray2('webgl'); + } +); + +(GPU.isWebGL2Supported && GPU.isSinglePrecisionSupported ? test : skip)( + 'Array(2) webgl2', + () => { + functionReturnArray2('webgl2'); + } +); + +(GPU.isHeadlessGLSupported && GPU.isSinglePrecisionSupported ? test : skip)( + 'Array(2) headlessgl', + () => { + functionReturnArray2('headlessgl'); + } +); test('Array(2) cpu', () => { functionReturnArray2('cpu'); @@ -108,17 +117,26 @@ function functionReturnArray3(mode) { functionReturnArray3('gpu'); }); -(GPU.isWebGLSupported && GPU.isSinglePrecisionSupported ? test : skip)('Array(3) webgl', () => { - functionReturnArray3('webgl'); -}); +(GPU.isWebGLSupported && GPU.isSinglePrecisionSupported ? test : skip)( + 'Array(3) webgl', + () => { + functionReturnArray3('webgl'); + } +); -(GPU.isWebGL2Supported && GPU.isSinglePrecisionSupported ? test : skip)('Array(3) webgl2', () => { - functionReturnArray3('webgl2'); -}); +(GPU.isWebGL2Supported && GPU.isSinglePrecisionSupported ? test : skip)( + 'Array(3) webgl2', + () => { + functionReturnArray3('webgl2'); + } +); -(GPU.isHeadlessGLSupported && GPU.isSinglePrecisionSupported ? test : skip)('Array(3) headlessgl', () => { - functionReturnArray3('headlessgl'); -}); +(GPU.isHeadlessGLSupported && GPU.isSinglePrecisionSupported ? test : skip)( + 'Array(3) headlessgl', + () => { + functionReturnArray3('headlessgl'); + } +); test('Array(3) cpu', () => { functionReturnArray3('cpu'); @@ -152,17 +170,26 @@ function functionReturnArray4(mode) { functionReturnArray4('gpu'); }); -(GPU.isWebGLSupported && GPU.isSinglePrecisionSupported ? test : skip)('Array(4) webgl', () => { - functionReturnArray4('webgl'); -}); +(GPU.isWebGLSupported && GPU.isSinglePrecisionSupported ? test : skip)( + 'Array(4) webgl', + () => { + functionReturnArray4('webgl'); + } +); -(GPU.isWebGL2Supported && GPU.isSinglePrecisionSupported ? test : skip)('Array(4) webgl2', () => { - functionReturnArray4('webgl2'); -}); +(GPU.isWebGL2Supported && GPU.isSinglePrecisionSupported ? test : skip)( + 'Array(4) webgl2', + () => { + functionReturnArray4('webgl2'); + } +); -(GPU.isHeadlessGLSupported && GPU.isSinglePrecisionSupported ? test : skip)('Array(4) headlessgl', () => { - functionReturnArray4('headlessgl'); -}); +(GPU.isHeadlessGLSupported && GPU.isSinglePrecisionSupported ? test : skip)( + 'Array(4) headlessgl', + () => { + functionReturnArray4('headlessgl'); + } +); test('Array(4) cpu', () => { functionReturnArray4('cpu'); @@ -176,7 +203,12 @@ function functionReturnArray4MemberExpression(mode) { return pixel; function toIntArray4(pixel) { - return [pixel[0] * 255, pixel[1] * 255, pixel[2] * 255, pixel[3] * 255]; + return [ + pixel[0] * 255, + pixel[1] * 255, + pixel[2] * 255, + pixel[3] * 255, + ]; } }, { diff --git a/test/features/get-pixels.js b/test/features/get-pixels.js index 5f4e4624..71c871e1 100644 --- a/test/features/get-pixels.js +++ b/test/features/get-pixels.js @@ -7,7 +7,11 @@ function getPixelsStandard(mode) { const gpu = new GPU({ mode }); const kernel = gpu.createKernel( function (v) { - this.color(v[this.thread.y][this.thread.x][0], v[this.thread.y][this.thread.x][1], v[this.thread.y][this.thread.x][2]); + this.color( + v[this.thread.y][this.thread.x][0], + v[this.thread.y][this.thread.x][1], + v[this.thread.y][this.thread.x][2] + ); }, { output: [2, 2], @@ -31,39 +35,61 @@ function getPixelsStandard(mode) { test('standard auto', () => { const pixels = getPixelsStandard(); - assert.deepEqual(pixels, [46, 51, 56, 255, 66, 71, 76, 255, 5, 10, 15, 255, 25, 31, 36, 255]); + assert.deepEqual( + pixels, + [46, 51, 56, 255, 66, 71, 76, 255, 5, 10, 15, 255, 25, 31, 36, 255] + ); }); test('standard gpu', () => { const pixels = getPixelsStandard('gpu'); - assert.deepEqual(pixels, [46, 51, 56, 255, 66, 71, 76, 255, 5, 10, 15, 255, 25, 31, 36, 255]); + assert.deepEqual( + pixels, + [46, 51, 56, 255, 66, 71, 76, 255, 5, 10, 15, 255, 25, 31, 36, 255] + ); }); (GPU.isWebGLSupported ? test : skip)('standard webgl', () => { const pixels = getPixelsStandard('webgl'); - assert.deepEqual(pixels, [46, 51, 56, 255, 66, 71, 76, 255, 5, 10, 15, 255, 25, 31, 36, 255]); + assert.deepEqual( + pixels, + [46, 51, 56, 255, 66, 71, 76, 255, 5, 10, 15, 255, 25, 31, 36, 255] + ); }); (GPU.isWebGL2Supported ? test : skip)('standard webgl2', () => { const pixels = getPixelsStandard('webgl2'); - assert.deepEqual(pixels, [46, 51, 56, 255, 66, 71, 76, 255, 5, 10, 15, 255, 25, 31, 36, 255]); + assert.deepEqual( + pixels, + [46, 51, 56, 255, 66, 71, 76, 255, 5, 10, 15, 255, 25, 31, 36, 255] + ); }); (GPU.isHeadlessGLSupported ? test : skip)('standard headlessgl', () => { const pixels = getPixelsStandard('headlessgl'); - assert.deepEqual(pixels, [46, 51, 56, 255, 66, 71, 76, 255, 5, 10, 15, 255, 25, 31, 36, 255]); + assert.deepEqual( + pixels, + [46, 51, 56, 255, 66, 71, 76, 255, 5, 10, 15, 255, 25, 31, 36, 255] + ); }); (GPU.isCanvasSupported ? test : skip)('standard cpu', () => { const pixels = getPixelsStandard('cpu'); - assert.deepEqual(pixels, [45, 51, 56, 255, 66, 71, 76, 255, 5, 10, 15, 255, 25, 30, 35, 255]); + assert.deepEqual( + pixels, + [45, 51, 56, 255, 66, 71, 76, 255, 5, 10, 15, 255, 25, 30, 35, 255] + ); }); function getPixelsFlipped(mode) { const gpu = new GPU({ mode }); const kernel = gpu.createKernel( function (v) { - this.color(v[this.thread.y][this.thread.x][0], v[this.thread.y][this.thread.x][1], v[this.thread.y][this.thread.x][2]); + this.color( + v[this.thread.y][this.thread.x][0], + v[this.thread.y][this.thread.x][1], + v[this.thread.y][this.thread.x][2] + ); }, { output: [2, 2], @@ -87,30 +113,48 @@ function getPixelsFlipped(mode) { test('flipped auto', () => { const pixels = getPixelsFlipped(); - assert.deepEqual(pixels, [5, 10, 15, 255, 25, 31, 36, 255, 46, 51, 56, 255, 66, 71, 76, 255]); + assert.deepEqual( + pixels, + [5, 10, 15, 255, 25, 31, 36, 255, 46, 51, 56, 255, 66, 71, 76, 255] + ); }); test('flipped gpu', () => { const pixels = getPixelsFlipped('gpu'); - assert.deepEqual(pixels, [5, 10, 15, 255, 25, 31, 36, 255, 46, 51, 56, 255, 66, 71, 76, 255]); + assert.deepEqual( + pixels, + [5, 10, 15, 255, 25, 31, 36, 255, 46, 51, 56, 255, 66, 71, 76, 255] + ); }); (GPU.isWebGLSupported ? test : skip)('flipped webgl', () => { const pixels = getPixelsFlipped('webgl'); - assert.deepEqual(pixels, [5, 10, 15, 255, 25, 31, 36, 255, 46, 51, 56, 255, 66, 71, 76, 255]); + assert.deepEqual( + pixels, + [5, 10, 15, 255, 25, 31, 36, 255, 46, 51, 56, 255, 66, 71, 76, 255] + ); }); (GPU.isWebGL2Supported ? test : skip)('flipped webgl2', () => { const pixels = getPixelsFlipped('webgl2'); - assert.deepEqual(pixels, [5, 10, 15, 255, 25, 31, 36, 255, 46, 51, 56, 255, 66, 71, 76, 255]); + assert.deepEqual( + pixels, + [5, 10, 15, 255, 25, 31, 36, 255, 46, 51, 56, 255, 66, 71, 76, 255] + ); }); (GPU.isHeadlessGLSupported ? test : skip)('flipped headlessgl', () => { const pixels = getPixelsFlipped('headlessgl'); - assert.deepEqual(pixels, [5, 10, 15, 255, 25, 31, 36, 255, 46, 51, 56, 255, 66, 71, 76, 255]); + assert.deepEqual( + pixels, + [5, 10, 15, 255, 25, 31, 36, 255, 46, 51, 56, 255, 66, 71, 76, 255] + ); }); (GPU.isCanvasSupported ? test : skip)('flipped cpu', () => { const pixels = getPixelsFlipped('cpu'); - assert.deepEqual(pixels, [5, 10, 15, 255, 25, 30, 35, 255, 45, 51, 56, 255, 66, 71, 76, 255]); + assert.deepEqual( + pixels, + [5, 10, 15, 255, 25, 30, 35, 255, 45, 51, 56, 255, 66, 71, 76, 255] + ); }); diff --git a/test/features/if-else.js b/test/features/if-else.js index fb67e1fd..48ed92e3 100644 --- a/test/features/if-else.js +++ b/test/features/if-else.js @@ -69,7 +69,11 @@ function ifElseLookupTest(mode) { ); assert.ok(f !== null, 'function generated test'); - assert.deepEqual(Array.from(f([1, 1, 0, 0])), [0, 0, 1, 1], 'basic return function test'); + assert.deepEqual( + Array.from(f([1, 1, 0, 0])), + [0, 0, 1, 1], + 'basic return function test' + ); gpu.destroy(); } @@ -115,7 +119,11 @@ function ifElseIfTest(mode) { output: [2], } ); - assert.deepEqual(Array.from(f([-1, 1])), [0.5, 0], 'basic return function test'); + assert.deepEqual( + Array.from(f([-1, 1])), + [0.5, 0], + 'basic return function test' + ); gpu.destroy(); } diff --git a/test/features/image.js b/test/features/image.js index b136fad4..2a356d77 100644 --- a/test/features/image.js +++ b/test/features/image.js @@ -33,13 +33,19 @@ function imageArgumentTest(mode, done) { imageArgumentTest('gpu', t.async()); }); -(GPU.isWebGLSupported && typeof Image !== 'undefined' ? test : skip)('image argument webgl', t => { - imageArgumentTest('webgl', t.async()); -}); +(GPU.isWebGLSupported && typeof Image !== 'undefined' ? test : skip)( + 'image argument webgl', + t => { + imageArgumentTest('webgl', t.async()); + } +); -(GPU.isWebGL2Supported && typeof Image !== 'undefined' ? test : skip)('image argument webgl2', t => { - imageArgumentTest('webgl2', t.async()); -}); +(GPU.isWebGL2Supported && typeof Image !== 'undefined' ? test : skip)( + 'image argument webgl2', + t => { + imageArgumentTest('webgl2', t.async()); + } +); (typeof Image !== 'undefined' ? test : skip)('image argument cpu', t => { imageArgumentTest('cpu', t.async()); diff --git a/test/features/infinity.js b/test/features/infinity.js index ae71e549..00d6dbff 100644 --- a/test/features/infinity.js +++ b/test/features/infinity.js @@ -38,9 +38,12 @@ test('Infinity without float gpu', () => { inputWithoutFloat(v => assert.deepEqual(v[0], NaN), 'webgl2'); }); -(GPU.isHeadlessGLSupported ? test : skip)('Infinity without float headlessgl', () => { - inputWithoutFloat(v => assert.deepEqual(v[0], NaN), 'headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'Infinity without float headlessgl', + () => { + inputWithoutFloat(v => assert.deepEqual(v[0], NaN), 'headlessgl'); + } +); function inputWithFloat(checks, mode) { const gpu = new GPU({ mode }); @@ -57,26 +60,53 @@ function inputWithFloat(checks, mode) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported ? test : skip)('Infinity with float auto', () => { - inputWithFloat(v => assert.deepEqual(v[0], 3.4028234663852886e38)); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'Infinity with float auto', + () => { + inputWithFloat(v => assert.deepEqual(v[0], 3.4028234663852886e38)); + } +); -(GPU.isSinglePrecisionSupported ? test : skip)('Infinity with float cpu', () => { - inputWithFloat(v => assert.deepEqual(v[0], Infinity), 'cpu'); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'Infinity with float cpu', + () => { + inputWithFloat(v => assert.deepEqual(v[0], Infinity), 'cpu'); + } +); -(GPU.isSinglePrecisionSupported ? test : skip)('Infinity with float gpu', () => { - inputWithFloat(v => assert.deepEqual(v[0], 3.4028234663852886e38), 'gpu'); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'Infinity with float gpu', + () => { + inputWithFloat(v => assert.deepEqual(v[0], 3.4028234663852886e38), 'gpu'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('Infinity with float webgl', () => { - inputWithFloat(v => assert.deepEqual(v[0], 3.4028234663852886e38), 'webgl'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'Infinity with float webgl', + () => { + inputWithFloat( + v => assert.deepEqual(v[0], 3.4028234663852886e38), + 'webgl' + ); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('Infinity with float webgl2', () => { - inputWithFloat(v => assert.deepEqual(v[0], 3.4028234663852886e38), 'webgl2'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'Infinity with float webgl2', + () => { + inputWithFloat( + v => assert.deepEqual(v[0], 3.4028234663852886e38), + 'webgl2' + ); + } +); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('Infinity with float headlessgl', () => { - inputWithFloat(v => assert.deepEqual(v[0], 3.4028234663852886e38), 'headlessgl'); -}); +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'Infinity with float headlessgl', + () => { + inputWithFloat( + v => assert.deepEqual(v[0], 3.4028234663852886e38), + 'headlessgl' + ); + } +); diff --git a/test/features/input.js b/test/features/input.js index 85e76903..bf69dfb7 100644 --- a/test/features/input.js +++ b/test/features/input.js @@ -187,7 +187,9 @@ function inputYXOffsetPlus1(mode) { }) .setOutput([2, 8]); - const a = new Float32Array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]); + const a = new Float32Array([ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, + ]); const result = kernel(input(a, [8, 2])); assert.deepEqual( @@ -224,9 +226,12 @@ test('inputYXOffsetPlus1 gpu', () => { inputYXOffsetPlus1('webgl2'); }); -(GPU.isHeadlessGLSupported ? test : skip)('inputYXOffsetPlus1 headlessgl', () => { - inputYXOffsetPlus1('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'inputYXOffsetPlus1 headlessgl', + () => { + inputYXOffsetPlus1('headlessgl'); + } +); test('inputYXOffsetPlus1 cpu', () => { inputYXOffsetPlus1('cpu'); @@ -241,7 +246,10 @@ function inputZYX(mode) { .setOutput([2, 4, 4]); const a = new Float32Array(32); - a.set([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]); + a.set([ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + ]); const result = kernel(input(a, [2, 4, 4])); assert.deepEqual( @@ -313,7 +321,10 @@ function inputZYXVariables(mode) { .setOutput([1]); const a = new Float32Array(32); - a.set([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]); + a.set([ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + ]); const aInput = input(a, [2, 4, 4]); assert.deepEqual(Array.from(kernel(aInput, 1, 2, 3)), [30]); assert.deepEqual(Array.from(kernel(aInput, 0, 2, 3)), [29]); @@ -339,9 +350,12 @@ test('inputZYXVariables gpu', () => { inputZYXVariables('webgl2'); }); -(GPU.isHeadlessGLSupported ? test : skip)('inputZYXVariables headlessgl', () => { - inputZYXVariables('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'inputZYXVariables headlessgl', + () => { + inputZYXVariables('headlessgl'); + } +); test('inputZYXVariables cpu', () => { inputZYXVariables('cpu'); @@ -386,11 +400,20 @@ test('.toArray() with array', () => { assert.deepEqual(input([1, 2, 3, 4], [4]).toArray(), [1, 2, 3, 4]); }); test('.toArray() with matrix', () => { - assert.deepEqual(input([1, 2, 3, 4, 5, 6, 7, 8], [4, 2]).toArray(), [new Float32Array([1, 2, 3, 4]), new Float32Array([5, 6, 7, 8])]); + assert.deepEqual(input([1, 2, 3, 4, 5, 6, 7, 8], [4, 2]).toArray(), [ + new Float32Array([1, 2, 3, 4]), + new Float32Array([5, 6, 7, 8]), + ]); }); test('.toArray() with grid', () => { - assert.deepEqual(input([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], [4, 2, 2]).toArray(), [ - [new Float32Array([1, 2, 3, 4]), new Float32Array([5, 6, 7, 8])], - [new Float32Array([9, 10, 11, 12]), new Float32Array([13, 14, 15, 16])], - ]); + assert.deepEqual( + input( + [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], + [4, 2, 2] + ).toArray(), + [ + [new Float32Array([1, 2, 3, 4]), new Float32Array([5, 6, 7, 8])], + [new Float32Array([9, 10, 11, 12]), new Float32Array([13, 14, 15, 16])], + ] + ); }); diff --git a/test/features/legacy-encoder.js b/test/features/legacy-encoder.js index 4241d16a..67cfa6bb 100644 --- a/test/features/legacy-encoder.js +++ b/test/features/legacy-encoder.js @@ -1,5 +1,10 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU, HeadlessGLKernel, WebGLKernel, WebGL2Kernel } = require('../../src'); +const { + GPU, + HeadlessGLKernel, + WebGLKernel, + WebGL2Kernel, +} = require('../../src'); describe('features: legacy encoder'); @@ -94,17 +99,26 @@ function testSubKernelsLegacyEncoderOff(mode) { testSubKernelsLegacyEncoderOff(); }); -(GPU.isWebGLSupported && GPU.isKernelMapSupported ? test : skip)('subKernels off webgl', () => { - testSubKernelsLegacyEncoderOff('webgl'); -}); +(GPU.isWebGLSupported && GPU.isKernelMapSupported ? test : skip)( + 'subKernels off webgl', + () => { + testSubKernelsLegacyEncoderOff('webgl'); + } +); -(GPU.isWebGL2Supported && GPU.isKernelMapSupported ? test : skip)('subKernels off webgl2', () => { - testSubKernelsLegacyEncoderOff('webgl2'); -}); +(GPU.isWebGL2Supported && GPU.isKernelMapSupported ? test : skip)( + 'subKernels off webgl2', + () => { + testSubKernelsLegacyEncoderOff('webgl2'); + } +); -(GPU.isHeadlessGLSupported && GPU.isKernelMapSupported ? test : skip)('subKernels off headlessgl', () => { - testSubKernelsLegacyEncoderOff('headlessgl'); -}); +(GPU.isHeadlessGLSupported && GPU.isKernelMapSupported ? test : skip)( + 'subKernels off headlessgl', + () => { + testSubKernelsLegacyEncoderOff('headlessgl'); + } +); test('subKernels off cpu', () => { testSubKernelsLegacyEncoderOff('cpu'); @@ -137,26 +151,36 @@ function testSubKernelsLegacyEncoderOn(mode) { testSubKernelsLegacyEncoderOn(); }); -(GPU.isWebGLSupported && GPU.isKernelMapSupported ? test : skip)('subKernels on webgl', () => { - testSubKernelsLegacyEncoderOn('webgl'); -}); +(GPU.isWebGLSupported && GPU.isKernelMapSupported ? test : skip)( + 'subKernels on webgl', + () => { + testSubKernelsLegacyEncoderOn('webgl'); + } +); -(GPU.isWebGL2Supported && GPU.isKernelMapSupported ? test : skip)('subKernels on webgl2', () => { - testSubKernelsLegacyEncoderOn('webgl2'); -}); +(GPU.isWebGL2Supported && GPU.isKernelMapSupported ? test : skip)( + 'subKernels on webgl2', + () => { + testSubKernelsLegacyEncoderOn('webgl2'); + } +); -(GPU.isHeadlessGLSupported && GPU.isKernelMapSupported ? test : skip)('subKernels on headlessgl', () => { - testSubKernelsLegacyEncoderOn('headlessgl'); -}); +(GPU.isHeadlessGLSupported && GPU.isKernelMapSupported ? test : skip)( + 'subKernels on headlessgl', + () => { + testSubKernelsLegacyEncoderOn('headlessgl'); + } +); test('subKernels on cpu', () => { testSubKernelsLegacyEncoderOn('cpu'); }); test('HeadlessGLKernel.getMainResultKernelPackedPixels useLegacyEncoder = false', () => { - const result = HeadlessGLKernel.prototype.getMainResultKernelPackedPixels.apply({ - useLegacyEncoder: false, - }); + const result = + HeadlessGLKernel.prototype.getMainResultKernelPackedPixels.apply({ + useLegacyEncoder: false, + }); assert.equal( result, ` threadId = indexTo3D(index, uOutputDim); @@ -193,9 +217,10 @@ test('WebGL2Kernel.getMainResultKernelPackedPixels useLegacyEncoder = false', () }); test('HeadlessGLKernel.getMainResultKernelPackedPixels useLegacyEncoder = true', () => { - const result = HeadlessGLKernel.prototype.getMainResultKernelPackedPixels.apply({ - useLegacyEncoder: true, - }); + const result = + HeadlessGLKernel.prototype.getMainResultKernelPackedPixels.apply({ + useLegacyEncoder: true, + }); assert.equal( result, ` threadId = indexTo3D(index, uOutputDim); @@ -232,14 +257,15 @@ test('WebGL2Kernel.getMainResultKernelPackedPixels useLegacyEncoder = true', () }); test('HeadlessGLKernel.getMainResultSubKernelPackedPixels useLegacyEncoder = false', () => { - const result = HeadlessGLKernel.prototype.getMainResultSubKernelPackedPixels.apply({ - useLegacyEncoder: false, - subKernels: [ - { - name: 'subKernel1', - }, - ], - }); + const result = + HeadlessGLKernel.prototype.getMainResultSubKernelPackedPixels.apply({ + useLegacyEncoder: false, + subKernels: [ + { + name: 'subKernel1', + }, + ], + }); assert.equal( result, ` gl_FragData[1] = encode32(subKernelResult_subKernel1); @@ -248,14 +274,15 @@ test('HeadlessGLKernel.getMainResultSubKernelPackedPixels useLegacyEncoder = fal }); test('WebGLKernel.getMainResultSubKernelPackedPixels useLegacyEncoder = false', () => { - const result = WebGLKernel.prototype.getMainResultSubKernelPackedPixels.apply({ - useLegacyEncoder: false, - subKernels: [ - { - name: 'subKernel1', - }, - ], - }); + const result = + WebGLKernel.prototype.getMainResultSubKernelPackedPixels.apply({ + useLegacyEncoder: false, + subKernels: [ + { + name: 'subKernel1', + }, + ], + }); assert.equal( result, ` gl_FragData[1] = encode32(subKernelResult_subKernel1); @@ -264,14 +291,15 @@ test('WebGLKernel.getMainResultSubKernelPackedPixels useLegacyEncoder = false', }); test('WebGL2Kernel.getMainResultSubKernelPackedPixels useLegacyEncoder = false', () => { - const result = WebGL2Kernel.prototype.getMainResultSubKernelPackedPixels.apply({ - useLegacyEncoder: false, - subKernels: [ - { - name: 'subKernel1', - }, - ], - }); + const result = + WebGL2Kernel.prototype.getMainResultSubKernelPackedPixels.apply({ + useLegacyEncoder: false, + subKernels: [ + { + name: 'subKernel1', + }, + ], + }); assert.equal( result, ` data1 = encode32(subKernelResult_subKernel1); @@ -280,14 +308,15 @@ test('WebGL2Kernel.getMainResultSubKernelPackedPixels useLegacyEncoder = false', }); test('HeadlessGLKernel.getMainResultSubKernelPackedPixels useLegacyEncoder = true', () => { - const result = HeadlessGLKernel.prototype.getMainResultSubKernelPackedPixels.apply({ - useLegacyEncoder: true, - subKernels: [ - { - name: 'subKernel1', - }, - ], - }); + const result = + HeadlessGLKernel.prototype.getMainResultSubKernelPackedPixels.apply({ + useLegacyEncoder: true, + subKernels: [ + { + name: 'subKernel1', + }, + ], + }); assert.equal( result, ` gl_FragData[1] = legacyEncode32(subKernelResult_subKernel1); @@ -296,14 +325,15 @@ test('HeadlessGLKernel.getMainResultSubKernelPackedPixels useLegacyEncoder = tru }); test('WebGLKernel.getMainResultSubKernelPackedPixels useLegacyEncoder = true', () => { - const result = WebGLKernel.prototype.getMainResultSubKernelPackedPixels.apply({ - useLegacyEncoder: true, - subKernels: [ - { - name: 'subKernel1', - }, - ], - }); + const result = + WebGLKernel.prototype.getMainResultSubKernelPackedPixels.apply({ + useLegacyEncoder: true, + subKernels: [ + { + name: 'subKernel1', + }, + ], + }); assert.equal( result, ` gl_FragData[1] = legacyEncode32(subKernelResult_subKernel1); @@ -312,14 +342,15 @@ test('WebGLKernel.getMainResultSubKernelPackedPixels useLegacyEncoder = true', ( }); test('WebGL2Kernel.getMainResultSubKernelPackedPixels useLegacyEncoder = true', () => { - const result = WebGL2Kernel.prototype.getMainResultSubKernelPackedPixels.apply({ - useLegacyEncoder: true, - subKernels: [ - { - name: 'subKernel1', - }, - ], - }); + const result = + WebGL2Kernel.prototype.getMainResultSubKernelPackedPixels.apply({ + useLegacyEncoder: true, + subKernels: [ + { + name: 'subKernel1', + }, + ], + }); assert.equal( result, ` data1 = legacyEncode32(subKernelResult_subKernel1); diff --git a/test/features/loops.js b/test/features/loops.js index e06e4caa..7a431685 100644 --- a/test/features/loops.js +++ b/test/features/loops.js @@ -105,9 +105,12 @@ test('forConstantLoopTest gpu', () => { forWithConstantTest('webgl2'); }); -(GPU.isHeadlessGLSupported ? test : skip)('forConstantLoopTest headlessgl', () => { - forWithConstantTest('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'forConstantLoopTest headlessgl', + () => { + forWithConstantTest('headlessgl'); + } +); test('forConstantLoopTest cpu', () => { forWithConstantTest('cpu'); @@ -241,10 +244,13 @@ function evilWhileLoopTest(mode) { const evil_while_a = [1, 2, 3, 5, 6, 7]; const evil_while_b = [4, 5, 6, 1, 2, 3]; const evil_while_cpuRef = new GPU({ mode: 'cpu' }); - const evil_while_cpuRef_f = evil_while_cpuRef.createKernel(evilWhileKernelFunction, { - output: [6], - loopMaxIterations: 10000, - }); + const evil_while_cpuRef_f = evil_while_cpuRef.createKernel( + evilWhileKernelFunction, + { + output: [6], + loopMaxIterations: 10000, + } + ); const evil_while_exp = evil_while_cpuRef_f(evil_while_a, evil_while_b); const gpu = new GPU({ mode }); diff --git a/test/features/math-object.js b/test/features/math-object.js index a3aeb191..2a18d369 100644 --- a/test/features/math-object.js +++ b/test/features/math-object.js @@ -4,7 +4,16 @@ const { GPU } = require('../../src'); describe('features: math object'); function mathProps(mode) { - const props = ['E', 'LN10', 'LN2', 'LOG10E', 'LOG2E', 'PI', 'SQRT1_2', 'SQRT2']; + const props = [ + 'E', + 'LN10', + 'LN2', + 'LOG10E', + 'LOG2E', + 'PI', + 'SQRT1_2', + 'SQRT2', + ]; const gpu = new GPU({ mode }); for (let i = 0; i < props.length; i++) { const prop = props[i]; @@ -35,9 +44,12 @@ test('All Math properties gpu', () => { mathProps('webgl2'); }); -(GPU.isHeadlessGLSupported ? test : skip)('All Math properties headlessgl', () => { - mathProps('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'All Math properties headlessgl', + () => { + mathProps('headlessgl'); + } +); test('All Math properties cpu', () => { mathProps('cpu'); @@ -86,7 +98,11 @@ function singleArgumentMathMethods(mode) { { output: [1] } ); for (let j = 0; j < 10; j++) { - assert.equal(kernel(j / 10)[0].toFixed(3), Math[method](j / 10).toFixed(3), `Math.${method}(${j / 10})`); + assert.equal( + kernel(j / 10)[0].toFixed(3), + Math[method](j / 10).toFixed(3), + `Math.${method}(${j / 10})` + ); } } gpu.destroy(); @@ -100,17 +116,26 @@ test('Single argument Math methods gpu', () => { singleArgumentMathMethods('gpu'); }); -(GPU.isWebGLSupported ? test : skip)('Single argument Math methods webgl', () => { - singleArgumentMathMethods('webgl'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'Single argument Math methods webgl', + () => { + singleArgumentMathMethods('webgl'); + } +); -(GPU.isWebGL2Supported ? test : skip)('Single argument Math methods webgl2', () => { - singleArgumentMathMethods('webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'Single argument Math methods webgl2', + () => { + singleArgumentMathMethods('webgl2'); + } +); -(GPU.isHeadlessGLSupported ? test : skip)('Single argument Math methods headlessgl', () => { - singleArgumentMathMethods('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'Single argument Math methods headlessgl', + () => { + singleArgumentMathMethods('headlessgl'); + } +); test('Single argument Math methods cpu', () => { singleArgumentMathMethods('cpu'); @@ -131,7 +156,11 @@ function twoArgumentMathMethods(mode) { for (let j = 0; j < 10; j++) { const value1 = j / 10; const value2 = value1; - assert.equal(kernel(value1, value2)[0].toFixed(3), Math[method](value1, value2).toFixed(3), `Math.${method}(${value1}, ${value2})`); + assert.equal( + kernel(value1, value2)[0].toFixed(3), + Math[method](value1, value2).toFixed(3), + `Math.${method}(${value1}, ${value2})` + ); } } gpu.destroy(); @@ -149,13 +178,19 @@ test('Two argument Math methods gpu', () => { twoArgumentMathMethods('webgl'); }); -(GPU.isWebGL2Supported ? test : skip)('Two argument Math methods webgl2', () => { - twoArgumentMathMethods('webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'Two argument Math methods webgl2', + () => { + twoArgumentMathMethods('webgl2'); + } +); -(GPU.isHeadlessGLSupported ? test : skip)('Two argument Math methods headlessgl', () => { - twoArgumentMathMethods('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'Two argument Math methods headlessgl', + () => { + twoArgumentMathMethods('headlessgl'); + } +); test('Two argument Math methods cpu', () => { twoArgumentMathMethods('cpu'); @@ -215,7 +250,10 @@ function mathRandom(mode) { ); const result = kernel(); - assert.ok(result[0] > 0 && result[0] < 1, `value was expected to be between o and 1, but was ${result[0]}`); + assert.ok( + result[0] > 0 && result[0] < 1, + `value was expected to be between o and 1, but was ${result[0]}` + ); } test('random auto', () => { diff --git a/test/features/nested-function.js b/test/features/nested-function.js index fc3998be..a5d753df 100644 --- a/test/features/nested-function.js +++ b/test/features/nested-function.js @@ -90,9 +90,12 @@ test('nested in custom gpu', () => { testNestedInCustomFunction('webgl2'); }); -(GPU.isHeadlessGLSupported ? test : skip)('nested in custom headlessgl', () => { - testNestedInCustomFunction('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'nested in custom headlessgl', + () => { + testNestedInCustomFunction('headlessgl'); + } +); test('nested in custom cpu', () => { testNestedInCustomFunction('cpu'); diff --git a/test/features/offscreen-canvas.js b/test/features/offscreen-canvas.js index df0742e4..42e2bd46 100644 --- a/test/features/offscreen-canvas.js +++ b/test/features/offscreen-canvas.js @@ -29,21 +29,30 @@ if (typeof importScripts !== 'undefined') { worker.postMessage(mode); } - (GPU.isOffscreenCanvasSupported ? test : skip)('offscreen canvas auto', t => { - testOffscreenCanvas(null, t.async()); - }); + (GPU.isOffscreenCanvasSupported ? test : skip)( + 'offscreen canvas auto', + t => { + testOffscreenCanvas(null, t.async()); + } + ); (GPU.isOffscreenCanvasSupported ? test : skip)('offscreen canvas gpu', t => { testOffscreenCanvas('gpu', t.async()); }); - (GPU.isOffscreenCanvasSupported ? test : skip)('offscreen canvas webgl', t => { - testOffscreenCanvas('webgl', t.async()); - }); + (GPU.isOffscreenCanvasSupported ? test : skip)( + 'offscreen canvas webgl', + t => { + testOffscreenCanvas('webgl', t.async()); + } + ); - (GPU.isOffscreenCanvasSupported ? test : skip)('offscreen canvas webgl2', t => { - testOffscreenCanvas('webgl2', t.async()); - }); + (GPU.isOffscreenCanvasSupported ? test : skip)( + 'offscreen canvas webgl2', + t => { + testOffscreenCanvas('webgl2', t.async()); + } + ); (GPU.isOffscreenCanvasSupported ? test : skip)('offscreen canvas cpu', t => { testOffscreenCanvas('cpu', t.async()); diff --git a/test/features/optimize-float-memory.js b/test/features/optimize-float-memory.js index 9ef6366c..8875420b 100644 --- a/test/features/optimize-float-memory.js +++ b/test/features/optimize-float-memory.js @@ -21,18 +21,30 @@ function whenEnabledCallsCorrectRenderFunction(mode) { assert.equal(result[0], 1); } -(GPU.isSinglePrecisionSupported && GPU.isGPUSupported ? test : skip)('when enabled calls correct render function gpu (GPU ONLY)', () => { - whenEnabledCallsCorrectRenderFunction('gpu'); -}); -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('when enabled calls correct render function webgl (GPU ONLY)', () => { - whenEnabledCallsCorrectRenderFunction('webgl'); -}); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('when enabled calls correct render function webgl2 (GPU ONLY)', () => { - whenEnabledCallsCorrectRenderFunction('webgl2'); -}); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('when enabled calls correct render function headlessgl (GPU ONLY)', () => { - whenEnabledCallsCorrectRenderFunction('headlessgl'); -}); +(GPU.isSinglePrecisionSupported && GPU.isGPUSupported ? test : skip)( + 'when enabled calls correct render function gpu (GPU ONLY)', + () => { + whenEnabledCallsCorrectRenderFunction('gpu'); + } +); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'when enabled calls correct render function webgl (GPU ONLY)', + () => { + whenEnabledCallsCorrectRenderFunction('webgl'); + } +); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'when enabled calls correct render function webgl2 (GPU ONLY)', + () => { + whenEnabledCallsCorrectRenderFunction('webgl2'); + } +); +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'when enabled calls correct render function headlessgl (GPU ONLY)', + () => { + whenEnabledCallsCorrectRenderFunction('headlessgl'); + } +); function whenEnabledCallsCorrectRenderFunction2D(mode) { const gpu = new GPU({ mode }); @@ -58,18 +70,30 @@ function whenEnabledCallsCorrectRenderFunction2D(mode) { ); } -(GPU.isSinglePrecisionSupported && GPU.isGPUSupported ? test : skip)('when enabled calls correct render function 2d gpu (GPU ONLY)', () => { - whenEnabledCallsCorrectRenderFunction2D('gpu'); -}); -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('when enabled calls correct render function 2d webgl (GPU ONLY)', () => { - whenEnabledCallsCorrectRenderFunction2D('webgl'); -}); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('when enabled calls correct render function 2d webgl2 (GPU ONLY)', () => { - whenEnabledCallsCorrectRenderFunction2D('webgl2'); -}); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('when enabled calls correct render function 2d headlessgl (GPU ONLY)', () => { - whenEnabledCallsCorrectRenderFunction2D('headlessgl'); -}); +(GPU.isSinglePrecisionSupported && GPU.isGPUSupported ? test : skip)( + 'when enabled calls correct render function 2d gpu (GPU ONLY)', + () => { + whenEnabledCallsCorrectRenderFunction2D('gpu'); + } +); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'when enabled calls correct render function 2d webgl (GPU ONLY)', + () => { + whenEnabledCallsCorrectRenderFunction2D('webgl'); + } +); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'when enabled calls correct render function 2d webgl2 (GPU ONLY)', + () => { + whenEnabledCallsCorrectRenderFunction2D('webgl2'); + } +); +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'when enabled calls correct render function 2d headlessgl (GPU ONLY)', + () => { + whenEnabledCallsCorrectRenderFunction2D('headlessgl'); + } +); function whenEnabledCallsCorrectRenderFunction3D(mode) { const gpu = new GPU({ mode }); @@ -101,18 +125,30 @@ function whenEnabledCallsCorrectRenderFunction3D(mode) { ); } -(GPU.isSinglePrecisionSupported && GPU.isGPUSupported ? test : skip)('when enabled calls correct render function 3d gpu (GPU ONLY)', () => { - whenEnabledCallsCorrectRenderFunction3D('gpu'); -}); -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('when enabled calls correct render function 3d webgl (GPU ONLY)', () => { - whenEnabledCallsCorrectRenderFunction3D('webgl'); -}); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('when enabled calls correct render function 3d webgl2 (GPU ONLY)', () => { - whenEnabledCallsCorrectRenderFunction3D('webgl2'); -}); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('when enabled calls correct render function 3d headlessgl (GPU ONLY)', () => { - whenEnabledCallsCorrectRenderFunction3D('headlessgl'); -}); +(GPU.isSinglePrecisionSupported && GPU.isGPUSupported ? test : skip)( + 'when enabled calls correct render function 3d gpu (GPU ONLY)', + () => { + whenEnabledCallsCorrectRenderFunction3D('gpu'); + } +); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'when enabled calls correct render function 3d webgl (GPU ONLY)', + () => { + whenEnabledCallsCorrectRenderFunction3D('webgl'); + } +); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'when enabled calls correct render function 3d webgl2 (GPU ONLY)', + () => { + whenEnabledCallsCorrectRenderFunction3D('webgl2'); + } +); +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'when enabled calls correct render function 3d headlessgl (GPU ONLY)', + () => { + whenEnabledCallsCorrectRenderFunction3D('headlessgl'); + } +); function singlePrecision(mode) { const gpu = new GPU({ mode }); @@ -132,25 +168,40 @@ function singlePrecision(mode) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported && GPU.isGPUSupported ? test : skip)('single precision auto', () => { - singlePrecision(); -}); - -(GPU.isSinglePrecisionSupported && GPU.isGPUSupported ? test : skip)('single precision gpu', () => { - singlePrecision('gpu'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('single precision webgl', () => { - singlePrecision('webgl'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('single precision webgl2', () => { - singlePrecision('webgl2'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('single precision headlessgl', () => { - singlePrecision('headlessgl'); -}); +(GPU.isSinglePrecisionSupported && GPU.isGPUSupported ? test : skip)( + 'single precision auto', + () => { + singlePrecision(); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isGPUSupported ? test : skip)( + 'single precision gpu', + () => { + singlePrecision('gpu'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'single precision webgl', + () => { + singlePrecision('webgl'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'single precision webgl2', + () => { + singlePrecision('webgl2'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'single precision headlessgl', + () => { + singlePrecision('headlessgl'); + } +); test('single precision cpu', () => { singlePrecision('cpu'); @@ -185,21 +236,33 @@ function float2DOutput(mode) { float2DOutput(); }); -(GPU.isSinglePrecisionSupported && GPU.isGPUSupported ? test : skip)('float 2d output gpu', () => { - float2DOutput('gpu'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('float 2d output webgl', () => { - float2DOutput('webgl'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('float 2d output webgl2', () => { - float2DOutput('webgl2'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('float 2d output headlessgl', () => { - float2DOutput('headlessgl'); -}); +(GPU.isSinglePrecisionSupported && GPU.isGPUSupported ? test : skip)( + 'float 2d output gpu', + () => { + float2DOutput('gpu'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'float 2d output webgl', + () => { + float2DOutput('webgl'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'float 2d output webgl2', + () => { + float2DOutput('webgl2'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'float 2d output headlessgl', + () => { + float2DOutput('headlessgl'); + } +); test('float 2d output cpu', () => { float2DOutput('cpu'); @@ -241,21 +304,33 @@ function float3DOutput(mode) { float3DOutput(); }); -(GPU.isSinglePrecisionSupported && GPU.isGPUSupported ? test : skip)('float 3d output gpu', () => { - float3DOutput('gpu'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('float 3d output webgl', () => { - float3DOutput('webgl'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('float 3d output webgl2', () => { - float3DOutput('webgl2'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('float 3d output headlessgl', () => { - float3DOutput('headlessgl'); -}); +(GPU.isSinglePrecisionSupported && GPU.isGPUSupported ? test : skip)( + 'float 3d output gpu', + () => { + float3DOutput('gpu'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'float 3d output webgl', + () => { + float3DOutput('webgl'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'float 3d output webgl2', + () => { + float3DOutput('webgl2'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'float 3d output headlessgl', + () => { + float3DOutput('headlessgl'); + } +); test('float 3d output cpu', () => { float3DOutput('cpu'); @@ -280,21 +355,33 @@ function floatPipelineOutput(mode) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported && GPU.isGPUSupported ? test : skip)('float pipeline output gpu (GPU only)', () => { - floatPipelineOutput('gpu'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('float pipeline output webgl (GPU only)', () => { - floatPipelineOutput('webgl'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('float pipeline output webgl2 (GPU only)', () => { - floatPipelineOutput('webgl2'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('float pipeline output headlessgl (GPU only)', () => { - floatPipelineOutput('headlessgl'); -}); +(GPU.isSinglePrecisionSupported && GPU.isGPUSupported ? test : skip)( + 'float pipeline output gpu (GPU only)', + () => { + floatPipelineOutput('gpu'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'float pipeline output webgl (GPU only)', + () => { + floatPipelineOutput('webgl'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'float pipeline output webgl2 (GPU only)', + () => { + floatPipelineOutput('webgl2'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'float pipeline output headlessgl (GPU only)', + () => { + floatPipelineOutput('headlessgl'); + } +); function floatPipeline2DOutput(mode) { const gpu = new GPU({ mode }); @@ -323,21 +410,33 @@ function floatPipeline2DOutput(mode) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported && GPU.isGPUSupported ? test : skip)('float pipeline 2d output gpu (GPU Only)', () => { - floatPipeline2DOutput('gpu'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('float pipeline 2d output webgl (GPU Only)', () => { - floatPipeline2DOutput('webgl'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('float pipeline 2d output webgl2 (GPU Only)', () => { - floatPipeline2DOutput('webgl2'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('float pipeline 2d output headlessgl (GPU Only)', () => { - floatPipeline2DOutput('headlessgl'); -}); +(GPU.isSinglePrecisionSupported && GPU.isGPUSupported ? test : skip)( + 'float pipeline 2d output gpu (GPU Only)', + () => { + floatPipeline2DOutput('gpu'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'float pipeline 2d output webgl (GPU Only)', + () => { + floatPipeline2DOutput('webgl'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'float pipeline 2d output webgl2 (GPU Only)', + () => { + floatPipeline2DOutput('webgl2'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'float pipeline 2d output headlessgl (GPU Only)', + () => { + floatPipeline2DOutput('headlessgl'); + } +); function floatPipeline3DOutput(mode) { const gpu = new GPU({ mode }); @@ -372,18 +471,31 @@ function floatPipeline3DOutput(mode) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported && GPU.isGPUSupported ? test : skip)('float pipeline 3d output gpu (GPU only)', () => { - floatPipeline3DOutput('gpu'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('float pipeline 3d output webgl (GPU only)', () => { - floatPipeline3DOutput('webgl'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('float pipeline 3d output webgl2 (GPU only)', () => { +(GPU.isSinglePrecisionSupported && GPU.isGPUSupported ? test : skip)( + 'float pipeline 3d output gpu (GPU only)', + () => { + floatPipeline3DOutput('gpu'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'float pipeline 3d output webgl (GPU only)', + () => { + floatPipeline3DOutput('webgl'); + } +); + +(GPU.isSinglePrecisionSupported && + GPU.isSinglePrecisionSupported && + GPU.isWebGL2Supported + ? test + : skip)('float pipeline 3d output webgl2 (GPU only)', () => { floatPipeline3DOutput('webgl2'); }); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('float pipeline 3d output headlessgl (GPU only)', () => { - floatPipeline3DOutput('headlessgl'); -}); +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'float pipeline 3d output headlessgl (GPU only)', + () => { + floatPipeline3DOutput('headlessgl'); + } +); diff --git a/test/features/output.js b/test/features/output.js index be431205..07cfcbb9 100644 --- a/test/features/output.js +++ b/test/features/output.js @@ -205,9 +205,12 @@ test('graphical output array gpu', () => { outputGraphicalArray('webgl2'); }); -(GPU.isHeadlessGLSupported ? test : skip)('graphical output array headlessgl', () => { - outputGraphicalArray('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'graphical output array headlessgl', + () => { + outputGraphicalArray('headlessgl'); + } +); test('graphical output array cpu', () => { outputGraphicalArray('cpu'); @@ -242,25 +245,55 @@ function outputGraphicalMatrix(mode, canvas, context) { const canvas = document.createElement('canvas'); const context = canvas.getContext('webgl', { premultipliedAlpha: false }); const pixels = outputGraphicalMatrix('webgl', canvas, context); - assert.deepEqual(pixels, [191, 191, 191, 191, 255, 255, 255, 255, 64, 64, 64, 64, 128, 128, 128, 128]); + assert.deepEqual( + pixels, + [ + 191, 191, 191, 191, 255, 255, 255, 255, 64, 64, 64, 64, 128, 128, 128, + 128, + ] + ); }); (GPU.isWebGL2Supported ? test : skip)('graphical output matrix webgl2', () => { const canvas = document.createElement('canvas'); const context = canvas.getContext('webgl2', { premultipliedAlpha: false }); const pixels = outputGraphicalMatrix('webgl2', canvas, context); - assert.deepEqual(pixels, [191, 191, 191, 191, 255, 255, 255, 255, 64, 64, 64, 64, 128, 128, 128, 128]); -}); - -(GPU.isHeadlessGLSupported ? test : skip)('graphical output matrix headlessgl', () => { - const pixels = outputGraphicalMatrix('headlessgl'); - assert.deepEqual(pixels, [191, 191, 191, 191, 255, 255, 255, 255, 64, 64, 64, 64, 128, 128, 128, 128]); + assert.deepEqual( + pixels, + [ + 191, 191, 191, 191, 255, 255, 255, 255, 64, 64, 64, 64, 128, 128, 128, + 128, + ] + ); }); -(GPU.isCanvasSupported ? test : skip)('graphical output matrix cpu with real canvas', () => { - const pixels = outputGraphicalMatrix('cpu'); - assert.deepEqual(pixels, [191, 191, 191, 191, 255, 255, 255, 255, 63, 63, 63, 63, 127, 127, 127, 127]); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'graphical output matrix headlessgl', + () => { + const pixels = outputGraphicalMatrix('headlessgl'); + assert.deepEqual( + pixels, + [ + 191, 191, 191, 191, 255, 255, 255, 255, 64, 64, 64, 64, 128, 128, 128, + 128, + ] + ); + } +); + +(GPU.isCanvasSupported ? test : skip)( + 'graphical output matrix cpu with real canvas', + () => { + const pixels = outputGraphicalMatrix('cpu'); + assert.deepEqual( + pixels, + [ + 191, 191, 191, 191, 255, 255, 255, 255, 63, 63, 63, 63, 127, 127, 127, + 127, + ] + ); + } +); test('graphical output matrix cpu with mocked canvas', () => { // allow tests on node or browser @@ -283,7 +316,13 @@ test('graphical output matrix cpu with mocked canvas', () => { getContext: () => mockContext, }; const pixels = outputGraphicalMatrix('cpu', mockCanvas, mockContext); - assert.deepEqual(pixels, [191, 191, 191, 191, 255, 255, 255, 255, 63, 63, 63, 63, 127, 127, 127, 127]); + assert.deepEqual( + pixels, + [ + 191, 191, 191, 191, 255, 255, 255, 255, 63, 63, 63, 63, 127, 127, 127, + 127, + ] + ); }); function outputGraphicalCube(mode) { @@ -326,9 +365,12 @@ test('graphical output array gpu', () => { outputGraphicalCube('webgl2'); }); -(GPU.isHeadlessGLSupported ? test : skip)('graphical output array headlessgl', () => { - outputGraphicalCube('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'graphical output array headlessgl', + () => { + outputGraphicalCube('headlessgl'); + } +); test('graphical output array cpu', () => { outputGraphicalCube('cpu'); diff --git a/test/features/raw-output.js b/test/features/raw-output.js index c00ae952..a4602fc1 100644 --- a/test/features/raw-output.js +++ b/test/features/raw-output.js @@ -26,21 +26,33 @@ test('raw unsigned precision render output auto', () => { rawUnsignedPrecisionRenderOutput(); }); -(GPU.isGPUSupported ? test : skip)('raw unsigned precision render output gpu', () => { - rawUnsignedPrecisionRenderOutput('gpu'); -}); +(GPU.isGPUSupported ? test : skip)( + 'raw unsigned precision render output gpu', + () => { + rawUnsignedPrecisionRenderOutput('gpu'); + } +); -(GPU.isWebGLSupported ? test : skip)('raw unsigned precision render output webgl', () => { - rawUnsignedPrecisionRenderOutput('webgl'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'raw unsigned precision render output webgl', + () => { + rawUnsignedPrecisionRenderOutput('webgl'); + } +); -(GPU.isWebGL2Supported ? test : skip)('raw unsigned precision render output webgl2', () => { - rawUnsignedPrecisionRenderOutput('webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'raw unsigned precision render output webgl2', + () => { + rawUnsignedPrecisionRenderOutput('webgl2'); + } +); -(GPU.isHeadlessGLSupported ? test : skip)('raw unsigned precision render output headlessgl', () => { - rawUnsignedPrecisionRenderOutput('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'raw unsigned precision render output headlessgl', + () => { + rawUnsignedPrecisionRenderOutput('headlessgl'); + } +); test('raw unsigned precision render output cpu', () => { assert.throws(() => { @@ -75,25 +87,40 @@ function rawSinglePrecisionRenderOutput(mode) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported ? test : skip)('raw single precision render output auto', () => { - rawSinglePrecisionRenderOutput(); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'raw single precision render output auto', + () => { + rawSinglePrecisionRenderOutput(); + } +); -(GPU.isGPUSupported && GPU.isSinglePrecisionSupported ? test : skip)('raw single precision render output gpu', () => { - rawSinglePrecisionRenderOutput('gpu'); -}); +(GPU.isGPUSupported && GPU.isSinglePrecisionSupported ? test : skip)( + 'raw single precision render output gpu', + () => { + rawSinglePrecisionRenderOutput('gpu'); + } +); -(GPU.isWebGLSupported && GPU.isSinglePrecisionSupported ? test : skip)('raw single precision render output webgl', () => { - rawSinglePrecisionRenderOutput('webgl'); -}); +(GPU.isWebGLSupported && GPU.isSinglePrecisionSupported ? test : skip)( + 'raw single precision render output webgl', + () => { + rawSinglePrecisionRenderOutput('webgl'); + } +); -(GPU.isWebGL2Supported && GPU.isSinglePrecisionSupported ? test : skip)('raw single precision render output webgl2', () => { - rawSinglePrecisionRenderOutput('webgl2'); -}); +(GPU.isWebGL2Supported && GPU.isSinglePrecisionSupported ? test : skip)( + 'raw single precision render output webgl2', + () => { + rawSinglePrecisionRenderOutput('webgl2'); + } +); -(GPU.isHeadlessGLSupported && GPU.isSinglePrecisionSupported ? test : skip)('raw single precision render output headlessgl', () => { - rawSinglePrecisionRenderOutput('headlessgl'); -}); +(GPU.isHeadlessGLSupported && GPU.isSinglePrecisionSupported ? test : skip)( + 'raw single precision render output headlessgl', + () => { + rawSinglePrecisionRenderOutput('headlessgl'); + } +); test('raw single precision render output cpu', () => { assert.throws(() => { diff --git a/test/features/read-color-texture.js b/test/features/read-color-texture.js index 17feb1aa..4981d9c8 100644 --- a/test/features/read-color-texture.js +++ b/test/features/read-color-texture.js @@ -7,7 +7,12 @@ function colorSyntaxTest(mode) { const gpu = new GPU({ mode }); const createTexture = gpu .createKernel(function (value) { - this.color(value[this.thread.y][this.thread.x], value[this.thread.y][this.thread.x], value[this.thread.y][this.thread.x], value[this.thread.y][this.thread.x]); + this.color( + value[this.thread.y][this.thread.x], + value[this.thread.y][this.thread.x], + value[this.thread.y][this.thread.x], + value[this.thread.y][this.thread.x] + ); }) .setOutput([4, 4]) .setGraphical(true) diff --git a/test/features/read-from-texture.js b/test/features/read-from-texture.js index 14d88ba0..793a136b 100644 --- a/test/features/read-from-texture.js +++ b/test/features/read-from-texture.js @@ -43,7 +43,9 @@ function readWithoutTextureKernels(mode) { readWithoutTextureKernels('webgl2'); }); -(GPU.isHeadlessGLSupported && HeadlessGLKernel.features.kernelMap ? test : skip)('Read without texture headlessgl', () => { +(GPU.isHeadlessGLSupported && HeadlessGLKernel.features.kernelMap + ? test + : skip)('Read without texture headlessgl', () => { readWithoutTextureKernels('headlessgl'); }); @@ -87,6 +89,8 @@ function readFromTextureKernels(mode) { readFromTextureKernels('webgl2'); }); -(GPU.isHeadlessGLSupported && HeadlessGLKernel.features.kernelMap ? test : skip)('Read from Texture headlessgl', () => { +(GPU.isHeadlessGLSupported && HeadlessGLKernel.features.kernelMap + ? test + : skip)('Read from Texture headlessgl', () => { readFromTextureKernels('headlessgl'); }); diff --git a/test/features/read-image-bitmap.js b/test/features/read-image-bitmap.js index 4d7fcce8..a0132ba9 100644 --- a/test/features/read-image-bitmap.js +++ b/test/features/read-image-bitmap.js @@ -27,25 +27,37 @@ function readImageBitmap(mode, done) { }; } -(typeof Image !== 'undefined' ? test : skip)('readImageBitmap auto', assert => { - readImageBitmap(null, assert.async()); -}); +(typeof Image !== 'undefined' ? test : skip)( + 'readImageBitmap auto', + assert => { + readImageBitmap(null, assert.async()); + } +); (typeof Image !== 'undefined' ? test : skip)('readImageBitmap gpu', assert => { readImageBitmap('gpu', assert.async()); }); -(GPU.isWebGLSupported && typeof Image !== 'undefined' ? test : skip)('readImageBitmap webgl', assert => { - readImageBitmap('webgl', assert.async()); -}); +(GPU.isWebGLSupported && typeof Image !== 'undefined' ? test : skip)( + 'readImageBitmap webgl', + assert => { + readImageBitmap('webgl', assert.async()); + } +); -(GPU.isWebGL2Supported && typeof Image !== 'undefined' ? test : skip)('readImageBitmap webgl2', assert => { - readImageBitmap('webgl2', assert.async()); -}); +(GPU.isWebGL2Supported && typeof Image !== 'undefined' ? test : skip)( + 'readImageBitmap webgl2', + assert => { + readImageBitmap('webgl2', assert.async()); + } +); -(GPU.isHeadlessGLSupported && typeof Image !== 'undefined' ? test : skip)('readImageBitmap headlessgl', assert => { - readImageBitmap('headlessgl', assert.async()); -}); +(GPU.isHeadlessGLSupported && typeof Image !== 'undefined' ? test : skip)( + 'readImageBitmap headlessgl', + assert => { + readImageBitmap('headlessgl', assert.async()); + } +); (typeof Image !== 'undefined' ? test : skip)('readImageBitmap cpu', assert => { readImageBitmap('cpu', assert.async()); diff --git a/test/features/read-image-data.js b/test/features/read-image-data.js index aed9ed90..51e269ad 100644 --- a/test/features/read-image-data.js +++ b/test/features/read-image-data.js @@ -30,17 +30,26 @@ function readImageData(mode) { readImageData('gpu'); }); -(GPU.isWebGLSupported && typeof ImageData !== 'undefined' ? test : skip)('readImageData webgl', () => { - readImageData('webgl'); -}); - -(GPU.isWebGL2Supported && typeof ImageData !== 'undefined' ? test : skip)('readImageData webgl2', () => { - readImageData('webgl2'); -}); - -(GPU.isHeadlessGLSupported && typeof ImageData !== 'undefined' ? test : skip)('readImageData headlessgl', () => { - readImageData('headlessgl'); -}); +(GPU.isWebGLSupported && typeof ImageData !== 'undefined' ? test : skip)( + 'readImageData webgl', + () => { + readImageData('webgl'); + } +); + +(GPU.isWebGL2Supported && typeof ImageData !== 'undefined' ? test : skip)( + 'readImageData webgl2', + () => { + readImageData('webgl2'); + } +); + +(GPU.isHeadlessGLSupported && typeof ImageData !== 'undefined' ? test : skip)( + 'readImageData headlessgl', + () => { + readImageData('headlessgl'); + } +); (typeof ImageData !== 'undefined' ? test : skip)('readImageData cpu', () => { readImageData('cpu'); diff --git a/test/features/read-offscreen-canvas.js b/test/features/read-offscreen-canvas.js index afbf5dd6..d9eee586 100644 --- a/test/features/read-offscreen-canvas.js +++ b/test/features/read-offscreen-canvas.js @@ -41,23 +41,38 @@ if (typeof importScripts !== 'undefined') { worker.postMessage(mode); } - (GPU.isOffscreenCanvasSupported ? test : skip)('read offscreen canvas auto', t => { - testReadOffscreenCanvas(null, t.async()); - }); + (GPU.isOffscreenCanvasSupported ? test : skip)( + 'read offscreen canvas auto', + t => { + testReadOffscreenCanvas(null, t.async()); + } + ); - (GPU.isOffscreenCanvasSupported ? test : skip)('read offscreen canvas gpu', t => { - testReadOffscreenCanvas('gpu', t.async()); - }); + (GPU.isOffscreenCanvasSupported ? test : skip)( + 'read offscreen canvas gpu', + t => { + testReadOffscreenCanvas('gpu', t.async()); + } + ); - (GPU.isOffscreenCanvasSupported ? test : skip)('read offscreen canvas webgl', t => { - testReadOffscreenCanvas('webgl', t.async()); - }); + (GPU.isOffscreenCanvasSupported ? test : skip)( + 'read offscreen canvas webgl', + t => { + testReadOffscreenCanvas('webgl', t.async()); + } + ); - (GPU.isOffscreenCanvasSupported ? test : skip)('read offscreen canvas webgl2', t => { - testReadOffscreenCanvas('webgl2', t.async()); - }); + (GPU.isOffscreenCanvasSupported ? test : skip)( + 'read offscreen canvas webgl2', + t => { + testReadOffscreenCanvas('webgl2', t.async()); + } + ); - (GPU.isOffscreenCanvasSupported ? test : skip)('read offscreen canvas cpu', t => { - testReadOffscreenCanvas('cpu', t.async()); - }); + (GPU.isOffscreenCanvasSupported ? test : skip)( + 'read offscreen canvas cpu', + t => { + testReadOffscreenCanvas('cpu', t.async()); + } + ); } diff --git a/test/features/return-arrays.js b/test/features/return-arrays.js index 0461112b..c16f69f7 100644 --- a/test/features/return-arrays.js +++ b/test/features/return-arrays.js @@ -19,25 +19,40 @@ function returnArray2FromKernel(mode) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported ? test : skip)('return Array(2) from kernel auto', () => { - returnArray2FromKernel(); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'return Array(2) from kernel auto', + () => { + returnArray2FromKernel(); + } +); -(GPU.isSinglePrecisionSupported ? test : skip)('return Array(2) from kernel gpu', () => { - returnArray2FromKernel('gpu'); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'return Array(2) from kernel gpu', + () => { + returnArray2FromKernel('gpu'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('return Array(2) from kernel webgl', () => { - returnArray2FromKernel('webgl'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'return Array(2) from kernel webgl', + () => { + returnArray2FromKernel('webgl'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('return Array(2) from kernel webgl2', () => { - returnArray2FromKernel('webgl2'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'return Array(2) from kernel webgl2', + () => { + returnArray2FromKernel('webgl2'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('return Array(2) from kernel headlessgl', () => { - returnArray2FromKernel('headlessgl'); -}); +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'return Array(2) from kernel headlessgl', + () => { + returnArray2FromKernel('headlessgl'); + } +); test('return Array(2) from kernel cpu', () => { returnArray2FromKernel('cpu'); @@ -61,25 +76,40 @@ function returnArray2D2FromKernel(mode) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported ? test : skip)('return Array2D(2) from kernel auto', () => { - returnArray2D2FromKernel(); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'return Array2D(2) from kernel auto', + () => { + returnArray2D2FromKernel(); + } +); -(GPU.isSinglePrecisionSupported ? test : skip)('return Array2D(2) from kernel gpu', () => { - returnArray2D2FromKernel('gpu'); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'return Array2D(2) from kernel gpu', + () => { + returnArray2D2FromKernel('gpu'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('return Array2D(2) from kernel webgl', () => { - returnArray2D2FromKernel('webgl'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'return Array2D(2) from kernel webgl', + () => { + returnArray2D2FromKernel('webgl'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('return Array2D(2) from kernel webgl2', () => { - returnArray2D2FromKernel('webgl2'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'return Array2D(2) from kernel webgl2', + () => { + returnArray2D2FromKernel('webgl2'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('return Array2D(2) from kernel headlessgl', () => { - returnArray2D2FromKernel('headlessgl'); -}); +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'return Array2D(2) from kernel headlessgl', + () => { + returnArray2D2FromKernel('headlessgl'); + } +); test('return Array2D(2) from kernel cpu', () => { returnArray2D2FromKernel('cpu'); @@ -105,25 +135,40 @@ function returnArray3D2FromKernel(mode) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported ? test : skip)('return Array3D(2) from kernel auto', () => { - returnArray3D2FromKernel(); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'return Array3D(2) from kernel auto', + () => { + returnArray3D2FromKernel(); + } +); -(GPU.isSinglePrecisionSupported ? test : skip)('return Array3D(2) from kernel gpu', () => { - returnArray3D2FromKernel('gpu'); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'return Array3D(2) from kernel gpu', + () => { + returnArray3D2FromKernel('gpu'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('return Array3D(2) from kernel webgl', () => { - returnArray3D2FromKernel('webgl'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'return Array3D(2) from kernel webgl', + () => { + returnArray3D2FromKernel('webgl'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('return Array3D(2) from kernel webgl2', () => { - returnArray3D2FromKernel('webgl2'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'return Array3D(2) from kernel webgl2', + () => { + returnArray3D2FromKernel('webgl2'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('return Array3D(2) from kernel headlessgl', () => { - returnArray3D2FromKernel('headlessgl'); -}); +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'return Array3D(2) from kernel headlessgl', + () => { + returnArray3D2FromKernel('headlessgl'); + } +); test('return Array3D(2) from kernel cpu', () => { returnArray3D2FromKernel('cpu'); @@ -142,25 +187,40 @@ function returnArray3FromKernel(mode) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported ? test : skip)('return Array(3) from kernel auto', () => { - returnArray3FromKernel(); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'return Array(3) from kernel auto', + () => { + returnArray3FromKernel(); + } +); -(GPU.isSinglePrecisionSupported ? test : skip)('return Array(3) from kernel gpu', () => { - returnArray3FromKernel('gpu'); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'return Array(3) from kernel gpu', + () => { + returnArray3FromKernel('gpu'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('return Array(3) from kernel webgl', () => { - returnArray3FromKernel('webgl'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'return Array(3) from kernel webgl', + () => { + returnArray3FromKernel('webgl'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('return Array(3) from kernel webgl2', () => { - returnArray3FromKernel('webgl2'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'return Array(3) from kernel webgl2', + () => { + returnArray3FromKernel('webgl2'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('return Array(3) from kernel headlessgl', () => { - returnArray3FromKernel('headlessgl'); -}); +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'return Array(3) from kernel headlessgl', + () => { + returnArray3FromKernel('headlessgl'); + } +); test('return Array(3) from kernel cpu', () => { returnArray3FromKernel('cpu'); @@ -185,25 +245,40 @@ function returnArray2D3FromKernel(mode) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported ? test : skip)('return Array2D(3) from kernel auto', () => { - returnArray2D3FromKernel(); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'return Array2D(3) from kernel auto', + () => { + returnArray2D3FromKernel(); + } +); -(GPU.isSinglePrecisionSupported ? test : skip)('return Array2D(3) from kernel gpu', () => { - returnArray2D3FromKernel('gpu'); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'return Array2D(3) from kernel gpu', + () => { + returnArray2D3FromKernel('gpu'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('return Array2D(3) from kernel webgl', () => { - returnArray2D3FromKernel('webgl'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'return Array2D(3) from kernel webgl', + () => { + returnArray2D3FromKernel('webgl'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('return Array2D(3) from kernel webgl2', () => { - returnArray2D3FromKernel('webgl2'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'return Array2D(3) from kernel webgl2', + () => { + returnArray2D3FromKernel('webgl2'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('return Array2D(3) from kernel headlessgl', () => { - returnArray2D3FromKernel('headlessgl'); -}); +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'return Array2D(3) from kernel headlessgl', + () => { + returnArray2D3FromKernel('headlessgl'); + } +); test('return Array2D(3) from kernel cpu', () => { returnArray2D3FromKernel('cpu'); @@ -230,25 +305,40 @@ function returnArray3D3FromKernel(mode) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported ? test : skip)('return Array3D(3) from kernel auto', () => { - returnArray3D3FromKernel(); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'return Array3D(3) from kernel auto', + () => { + returnArray3D3FromKernel(); + } +); -(GPU.isSinglePrecisionSupported ? test : skip)('return Array3D(3) from kernel gpu', () => { - returnArray3D3FromKernel('gpu'); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'return Array3D(3) from kernel gpu', + () => { + returnArray3D3FromKernel('gpu'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('return Array3D(3) from kernel webgl', () => { - returnArray3D3FromKernel('webgl'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'return Array3D(3) from kernel webgl', + () => { + returnArray3D3FromKernel('webgl'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('return Array3D(3) from kernel webgl2', () => { - returnArray3D3FromKernel('webgl2'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'return Array3D(3) from kernel webgl2', + () => { + returnArray3D3FromKernel('webgl2'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('return Array3D(3) from kernel headlessgl', () => { - returnArray3D3FromKernel('headlessgl'); -}); +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'return Array3D(3) from kernel headlessgl', + () => { + returnArray3D3FromKernel('headlessgl'); + } +); test('return Array3D(3) from kernel cpu', () => { returnArray3D3FromKernel('cpu'); @@ -270,25 +360,40 @@ function returnArray4FromKernel(mode) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported ? test : skip)('return Array(4) from kernel auto', () => { - returnArray4FromKernel(); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'return Array(4) from kernel auto', + () => { + returnArray4FromKernel(); + } +); -(GPU.isSinglePrecisionSupported ? test : skip)('return Array(4) from kernel gpu', () => { - returnArray4FromKernel('gpu'); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'return Array(4) from kernel gpu', + () => { + returnArray4FromKernel('gpu'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('return Array(4) from kernel webgl', () => { - returnArray4FromKernel('webgl'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'return Array(4) from kernel webgl', + () => { + returnArray4FromKernel('webgl'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('return Array(4) from kernel webgl2', () => { - returnArray4FromKernel('webgl2'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'return Array(4) from kernel webgl2', + () => { + returnArray4FromKernel('webgl2'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('return Array(4) from kernel headlessgl', () => { - returnArray4FromKernel('headlessgl'); -}); +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'return Array(4) from kernel headlessgl', + () => { + returnArray4FromKernel('headlessgl'); + } +); test('return Array(4) from kernel cpu', () => { returnArray4FromKernel('cpu'); @@ -298,7 +403,12 @@ function returnArray2D4FromKernel(mode) { const gpu = new GPU({ mode }); const kernel = gpu.createKernel( function () { - return [this.thread.x, this.thread.y, this.thread.x * this.thread.y, this.thread.x - this.thread.y]; + return [ + this.thread.x, + this.thread.y, + this.thread.x * this.thread.y, + this.thread.x - this.thread.y, + ]; }, { output: [3, 7], precision: 'single' } ); @@ -314,25 +424,40 @@ function returnArray2D4FromKernel(mode) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported ? test : skip)('return Array2D(4) from kernel auto', () => { - returnArray2D4FromKernel(); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'return Array2D(4) from kernel auto', + () => { + returnArray2D4FromKernel(); + } +); -(GPU.isSinglePrecisionSupported ? test : skip)('return Array2D(4) from kernel gpu', () => { - returnArray2D4FromKernel('gpu'); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'return Array2D(4) from kernel gpu', + () => { + returnArray2D4FromKernel('gpu'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('return Array2D(4) from kernel webgl', () => { - returnArray2D4FromKernel('webgl'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'return Array2D(4) from kernel webgl', + () => { + returnArray2D4FromKernel('webgl'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('return Array2D(4) from kernel webgl2', () => { - returnArray2D4FromKernel('webgl2'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'return Array2D(4) from kernel webgl2', + () => { + returnArray2D4FromKernel('webgl2'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('return Array2D(4) from kernel headlessgl', () => { - returnArray2D4FromKernel('headlessgl'); -}); +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'return Array2D(4) from kernel headlessgl', + () => { + returnArray2D4FromKernel('headlessgl'); + } +); test('return Array2D(4) from kernel cpu', () => { returnArray2D4FromKernel('cpu'); @@ -342,7 +467,12 @@ function returnArray3D4FromKernel(mode) { const gpu = new GPU({ mode }); const kernel = gpu.createKernel( function () { - return [this.thread.x, this.thread.y, this.thread.z, this.thread.x * this.thread.y * this.thread.z]; + return [ + this.thread.x, + this.thread.y, + this.thread.z, + this.thread.x * this.thread.y * this.thread.z, + ]; }, { output: [3, 5, 7], precision: 'single' } ); @@ -360,32 +490,50 @@ function returnArray3D4FromKernel(mode) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported ? test : skip)('return Array3D(4) from kernel auto', () => { - returnArray3D4FromKernel(); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'return Array3D(4) from kernel auto', + () => { + returnArray3D4FromKernel(); + } +); -(GPU.isSinglePrecisionSupported ? test : skip)('return Array3D(4) from kernel gpu', () => { - returnArray3D4FromKernel('gpu'); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'return Array3D(4) from kernel gpu', + () => { + returnArray3D4FromKernel('gpu'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('return Array3D(4) from kernel webgl', () => { - returnArray3D4FromKernel('webgl'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'return Array3D(4) from kernel webgl', + () => { + returnArray3D4FromKernel('webgl'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('return Array3D(4) from kernel webgl2', () => { - returnArray3D4FromKernel('webgl2'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'return Array3D(4) from kernel webgl2', + () => { + returnArray3D4FromKernel('webgl2'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('return Array3D(4) from kernel headlessgl', () => { - returnArray3D4FromKernel('headlessgl'); -}); +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'return Array3D(4) from kernel headlessgl', + () => { + returnArray3D4FromKernel('headlessgl'); + } +); test('return Array3D(4) from kernel cpu', () => { returnArray3D4FromKernel('cpu'); }); function returnArray2FromKernelVariables33Length(mode) { - const array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33]; + const array = [ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + ]; const sixteen = new Uint16Array(array); const eight = new Uint8Array(array); const gpu = new GPU({ mode }); @@ -403,32 +551,50 @@ function returnArray2FromKernelVariables33Length(mode) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported ? test : skip)('return Array(2) from kernel variables 33 in length auto', () => { - returnArray2FromKernelVariables33Length(); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'return Array(2) from kernel variables 33 in length auto', + () => { + returnArray2FromKernelVariables33Length(); + } +); -(GPU.isSinglePrecisionSupported && GPU.isGPUSupported ? test : skip)('return Array(2) from kernel variables 33 in length gpu', () => { - returnArray2FromKernelVariables33Length('gpu'); -}); +(GPU.isSinglePrecisionSupported && GPU.isGPUSupported ? test : skip)( + 'return Array(2) from kernel variables 33 in length gpu', + () => { + returnArray2FromKernelVariables33Length('gpu'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('return Array(2) from kernel variables 33 in length webgl', () => { - returnArray2FromKernelVariables33Length('webgl'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'return Array(2) from kernel variables 33 in length webgl', + () => { + returnArray2FromKernelVariables33Length('webgl'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('return Array(2) from kernel variables 33 in length webgl2', () => { - returnArray2FromKernelVariables33Length('webgl2'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'return Array(2) from kernel variables 33 in length webgl2', + () => { + returnArray2FromKernelVariables33Length('webgl2'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('return Array(2) from kernel variables 33 in length headlessgl', () => { - returnArray2FromKernelVariables33Length('headlessgl'); -}); +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'return Array(2) from kernel variables 33 in length headlessgl', + () => { + returnArray2FromKernelVariables33Length('headlessgl'); + } +); test('return Array(2) from kernel variables 33 in length cpu', () => { returnArray2FromKernelVariables33Length('cpu'); }); function returnArray3FromKernelVariables33Length(mode) { - const array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33]; + const array = [ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + ]; const thirtyTwo = new Float32Array(array); const sixteen = new Uint16Array(array); const eight = new Uint8Array(array); @@ -447,39 +613,62 @@ function returnArray3FromKernelVariables33Length(mode) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported ? test : skip)('return Array(3) from kernel variables 33 in length auto', () => { - returnArray3FromKernelVariables33Length(); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'return Array(3) from kernel variables 33 in length auto', + () => { + returnArray3FromKernelVariables33Length(); + } +); -(GPU.isSinglePrecisionSupported && GPU.isGPUSupported ? test : skip)('return Array(3) from kernel variables 33 in length gpu', () => { - returnArray3FromKernelVariables33Length('gpu'); -}); +(GPU.isSinglePrecisionSupported && GPU.isGPUSupported ? test : skip)( + 'return Array(3) from kernel variables 33 in length gpu', + () => { + returnArray3FromKernelVariables33Length('gpu'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('return Array(3) from kernel variables 33 in length webgl', () => { - returnArray3FromKernelVariables33Length('webgl'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'return Array(3) from kernel variables 33 in length webgl', + () => { + returnArray3FromKernelVariables33Length('webgl'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('return Array(3) from kernel variables 33 in length webgl2', () => { - returnArray3FromKernelVariables33Length('webgl2'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'return Array(3) from kernel variables 33 in length webgl2', + () => { + returnArray3FromKernelVariables33Length('webgl2'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('return Array(3) from kernel variables 33 in length headlessgl', () => { - returnArray3FromKernelVariables33Length('headlessgl'); -}); +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'return Array(3) from kernel variables 33 in length headlessgl', + () => { + returnArray3FromKernelVariables33Length('headlessgl'); + } +); test('return Array(3) from kernel variables 33 in length cpu', () => { returnArray3FromKernelVariables33Length('cpu'); }); function returnArray4FromKernelVariables33Length(mode) { - const array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33]; + const array = [ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + ]; const thirtyTwo = new Float32Array(array); const sixteen = new Uint16Array(array); const eight = new Uint8Array(array); const gpu = new GPU({ mode }); const kernel = gpu.createKernel( function (v1, v2, v3, v4) { - return [v1[this.thread.x], v2[this.thread.x], v3[this.thread.x], v4[this.thread.x]]; + return [ + v1[this.thread.x], + v2[this.thread.x], + v3[this.thread.x], + v4[this.thread.x], + ]; }, { output: [33] } ); @@ -491,25 +680,40 @@ function returnArray4FromKernelVariables33Length(mode) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported ? test : skip)('return Array(4) from kernel variables 33 in length auto', () => { - returnArray4FromKernelVariables33Length(); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'return Array(4) from kernel variables 33 in length auto', + () => { + returnArray4FromKernelVariables33Length(); + } +); -(GPU.isSinglePrecisionSupported && GPU.isGPUSupported ? test : skip)('return Array(4) from kernel variables 33 in length gpu', () => { - returnArray4FromKernelVariables33Length('gpu'); -}); +(GPU.isSinglePrecisionSupported && GPU.isGPUSupported ? test : skip)( + 'return Array(4) from kernel variables 33 in length gpu', + () => { + returnArray4FromKernelVariables33Length('gpu'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('return Array(4) from kernel variables 33 in length webgl', () => { - returnArray4FromKernelVariables33Length('webgl'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'return Array(4) from kernel variables 33 in length webgl', + () => { + returnArray4FromKernelVariables33Length('webgl'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('return Array(4) from kernel variables 33 in length webgl2', () => { - returnArray4FromKernelVariables33Length('webgl2'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'return Array(4) from kernel variables 33 in length webgl2', + () => { + returnArray4FromKernelVariables33Length('webgl2'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('return Array(4) from kernel variables 33 in length headlessgl', () => { - returnArray4FromKernelVariables33Length('headlessgl'); -}); +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'return Array(4) from kernel variables 33 in length headlessgl', + () => { + returnArray4FromKernelVariables33Length('headlessgl'); + } +); test('return Array(4) from kernel variables 33 in length cpu', () => { returnArray4FromKernelVariables33Length('cpu'); diff --git a/test/features/single-precision-textures.js b/test/features/single-precision-textures.js index b678137c..153a7c25 100644 --- a/test/features/single-precision-textures.js +++ b/test/features/single-precision-textures.js @@ -21,27 +21,44 @@ function singlePrecisionTexturesWithArray(mode) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported && GPU.isKernelMapSupported ? test : skip)('with Array auto', () => { - singlePrecisionTexturesWithArray(); -}); +(GPU.isSinglePrecisionSupported && GPU.isKernelMapSupported ? test : skip)( + 'with Array auto', + () => { + singlePrecisionTexturesWithArray(); + } +); test('with Array cpu', () => { singlePrecisionTexturesWithArray('cpu'); }); -(GPU.isSinglePrecisionSupported && GPU.isKernelMapSupported ? test : skip)('with Array gpu', () => { - singlePrecisionTexturesWithArray('gpu'); -}); +(GPU.isSinglePrecisionSupported && GPU.isKernelMapSupported ? test : skip)( + 'with Array gpu', + () => { + singlePrecisionTexturesWithArray('gpu'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported && GPU.isKernelMapSupported ? test : skip)('with Array webgl', () => { +(GPU.isSinglePrecisionSupported && + GPU.isWebGLSupported && + GPU.isKernelMapSupported + ? test + : skip)('with Array webgl', () => { singlePrecisionTexturesWithArray('webgl'); }); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('with Array webgl2', () => { - singlePrecisionTexturesWithArray('webgl2'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'with Array webgl2', + () => { + singlePrecisionTexturesWithArray('webgl2'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported && GPU.isKernelMapSupported ? test : skip)('with Array headlessgl', () => { +(GPU.isSinglePrecisionSupported && + GPU.isHeadlessGLSupported && + GPU.isKernelMapSupported + ? test + : skip)('with Array headlessgl', () => { singlePrecisionTexturesWithArray('headlessgl'); }); @@ -63,27 +80,44 @@ function singlePrecisionTexturesWithFloat32Array(mode) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported && GPU.isKernelMapSupported ? test : skip)('with Float32Array auto', () => { - singlePrecisionTexturesWithFloat32Array(); -}); +(GPU.isSinglePrecisionSupported && GPU.isKernelMapSupported ? test : skip)( + 'with Float32Array auto', + () => { + singlePrecisionTexturesWithFloat32Array(); + } +); test('with Float32Array cpu', () => { singlePrecisionTexturesWithFloat32Array('cpu'); }); -(GPU.isSinglePrecisionSupported && GPU.isKernelMapSupported ? test : skip)('with Float32Array gpu', () => { - singlePrecisionTexturesWithFloat32Array('gpu'); -}); +(GPU.isSinglePrecisionSupported && GPU.isKernelMapSupported ? test : skip)( + 'with Float32Array gpu', + () => { + singlePrecisionTexturesWithFloat32Array('gpu'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported && GPU.isKernelMapSupported ? test : skip)('with Float32Array webgl', () => { +(GPU.isSinglePrecisionSupported && + GPU.isWebGLSupported && + GPU.isKernelMapSupported + ? test + : skip)('with Float32Array webgl', () => { singlePrecisionTexturesWithFloat32Array('webgl'); }); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('with Float32Array webgl2', () => { - singlePrecisionTexturesWithFloat32Array('webgl2'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'with Float32Array webgl2', + () => { + singlePrecisionTexturesWithFloat32Array('webgl2'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported && GPU.isKernelMapSupported ? test : skip)('with Float32Array headlessgl', () => { +(GPU.isSinglePrecisionSupported && + GPU.isHeadlessGLSupported && + GPU.isKernelMapSupported + ? test + : skip)('with Float32Array headlessgl', () => { singlePrecisionTexturesWithFloat32Array('headlessgl'); }); @@ -105,27 +139,44 @@ function singlePrecisionTexturesWithUint16Array(mode) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported && GPU.isKernelMapSupported ? test : skip)('with Uint16Array auto', () => { - singlePrecisionTexturesWithUint16Array(); -}); +(GPU.isSinglePrecisionSupported && GPU.isKernelMapSupported ? test : skip)( + 'with Uint16Array auto', + () => { + singlePrecisionTexturesWithUint16Array(); + } +); test('with Uint16Array cpu', () => { singlePrecisionTexturesWithUint16Array('cpu'); }); -(GPU.isSinglePrecisionSupported && GPU.isKernelMapSupported ? test : skip)('with Uint16Array gpu', () => { - singlePrecisionTexturesWithUint16Array('gpu'); -}); +(GPU.isSinglePrecisionSupported && GPU.isKernelMapSupported ? test : skip)( + 'with Uint16Array gpu', + () => { + singlePrecisionTexturesWithUint16Array('gpu'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported && GPU.isKernelMapSupported ? test : skip)('with Uint16Array webgl', () => { +(GPU.isSinglePrecisionSupported && + GPU.isWebGLSupported && + GPU.isKernelMapSupported + ? test + : skip)('with Uint16Array webgl', () => { singlePrecisionTexturesWithUint16Array('webgl'); }); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('with Uint16Array webgl2', () => { - singlePrecisionTexturesWithUint16Array('webgl2'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'with Uint16Array webgl2', + () => { + singlePrecisionTexturesWithUint16Array('webgl2'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported && GPU.isKernelMapSupported ? test : skip)('with Uint16Array headlessgl', () => { +(GPU.isSinglePrecisionSupported && + GPU.isHeadlessGLSupported && + GPU.isKernelMapSupported + ? test + : skip)('with Uint16Array headlessgl', () => { singlePrecisionTexturesWithUint16Array('headlessgl'); }); @@ -147,27 +198,44 @@ function singlePrecisionTexturesWithUint8Array(mode) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported && GPU.isKernelMapSupported ? test : skip)('with Uint8Array auto', () => { - singlePrecisionTexturesWithUint8Array(); -}); +(GPU.isSinglePrecisionSupported && GPU.isKernelMapSupported ? test : skip)( + 'with Uint8Array auto', + () => { + singlePrecisionTexturesWithUint8Array(); + } +); test('with Uint8Array cpu', () => { singlePrecisionTexturesWithUint8Array('cpu'); }); -(GPU.isSinglePrecisionSupported && GPU.isKernelMapSupported ? test : skip)('with Uint8Array gpu', () => { - singlePrecisionTexturesWithUint8Array('gpu'); -}); +(GPU.isSinglePrecisionSupported && GPU.isKernelMapSupported ? test : skip)( + 'with Uint8Array gpu', + () => { + singlePrecisionTexturesWithUint8Array('gpu'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported && GPU.isKernelMapSupported ? test : skip)('with Uint8Array webgl', () => { +(GPU.isSinglePrecisionSupported && + GPU.isWebGLSupported && + GPU.isKernelMapSupported + ? test + : skip)('with Uint8Array webgl', () => { singlePrecisionTexturesWithUint8Array('webgl'); }); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('with Uint8Array webgl2', () => { - singlePrecisionTexturesWithUint8Array('webgl2'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'with Uint8Array webgl2', + () => { + singlePrecisionTexturesWithUint8Array('webgl2'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported && GPU.isKernelMapSupported ? test : skip)('with Uint8Array headlessgl', () => { +(GPU.isSinglePrecisionSupported && + GPU.isHeadlessGLSupported && + GPU.isKernelMapSupported + ? test + : skip)('with Uint8Array headlessgl', () => { singlePrecisionTexturesWithUint8Array('headlessgl'); }); @@ -189,27 +257,44 @@ function singlePrecisionTexturesWithUint8ClampedArray(mode) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported && GPU.isKernelMapSupported ? test : skip)('with Uint8ClampedArray auto', () => { - singlePrecisionTexturesWithUint8ClampedArray(); -}); +(GPU.isSinglePrecisionSupported && GPU.isKernelMapSupported ? test : skip)( + 'with Uint8ClampedArray auto', + () => { + singlePrecisionTexturesWithUint8ClampedArray(); + } +); test('with Uint8ClampedArray cpu', () => { singlePrecisionTexturesWithUint8ClampedArray('cpu'); }); -(GPU.isSinglePrecisionSupported && GPU.isKernelMapSupported ? test : skip)('with Uint8ClampedArray gpu', () => { - singlePrecisionTexturesWithUint8ClampedArray('gpu'); -}); +(GPU.isSinglePrecisionSupported && GPU.isKernelMapSupported ? test : skip)( + 'with Uint8ClampedArray gpu', + () => { + singlePrecisionTexturesWithUint8ClampedArray('gpu'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported && GPU.isKernelMapSupported ? test : skip)('with Uint8ClampedArray webgl', () => { +(GPU.isSinglePrecisionSupported && + GPU.isWebGLSupported && + GPU.isKernelMapSupported + ? test + : skip)('with Uint8ClampedArray webgl', () => { singlePrecisionTexturesWithUint8ClampedArray('webgl'); }); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('with Uint8ClampedArray webgl2', () => { - singlePrecisionTexturesWithUint8ClampedArray('webgl2'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'with Uint8ClampedArray webgl2', + () => { + singlePrecisionTexturesWithUint8ClampedArray('webgl2'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported && GPU.isKernelMapSupported ? test : skip)('with Uint8ClampedArray headlessgl', () => { +(GPU.isSinglePrecisionSupported && + GPU.isHeadlessGLSupported && + GPU.isKernelMapSupported + ? test + : skip)('with Uint8ClampedArray headlessgl', () => { singlePrecisionTexturesWithUint8ClampedArray('headlessgl'); }); @@ -237,32 +322,52 @@ function singlePrecisionTexturesWithArray2D(mode) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported && GPU.isKernelMapSupported ? test : skip)('with Array2D auto', () => { - singlePrecisionTexturesWithArray2D(); -}); +(GPU.isSinglePrecisionSupported && GPU.isKernelMapSupported ? test : skip)( + 'with Array2D auto', + () => { + singlePrecisionTexturesWithArray2D(); + } +); test('with Array2D cpu', () => { singlePrecisionTexturesWithArray2D('cpu'); }); -(GPU.isSinglePrecisionSupported && GPU.isKernelMapSupported ? test : skip)('with Array2D gpu', () => { - singlePrecisionTexturesWithArray2D('gpu'); -}); +(GPU.isSinglePrecisionSupported && GPU.isKernelMapSupported ? test : skip)( + 'with Array2D gpu', + () => { + singlePrecisionTexturesWithArray2D('gpu'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported && GPU.isKernelMapSupported ? test : skip)('with Array2D webgl', () => { +(GPU.isSinglePrecisionSupported && + GPU.isWebGLSupported && + GPU.isKernelMapSupported + ? test + : skip)('with Array2D webgl', () => { singlePrecisionTexturesWithArray2D('webgl'); }); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('with Array2D webgl2', () => { - singlePrecisionTexturesWithArray2D('webgl2'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'with Array2D webgl2', + () => { + singlePrecisionTexturesWithArray2D('webgl2'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported && GPU.isKernelMapSupported ? test : skip)('with Array2D headlessgl', () => { +(GPU.isSinglePrecisionSupported && + GPU.isHeadlessGLSupported && + GPU.isKernelMapSupported + ? test + : skip)('with Array2D headlessgl', () => { singlePrecisionTexturesWithArray2D('headlessgl'); }); function singlePrecisionTexturesWithFloat32Array2D(mode) { - const original = [new Float32Array([1, 2, 3, 4, 5, 6, 7, 8, 9]), new Float32Array([10, 11, 12, 13, 14, 15, 16, 18, 19])]; + const original = [ + new Float32Array([1, 2, 3, 4, 5, 6, 7, 8, 9]), + new Float32Array([10, 11, 12, 13, 14, 15, 16, 18, 19]), + ]; const gpu = new GPU({ mode }); const kernel = gpu.createKernel( function (packed) { @@ -282,32 +387,52 @@ function singlePrecisionTexturesWithFloat32Array2D(mode) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported && GPU.isKernelMapSupported ? test : skip)('with Float32Array2D auto', () => { - singlePrecisionTexturesWithFloat32Array2D(); -}); +(GPU.isSinglePrecisionSupported && GPU.isKernelMapSupported ? test : skip)( + 'with Float32Array2D auto', + () => { + singlePrecisionTexturesWithFloat32Array2D(); + } +); test('with Float32Array2D cpu', () => { singlePrecisionTexturesWithFloat32Array2D('cpu'); }); -(GPU.isSinglePrecisionSupported && GPU.isKernelMapSupported ? test : skip)('with Float32Array2D gpu', () => { - singlePrecisionTexturesWithFloat32Array2D('gpu'); -}); +(GPU.isSinglePrecisionSupported && GPU.isKernelMapSupported ? test : skip)( + 'with Float32Array2D gpu', + () => { + singlePrecisionTexturesWithFloat32Array2D('gpu'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported && GPU.isKernelMapSupported ? test : skip)('with Float32Array2D webgl', () => { +(GPU.isSinglePrecisionSupported && + GPU.isWebGLSupported && + GPU.isKernelMapSupported + ? test + : skip)('with Float32Array2D webgl', () => { singlePrecisionTexturesWithFloat32Array2D('webgl'); }); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('with Float32Array2D webgl2', () => { - singlePrecisionTexturesWithFloat32Array2D('webgl2'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'with Float32Array2D webgl2', + () => { + singlePrecisionTexturesWithFloat32Array2D('webgl2'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported && GPU.isKernelMapSupported ? test : skip)('with Float32Array2D headlessgl', () => { +(GPU.isSinglePrecisionSupported && + GPU.isHeadlessGLSupported && + GPU.isKernelMapSupported + ? test + : skip)('with Float32Array2D headlessgl', () => { singlePrecisionTexturesWithFloat32Array2D('headlessgl'); }); function singlePrecisionTexturesWithUint16Array2D(mode) { - const original = [new Uint16Array([1, 2, 3, 4, 5, 6, 7, 8, 9]), new Uint16Array([10, 11, 12, 13, 14, 15, 16, 18, 19])]; + const original = [ + new Uint16Array([1, 2, 3, 4, 5, 6, 7, 8, 9]), + new Uint16Array([10, 11, 12, 13, 14, 15, 16, 18, 19]), + ]; const gpu = new GPU({ mode }); const kernel = gpu.createKernel( function (packed) { @@ -327,32 +452,52 @@ function singlePrecisionTexturesWithUint16Array2D(mode) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported && GPU.isKernelMapSupported ? test : skip)('with Uint16Array2D auto', () => { - singlePrecisionTexturesWithUint16Array2D(); -}); +(GPU.isSinglePrecisionSupported && GPU.isKernelMapSupported ? test : skip)( + 'with Uint16Array2D auto', + () => { + singlePrecisionTexturesWithUint16Array2D(); + } +); test('with Uint16Array2D cpu', () => { singlePrecisionTexturesWithUint16Array2D('cpu'); }); -(GPU.isSinglePrecisionSupported && GPU.isKernelMapSupported ? test : skip)('with Uint16Array2D gpu', () => { - singlePrecisionTexturesWithUint16Array2D('gpu'); -}); +(GPU.isSinglePrecisionSupported && GPU.isKernelMapSupported ? test : skip)( + 'with Uint16Array2D gpu', + () => { + singlePrecisionTexturesWithUint16Array2D('gpu'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported && GPU.isKernelMapSupported ? test : skip)('with Uint16Array2D webgl', () => { +(GPU.isSinglePrecisionSupported && + GPU.isWebGLSupported && + GPU.isKernelMapSupported + ? test + : skip)('with Uint16Array2D webgl', () => { singlePrecisionTexturesWithUint16Array2D('webgl'); }); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('with Uint16Array2D webgl2', () => { - singlePrecisionTexturesWithUint16Array2D('webgl2'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'with Uint16Array2D webgl2', + () => { + singlePrecisionTexturesWithUint16Array2D('webgl2'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported && GPU.isKernelMapSupported ? test : skip)('with Uint16Array2D headlessgl', () => { +(GPU.isSinglePrecisionSupported && + GPU.isHeadlessGLSupported && + GPU.isKernelMapSupported + ? test + : skip)('with Uint16Array2D headlessgl', () => { singlePrecisionTexturesWithUint16Array2D('headlessgl'); }); function singlePrecisionTexturesWithUint8Array2D(mode) { - const original = [new Uint8Array([1, 2, 3, 4, 5, 6, 7, 8, 9]), new Uint8Array([10, 11, 12, 13, 14, 15, 16, 18, 19])]; + const original = [ + new Uint8Array([1, 2, 3, 4, 5, 6, 7, 8, 9]), + new Uint8Array([10, 11, 12, 13, 14, 15, 16, 18, 19]), + ]; const gpu = new GPU({ mode }); const kernel = gpu.createKernel( function (packed) { @@ -372,32 +517,52 @@ function singlePrecisionTexturesWithUint8Array2D(mode) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported && GPU.isKernelMapSupported ? test : skip)('with Uint8Array2D auto', () => { - singlePrecisionTexturesWithUint8Array2D(); -}); +(GPU.isSinglePrecisionSupported && GPU.isKernelMapSupported ? test : skip)( + 'with Uint8Array2D auto', + () => { + singlePrecisionTexturesWithUint8Array2D(); + } +); test('with Uint8Array2D cpu', () => { singlePrecisionTexturesWithUint8Array2D('cpu'); }); -(GPU.isSinglePrecisionSupported && GPU.isKernelMapSupported ? test : skip)('with Uint8Array2D gpu', () => { - singlePrecisionTexturesWithUint8Array2D('gpu'); -}); +(GPU.isSinglePrecisionSupported && GPU.isKernelMapSupported ? test : skip)( + 'with Uint8Array2D gpu', + () => { + singlePrecisionTexturesWithUint8Array2D('gpu'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported && GPU.isKernelMapSupported ? test : skip)('with Uint8Array2D webgl', () => { +(GPU.isSinglePrecisionSupported && + GPU.isWebGLSupported && + GPU.isKernelMapSupported + ? test + : skip)('with Uint8Array2D webgl', () => { singlePrecisionTexturesWithUint8Array2D('webgl'); }); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('with Uint8Array2D webgl2', () => { - singlePrecisionTexturesWithUint8Array2D('webgl2'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'with Uint8Array2D webgl2', + () => { + singlePrecisionTexturesWithUint8Array2D('webgl2'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported && GPU.isKernelMapSupported ? test : skip)('with Uint8Array2D headlessgl', () => { +(GPU.isSinglePrecisionSupported && + GPU.isHeadlessGLSupported && + GPU.isKernelMapSupported + ? test + : skip)('with Uint8Array2D headlessgl', () => { singlePrecisionTexturesWithUint8Array2D('headlessgl'); }); function singlePrecisionTexturesWithUint8ClampedArray2D(mode) { - const original = [new Uint8ClampedArray([1, 2, 3, 4, 5, 6, 7, 8, 9]), new Uint8ClampedArray([10, 11, 12, 13, 14, 15, 16, 18, 19])]; + const original = [ + new Uint8ClampedArray([1, 2, 3, 4, 5, 6, 7, 8, 9]), + new Uint8ClampedArray([10, 11, 12, 13, 14, 15, 16, 18, 19]), + ]; const gpu = new GPU({ mode }); const kernel = gpu.createKernel( function (packed) { @@ -417,27 +582,44 @@ function singlePrecisionTexturesWithUint8ClampedArray2D(mode) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported && GPU.isKernelMapSupported ? test : skip)('with Uint8ClampedArray2D auto', () => { - singlePrecisionTexturesWithUint8ClampedArray2D(); -}); +(GPU.isSinglePrecisionSupported && GPU.isKernelMapSupported ? test : skip)( + 'with Uint8ClampedArray2D auto', + () => { + singlePrecisionTexturesWithUint8ClampedArray2D(); + } +); test('with Uint8ClampedArray2D cpu', () => { singlePrecisionTexturesWithUint8ClampedArray2D('cpu'); }); -(GPU.isSinglePrecisionSupported && GPU.isKernelMapSupported ? test : skip)('with Uint8ClampedArray2D gpu', () => { - singlePrecisionTexturesWithUint8ClampedArray2D('gpu'); -}); +(GPU.isSinglePrecisionSupported && GPU.isKernelMapSupported ? test : skip)( + 'with Uint8ClampedArray2D gpu', + () => { + singlePrecisionTexturesWithUint8ClampedArray2D('gpu'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported && GPU.isKernelMapSupported ? test : skip)('with Uint8ClampedArray2D webgl', () => { +(GPU.isSinglePrecisionSupported && + GPU.isWebGLSupported && + GPU.isKernelMapSupported + ? test + : skip)('with Uint8ClampedArray2D webgl', () => { singlePrecisionTexturesWithUint8ClampedArray2D('webgl'); }); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('with Uint8ClampedArray2D webgl2', () => { - singlePrecisionTexturesWithUint8ClampedArray2D('webgl2'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'with Uint8ClampedArray2D webgl2', + () => { + singlePrecisionTexturesWithUint8ClampedArray2D('webgl2'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported && GPU.isKernelMapSupported ? test : skip)('with Uint8ClampedArray2D headlessgl', () => { +(GPU.isSinglePrecisionSupported && + GPU.isHeadlessGLSupported && + GPU.isKernelMapSupported + ? test + : skip)('with Uint8ClampedArray2D headlessgl', () => { singlePrecisionTexturesWithUint8ClampedArray2D('headlessgl'); }); @@ -471,34 +653,57 @@ function singlePrecisionTexturesWithArray3D(mode) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported && GPU.isKernelMapSupported ? test : skip)('with Array3D auto', () => { - singlePrecisionTexturesWithArray3D(); -}); +(GPU.isSinglePrecisionSupported && GPU.isKernelMapSupported ? test : skip)( + 'with Array3D auto', + () => { + singlePrecisionTexturesWithArray3D(); + } +); test('with Array3D cpu', () => { singlePrecisionTexturesWithArray3D('cpu'); }); -(GPU.isSinglePrecisionSupported && GPU.isKernelMapSupported ? test : skip)('with Array3D gpu', () => { - singlePrecisionTexturesWithArray3D('gpu'); -}); +(GPU.isSinglePrecisionSupported && GPU.isKernelMapSupported ? test : skip)( + 'with Array3D gpu', + () => { + singlePrecisionTexturesWithArray3D('gpu'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported && GPU.isKernelMapSupported ? test : skip)('with Array3D webgl', () => { +(GPU.isSinglePrecisionSupported && + GPU.isWebGLSupported && + GPU.isKernelMapSupported + ? test + : skip)('with Array3D webgl', () => { singlePrecisionTexturesWithArray3D('webgl'); }); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('with Array3D webgl2', () => { - singlePrecisionTexturesWithArray3D('webgl2'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'with Array3D webgl2', + () => { + singlePrecisionTexturesWithArray3D('webgl2'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported && GPU.isKernelMapSupported ? test : skip)('with Array3D headlessgl', () => { +(GPU.isSinglePrecisionSupported && + GPU.isHeadlessGLSupported && + GPU.isKernelMapSupported + ? test + : skip)('with Array3D headlessgl', () => { singlePrecisionTexturesWithArray3D('headlessgl'); }); function singlePrecisionTexturesWithFloat32Array3D(mode) { const original = [ - [new Float32Array([1, 2, 3, 4, 5, 6, 7, 8, 9]), new Float32Array([10, 11, 12, 13, 14, 15, 16, 18, 19])], - [new Float32Array([20, 21, 22, 23, 24, 25, 26, 27, 28]), new Float32Array([29, 30, 31, 32, 33, 34, 35, 36, 37])], + [ + new Float32Array([1, 2, 3, 4, 5, 6, 7, 8, 9]), + new Float32Array([10, 11, 12, 13, 14, 15, 16, 18, 19]), + ], + [ + new Float32Array([20, 21, 22, 23, 24, 25, 26, 27, 28]), + new Float32Array([29, 30, 31, 32, 33, 34, 35, 36, 37]), + ], ]; const gpu = new GPU({ mode }); const kernel = gpu.createKernel( @@ -519,34 +724,57 @@ function singlePrecisionTexturesWithFloat32Array3D(mode) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported && GPU.isKernelMapSupported ? test : skip)('with Float32Array3D auto', () => { - singlePrecisionTexturesWithFloat32Array3D(); -}); +(GPU.isSinglePrecisionSupported && GPU.isKernelMapSupported ? test : skip)( + 'with Float32Array3D auto', + () => { + singlePrecisionTexturesWithFloat32Array3D(); + } +); test('with Float32Array3D cpu', () => { singlePrecisionTexturesWithFloat32Array3D('cpu'); }); -(GPU.isSinglePrecisionSupported && GPU.isKernelMapSupported ? test : skip)('with Float32Array3D gpu', () => { - singlePrecisionTexturesWithFloat32Array3D('gpu'); -}); +(GPU.isSinglePrecisionSupported && GPU.isKernelMapSupported ? test : skip)( + 'with Float32Array3D gpu', + () => { + singlePrecisionTexturesWithFloat32Array3D('gpu'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported && GPU.isKernelMapSupported ? test : skip)('with Float32Array3D webgl', () => { +(GPU.isSinglePrecisionSupported && + GPU.isWebGLSupported && + GPU.isKernelMapSupported + ? test + : skip)('with Float32Array3D webgl', () => { singlePrecisionTexturesWithFloat32Array3D('webgl'); }); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('with Float32Array3D webgl2', () => { - singlePrecisionTexturesWithFloat32Array3D('webgl2'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'with Float32Array3D webgl2', + () => { + singlePrecisionTexturesWithFloat32Array3D('webgl2'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported && GPU.isKernelMapSupported ? test : skip)('with Float32Array3D headlessgl', () => { +(GPU.isSinglePrecisionSupported && + GPU.isHeadlessGLSupported && + GPU.isKernelMapSupported + ? test + : skip)('with Float32Array3D headlessgl', () => { singlePrecisionTexturesWithFloat32Array3D('headlessgl'); }); function singlePrecisionTexturesWithUint16Array3D(mode) { const original = [ - [new Uint16Array([1, 2, 3, 4, 5, 6, 7, 8, 9]), new Uint16Array([10, 11, 12, 13, 14, 15, 16, 18, 19])], - [new Uint16Array([20, 21, 22, 23, 24, 25, 26, 27, 28]), new Uint16Array([29, 30, 31, 32, 33, 34, 35, 36, 37])], + [ + new Uint16Array([1, 2, 3, 4, 5, 6, 7, 8, 9]), + new Uint16Array([10, 11, 12, 13, 14, 15, 16, 18, 19]), + ], + [ + new Uint16Array([20, 21, 22, 23, 24, 25, 26, 27, 28]), + new Uint16Array([29, 30, 31, 32, 33, 34, 35, 36, 37]), + ], ]; const gpu = new GPU({ mode }); const kernel = gpu.createKernel( @@ -567,34 +795,57 @@ function singlePrecisionTexturesWithUint16Array3D(mode) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported && GPU.isKernelMapSupported ? test : skip)('with Uint16Array3D auto', () => { - singlePrecisionTexturesWithUint16Array3D(); -}); +(GPU.isSinglePrecisionSupported && GPU.isKernelMapSupported ? test : skip)( + 'with Uint16Array3D auto', + () => { + singlePrecisionTexturesWithUint16Array3D(); + } +); test('with Uint16Array3D cpu', () => { singlePrecisionTexturesWithUint16Array3D('cpu'); }); -(GPU.isSinglePrecisionSupported && GPU.isKernelMapSupported ? test : skip)('with Uint16Array3D gpu', () => { - singlePrecisionTexturesWithUint16Array3D('gpu'); -}); +(GPU.isSinglePrecisionSupported && GPU.isKernelMapSupported ? test : skip)( + 'with Uint16Array3D gpu', + () => { + singlePrecisionTexturesWithUint16Array3D('gpu'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported && GPU.isKernelMapSupported ? test : skip)('with Uint16Array3D webgl', () => { +(GPU.isSinglePrecisionSupported && + GPU.isWebGLSupported && + GPU.isKernelMapSupported + ? test + : skip)('with Uint16Array3D webgl', () => { singlePrecisionTexturesWithUint16Array3D('webgl'); }); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('with Uint16Array3D webgl2', () => { - singlePrecisionTexturesWithUint16Array3D('webgl2'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'with Uint16Array3D webgl2', + () => { + singlePrecisionTexturesWithUint16Array3D('webgl2'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported && GPU.isKernelMapSupported ? test : skip)('with Uint16Array3D headlessgl', () => { +(GPU.isSinglePrecisionSupported && + GPU.isHeadlessGLSupported && + GPU.isKernelMapSupported + ? test + : skip)('with Uint16Array3D headlessgl', () => { singlePrecisionTexturesWithUint16Array3D('headlessgl'); }); function singlePrecisionTexturesWithUint8Array3D(mode) { const original = [ - [new Uint8Array([1, 2, 3, 4, 5, 6, 7, 8, 9]), new Uint8Array([10, 11, 12, 13, 14, 15, 16, 18, 19])], - [new Uint8Array([20, 21, 22, 23, 24, 25, 26, 27, 28]), new Uint8Array([29, 30, 31, 32, 33, 34, 35, 36, 37])], + [ + new Uint8Array([1, 2, 3, 4, 5, 6, 7, 8, 9]), + new Uint8Array([10, 11, 12, 13, 14, 15, 16, 18, 19]), + ], + [ + new Uint8Array([20, 21, 22, 23, 24, 25, 26, 27, 28]), + new Uint8Array([29, 30, 31, 32, 33, 34, 35, 36, 37]), + ], ]; const gpu = new GPU({ mode }); const kernel = gpu.createKernel( @@ -615,34 +866,57 @@ function singlePrecisionTexturesWithUint8Array3D(mode) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported && GPU.isKernelMapSupported ? test : skip)('with Uint8Array3D auto', () => { - singlePrecisionTexturesWithUint8Array3D(); -}); +(GPU.isSinglePrecisionSupported && GPU.isKernelMapSupported ? test : skip)( + 'with Uint8Array3D auto', + () => { + singlePrecisionTexturesWithUint8Array3D(); + } +); test('with Uint8Array3D cpu', () => { singlePrecisionTexturesWithUint8Array3D('cpu'); }); -(GPU.isSinglePrecisionSupported && GPU.isKernelMapSupported ? test : skip)('with Uint8Array3D gpu', () => { - singlePrecisionTexturesWithUint8Array3D('gpu'); -}); +(GPU.isSinglePrecisionSupported && GPU.isKernelMapSupported ? test : skip)( + 'with Uint8Array3D gpu', + () => { + singlePrecisionTexturesWithUint8Array3D('gpu'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported && GPU.isKernelMapSupported ? test : skip)('with Uint8Array3D webgl', () => { +(GPU.isSinglePrecisionSupported && + GPU.isWebGLSupported && + GPU.isKernelMapSupported + ? test + : skip)('with Uint8Array3D webgl', () => { singlePrecisionTexturesWithUint8Array3D('webgl'); }); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('with Uint8Array3D webgl2', () => { - singlePrecisionTexturesWithUint8Array3D('webgl2'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'with Uint8Array3D webgl2', + () => { + singlePrecisionTexturesWithUint8Array3D('webgl2'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported && GPU.isKernelMapSupported ? test : skip)('with Uint8Array3D headlessgl', () => { +(GPU.isSinglePrecisionSupported && + GPU.isHeadlessGLSupported && + GPU.isKernelMapSupported + ? test + : skip)('with Uint8Array3D headlessgl', () => { singlePrecisionTexturesWithUint8Array3D('headlessgl'); }); function singlePrecisionTexturesWithUint8ClampedArray3D(mode) { const original = [ - [new Uint8ClampedArray([1, 2, 3, 4, 5, 6, 7, 8, 9]), new Uint8ClampedArray([10, 11, 12, 13, 14, 15, 16, 18, 19])], - [new Uint8ClampedArray([20, 21, 22, 23, 24, 25, 26, 27, 28]), new Uint8ClampedArray([29, 30, 31, 32, 33, 34, 35, 36, 37])], + [ + new Uint8ClampedArray([1, 2, 3, 4, 5, 6, 7, 8, 9]), + new Uint8ClampedArray([10, 11, 12, 13, 14, 15, 16, 18, 19]), + ], + [ + new Uint8ClampedArray([20, 21, 22, 23, 24, 25, 26, 27, 28]), + new Uint8ClampedArray([29, 30, 31, 32, 33, 34, 35, 36, 37]), + ], ]; const gpu = new GPU({ mode }); const kernel = gpu.createKernel( @@ -663,27 +937,44 @@ function singlePrecisionTexturesWithUint8ClampedArray3D(mode) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported && GPU.isKernelMapSupported ? test : skip)('with Uint8ClampedArray3D auto', () => { - singlePrecisionTexturesWithUint8ClampedArray3D(); -}); +(GPU.isSinglePrecisionSupported && GPU.isKernelMapSupported ? test : skip)( + 'with Uint8ClampedArray3D auto', + () => { + singlePrecisionTexturesWithUint8ClampedArray3D(); + } +); test('with Uint8ClampedArray3D cpu', () => { singlePrecisionTexturesWithUint8ClampedArray3D('cpu'); }); -(GPU.isSinglePrecisionSupported && GPU.isKernelMapSupported ? test : skip)('with Uint8ClampedArray3D gpu', () => { - singlePrecisionTexturesWithUint8ClampedArray3D('gpu'); -}); +(GPU.isSinglePrecisionSupported && GPU.isKernelMapSupported ? test : skip)( + 'with Uint8ClampedArray3D gpu', + () => { + singlePrecisionTexturesWithUint8ClampedArray3D('gpu'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported && GPU.isKernelMapSupported ? test : skip)('with Uint8ClampedArray3D webgl', () => { +(GPU.isSinglePrecisionSupported && + GPU.isWebGLSupported && + GPU.isKernelMapSupported + ? test + : skip)('with Uint8ClampedArray3D webgl', () => { singlePrecisionTexturesWithUint8ClampedArray3D('webgl'); }); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('with Uint8ClampedArray3D webgl2', () => { - singlePrecisionTexturesWithUint8ClampedArray3D('webgl2'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'with Uint8ClampedArray3D webgl2', + () => { + singlePrecisionTexturesWithUint8ClampedArray3D('webgl2'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported && GPU.isKernelMapSupported ? test : skip)('with Uint8ClampedArray3D headlessgl', () => { +(GPU.isSinglePrecisionSupported && + GPU.isHeadlessGLSupported && + GPU.isKernelMapSupported + ? test + : skip)('with Uint8ClampedArray3D headlessgl', () => { singlePrecisionTexturesWithUint8ClampedArray3D('headlessgl'); }); @@ -713,22 +1004,37 @@ function testImmutableDoesNotCollideWithKernelTexture(mode) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported ? test : skip)('immutable does not collide with kernel texture auto', () => { - testImmutableDoesNotCollideWithKernelTexture(); -}); - -(GPU.isSinglePrecisionSupported ? test : skip)('immutable does not collide with kernel texture gpu', () => { - testImmutableDoesNotCollideWithKernelTexture('gpu'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('immutable does not collide with kernel texture webgl', () => { - testImmutableDoesNotCollideWithKernelTexture('webgl'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('immutable does not collide with kernel texture webgl2', () => { - testImmutableDoesNotCollideWithKernelTexture('webgl2'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('immutable does not collide with kernel texture headlessgl', () => { - testImmutableDoesNotCollideWithKernelTexture('headlessgl'); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'immutable does not collide with kernel texture auto', + () => { + testImmutableDoesNotCollideWithKernelTexture(); + } +); + +(GPU.isSinglePrecisionSupported ? test : skip)( + 'immutable does not collide with kernel texture gpu', + () => { + testImmutableDoesNotCollideWithKernelTexture('gpu'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'immutable does not collide with kernel texture webgl', + () => { + testImmutableDoesNotCollideWithKernelTexture('webgl'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'immutable does not collide with kernel texture webgl2', + () => { + testImmutableDoesNotCollideWithKernelTexture('webgl2'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'immutable does not collide with kernel texture headlessgl', + () => { + testImmutableDoesNotCollideWithKernelTexture('headlessgl'); + } +); diff --git a/test/features/single-precision.js b/test/features/single-precision.js index d8e38ff2..d31c7fb8 100644 --- a/test/features/single-precision.js +++ b/test/features/single-precision.js @@ -31,9 +31,12 @@ test('cpu', () => { singlePrecisionKernel('gpu'); }); -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('webgl', () => { - singlePrecisionKernel('webgl'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'webgl', + () => { + singlePrecisionKernel('webgl'); + } +); (GPU.isWebGL2Supported ? test : skip)('webgl2', () => { singlePrecisionKernel('webgl2'); diff --git a/test/features/ternary.js b/test/features/ternary.js index d6fe5a0f..4e6b009e 100644 --- a/test/features/ternary.js +++ b/test/features/ternary.js @@ -73,9 +73,12 @@ test('with variable usage gpu', () => { ternaryWithVariableUsage('webgl2'); }); -(GPU.isHeadlessGLSupported ? test : skip)('with variable usage headlessgl', () => { - ternaryWithVariableUsage('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'with variable usage headlessgl', + () => { + ternaryWithVariableUsage('headlessgl'); + } +); test('with variable usage cpu', () => { ternaryWithVariableUsage('cpu'); diff --git a/test/features/to-string/as-file.js b/test/features/to-string/as-file.js index c8009326..94fdd202 100644 --- a/test/features/to-string/as-file.js +++ b/test/features/to-string/as-file.js @@ -29,10 +29,16 @@ function toStringAsFileTest(mode) { gpu.destroy(); } -(GPU.isHeadlessGLSupported ? test : skip)('can save and restore function headlessgl', () => { - toStringAsFileTest('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'can save and restore function headlessgl', + () => { + toStringAsFileTest('headlessgl'); + } +); -(GPU.isHeadlessGLSupported ? test : skip)('can save and restore function cpu', () => { - toStringAsFileTest('cpu'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'can save and restore function cpu', + () => { + toStringAsFileTest('cpu'); + } +); diff --git a/test/features/to-string/precision/single/arguments/array.js b/test/features/to-string/precision/single/arguments/array.js index 3fc66ee2..517c3bff 100644 --- a/test/features/to-string/precision/single/arguments/array.js +++ b/test/features/to-string/precision/single/arguments/array.js @@ -33,21 +33,30 @@ function testArgument(mode, context, canvas) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('webgl', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl'); - testArgument('webgl', context, canvas); -}); - -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('webgl2', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl2'); - testArgument('webgl2', context, canvas); -}); - -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('headlessgl', () => { - testArgument('headlessgl', require('gl')(1, 1), null); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'webgl', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl'); + testArgument('webgl', context, canvas); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'webgl2', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl2'); + testArgument('webgl2', context, canvas); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'headlessgl', + () => { + testArgument('headlessgl', require('gl')(1, 1), null); + } +); test('cpu', () => { testArgument('cpu'); diff --git a/test/features/to-string/precision/single/arguments/array2.js b/test/features/to-string/precision/single/arguments/array2.js index ead9c27e..35dabddc 100644 --- a/test/features/to-string/precision/single/arguments/array2.js +++ b/test/features/to-string/precision/single/arguments/array2.js @@ -34,21 +34,30 @@ function testArgument(mode, context, canvas) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('webgl', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl'); - testArgument('webgl', context, canvas); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'webgl', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl'); + testArgument('webgl', context, canvas); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('webgl2', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl2'); - testArgument('webgl2', context, canvas); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'webgl2', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl2'); + testArgument('webgl2', context, canvas); + } +); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('headlessgl', () => { - testArgument('headlessgl', require('gl')(1, 1), null); -}); +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'headlessgl', + () => { + testArgument('headlessgl', require('gl')(1, 1), null); + } +); test('cpu', () => { testArgument('cpu'); diff --git a/test/features/to-string/precision/single/arguments/array2d.js b/test/features/to-string/precision/single/arguments/array2d.js index 1eb6285b..0c90e719 100644 --- a/test/features/to-string/precision/single/arguments/array2d.js +++ b/test/features/to-string/precision/single/arguments/array2d.js @@ -47,21 +47,30 @@ function testArgument(mode, context, canvas) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('webgl', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl'); - testArgument('webgl', context, canvas); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'webgl', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl'); + testArgument('webgl', context, canvas); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('webgl2', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl2'); - testArgument('webgl2', context, canvas); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'webgl2', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl2'); + testArgument('webgl2', context, canvas); + } +); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('headlessgl', () => { - testArgument('headlessgl', require('gl')(1, 1), null); -}); +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'headlessgl', + () => { + testArgument('headlessgl', require('gl')(1, 1), null); + } +); test('cpu', () => { testArgument('cpu'); diff --git a/test/features/to-string/precision/single/arguments/array2d2.js b/test/features/to-string/precision/single/arguments/array2d2.js index 7bde045e..a6208ddb 100644 --- a/test/features/to-string/precision/single/arguments/array2d2.js +++ b/test/features/to-string/precision/single/arguments/array2d2.js @@ -61,21 +61,30 @@ function testArgument(mode, context, canvas) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('webgl', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl'); - testArgument('webgl', context, canvas); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'webgl', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl'); + testArgument('webgl', context, canvas); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('webgl2', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl2'); - testArgument('webgl2', context, canvas); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'webgl2', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl2'); + testArgument('webgl2', context, canvas); + } +); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('headlessgl', () => { - testArgument('headlessgl', require('gl')(1, 1), null); -}); +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'headlessgl', + () => { + testArgument('headlessgl', require('gl')(1, 1), null); + } +); test('cpu', () => { testArgument('cpu'); diff --git a/test/features/to-string/precision/single/arguments/array2d3.js b/test/features/to-string/precision/single/arguments/array2d3.js index 0f1e4b94..a7bf1718 100644 --- a/test/features/to-string/precision/single/arguments/array2d3.js +++ b/test/features/to-string/precision/single/arguments/array2d3.js @@ -62,21 +62,30 @@ function testArgument(mode, context, canvas) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('webgl', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl'); - testArgument('webgl', context, canvas); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'webgl', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl'); + testArgument('webgl', context, canvas); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('webgl2', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl2'); - testArgument('webgl2', context, canvas); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'webgl2', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl2'); + testArgument('webgl2', context, canvas); + } +); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('headlessgl', () => { - testArgument('headlessgl', require('gl')(1, 1), null); -}); +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'headlessgl', + () => { + testArgument('headlessgl', require('gl')(1, 1), null); + } +); test('cpu', () => { testArgument('cpu'); diff --git a/test/features/to-string/precision/single/arguments/array3.js b/test/features/to-string/precision/single/arguments/array3.js index 1341d4c2..1d0c33d4 100644 --- a/test/features/to-string/precision/single/arguments/array3.js +++ b/test/features/to-string/precision/single/arguments/array3.js @@ -34,21 +34,30 @@ function testArgument(mode, context, canvas) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('webgl', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl'); - testArgument('webgl', context, canvas); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'webgl', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl'); + testArgument('webgl', context, canvas); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('webgl2', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl2'); - testArgument('webgl2', context, canvas); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'webgl2', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl2'); + testArgument('webgl2', context, canvas); + } +); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('headlessgl', () => { - testArgument('headlessgl', require('gl')(1, 1), null); -}); +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'headlessgl', + () => { + testArgument('headlessgl', require('gl')(1, 1), null); + } +); test('cpu', () => { testArgument('cpu'); diff --git a/test/features/to-string/precision/single/arguments/array3d.js b/test/features/to-string/precision/single/arguments/array3d.js index fe6cc916..b0524cc2 100644 --- a/test/features/to-string/precision/single/arguments/array3d.js +++ b/test/features/to-string/precision/single/arguments/array3d.js @@ -57,21 +57,30 @@ function testArgument(mode, context, canvas) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('webgl', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl'); - testArgument('webgl', context, canvas); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'webgl', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl'); + testArgument('webgl', context, canvas); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('webgl2', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl2'); - testArgument('webgl2', context, canvas); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'webgl2', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl2'); + testArgument('webgl2', context, canvas); + } +); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('headlessgl', () => { - testArgument('headlessgl', require('gl')(1, 1), null); -}); +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'headlessgl', + () => { + testArgument('headlessgl', require('gl')(1, 1), null); + } +); test('cpu', () => { testArgument('cpu'); diff --git a/test/features/to-string/precision/single/arguments/array4.js b/test/features/to-string/precision/single/arguments/array4.js index a3b9e381..ebea2ab7 100644 --- a/test/features/to-string/precision/single/arguments/array4.js +++ b/test/features/to-string/precision/single/arguments/array4.js @@ -34,21 +34,30 @@ function testArgument(mode, context, canvas) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('webgl', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl'); - testArgument('webgl', context, canvas); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'webgl', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl'); + testArgument('webgl', context, canvas); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('webgl2', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl2'); - testArgument('webgl2', context, canvas); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'webgl2', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl2'); + testArgument('webgl2', context, canvas); + } +); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('headlessgl', () => { - testArgument('headlessgl', require('gl')(1, 1), null); -}); +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'headlessgl', + () => { + testArgument('headlessgl', require('gl')(1, 1), null); + } +); test('cpu', () => { testArgument('cpu'); diff --git a/test/features/to-string/precision/single/arguments/boolean.js b/test/features/to-string/precision/single/arguments/boolean.js index eeb65a52..dc861262 100644 --- a/test/features/to-string/precision/single/arguments/boolean.js +++ b/test/features/to-string/precision/single/arguments/boolean.js @@ -25,21 +25,30 @@ function testArgument(mode, context, canvas) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('webgl', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl'); - testArgument('webgl', context, canvas); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'webgl', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl'); + testArgument('webgl', context, canvas); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('webgl2', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl2'); - testArgument('webgl2', context, canvas); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'webgl2', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl2'); + testArgument('webgl2', context, canvas); + } +); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('headlessgl', () => { - testArgument('headlessgl', require('gl')(1, 1), null); -}); +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'headlessgl', + () => { + testArgument('headlessgl', require('gl')(1, 1), null); + } +); test('cpu', () => { testArgument('cpu'); diff --git a/test/features/to-string/precision/single/arguments/float.js b/test/features/to-string/precision/single/arguments/float.js index f6ef9ec0..77eaddf9 100644 --- a/test/features/to-string/precision/single/arguments/float.js +++ b/test/features/to-string/precision/single/arguments/float.js @@ -27,21 +27,30 @@ function testArgument(mode, context, canvas) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('webgl', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl'); - testArgument('webgl', context, canvas); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'webgl', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl'); + testArgument('webgl', context, canvas); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('webgl2', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl2'); - testArgument('webgl2', context, canvas); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'webgl2', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl2'); + testArgument('webgl2', context, canvas); + } +); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('headlessgl', () => { - testArgument('headlessgl', require('gl')(1, 1), null); -}); +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'headlessgl', + () => { + testArgument('headlessgl', require('gl')(1, 1), null); + } +); test('cpu', () => { testArgument('cpu'); diff --git a/test/features/to-string/precision/single/arguments/html-canvas.js b/test/features/to-string/precision/single/arguments/html-canvas.js index 2841ced6..c5c14de0 100644 --- a/test/features/to-string/precision/single/arguments/html-canvas.js +++ b/test/features/to-string/precision/single/arguments/html-canvas.js @@ -34,10 +34,16 @@ function testArgument(mode, done) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('webgl', () => { - testArgument('webgl'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'webgl', + () => { + testArgument('webgl'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('webgl2', () => { - testArgument('webgl2'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'webgl2', + () => { + testArgument('webgl2'); + } +); diff --git a/test/features/to-string/precision/single/arguments/html-image-array.js b/test/features/to-string/precision/single/arguments/html-image-array.js index 43a835ad..0d2725e5 100644 --- a/test/features/to-string/precision/single/arguments/html-image-array.js +++ b/test/features/to-string/precision/single/arguments/html-image-array.js @@ -4,7 +4,12 @@ const { GPU, CPUKernel } = require('../../../../../../src'); describe('feature: to-string single precision arguments HTMLImageArray'); function testArgument(mode, done) { - loadImages(['jellyfish-1.jpeg', 'jellyfish-2.jpeg', 'jellyfish-3.jpeg', 'jellyfish-4.jpeg']).then(([image1, image2, image3, image4]) => { + loadImages([ + 'jellyfish-1.jpeg', + 'jellyfish-2.jpeg', + 'jellyfish-3.jpeg', + 'jellyfish-4.jpeg', + ]).then(([image1, image2, image3, image4]) => { const imagesArray1 = [image1, image2]; const imagesArray2 = [image3, image4]; const gpu = new GPU({ mode }); @@ -49,15 +54,21 @@ function testArgument(mode, done) { }); } -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('webgl', t => { - const done = t.async(); - testArgument('webgl', kernel => { - // They aren't supported, so test that kernel falls back - assert.equal(kernel.kernel.constructor, CPUKernel); - done(); - }); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'webgl', + t => { + const done = t.async(); + testArgument('webgl', kernel => { + // They aren't supported, so test that kernel falls back + assert.equal(kernel.kernel.constructor, CPUKernel); + done(); + }); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('webgl2', t => { - testArgument('webgl2', t.async()); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'webgl2', + t => { + testArgument('webgl2', t.async()); + } +); diff --git a/test/features/to-string/precision/single/arguments/html-image.js b/test/features/to-string/precision/single/arguments/html-image.js index 7683099d..eb2f7db8 100644 --- a/test/features/to-string/precision/single/arguments/html-image.js +++ b/test/features/to-string/precision/single/arguments/html-image.js @@ -4,38 +4,46 @@ const { GPU } = require('../../../../../../src'); describe('feature: to-string single precision arguments HTMLImage'); function testArgument(mode, done) { - loadImages(['jellyfish-1.jpeg', 'jellyfish-2.jpeg']).then(([image1, image2]) => { - const gpu = new GPU({ mode }); - const originalKernel = gpu.createKernel( - function (a) { - const pixel = a[0][0]; - return pixel.b * 255; - }, - { - output: [1], - precision: 'single', - argumentTypes: ['HTMLImage'], - } - ); - const canvas = originalKernel.canvas; - const context = originalKernel.context; - assert.deepEqual(originalKernel(image1)[0], 253); - const kernelString = originalKernel.toString(image1); - const newKernel = new Function('return ' + kernelString)()({ - context, - canvas, - }); - assert.deepEqual(newKernel(image1)[0], 253); - assert.deepEqual(newKernel(image2)[0], 255); - gpu.destroy(); - done(); - }); + loadImages(['jellyfish-1.jpeg', 'jellyfish-2.jpeg']).then( + ([image1, image2]) => { + const gpu = new GPU({ mode }); + const originalKernel = gpu.createKernel( + function (a) { + const pixel = a[0][0]; + return pixel.b * 255; + }, + { + output: [1], + precision: 'single', + argumentTypes: ['HTMLImage'], + } + ); + const canvas = originalKernel.canvas; + const context = originalKernel.context; + assert.deepEqual(originalKernel(image1)[0], 253); + const kernelString = originalKernel.toString(image1); + const newKernel = new Function('return ' + kernelString)()({ + context, + canvas, + }); + assert.deepEqual(newKernel(image1)[0], 253); + assert.deepEqual(newKernel(image2)[0], 255); + gpu.destroy(); + done(); + } + ); } -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('webgl', t => { - testArgument('webgl', t.async()); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'webgl', + t => { + testArgument('webgl', t.async()); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('webgl2', t => { - testArgument('webgl2', t.async()); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'webgl2', + t => { + testArgument('webgl2', t.async()); + } +); diff --git a/test/features/to-string/precision/single/arguments/input.js b/test/features/to-string/precision/single/arguments/input.js index bcd39430..f6aca281 100644 --- a/test/features/to-string/precision/single/arguments/input.js +++ b/test/features/to-string/precision/single/arguments/input.js @@ -33,21 +33,30 @@ function testArgument(mode, context, canvas) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('webgl', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl'); - testArgument('webgl', context, canvas); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'webgl', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl'); + testArgument('webgl', context, canvas); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('webgl2', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl2'); - testArgument('webgl2', context, canvas); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'webgl2', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl2'); + testArgument('webgl2', context, canvas); + } +); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('headlessgl', () => { - testArgument('headlessgl', require('gl')(1, 1), null); -}); +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'headlessgl', + () => { + testArgument('headlessgl', require('gl')(1, 1), null); + } +); test('cpu', () => { testArgument('cpu'); diff --git a/test/features/to-string/precision/single/arguments/integer.js b/test/features/to-string/precision/single/arguments/integer.js index f18e434d..d266789e 100644 --- a/test/features/to-string/precision/single/arguments/integer.js +++ b/test/features/to-string/precision/single/arguments/integer.js @@ -27,21 +27,30 @@ function testArgument(mode, context, canvas) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('webgl', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl'); - testArgument('webgl', context, canvas); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'webgl', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl'); + testArgument('webgl', context, canvas); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('webgl2', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl2'); - testArgument('webgl2', context, canvas); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'webgl2', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl2'); + testArgument('webgl2', context, canvas); + } +); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('headlessgl', () => { - testArgument('headlessgl', require('gl')(1, 1), null); -}); +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'headlessgl', + () => { + testArgument('headlessgl', require('gl')(1, 1), null); + } +); test('cpu', () => { testArgument('cpu'); diff --git a/test/features/to-string/precision/single/arguments/memory-optimized-number-texture.js b/test/features/to-string/precision/single/arguments/memory-optimized-number-texture.js index 10428c8e..9f2fe765 100644 --- a/test/features/to-string/precision/single/arguments/memory-optimized-number-texture.js +++ b/test/features/to-string/precision/single/arguments/memory-optimized-number-texture.js @@ -1,7 +1,9 @@ const { assert, skip, test, module: describe, only } = require('qunit'); const { GPU } = require('../../../../../../src'); -describe('feature: to-string single precision arguments MemoryOptimizedNumberTexture'); +describe( + 'feature: to-string single precision arguments MemoryOptimizedNumberTexture' +); function testArgument(mode, context, canvas) { const gpu = new GPU({ mode, context, canvas }); @@ -48,21 +50,30 @@ function testArgument(mode, context, canvas) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('webgl', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl'); - testArgument('webgl', context, canvas); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'webgl', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl'); + testArgument('webgl', context, canvas); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('webgl2', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl2'); - testArgument('webgl2', context, canvas); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'webgl2', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl2'); + testArgument('webgl2', context, canvas); + } +); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('headlessgl', () => { - testArgument('headlessgl', require('gl')(1, 1), null); -}); +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'headlessgl', + () => { + testArgument('headlessgl', require('gl')(1, 1), null); + } +); test('cpu', () => { testArgument('cpu'); diff --git a/test/features/to-string/precision/single/arguments/number-texture.js b/test/features/to-string/precision/single/arguments/number-texture.js index 53fd2e1d..2716e54c 100644 --- a/test/features/to-string/precision/single/arguments/number-texture.js +++ b/test/features/to-string/precision/single/arguments/number-texture.js @@ -48,21 +48,30 @@ function testArgument(mode, context, canvas) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('webgl', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl'); - testArgument('webgl', context, canvas); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'webgl', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl'); + testArgument('webgl', context, canvas); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('webgl2', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl2'); - testArgument('webgl2', context, canvas); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'webgl2', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl2'); + testArgument('webgl2', context, canvas); + } +); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('headlessgl', () => { - testArgument('headlessgl', require('gl')(1, 1), null); -}); +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'headlessgl', + () => { + testArgument('headlessgl', require('gl')(1, 1), null); + } +); test('cpu', () => { testArgument('cpu'); diff --git a/test/features/to-string/precision/single/constants/array.js b/test/features/to-string/precision/single/constants/array.js index 520af2c8..0cc5cdfa 100644 --- a/test/features/to-string/precision/single/constants/array.js +++ b/test/features/to-string/precision/single/constants/array.js @@ -38,21 +38,30 @@ function testConstant(mode, context, canvas) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('webgl', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl'); - testConstant('webgl', context, canvas); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'webgl', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl'); + testConstant('webgl', context, canvas); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('webgl2', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl2'); - testConstant('webgl2', context, canvas); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'webgl2', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl2'); + testConstant('webgl2', context, canvas); + } +); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('headlessgl', () => { - testConstant('headlessgl', require('gl')(1, 1), null); -}); +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'headlessgl', + () => { + testConstant('headlessgl', require('gl')(1, 1), null); + } +); test('cpu', () => { testConstant('cpu'); diff --git a/test/features/to-string/precision/single/constants/array2.js b/test/features/to-string/precision/single/constants/array2.js index f219178d..ded5828a 100644 --- a/test/features/to-string/precision/single/constants/array2.js +++ b/test/features/to-string/precision/single/constants/array2.js @@ -42,21 +42,30 @@ function testConstant(mode, context, canvas) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('webgl', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl'); - testConstant('webgl', context, canvas); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'webgl', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl'); + testConstant('webgl', context, canvas); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('webgl2', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl2'); - testConstant('webgl2', context, canvas); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'webgl2', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl2'); + testConstant('webgl2', context, canvas); + } +); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('headlessgl', () => { - testConstant('headlessgl', require('gl')(1, 1), null); -}); +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'headlessgl', + () => { + testConstant('headlessgl', require('gl')(1, 1), null); + } +); test('cpu', () => { testConstant('cpu'); diff --git a/test/features/to-string/precision/single/constants/array2d.js b/test/features/to-string/precision/single/constants/array2d.js index 89258dc4..6a4a3f1d 100644 --- a/test/features/to-string/precision/single/constants/array2d.js +++ b/test/features/to-string/precision/single/constants/array2d.js @@ -49,21 +49,30 @@ function testConstant(mode, context, canvas) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('webgl', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl'); - testConstant('webgl', context, canvas); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'webgl', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl'); + testConstant('webgl', context, canvas); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('webgl2', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl2'); - testConstant('webgl2', context, canvas); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'webgl2', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl2'); + testConstant('webgl2', context, canvas); + } +); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('headlessgl', () => { - testConstant('headlessgl', require('gl')(1, 1), null); -}); +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'headlessgl', + () => { + testConstant('headlessgl', require('gl')(1, 1), null); + } +); test('cpu', () => { testConstant('cpu'); diff --git a/test/features/to-string/precision/single/constants/array3.js b/test/features/to-string/precision/single/constants/array3.js index a22f15fe..93ec4ca1 100644 --- a/test/features/to-string/precision/single/constants/array3.js +++ b/test/features/to-string/precision/single/constants/array3.js @@ -42,21 +42,30 @@ function testConstant(mode, context, canvas) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('webgl', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl'); - testConstant('webgl', context, canvas); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'webgl', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl'); + testConstant('webgl', context, canvas); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('webgl2', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl2'); - testConstant('webgl2', context, canvas); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'webgl2', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl2'); + testConstant('webgl2', context, canvas); + } +); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('headlessgl', () => { - testConstant('headlessgl', require('gl')(1, 1), null); -}); +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'headlessgl', + () => { + testConstant('headlessgl', require('gl')(1, 1), null); + } +); test('cpu', () => { testConstant('cpu'); diff --git a/test/features/to-string/precision/single/constants/array3d.js b/test/features/to-string/precision/single/constants/array3d.js index 2e92f7bb..cb1c6db6 100644 --- a/test/features/to-string/precision/single/constants/array3d.js +++ b/test/features/to-string/precision/single/constants/array3d.js @@ -60,21 +60,30 @@ function testConstant(mode, context, canvas) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('webgl', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl'); - testConstant('webgl', context, canvas); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'webgl', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl'); + testConstant('webgl', context, canvas); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('webgl2', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl2'); - testConstant('webgl2', context, canvas); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'webgl2', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl2'); + testConstant('webgl2', context, canvas); + } +); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('headlessgl', () => { - testConstant('headlessgl', require('gl')(1, 1), null); -}); +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'headlessgl', + () => { + testConstant('headlessgl', require('gl')(1, 1), null); + } +); test('cpu', () => { testConstant('cpu'); diff --git a/test/features/to-string/precision/single/constants/array4.js b/test/features/to-string/precision/single/constants/array4.js index c32d3a4f..32b5cfba 100644 --- a/test/features/to-string/precision/single/constants/array4.js +++ b/test/features/to-string/precision/single/constants/array4.js @@ -44,21 +44,30 @@ function testConstant(mode, context, canvas) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('webgl', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl'); - testConstant('webgl', context, canvas); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'webgl', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl'); + testConstant('webgl', context, canvas); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('webgl2', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl2'); - testConstant('webgl2', context, canvas); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'webgl2', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl2'); + testConstant('webgl2', context, canvas); + } +); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('headlessgl', () => { - testConstant('headlessgl', require('gl')(1, 1), null); -}); +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'headlessgl', + () => { + testConstant('headlessgl', require('gl')(1, 1), null); + } +); test('cpu', () => { testConstant('cpu'); diff --git a/test/features/to-string/precision/single/constants/boolean.js b/test/features/to-string/precision/single/constants/boolean.js index 2842e584..cc8bcf74 100644 --- a/test/features/to-string/precision/single/constants/boolean.js +++ b/test/features/to-string/precision/single/constants/boolean.js @@ -52,21 +52,30 @@ function testConstant(mode, context, canvas) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('webgl', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl'); - testConstant('webgl', context, canvas); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'webgl', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl'); + testConstant('webgl', context, canvas); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('webgl2', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl2'); - testConstant('webgl2', context, canvas); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'webgl2', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl2'); + testConstant('webgl2', context, canvas); + } +); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('headlessgl', () => { - testConstant('headlessgl', require('gl')(1, 1), null); -}); +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'headlessgl', + () => { + testConstant('headlessgl', require('gl')(1, 1), null); + } +); test('cpu', () => { testConstant('cpu'); diff --git a/test/features/to-string/precision/single/constants/float.js b/test/features/to-string/precision/single/constants/float.js index 8c9447e1..62c86dfa 100644 --- a/test/features/to-string/precision/single/constants/float.js +++ b/test/features/to-string/precision/single/constants/float.js @@ -31,21 +31,30 @@ function testConstant(mode, context, canvas) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('webgl', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl'); - testConstant('webgl', context, canvas); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'webgl', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl'); + testConstant('webgl', context, canvas); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('webgl2', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl2'); - testConstant('webgl2', context, canvas); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'webgl2', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl2'); + testConstant('webgl2', context, canvas); + } +); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('headlessgl', () => { - testConstant('headlessgl', require('gl')(1, 1), null); -}); +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'headlessgl', + () => { + testConstant('headlessgl', require('gl')(1, 1), null); + } +); test('cpu', () => { testConstant('cpu'); diff --git a/test/features/to-string/precision/single/constants/html-canvas.js b/test/features/to-string/precision/single/constants/html-canvas.js index ece2f052..8aebc537 100644 --- a/test/features/to-string/precision/single/constants/html-canvas.js +++ b/test/features/to-string/precision/single/constants/html-canvas.js @@ -38,10 +38,16 @@ function testArgument(mode, done) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('webgl', () => { - testArgument('webgl'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'webgl', + () => { + testArgument('webgl'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('webgl2', () => { - testArgument('webgl2'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'webgl2', + () => { + testArgument('webgl2'); + } +); diff --git a/test/features/to-string/precision/single/constants/html-image-array.js b/test/features/to-string/precision/single/constants/html-image-array.js index d4087966..e8ecf1fe 100644 --- a/test/features/to-string/precision/single/constants/html-image-array.js +++ b/test/features/to-string/precision/single/constants/html-image-array.js @@ -4,7 +4,12 @@ const { GPU, CPUKernel } = require('../../../../../../src'); describe('feature: to-string single precision constants HTMLImageArray'); function testArgument(mode, done) { - loadImages(['jellyfish-1.jpeg', 'jellyfish-2.jpeg', 'jellyfish-3.jpeg', 'jellyfish-4.jpeg']).then(([image1, image2, image3, image4]) => { + loadImages([ + 'jellyfish-1.jpeg', + 'jellyfish-2.jpeg', + 'jellyfish-3.jpeg', + 'jellyfish-4.jpeg', + ]).then(([image1, image2, image3, image4]) => { const images1 = [image1, image2]; const images2 = [image3, image4]; const gpu = new GPU({ mode }); @@ -56,19 +61,28 @@ function testArgument(mode, done) { }); } -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('webgl', t => { - const done = t.async(); - testArgument('webgl', kernel => { - // They aren't supported, so test that kernel falls back - assert.equal(kernel.kernel.constructor, CPUKernel); - done(); - }); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'webgl', + t => { + const done = t.async(); + testArgument('webgl', kernel => { + // They aren't supported, so test that kernel falls back + assert.equal(kernel.kernel.constructor, CPUKernel); + done(); + }); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('webgl2', t => { - testArgument('webgl2', t.async()); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'webgl2', + t => { + testArgument('webgl2', t.async()); + } +); -(GPU.isSinglePrecisionSupported && (GPU.isWebGLSupported || GPU.isWebGL2Supported) ? test : skip)('cpu', t => { +(GPU.isSinglePrecisionSupported && + (GPU.isWebGLSupported || GPU.isWebGL2Supported) + ? test + : skip)('cpu', t => { testArgument('cpu', t.async()); }); diff --git a/test/features/to-string/precision/single/constants/html-image.js b/test/features/to-string/precision/single/constants/html-image.js index 831488c3..76a90c71 100644 --- a/test/features/to-string/precision/single/constants/html-image.js +++ b/test/features/to-string/precision/single/constants/html-image.js @@ -4,42 +4,53 @@ const { GPU } = require('../../../../../../src'); describe('feature: to-string single precision constants HTMLImage'); function testArgument(mode, done) { - loadImages(['jellyfish-1.jpeg', 'jellyfish-2.jpeg']).then(([image1, image2]) => { - const gpu = new GPU({ mode }); - const originalKernel = gpu.createKernel( - function () { - const pixel = this.constants.a[0][0]; - return pixel.b * 255; - }, - { - output: [1], - precision: 'single', - constants: { a: image1 }, - } - ); - const canvas = originalKernel.canvas; - const context = originalKernel.context; - assert.deepEqual(originalKernel()[0], 253); - const kernelString = originalKernel.toString(); - const newKernel = new Function('return ' + kernelString)()({ - context, - canvas, - constants: { a: image2 }, - }); - assert.deepEqual(newKernel(image2)[0], 255); - gpu.destroy(); - done(); - }); + loadImages(['jellyfish-1.jpeg', 'jellyfish-2.jpeg']).then( + ([image1, image2]) => { + const gpu = new GPU({ mode }); + const originalKernel = gpu.createKernel( + function () { + const pixel = this.constants.a[0][0]; + return pixel.b * 255; + }, + { + output: [1], + precision: 'single', + constants: { a: image1 }, + } + ); + const canvas = originalKernel.canvas; + const context = originalKernel.context; + assert.deepEqual(originalKernel()[0], 253); + const kernelString = originalKernel.toString(); + const newKernel = new Function('return ' + kernelString)()({ + context, + canvas, + constants: { a: image2 }, + }); + assert.deepEqual(newKernel(image2)[0], 255); + gpu.destroy(); + done(); + } + ); } -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('webgl', t => { - testArgument('webgl', t.async()); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'webgl', + t => { + testArgument('webgl', t.async()); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('webgl2', t => { - testArgument('webgl2', t.async()); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'webgl2', + t => { + testArgument('webgl2', t.async()); + } +); -(GPU.isSinglePrecisionSupported && (GPU.isWebGLSupported || GPU.isWebGL2Supported) ? test : skip)('cpu', t => { +(GPU.isSinglePrecisionSupported && + (GPU.isWebGLSupported || GPU.isWebGL2Supported) + ? test + : skip)('cpu', t => { testArgument('cpu', t.async()); }); diff --git a/test/features/to-string/precision/single/constants/input.js b/test/features/to-string/precision/single/constants/input.js index 6d0fc039..3d4949b9 100644 --- a/test/features/to-string/precision/single/constants/input.js +++ b/test/features/to-string/precision/single/constants/input.js @@ -38,21 +38,30 @@ function testConstant(mode, context, canvas) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('webgl', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl'); - testConstant('webgl', context, canvas); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'webgl', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl'); + testConstant('webgl', context, canvas); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('webgl2', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl2'); - testConstant('webgl2', context, canvas); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'webgl2', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl2'); + testConstant('webgl2', context, canvas); + } +); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('headlessgl', () => { - testConstant('headlessgl', require('gl')(1, 1), null); -}); +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'headlessgl', + () => { + testConstant('headlessgl', require('gl')(1, 1), null); + } +); test('cpu', () => { testConstant('cpu'); diff --git a/test/features/to-string/precision/single/constants/integer.js b/test/features/to-string/precision/single/constants/integer.js index 68d97009..10afc964 100644 --- a/test/features/to-string/precision/single/constants/integer.js +++ b/test/features/to-string/precision/single/constants/integer.js @@ -33,21 +33,30 @@ function testConstant(mode, context, canvas) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('webgl', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl'); - testConstant('webgl', context, canvas); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'webgl', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl'); + testConstant('webgl', context, canvas); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('webgl2', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl2'); - testConstant('webgl2', context, canvas); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'webgl2', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl2'); + testConstant('webgl2', context, canvas); + } +); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('headlessgl', () => { - testConstant('headlessgl', require('gl')(1, 1), null); -}); +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'headlessgl', + () => { + testConstant('headlessgl', require('gl')(1, 1), null); + } +); test('cpu', () => { testConstant('cpu'); diff --git a/test/features/to-string/precision/single/constants/memory-optimized-number-texture.js b/test/features/to-string/precision/single/constants/memory-optimized-number-texture.js index cf4d5020..d55810fd 100644 --- a/test/features/to-string/precision/single/constants/memory-optimized-number-texture.js +++ b/test/features/to-string/precision/single/constants/memory-optimized-number-texture.js @@ -1,7 +1,9 @@ const { assert, skip, test, module: describe, only } = require('qunit'); const { GPU } = require('../../../../../../src'); -describe('feature: to-string single precision constants MemoryOptimizedNumberTexture'); +describe( + 'feature: to-string single precision constants MemoryOptimizedNumberTexture' +); function testConstant(mode, context, canvas) { const gpu = new GPU({ mode, context, canvas }); @@ -44,28 +46,43 @@ function testConstant(mode, context, canvas) { const Kernel = new Function('return ' + kernelString)(); const newKernel = Kernel({ context, constants: { a: texture } }); const newKernel2 = Kernel({ context, constants: { a: texture2 } }); - assert.deepEqual(texture2.toArray ? texture2.toArray() : texture2, new Float32Array([4, 3, 2, 1])); - assert.deepEqual(texture.toArray ? texture.toArray() : texture, new Float32Array([0, 1, 2, 3])); + assert.deepEqual( + texture2.toArray ? texture2.toArray() : texture2, + new Float32Array([4, 3, 2, 1]) + ); + assert.deepEqual( + texture.toArray ? texture.toArray() : texture, + new Float32Array([0, 1, 2, 3]) + ); assert.deepEqual(newKernel(), new Float32Array([0, 1, 2, 3])); assert.deepEqual(newKernel2(), new Float32Array([4, 3, 2, 1])); gpu.destroy(); } -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('webgl', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl'); - testConstant('webgl', context, canvas); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'webgl', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl'); + testConstant('webgl', context, canvas); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('webgl2', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl2'); - testConstant('webgl2', context, canvas); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'webgl2', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl2'); + testConstant('webgl2', context, canvas); + } +); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('headlessgl', () => { - testConstant('headlessgl', require('gl')(1, 1), null); -}); +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'headlessgl', + () => { + testConstant('headlessgl', require('gl')(1, 1), null); + } +); test('cpu', () => { testConstant('cpu'); diff --git a/test/features/to-string/precision/single/constants/number-texture.js b/test/features/to-string/precision/single/constants/number-texture.js index fd6fd9f0..f604b1ed 100644 --- a/test/features/to-string/precision/single/constants/number-texture.js +++ b/test/features/to-string/precision/single/constants/number-texture.js @@ -46,28 +46,43 @@ function testConstant(mode, context, canvas) { const Kernel = new Function('return ' + kernelString)(); const newKernel = Kernel({ context, constants: { a: texture } }); const newKernel2 = Kernel({ context, constants: { a: texture2 } }); - assert.deepEqual(texture2.toArray ? texture2.toArray() : texture2, new Float32Array([4, 3, 2, 1])); - assert.deepEqual(texture.toArray ? texture.toArray() : texture, new Float32Array([0, 1, 2, 3])); + assert.deepEqual( + texture2.toArray ? texture2.toArray() : texture2, + new Float32Array([4, 3, 2, 1]) + ); + assert.deepEqual( + texture.toArray ? texture.toArray() : texture, + new Float32Array([0, 1, 2, 3]) + ); assert.deepEqual(newKernel(), new Float32Array([0, 1, 2, 3])); assert.deepEqual(newKernel2(), new Float32Array([4, 3, 2, 1])); gpu.destroy(); } -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('webgl', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl'); - testConstant('webgl', context, canvas); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'webgl', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl'); + testConstant('webgl', context, canvas); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('webgl2', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl2'); - testConstant('webgl2', context, canvas); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'webgl2', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl2'); + testConstant('webgl2', context, canvas); + } +); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('headlessgl', () => { - testConstant('headlessgl', require('gl')(1, 1), null); -}); +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'headlessgl', + () => { + testConstant('headlessgl', require('gl')(1, 1), null); + } +); test('cpu', () => { testConstant('cpu'); diff --git a/test/features/to-string/precision/single/graphical.js b/test/features/to-string/precision/single/graphical.js index 222b0736..9ba2fd70 100644 --- a/test/features/to-string/precision/single/graphical.js +++ b/test/features/to-string/precision/single/graphical.js @@ -18,7 +18,10 @@ function testGraphical(mode, context, canvas) { } ); - const expected = new Uint8ClampedArray([255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]); + const expected = new Uint8ClampedArray([ + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, + ]); originalKernel(); assert.deepEqual(originalKernel.getPixels(), expected); const kernelString = originalKernel.toString(); @@ -31,21 +34,30 @@ function testGraphical(mode, context, canvas) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('webgl', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl'); - testGraphical('webgl', context, canvas); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'webgl', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl'); + testGraphical('webgl', context, canvas); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('webgl2', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl2'); - testGraphical('webgl2', context, canvas); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'webgl2', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl2'); + testGraphical('webgl2', context, canvas); + } +); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('headlessgl', () => { - testGraphical('headlessgl', require('gl')(1, 1), null); -}); +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'headlessgl', + () => { + testGraphical('headlessgl', require('gl')(1, 1), null); + } +); (GPU.isCanvasSupported ? test : skip)('cpu', () => { const canvas = document.createElement('canvas'); diff --git a/test/features/to-string/precision/single/kernel-map/array/array.js b/test/features/to-string/precision/single/kernel-map/array/array.js index e0c1eebe..9407de13 100644 --- a/test/features/to-string/precision/single/kernel-map/array/array.js +++ b/test/features/to-string/precision/single/kernel-map/array/array.js @@ -1,7 +1,9 @@ const { assert, skip, test, module: describe, only } = require('qunit'); const { GPU } = require('../../../../../../../src'); -describe('feature: to-string single precision array style kernel map returns Array'); +describe( + 'feature: to-string single precision array style kernel map returns Array' +); function testReturn(mode, context, canvas) { const gpu = new GPU({ mode }); @@ -36,21 +38,30 @@ function testReturn(mode, context, canvas) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('webgl', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl'); - testReturn('webgl', context, canvas); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'webgl', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl'); + testReturn('webgl', context, canvas); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('webgl2', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl2'); - testReturn('webgl2', context, canvas); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'webgl2', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl2'); + testReturn('webgl2', context, canvas); + } +); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('headlessgl', () => { - testReturn('headlessgl', require('gl')(1, 1), null); -}); +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'headlessgl', + () => { + testReturn('headlessgl', require('gl')(1, 1), null); + } +); test('cpu', () => { testReturn('cpu'); diff --git a/test/features/to-string/precision/single/kernel-map/array/array2d.js b/test/features/to-string/precision/single/kernel-map/array/array2d.js index 091e19aa..8b8c724b 100644 --- a/test/features/to-string/precision/single/kernel-map/array/array2d.js +++ b/test/features/to-string/precision/single/kernel-map/array/array2d.js @@ -1,7 +1,9 @@ const { assert, skip, test, module: describe, only } = require('qunit'); const { GPU } = require('../../../../../../../src'); -describe('feature: to-string single precision array style kernel map returns 2D Array'); +describe( + 'feature: to-string single precision array style kernel map returns 2D Array' +); function testReturn(mode, context, canvas) { const gpu = new GPU({ mode }); @@ -36,21 +38,30 @@ function testReturn(mode, context, canvas) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('webgl', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl'); - testReturn('webgl', context, canvas); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'webgl', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl'); + testReturn('webgl', context, canvas); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('webgl2', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl2'); - testReturn('webgl2', context, canvas); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'webgl2', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl2'); + testReturn('webgl2', context, canvas); + } +); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('headlessgl', () => { - testReturn('headlessgl', require('gl')(1, 1), null); -}); +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'headlessgl', + () => { + testReturn('headlessgl', require('gl')(1, 1), null); + } +); test('cpu', () => { testReturn('cpu'); diff --git a/test/features/to-string/precision/single/kernel-map/array/array3d.js b/test/features/to-string/precision/single/kernel-map/array/array3d.js index 85251e8c..ae90e843 100644 --- a/test/features/to-string/precision/single/kernel-map/array/array3d.js +++ b/test/features/to-string/precision/single/kernel-map/array/array3d.js @@ -1,7 +1,9 @@ const { assert, skip, test, module: describe, only } = require('qunit'); const { GPU } = require('../../../../../../../src'); -describe('feature: to-string single precision array style kernel map returns Array3d'); +describe( + 'feature: to-string single precision array style kernel map returns Array3d' +); function testReturn(mode, context, canvas) { const gpu = new GPU({ mode }); @@ -42,21 +44,30 @@ function testReturn(mode, context, canvas) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('webgl', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl'); - testReturn('webgl', context, canvas); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'webgl', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl'); + testReturn('webgl', context, canvas); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('webgl2', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl2'); - testReturn('webgl2', context, canvas); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'webgl2', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl2'); + testReturn('webgl2', context, canvas); + } +); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('headlessgl', () => { - testReturn('headlessgl', require('gl')(1, 1), null); -}); +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'headlessgl', + () => { + testReturn('headlessgl', require('gl')(1, 1), null); + } +); test('cpu', () => { testReturn('cpu'); diff --git a/test/features/to-string/precision/single/kernel-map/array/memory-optimized-number-texture.js b/test/features/to-string/precision/single/kernel-map/array/memory-optimized-number-texture.js index c2b72a85..edb31d6d 100644 --- a/test/features/to-string/precision/single/kernel-map/array/memory-optimized-number-texture.js +++ b/test/features/to-string/precision/single/kernel-map/array/memory-optimized-number-texture.js @@ -1,7 +1,9 @@ const { assert, skip, test, module: describe, only } = require('qunit'); const { GPU } = require('../../../../../../../src'); -describe('feature: to-string single precision array style kernel map returns MemoryOptimizedNumberTexture'); +describe( + 'feature: to-string single precision array style kernel map returns MemoryOptimizedNumberTexture' +); function testReturn(mode, context, canvas) { const gpu = new GPU({ mode }); @@ -38,18 +40,27 @@ function testReturn(mode, context, canvas) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('webgl', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl'); - testReturn('webgl', context, canvas); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'webgl', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl'); + testReturn('webgl', context, canvas); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('webgl2', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl2'); - testReturn('webgl2', context, canvas); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'webgl2', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl2'); + testReturn('webgl2', context, canvas); + } +); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('headlessgl', () => { - testReturn('headlessgl', require('gl')(1, 1), null); -}); +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'headlessgl', + () => { + testReturn('headlessgl', require('gl')(1, 1), null); + } +); diff --git a/test/features/to-string/precision/single/kernel-map/array/number-texture.js b/test/features/to-string/precision/single/kernel-map/array/number-texture.js index 6749b5c6..250bcefb 100644 --- a/test/features/to-string/precision/single/kernel-map/array/number-texture.js +++ b/test/features/to-string/precision/single/kernel-map/array/number-texture.js @@ -1,7 +1,9 @@ const { assert, skip, test, module: describe, only } = require('qunit'); const { GPU } = require('../../../../../../../src'); -describe('feature: to-string single precision array style kernel map returns NumberTexture'); +describe( + 'feature: to-string single precision array style kernel map returns NumberTexture' +); function testReturn(mode, context, canvas) { const gpu = new GPU({ mode }); @@ -37,18 +39,27 @@ function testReturn(mode, context, canvas) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('webgl', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl'); - testReturn('webgl', context, canvas); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'webgl', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl'); + testReturn('webgl', context, canvas); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('webgl2', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl2'); - testReturn('webgl2', context, canvas); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'webgl2', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl2'); + testReturn('webgl2', context, canvas); + } +); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('headlessgl', () => { - testReturn('headlessgl', require('gl')(1, 1), null); -}); +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'headlessgl', + () => { + testReturn('headlessgl', require('gl')(1, 1), null); + } +); diff --git a/test/features/to-string/precision/single/kernel-map/object/array.js b/test/features/to-string/precision/single/kernel-map/object/array.js index ed0ad15a..0671d4d3 100644 --- a/test/features/to-string/precision/single/kernel-map/object/array.js +++ b/test/features/to-string/precision/single/kernel-map/object/array.js @@ -36,21 +36,30 @@ function testReturn(mode, context, canvas) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('webgl', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl'); - testReturn('webgl', context, canvas); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'webgl', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl'); + testReturn('webgl', context, canvas); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('webgl2', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl2'); - testReturn('webgl2', context, canvas); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'webgl2', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl2'); + testReturn('webgl2', context, canvas); + } +); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('headlessgl', () => { - testReturn('headlessgl', require('gl')(1, 1), null); -}); +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'headlessgl', + () => { + testReturn('headlessgl', require('gl')(1, 1), null); + } +); test('cpu', () => { testReturn('cpu'); diff --git a/test/features/to-string/precision/single/kernel-map/object/array2d.js b/test/features/to-string/precision/single/kernel-map/object/array2d.js index c85c5d3f..e1da95a0 100644 --- a/test/features/to-string/precision/single/kernel-map/object/array2d.js +++ b/test/features/to-string/precision/single/kernel-map/object/array2d.js @@ -36,21 +36,30 @@ function testReturn(mode, context, canvas) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('webgl', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl'); - testReturn('webgl', context, canvas); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'webgl', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl'); + testReturn('webgl', context, canvas); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('webgl2', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl2'); - testReturn('webgl2', context, canvas); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'webgl2', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl2'); + testReturn('webgl2', context, canvas); + } +); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('headlessgl', () => { - testReturn('headlessgl', require('gl')(1, 1), null); -}); +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'headlessgl', + () => { + testReturn('headlessgl', require('gl')(1, 1), null); + } +); test('cpu', () => { testReturn('cpu'); diff --git a/test/features/to-string/precision/single/kernel-map/object/array3d.js b/test/features/to-string/precision/single/kernel-map/object/array3d.js index 3f40adeb..2d5a9059 100644 --- a/test/features/to-string/precision/single/kernel-map/object/array3d.js +++ b/test/features/to-string/precision/single/kernel-map/object/array3d.js @@ -42,21 +42,30 @@ function testReturn(mode, context, canvas) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('webgl', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl'); - testReturn('webgl', context, canvas); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'webgl', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl'); + testReturn('webgl', context, canvas); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('webgl2', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl2'); - testReturn('webgl2', context, canvas); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'webgl2', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl2'); + testReturn('webgl2', context, canvas); + } +); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('headlessgl', () => { - testReturn('headlessgl', require('gl')(1, 1), null); -}); +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'headlessgl', + () => { + testReturn('headlessgl', require('gl')(1, 1), null); + } +); test('cpu', () => { testReturn('cpu'); diff --git a/test/features/to-string/precision/single/kernel-map/object/memory-optimized-number-texture.js b/test/features/to-string/precision/single/kernel-map/object/memory-optimized-number-texture.js index 11125d6b..a703208f 100644 --- a/test/features/to-string/precision/single/kernel-map/object/memory-optimized-number-texture.js +++ b/test/features/to-string/precision/single/kernel-map/object/memory-optimized-number-texture.js @@ -1,7 +1,9 @@ const { assert, skip, test, module: describe, only } = require('qunit'); const { GPU } = require('../../../../../../../src'); -describe('feature: to-string single precision object style kernel map returns MemoryOptimizedNumberTexture'); +describe( + 'feature: to-string single precision object style kernel map returns MemoryOptimizedNumberTexture' +); function testReturn(mode, context, canvas) { const gpu = new GPU({ mode }); @@ -38,18 +40,27 @@ function testReturn(mode, context, canvas) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('webgl', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl'); - testReturn('webgl', context, canvas); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'webgl', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl'); + testReturn('webgl', context, canvas); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('webgl2', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl2'); - testReturn('webgl2', context, canvas); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'webgl2', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl2'); + testReturn('webgl2', context, canvas); + } +); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('headlessgl', () => { - testReturn('headlessgl', require('gl')(1, 1), null); -}); +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'headlessgl', + () => { + testReturn('headlessgl', require('gl')(1, 1), null); + } +); diff --git a/test/features/to-string/precision/single/kernel-map/object/number-texture.js b/test/features/to-string/precision/single/kernel-map/object/number-texture.js index 5524f71d..a75e5894 100644 --- a/test/features/to-string/precision/single/kernel-map/object/number-texture.js +++ b/test/features/to-string/precision/single/kernel-map/object/number-texture.js @@ -1,7 +1,9 @@ const { assert, skip, test, module: describe, only } = require('qunit'); const { GPU } = require('../../../../../../../src'); -describe('feature: to-string single precision object style kernel map returns NumberTexture'); +describe( + 'feature: to-string single precision object style kernel map returns NumberTexture' +); function testReturn(mode, context, canvas) { const gpu = new GPU({ mode }); @@ -37,18 +39,27 @@ function testReturn(mode, context, canvas) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('webgl', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl'); - testReturn('webgl', context, canvas); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'webgl', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl'); + testReturn('webgl', context, canvas); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('webgl2', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl2'); - testReturn('webgl2', context, canvas); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'webgl2', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl2'); + testReturn('webgl2', context, canvas); + } +); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('headlessgl', () => { - testReturn('headlessgl', require('gl')(1, 1), null); -}); +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'headlessgl', + () => { + testReturn('headlessgl', require('gl')(1, 1), null); + } +); diff --git a/test/features/to-string/precision/single/returns/array.js b/test/features/to-string/precision/single/returns/array.js index 7ba47f4c..b536b2eb 100644 --- a/test/features/to-string/precision/single/returns/array.js +++ b/test/features/to-string/precision/single/returns/array.js @@ -27,21 +27,30 @@ function testReturn(mode, context, canvas) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('webgl', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl'); - testReturn('webgl', context, canvas); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'webgl', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl'); + testReturn('webgl', context, canvas); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('webgl2', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl2'); - testReturn('webgl2', context, canvas); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'webgl2', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl2'); + testReturn('webgl2', context, canvas); + } +); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('headlessgl', () => { - testReturn('headlessgl', require('gl')(1, 1), null); -}); +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'headlessgl', + () => { + testReturn('headlessgl', require('gl')(1, 1), null); + } +); test('cpu', () => { testReturn('cpu'); diff --git a/test/features/to-string/precision/single/returns/array2d.js b/test/features/to-string/precision/single/returns/array2d.js index 12fb3c73..3b595d82 100644 --- a/test/features/to-string/precision/single/returns/array2d.js +++ b/test/features/to-string/precision/single/returns/array2d.js @@ -23,26 +23,38 @@ function testReturn(mode, context, canvas) { const originalResult = originalKernel(a, b); assert.deepEqual(originalResult, expected); const kernelString = originalKernel.toString(a, b); - const newResult = new Function('return ' + kernelString)()({ context })(a, b); + const newResult = new Function('return ' + kernelString)()({ context })( + a, + b + ); assert.deepEqual(newResult, expected); gpu.destroy(); } -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('webgl', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl'); - testReturn('webgl', context, canvas); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'webgl', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl'); + testReturn('webgl', context, canvas); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('webgl2', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl2'); - testReturn('webgl2', context, canvas); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'webgl2', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl2'); + testReturn('webgl2', context, canvas); + } +); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('headlessgl', () => { - testReturn('headlessgl', require('gl')(1, 1), null); -}); +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'headlessgl', + () => { + testReturn('headlessgl', require('gl')(1, 1), null); + } +); test('cpu', () => { testReturn('cpu'); diff --git a/test/features/to-string/precision/single/returns/array3d.js b/test/features/to-string/precision/single/returns/array3d.js index d20899ff..a94245f6 100644 --- a/test/features/to-string/precision/single/returns/array3d.js +++ b/test/features/to-string/precision/single/returns/array3d.js @@ -27,26 +27,39 @@ function testReturn(mode, context, canvas) { const originalResult = originalKernel(a, b, c); assert.deepEqual(originalResult, expected); const kernelString = originalKernel.toString(a, b, c); - const newResult = new Function('return ' + kernelString)()({ context })(a, b, c); + const newResult = new Function('return ' + kernelString)()({ context })( + a, + b, + c + ); assert.deepEqual(newResult, expected); gpu.destroy(); } -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('webgl', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl'); - testReturn('webgl', context, canvas); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'webgl', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl'); + testReturn('webgl', context, canvas); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('webgl2', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl2'); - testReturn('webgl2', context, canvas); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'webgl2', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl2'); + testReturn('webgl2', context, canvas); + } +); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('headlessgl', () => { - testReturn('headlessgl', require('gl')(1, 1), null); -}); +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'headlessgl', + () => { + testReturn('headlessgl', require('gl')(1, 1), null); + } +); test('cpu', () => { testReturn('cpu'); diff --git a/test/features/to-string/precision/single/returns/texture.js b/test/features/to-string/precision/single/returns/texture.js index faa7e476..31191b0d 100644 --- a/test/features/to-string/precision/single/returns/texture.js +++ b/test/features/to-string/precision/single/returns/texture.js @@ -28,18 +28,27 @@ function testReturn(mode, context, canvas) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('webgl', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl'); - testReturn('webgl', context, canvas); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'webgl', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl'); + testReturn('webgl', context, canvas); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('webgl2', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl2'); - testReturn('webgl2', context, canvas); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'webgl2', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl2'); + testReturn('webgl2', context, canvas); + } +); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('headlessgl', () => { - testReturn('headlessgl', require('gl')(1, 1), null); -}); +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'headlessgl', + () => { + testReturn('headlessgl', require('gl')(1, 1), null); + } +); diff --git a/test/features/to-string/precision/unsigned/arguments/html-canvas.js b/test/features/to-string/precision/unsigned/arguments/html-canvas.js index 15e73de2..f4050e0e 100644 --- a/test/features/to-string/precision/unsigned/arguments/html-canvas.js +++ b/test/features/to-string/precision/unsigned/arguments/html-canvas.js @@ -34,10 +34,16 @@ function testArgument(mode, done) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('webgl', () => { - testArgument('webgl'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'webgl', + () => { + testArgument('webgl'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('webgl2', () => { - testArgument('webgl2'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'webgl2', + () => { + testArgument('webgl2'); + } +); diff --git a/test/features/to-string/precision/unsigned/arguments/html-image-array.js b/test/features/to-string/precision/unsigned/arguments/html-image-array.js index fd19d62e..6dfd236e 100644 --- a/test/features/to-string/precision/unsigned/arguments/html-image-array.js +++ b/test/features/to-string/precision/unsigned/arguments/html-image-array.js @@ -4,7 +4,12 @@ const { GPU, CPUKernel } = require('../../../../../../src'); describe('feature: to-string unsigned precision arguments HTMLImageArray'); function testArgument(mode, done) { - loadImages(['jellyfish-1.jpeg', 'jellyfish-2.jpeg', 'jellyfish-3.jpeg', 'jellyfish-4.jpeg']).then(([image1, image2, image3, image4]) => { + loadImages([ + 'jellyfish-1.jpeg', + 'jellyfish-2.jpeg', + 'jellyfish-3.jpeg', + 'jellyfish-4.jpeg', + ]).then(([image1, image2, image3, image4]) => { const imagesArray1 = [image1, image2]; const imagesArray2 = [image3, image4]; const gpu = new GPU({ mode }); diff --git a/test/features/to-string/precision/unsigned/arguments/html-image.js b/test/features/to-string/precision/unsigned/arguments/html-image.js index 2e0cbf69..ace04072 100644 --- a/test/features/to-string/precision/unsigned/arguments/html-image.js +++ b/test/features/to-string/precision/unsigned/arguments/html-image.js @@ -4,32 +4,34 @@ const { GPU } = require('../../../../../../src'); describe('feature: to-string unsigned precision arguments HTMLImage'); function testArgument(mode, done) { - loadImages(['jellyfish-1.jpeg', 'jellyfish-2.jpeg']).then(([image1, image2]) => { - const gpu = new GPU({ mode }); - const originalKernel = gpu.createKernel( - function (a) { - const pixel = a[0][0]; - return pixel.b * 255; - }, - { - output: [1], - precision: 'unsigned', - argumentTypes: ['HTMLImage'], - } - ); - const canvas = originalKernel.canvas; - const context = originalKernel.context; - assert.deepEqual(originalKernel(image1)[0], 253); - const kernelString = originalKernel.toString(image1); - const newKernel = new Function('return ' + kernelString)()({ - context, - canvas, - }); - assert.deepEqual(newKernel(image1)[0], 253); - assert.deepEqual(newKernel(image2)[0], 255); - gpu.destroy(); - done(); - }); + loadImages(['jellyfish-1.jpeg', 'jellyfish-2.jpeg']).then( + ([image1, image2]) => { + const gpu = new GPU({ mode }); + const originalKernel = gpu.createKernel( + function (a) { + const pixel = a[0][0]; + return pixel.b * 255; + }, + { + output: [1], + precision: 'unsigned', + argumentTypes: ['HTMLImage'], + } + ); + const canvas = originalKernel.canvas; + const context = originalKernel.context; + assert.deepEqual(originalKernel(image1)[0], 253); + const kernelString = originalKernel.toString(image1); + const newKernel = new Function('return ' + kernelString)()({ + context, + canvas, + }); + assert.deepEqual(newKernel(image1)[0], 253); + assert.deepEqual(newKernel(image2)[0], 255); + gpu.destroy(); + done(); + } + ); } (GPU.isWebGLSupported ? test : skip)('webgl', t => { diff --git a/test/features/to-string/precision/unsigned/arguments/memory-optimized-number-texture.js b/test/features/to-string/precision/unsigned/arguments/memory-optimized-number-texture.js index c86d45b9..385121f5 100644 --- a/test/features/to-string/precision/unsigned/arguments/memory-optimized-number-texture.js +++ b/test/features/to-string/precision/unsigned/arguments/memory-optimized-number-texture.js @@ -1,7 +1,9 @@ const { assert, skip, test, module: describe, only } = require('qunit'); const { GPU } = require('../../../../../../src'); -describe('feature: to-string unsigned precision arguments MemoryOptimizedNumberTexture'); +describe( + 'feature: to-string unsigned precision arguments MemoryOptimizedNumberTexture' +); function testArgument(mode, context, canvas) { const gpu = new GPU({ mode, context, canvas }); diff --git a/test/features/to-string/precision/unsigned/constants/html-canvas.js b/test/features/to-string/precision/unsigned/constants/html-canvas.js index 75e31876..eed2bd20 100644 --- a/test/features/to-string/precision/unsigned/constants/html-canvas.js +++ b/test/features/to-string/precision/unsigned/constants/html-canvas.js @@ -38,10 +38,16 @@ function testArgument(mode, done) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('webgl', () => { - testArgument('webgl'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'webgl', + () => { + testArgument('webgl'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('webgl2', () => { - testArgument('webgl2'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'webgl2', + () => { + testArgument('webgl2'); + } +); diff --git a/test/features/to-string/precision/unsigned/constants/html-image-array.js b/test/features/to-string/precision/unsigned/constants/html-image-array.js index 685f6b3e..26c200fa 100644 --- a/test/features/to-string/precision/unsigned/constants/html-image-array.js +++ b/test/features/to-string/precision/unsigned/constants/html-image-array.js @@ -4,7 +4,12 @@ const { GPU, CPUKernel } = require('../../../../../../src'); describe('feature: to-string unsigned precision constants HTMLImageArray'); function testArgument(mode, done) { - loadImages(['jellyfish-1.jpeg', 'jellyfish-2.jpeg', 'jellyfish-3.jpeg', 'jellyfish-4.jpeg']).then(([image1, image2, image3, image4]) => { + loadImages([ + 'jellyfish-1.jpeg', + 'jellyfish-2.jpeg', + 'jellyfish-3.jpeg', + 'jellyfish-4.jpeg', + ]).then(([image1, image2, image3, image4]) => { const images1 = [image1, image2]; const images2 = [image3, image4]; const gpu = new GPU({ mode }); diff --git a/test/features/to-string/precision/unsigned/constants/html-image.js b/test/features/to-string/precision/unsigned/constants/html-image.js index 9ac78776..f9681f59 100644 --- a/test/features/to-string/precision/unsigned/constants/html-image.js +++ b/test/features/to-string/precision/unsigned/constants/html-image.js @@ -1,38 +1,44 @@ const { assert, skip, test, module: describe, only } = require('qunit'); const { GPU, utils } = require('../../../../../../src'); -const { loadImage, imageToArray, check2DImage } = require('../../../../../browser-test-utils'); +const { + loadImage, + imageToArray, + check2DImage, +} = require('../../../../../browser-test-utils'); describe('feature: to-string unsigned precision constants HTMLImage'); function testArgument(mode, done) { - loadImages(['jellyfish-1.jpeg', 'jellyfish-2.jpeg']).then(([image1, image2]) => { - const gpu = new GPU({ mode }); - const originalKernel = gpu.createKernel( - function () { - const pixel = this.constants.a[0][0]; - return pixel.b * 255; - }, - { - output: [1], - precision: 'unsigned', - constants: { a: image1 }, - } - ); - const canvas = originalKernel.canvas; - const context = originalKernel.context; - assert.deepEqual(originalKernel()[0], 253); - const kernelString = originalKernel.toString(); - const newKernel = new Function('return ' + kernelString)()({ - context, - canvas, - constants: { - a: image2, - }, - }); - assert.deepEqual(newKernel()[0], 255); - gpu.destroy(); - done(); - }); + loadImages(['jellyfish-1.jpeg', 'jellyfish-2.jpeg']).then( + ([image1, image2]) => { + const gpu = new GPU({ mode }); + const originalKernel = gpu.createKernel( + function () { + const pixel = this.constants.a[0][0]; + return pixel.b * 255; + }, + { + output: [1], + precision: 'unsigned', + constants: { a: image1 }, + } + ); + const canvas = originalKernel.canvas; + const context = originalKernel.context; + assert.deepEqual(originalKernel()[0], 253); + const kernelString = originalKernel.toString(); + const newKernel = new Function('return ' + kernelString)()({ + context, + canvas, + constants: { + a: image2, + }, + }); + assert.deepEqual(newKernel()[0], 255); + gpu.destroy(); + done(); + } + ); } (GPU.isWebGLSupported ? test : skip)('webgl', t => { diff --git a/test/features/to-string/precision/unsigned/constants/memory-optimized-number-texture.js b/test/features/to-string/precision/unsigned/constants/memory-optimized-number-texture.js index 303f7c35..d7204791 100644 --- a/test/features/to-string/precision/unsigned/constants/memory-optimized-number-texture.js +++ b/test/features/to-string/precision/unsigned/constants/memory-optimized-number-texture.js @@ -1,7 +1,9 @@ const { assert, skip, test, module: describe, only } = require('qunit'); const { GPU } = require('../../../../../../src'); -describe('feature: to-string unsigned precision constants MemoryOptimizedNumberTexture'); +describe( + 'feature: to-string unsigned precision constants MemoryOptimizedNumberTexture' +); function testConstant(mode, context, canvas) { const gpu = new GPU({ mode, context, canvas }); @@ -44,8 +46,14 @@ function testConstant(mode, context, canvas) { const Kernel = new Function('return ' + kernelString)(); const newKernel = Kernel({ context, constants: { a: texture } }); const newKernel2 = Kernel({ context, constants: { a: texture2 } }); - assert.deepEqual(texture2.toArray ? texture2.toArray() : texture2, new Float32Array([4, 3, 2, 1])); - assert.deepEqual(texture.toArray ? texture.toArray() : texture, new Float32Array([0, 1, 2, 3])); + assert.deepEqual( + texture2.toArray ? texture2.toArray() : texture2, + new Float32Array([4, 3, 2, 1]) + ); + assert.deepEqual( + texture.toArray ? texture.toArray() : texture, + new Float32Array([0, 1, 2, 3]) + ); assert.deepEqual(newKernel(), new Float32Array([0, 1, 2, 3])); assert.deepEqual(newKernel2(), new Float32Array([4, 3, 2, 1])); gpu.destroy(); diff --git a/test/features/to-string/precision/unsigned/constants/number-texture.js b/test/features/to-string/precision/unsigned/constants/number-texture.js index aff6b529..405f7c65 100644 --- a/test/features/to-string/precision/unsigned/constants/number-texture.js +++ b/test/features/to-string/precision/unsigned/constants/number-texture.js @@ -46,8 +46,14 @@ function testConstant(mode, context, canvas) { const Kernel = new Function('return ' + kernelString)(); const newKernel = Kernel({ context, constants: { a: texture } }); const newKernel2 = Kernel({ context, constants: { a: texture2 } }); - assert.deepEqual(texture2.toArray ? texture2.toArray() : texture2, new Float32Array([4, 3, 2, 1])); - assert.deepEqual(texture.toArray ? texture.toArray() : texture, new Float32Array([0, 1, 2, 3])); + assert.deepEqual( + texture2.toArray ? texture2.toArray() : texture2, + new Float32Array([4, 3, 2, 1]) + ); + assert.deepEqual( + texture.toArray ? texture.toArray() : texture, + new Float32Array([0, 1, 2, 3]) + ); assert.deepEqual(newKernel(), new Float32Array([0, 1, 2, 3])); assert.deepEqual(newKernel2(), new Float32Array([4, 3, 2, 1])); gpu.destroy(); diff --git a/test/features/to-string/precision/unsigned/graphical.js b/test/features/to-string/precision/unsigned/graphical.js index 2fa79210..8a65fbf1 100644 --- a/test/features/to-string/precision/unsigned/graphical.js +++ b/test/features/to-string/precision/unsigned/graphical.js @@ -18,7 +18,10 @@ function testGraphical(mode, context, canvas) { } ); - const expected = new Uint8ClampedArray([255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]); + const expected = new Uint8ClampedArray([ + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, + ]); originalKernel(); assert.deepEqual(originalKernel.getPixels(), expected); const kernelString = originalKernel.toString(); diff --git a/test/features/to-string/precision/unsigned/kernel-map/array/array.js b/test/features/to-string/precision/unsigned/kernel-map/array/array.js index 2181ed24..6f49b413 100644 --- a/test/features/to-string/precision/unsigned/kernel-map/array/array.js +++ b/test/features/to-string/precision/unsigned/kernel-map/array/array.js @@ -1,7 +1,9 @@ const { assert, skip, test, module: describe, only } = require('qunit'); const { GPU } = require('../../../../../../../src'); -describe('feature: to-string unsigned precision array style kernel map returns Array'); +describe( + 'feature: to-string unsigned precision array style kernel map returns Array' +); function testReturn(mode, context, canvas) { const gpu = new GPU({ mode }); diff --git a/test/features/to-string/precision/unsigned/kernel-map/array/array2d.js b/test/features/to-string/precision/unsigned/kernel-map/array/array2d.js index af2a8246..3f8c1f71 100644 --- a/test/features/to-string/precision/unsigned/kernel-map/array/array2d.js +++ b/test/features/to-string/precision/unsigned/kernel-map/array/array2d.js @@ -1,7 +1,9 @@ const { assert, skip, test, module: describe, only } = require('qunit'); const { GPU } = require('../../../../../../../src'); -describe('feature: to-string unsigned precision array style kernel map returns Array2D'); +describe( + 'feature: to-string unsigned precision array style kernel map returns Array2D' +); function testReturn(mode, context, canvas) { const gpu = new GPU({ mode }); diff --git a/test/features/to-string/precision/unsigned/kernel-map/array/array3d.js b/test/features/to-string/precision/unsigned/kernel-map/array/array3d.js index f3529a4a..512ffc7a 100644 --- a/test/features/to-string/precision/unsigned/kernel-map/array/array3d.js +++ b/test/features/to-string/precision/unsigned/kernel-map/array/array3d.js @@ -1,7 +1,9 @@ const { assert, skip, test, module: describe, only } = require('qunit'); const { GPU } = require('../../../../../../../src'); -describe('feature: to-string unsigned precision array style kernel map returns Array3d'); +describe( + 'feature: to-string unsigned precision array style kernel map returns Array3d' +); function testReturn(mode, context, canvas) { const gpu = new GPU({ mode }); diff --git a/test/features/to-string/precision/unsigned/kernel-map/array/memory-optimized-number-texture.js b/test/features/to-string/precision/unsigned/kernel-map/array/memory-optimized-number-texture.js index afa141aa..846f8e92 100644 --- a/test/features/to-string/precision/unsigned/kernel-map/array/memory-optimized-number-texture.js +++ b/test/features/to-string/precision/unsigned/kernel-map/array/memory-optimized-number-texture.js @@ -1,7 +1,9 @@ const { assert, skip, test, module: describe, only } = require('qunit'); const { GPU } = require('../../../../../../../src'); -describe('feature: to-string unsigned precision array style kernel map returns MemoryOptimizedNumberTexture'); +describe( + 'feature: to-string unsigned precision array style kernel map returns MemoryOptimizedNumberTexture' +); function testReturn(mode, context, canvas) { const gpu = new GPU({ mode }); diff --git a/test/features/to-string/precision/unsigned/kernel-map/array/number-texture.js b/test/features/to-string/precision/unsigned/kernel-map/array/number-texture.js index 2c73ae29..095ed9bd 100644 --- a/test/features/to-string/precision/unsigned/kernel-map/array/number-texture.js +++ b/test/features/to-string/precision/unsigned/kernel-map/array/number-texture.js @@ -1,7 +1,9 @@ const { assert, skip, test, module: describe, only } = require('qunit'); const { GPU } = require('../../../../../../../src'); -describe('feature: to-string unsigned precision array style kernel map returns NumberTexture'); +describe( + 'feature: to-string unsigned precision array style kernel map returns NumberTexture' +); function testReturn(mode, context, canvas) { const gpu = new GPU({ mode }); diff --git a/test/features/to-string/precision/unsigned/kernel-map/object/memory-optimized-number-texture.js b/test/features/to-string/precision/unsigned/kernel-map/object/memory-optimized-number-texture.js index 0142cf1a..ae0e23a6 100644 --- a/test/features/to-string/precision/unsigned/kernel-map/object/memory-optimized-number-texture.js +++ b/test/features/to-string/precision/unsigned/kernel-map/object/memory-optimized-number-texture.js @@ -1,7 +1,9 @@ const { assert, skip, test, module: describe, only } = require('qunit'); const { GPU } = require('../../../../../../../src'); -describe('feature: to-string unsigned precision object style kernel map returns MemoryOptimizedNumberTexture'); +describe( + 'feature: to-string unsigned precision object style kernel map returns MemoryOptimizedNumberTexture' +); function testReturn(mode, context, canvas) { const gpu = new GPU({ mode }); diff --git a/test/features/to-string/precision/unsigned/kernel-map/object/number-texture.js b/test/features/to-string/precision/unsigned/kernel-map/object/number-texture.js index 8d886178..868a7351 100644 --- a/test/features/to-string/precision/unsigned/kernel-map/object/number-texture.js +++ b/test/features/to-string/precision/unsigned/kernel-map/object/number-texture.js @@ -1,7 +1,9 @@ const { assert, skip, test, module: describe, only } = require('qunit'); const { GPU } = require('../../../../../../../src'); -describe('feature: to-string unsigned precision object style kernel map returns NumberTexture'); +describe( + 'feature: to-string unsigned precision object style kernel map returns NumberTexture' +); function testReturn(mode, context, canvas) { const gpu = new GPU({ mode }); diff --git a/test/features/to-string/precision/unsigned/returns/array2d.js b/test/features/to-string/precision/unsigned/returns/array2d.js index ead84e9b..15fb3972 100644 --- a/test/features/to-string/precision/unsigned/returns/array2d.js +++ b/test/features/to-string/precision/unsigned/returns/array2d.js @@ -23,7 +23,10 @@ function testReturn(mode, context, canvas) { const originalResult = originalKernel(a, b); assert.deepEqual(originalResult, expected); const kernelString = originalKernel.toString(a, b); - const newResult = new Function('return ' + kernelString)()({ context })(a, b); + const newResult = new Function('return ' + kernelString)()({ context })( + a, + b + ); assert.deepEqual(newResult, expected); gpu.destroy(); } diff --git a/test/features/to-string/precision/unsigned/returns/array3d.js b/test/features/to-string/precision/unsigned/returns/array3d.js index 15423855..08d27dc1 100644 --- a/test/features/to-string/precision/unsigned/returns/array3d.js +++ b/test/features/to-string/precision/unsigned/returns/array3d.js @@ -27,7 +27,11 @@ function testReturn(mode, context, canvas) { const originalResult = originalKernel(a, b, c); assert.deepEqual(originalResult, expected); const kernelString = originalKernel.toString(a, b, c); - const newResult = new Function('return ' + kernelString)()({ context })(a, b, c); + const newResult = new Function('return ' + kernelString)()({ context })( + a, + b, + c + ); assert.deepEqual(newResult, expected); gpu.destroy(); } diff --git a/test/features/to-string/precision/unsigned/returns/texture.js b/test/features/to-string/precision/unsigned/returns/texture.js index 8bc59bb5..7c335646 100644 --- a/test/features/to-string/precision/unsigned/returns/texture.js +++ b/test/features/to-string/precision/unsigned/returns/texture.js @@ -28,18 +28,27 @@ function testReturn(mode, context, canvas) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('webgl', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl'); - testReturn('webgl', context, canvas); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'webgl', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl'); + testReturn('webgl', context, canvas); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('webgl2', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl2'); - testReturn('webgl2', context, canvas); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'webgl2', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl2'); + testReturn('webgl2', context, canvas); + } +); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('headlessgl', () => { - testReturn('headlessgl', require('gl')(1, 1), null); -}); +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'headlessgl', + () => { + testReturn('headlessgl', require('gl')(1, 1), null); + } +); diff --git a/test/features/type-management.js b/test/features/type-management.js index d2d4822e..f5784d59 100644 --- a/test/features/type-management.js +++ b/test/features/type-management.js @@ -1,5 +1,10 @@ const { assert, test, module: describe, only, skip } = require('qunit'); -const { GPU, WebGLFunctionNode, WebGL2FunctionNode, CPUFunctionNode } = require('../../src'); +const { + GPU, + WebGLFunctionNode, + WebGL2FunctionNode, + CPUFunctionNode, +} = require('../../src'); describe('features: type management'); @@ -813,7 +818,15 @@ test('arrays inherited - Array(4) webgl2', () => { output: [1], } ); - assert.equal(node.toString(), 'vec4 inherited(vec4 user_array, vec4 user_array2) {' + '\nvec4 user_array3=vec4(0.0, 0.0, 0.0, 0.0);' + '\nuser_array3[0]=user_array[0];' + '\nuser_array3[1]=(user_array[1]*user_array2[1]);' + '\nreturn user_array3;' + '\n}'); + assert.equal( + node.toString(), + 'vec4 inherited(vec4 user_array, vec4 user_array2) {' + + '\nvec4 user_array3=vec4(0.0, 0.0, 0.0, 0.0);' + + '\nuser_array3[0]=user_array[0];' + + '\nuser_array3[1]=(user_array[1]*user_array2[1]);' + + '\nreturn user_array3;' + + '\n}' + ); }); test('arrays inherited - Array(4) cpu', () => { const node = new CPUFunctionNode( @@ -884,7 +897,21 @@ test('auto detect float, array, array2d, array3d - webgl', () => { } ); - assert.equal(node.toString(), 'float advancedUsed(int user_int, sampler2D user_array,ivec2 user_arraySize,ivec3 user_arrayDim, sampler2D user_array2d,ivec2 user_array2dSize,ivec3 user_array2dDim, sampler2D user_array3d,ivec2 user_array3dSize,ivec3 user_array3dDim) {' + '\nfloat user_allValues=constants_float;' + '\nuser_allValues+=float(constants_int);' + '\nuser_allValues+=get32(constants_array, constants_arraySize, constants_arrayDim, 0, 0, threadId.x);' + '\nuser_allValues+=get32(constants_array2d, constants_array2dSize, constants_array2dDim, 0, threadId.x, threadId.y);' + '\nuser_allValues+=get32(constants_array3d, constants_array3dSize, constants_array3dDim, threadId.x, threadId.y, threadId.z);' + '\nuser_allValues+=float(user_int);' + '\nuser_allValues+=get32(user_array, user_arraySize, user_arrayDim, 0, 0, threadId.x);' + '\nuser_allValues+=get32(user_array2d, user_array2dSize, user_array2dDim, 0, threadId.x, threadId.y);' + '\nuser_allValues+=get32(user_array3d, user_array3dSize, user_array3dDim, threadId.x, threadId.y, threadId.z);' + '\nreturn (user_allValues*random());' + '\n}'); + assert.equal( + node.toString(), + 'float advancedUsed(int user_int, sampler2D user_array,ivec2 user_arraySize,ivec3 user_arrayDim, sampler2D user_array2d,ivec2 user_array2dSize,ivec3 user_array2dDim, sampler2D user_array3d,ivec2 user_array3dSize,ivec3 user_array3dDim) {' + + '\nfloat user_allValues=constants_float;' + + '\nuser_allValues+=float(constants_int);' + + '\nuser_allValues+=get32(constants_array, constants_arraySize, constants_arrayDim, 0, 0, threadId.x);' + + '\nuser_allValues+=get32(constants_array2d, constants_array2dSize, constants_array2dDim, 0, threadId.x, threadId.y);' + + '\nuser_allValues+=get32(constants_array3d, constants_array3dSize, constants_array3dDim, threadId.x, threadId.y, threadId.z);' + + '\nuser_allValues+=float(user_int);' + + '\nuser_allValues+=get32(user_array, user_arraySize, user_arrayDim, 0, 0, threadId.x);' + + '\nuser_allValues+=get32(user_array2d, user_array2dSize, user_array2dDim, 0, threadId.x, threadId.y);' + + '\nuser_allValues+=get32(user_array3d, user_array3dSize, user_array3dDim, threadId.x, threadId.y, threadId.z);' + + '\nreturn (user_allValues*random());' + + '\n}' + ); }); function notDefined(mode) { diff --git a/test/features/unsigned-precision-textures.js b/test/features/unsigned-precision-textures.js index 34688a77..b63ebfa3 100644 --- a/test/features/unsigned-precision-textures.js +++ b/test/features/unsigned-precision-textures.js @@ -33,17 +33,23 @@ test('with Array cpu', () => { unsignedPrecisionTexturesWithArray('gpu'); }); -(GPU.isWebGLSupported && GPU.isKernelMapSupported ? test : skip)('with Array webgl', () => { - unsignedPrecisionTexturesWithArray('webgl'); -}); +(GPU.isWebGLSupported && GPU.isKernelMapSupported ? test : skip)( + 'with Array webgl', + () => { + unsignedPrecisionTexturesWithArray('webgl'); + } +); (GPU.isWebGL2Supported ? test : skip)('with Array webgl2', () => { unsignedPrecisionTexturesWithArray('webgl2'); }); -(GPU.isHeadlessGLSupported && GPU.isKernelMapSupported ? test : skip)('with Array headlessgl', () => { - unsignedPrecisionTexturesWithArray('headlessgl'); -}); +(GPU.isHeadlessGLSupported && GPU.isKernelMapSupported ? test : skip)( + 'with Array headlessgl', + () => { + unsignedPrecisionTexturesWithArray('headlessgl'); + } +); function unsignedPrecisionTexturesWithFloat32Array(mode) { const original = new Float32Array([1, 2, 3, 4, 5, 6, 7, 8, 9]); @@ -75,17 +81,23 @@ test('with Float32Array cpu', () => { unsignedPrecisionTexturesWithFloat32Array('gpu'); }); -(GPU.isWebGLSupported && GPU.isKernelMapSupported ? test : skip)('with Float32Array webgl', () => { - unsignedPrecisionTexturesWithFloat32Array('webgl'); -}); +(GPU.isWebGLSupported && GPU.isKernelMapSupported ? test : skip)( + 'with Float32Array webgl', + () => { + unsignedPrecisionTexturesWithFloat32Array('webgl'); + } +); (GPU.isWebGL2Supported ? test : skip)('with Float32Array webgl2', () => { unsignedPrecisionTexturesWithFloat32Array('webgl2'); }); -(GPU.isHeadlessGLSupported && GPU.isKernelMapSupported ? test : skip)('with Float32Array headlessgl', () => { - unsignedPrecisionTexturesWithFloat32Array('headlessgl'); -}); +(GPU.isHeadlessGLSupported && GPU.isKernelMapSupported ? test : skip)( + 'with Float32Array headlessgl', + () => { + unsignedPrecisionTexturesWithFloat32Array('headlessgl'); + } +); function unsignedPrecisionTexturesWithUint16Array(mode) { const original = new Uint16Array([1, 2, 3, 4, 5, 6, 7, 8, 9]); @@ -117,17 +129,23 @@ test('with Uint16Array cpu', () => { unsignedPrecisionTexturesWithUint16Array('gpu'); }); -(GPU.isWebGLSupported && GPU.isKernelMapSupported ? test : skip)('with Uint16Array webgl', () => { - unsignedPrecisionTexturesWithUint16Array('webgl'); -}); +(GPU.isWebGLSupported && GPU.isKernelMapSupported ? test : skip)( + 'with Uint16Array webgl', + () => { + unsignedPrecisionTexturesWithUint16Array('webgl'); + } +); (GPU.isWebGL2Supported ? test : skip)('with Uint16Array webgl2', () => { unsignedPrecisionTexturesWithUint16Array('webgl2'); }); -(GPU.isHeadlessGLSupported && GPU.isKernelMapSupported ? test : skip)('with Uint16Array headlessgl', () => { - unsignedPrecisionTexturesWithUint16Array('headlessgl'); -}); +(GPU.isHeadlessGLSupported && GPU.isKernelMapSupported ? test : skip)( + 'with Uint16Array headlessgl', + () => { + unsignedPrecisionTexturesWithUint16Array('headlessgl'); + } +); function unsignedPrecisionTexturesWithUint8Array(mode) { const original = new Uint8Array([1, 2, 3, 4, 5, 6, 7, 8, 9]); @@ -159,17 +177,23 @@ test('with Uint8Array cpu', () => { unsignedPrecisionTexturesWithUint8Array('gpu'); }); -(GPU.isWebGLSupported && GPU.isKernelMapSupported ? test : skip)('with Uint8Array webgl', () => { - unsignedPrecisionTexturesWithUint8Array('webgl'); -}); +(GPU.isWebGLSupported && GPU.isKernelMapSupported ? test : skip)( + 'with Uint8Array webgl', + () => { + unsignedPrecisionTexturesWithUint8Array('webgl'); + } +); (GPU.isWebGL2Supported ? test : skip)('with Uint8Array webgl2', () => { unsignedPrecisionTexturesWithUint8Array('webgl2'); }); -(GPU.isHeadlessGLSupported && GPU.isKernelMapSupported ? test : skip)('with Uint8Array headlessgl', () => { - unsignedPrecisionTexturesWithUint8Array('headlessgl'); -}); +(GPU.isHeadlessGLSupported && GPU.isKernelMapSupported ? test : skip)( + 'with Uint8Array headlessgl', + () => { + unsignedPrecisionTexturesWithUint8Array('headlessgl'); + } +); function unsignedPrecisionTexturesWithUint8ClampedArray(mode) { const original = new Uint8ClampedArray([1, 2, 3, 4, 5, 6, 7, 8, 9]); @@ -201,17 +225,23 @@ test('with Uint8ClampedArray cpu', () => { unsignedPrecisionTexturesWithUint8ClampedArray('gpu'); }); -(GPU.isWebGLSupported && GPU.isKernelMapSupported ? test : skip)('with Uint8ClampedArray webgl', () => { - unsignedPrecisionTexturesWithUint8ClampedArray('webgl'); -}); +(GPU.isWebGLSupported && GPU.isKernelMapSupported ? test : skip)( + 'with Uint8ClampedArray webgl', + () => { + unsignedPrecisionTexturesWithUint8ClampedArray('webgl'); + } +); (GPU.isWebGL2Supported ? test : skip)('with Uint8ClampedArray webgl2', () => { unsignedPrecisionTexturesWithUint8ClampedArray('webgl2'); }); -(GPU.isHeadlessGLSupported && GPU.isKernelMapSupported ? test : skip)('with Uint8ClampedArray headlessgl', () => { - unsignedPrecisionTexturesWithUint8ClampedArray('headlessgl'); -}); +(GPU.isHeadlessGLSupported && GPU.isKernelMapSupported ? test : skip)( + 'with Uint8ClampedArray headlessgl', + () => { + unsignedPrecisionTexturesWithUint8ClampedArray('headlessgl'); + } +); function unsignedPrecisionTexturesWithArray2D(mode) { const original = [ @@ -249,20 +279,29 @@ test('with Array2D cpu', () => { unsignedPrecisionTexturesWithArray2D('gpu'); }); -(GPU.isWebGLSupported && GPU.isKernelMapSupported ? test : skip)('with Array2D webgl', () => { - unsignedPrecisionTexturesWithArray2D('webgl'); -}); +(GPU.isWebGLSupported && GPU.isKernelMapSupported ? test : skip)( + 'with Array2D webgl', + () => { + unsignedPrecisionTexturesWithArray2D('webgl'); + } +); (GPU.isWebGL2Supported ? test : skip)('with Array2D webgl2', () => { unsignedPrecisionTexturesWithArray2D('webgl2'); }); -(GPU.isHeadlessGLSupported && GPU.isKernelMapSupported ? test : skip)('with Array2D headlessgl', () => { - unsignedPrecisionTexturesWithArray2D('headlessgl'); -}); +(GPU.isHeadlessGLSupported && GPU.isKernelMapSupported ? test : skip)( + 'with Array2D headlessgl', + () => { + unsignedPrecisionTexturesWithArray2D('headlessgl'); + } +); function unsignedPrecisionTexturesWithFloat32Array2D(mode) { - const original = [new Float32Array([1, 2, 3, 4, 5, 6, 7, 8, 9]), new Float32Array([10, 11, 12, 13, 14, 15, 16, 18, 19])]; + const original = [ + new Float32Array([1, 2, 3, 4, 5, 6, 7, 8, 9]), + new Float32Array([10, 11, 12, 13, 14, 15, 16, 18, 19]), + ]; const gpu = new GPU({ mode }); const kernel = gpu.createKernel( function (packed) { @@ -294,20 +333,29 @@ test('with Float32Array2D cpu', () => { unsignedPrecisionTexturesWithFloat32Array2D('gpu'); }); -(GPU.isWebGLSupported && GPU.isKernelMapSupported ? test : skip)('with Float32Array2D webgl', () => { - unsignedPrecisionTexturesWithFloat32Array2D('webgl'); -}); +(GPU.isWebGLSupported && GPU.isKernelMapSupported ? test : skip)( + 'with Float32Array2D webgl', + () => { + unsignedPrecisionTexturesWithFloat32Array2D('webgl'); + } +); (GPU.isWebGL2Supported ? test : skip)('with Float32Array2D webgl2', () => { unsignedPrecisionTexturesWithFloat32Array2D('webgl2'); }); -(GPU.isHeadlessGLSupported && GPU.isKernelMapSupported ? test : skip)('with Float32Array2D headlessgl', () => { - unsignedPrecisionTexturesWithFloat32Array2D('headlessgl'); -}); +(GPU.isHeadlessGLSupported && GPU.isKernelMapSupported ? test : skip)( + 'with Float32Array2D headlessgl', + () => { + unsignedPrecisionTexturesWithFloat32Array2D('headlessgl'); + } +); function unsignedPrecisionTexturesWithUint16Array2D(mode) { - const original = [new Uint16Array([1, 2, 3, 4, 5, 6, 7, 8, 9]), new Uint16Array([10, 11, 12, 13, 14, 15, 16, 18, 19])]; + const original = [ + new Uint16Array([1, 2, 3, 4, 5, 6, 7, 8, 9]), + new Uint16Array([10, 11, 12, 13, 14, 15, 16, 18, 19]), + ]; const gpu = new GPU({ mode }); const kernel = gpu.createKernel( function (packed) { @@ -339,20 +387,29 @@ test('with Uint16Array2D cpu', () => { unsignedPrecisionTexturesWithUint16Array2D('gpu'); }); -(GPU.isWebGLSupported && GPU.isKernelMapSupported ? test : skip)('with Uint16Array2D webgl', () => { - unsignedPrecisionTexturesWithUint16Array2D('webgl'); -}); +(GPU.isWebGLSupported && GPU.isKernelMapSupported ? test : skip)( + 'with Uint16Array2D webgl', + () => { + unsignedPrecisionTexturesWithUint16Array2D('webgl'); + } +); (GPU.isWebGL2Supported ? test : skip)('with Uint16Array2D webgl2', () => { unsignedPrecisionTexturesWithUint16Array2D('webgl2'); }); -(GPU.isHeadlessGLSupported && GPU.isKernelMapSupported ? test : skip)('with Uint16Array2D headlessgl', () => { - unsignedPrecisionTexturesWithUint16Array2D('headlessgl'); -}); +(GPU.isHeadlessGLSupported && GPU.isKernelMapSupported ? test : skip)( + 'with Uint16Array2D headlessgl', + () => { + unsignedPrecisionTexturesWithUint16Array2D('headlessgl'); + } +); function unsignedPrecisionTexturesWithUint8Array2D(mode) { - const original = [new Uint8Array([1, 2, 3, 4, 5, 6, 7, 8, 9]), new Uint8Array([10, 11, 12, 13, 14, 15, 16, 18, 19])]; + const original = [ + new Uint8Array([1, 2, 3, 4, 5, 6, 7, 8, 9]), + new Uint8Array([10, 11, 12, 13, 14, 15, 16, 18, 19]), + ]; const gpu = new GPU({ mode }); const kernel = gpu.createKernel( function (packed) { @@ -384,20 +441,29 @@ test('with Uint8Array2D cpu', () => { unsignedPrecisionTexturesWithUint8Array2D('gpu'); }); -(GPU.isWebGLSupported && GPU.isKernelMapSupported ? test : skip)('with Uint8Array2D webgl', () => { - unsignedPrecisionTexturesWithUint8Array2D('webgl'); -}); +(GPU.isWebGLSupported && GPU.isKernelMapSupported ? test : skip)( + 'with Uint8Array2D webgl', + () => { + unsignedPrecisionTexturesWithUint8Array2D('webgl'); + } +); (GPU.isWebGL2Supported ? test : skip)('with Uint8Array2D webgl2', () => { unsignedPrecisionTexturesWithUint8Array2D('webgl2'); }); -(GPU.isHeadlessGLSupported && GPU.isKernelMapSupported ? test : skip)('with Uint8Array2D headlessgl', () => { - unsignedPrecisionTexturesWithUint8Array2D('headlessgl'); -}); +(GPU.isHeadlessGLSupported && GPU.isKernelMapSupported ? test : skip)( + 'with Uint8Array2D headlessgl', + () => { + unsignedPrecisionTexturesWithUint8Array2D('headlessgl'); + } +); function unsignedPrecisionTexturesWithUint8ClampedArray2D(mode) { - const original = [new Uint8ClampedArray([1, 2, 3, 4, 5, 6, 7, 8, 9]), new Uint8ClampedArray([10, 11, 12, 13, 14, 15, 16, 18, 19])]; + const original = [ + new Uint8ClampedArray([1, 2, 3, 4, 5, 6, 7, 8, 9]), + new Uint8ClampedArray([10, 11, 12, 13, 14, 15, 16, 18, 19]), + ]; const gpu = new GPU({ mode }); const kernel = gpu.createKernel( function (packed) { @@ -417,29 +483,44 @@ function unsignedPrecisionTexturesWithUint8ClampedArray2D(mode) { gpu.destroy(); } -(GPU.isKernelMapSupported ? test : skip)('with Uint8ClampedArray2D auto', () => { - unsignedPrecisionTexturesWithUint8ClampedArray2D(); -}); +(GPU.isKernelMapSupported ? test : skip)( + 'with Uint8ClampedArray2D auto', + () => { + unsignedPrecisionTexturesWithUint8ClampedArray2D(); + } +); test('with Uint8ClampedArray2D cpu', () => { unsignedPrecisionTexturesWithUint8ClampedArray2D('cpu'); }); -(GPU.isKernelMapSupported ? test : skip)('with Uint8ClampedArray2D gpu', () => { - unsignedPrecisionTexturesWithUint8ClampedArray2D('gpu'); -}); - -(GPU.isWebGLSupported && GPU.isKernelMapSupported ? test : skip)('with Uint8ClampedArray2D webgl', () => { - unsignedPrecisionTexturesWithUint8ClampedArray2D('webgl'); -}); - -(GPU.isWebGL2Supported ? test : skip)('with Uint8ClampedArray2D webgl2', () => { - unsignedPrecisionTexturesWithUint8ClampedArray2D('webgl2'); -}); - -(GPU.isHeadlessGLSupported && GPU.isKernelMapSupported ? test : skip)('with Uint8ClampedArray2D headlessgl', () => { - unsignedPrecisionTexturesWithUint8ClampedArray2D('headlessgl'); -}); +(GPU.isKernelMapSupported ? test : skip)( + 'with Uint8ClampedArray2D gpu', + () => { + unsignedPrecisionTexturesWithUint8ClampedArray2D('gpu'); + } +); + +(GPU.isWebGLSupported && GPU.isKernelMapSupported ? test : skip)( + 'with Uint8ClampedArray2D webgl', + () => { + unsignedPrecisionTexturesWithUint8ClampedArray2D('webgl'); + } +); + +(GPU.isWebGL2Supported ? test : skip)( + 'with Uint8ClampedArray2D webgl2', + () => { + unsignedPrecisionTexturesWithUint8ClampedArray2D('webgl2'); + } +); + +(GPU.isHeadlessGLSupported && GPU.isKernelMapSupported ? test : skip)( + 'with Uint8ClampedArray2D headlessgl', + () => { + unsignedPrecisionTexturesWithUint8ClampedArray2D('headlessgl'); + } +); function unsignedPrecisionTexturesWithArray3D(mode) { const original = [ @@ -483,22 +564,34 @@ test('with Array3D cpu', () => { unsignedPrecisionTexturesWithArray3D('gpu'); }); -(GPU.isWebGLSupported && GPU.isKernelMapSupported ? test : skip)('with Array3D webgl', () => { - unsignedPrecisionTexturesWithArray3D('webgl'); -}); +(GPU.isWebGLSupported && GPU.isKernelMapSupported ? test : skip)( + 'with Array3D webgl', + () => { + unsignedPrecisionTexturesWithArray3D('webgl'); + } +); (GPU.isWebGL2Supported ? test : skip)('with Array3D webgl2', () => { unsignedPrecisionTexturesWithArray3D('webgl2'); }); -(GPU.isHeadlessGLSupported && GPU.isKernelMapSupported ? test : skip)('with Array3D headlessgl', () => { - unsignedPrecisionTexturesWithArray3D('headlessgl'); -}); +(GPU.isHeadlessGLSupported && GPU.isKernelMapSupported ? test : skip)( + 'with Array3D headlessgl', + () => { + unsignedPrecisionTexturesWithArray3D('headlessgl'); + } +); function unsignedPrecisionTexturesWithFloat32Array3D(mode) { const original = [ - [new Float32Array([1, 2, 3, 4, 5, 6, 7, 8, 9]), new Float32Array([10, 11, 12, 13, 14, 15, 16, 18, 19])], - [new Float32Array([20, 21, 22, 23, 24, 25, 26, 27, 28]), new Float32Array([29, 30, 31, 32, 33, 34, 35, 36, 37])], + [ + new Float32Array([1, 2, 3, 4, 5, 6, 7, 8, 9]), + new Float32Array([10, 11, 12, 13, 14, 15, 16, 18, 19]), + ], + [ + new Float32Array([20, 21, 22, 23, 24, 25, 26, 27, 28]), + new Float32Array([29, 30, 31, 32, 33, 34, 35, 36, 37]), + ], ]; const gpu = new GPU({ mode }); const kernel = gpu.createKernel( @@ -531,22 +624,34 @@ test('with Float32Array3D cpu', () => { unsignedPrecisionTexturesWithFloat32Array3D('gpu'); }); -(GPU.isWebGLSupported && GPU.isKernelMapSupported ? test : skip)('with Float32Array3D webgl', () => { - unsignedPrecisionTexturesWithFloat32Array3D('webgl'); -}); +(GPU.isWebGLSupported && GPU.isKernelMapSupported ? test : skip)( + 'with Float32Array3D webgl', + () => { + unsignedPrecisionTexturesWithFloat32Array3D('webgl'); + } +); (GPU.isWebGL2Supported ? test : skip)('with Float32Array3D webgl2', () => { unsignedPrecisionTexturesWithFloat32Array3D('webgl2'); }); -(GPU.isHeadlessGLSupported && GPU.isKernelMapSupported ? test : skip)('with Float32Array3D headlessgl', () => { - unsignedPrecisionTexturesWithFloat32Array3D('headlessgl'); -}); +(GPU.isHeadlessGLSupported && GPU.isKernelMapSupported ? test : skip)( + 'with Float32Array3D headlessgl', + () => { + unsignedPrecisionTexturesWithFloat32Array3D('headlessgl'); + } +); function unsignedPrecisionTexturesWithUint16Array3D(mode) { const original = [ - [new Uint16Array([1, 2, 3, 4, 5, 6, 7, 8, 9]), new Uint16Array([10, 11, 12, 13, 14, 15, 16, 18, 19])], - [new Uint16Array([20, 21, 22, 23, 24, 25, 26, 27, 28]), new Uint16Array([29, 30, 31, 32, 33, 34, 35, 36, 37])], + [ + new Uint16Array([1, 2, 3, 4, 5, 6, 7, 8, 9]), + new Uint16Array([10, 11, 12, 13, 14, 15, 16, 18, 19]), + ], + [ + new Uint16Array([20, 21, 22, 23, 24, 25, 26, 27, 28]), + new Uint16Array([29, 30, 31, 32, 33, 34, 35, 36, 37]), + ], ]; const gpu = new GPU({ mode }); const kernel = gpu.createKernel( @@ -579,22 +684,34 @@ test('with Uint16Array3D cpu', () => { unsignedPrecisionTexturesWithUint16Array3D('gpu'); }); -(GPU.isWebGLSupported && GPU.isKernelMapSupported ? test : skip)('with Uint16Array3D webgl', () => { - unsignedPrecisionTexturesWithUint16Array3D('webgl'); -}); +(GPU.isWebGLSupported && GPU.isKernelMapSupported ? test : skip)( + 'with Uint16Array3D webgl', + () => { + unsignedPrecisionTexturesWithUint16Array3D('webgl'); + } +); (GPU.isWebGL2Supported ? test : skip)('with Uint16Array3D webgl2', () => { unsignedPrecisionTexturesWithUint16Array3D('webgl2'); }); -(GPU.isHeadlessGLSupported && GPU.isKernelMapSupported ? test : skip)('with Uint16Array3D headlessgl', () => { - unsignedPrecisionTexturesWithUint16Array3D('headlessgl'); -}); +(GPU.isHeadlessGLSupported && GPU.isKernelMapSupported ? test : skip)( + 'with Uint16Array3D headlessgl', + () => { + unsignedPrecisionTexturesWithUint16Array3D('headlessgl'); + } +); function unsignedPrecisionTexturesWithUint8Array3D(mode) { const original = [ - [new Uint8Array([1, 2, 3, 4, 5, 6, 7, 8, 9]), new Uint8Array([10, 11, 12, 13, 14, 15, 16, 18, 19])], - [new Uint8Array([20, 21, 22, 23, 24, 25, 26, 27, 28]), new Uint8Array([29, 30, 31, 32, 33, 34, 35, 36, 37])], + [ + new Uint8Array([1, 2, 3, 4, 5, 6, 7, 8, 9]), + new Uint8Array([10, 11, 12, 13, 14, 15, 16, 18, 19]), + ], + [ + new Uint8Array([20, 21, 22, 23, 24, 25, 26, 27, 28]), + new Uint8Array([29, 30, 31, 32, 33, 34, 35, 36, 37]), + ], ]; const gpu = new GPU({ mode }); const kernel = gpu.createKernel( @@ -627,22 +744,34 @@ test('with Uint8Array3D cpu', () => { unsignedPrecisionTexturesWithUint8Array3D('gpu'); }); -(GPU.isWebGLSupported && GPU.isKernelMapSupported ? test : skip)('with Uint8Array3D webgl', () => { - unsignedPrecisionTexturesWithUint8Array3D('webgl'); -}); +(GPU.isWebGLSupported && GPU.isKernelMapSupported ? test : skip)( + 'with Uint8Array3D webgl', + () => { + unsignedPrecisionTexturesWithUint8Array3D('webgl'); + } +); (GPU.isWebGL2Supported ? test : skip)('with Uint8Array3D webgl2', () => { unsignedPrecisionTexturesWithUint8Array3D('webgl2'); }); -(GPU.isHeadlessGLSupported && GPU.isKernelMapSupported ? test : skip)('with Uint8Array3D headlessgl', () => { - unsignedPrecisionTexturesWithUint8Array3D('headlessgl'); -}); +(GPU.isHeadlessGLSupported && GPU.isKernelMapSupported ? test : skip)( + 'with Uint8Array3D headlessgl', + () => { + unsignedPrecisionTexturesWithUint8Array3D('headlessgl'); + } +); function unsignedPrecisionTexturesWithUint8ClampedArray3D(mode) { const original = [ - [new Uint8ClampedArray([1, 2, 3, 4, 5, 6, 7, 8, 9]), new Uint8ClampedArray([10, 11, 12, 13, 14, 15, 16, 18, 19])], - [new Uint8ClampedArray([20, 21, 22, 23, 24, 25, 26, 27, 28]), new Uint8ClampedArray([29, 30, 31, 32, 33, 34, 35, 36, 37])], + [ + new Uint8ClampedArray([1, 2, 3, 4, 5, 6, 7, 8, 9]), + new Uint8ClampedArray([10, 11, 12, 13, 14, 15, 16, 18, 19]), + ], + [ + new Uint8ClampedArray([20, 21, 22, 23, 24, 25, 26, 27, 28]), + new Uint8ClampedArray([29, 30, 31, 32, 33, 34, 35, 36, 37]), + ], ]; const gpu = new GPU({ mode }); const kernel = gpu.createKernel( @@ -663,29 +792,44 @@ function unsignedPrecisionTexturesWithUint8ClampedArray3D(mode) { gpu.destroy(); } -(GPU.isKernelMapSupported ? test : skip)('with Uint8ClampedArray3D auto', () => { - unsignedPrecisionTexturesWithUint8ClampedArray3D(); -}); +(GPU.isKernelMapSupported ? test : skip)( + 'with Uint8ClampedArray3D auto', + () => { + unsignedPrecisionTexturesWithUint8ClampedArray3D(); + } +); test('with Uint8ClampedArray3D cpu', () => { unsignedPrecisionTexturesWithUint8ClampedArray3D('cpu'); }); -(GPU.isKernelMapSupported ? test : skip)('with Uint8ClampedArray3D gpu', () => { - unsignedPrecisionTexturesWithUint8ClampedArray3D('gpu'); -}); - -(GPU.isWebGLSupported && GPU.isKernelMapSupported ? test : skip)('with Uint8ClampedArray3D webgl', () => { - unsignedPrecisionTexturesWithUint8ClampedArray3D('webgl'); -}); - -(GPU.isWebGL2Supported ? test : skip)('with Uint8ClampedArray3D webgl2', () => { - unsignedPrecisionTexturesWithUint8ClampedArray3D('webgl2'); -}); - -(GPU.isHeadlessGLSupported && GPU.isKernelMapSupported ? test : skip)('with Uint8ClampedArray3D headlessgl', () => { - unsignedPrecisionTexturesWithUint8ClampedArray3D('headlessgl'); -}); +(GPU.isKernelMapSupported ? test : skip)( + 'with Uint8ClampedArray3D gpu', + () => { + unsignedPrecisionTexturesWithUint8ClampedArray3D('gpu'); + } +); + +(GPU.isWebGLSupported && GPU.isKernelMapSupported ? test : skip)( + 'with Uint8ClampedArray3D webgl', + () => { + unsignedPrecisionTexturesWithUint8ClampedArray3D('webgl'); + } +); + +(GPU.isWebGL2Supported ? test : skip)( + 'with Uint8ClampedArray3D webgl2', + () => { + unsignedPrecisionTexturesWithUint8ClampedArray3D('webgl2'); + } +); + +(GPU.isHeadlessGLSupported && GPU.isKernelMapSupported ? test : skip)( + 'with Uint8ClampedArray3D headlessgl', + () => { + unsignedPrecisionTexturesWithUint8ClampedArray3D('headlessgl'); + } +); function testImmutableDoesNotCollideWithKernelTexture(mode) { const gpu = new GPU({ mode }); @@ -720,14 +864,23 @@ test('immutable does not collide with kernel texture gpu', () => { testImmutableDoesNotCollideWithKernelTexture('gpu'); }); -(GPU.isWebGLSupported ? test : skip)('immutable does not collide with kernel texture webgl', () => { - testImmutableDoesNotCollideWithKernelTexture('webgl'); -}); - -(GPU.isWebGL2Supported ? test : skip)('immutable does not collide with kernel texture webgl2', () => { - testImmutableDoesNotCollideWithKernelTexture('webgl2'); -}); - -(GPU.isHeadlessGLSupported ? test : skip)('immutable does not collide with kernel texture headlessgl', () => { - testImmutableDoesNotCollideWithKernelTexture('headlessgl'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'immutable does not collide with kernel texture webgl', + () => { + testImmutableDoesNotCollideWithKernelTexture('webgl'); + } +); + +(GPU.isWebGL2Supported ? test : skip)( + 'immutable does not collide with kernel texture webgl2', + () => { + testImmutableDoesNotCollideWithKernelTexture('webgl2'); + } +); + +(GPU.isHeadlessGLSupported ? test : skip)( + 'immutable does not collide with kernel texture headlessgl', + () => { + testImmutableDoesNotCollideWithKernelTexture('headlessgl'); + } +); diff --git a/test/features/video.js b/test/features/video.js index 10e29e5f..13268220 100644 --- a/test/features/video.js +++ b/test/features/video.js @@ -28,22 +28,35 @@ function videoArgumentTest(mode, done) { }, 1000); } -(typeof HTMLVideoElement !== 'undefined' ? test : skip)('video argument auto', t => { - videoArgumentTest(null, t.async()); -}); +(typeof HTMLVideoElement !== 'undefined' ? test : skip)( + 'video argument auto', + t => { + videoArgumentTest(null, t.async()); + } +); -(typeof HTMLVideoElement !== 'undefined' ? test : skip)('video argument gpu', t => { - videoArgumentTest('gpu', t.async()); -}); +(typeof HTMLVideoElement !== 'undefined' ? test : skip)( + 'video argument gpu', + t => { + videoArgumentTest('gpu', t.async()); + } +); -(GPU.isWebGLSupported && typeof HTMLVideoElement !== 'undefined' ? test : skip)('video argument webgl', t => { +(GPU.isWebGLSupported && typeof HTMLVideoElement !== 'undefined' + ? test + : skip)('video argument webgl', t => { videoArgumentTest('webgl', t.async()); }); -(GPU.isWebGL2Supported && typeof HTMLVideoElement !== 'undefined' ? test : skip)('video argument webgl2', t => { +(GPU.isWebGL2Supported && typeof HTMLVideoElement !== 'undefined' + ? test + : skip)('video argument webgl2', t => { videoArgumentTest('webgl2', t.async()); }); -(typeof HTMLVideoElement !== 'undefined' ? test : skip)('video argument cpu', t => { - videoArgumentTest('cpu', t.async()); -}); +(typeof HTMLVideoElement !== 'undefined' ? test : skip)( + 'video argument cpu', + t => { + videoArgumentTest('cpu', t.async()); + } +); diff --git a/test/index.js b/test/index.js index 1cc8700a..81e1c630 100644 --- a/test/index.js +++ b/test/index.js @@ -31,7 +31,10 @@ describe('Test Node GPU', () => { const result = kernel(); expect(gpu.runner.constructor).to.equal(GPU.HeadlessGLRunner); - expect(result).to.deep.equal([Float32Array.from([0, 0]), Float32Array.from([0, 1])]); + expect(result).to.deep.equal([ + Float32Array.from([0, 0]), + Float32Array.from([0, 1]), + ]); }); }); @@ -63,7 +66,10 @@ describe('Test Node GPU', () => { const result = kernel(); expect(gpu.runner.constructor).to.equal(GPU.CPURunner); - expect(result).to.deep.equal([Float32Array.from([0, 0]), Float32Array.from([0, 1])]); + expect(result).to.deep.equal([ + Float32Array.from([0, 0]), + Float32Array.from([0, 1]), + ]); }); }); }); diff --git a/test/internal/argument-texture-switching.js b/test/internal/argument-texture-switching.js index 3717cc62..0d62bb6b 100644 --- a/test/internal/argument-texture-switching.js +++ b/test/internal/argument-texture-switching.js @@ -28,25 +28,40 @@ function testArrayWithoutTypeDefined(mode) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported ? test : skip)('Array without type defined (GPU only) auto', () => { - testArrayWithoutTypeDefined(); -}); - -(GPU.isSinglePrecisionSupported ? test : skip)('Array without type defined (GPU only) gpu', () => { - testArrayWithoutTypeDefined('gpu'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('Array without type defined (GPU only) webgl', () => { - testArrayWithoutTypeDefined('webgl'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('Array without type defined (GPU only) webgl2', () => { - testArrayWithoutTypeDefined('webgl2'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('Array without type defined (GPU only) headlessgl', () => { - testArrayWithoutTypeDefined('headlessgl'); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'Array without type defined (GPU only) auto', + () => { + testArrayWithoutTypeDefined(); + } +); + +(GPU.isSinglePrecisionSupported ? test : skip)( + 'Array without type defined (GPU only) gpu', + () => { + testArrayWithoutTypeDefined('gpu'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'Array without type defined (GPU only) webgl', + () => { + testArrayWithoutTypeDefined('webgl'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'Array without type defined (GPU only) webgl2', + () => { + testArrayWithoutTypeDefined('webgl2'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'Array without type defined (GPU only) headlessgl', + () => { + testArrayWithoutTypeDefined('headlessgl'); + } +); function testArrayWithTypeDefined(mode) { const gpu = new GPU({ mode }); @@ -76,25 +91,40 @@ function testArrayWithTypeDefined(mode) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported ? test : skip)('Array with type defined (GPU only) auto', () => { - testArrayWithTypeDefined(); -}); - -(GPU.isSinglePrecisionSupported ? test : skip)('Array with type defined (GPU only) gpu', () => { - testArrayWithTypeDefined('gpu'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('Array with type defined (GPU only) webgl', () => { - testArrayWithTypeDefined('webgl'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('Array with type defined (GPU only) webgl2', () => { - testArrayWithTypeDefined('webgl2'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('Array with type defined (GPU only) headlessgl', () => { - testArrayWithTypeDefined('headlessgl'); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'Array with type defined (GPU only) auto', + () => { + testArrayWithTypeDefined(); + } +); + +(GPU.isSinglePrecisionSupported ? test : skip)( + 'Array with type defined (GPU only) gpu', + () => { + testArrayWithTypeDefined('gpu'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'Array with type defined (GPU only) webgl', + () => { + testArrayWithTypeDefined('webgl'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'Array with type defined (GPU only) webgl2', + () => { + testArrayWithTypeDefined('webgl2'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'Array with type defined (GPU only) headlessgl', + () => { + testArrayWithTypeDefined('headlessgl'); + } +); function testArray1D2(mode) { const gpu = new GPU({ mode }); @@ -124,25 +154,40 @@ function testArray1D2(mode) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported ? test : skip)('Array1D(2) (GPU only) auto', () => { - testArray1D2(); -}); - -(GPU.isSinglePrecisionSupported ? test : skip)('Array1D(2) (GPU only) gpu', () => { - testArray1D2('gpu'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('Array1D(2) (GPU only) webgl', () => { - testArray1D2('webgl'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('Array1D(2) (GPU only) webgl2', () => { - testArray1D2('webgl2'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('Array1D(2) (GPU only) headlessgl', () => { - testArray1D2('headlessgl'); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'Array1D(2) (GPU only) auto', + () => { + testArray1D2(); + } +); + +(GPU.isSinglePrecisionSupported ? test : skip)( + 'Array1D(2) (GPU only) gpu', + () => { + testArray1D2('gpu'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'Array1D(2) (GPU only) webgl', + () => { + testArray1D2('webgl'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'Array1D(2) (GPU only) webgl2', + () => { + testArray1D2('webgl2'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'Array1D(2) (GPU only) headlessgl', + () => { + testArray1D2('headlessgl'); + } +); function testArray1D3(mode) { const gpu = new GPU({ mode }); @@ -172,31 +217,51 @@ function testArray1D3(mode) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported ? test : skip)('Array1D(3) (GPU only) auto', () => { - testArray1D3(); -}); - -(GPU.isSinglePrecisionSupported ? test : skip)('Array1D(3) (GPU only) gpu', () => { - testArray1D3('gpu'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('Array1D(3) (GPU only) webgl', () => { - testArray1D3('webgl'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('Array1D(3) (GPU only) webgl2', () => { - testArray1D3('webgl2'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('Array1D(3) (GPU only) headlessgl', () => { - testArray1D3('headlessgl'); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'Array1D(3) (GPU only) auto', + () => { + testArray1D3(); + } +); + +(GPU.isSinglePrecisionSupported ? test : skip)( + 'Array1D(3) (GPU only) gpu', + () => { + testArray1D3('gpu'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'Array1D(3) (GPU only) webgl', + () => { + testArray1D3('webgl'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'Array1D(3) (GPU only) webgl2', + () => { + testArray1D3('webgl2'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'Array1D(3) (GPU only) headlessgl', + () => { + testArray1D3('headlessgl'); + } +); function testArray1D4(mode) { const gpu = new GPU({ mode }); const texture = gpu .createKernel(function () { - return [this.thread.x, this.thread.x + 1, this.thread.x + 2, this.thread.x + 3]; + return [ + this.thread.x, + this.thread.x + 1, + this.thread.x + 2, + this.thread.x + 3, + ]; }) .setOutput([10]) .setPipeline(true) @@ -220,25 +285,40 @@ function testArray1D4(mode) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported ? test : skip)('Array1D(4) (GPU only) auto', () => { - testArray1D4(); -}); - -(GPU.isSinglePrecisionSupported ? test : skip)('Array1D(4) (GPU only) gpu', () => { - testArray1D4('gpu'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('Array1D(4) (GPU only) webgl', () => { - testArray1D4('webgl'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('Array1D(4) (GPU only) webgl2', () => { - testArray1D4('webgl2'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('Array1D(4) (GPU only) headlessgl', () => { - testArray1D4('headlessgl'); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'Array1D(4) (GPU only) auto', + () => { + testArray1D4(); + } +); + +(GPU.isSinglePrecisionSupported ? test : skip)( + 'Array1D(4) (GPU only) gpu', + () => { + testArray1D4('gpu'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'Array1D(4) (GPU only) webgl', + () => { + testArray1D4('webgl'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'Array1D(4) (GPU only) webgl2', + () => { + testArray1D4('webgl2'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'Array1D(4) (GPU only) headlessgl', + () => { + testArray1D4('headlessgl'); + } +); function testArray2D2(mode) { const gpu = new GPU({ mode }); @@ -268,25 +348,40 @@ function testArray2D2(mode) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported ? test : skip)('Array2D(2) (GPU only) auto', () => { - testArray2D2(); -}); - -(GPU.isSinglePrecisionSupported ? test : skip)('Array2D(2) (GPU only) gpu', () => { - testArray2D2('gpu'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('Array2D(2) (GPU only) webgl', () => { - testArray2D2('webgl'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('Array2D(2) (GPU only) webgl2', () => { - testArray2D2('webgl2'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('Array2D(2) (GPU only) headlessgl', () => { - testArray2D2('headlessgl'); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'Array2D(2) (GPU only) auto', + () => { + testArray2D2(); + } +); + +(GPU.isSinglePrecisionSupported ? test : skip)( + 'Array2D(2) (GPU only) gpu', + () => { + testArray2D2('gpu'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'Array2D(2) (GPU only) webgl', + () => { + testArray2D2('webgl'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'Array2D(2) (GPU only) webgl2', + () => { + testArray2D2('webgl2'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'Array2D(2) (GPU only) headlessgl', + () => { + testArray2D2('headlessgl'); + } +); function testArray2D3(mode) { const gpu = new GPU({ mode }); @@ -316,31 +411,51 @@ function testArray2D3(mode) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported ? test : skip)('Array2D(3) (GPU only) auto', () => { - testArray2D3(); -}); - -(GPU.isSinglePrecisionSupported ? test : skip)('Array1D(3) (GPU only) gpu', () => { - testArray2D3('gpu'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('Array2D(3) (GPU only) webgl', () => { - testArray2D3('webgl'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('Array2D(3) (GPU only) webgl2', () => { - testArray2D3('webgl2'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('Array2D(3) (GPU only) headlessgl', () => { - testArray2D3('headlessgl'); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'Array2D(3) (GPU only) auto', + () => { + testArray2D3(); + } +); + +(GPU.isSinglePrecisionSupported ? test : skip)( + 'Array1D(3) (GPU only) gpu', + () => { + testArray2D3('gpu'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'Array2D(3) (GPU only) webgl', + () => { + testArray2D3('webgl'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'Array2D(3) (GPU only) webgl2', + () => { + testArray2D3('webgl2'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'Array2D(3) (GPU only) headlessgl', + () => { + testArray2D3('headlessgl'); + } +); function testArray2D4(mode) { const gpu = new GPU({ mode }); const texture = gpu .createKernel(function () { - return [this.thread.x, this.thread.y, this.thread.x * this.thread.y, this.thread.x / this.thread.y]; + return [ + this.thread.x, + this.thread.y, + this.thread.x * this.thread.y, + this.thread.x / this.thread.y, + ]; }) .setOutput([10, 10]) .setPipeline(true) @@ -364,25 +479,40 @@ function testArray2D4(mode) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported ? test : skip)('Array2D(4) (GPU only) auto', () => { - testArray2D4(); -}); - -(GPU.isSinglePrecisionSupported ? test : skip)('Array1D(4) (GPU only) gpu', () => { - testArray2D4('gpu'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('Array2D(4) (GPU only) webgl', () => { - testArray2D4('webgl'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('Array2D(4) (GPU only) webgl2', () => { - testArray2D4('webgl2'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('Array2D(4) (GPU only) headlessgl', () => { - testArray2D4('headlessgl'); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'Array2D(4) (GPU only) auto', + () => { + testArray2D4(); + } +); + +(GPU.isSinglePrecisionSupported ? test : skip)( + 'Array1D(4) (GPU only) gpu', + () => { + testArray2D4('gpu'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'Array2D(4) (GPU only) webgl', + () => { + testArray2D4('webgl'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'Array2D(4) (GPU only) webgl2', + () => { + testArray2D4('webgl2'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'Array2D(4) (GPU only) headlessgl', + () => { + testArray2D4('headlessgl'); + } +); function testArray3D2(mode) { const gpu = new GPU({ mode }); @@ -412,25 +542,40 @@ function testArray3D2(mode) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported ? test : skip)('Array3D(2) (GPU only) auto', () => { - testArray3D2(); -}); - -(GPU.isSinglePrecisionSupported ? test : skip)('Array3D(2) (GPU only) gpu', () => { - testArray3D2('gpu'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('Array3D(2) (GPU only) webgl', () => { - testArray3D2('webgl'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('Array3D(2) (GPU only) webgl2', () => { - testArray3D2('webgl2'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('Array3D(2) (GPU only) headlessgl', () => { - testArray3D2('headlessgl'); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'Array3D(2) (GPU only) auto', + () => { + testArray3D2(); + } +); + +(GPU.isSinglePrecisionSupported ? test : skip)( + 'Array3D(2) (GPU only) gpu', + () => { + testArray3D2('gpu'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'Array3D(2) (GPU only) webgl', + () => { + testArray3D2('webgl'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'Array3D(2) (GPU only) webgl2', + () => { + testArray3D2('webgl2'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'Array3D(2) (GPU only) headlessgl', + () => { + testArray3D2('headlessgl'); + } +); function testArray3D3(mode) { const gpu = new GPU({ mode }); @@ -460,31 +605,51 @@ function testArray3D3(mode) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported ? test : skip)('Array3D(3) (GPU only) auto', () => { - testArray3D3(); -}); - -(GPU.isSinglePrecisionSupported ? test : skip)('Array3D(3) (GPU only) gpu', () => { - testArray3D3('gpu'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('Array3D(3) (GPU only) webgl', () => { - testArray3D3('webgl'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('Array3D(3) (GPU only) webgl2', () => { - testArray3D3('webgl2'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('Array3D(3) (GPU only) headlessgl', () => { - testArray3D3('headlessgl'); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'Array3D(3) (GPU only) auto', + () => { + testArray3D3(); + } +); + +(GPU.isSinglePrecisionSupported ? test : skip)( + 'Array3D(3) (GPU only) gpu', + () => { + testArray3D3('gpu'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'Array3D(3) (GPU only) webgl', + () => { + testArray3D3('webgl'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'Array3D(3) (GPU only) webgl2', + () => { + testArray3D3('webgl2'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'Array3D(3) (GPU only) headlessgl', + () => { + testArray3D3('headlessgl'); + } +); function testArray3D4(mode) { const gpu = new GPU({ mode }); const texture = gpu .createKernel(function () { - return [this.thread.x, this.thread.y, this.thread.z, this.thread.x * this.thread.y * this.thread.z]; + return [ + this.thread.x, + this.thread.y, + this.thread.z, + this.thread.x * this.thread.y * this.thread.z, + ]; }) .setOutput([10, 10, 10]) .setPipeline(true) @@ -508,22 +673,37 @@ function testArray3D4(mode) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported ? test : skip)('Array3D(4) (GPU only) auto', () => { - testArray3D4(); -}); - -(GPU.isSinglePrecisionSupported ? test : skip)('Array3D(4) (GPU only) gpu', () => { - testArray3D4('gpu'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('Array3D(4) (GPU only) webgl', () => { - testArray3D4('webgl'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('Array3D(4) (GPU only) webgl2', () => { - testArray3D4('webgl2'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('Array3D(4) (GPU only) headlessgl', () => { - testArray3D4('headlessgl'); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'Array3D(4) (GPU only) auto', + () => { + testArray3D4(); + } +); + +(GPU.isSinglePrecisionSupported ? test : skip)( + 'Array3D(4) (GPU only) gpu', + () => { + testArray3D4('gpu'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'Array3D(4) (GPU only) webgl', + () => { + testArray3D4('webgl'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'Array3D(4) (GPU only) webgl2', + () => { + testArray3D4('webgl2'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'Array3D(4) (GPU only) headlessgl', + () => { + testArray3D4('headlessgl'); + } +); diff --git a/test/internal/backend/gl-kernel.js b/test/internal/backend/gl-kernel.js index ffcb0e65..d6d8a098 100644 --- a/test/internal/backend/gl-kernel.js +++ b/test/internal/backend/gl-kernel.js @@ -5,7 +5,8 @@ const { GLKernel, GPU } = require(process.cwd() + '/src'); describe('GLKernel'); test('nativeFunctionArguments() parse simple function', () => { - const result = GLKernel.nativeFunctionArguments(`vec2 myFunction(vec2 longName) { + const result = + GLKernel.nativeFunctionArguments(`vec2 myFunction(vec2 longName) { return vec2(1, 1); }`); @@ -16,7 +17,8 @@ test('nativeFunctionArguments() parse simple function', () => { }); test('nativeFunctionArguments() parse simple function with argument that has number', () => { - const result = GLKernel.nativeFunctionArguments(`vec2 myFunction(vec2 longName123) { + const result = + GLKernel.nativeFunctionArguments(`vec2 myFunction(vec2 longName123) { return vec2(1, 1); }`); @@ -27,7 +29,8 @@ test('nativeFunctionArguments() parse simple function with argument that has num }); test('nativeFunctionArguments() parse simple function, multiple arguments', () => { - const result = GLKernel.nativeFunctionArguments(`vec2 myFunction(vec3 a,vec3 b,float c) { + const result = + GLKernel.nativeFunctionArguments(`vec2 myFunction(vec3 a,vec3 b,float c) { return vec2(1, 1); }`); @@ -38,7 +41,8 @@ test('nativeFunctionArguments() parse simple function, multiple arguments', () = }); test('nativeFunctionArguments() parse simple function, multiple arguments with comments', () => { - const result = GLKernel.nativeFunctionArguments(`vec2 myFunction(vec3 a /* vec4 b */,vec2 c, /* vec4 d */ float e) { + const result = + GLKernel.nativeFunctionArguments(`vec2 myFunction(vec3 a /* vec4 b */,vec2 c, /* vec4 d */ float e) { return vec2(1, 1); }`); @@ -110,11 +114,17 @@ test('nativeFunctionArguments() parse simple function that is cut short', () => }); test('getVariablePrecisionString() when tactic is set to "speed" returns "lowp"', () => { - assert.equal(GLKernel.prototype.getVariablePrecisionString.call({ tactic: 'speed' }), 'lowp'); + assert.equal( + GLKernel.prototype.getVariablePrecisionString.call({ tactic: 'speed' }), + 'lowp' + ); }); test('getVariablePrecisionString() when tactic is set to "balanced" returns "mediump"', () => { - assert.equal(GLKernel.prototype.getVariablePrecisionString.call({ tactic: 'balanced' }), 'mediump'); + assert.equal( + GLKernel.prototype.getVariablePrecisionString.call({ tactic: 'balanced' }), + 'mediump' + ); }); test('getVariablePrecisionString() when tactic is set to "precision" returns "highp"', () => { @@ -139,7 +149,13 @@ test('getVariablePrecisionString() when tactic is not set and texSize is within }, }; const textureSize = [2, 2]; - assert.equal(GLKernel.prototype.getVariablePrecisionString.call(mockInstance, textureSize), 'lowp'); + assert.equal( + GLKernel.prototype.getVariablePrecisionString.call( + mockInstance, + textureSize + ), + 'lowp' + ); }); test('getVariablePrecisionString() when tactic is not set and texSize is within mediumFloatPrecision', () => { @@ -155,7 +171,13 @@ test('getVariablePrecisionString() when tactic is not set and texSize is within }, }; const textureSize = [4, 4]; - assert.equal(GLKernel.prototype.getVariablePrecisionString.call(mockInstance, textureSize), 'mediump'); + assert.equal( + GLKernel.prototype.getVariablePrecisionString.call( + mockInstance, + textureSize + ), + 'mediump' + ); }); test('getVariablePrecisionString() when tactic is not set and texSize is within highFloatPrecision', () => { @@ -171,7 +193,13 @@ test('getVariablePrecisionString() when tactic is not set and texSize is within }, }; const textureSize = [5, 5]; - assert.equal(GLKernel.prototype.getVariablePrecisionString.call(mockInstance, textureSize), 'highp'); + assert.equal( + GLKernel.prototype.getVariablePrecisionString.call( + mockInstance, + textureSize + ), + 'highp' + ); }); test('getVariablePrecisionString() when tactic is not set and texSize is outside highFloatPrecision', () => { @@ -187,7 +215,12 @@ test('getVariablePrecisionString() when tactic is not set and texSize is outside }, }; const textureSize = [6, 6]; - assert.throws(() => GLKernel.prototype.getVariablePrecisionString.call(mockInstance, textureSize)); + assert.throws(() => + GLKernel.prototype.getVariablePrecisionString.call( + mockInstance, + textureSize + ) + ); }); test('getVariablePrecisionString() when tactic is not set and texSize is within lowIntPrecision', () => { @@ -203,7 +236,15 @@ test('getVariablePrecisionString() when tactic is not set and texSize is within }, }; const textureSize = [2, 2]; - assert.equal(GLKernel.prototype.getVariablePrecisionString.call(mockInstance, textureSize, null, true), 'lowp'); + assert.equal( + GLKernel.prototype.getVariablePrecisionString.call( + mockInstance, + textureSize, + null, + true + ), + 'lowp' + ); }); test('getVariablePrecisionString() when tactic is not set and texSize is within mediumIntPrecision', () => { @@ -219,7 +260,15 @@ test('getVariablePrecisionString() when tactic is not set and texSize is within }, }; const textureSize = [4, 4]; - assert.equal(GLKernel.prototype.getVariablePrecisionString.call(mockInstance, textureSize, null, true), 'mediump'); + assert.equal( + GLKernel.prototype.getVariablePrecisionString.call( + mockInstance, + textureSize, + null, + true + ), + 'mediump' + ); }); test('getVariablePrecisionString() when tactic is not set and texSize is within highIntPrecision', () => { @@ -235,7 +284,15 @@ test('getVariablePrecisionString() when tactic is not set and texSize is within }, }; const textureSize = [5, 5]; - assert.equal(GLKernel.prototype.getVariablePrecisionString.call(mockInstance, textureSize, null, true), 'highp'); + assert.equal( + GLKernel.prototype.getVariablePrecisionString.call( + mockInstance, + textureSize, + null, + true + ), + 'highp' + ); }); test('getVariablePrecisionString() when tactic is not set and texSize is outside highIntPrecision', () => { @@ -251,7 +308,14 @@ test('getVariablePrecisionString() when tactic is not set and texSize is outside }, }; const textureSize = [6, 6]; - assert.throws(() => GLKernel.prototype.getVariablePrecisionString.call(mockInstance, textureSize, null, true)); + assert.throws(() => + GLKernel.prototype.getVariablePrecisionString.call( + mockInstance, + textureSize, + null, + true + ) + ); }); test('getVariablePrecisionString() when features.isSpeedTacticSupported is false returns "highp"', () => { @@ -264,7 +328,15 @@ test('getVariablePrecisionString() when features.isSpeedTacticSupported is false }, }; const textureSize = [1, 1]; - assert.equal(GLKernel.prototype.getVariablePrecisionString.call(mockInstance, textureSize, null, true), 'highp'); + assert.equal( + GLKernel.prototype.getVariablePrecisionString.call( + mockInstance, + textureSize, + null, + true + ), + 'highp' + ); }); function testGetFeatures(canvas, context) { @@ -372,7 +444,10 @@ test('setOutput() when does not need to trigger recompile', () => { GLKernel.prototype.setOutput.call(mockInstance, [100, 100]); assert.equal(mockContext.bindFramebuffer.callCount, 1); assert.equal(mockContext.bindFramebuffer.args[0][0], 'FRAMEBUFFER'); - assert.equal(mockContext.bindFramebuffer.args[0][1], mockInstance.framebuffer); + assert.equal( + mockContext.bindFramebuffer.args[0][1], + mockInstance.framebuffer + ); assert.equal(mockInstance.updateMaxTexSize.callCount, 1); assert.equal(mockInstance.framebuffer.width, 100); assert.equal(mockInstance.framebuffer.height, 100); diff --git a/test/internal/backend/headless-gl/kernel/index.js b/test/internal/backend/headless-gl/kernel/index.js index e3175ad1..daad0c6e 100644 --- a/test/internal/backend/headless-gl/kernel/index.js +++ b/test/internal/backend/headless-gl/kernel/index.js @@ -2,17 +2,20 @@ const { assert, test, module: describe, only, skip } = require('qunit'); describe('internal: HeadlessGLKernel'); -(typeof global !== 'undefined' ? test : skip)('.setupFeatureChecks() should not blow up, even if global WebGLRenderingContext is available', () => { - global.WebGLRenderingContext = {}; - global.document = { - createElement: () => { - return {}; - }, - }; - // this is done late on purpose! Do not change this, as it causes HeadlessGL to initialize with certain values - const { HeadlessGLKernel } = require('../../../../../src'); - HeadlessGLKernel.setupFeatureChecks(); - assert.ok(true); - delete global.document; - delete global.WebGLRenderingContext; -}); +(typeof global !== 'undefined' ? test : skip)( + '.setupFeatureChecks() should not blow up, even if global WebGLRenderingContext is available', + () => { + global.WebGLRenderingContext = {}; + global.document = { + createElement: () => { + return {}; + }, + }; + // this is done late on purpose! Do not change this, as it causes HeadlessGL to initialize with certain values + const { HeadlessGLKernel } = require('../../../../../src'); + HeadlessGLKernel.setupFeatureChecks(); + assert.ok(true); + delete global.document; + delete global.WebGLRenderingContext; + } +); diff --git a/test/internal/backend/web-gl/function-node/astBinaryExpression.js b/test/internal/backend/web-gl/function-node/astBinaryExpression.js index 358c1bfb..10b909d7 100644 --- a/test/internal/backend/web-gl/function-node/astBinaryExpression.js +++ b/test/internal/backend/web-gl/function-node/astBinaryExpression.js @@ -15,7 +15,12 @@ test('divide float & float', () => { } ); - assert.equal(node.toString(), 'float kernel(float user_left, float user_right) {' + '\nreturn (user_left/user_right);' + '\n}'); + assert.equal( + node.toString(), + 'float kernel(float user_left, float user_right) {' + + '\nreturn (user_left/user_right);' + + '\n}' + ); }); test('divide float & int', () => { @@ -30,7 +35,12 @@ test('divide float & int', () => { } ); - assert.equal(node.toString(), 'float kernel(float user_left, int user_right) {' + '\nreturn (user_left/float(user_right));' + '\n}'); + assert.equal( + node.toString(), + 'float kernel(float user_left, int user_right) {' + + '\nreturn (user_left/float(user_right));' + + '\n}' + ); }); test('divide float & literal float', () => { @@ -45,7 +55,10 @@ test('divide float & literal float', () => { } ); - assert.equal(node.toString(), 'float kernel(float user_left) {' + '\nreturn (user_left/1.1);' + '\n}'); + assert.equal( + node.toString(), + 'float kernel(float user_left) {' + '\nreturn (user_left/1.1);' + '\n}' + ); }); test('divide float & literal integer', () => { @@ -60,7 +73,10 @@ test('divide float & literal integer', () => { } ); - assert.equal(node.toString(), 'float kernel(float user_left) {' + '\nreturn (user_left/1.0);' + '\n}'); + assert.equal( + node.toString(), + 'float kernel(float user_left) {' + '\nreturn (user_left/1.0);' + '\n}' + ); }); test('divide float & Input', () => { @@ -76,7 +92,12 @@ test('divide float & Input', () => { } ); - assert.equal(node.toString(), 'float kernel(float user_left, sampler2D user_right,ivec2 user_rightSize,ivec3 user_rightDim) {' + '\nreturn (user_left/get32(user_right, user_rightSize, user_rightDim, 0, 0, threadId.x));' + '\n}'); + assert.equal( + node.toString(), + 'float kernel(float user_left, sampler2D user_right,ivec2 user_rightSize,ivec3 user_rightDim) {' + + '\nreturn (user_left/get32(user_right, user_rightSize, user_rightDim, 0, 0, threadId.x));' + + '\n}' + ); }); test('divide int & float', () => { @@ -91,7 +112,12 @@ test('divide int & float', () => { } ); - assert.equal(node.toString(), 'float kernel(int user_left, float user_right) {' + '\nreturn float((user_left/int(user_right)));' + '\n}'); + assert.equal( + node.toString(), + 'float kernel(int user_left, float user_right) {' + + '\nreturn float((user_left/int(user_right)));' + + '\n}' + ); }); test('divide int & int', () => { @@ -106,7 +132,12 @@ test('divide int & int', () => { } ); - assert.equal(node.toString(), 'float kernel(int user_left, int user_right) {' + '\nreturn float((user_left/user_right));' + '\n}'); + assert.equal( + node.toString(), + 'float kernel(int user_left, int user_right) {' + + '\nreturn float((user_left/user_right));' + + '\n}' + ); }); test('divide int & literal float', () => { @@ -121,7 +152,10 @@ test('divide int & literal float', () => { } ); - assert.equal(node.toString(), 'float kernel(int user_left) {' + '\nreturn float((user_left/1));' + '\n}'); + assert.equal( + node.toString(), + 'float kernel(int user_left) {' + '\nreturn float((user_left/1));' + '\n}' + ); }); test('divide int & literal integer', () => { @@ -136,7 +170,10 @@ test('divide int & literal integer', () => { } ); - assert.equal(node.toString(), 'float kernel(int user_left) {' + '\nreturn float((user_left/1));' + '\n}'); + assert.equal( + node.toString(), + 'float kernel(int user_left) {' + '\nreturn float((user_left/1));' + '\n}' + ); }); test('divide int & Input', () => { @@ -152,7 +189,12 @@ test('divide int & Input', () => { } ); - assert.equal(node.toString(), 'float kernel(int user_left, sampler2D user_right,ivec2 user_rightSize,ivec3 user_rightDim) {' + '\nreturn float((user_left/int(get32(user_right, user_rightSize, user_rightDim, 0, 0, threadId.x))));' + '\n}'); + assert.equal( + node.toString(), + 'float kernel(int user_left, sampler2D user_right,ivec2 user_rightSize,ivec3 user_rightDim) {' + + '\nreturn float((user_left/int(get32(user_right, user_rightSize, user_rightDim, 0, 0, threadId.x))));' + + '\n}' + ); }); test('divide literal integer & float', () => { @@ -167,7 +209,10 @@ test('divide literal integer & float', () => { } ); - assert.equal(node.toString(), 'float kernel(float user_left) {' + '\nreturn (1.0/user_left);' + '\n}'); + assert.equal( + node.toString(), + 'float kernel(float user_left) {' + '\nreturn (1.0/user_left);' + '\n}' + ); }); test('divide literal integer & int', () => { @@ -182,7 +227,10 @@ test('divide literal integer & int', () => { } ); - assert.equal(node.toString(), 'float kernel(int user_left) {' + '\nreturn float((1/user_left));' + '\n}'); + assert.equal( + node.toString(), + 'float kernel(int user_left) {' + '\nreturn float((1/user_left));' + '\n}' + ); }); test('divide literal integer & literal float', () => { @@ -197,7 +245,10 @@ test('divide literal integer & literal float', () => { } ); - assert.equal(node.toString(), 'float kernel() {' + '\nreturn (1.0/1.1);' + '\n}'); + assert.equal( + node.toString(), + 'float kernel() {' + '\nreturn (1.0/1.1);' + '\n}' + ); }); test('divide literal integer & literal integer', () => { @@ -212,7 +263,10 @@ test('divide literal integer & literal integer', () => { } ); - assert.equal(node.toString(), 'float kernel() {' + '\nreturn (1.0/1.0);' + '\n}'); + assert.equal( + node.toString(), + 'float kernel() {' + '\nreturn (1.0/1.0);' + '\n}' + ); }); test('divide literal integer & Input', () => { @@ -228,7 +282,12 @@ test('divide literal integer & Input', () => { } ); - assert.equal(node.toString(), 'float kernel(sampler2D user_v,ivec2 user_vSize,ivec3 user_vDim) {' + '\nreturn (1.0/get32(user_v, user_vSize, user_vDim, 0, 0, threadId.x));' + '\n}'); + assert.equal( + node.toString(), + 'float kernel(sampler2D user_v,ivec2 user_vSize,ivec3 user_vDim) {' + + '\nreturn (1.0/get32(user_v, user_vSize, user_vDim, 0, 0, threadId.x));' + + '\n}' + ); }); test('divide literal float & float', () => { @@ -243,7 +302,10 @@ test('divide literal float & float', () => { } ); - assert.equal(node.toString(), 'float kernel(float user_right) {' + '\nreturn (1.1/user_right);' + '\n}'); + assert.equal( + node.toString(), + 'float kernel(float user_right) {' + '\nreturn (1.1/user_right);' + '\n}' + ); }); test('divide literal float & int', () => { @@ -258,7 +320,12 @@ test('divide literal float & int', () => { } ); - assert.equal(node.toString(), 'float kernel(int user_right) {' + '\nreturn (1.1/float(user_right));' + '\n}'); + assert.equal( + node.toString(), + 'float kernel(int user_right) {' + + '\nreturn (1.1/float(user_right));' + + '\n}' + ); }); test('divide literal float & literal float', () => { @@ -273,7 +340,10 @@ test('divide literal float & literal float', () => { } ); - assert.equal(node.toString(), 'float kernel() {' + '\nreturn (1.1/1.1);' + '\n}'); + assert.equal( + node.toString(), + 'float kernel() {' + '\nreturn (1.1/1.1);' + '\n}' + ); }); test('divide literal float & literal integer', () => { @@ -288,7 +358,10 @@ test('divide literal float & literal integer', () => { } ); - assert.equal(node.toString(), 'float kernel() {' + '\nreturn (1.1/1.0);' + '\n}'); + assert.equal( + node.toString(), + 'float kernel() {' + '\nreturn (1.1/1.0);' + '\n}' + ); }); test('divide literal float & Input', () => { @@ -304,7 +377,12 @@ test('divide literal float & Input', () => { } ); - assert.equal(node.toString(), 'float kernel(sampler2D user_v,ivec2 user_vSize,ivec3 user_vDim) {' + '\nreturn (1.1/get32(user_v, user_vSize, user_vDim, 0, 0, threadId.x));' + '\n}'); + assert.equal( + node.toString(), + 'float kernel(sampler2D user_v,ivec2 user_vSize,ivec3 user_vDim) {' + + '\nreturn (1.1/get32(user_v, user_vSize, user_vDim, 0, 0, threadId.x));' + + '\n}' + ); }); test('divide this.thread.x by this.output.x and multiple, integer, integer, and float with this.fixIntegerDivisionAccuracy = false', () => { @@ -321,7 +399,10 @@ test('divide this.thread.x by this.output.x and multiple, integer, integer, and } ); - assert.equal(node.toString(), 'float kernel() {' + '\nreturn float(((threadId.x/1)*4));' + '\n}'); + assert.equal( + node.toString(), + 'float kernel() {' + '\nreturn float(((threadId.x/1)*4));' + '\n}' + ); }); test('divide this.thread.x by this.output.x and multiple, integer, integer, and float with this.fixIntegerDivisionAccuracy = true', () => { @@ -338,41 +419,80 @@ test('divide this.thread.x by this.output.x and multiple, integer, integer, and } ); - assert.equal(node.toString(), 'float kernel() {' + '\nreturn (divWithIntCheck(float(threadId.x), 1.0)*4.0);' + '\n}'); + assert.equal( + node.toString(), + 'float kernel() {' + + '\nreturn (divWithIntCheck(float(threadId.x), 1.0)*4.0);' + + '\n}' + ); }); test('multiply Input and Input', () => { - const node = new WebGLFunctionNode('function kernel(v1, v2) {' + '\n return v1[this.thread.x] * v2[this.thread.x];' + '\n}', { - output: [1], - argumentTypes: ['Input', 'Input'], - lookupFunctionArgumentBitRatio: () => 4, - }); - assert.equal(node.toString(), 'float kernel(sampler2D user_v1,ivec2 user_v1Size,ivec3 user_v1Dim, sampler2D user_v2,ivec2 user_v2Size,ivec3 user_v2Dim) {' + '\nreturn (get32(user_v1, user_v1Size, user_v1Dim, 0, 0, threadId.x)*get32(user_v2, user_v2Size, user_v2Dim, 0, 0, threadId.x));' + '\n}'); + const node = new WebGLFunctionNode( + 'function kernel(v1, v2) {' + + '\n return v1[this.thread.x] * v2[this.thread.x];' + + '\n}', + { + output: [1], + argumentTypes: ['Input', 'Input'], + lookupFunctionArgumentBitRatio: () => 4, + } + ); + assert.equal( + node.toString(), + 'float kernel(sampler2D user_v1,ivec2 user_v1Size,ivec3 user_v1Dim, sampler2D user_v2,ivec2 user_v2Size,ivec3 user_v2Dim) {' + + '\nreturn (get32(user_v1, user_v1Size, user_v1Dim, 0, 0, threadId.x)*get32(user_v2, user_v2Size, user_v2Dim, 0, 0, threadId.x));' + + '\n}' + ); }); test('multiply Input and int', () => { - const node = new WebGLFunctionNode('function kernel(v1, v2) {' + '\n return v1[this.thread.x] * v2;' + '\n}', { - output: [1], - argumentTypes: ['Input', 'Integer'], - lookupFunctionArgumentBitRatio: () => 4, - }); - assert.equal(node.toString(), 'float kernel(sampler2D user_v1,ivec2 user_v1Size,ivec3 user_v1Dim, int user_v2) {' + '\nreturn (get32(user_v1, user_v1Size, user_v1Dim, 0, 0, threadId.x)*float(user_v2));' + '\n}'); + const node = new WebGLFunctionNode( + 'function kernel(v1, v2) {' + '\n return v1[this.thread.x] * v2;' + '\n}', + { + output: [1], + argumentTypes: ['Input', 'Integer'], + lookupFunctionArgumentBitRatio: () => 4, + } + ); + assert.equal( + node.toString(), + 'float kernel(sampler2D user_v1,ivec2 user_v1Size,ivec3 user_v1Dim, int user_v2) {' + + '\nreturn (get32(user_v1, user_v1Size, user_v1Dim, 0, 0, threadId.x)*float(user_v2));' + + '\n}' + ); }); test('multiply Input and float', () => { - const node = new WebGLFunctionNode('function kernel(v1, v2) {' + '\n return v1[this.thread.x] * v2;' + '\n}', { - output: [1], - argumentTypes: ['Input', 'Float'], - lookupFunctionArgumentBitRatio: () => 4, - }); - assert.equal(node.toString(), 'float kernel(sampler2D user_v1,ivec2 user_v1Size,ivec3 user_v1Dim, float user_v2) {' + '\nreturn (get32(user_v1, user_v1Size, user_v1Dim, 0, 0, threadId.x)*user_v2);' + '\n}'); + const node = new WebGLFunctionNode( + 'function kernel(v1, v2) {' + '\n return v1[this.thread.x] * v2;' + '\n}', + { + output: [1], + argumentTypes: ['Input', 'Float'], + lookupFunctionArgumentBitRatio: () => 4, + } + ); + assert.equal( + node.toString(), + 'float kernel(sampler2D user_v1,ivec2 user_v1Size,ivec3 user_v1Dim, float user_v2) {' + + '\nreturn (get32(user_v1, user_v1Size, user_v1Dim, 0, 0, threadId.x)*user_v2);' + + '\n}' + ); }); test('multiply Input and Number', () => { - const node = new WebGLFunctionNode('function kernel(v1, v2) {' + '\n return v1[this.thread.x] * v2;' + '\n}', { - output: [1], - argumentTypes: ['Input', 'Number'], - lookupFunctionArgumentBitRatio: () => 4, - }); - assert.equal(node.toString(), 'float kernel(sampler2D user_v1,ivec2 user_v1Size,ivec3 user_v1Dim, float user_v2) {' + '\nreturn (get32(user_v1, user_v1Size, user_v1Dim, 0, 0, threadId.x)*user_v2);' + '\n}'); + const node = new WebGLFunctionNode( + 'function kernel(v1, v2) {' + '\n return v1[this.thread.x] * v2;' + '\n}', + { + output: [1], + argumentTypes: ['Input', 'Number'], + lookupFunctionArgumentBitRatio: () => 4, + } + ); + assert.equal( + node.toString(), + 'float kernel(sampler2D user_v1,ivec2 user_v1Size,ivec3 user_v1Dim, float user_v2) {' + + '\nreturn (get32(user_v1, user_v1Size, user_v1Dim, 0, 0, threadId.x)*user_v2);' + + '\n}' + ); }); diff --git a/test/internal/backend/web-gl/function-node/astCallExpression.js b/test/internal/backend/web-gl/function-node/astCallExpression.js index db0da4e8..71350391 100644 --- a/test/internal/backend/web-gl/function-node/astCallExpression.js +++ b/test/internal/backend/web-gl/function-node/astCallExpression.js @@ -10,7 +10,10 @@ test('handles Math.abs with floats', () => { }`, { output: [1], argumentTypes: ['Number'] } ); - assert.equal(node.toString(), 'float kernel(float user_v) {' + '\nreturn abs(user_v);' + '\n}'); + assert.equal( + node.toString(), + 'float kernel(float user_v) {' + '\nreturn abs(user_v);' + '\n}' + ); }); test('handles Math.abs with ints', () => { const node = new WebGLFunctionNode( @@ -19,7 +22,10 @@ test('handles Math.abs with ints', () => { }`, { output: [1], argumentTypes: ['Integer'] } ); - assert.equal(node.toString(), 'float kernel(int user_v) {' + '\nreturn abs(float(user_v));' + '\n}'); + assert.equal( + node.toString(), + 'float kernel(int user_v) {' + '\nreturn abs(float(user_v));' + '\n}' + ); }); test('handles Math.pow with floats', () => { const node = new WebGLFunctionNode( @@ -28,7 +34,12 @@ test('handles Math.pow with floats', () => { }`, { output: [1], argumentTypes: ['Number', 'Number'] } ); - assert.equal(node.toString(), 'float kernel(float user_v, float user_v2) {' + '\nreturn _pow(user_v, user_v2);' + '\n}'); + assert.equal( + node.toString(), + 'float kernel(float user_v, float user_v2) {' + + '\nreturn _pow(user_v, user_v2);' + + '\n}' + ); }); test('handles Math.pow with mixed 1', () => { const node = new WebGLFunctionNode( @@ -37,7 +48,12 @@ test('handles Math.pow with mixed 1', () => { }`, { output: [1], argumentTypes: ['Number', 'Integer'] } ); - assert.equal(node.toString(), 'float kernel(float user_v, int user_v2) {' + '\nreturn _pow(user_v, float(user_v2));' + '\n}'); + assert.equal( + node.toString(), + 'float kernel(float user_v, int user_v2) {' + + '\nreturn _pow(user_v, float(user_v2));' + + '\n}' + ); }); test('handles Math.pow with mixed 2', () => { const node = new WebGLFunctionNode( @@ -46,7 +62,12 @@ test('handles Math.pow with mixed 2', () => { }`, { output: [1], argumentTypes: ['Integer', 'Number'] } ); - assert.equal(node.toString(), 'float kernel(int user_v, float user_v2) {' + '\nreturn _pow(float(user_v), user_v2);' + '\n}'); + assert.equal( + node.toString(), + 'float kernel(int user_v, float user_v2) {' + + '\nreturn _pow(float(user_v), user_v2);' + + '\n}' + ); }); test('handles Math.pow with ints', () => { const node = new WebGLFunctionNode( @@ -55,61 +76,86 @@ test('handles Math.pow with ints', () => { }`, { output: [1], argumentTypes: ['Integer', 'Integer'] } ); - assert.equal(node.toString(), 'float kernel(int user_v, int user_v2) {' + '\nreturn _pow(float(user_v), float(user_v2));' + '\n}'); + assert.equal( + node.toString(), + 'float kernel(int user_v, int user_v2) {' + + '\nreturn _pow(float(user_v), float(user_v2));' + + '\n}' + ); }); test('handles argument of type Input', () => { let lookupReturnTypeCalls = 0; let lookupFunctionArgumentTypes = 0; - const node = new WebGLFunctionNode('function kernel(v) {' + '\n return childFunction(v);' + '\n}', { - output: [1], - argumentTypes: ['Input'], - needsArgumentType: () => false, - lookupReturnType: functionName => { - lookupReturnTypeCalls++; - if (functionName === 'childFunction') { - return 'Number'; - } - throw new Error(`unhanded lookupReturnType for ${functionName}`); - }, - lookupFunctionArgumentTypes: functionName => { - lookupFunctionArgumentTypes++; - if (functionName === 'childFunction') { - return ['Input']; - } - throw new Error(`unhanded lookupFunctionArgumentTypes for ${functionName}`); - }, - triggerImplyArgumentBitRatio: () => {}, - assignArgumentType: () => {}, - }); - assert.equal(node.toString(), 'float kernel(sampler2D user_v,ivec2 user_vSize,ivec3 user_vDim) {' + '\nreturn childFunction(user_v,user_vSize,user_vDim);' + '\n}'); + const node = new WebGLFunctionNode( + 'function kernel(v) {' + '\n return childFunction(v);' + '\n}', + { + output: [1], + argumentTypes: ['Input'], + needsArgumentType: () => false, + lookupReturnType: functionName => { + lookupReturnTypeCalls++; + if (functionName === 'childFunction') { + return 'Number'; + } + throw new Error(`unhanded lookupReturnType for ${functionName}`); + }, + lookupFunctionArgumentTypes: functionName => { + lookupFunctionArgumentTypes++; + if (functionName === 'childFunction') { + return ['Input']; + } + throw new Error( + `unhanded lookupFunctionArgumentTypes for ${functionName}` + ); + }, + triggerImplyArgumentBitRatio: () => {}, + assignArgumentType: () => {}, + } + ); + assert.equal( + node.toString(), + 'float kernel(sampler2D user_v,ivec2 user_vSize,ivec3 user_vDim) {' + + '\nreturn childFunction(user_v,user_vSize,user_vDim);' + + '\n}' + ); assert.equal(lookupReturnTypeCalls, 2); assert.equal(lookupFunctionArgumentTypes, 1); }); test('handles argument of type HTMLImageArray', () => { let lookupReturnTypeCalls = 0; let lookupFunctionArgumentTypes = 0; - const node = new WebGLFunctionNode('function kernel(v) {' + '\n return childFunction(v);' + '\n}', { - output: [1], - argumentTypes: ['HTMLImageArray'], - needsArgumentType: () => false, - lookupReturnType: functionName => { - lookupReturnTypeCalls++; - if (functionName === 'childFunction') { - return 'Number'; - } - throw new Error(`unhanded lookupReturnType for ${functionName}`); - }, - lookupFunctionArgumentTypes: functionName => { - lookupFunctionArgumentTypes++; - if (functionName === 'childFunction') { - return ['HTMLImageArray']; - } - throw new Error(`unhanded lookupFunctionArgumentTypes for ${functionName}`); - }, - triggerImplyArgumentBitRatio: () => {}, - assignArgumentType: () => {}, - }); - assert.equal(node.toString(), 'float kernel(sampler2DArray user_v,ivec2 user_vSize,ivec3 user_vDim) {' + '\nreturn childFunction(user_v,user_vSize,user_vDim);' + '\n}'); + const node = new WebGLFunctionNode( + 'function kernel(v) {' + '\n return childFunction(v);' + '\n}', + { + output: [1], + argumentTypes: ['HTMLImageArray'], + needsArgumentType: () => false, + lookupReturnType: functionName => { + lookupReturnTypeCalls++; + if (functionName === 'childFunction') { + return 'Number'; + } + throw new Error(`unhanded lookupReturnType for ${functionName}`); + }, + lookupFunctionArgumentTypes: functionName => { + lookupFunctionArgumentTypes++; + if (functionName === 'childFunction') { + return ['HTMLImageArray']; + } + throw new Error( + `unhanded lookupFunctionArgumentTypes for ${functionName}` + ); + }, + triggerImplyArgumentBitRatio: () => {}, + assignArgumentType: () => {}, + } + ); + assert.equal( + node.toString(), + 'float kernel(sampler2DArray user_v,ivec2 user_vSize,ivec3 user_vDim) {' + + '\nreturn childFunction(user_v,user_vSize,user_vDim);' + + '\n}' + ); assert.equal(lookupReturnTypeCalls, 2); assert.equal(lookupFunctionArgumentTypes, 1); }); diff --git a/test/internal/backend/web-gl/function-node/astForStatement.js b/test/internal/backend/web-gl/function-node/astForStatement.js index 7cc32e74..4804bb1a 100644 --- a/test/internal/backend/web-gl/function-node/astForStatement.js +++ b/test/internal/backend/web-gl/function-node/astForStatement.js @@ -17,7 +17,16 @@ test('with safe loop with init', () => { } ); - assert.equal(node.toString(), 'float kernel() {' + '\nint user_sum=0;' + '\nfor (int user_i=0;(user_i<100);user_i++){' + '\nuser_sum++;}' + '\n' + '\nreturn float(user_sum);' + '\n}'); + assert.equal( + node.toString(), + 'float kernel() {' + + '\nint user_sum=0;' + + '\nfor (int user_i=0;(user_i<100);user_i++){' + + '\nuser_sum++;}' + + '\n' + + '\nreturn float(user_sum);' + + '\n}' + ); }); test('with safe loop with init and if', () => { @@ -36,7 +45,18 @@ test('with safe loop with init and if', () => { } ); - assert.equal(node.toString(), 'float kernel() {' + '\nint user_sum=0;' + '\nfor (int user_i=0;(user_i<100);user_i++){' + '\nif ((user_i>50)){' + '\nuser_sum++;}' + '\n}' + '\n' + '\nreturn float(user_sum);' + '\n}'); + assert.equal( + node.toString(), + 'float kernel() {' + + '\nint user_sum=0;' + + '\nfor (int user_i=0;(user_i<100);user_i++){' + + '\nif ((user_i>50)){' + + '\nuser_sum++;}' + + '\n}' + + '\n' + + '\nreturn float(user_sum);' + + '\n}' + ); }); test('with safe loop with no init', () => { @@ -54,7 +74,19 @@ test('with safe loop with no init', () => { } ); - assert.equal(node.toString(), 'float kernel() {' + '\nint user_sum=0;' + '\nint user_i=0;' + '\nfor (int safeI=0;safeI { @@ -72,7 +104,21 @@ test('with safe loop with no test', () => { } ); - assert.equal(node.toString(), 'float kernel() {' + '\nint user_sum=0;' + '\nint user_i=0;' + '\nfor (int safeI=0;safeI100)) {' + '\nbreak;' + '\n}' + '\nuser_sum++;' + '\nuser_i++;}' + '\n' + '\nreturn float(user_sum);' + '\n}'); + assert.equal( + node.toString(), + 'float kernel() {' + + '\nint user_sum=0;' + + '\nint user_i=0;' + + '\nfor (int safeI=0;safeI100)) {' + + '\nbreak;' + + '\n}' + + '\nuser_sum++;' + + '\nuser_i++;}' + + '\n' + + '\nreturn float(user_sum);' + + '\n}' + ); }); test('with unsafe loop with init', () => { @@ -90,7 +136,19 @@ test('with unsafe loop with init', () => { } ); - assert.equal(node.toString(), 'float kernel(float user_arg1) {' + '\nint user_sum=0;' + '\nfloat user_i=(0.0+user_arg1);' + '\nfor (int safeI=0;safeI { @@ -109,7 +167,19 @@ test('with unsafe loop with no init', () => { } ); - assert.equal(node.toString(), 'float kernel(float user_arg1) {' + '\nint user_sum=0;' + '\nfloat user_i=(0.0+user_arg1);' + '\nfor (int safeI=0;safeI { @@ -128,7 +198,19 @@ test('with unsafe loop with no init reversed', () => { } ); - assert.equal(node.toString(), 'float kernel(float user_arg1) {' + '\nint user_sum=0;' + '\nfloat user_i=(0.0+user_arg1);' + '\nfor (int safeI=0;safeIuser_i)) break;' + '\nuser_sum++;' + '\nuser_i++;}' + '\n' + '\nreturn float(user_sum);' + '\n}'); + assert.equal( + node.toString(), + 'float kernel(float user_arg1) {' + + '\nint user_sum=0;' + + '\nfloat user_i=(0.0+user_arg1);' + + '\nfor (int safeI=0;safeIuser_i)) break;' + + '\nuser_sum++;' + + '\nuser_i++;}' + + '\n' + + '\nreturn float(user_sum);' + + '\n}' + ); }); test('nested safe loop', () => { @@ -147,7 +229,18 @@ test('nested safe loop', () => { } ); - assert.equal(node.toString(), 'float kernel() {' + '\nint user_sum=0;' + '\nfor (int user_i=0;(user_i<100);user_i++){' + '\nfor (int user_j=0;(user_j<100);user_j++){' + '\nuser_sum++;}' + '\n}' + '\n' + '\nreturn float(user_sum);' + '\n}'); + assert.equal( + node.toString(), + 'float kernel() {' + + '\nint user_sum=0;' + + '\nfor (int user_i=0;(user_i<100);user_i++){' + + '\nfor (int user_j=0;(user_j<100);user_j++){' + + '\nuser_sum++;}' + + '\n}' + + '\n' + + '\nreturn float(user_sum);' + + '\n}' + ); }); test('nested unsafe loop', () => { @@ -167,7 +260,24 @@ test('nested unsafe loop', () => { } ); - assert.equal(node.toString(), 'float kernel(float user_arg1, float user_arg2) {' + '\nint user_sum=0;' + '\nfloat user_i=user_arg1;' + '\nfor (int safeI2=0;safeI2 { @@ -185,7 +295,16 @@ test('this.output.x usage inside loop', () => { } ); - assert.equal(node.toString(), 'float kernel() {' + '\nfloat user_sum=0.0;' + '\nfor (int user_i=0;(user_i<1);user_i++){' + '\nuser_sum+=1.0;}' + '\n' + '\nreturn user_sum;' + '\n}'); + assert.equal( + node.toString(), + 'float kernel() {' + + '\nfloat user_sum=0.0;' + + '\nfor (int user_i=0;(user_i<1);user_i++){' + + '\nuser_sum+=1.0;}' + + '\n' + + '\nreturn user_sum;' + + '\n}' + ); }); test('this.thread.x usage inside loop', () => { @@ -203,7 +322,16 @@ test('this.thread.x usage inside loop', () => { } ); - assert.equal(node.toString(), 'float kernel() {' + '\nfloat user_sum=0.0;' + '\nfor (int user_i=0;(user_i { @@ -222,5 +350,15 @@ test('this.thread.x usage outside loop', () => { } ); - assert.equal(node.toString(), 'float kernel() {' + '\nfloat user_sum=0.0;' + '\nfloat user_x=float(threadId.x);' + '\nfor (int user_i=0;(user_i { argumentTypes: ['Array', 'Array'], lookupFunctionArgumentBitRatio: () => 4, }), - 'vec2 user_value=vec2(' + 'get32(user_arg1, user_arg1Size, user_arg1Dim, 0, 0, 0), ' + 'get32(user_arg2, user_arg2Size, user_arg2Dim, 0, 0, 0)' + ');' + 'vec2 user_value=vec2(' + + 'get32(user_arg1, user_arg1Size, user_arg1Dim, 0, 0, 0), ' + + 'get32(user_arg2, user_arg2Size, user_arg2Dim, 0, 0, 0)' + + ');' ); }); @@ -90,7 +93,11 @@ test('Array3 value[] from value[]', () => { argumentTypes: ['Array', 'Array', 'Array'], lookupFunctionArgumentBitRatio: () => 4, }), - 'vec3 user_value=vec3(' + 'get32(user_arg1, user_arg1Size, user_arg1Dim, 0, 0, 0), ' + 'get32(user_arg2, user_arg2Size, user_arg2Dim, 0, 0, 0), ' + 'get32(user_arg3, user_arg3Size, user_arg3Dim, 0, 0, 0)' + ');' + 'vec3 user_value=vec3(' + + 'get32(user_arg1, user_arg1Size, user_arg1Dim, 0, 0, 0), ' + + 'get32(user_arg2, user_arg2Size, user_arg2Dim, 0, 0, 0), ' + + 'get32(user_arg3, user_arg3Size, user_arg3Dim, 0, 0, 0)' + + ');' ); }); @@ -101,40 +108,111 @@ test('Array4 value[] from value[]', () => { argumentTypes: ['Array', 'Array', 'Array', 'Array'], lookupFunctionArgumentBitRatio: () => 4, }), - 'vec4 user_value=vec4(' + 'get32(user_arg1, user_arg1Size, user_arg1Dim, 0, 0, 0), ' + 'get32(user_arg2, user_arg2Size, user_arg2Dim, 0, 0, 0), ' + 'get32(user_arg3, user_arg3Size, user_arg3Dim, 0, 0, 0), ' + 'get32(user_arg4, user_arg4Size, user_arg4Dim, 0, 0, 0)' + ');' + 'vec4 user_value=vec4(' + + 'get32(user_arg1, user_arg1Size, user_arg1Dim, 0, 0, 0), ' + + 'get32(user_arg2, user_arg2Size, user_arg2Dim, 0, 0, 0), ' + + 'get32(user_arg3, user_arg3Size, user_arg3Dim, 0, 0, 0), ' + + 'get32(user_arg4, user_arg4Size, user_arg4Dim, 0, 0, 0)' + + ');' ); }); test('float, Array2, Array3 chain values', () => { assert.equal( - run('const value1 = 1, ' + 'value2 = [arg1[0], arg2[0]], ' + 'value3 = [arg1[0], arg2[0], arg3[0]], ' + 'value4 = [arg1[0], arg2[0], arg3[0], arg4[0]];', { - argumentNames: ['arg1', 'arg2', 'arg3', 'arg4'], - argumentTypes: ['Array', 'Array', 'Array', 'Array'], - lookupFunctionArgumentBitRatio: () => 4, - }), - 'float user_value1=1.0;' + 'vec2 user_value2=vec2(' + 'get32(user_arg1, user_arg1Size, user_arg1Dim, 0, 0, 0), ' + 'get32(user_arg2, user_arg2Size, user_arg2Dim, 0, 0, 0)' + ');' + 'vec3 user_value3=vec3(' + 'get32(user_arg1, user_arg1Size, user_arg1Dim, 0, 0, 0), ' + 'get32(user_arg2, user_arg2Size, user_arg2Dim, 0, 0, 0), ' + 'get32(user_arg3, user_arg3Size, user_arg3Dim, 0, 0, 0)' + ');' + 'vec4 user_value4=vec4(' + 'get32(user_arg1, user_arg1Size, user_arg1Dim, 0, 0, 0), ' + 'get32(user_arg2, user_arg2Size, user_arg2Dim, 0, 0, 0), ' + 'get32(user_arg3, user_arg3Size, user_arg3Dim, 0, 0, 0), ' + 'get32(user_arg4, user_arg4Size, user_arg4Dim, 0, 0, 0)' + ');' + run( + 'const value1 = 1, ' + + 'value2 = [arg1[0], arg2[0]], ' + + 'value3 = [arg1[0], arg2[0], arg3[0]], ' + + 'value4 = [arg1[0], arg2[0], arg3[0], arg4[0]];', + { + argumentNames: ['arg1', 'arg2', 'arg3', 'arg4'], + argumentTypes: ['Array', 'Array', 'Array', 'Array'], + lookupFunctionArgumentBitRatio: () => 4, + } + ), + 'float user_value1=1.0;' + + 'vec2 user_value2=vec2(' + + 'get32(user_arg1, user_arg1Size, user_arg1Dim, 0, 0, 0), ' + + 'get32(user_arg2, user_arg2Size, user_arg2Dim, 0, 0, 0)' + + ');' + + 'vec3 user_value3=vec3(' + + 'get32(user_arg1, user_arg1Size, user_arg1Dim, 0, 0, 0), ' + + 'get32(user_arg2, user_arg2Size, user_arg2Dim, 0, 0, 0), ' + + 'get32(user_arg3, user_arg3Size, user_arg3Dim, 0, 0, 0)' + + ');' + + 'vec4 user_value4=vec4(' + + 'get32(user_arg1, user_arg1Size, user_arg1Dim, 0, 0, 0), ' + + 'get32(user_arg2, user_arg2Size, user_arg2Dim, 0, 0, 0), ' + + 'get32(user_arg3, user_arg3Size, user_arg3Dim, 0, 0, 0), ' + + 'get32(user_arg4, user_arg4Size, user_arg4Dim, 0, 0, 0)' + + ');' ); }); test('float, Array2, Array3, Array4 multiple values', () => { assert.equal( - run('const value1 = 1, ' + 'value2 = [arg1[0], arg2[0]], ' + 'value3 = [arg1[0], arg2[0], arg3[0]], ' + 'value4 = [arg1[0], arg2[0], arg3[0], arg4[0]];', { - argumentNames: ['arg1', 'arg2', 'arg3', 'arg4'], - argumentTypes: ['Array', 'Array', 'Array', 'Array'], - lookupFunctionArgumentBitRatio: () => 4, - }), - 'float user_value1=1.0;' + 'vec2 user_value2=vec2(' + 'get32(user_arg1, user_arg1Size, user_arg1Dim, 0, 0, 0), ' + 'get32(user_arg2, user_arg2Size, user_arg2Dim, 0, 0, 0)' + ');' + 'vec3 user_value3=vec3(' + 'get32(user_arg1, user_arg1Size, user_arg1Dim, 0, 0, 0), ' + 'get32(user_arg2, user_arg2Size, user_arg2Dim, 0, 0, 0), ' + 'get32(user_arg3, user_arg3Size, user_arg3Dim, 0, 0, 0)' + ');' + 'vec4 user_value4=vec4(' + 'get32(user_arg1, user_arg1Size, user_arg1Dim, 0, 0, 0), ' + 'get32(user_arg2, user_arg2Size, user_arg2Dim, 0, 0, 0), ' + 'get32(user_arg3, user_arg3Size, user_arg3Dim, 0, 0, 0), ' + 'get32(user_arg4, user_arg4Size, user_arg4Dim, 0, 0, 0)' + ');' + run( + 'const value1 = 1, ' + + 'value2 = [arg1[0], arg2[0]], ' + + 'value3 = [arg1[0], arg2[0], arg3[0]], ' + + 'value4 = [arg1[0], arg2[0], arg3[0], arg4[0]];', + { + argumentNames: ['arg1', 'arg2', 'arg3', 'arg4'], + argumentTypes: ['Array', 'Array', 'Array', 'Array'], + lookupFunctionArgumentBitRatio: () => 4, + } + ), + 'float user_value1=1.0;' + + 'vec2 user_value2=vec2(' + + 'get32(user_arg1, user_arg1Size, user_arg1Dim, 0, 0, 0), ' + + 'get32(user_arg2, user_arg2Size, user_arg2Dim, 0, 0, 0)' + + ');' + + 'vec3 user_value3=vec3(' + + 'get32(user_arg1, user_arg1Size, user_arg1Dim, 0, 0, 0), ' + + 'get32(user_arg2, user_arg2Size, user_arg2Dim, 0, 0, 0), ' + + 'get32(user_arg3, user_arg3Size, user_arg3Dim, 0, 0, 0)' + + ');' + + 'vec4 user_value4=vec4(' + + 'get32(user_arg1, user_arg1Size, user_arg1Dim, 0, 0, 0), ' + + 'get32(user_arg2, user_arg2Size, user_arg2Dim, 0, 0, 0), ' + + 'get32(user_arg3, user_arg3Size, user_arg3Dim, 0, 0, 0), ' + + 'get32(user_arg4, user_arg4Size, user_arg4Dim, 0, 0, 0)' + + ');' ); }); test('float, float, Array4, Array4, Array4 chain values', () => { assert.equal( - run('const value1 = 1, value2 = 1.5, ' + 'value3 = [arg1[0], arg2[0], arg3[0], arg4[0]], ' + 'value4 = [arg4[4], arg3[4], arg2[4], arg1[4]], ' + 'value5 = [arg2[1], arg2[2], arg2[3], arg2[4]];', { - argumentNames: ['arg1', 'arg2', 'arg3', 'arg4'], - argumentTypes: ['Array', 'Array', 'Array', 'Array'], - lookupFunctionArgumentBitRatio: () => 4, - }), - 'float user_value1=1.0,user_value2=1.5;' + 'vec4 user_value3=vec4(' + 'get32(user_arg1, user_arg1Size, user_arg1Dim, 0, 0, 0), ' + 'get32(user_arg2, user_arg2Size, user_arg2Dim, 0, 0, 0), ' + 'get32(user_arg3, user_arg3Size, user_arg3Dim, 0, 0, 0), ' + 'get32(user_arg4, user_arg4Size, user_arg4Dim, 0, 0, 0)' + '),' + 'user_value4=vec4(' + 'get32(user_arg4, user_arg4Size, user_arg4Dim, 0, 0, 4), ' + 'get32(user_arg3, user_arg3Size, user_arg3Dim, 0, 0, 4), ' + 'get32(user_arg2, user_arg2Size, user_arg2Dim, 0, 0, 4), ' + 'get32(user_arg1, user_arg1Size, user_arg1Dim, 0, 0, 4)' + '),' + 'user_value5=vec4(' + 'get32(user_arg2, user_arg2Size, user_arg2Dim, 0, 0, 1), ' + 'get32(user_arg2, user_arg2Size, user_arg2Dim, 0, 0, 2), ' + 'get32(user_arg2, user_arg2Size, user_arg2Dim, 0, 0, 3), ' + 'get32(user_arg2, user_arg2Size, user_arg2Dim, 0, 0, 4)' + ');' + run( + 'const value1 = 1, value2 = 1.5, ' + + 'value3 = [arg1[0], arg2[0], arg3[0], arg4[0]], ' + + 'value4 = [arg4[4], arg3[4], arg2[4], arg1[4]], ' + + 'value5 = [arg2[1], arg2[2], arg2[3], arg2[4]];', + { + argumentNames: ['arg1', 'arg2', 'arg3', 'arg4'], + argumentTypes: ['Array', 'Array', 'Array', 'Array'], + lookupFunctionArgumentBitRatio: () => 4, + } + ), + 'float user_value1=1.0,user_value2=1.5;' + + 'vec4 user_value3=vec4(' + + 'get32(user_arg1, user_arg1Size, user_arg1Dim, 0, 0, 0), ' + + 'get32(user_arg2, user_arg2Size, user_arg2Dim, 0, 0, 0), ' + + 'get32(user_arg3, user_arg3Size, user_arg3Dim, 0, 0, 0), ' + + 'get32(user_arg4, user_arg4Size, user_arg4Dim, 0, 0, 0)' + + '),' + + 'user_value4=vec4(' + + 'get32(user_arg4, user_arg4Size, user_arg4Dim, 0, 0, 4), ' + + 'get32(user_arg3, user_arg3Size, user_arg3Dim, 0, 0, 4), ' + + 'get32(user_arg2, user_arg2Size, user_arg2Dim, 0, 0, 4), ' + + 'get32(user_arg1, user_arg1Size, user_arg1Dim, 0, 0, 4)' + + '),' + + 'user_value5=vec4(' + + 'get32(user_arg2, user_arg2Size, user_arg2Dim, 0, 0, 1), ' + + 'get32(user_arg2, user_arg2Size, user_arg2Dim, 0, 0, 2), ' + + 'get32(user_arg2, user_arg2Size, user_arg2Dim, 0, 0, 3), ' + + 'get32(user_arg2, user_arg2Size, user_arg2Dim, 0, 0, 4)' + + ');' ); }); @@ -227,15 +305,24 @@ test('this.constants.value[][][] float', () => { }); test('this.thread.x float', () => { - assert.equal(run('const value = this.thread.x'), 'float user_value=float(threadId.x);'); + assert.equal( + run('const value = this.thread.x'), + 'float user_value=float(threadId.x);' + ); }); test('this.thread.y float', () => { - assert.equal(run('const value = this.thread.y'), 'float user_value=float(threadId.y);'); + assert.equal( + run('const value = this.thread.y'), + 'float user_value=float(threadId.y);' + ); }); test('this.thread.z float', () => { - assert.equal(run('const value = this.thread.z'), 'float user_value=float(threadId.z);'); + assert.equal( + run('const value = this.thread.z'), + 'float user_value=float(threadId.z);' + ); }); test('this.output.x float', () => { @@ -257,9 +344,15 @@ test('this.outputs.z throws', () => { }); test('Math.E Number float', () => { - assert.equal(run('const value = Math.E'), `float user_value=${Math.E.toString()};`); + assert.equal( + run('const value = Math.E'), + `float user_value=${Math.E.toString()};` + ); }); test('Math.E Number float', () => { - assert.equal(run('const value = Math.E'), `float user_value=${Math.E.toString()};`); + assert.equal( + run('const value = Math.E'), + `float user_value=${Math.E.toString()};` + ); }); diff --git a/test/internal/backend/web-gl/function-node/contexts.js b/test/internal/backend/web-gl/function-node/contexts.js index 02bc8bde..8345b56f 100644 --- a/test/internal/backend/web-gl/function-node/contexts.js +++ b/test/internal/backend/web-gl/function-node/contexts.js @@ -184,7 +184,9 @@ test('safe from multiplication deep', () => { node.toString(); const { const1, const10 } = node.contexts[1]; - assert.ok(const1.dependencies.every(dependency => dependency.isSafe === false)); + assert.ok( + const1.dependencies.every(dependency => dependency.isSafe === false) + ); assert.deepEqual(const10.dependencies, [ { name: 'const9', @@ -271,7 +273,9 @@ test('safe from division deep', () => { node.toString(); const { const1, const10 } = node.contexts[1]; - assert.ok(const1.dependencies.every(dependency => dependency.isSafe === false)); + assert.ok( + const1.dependencies.every(dependency => dependency.isSafe === false) + ); assert.deepEqual(const10.dependencies, [ { name: 'const9', diff --git a/test/internal/backend/web-gl/function-node/firstAvailableTypeFromAst.js b/test/internal/backend/web-gl/function-node/firstAvailableTypeFromAst.js index 09a0a131..5c661375 100644 --- a/test/internal/backend/web-gl/function-node/firstAvailableTypeFromAst.js +++ b/test/internal/backend/web-gl/function-node/firstAvailableTypeFromAst.js @@ -159,7 +159,8 @@ test('unknown function call', () => { test('function call', () => { assert.equal( run('value()', { - lookupReturnType: (name, ast, node) => (name === 'value' ? 'Fake Type' : null), + lookupReturnType: (name, ast, node) => + name === 'value' ? 'Fake Type' : null, }), 'Fake Type' ); @@ -194,7 +195,8 @@ test('simple right expression', () => { test('function call expression', () => { assert.equal( run('otherFunction() + value', { - lookupReturnType: (name, ast, node) => (name === 'otherFunction' ? 'Fake Type' : null), + lookupReturnType: (name, ast, node) => + name === 'otherFunction' ? 'Fake Type' : null, }), 'Fake Type' ); @@ -233,15 +235,24 @@ test('Math.LOG10E', () => { }); test('Math.abs(value)', () => { - assert.equal(run('Math.abs(value)', { argumentTypes: ['Number', 'Number', 'Number'] }), 'Number'); + assert.equal( + run('Math.abs(value)', { argumentTypes: ['Number', 'Number', 'Number'] }), + 'Number' + ); }); test('Math.acos(value)', () => { - assert.equal(run('Math.acos(value)', { argumentTypes: ['Number', 'Number', 'Number'] }), 'Number'); + assert.equal( + run('Math.acos(value)', { argumentTypes: ['Number', 'Number', 'Number'] }), + 'Number' + ); }); test('Math.atan(value)', () => { - assert.equal(run('Math.atan(value)', { argumentTypes: ['Number', 'Number', 'Number'] }), 'Number'); + assert.equal( + run('Math.atan(value)', { argumentTypes: ['Number', 'Number', 'Number'] }), + 'Number' + ); }); test('Math.atan2(value, value2)', () => { @@ -254,15 +265,24 @@ test('Math.atan2(value, value2)', () => { }); test('Math.ceil(value)', () => { - assert.equal(run('Math.ceil(value)', { argumentTypes: ['Number', 'Number', 'Number'] }), 'Number'); + assert.equal( + run('Math.ceil(value)', { argumentTypes: ['Number', 'Number', 'Number'] }), + 'Number' + ); }); test('Math.cos(value)', () => { - assert.equal(run('Math.cos(value)', { argumentTypes: ['Number', 'Number', 'Number'] }), 'Number'); + assert.equal( + run('Math.cos(value)', { argumentTypes: ['Number', 'Number', 'Number'] }), + 'Number' + ); }); test('Math.exp(value)', () => { - assert.equal(run('Math.exp(value)', { argumentTypes: ['Number', 'Number', 'Number'] }), 'Number'); + assert.equal( + run('Math.exp(value)', { argumentTypes: ['Number', 'Number', 'Number'] }), + 'Number' + ); }); test('Math.floor(value)', () => { @@ -275,7 +295,10 @@ test('Math.floor(value)', () => { }); test('Math.log(value)', () => { - assert.equal(run('Math.log(value)', { argumentTypes: ['Number', 'Number', 'Number'] }), 'Number'); + assert.equal( + run('Math.log(value)', { argumentTypes: ['Number', 'Number', 'Number'] }), + 'Number' + ); }); test('Math.max(value, value2, value3)', () => { @@ -306,7 +329,10 @@ test('Math.pow(value, value2)', () => { }); test('Math.random()', () => { - assert.equal(run('Math.random()', { argumentTypes: ['Number', 'Number', 'Number'] }), 'Number'); + assert.equal( + run('Math.random()', { argumentTypes: ['Number', 'Number', 'Number'] }), + 'Number' + ); }); test('Math.round(value)', () => { @@ -319,17 +345,29 @@ test('Math.round(value)', () => { }); test('Math.sin(value)', () => { - assert.equal(run('Math.sin(value)', { argumentTypes: ['Number', 'Number', 'Number'] }), 'Number'); + assert.equal( + run('Math.sin(value)', { argumentTypes: ['Number', 'Number', 'Number'] }), + 'Number' + ); }); test('Math.sqrt(value)', () => { - assert.equal(run('Math.sqrt(value)', { argumentTypes: ['Number', 'Number', 'Number'] }), 'Number'); + assert.equal( + run('Math.sqrt(value)', { argumentTypes: ['Number', 'Number', 'Number'] }), + 'Number' + ); }); test('Math.tan(value)', () => { - assert.equal(run('Math.tan(value)', { argumentTypes: ['Number', 'Number', 'Number'] }), 'Number'); + assert.equal( + run('Math.tan(value)', { argumentTypes: ['Number', 'Number', 'Number'] }), + 'Number' + ); }); test('Math.tanh(value)', () => { - assert.equal(run('Math.tanh(value)', { argumentTypes: ['Number', 'Number', 'Number'] }), 'Number'); + assert.equal( + run('Math.tanh(value)', { argumentTypes: ['Number', 'Number', 'Number'] }), + 'Number' + ); }); diff --git a/test/internal/backend/web-gl/function-node/getVariableSignature.js b/test/internal/backend/web-gl/function-node/getVariableSignature.js index 8aac9bbb..0366db77 100644 --- a/test/internal/backend/web-gl/function-node/getVariableSignature.js +++ b/test/internal/backend/web-gl/function-node/getVariableSignature.js @@ -86,16 +86,25 @@ test('this.constants.value[][]', () => { assert.equal(run('this.constants.value[0][0]'), 'this.constants.value[][]'); }); test('this.constants.value[][][]', () => { - assert.equal(run('this.constants.value[0][0][0]'), 'this.constants.value[][][]'); + assert.equal( + run('this.constants.value[0][0][0]'), + 'this.constants.value[][][]' + ); }); test('this.constants.texture[this.thread.z][this.thread.y][this.thread.x]', () => { - assert.equal(run('this.constants.texture[this.thread.z][this.thread.y][this.thread.x]'), 'this.constants.value[][][]'); + assert.equal( + run('this.constants.texture[this.thread.z][this.thread.y][this.thread.x]'), + 'this.constants.value[][][]' + ); }); test('this.whatever.value', () => { assert.equal(run('this.whatever.value'), null); }); test('this.constants.value[][][][]', () => { - assert.equal(run('this.constants.value[0][0][0][0]'), 'this.constants.value[][][][]'); + assert.equal( + run('this.constants.value[0][0][0][0]'), + 'this.constants.value[][][][]' + ); }); test('this.constants.value.something', () => { assert.equal(run('this.constants.value.something'), null); diff --git a/test/internal/backend/web-gl/function-node/getVariableType.js b/test/internal/backend/web-gl/function-node/getVariableType.js index 61c1b1ba..fe403be0 100644 --- a/test/internal/backend/web-gl/function-node/getVariableType.js +++ b/test/internal/backend/web-gl/function-node/getVariableType.js @@ -26,7 +26,12 @@ test('Native function > detects same native argument type float, and no cast', ( } ); - assert.equal(node.toString(), 'float kernel(float user_value) {' + '\nreturn nativeFunction(user_value);' + '\n}'); + assert.equal( + node.toString(), + 'float kernel(float user_value) {' + + '\nreturn nativeFunction(user_value);' + + '\n}' + ); }); test('Native function > detects same native argument type int, and no cast', () => { @@ -52,7 +57,12 @@ test('Native function > detects same native argument type int, and no cast', () } ); - assert.equal(node.toString(), 'float kernel(int user_value) {' + '\nreturn nativeFunction(user_value);' + '\n}'); + assert.equal( + node.toString(), + 'float kernel(int user_value) {' + + '\nreturn nativeFunction(user_value);' + + '\n}' + ); }); test('Native function > detects different native argument type int from literal, and cast to it from float', () => { @@ -78,7 +88,12 @@ test('Native function > detects different native argument type int from literal, } ); - assert.equal(node.toString(), 'float kernel(float user_value) {' + '\nreturn nativeFunction(int(1.5));' + '\n}'); + assert.equal( + node.toString(), + 'float kernel(float user_value) {' + + '\nreturn nativeFunction(int(1.5));' + + '\n}' + ); }); test('Native function > detects different native argument type float from literal, and cast to it from int', () => { @@ -104,7 +119,10 @@ test('Native function > detects different native argument type float from litera } ); - assert.equal(node.toString(), 'float kernel(float user_value) {' + '\nreturn nativeFunction(1);' + '\n}'); + assert.equal( + node.toString(), + 'float kernel(float user_value) {' + '\nreturn nativeFunction(1);' + '\n}' + ); }); test('Native function > detects different native argument type int, and cast to it from float', () => { @@ -130,7 +148,12 @@ test('Native function > detects different native argument type int, and cast to } ); - assert.equal(node.toString(), 'float kernel(float user_value) {' + '\nreturn nativeFunction(int(user_value));' + '\n}'); + assert.equal( + node.toString(), + 'float kernel(float user_value) {' + + '\nreturn nativeFunction(int(user_value));' + + '\n}' + ); }); test('Native function > detects different native argument type float, and cast to it from int', () => { @@ -156,5 +179,10 @@ test('Native function > detects different native argument type float, and cast t } ); - assert.equal(node.toString(), 'float kernel(int user_value) {' + '\nreturn nativeFunction(float(user_value));' + '\n}'); + assert.equal( + node.toString(), + 'float kernel(int user_value) {' + + '\nreturn nativeFunction(float(user_value));' + + '\n}' + ); }); diff --git a/test/internal/backend/web-gl/kernel-value/dynamic-memory-optimized-number-texture.js b/test/internal/backend/web-gl/kernel-value/dynamic-memory-optimized-number-texture.js index 7a31f507..ab16008d 100644 --- a/test/internal/backend/web-gl/kernel-value/dynamic-memory-optimized-number-texture.js +++ b/test/internal/backend/web-gl/kernel-value/dynamic-memory-optimized-number-texture.js @@ -10,19 +10,20 @@ test('.updateValue() checks too large height', () => { }, validate: true, }; - const v = new webGLKernelValueMaps.unsigned.dynamic.MemoryOptimizedNumberTexture( - { size: [1, 1] }, - { - kernel: mockKernel, - name: 'test', - type: 'MemoryOptimizedNumberTexture', - origin: 'user', - tactic: 'speed', - onRequestContextHandle: () => 1, - onRequestTexture: () => null, - onRequestIndex: () => 1, - } - ); + const v = + new webGLKernelValueMaps.unsigned.dynamic.MemoryOptimizedNumberTexture( + { size: [1, 1] }, + { + kernel: mockKernel, + name: 'test', + type: 'MemoryOptimizedNumberTexture', + origin: 'user', + tactic: 'speed', + onRequestContextHandle: () => 1, + onRequestTexture: () => null, + onRequestIndex: () => 1, + } + ); assert.throws(() => { v.updateValue({ size: [1, 2] }); @@ -37,19 +38,20 @@ test('.updateValue() checks too large width', () => { validate: true, }; - const v = new webGLKernelValueMaps.unsigned.dynamic.MemoryOptimizedNumberTexture( - { size: [1, 1] }, - { - kernel: mockKernel, - name: 'test', - type: 'MemoryOptimizedNumberTexture', - origin: 'user', - tactic: 'speed', - onRequestContextHandle: () => 1, - onRequestTexture: () => null, - onRequestIndex: () => 1, - } - ); + const v = + new webGLKernelValueMaps.unsigned.dynamic.MemoryOptimizedNumberTexture( + { size: [1, 1] }, + { + kernel: mockKernel, + name: 'test', + type: 'MemoryOptimizedNumberTexture', + origin: 'user', + tactic: 'speed', + onRequestContextHandle: () => 1, + onRequestTexture: () => null, + onRequestIndex: () => 1, + } + ); assert.throws(() => { v.updateValue({ size: [2, 1], @@ -74,25 +76,29 @@ test('.updateValue() checks ok height & width', () => { pixelStorei: () => {}, texImage2D: () => {}, }; - const v = new webGLKernelValueMaps.unsigned.dynamic.MemoryOptimizedNumberTexture( - { size: [2, 2], context: mockContext }, - { - kernel: mockKernel, - name: 'test', - type: 'MemoryOptimizedNumberTexture', - origin: 'user', - tactic: 'speed', - context: mockContext, - onRequestContextHandle: () => 1, - onRequestTexture: () => null, - onRequestIndex: () => 1, - } - ); + const v = + new webGLKernelValueMaps.unsigned.dynamic.MemoryOptimizedNumberTexture( + { size: [2, 2], context: mockContext }, + { + kernel: mockKernel, + name: 'test', + type: 'MemoryOptimizedNumberTexture', + origin: 'user', + tactic: 'speed', + context: mockContext, + onRequestContextHandle: () => 1, + onRequestTexture: () => null, + onRequestIndex: () => 1, + } + ); v.updateValue({ size: [1, 1], context: mockContext, texture: {}, }); - assert.equal(v.constructor.name, 'WebGLKernelValueDynamicMemoryOptimizedNumberTexture'); + assert.equal( + v.constructor.name, + 'WebGLKernelValueDynamicMemoryOptimizedNumberTexture' + ); }); diff --git a/test/internal/backend/web-gl/kernel-value/dynamic-single-array3d-i.js b/test/internal/backend/web-gl/kernel-value/dynamic-single-array3d-i.js index 9fd8a08f..06b34bb9 100644 --- a/test/internal/backend/web-gl/kernel-value/dynamic-single-array3d-i.js +++ b/test/internal/backend/web-gl/kernel-value/dynamic-single-array3d-i.js @@ -10,16 +10,19 @@ test('.updateValue() checks too large', () => { }, validate: true, }; - const v = new webGLKernelValueMaps.single.dynamic['Array3D(2)']([[[[1, 2]]]], { - kernel: mockKernel, - name: 'test', - type: 'Array3D(2)', - origin: 'user', - tactic: 'speed', - onRequestContextHandle: () => 1, - onRequestTexture: () => null, - onRequestIndex: () => 1, - }); + const v = new webGLKernelValueMaps.single.dynamic['Array3D(2)']( + [[[[1, 2]]]], + { + kernel: mockKernel, + name: 'test', + type: 'Array3D(2)', + origin: 'user', + tactic: 'speed', + onRequestContextHandle: () => 1, + onRequestTexture: () => null, + onRequestIndex: () => 1, + } + ); assert.throws(() => { v.updateValue([ @@ -52,17 +55,20 @@ test('.updateValue() checks ok', () => { pixelStorei: () => {}, texImage2D: () => {}, }; - const v = new webGLKernelValueMaps.single.dynamic['Array3D(2)']([[[[1, 2]]]], { - kernel: mockKernel, - name: 'test', - type: 'Array3D(2)', - origin: 'user', - tactic: 'speed', - context: mockContext, - onRequestContextHandle: () => 1, - onRequestTexture: () => null, - onRequestIndex: () => 1, - }); + const v = new webGLKernelValueMaps.single.dynamic['Array3D(2)']( + [[[[1, 2]]]], + { + kernel: mockKernel, + name: 'test', + type: 'Array3D(2)', + origin: 'user', + tactic: 'speed', + context: mockContext, + onRequestContextHandle: () => 1, + onRequestTexture: () => null, + onRequestIndex: () => 1, + } + ); v.updateValue([[[[2, 1]]]]); assert.equal(v.constructor.name, 'WebGLKernelValueDynamicSingleArray3DI'); diff --git a/test/internal/backend/web-gl/kernel-value/memory-optimized-number-texture.js b/test/internal/backend/web-gl/kernel-value/memory-optimized-number-texture.js index 116967b2..4513db04 100644 --- a/test/internal/backend/web-gl/kernel-value/memory-optimized-number-texture.js +++ b/test/internal/backend/web-gl/kernel-value/memory-optimized-number-texture.js @@ -69,21 +69,25 @@ test('.constructor() checks ok height & width', () => { pixelStorei: () => {}, texImage2D: () => {}, }; - const v = new webGLKernelValueMaps.unsigned.static.MemoryOptimizedNumberTexture( - { size: [2, 2], context: mockContext }, - { - kernel: mockKernel, - name: 'test', - type: 'MemoryOptimizedNumberTexture', - origin: 'user', - tactic: 'speed', - context: mockContext, - onRequestContextHandle: () => 1, - onRequestTexture: () => null, - onRequestIndex: () => 1, - } + const v = + new webGLKernelValueMaps.unsigned.static.MemoryOptimizedNumberTexture( + { size: [2, 2], context: mockContext }, + { + kernel: mockKernel, + name: 'test', + type: 'MemoryOptimizedNumberTexture', + origin: 'user', + tactic: 'speed', + context: mockContext, + onRequestContextHandle: () => 1, + onRequestTexture: () => null, + onRequestIndex: () => 1, + } + ); + assert.equal( + v.constructor.name, + 'WebGLKernelValueMemoryOptimizedNumberTexture' ); - assert.equal(v.constructor.name, 'WebGLKernelValueMemoryOptimizedNumberTexture'); }); test('.updateValue() should set uploadValue when a pipeline kernel has no texture', () => { @@ -104,20 +108,21 @@ test('.updateValue() should set uploadValue when a pipeline kernel has no textur pixelStorei: () => {}, texImage2D: () => {}, }; - const v = new webGLKernelValueMaps.unsigned.static.MemoryOptimizedNumberTexture( - { size: [2, 2], context: mockContext }, - { - kernel: mockKernel, - name: 'test', - type: 'MemoryOptimizedNumberTexture', - origin: 'user', - tactic: 'speed', - context: mockContext, - onRequestContextHandle: () => 1, - onRequestTexture: () => null, - onRequestIndex: () => 1, - } - ); + const v = + new webGLKernelValueMaps.unsigned.static.MemoryOptimizedNumberTexture( + { size: [2, 2], context: mockContext }, + { + kernel: mockKernel, + name: 'test', + type: 'MemoryOptimizedNumberTexture', + origin: 'user', + tactic: 'speed', + context: mockContext, + onRequestContextHandle: () => 1, + onRequestTexture: () => null, + onRequestIndex: () => 1, + } + ); const newMockTexture = {}; v.updateValue({ diff --git a/test/internal/backend/web-gl/kernel/index.js b/test/internal/backend/web-gl/kernel/index.js index 61486ba3..85613cfd 100644 --- a/test/internal/backend/web-gl/kernel/index.js +++ b/test/internal/backend/web-gl/kernel/index.js @@ -4,25 +4,28 @@ const { WebGLKernel } = require('../../../../../src'); describe('internal: WebGLKernel'); -(typeof global !== 'undefined' ? test : skip)('.setupFeatureChecks() if context is available, but .getExtension() is falsey', () => { - const mockContext = { - getExtension: null, // this is important - }; - const mockElement = { - getContext: () => mockContext, - }; - const mockDocument = { - createElement: () => { - return mockElement; - }, - }; - global.document = mockDocument; +(typeof global !== 'undefined' ? test : skip)( + '.setupFeatureChecks() if context is available, but .getExtension() is falsey', + () => { + const mockContext = { + getExtension: null, // this is important + }; + const mockElement = { + getContext: () => mockContext, + }; + const mockDocument = { + createElement: () => { + return mockElement; + }, + }; + global.document = mockDocument; - WebGLKernel.setupFeatureChecks(); - assert.ok(true); + WebGLKernel.setupFeatureChecks(); + assert.ok(true); - delete global.document; -}); + delete global.document; + } +); test('.validateSettings() checks output texture size - too large', () => { const mockContext = { diff --git a/test/internal/backend/web-gl/kernel/setupArguments.js b/test/internal/backend/web-gl/kernel/setupArguments.js index f11c9c07..7f280872 100644 --- a/test/internal/backend/web-gl/kernel/setupArguments.js +++ b/test/internal/backend/web-gl/kernel/setupArguments.js @@ -17,7 +17,17 @@ const gl = { UNPACK_FLIP_Y_WEBGL: 'UNPACK_FLIP_Y_WEBGL', }; function setupArgumentsTestSuite(testSuiteSettings) { - const { gpuSettings, argument, expectedPixels, expectedBitRatio, expectedDim, expectedSize, expectedType, expectedArgumentTextureCount, expectedPixelStorei } = testSuiteSettings; + const { + gpuSettings, + argument, + expectedPixels, + expectedBitRatio, + expectedDim, + expectedSize, + expectedType, + expectedArgumentTextureCount, + expectedPixelStorei, + } = testSuiteSettings; let texImage2DCalled = false; let activeTextureCalled = false; let bindTextureCalled = false; @@ -99,7 +109,17 @@ function setupArgumentsTestSuite(testSuiteSettings) { assert.equal(value, 0); uniform1iCalled = true; }, - texImage2D: (target, level, internalFormat, width, height, border, format, type, pixels) => { + texImage2D: ( + target, + level, + internalFormat, + width, + height, + border, + format, + type, + pixels + ) => { assert.equal(target, gl.TEXTURE_2D); assert.equal(level, 0); assert.equal(internalFormat, gl.RGBA); @@ -119,7 +139,10 @@ function setupArgumentsTestSuite(testSuiteSettings) { const settings = { context: mockContext, }; - const kernel = new WebGLKernel(source, Object.assign({}, settings, gpuSettings)); + const kernel = new WebGLKernel( + source, + Object.assign({}, settings, gpuSettings) + ); kernel.constructor = { lookupKernelValueType: WebGLKernel.lookupKernelValueType, features: { @@ -155,13 +178,15 @@ test('Array with unsigned precision 5 length', () => { }, argument: [ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, + 1, + 2, 3, 4, 5, ], expectedBitRatio: 4, expectedPixels: new Uint8Array( new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, 0, 0, + 1, + 2, 3, 4, 5, 0, 0, 0, ]).buffer ), expectedDim: new Int32Array([5, 1, 1]), @@ -179,13 +204,15 @@ test('Float32Array with unsigned precision 5 length', () => { }, argument: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, + 1, + 2, 3, 4, 5, ]), expectedBitRatio: 4, expectedPixels: new Uint8Array( new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, 0, 0, + 1, + 2, 3, 4, 5, 0, 0, 0, ]).buffer ), expectedDim: new Int32Array([5, 1, 1]), @@ -203,13 +230,15 @@ test('Uint16Array with unsigned precision 5 length', () => { }, argument: new Uint16Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, + 1, + 2, 3, 4, 5, ]), expectedBitRatio: 2, expectedPixels: new Uint8Array( new Uint16Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, 0, 0, + 1, + 2, 3, 4, 5, 0, 0, 0, ]).buffer ), expectedDim: new Int32Array([5, 1, 1]), @@ -229,7 +258,8 @@ test('Uint8Array with unsigned precision 5 length', () => { expectedBitRatio: 1, expectedPixels: new Uint8Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, 0, 0, + 1, + 2, 3, 4, 5, 0, 0, 0, ]), expectedDim: new Int32Array([5, 1, 1]), expectedSize: new Int32Array([1, 2]), // 1 * 2 * 4 = 8 @@ -247,12 +277,14 @@ test('Array with single precision', () => { }, argument: [ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, + 1, + 2, 3, 4, 5, ], expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, 0, 0, + 1, + 2, 3, 4, 5, 0, 0, 0, ]), expectedDim: new Int32Array([5, 1, 1]), expectedSize: new Int32Array([1, 2]), @@ -271,12 +303,14 @@ test('Float32Array with single precision', () => { }, argument: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, + 1, + 2, 3, 4, 5, ]), expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, 0, 0, + 1, + 2, 3, 4, 5, 0, 0, 0, ]), expectedDim: new Int32Array([5, 1, 1]), expectedSize: new Int32Array([1, 2]), @@ -295,13 +329,15 @@ test('Uint16Array with single precision', () => { }, argument: new Uint16Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, + 1, + 2, 3, 4, 5, ]), // upconverted from 2 expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, 0, 0, + 1, + 2, 3, 4, 5, 0, 0, 0, ]), expectedDim: new Int32Array([5, 1, 1]), expectedSize: new Int32Array([1, 2]), @@ -318,13 +354,15 @@ test('Uint8Array with single precision', () => { }, argument: new Uint8Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, + 1, + 2, 3, 4, 5, ]), // upconverted from 1 expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, 0, 0, + 1, + 2, 3, 4, 5, 0, 0, 0, ]), expectedDim: new Int32Array([5, 1, 1]), expectedSize: new Int32Array([1, 2]), @@ -344,7 +382,9 @@ test('Array with unsigned precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 1 per RGBA, so only 1 of the 4 channels is used // NOTE: 6x6 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ], expectedBitRatio: 4, expectedPixels: new Uint8Array( @@ -352,7 +392,9 @@ test('Array with unsigned precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 1 per RGBA, so only 1 of the 4 channels is used // NOTE: 6x6 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]).buffer ), expectedDim: new Int32Array([33, 1, 1]), @@ -373,7 +415,9 @@ test('Float32Array with unsigned precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 1 per RGBA, so only 1 of the 4 channels is used // NOTE: 6x6 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ]), expectedBitRatio: 4, expectedPixels: new Uint8Array( @@ -381,7 +425,9 @@ test('Float32Array with unsigned precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 1 per RGBA, so only 1 of the 4 channels is used // NOTE: 6x6 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]).buffer ), expectedDim: new Int32Array([33, 1, 1]), @@ -402,7 +448,9 @@ test('Uint16Array with unsigned precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 2 per RGBA, so only 2 of the 4 channels is used // NOTE: 4x5 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ]), expectedBitRatio: 2, expectedPixels: new Uint8Array( @@ -410,7 +458,9 @@ test('Uint16Array with unsigned precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 2 per RGBA, so only 2 of the 4 channels is used // NOTE: 4x5 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, 0, 0, 0, 0, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, 0, 0, 0, 0, ]).buffer ), expectedDim: new Int32Array([33, 1, 1]), @@ -431,7 +481,9 @@ test('Uint8Array with unsigned precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so only 2 of the 4 channels is used // NOTE: 3x3 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ]), expectedBitRatio: 1, expectedPixels: new Uint8Array( @@ -439,7 +491,9 @@ test('Uint8Array with unsigned precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so only 2 of the 4 channels is used // NOTE: 3x3 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]).buffer ), expectedDim: new Int32Array([33, 1, 1]), @@ -460,14 +514,18 @@ test('Array with single precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ], expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]), expectedDim: new Int32Array([33, 1, 1]), expectedSize: new Int32Array([3, 3]), // 3 * 3 = 9 * 4 = 34 @@ -487,14 +545,18 @@ test('Float32Array with single precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ]), expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]), expectedDim: new Int32Array([33, 1, 1]), expectedSize: new Int32Array([3, 3]), // 3 * 3 = 9 * 4 = 36 @@ -514,7 +576,9 @@ test('Uint16Array with single precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ]), // upconverted from 2 expectedBitRatio: 4, @@ -522,7 +586,9 @@ test('Uint16Array with single precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]), expectedDim: new Int32Array([33, 1, 1]), expectedSize: new Int32Array([3, 3]), // 3 * 3 = 9 * 4 = 36 @@ -542,7 +608,9 @@ test('Uint8Array with single precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ]), // upconverted from 1 expectedBitRatio: 4, @@ -550,7 +618,9 @@ test('Uint8Array with single precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]), expectedDim: new Int32Array([33, 1, 1]), expectedSize: new Int32Array([3, 3]), // 3 * 3 = 9 * 4 = 36 @@ -571,7 +641,8 @@ test('Input(Array) with unsigned precision 5 length', () => { argument: input( [ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, + 1, + 2, 3, 4, 5, 0, ], [2, 3] ), @@ -579,7 +650,8 @@ test('Input(Array) with unsigned precision 5 length', () => { expectedPixels: new Uint8Array( new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, 0, 0, + 1, + 2, 3, 4, 5, 0, 0, 0, ]).buffer ), expectedDim: new Int32Array([2, 3, 1]), @@ -598,7 +670,8 @@ test('Input(Float32Array) with unsigned precision 5 length', () => { argument: input( new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, + 1, + 2, 3, 4, 5, ]), [5] ), @@ -606,7 +679,8 @@ test('Input(Float32Array) with unsigned precision 5 length', () => { expectedPixels: new Uint8Array( new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, 0, 0, + 1, + 2, 3, 4, 5, 0, 0, 0, ]).buffer ), expectedDim: new Int32Array([5, 1, 1]), @@ -625,7 +699,8 @@ test('Input(Uint16Array) with unsigned precision 5 length', () => { argument: input( new Uint16Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, + 1, + 2, 3, 4, 5, 0, ]), [2, 3] ), @@ -633,7 +708,8 @@ test('Input(Uint16Array) with unsigned precision 5 length', () => { expectedPixels: new Uint8Array( new Uint16Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, 0, 0, + 1, + 2, 3, 4, 5, 0, 0, 0, ]).buffer ), expectedDim: new Int32Array([2, 3, 1]), @@ -653,7 +729,8 @@ test('Input(Uint8Array) with unsigned precision 5 length', () => { expectedBitRatio: 1, expectedPixels: new Uint8Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, 0, 0, + 1, + 2, 3, 4, 5, 0, 0, 0, ]), expectedDim: new Int32Array([2, 3, 1]), expectedSize: new Int32Array([1, 2]), // 1 * 2 * 4 = 8 @@ -672,14 +749,16 @@ test('Input(Array) with single precision', () => { argument: input( [ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, + 1, + 2, 3, 4, 5, 0, ], [2, 3] ), expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, 0, 0, + 1, + 2, 3, 4, 5, 0, 0, 0, ]), expectedDim: new Int32Array([2, 3, 1]), expectedSize: new Int32Array([1, 2]), @@ -699,14 +778,16 @@ test('Input(Float32Array) with single precision', () => { argument: input( new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, + 1, + 2, 3, 4, 5, 0, ]), [2, 3] ), expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, 0, 0, + 1, + 2, 3, 4, 5, 0, 0, 0, ]), expectedDim: new Int32Array([2, 3, 1]), expectedSize: new Int32Array([1, 2]), @@ -726,7 +807,8 @@ test('Input(Uint16Array) with single precision', () => { argument: input( new Uint16Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, + 1, + 2, 3, 4, 5, 0, ]), [2, 3] ), @@ -734,7 +816,8 @@ test('Input(Uint16Array) with single precision', () => { expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, 0, 0, + 1, + 2, 3, 4, 5, 0, 0, 0, ]), expectedDim: new Int32Array([2, 3, 1]), expectedSize: new Int32Array([1, 2]), @@ -752,7 +835,8 @@ test('Input(Uint8Array) with single precision', () => { argument: input( new Uint8Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, + 1, + 2, 3, 4, 5, 0, ]), [2, 3] ), @@ -760,7 +844,8 @@ test('Input(Uint8Array) with single precision', () => { expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, 0, 0, + 1, + 2, 3, 4, 5, 0, 0, 0, ]), expectedDim: new Int32Array([2, 3, 1]), expectedSize: new Int32Array([1, 2]), @@ -781,7 +866,9 @@ test('Input(Array) with unsigned precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 1 per RGBA, so only 1 of the 4 channels is used // NOTE: 6x6 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ], [33] ), @@ -791,7 +878,9 @@ test('Input(Array) with unsigned precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 1 per RGBA, so only 1 of the 4 channels is used // NOTE: 6x6 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]).buffer ), expectedDim: new Int32Array([33, 1, 1]), @@ -813,7 +902,9 @@ test('Input(Float32Array) with unsigned precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 1 per RGBA, so only 1 of the 4 channels is used // NOTE: 6x6 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ]), [33] ), @@ -823,7 +914,9 @@ test('Input(Float32Array) with unsigned precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 1 per RGBA, so only 1 of the 4 channels is used // NOTE: 6x6 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]).buffer ), expectedDim: new Int32Array([33, 1, 1]), @@ -845,7 +938,9 @@ test('Input(Uint16Array) with unsigned precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 2 per RGBA, so only 2 of the 4 channels is used // NOTE: 4x5 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ]), [33] ), @@ -855,7 +950,9 @@ test('Input(Uint16Array) with unsigned precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 2 per RGBA, so only 2 of the 4 channels is used // NOTE: 4x5 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, 0, 0, 0, 0, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, 0, 0, 0, 0, ]).buffer ), expectedDim: new Int32Array([33, 1, 1]), @@ -877,7 +974,9 @@ test('Input(Uint8Array) with unsigned precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so only 2 of the 4 channels is used // NOTE: 3x3 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ]), [33] ), @@ -887,7 +986,9 @@ test('Input(Uint8Array) with unsigned precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so only 2 of the 4 channels is used // NOTE: 3x3 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]).buffer ), expectedDim: new Int32Array([33, 1, 1]), @@ -909,7 +1010,9 @@ test('Input(Array) with single precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ], [33] ), @@ -918,7 +1021,9 @@ test('Input(Array) with single precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]), expectedDim: new Int32Array([33, 1, 1]), expectedSize: new Int32Array([3, 3]), // 3 * 3 = 9 * 4 = 34 @@ -939,7 +1044,9 @@ test('Input(Float32Array) with single precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ]), [33] ), @@ -948,7 +1055,9 @@ test('Input(Float32Array) with single precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]), expectedDim: new Int32Array([33, 1, 1]), expectedSize: new Int32Array([3, 3]), // 3 * 3 = 9 * 4 = 34 @@ -969,7 +1078,9 @@ test('Input(Uint16Array) with single precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ]), [33] ), @@ -979,7 +1090,9 @@ test('Input(Uint16Array) with single precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]), expectedDim: new Int32Array([33, 1, 1]), expectedSize: new Int32Array([3, 3]), // 3 * 3 = 9 * 4 = 36 @@ -1000,7 +1113,9 @@ test('Input(Uint8Array) with single precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA (8 bit, but upconverted to float32), so only 4 of the 4 channels is used // NOTE: 3x3 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ]), [33] ), @@ -1010,7 +1125,9 @@ test('Input(Uint8Array) with single precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA (8 bit, but upconverted to float32), so only 4 of the 4 channels is used // NOTE: 3x3 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]), expectedDim: new Int32Array([33, 1, 1]), expectedSize: new Int32Array([3, 3]), // 3 * 3 = 9 * 4 = 36 diff --git a/test/internal/backend/web-gl/kernel/setupConstants.js b/test/internal/backend/web-gl/kernel/setupConstants.js index 3e0e4f19..8aea5f61 100644 --- a/test/internal/backend/web-gl/kernel/setupConstants.js +++ b/test/internal/backend/web-gl/kernel/setupConstants.js @@ -17,7 +17,17 @@ const gl = { UNPACK_FLIP_Y_WEBGL: 'UNPACK_FLIP_Y_WEBGL', }; function setupConstantsTestSuite(testSuiteSettings) { - const { gpuSettings, constant, expectedPixels, expectedBitRatio, expectedDim, expectedSize, expectedType, expectedConstantTextureCount, expectedPixelStorei } = testSuiteSettings; + const { + gpuSettings, + constant, + expectedPixels, + expectedBitRatio, + expectedDim, + expectedSize, + expectedType, + expectedConstantTextureCount, + expectedPixelStorei, + } = testSuiteSettings; let texImage2DCalled = false; let activeTextureCalled = false; let bindTextureCalled = false; @@ -99,7 +109,17 @@ function setupConstantsTestSuite(testSuiteSettings) { assert.equal(value, 0); uniform1iCalled = true; }, - texImage2D: (target, level, internalFormat, width, height, border, format, type, pixels) => { + texImage2D: ( + target, + level, + internalFormat, + width, + height, + border, + format, + type, + pixels + ) => { assert.equal(target, gl.TEXTURE_2D); assert.equal(level, 0); assert.equal(internalFormat, gl.RGBA); @@ -119,7 +139,10 @@ function setupConstantsTestSuite(testSuiteSettings) { const settings = { context: mockContext, }; - const kernel = new WebGLKernel(source, Object.assign({ constants: { v: constant } }, settings, gpuSettings)); + const kernel = new WebGLKernel( + source, + Object.assign({ constants: { v: constant } }, settings, gpuSettings) + ); kernel.constructor = { lookupKernelValueType: WebGLKernel.lookupKernelValueType, features: { @@ -154,13 +177,15 @@ test('Array with unsigned precision 5 length', () => { }, constant: [ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, + 1, + 2, 3, 4, 5, ], expectedBitRatio: 4, expectedPixels: new Uint8Array( new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, 0, 0, + 1, + 2, 3, 4, 5, 0, 0, 0, ]).buffer ), expectedDim: new Int32Array([5, 1, 1]), @@ -178,13 +203,15 @@ test('Float32Array with unsigned precision 5 length', () => { }, constant: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, + 1, + 2, 3, 4, 5, ]), expectedBitRatio: 4, expectedPixels: new Uint8Array( new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, 0, 0, + 1, + 2, 3, 4, 5, 0, 0, 0, ]).buffer ), expectedDim: new Int32Array([5, 1, 1]), @@ -202,13 +229,15 @@ test('Uint16Array with unsigned precision 5 length', () => { }, constant: new Uint16Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, + 1, + 2, 3, 4, 5, ]), expectedBitRatio: 2, expectedPixels: new Uint8Array( new Uint16Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, 0, 0, + 1, + 2, 3, 4, 5, 0, 0, 0, ]).buffer ), expectedDim: new Int32Array([5, 1, 1]), @@ -228,7 +257,8 @@ test('Uint8Array with unsigned precision 5 length', () => { expectedBitRatio: 1, expectedPixels: new Uint8Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, 0, 0, + 1, + 2, 3, 4, 5, 0, 0, 0, ]), expectedDim: new Int32Array([5, 1, 1]), expectedSize: new Int32Array([1, 2]), // 1 * 2 * 4 = 8 @@ -246,12 +276,14 @@ test('Array with single precision', () => { }, constant: [ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, + 1, + 2, 3, 4, 5, ], expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, 0, 0, + 1, + 2, 3, 4, 5, 0, 0, 0, ]), expectedDim: new Int32Array([5, 1, 1]), expectedSize: new Int32Array([1, 2]), @@ -270,12 +302,14 @@ test('Float32Array with single precision', () => { }, constant: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, + 1, + 2, 3, 4, 5, ]), expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, 0, 0, + 1, + 2, 3, 4, 5, 0, 0, 0, ]), expectedDim: new Int32Array([5, 1, 1]), expectedSize: new Int32Array([1, 2]), @@ -294,13 +328,15 @@ test('Uint16Array with single precision', () => { }, constant: new Uint16Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, + 1, + 2, 3, 4, 5, ]), // upconverted from 2 expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, 0, 0, + 1, + 2, 3, 4, 5, 0, 0, 0, ]), expectedDim: new Int32Array([5, 1, 1]), expectedSize: new Int32Array([1, 2]), @@ -317,13 +353,15 @@ test('Uint8Array with single precision', () => { }, constant: new Uint8Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, + 1, + 2, 3, 4, 5, ]), // upconverted from 1 expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, 0, 0, + 1, + 2, 3, 4, 5, 0, 0, 0, ]), expectedDim: new Int32Array([5, 1, 1]), expectedSize: new Int32Array([1, 2]), @@ -343,7 +381,9 @@ test('Array with unsigned precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 1 per RGBA, so only 1 of the 4 channels is used // NOTE: 6x6 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ], expectedBitRatio: 4, expectedPixels: new Uint8Array( @@ -351,7 +391,9 @@ test('Array with unsigned precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 1 per RGBA, so only 1 of the 4 channels is used // NOTE: 6x6 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]).buffer ), expectedDim: new Int32Array([33, 1, 1]), @@ -372,7 +414,9 @@ test('Float32Array with unsigned precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 1 per RGBA, so only 1 of the 4 channels is used // NOTE: 6x6 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ]), expectedBitRatio: 4, expectedPixels: new Uint8Array( @@ -380,7 +424,9 @@ test('Float32Array with unsigned precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 1 per RGBA, so only 1 of the 4 channels is used // NOTE: 6x6 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]).buffer ), expectedDim: new Int32Array([33, 1, 1]), @@ -401,7 +447,9 @@ test('Uint16Array with unsigned precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 2 per RGBA, so only 2 of the 4 channels is used // NOTE: 4x5 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ]), expectedBitRatio: 2, expectedPixels: new Uint8Array( @@ -409,7 +457,9 @@ test('Uint16Array with unsigned precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 2 per RGBA, so only 2 of the 4 channels is used // NOTE: 4x5 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, 0, 0, 0, 0, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, 0, 0, 0, 0, ]).buffer ), expectedDim: new Int32Array([33, 1, 1]), @@ -430,7 +480,9 @@ test('Uint8Array with unsigned precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so only 2 of the 4 channels is used // NOTE: 3x3 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ]), expectedBitRatio: 1, expectedPixels: new Uint8Array( @@ -438,7 +490,9 @@ test('Uint8Array with unsigned precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so only 2 of the 4 channels is used // NOTE: 3x3 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]).buffer ), expectedDim: new Int32Array([33, 1, 1]), @@ -459,14 +513,18 @@ test('Array with single precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ], expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]), expectedDim: new Int32Array([33, 1, 1]), expectedSize: new Int32Array([3, 3]), // 3 * 3 = 9 * 4 = 34 @@ -486,14 +544,18 @@ test('Float32Array with single precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ]), expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]), expectedDim: new Int32Array([33, 1, 1]), expectedSize: new Int32Array([3, 3]), // 3 * 3 = 9 * 4 = 34 @@ -513,7 +575,9 @@ test('Uint16Array with single precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ]), // upconverted from 2 expectedBitRatio: 4, @@ -521,7 +585,9 @@ test('Uint16Array with single precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]), expectedDim: new Int32Array([33, 1, 1]), expectedSize: new Int32Array([3, 3]), // 3 * 3 = 9 * 4 = 36 @@ -541,7 +607,9 @@ test('Uint8Array with single precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ]), // upconverted from 1 expectedBitRatio: 4, @@ -549,7 +617,9 @@ test('Uint8Array with single precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]), expectedDim: new Int32Array([33, 1, 1]), expectedSize: new Int32Array([3, 3]), // 3 * 3 = 9 * 4 = 36 @@ -570,7 +640,8 @@ test('Input(Array) with unsigned precision 5 length', () => { constant: input( [ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, + 1, + 2, 3, 4, 5, 0, ], [2, 3] ), @@ -578,7 +649,8 @@ test('Input(Array) with unsigned precision 5 length', () => { expectedPixels: new Uint8Array( new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, 0, 0, + 1, + 2, 3, 4, 5, 0, 0, 0, ]).buffer ), expectedDim: new Int32Array([2, 3, 1]), @@ -597,7 +669,8 @@ test('Input(Float32Array) with unsigned precision 5 length', () => { constant: input( new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, + 1, + 2, 3, 4, 5, ]), [5] ), @@ -605,7 +678,8 @@ test('Input(Float32Array) with unsigned precision 5 length', () => { expectedPixels: new Uint8Array( new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, 0, 0, + 1, + 2, 3, 4, 5, 0, 0, 0, ]).buffer ), expectedDim: new Int32Array([5, 1, 1]), @@ -624,7 +698,8 @@ test('Input(Uint16Array) with unsigned precision 5 length', () => { constant: input( new Uint16Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, + 1, + 2, 3, 4, 5, 0, ]), [2, 3] ), @@ -632,7 +707,8 @@ test('Input(Uint16Array) with unsigned precision 5 length', () => { expectedPixels: new Uint8Array( new Uint16Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, 0, 0, + 1, + 2, 3, 4, 5, 0, 0, 0, ]).buffer ), expectedDim: new Int32Array([2, 3, 1]), @@ -652,7 +728,8 @@ test('Input(Uint8Array) with unsigned precision 5 length', () => { expectedBitRatio: 1, expectedPixels: new Uint8Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, 0, 0, + 1, + 2, 3, 4, 5, 0, 0, 0, ]), expectedDim: new Int32Array([2, 3, 1]), expectedSize: new Int32Array([1, 2]), // 1 * 2 * 4 = 8 @@ -671,14 +748,16 @@ test('Input(Array) with single precision', () => { constant: input( [ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, + 1, + 2, 3, 4, 5, 0, ], [2, 3] ), expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, 0, 0, + 1, + 2, 3, 4, 5, 0, 0, 0, ]), expectedDim: new Int32Array([2, 3, 1]), expectedSize: new Int32Array([1, 2]), @@ -698,14 +777,16 @@ test('Input(Float32Array) with single precision', () => { constant: input( new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, + 1, + 2, 3, 4, 5, 0, ]), [2, 3] ), expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, 0, 0, + 1, + 2, 3, 4, 5, 0, 0, 0, ]), expectedDim: new Int32Array([2, 3, 1]), expectedSize: new Int32Array([1, 2]), @@ -725,7 +806,8 @@ test('Input(Uint16Array) with single precision', () => { constant: input( new Uint16Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, + 1, + 2, 3, 4, 5, 0, ]), [2, 3] ), @@ -733,7 +815,8 @@ test('Input(Uint16Array) with single precision', () => { expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, 0, 0, + 1, + 2, 3, 4, 5, 0, 0, 0, ]), expectedDim: new Int32Array([2, 3, 1]), expectedSize: new Int32Array([1, 2]), @@ -751,7 +834,8 @@ test('Input(Uint8Array) with single precision', () => { constant: input( new Uint8Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, + 1, + 2, 3, 4, 5, 0, ]), [2, 3] ), @@ -759,7 +843,8 @@ test('Input(Uint8Array) with single precision', () => { expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, 0, 0, + 1, + 2, 3, 4, 5, 0, 0, 0, ]), expectedDim: new Int32Array([2, 3, 1]), expectedSize: new Int32Array([1, 2]), @@ -780,7 +865,9 @@ test('Input(Array) with unsigned precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 1 per RGBA, so only 1 of the 4 channels is used // NOTE: 6x6 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ], [33] ), @@ -790,7 +877,9 @@ test('Input(Array) with unsigned precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 1 per RGBA, so only 1 of the 4 channels is used // NOTE: 6x6 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]).buffer ), expectedDim: new Int32Array([33, 1, 1]), @@ -812,7 +901,9 @@ test('Input(Float32Array) with unsigned precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 1 per RGBA, so only 1 of the 4 channels is used // NOTE: 6x6 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ]), [33] ), @@ -822,7 +913,9 @@ test('Input(Float32Array) with unsigned precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 1 per RGBA, so only 1 of the 4 channels is used // NOTE: 6x6 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]).buffer ), expectedDim: new Int32Array([33, 1, 1]), @@ -844,7 +937,9 @@ test('Input(Uint16Array) with unsigned precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 2 per RGBA, so only 2 of the 4 channels is used // NOTE: 4x5 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ]), [33] ), @@ -854,7 +949,9 @@ test('Input(Uint16Array) with unsigned precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 2 per RGBA, so only 2 of the 4 channels is used // NOTE: 4x5 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, 0, 0, 0, 0, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, 0, 0, 0, 0, ]).buffer ), expectedDim: new Int32Array([33, 1, 1]), @@ -876,7 +973,9 @@ test('Input(Uint8Array) with unsigned precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so only 2 of the 4 channels is used // NOTE: 3x3 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ]), [33] ), @@ -886,7 +985,9 @@ test('Input(Uint8Array) with unsigned precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so only 2 of the 4 channels is used // NOTE: 3x3 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]).buffer ), expectedDim: new Int32Array([33, 1, 1]), @@ -908,7 +1009,9 @@ test('Input(Array) with single precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ], [33] ), @@ -917,7 +1020,9 @@ test('Input(Array) with single precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]), expectedDim: new Int32Array([33, 1, 1]), expectedSize: new Int32Array([3, 3]), // 3 * 3 = 9 * 4 = 34 @@ -938,7 +1043,9 @@ test('Input(Float32Array) with single precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ]), [33] ), @@ -947,7 +1054,9 @@ test('Input(Float32Array) with single precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]), expectedDim: new Int32Array([33, 1, 1]), expectedSize: new Int32Array([3, 3]), // 3 * 3 = 9 * 4 = 34 @@ -968,7 +1077,9 @@ test('Input(Uint16Array) with single precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ]), [33] ), @@ -978,7 +1089,9 @@ test('Input(Uint16Array) with single precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]), expectedDim: new Int32Array([33, 1, 1]), expectedSize: new Int32Array([3, 3]), // 3 * 3 = 9 * 4 = 36 @@ -999,7 +1112,9 @@ test('Input(Uint8Array) with single precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA (8 bit, but upconverted to float32), so only 4 of the 4 channels is used // NOTE: 3x3 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ]), [33] ), @@ -1009,7 +1124,9 @@ test('Input(Uint8Array) with single precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA (8 bit, but upconverted to float32), so only 4 of the 4 channels is used // NOTE: 3x3 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]), expectedDim: new Int32Array([33, 1, 1]), expectedSize: new Int32Array([3, 3]), // 3 * 3 = 9 * 4 = 36 diff --git a/test/internal/backend/web-gl2/kernel-value/dynamic-html-image-array.js b/test/internal/backend/web-gl2/kernel-value/dynamic-html-image-array.js index 02f511bc..1c72a4eb 100644 --- a/test/internal/backend/web-gl2/kernel-value/dynamic-html-image-array.js +++ b/test/internal/backend/web-gl2/kernel-value/dynamic-html-image-array.js @@ -10,16 +10,19 @@ test('.updateValue() checks too large height', () => { }, validate: true, }; - const v = new webGL2KernelValueMaps.unsigned.dynamic.HTMLImageArray([{ width: 1, height: 1 }], { - kernel: mockKernel, - name: 'test', - type: 'HTMLImage', - origin: 'user', - tactic: 'speed', - onRequestContextHandle: () => 1, - onRequestTexture: () => null, - onRequestIndex: () => 1, - }); + const v = new webGL2KernelValueMaps.unsigned.dynamic.HTMLImageArray( + [{ width: 1, height: 1 }], + { + kernel: mockKernel, + name: 'test', + type: 'HTMLImage', + origin: 'user', + tactic: 'speed', + onRequestContextHandle: () => 1, + onRequestTexture: () => null, + onRequestIndex: () => 1, + } + ); assert.throws(() => { v.updateValue([{ width: 1, height: 2 }]); @@ -34,16 +37,19 @@ test('.updateValue() checks too large width', () => { validate: true, }; - const v = new webGL2KernelValueMaps.unsigned.dynamic.HTMLImageArray([{ width: 1, height: 1 }], { - kernel: mockKernel, - name: 'test', - type: 'HTMLImageArray', - origin: 'user', - tactic: 'speed', - onRequestContextHandle: () => 1, - onRequestTexture: () => null, - onRequestIndex: () => 1, - }); + const v = new webGL2KernelValueMaps.unsigned.dynamic.HTMLImageArray( + [{ width: 1, height: 1 }], + { + kernel: mockKernel, + name: 'test', + type: 'HTMLImageArray', + origin: 'user', + tactic: 'speed', + onRequestContextHandle: () => 1, + onRequestTexture: () => null, + onRequestIndex: () => 1, + } + ); assert.throws(() => { v.updateValue([ { @@ -72,17 +78,20 @@ test('.updateValue() checks ok height & width', () => { texImage3D: () => {}, texSubImage3D: () => {}, }; - const v = new webGL2KernelValueMaps.unsigned.dynamic.HTMLImageArray([{ width: 2, height: 2 }], { - kernel: mockKernel, - name: 'test', - type: 'HTMLImageArray', - origin: 'user', - tactic: 'speed', - context: mockContext, - onRequestContextHandle: () => 1, - onRequestTexture: () => null, - onRequestIndex: () => 1, - }); + const v = new webGL2KernelValueMaps.unsigned.dynamic.HTMLImageArray( + [{ width: 2, height: 2 }], + { + kernel: mockKernel, + name: 'test', + type: 'HTMLImageArray', + origin: 'user', + tactic: 'speed', + context: mockContext, + onRequestContextHandle: () => 1, + onRequestTexture: () => null, + onRequestIndex: () => 1, + } + ); v.updateValue([ { height: 1, diff --git a/test/internal/backend/web-gl2/kernel-value/html-image-array.js b/test/internal/backend/web-gl2/kernel-value/html-image-array.js index 14cc7dae..a92d2dd1 100644 --- a/test/internal/backend/web-gl2/kernel-value/html-image-array.js +++ b/test/internal/backend/web-gl2/kernel-value/html-image-array.js @@ -11,16 +11,19 @@ test('.constructor() checks too large height', () => { validate: true, }; assert.throws(() => { - new webGL2KernelValueMaps.unsigned.static.HTMLImageArray([{ width: 1, height: 2 }], { - kernel: mockKernel, - name: 'test', - type: 'HTMLImageArray', - origin: 'user', - tactic: 'speed', - onRequestContextHandle: () => 1, - onRequestTexture: () => null, - onRequestIndex: () => 1, - }); + new webGL2KernelValueMaps.unsigned.static.HTMLImageArray( + [{ width: 1, height: 2 }], + { + kernel: mockKernel, + name: 'test', + type: 'HTMLImageArray', + origin: 'user', + tactic: 'speed', + onRequestContextHandle: () => 1, + onRequestTexture: () => null, + onRequestIndex: () => 1, + } + ); }, new Error('Argument texture height of 2 larger than maximum size of 1 for your GPU')); }); @@ -32,16 +35,19 @@ test('.constructor() checks too large width', () => { validate: true, }; assert.throws(() => { - new webGL2KernelValueMaps.unsigned.static.HTMLImageArray([{ width: 2, height: 1 }], { - kernel: mockKernel, - name: 'test', - type: 'HTMLImageArray', - origin: 'user', - tactic: 'speed', - onRequestContextHandle: () => 1, - onRequestTexture: () => null, - onRequestIndex: () => 1, - }); + new webGL2KernelValueMaps.unsigned.static.HTMLImageArray( + [{ width: 2, height: 1 }], + { + kernel: mockKernel, + name: 'test', + type: 'HTMLImageArray', + origin: 'user', + tactic: 'speed', + onRequestContextHandle: () => 1, + onRequestTexture: () => null, + onRequestIndex: () => 1, + } + ); }, new Error('Argument texture width of 2 larger than maximum size of 1 for your GPU')); }); @@ -52,15 +58,18 @@ test('.constructor() checks ok height & width', () => { }, validate: true, }; - const v = new webGL2KernelValueMaps.unsigned.static.HTMLImageArray([{ width: 2, height: 2 }], { - kernel: mockKernel, - name: 'test', - type: 'HTMLImageArray', - origin: 'user', - tactic: 'speed', - onRequestContextHandle: () => 1, - onRequestTexture: () => null, - onRequestIndex: () => 1, - }); + const v = new webGL2KernelValueMaps.unsigned.static.HTMLImageArray( + [{ width: 2, height: 2 }], + { + kernel: mockKernel, + name: 'test', + type: 'HTMLImageArray', + origin: 'user', + tactic: 'speed', + onRequestContextHandle: () => 1, + onRequestTexture: () => null, + onRequestIndex: () => 1, + } + ); assert.equal(v.constructor.name, 'WebGL2KernelValueHTMLImageArray'); }); diff --git a/test/internal/backend/web-gl2/kernel/index.js b/test/internal/backend/web-gl2/kernel/index.js index 6d01a405..88f7f172 100644 --- a/test/internal/backend/web-gl2/kernel/index.js +++ b/test/internal/backend/web-gl2/kernel/index.js @@ -3,25 +3,28 @@ const { WebGL2Kernel } = require('../../../../../src'); describe('internal: WebGL2Kernel'); -(typeof global !== 'undefined' ? test : skip)('.setupFeatureChecks() if context is available, but .getExtension() is falsey', () => { - const mockContext = { - getExtension: null, // this is important - }; - const mockElement = { - getContext: () => mockContext, - }; - const mockDocument = { - createElement: () => { - return mockElement; - }, - }; - global.document = mockDocument; +(typeof global !== 'undefined' ? test : skip)( + '.setupFeatureChecks() if context is available, but .getExtension() is falsey', + () => { + const mockContext = { + getExtension: null, // this is important + }; + const mockElement = { + getContext: () => mockContext, + }; + const mockDocument = { + createElement: () => { + return mockElement; + }, + }; + global.document = mockDocument; - WebGL2Kernel.setupFeatureChecks(); - assert.ok(true); + WebGL2Kernel.setupFeatureChecks(); + assert.ok(true); - delete global.document; -}); + delete global.document; + } +); test('.validateSettings() checks output texture size - too large', () => { const mockContext = { diff --git a/test/internal/backend/web-gl2/kernel/setupArguments.js b/test/internal/backend/web-gl2/kernel/setupArguments.js index 15e94d07..231bf04d 100644 --- a/test/internal/backend/web-gl2/kernel/setupArguments.js +++ b/test/internal/backend/web-gl2/kernel/setupArguments.js @@ -18,7 +18,17 @@ const gl = { UNPACK_FLIP_Y_WEBGL: 'UNPACK_FLIP_Y_WEBGL', }; function setupArgumentsTestSuite(testSuiteSettings) { - const { gpuSettings, argument, expectedPixels, expectedBitRatio, expectedDim, expectedSize, expectedType, expectedArgumentTextureCount, expectedPixelStorei } = testSuiteSettings; + const { + gpuSettings, + argument, + expectedPixels, + expectedBitRatio, + expectedDim, + expectedSize, + expectedType, + expectedArgumentTextureCount, + expectedPixelStorei, + } = testSuiteSettings; let texImage2DCalled = false; let activeTextureCalled = false; let bindTextureCalled = false; @@ -100,10 +110,23 @@ function setupArgumentsTestSuite(testSuiteSettings) { assert.equal(value, 0); uniform1iCalled = true; }, - texImage2D: (target, level, internalFormat, width, height, border, format, type, pixels) => { + texImage2D: ( + target, + level, + internalFormat, + width, + height, + border, + format, + type, + pixels + ) => { assert.equal(target, gl.TEXTURE_2D); assert.equal(level, 0); - assert.equal(internalFormat, gpuSettings.precision === 'single' ? gl.RGBA32F : gl.RGBA); + assert.equal( + internalFormat, + gpuSettings.precision === 'single' ? gl.RGBA32F : gl.RGBA + ); assert.equal(width, expectedSize[0]); assert.equal(height, expectedSize[1]); assert.equal(border, 0); @@ -120,7 +143,10 @@ function setupArgumentsTestSuite(testSuiteSettings) { const settings = { context: mockContext, }; - const kernel = new WebGL2Kernel(source, Object.assign({}, settings, gpuSettings)); + const kernel = new WebGL2Kernel( + source, + Object.assign({}, settings, gpuSettings) + ); kernel.constructor = { lookupKernelValueType: WebGL2Kernel.lookupKernelValueType, features: { @@ -156,13 +182,15 @@ test('Array with unsigned precision 5 length', () => { }, argument: [ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, + 1, + 2, 3, 4, 5, ], expectedBitRatio: 4, expectedPixels: new Uint8Array( new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, 0, 0, + 1, + 2, 3, 4, 5, 0, 0, 0, ]).buffer ), expectedDim: new Int32Array([5, 1, 1]), @@ -180,13 +208,15 @@ test('Float32Array with unsigned precision 5 length', () => { }, argument: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, + 1, + 2, 3, 4, 5, ]), expectedBitRatio: 4, expectedPixels: new Uint8Array( new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, 0, 0, + 1, + 2, 3, 4, 5, 0, 0, 0, ]).buffer ), expectedDim: new Int32Array([5, 1, 1]), @@ -204,13 +234,15 @@ test('Uint16Array with unsigned precision 5 length', () => { }, argument: new Uint16Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, + 1, + 2, 3, 4, 5, ]), expectedBitRatio: 2, expectedPixels: new Uint8Array( new Uint16Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, 0, 0, + 1, + 2, 3, 4, 5, 0, 0, 0, ]).buffer ), expectedDim: new Int32Array([5, 1, 1]), @@ -230,7 +262,8 @@ test('Uint8Array with unsigned precision 5 length', () => { expectedBitRatio: 1, expectedPixels: new Uint8Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, 0, 0, + 1, + 2, 3, 4, 5, 0, 0, 0, ]), expectedDim: new Int32Array([5, 1, 1]), expectedSize: new Int32Array([1, 2]), // 1 * 2 * 4 = 8 @@ -248,12 +281,14 @@ test('Array with single precision', () => { }, argument: [ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, + 1, + 2, 3, 4, 5, ], expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, 0, 0, + 1, + 2, 3, 4, 5, 0, 0, 0, ]), expectedDim: new Int32Array([5, 1, 1]), expectedSize: new Int32Array([1, 2]), @@ -272,12 +307,14 @@ test('Float32Array with single precision', () => { }, argument: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, + 1, + 2, 3, 4, 5, ]), expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, 0, 0, + 1, + 2, 3, 4, 5, 0, 0, 0, ]), expectedDim: new Int32Array([5, 1, 1]), expectedSize: new Int32Array([1, 2]), @@ -296,13 +333,15 @@ test('Uint16Array with single precision', () => { }, argument: new Uint16Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, + 1, + 2, 3, 4, 5, ]), // upconverted from 2 expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, 0, 0, + 1, + 2, 3, 4, 5, 0, 0, 0, ]), expectedDim: new Int32Array([5, 1, 1]), expectedSize: new Int32Array([1, 2]), @@ -319,13 +358,15 @@ test('Uint8Array with single precision', () => { }, argument: new Uint8Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, + 1, + 2, 3, 4, 5, ]), // upconverted from 1 expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, 0, 0, + 1, + 2, 3, 4, 5, 0, 0, 0, ]), expectedDim: new Int32Array([5, 1, 1]), expectedSize: new Int32Array([1, 2]), @@ -345,7 +386,9 @@ test('Array with unsigned precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 1 per RGBA, so only 1 of the 4 channels is used // NOTE: 6x6 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ], expectedBitRatio: 4, expectedPixels: new Uint8Array( @@ -353,7 +396,9 @@ test('Array with unsigned precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 1 per RGBA, so only 1 of the 4 channels is used // NOTE: 6x6 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]).buffer ), expectedDim: new Int32Array([33, 1, 1]), @@ -374,7 +419,9 @@ test('Float32Array with unsigned precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 1 per RGBA, so only 1 of the 4 channels is used // NOTE: 6x6 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ]), expectedBitRatio: 4, expectedPixels: new Uint8Array( @@ -382,7 +429,9 @@ test('Float32Array with unsigned precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 1 per RGBA, so only 1 of the 4 channels is used // NOTE: 6x6 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]).buffer ), expectedDim: new Int32Array([33, 1, 1]), @@ -403,7 +452,9 @@ test('Uint16Array with unsigned precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 2 per RGBA, so only 2 of the 4 channels is used // NOTE: 4x5 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ]), expectedBitRatio: 2, expectedPixels: new Uint8Array( @@ -411,7 +462,9 @@ test('Uint16Array with unsigned precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 2 per RGBA, so only 2 of the 4 channels is used // NOTE: 4x5 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, 0, 0, 0, 0, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, 0, 0, 0, 0, ]).buffer ), expectedDim: new Int32Array([33, 1, 1]), @@ -432,7 +485,9 @@ test('Uint8Array with unsigned precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so only 2 of the 4 channels is used // NOTE: 3x3 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ]), expectedBitRatio: 1, expectedPixels: new Uint8Array( @@ -440,7 +495,9 @@ test('Uint8Array with unsigned precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so only 2 of the 4 channels is used // NOTE: 3x3 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]).buffer ), expectedDim: new Int32Array([33, 1, 1]), @@ -461,14 +518,18 @@ test('Array with single precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ], expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]), expectedDim: new Int32Array([33, 1, 1]), expectedSize: new Int32Array([3, 3]), // 3 * 3 = 9 * 4 = 34 @@ -488,14 +549,18 @@ test('Float32Array with single precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ]), expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]), expectedDim: new Int32Array([33, 1, 1]), expectedSize: new Int32Array([3, 3]), // 3 * 3 = 9 * 4 = 36 @@ -515,7 +580,9 @@ test('Uint16Array with single precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ]), // upconverted from 2 expectedBitRatio: 4, @@ -523,7 +590,9 @@ test('Uint16Array with single precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]), expectedDim: new Int32Array([33, 1, 1]), expectedSize: new Int32Array([3, 3]), // 3 * 3 = 9 * 4 = 36 @@ -543,7 +612,9 @@ test('Uint8Array with single precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ]), // upconverted from 1 expectedBitRatio: 4, @@ -551,7 +622,9 @@ test('Uint8Array with single precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]), expectedDim: new Int32Array([33, 1, 1]), expectedSize: new Int32Array([3, 3]), // 3 * 3 = 9 * 4 = 36 @@ -572,7 +645,8 @@ test('Input(Array) with unsigned precision 5 length', () => { argument: input( [ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, + 1, + 2, 3, 4, 5, 0, ], [2, 3] ), @@ -580,7 +654,8 @@ test('Input(Array) with unsigned precision 5 length', () => { expectedPixels: new Uint8Array( new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, 0, 0, + 1, + 2, 3, 4, 5, 0, 0, 0, ]).buffer ), expectedDim: new Int32Array([2, 3, 1]), @@ -599,7 +674,8 @@ test('Input(Float32Array) with unsigned precision 5 length', () => { argument: input( new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, + 1, + 2, 3, 4, 5, ]), [5] ), @@ -607,7 +683,8 @@ test('Input(Float32Array) with unsigned precision 5 length', () => { expectedPixels: new Uint8Array( new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, 0, 0, + 1, + 2, 3, 4, 5, 0, 0, 0, ]).buffer ), expectedDim: new Int32Array([5, 1, 1]), @@ -626,7 +703,8 @@ test('Input(Uint16Array) with unsigned precision 5 length', () => { argument: input( new Uint16Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, + 1, + 2, 3, 4, 5, 0, ]), [2, 3] ), @@ -634,7 +712,8 @@ test('Input(Uint16Array) with unsigned precision 5 length', () => { expectedPixels: new Uint8Array( new Uint16Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, 0, 0, + 1, + 2, 3, 4, 5, 0, 0, 0, ]).buffer ), expectedDim: new Int32Array([2, 3, 1]), @@ -654,7 +733,8 @@ test('Input(Uint8Array) with unsigned precision 5 length', () => { expectedBitRatio: 1, expectedPixels: new Uint8Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, 0, 0, + 1, + 2, 3, 4, 5, 0, 0, 0, ]), expectedDim: new Int32Array([2, 3, 1]), expectedSize: new Int32Array([1, 2]), // 1 * 2 * 4 = 8 @@ -673,14 +753,16 @@ test('Input(Array) with single precision', () => { argument: input( [ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, + 1, + 2, 3, 4, 5, 0, ], [2, 3] ), expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, 0, 0, + 1, + 2, 3, 4, 5, 0, 0, 0, ]), expectedDim: new Int32Array([2, 3, 1]), expectedSize: new Int32Array([1, 2]), @@ -700,14 +782,16 @@ test('Input(Float32Array) with single precision', () => { argument: input( new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, + 1, + 2, 3, 4, 5, 0, ]), [2, 3] ), expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, 0, 0, + 1, + 2, 3, 4, 5, 0, 0, 0, ]), expectedDim: new Int32Array([2, 3, 1]), expectedSize: new Int32Array([1, 2]), @@ -727,7 +811,8 @@ test('Input(Uint16Array) with single precision', () => { argument: input( new Uint16Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, + 1, + 2, 3, 4, 5, 0, ]), [2, 3] ), @@ -735,7 +820,8 @@ test('Input(Uint16Array) with single precision', () => { expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, 0, 0, + 1, + 2, 3, 4, 5, 0, 0, 0, ]), expectedDim: new Int32Array([2, 3, 1]), expectedSize: new Int32Array([1, 2]), @@ -753,7 +839,8 @@ test('Input(Uint8Array) with single precision', () => { argument: input( new Uint8Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, + 1, + 2, 3, 4, 5, 0, ]), [2, 3] ), @@ -761,7 +848,8 @@ test('Input(Uint8Array) with single precision', () => { expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, 0, 0, + 1, + 2, 3, 4, 5, 0, 0, 0, ]), expectedDim: new Int32Array([2, 3, 1]), expectedSize: new Int32Array([1, 2]), @@ -782,7 +870,9 @@ test('Input(Array) with unsigned precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 1 per RGBA, so only 1 of the 4 channels is used // NOTE: 6x6 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ], [33] ), @@ -792,7 +882,9 @@ test('Input(Array) with unsigned precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 1 per RGBA, so only 1 of the 4 channels is used // NOTE: 6x6 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]).buffer ), expectedDim: new Int32Array([33, 1, 1]), @@ -814,7 +906,9 @@ test('Input(Float32Array) with unsigned precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 1 per RGBA, so only 1 of the 4 channels is used // NOTE: 6x6 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ]), [33] ), @@ -824,7 +918,9 @@ test('Input(Float32Array) with unsigned precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 1 per RGBA, so only 1 of the 4 channels is used // NOTE: 6x6 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]).buffer ), expectedDim: new Int32Array([33, 1, 1]), @@ -846,7 +942,9 @@ test('Input(Uint16Array) with unsigned precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 2 per RGBA, so only 2 of the 4 channels is used // NOTE: 4x5 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ]), [33] ), @@ -856,7 +954,9 @@ test('Input(Uint16Array) with unsigned precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 2 per RGBA, so only 2 of the 4 channels is used // NOTE: 4x5 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, 0, 0, 0, 0, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, 0, 0, 0, 0, ]).buffer ), expectedDim: new Int32Array([33, 1, 1]), @@ -878,7 +978,9 @@ test('Input(Uint8Array) with unsigned precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so only 2 of the 4 channels is used // NOTE: 3x3 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ]), [33] ), @@ -888,7 +990,9 @@ test('Input(Uint8Array) with unsigned precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so only 2 of the 4 channels is used // NOTE: 3x3 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]).buffer ), expectedDim: new Int32Array([33, 1, 1]), @@ -910,7 +1014,9 @@ test('Input(Array) with single precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ], [33] ), @@ -919,7 +1025,9 @@ test('Input(Array) with single precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]), expectedDim: new Int32Array([33, 1, 1]), expectedSize: new Int32Array([3, 3]), // 3 * 3 = 9 * 4 = 34 @@ -940,7 +1048,9 @@ test('Input(Float32Array) with single precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ]), [33] ), @@ -949,7 +1059,9 @@ test('Input(Float32Array) with single precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]), expectedDim: new Int32Array([33, 1, 1]), expectedSize: new Int32Array([3, 3]), // 3 * 3 = 9 * 4 = 34 @@ -970,7 +1082,9 @@ test('Input(Uint16Array) with single precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ]), [33] ), @@ -980,7 +1094,9 @@ test('Input(Uint16Array) with single precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]), expectedDim: new Int32Array([33, 1, 1]), expectedSize: new Int32Array([3, 3]), // 3 * 3 = 9 * 4 = 36 @@ -1001,7 +1117,9 @@ test('Input(Uint8Array) with single precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA (8 bit, but upconverted to float32), so only 4 of the 4 channels is used // NOTE: 3x3 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ]), [33] ), @@ -1011,7 +1129,9 @@ test('Input(Uint8Array) with single precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA (8 bit, but upconverted to float32), so only 4 of the 4 channels is used // NOTE: 3x3 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]), expectedDim: new Int32Array([33, 1, 1]), expectedSize: new Int32Array([3, 3]), // 3 * 3 = 9 * 4 = 36 diff --git a/test/internal/backend/web-gl2/kernel/setupConstants.js b/test/internal/backend/web-gl2/kernel/setupConstants.js index 318e0b92..00ece59e 100644 --- a/test/internal/backend/web-gl2/kernel/setupConstants.js +++ b/test/internal/backend/web-gl2/kernel/setupConstants.js @@ -18,7 +18,17 @@ const gl = { UNPACK_FLIP_Y_WEBGL: 'UNPACK_FLIP_Y_WEBGL', }; function setupConstantsTestSuite(testSuiteSettings) { - const { gpuSettings, constant, expectedPixels, expectedBitRatio, expectedDim, expectedSize, expectedType, expectedConstantTextureCount, expectedPixelStorei } = testSuiteSettings; + const { + gpuSettings, + constant, + expectedPixels, + expectedBitRatio, + expectedDim, + expectedSize, + expectedType, + expectedConstantTextureCount, + expectedPixelStorei, + } = testSuiteSettings; let texImage2DCalled = false; let activeTextureCalled = false; let bindTextureCalled = false; @@ -100,10 +110,23 @@ function setupConstantsTestSuite(testSuiteSettings) { assert.equal(value, 0); uniform1iCalled = true; }, - texImage2D: (target, level, internalFormat, width, height, border, format, type, pixels) => { + texImage2D: ( + target, + level, + internalFormat, + width, + height, + border, + format, + type, + pixels + ) => { assert.equal(target, gl.TEXTURE_2D); assert.equal(level, 0); - assert.equal(internalFormat, gpuSettings.precision === 'single' ? gl.RGBA32F : gl.RGBA); + assert.equal( + internalFormat, + gpuSettings.precision === 'single' ? gl.RGBA32F : gl.RGBA + ); assert.equal(width, expectedSize[0]); assert.equal(height, expectedSize[1]); assert.equal(border, 0); @@ -120,7 +143,10 @@ function setupConstantsTestSuite(testSuiteSettings) { const settings = { context: mockContext, }; - const kernel = new WebGL2Kernel(source, Object.assign({ constants: { v: constant } }, settings, gpuSettings)); + const kernel = new WebGL2Kernel( + source, + Object.assign({ constants: { v: constant } }, settings, gpuSettings) + ); kernel.constructor = { lookupKernelValueType: WebGL2Kernel.lookupKernelValueType, features: { @@ -155,13 +181,15 @@ test('Array with unsigned precision 5 length', () => { }, constant: [ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, + 1, + 2, 3, 4, 5, ], expectedBitRatio: 4, expectedPixels: new Uint8Array( new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, 0, 0, + 1, + 2, 3, 4, 5, 0, 0, 0, ]).buffer ), expectedDim: new Int32Array([5, 1, 1]), @@ -179,13 +207,15 @@ test('Float32Array with unsigned precision 5 length', () => { }, constant: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, + 1, + 2, 3, 4, 5, ]), expectedBitRatio: 4, expectedPixels: new Uint8Array( new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, 0, 0, + 1, + 2, 3, 4, 5, 0, 0, 0, ]).buffer ), expectedDim: new Int32Array([5, 1, 1]), @@ -203,13 +233,15 @@ test('Uint16Array with unsigned precision 5 length', () => { }, constant: new Uint16Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, + 1, + 2, 3, 4, 5, ]), expectedBitRatio: 2, expectedPixels: new Uint8Array( new Uint16Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, 0, 0, + 1, + 2, 3, 4, 5, 0, 0, 0, ]).buffer ), expectedDim: new Int32Array([5, 1, 1]), @@ -229,7 +261,8 @@ test('Uint8Array with unsigned precision 5 length', () => { expectedBitRatio: 1, expectedPixels: new Uint8Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, 0, 0, + 1, + 2, 3, 4, 5, 0, 0, 0, ]), expectedDim: new Int32Array([5, 1, 1]), expectedSize: new Int32Array([1, 2]), // 1 * 2 * 4 = 8 @@ -247,12 +280,14 @@ test('Array with single precision', () => { }, constant: [ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, + 1, + 2, 3, 4, 5, ], expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, 0, 0, + 1, + 2, 3, 4, 5, 0, 0, 0, ]), expectedDim: new Int32Array([5, 1, 1]), expectedSize: new Int32Array([1, 2]), @@ -271,12 +306,14 @@ test('Float32Array with single precision', () => { }, constant: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, + 1, + 2, 3, 4, 5, ]), expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, 0, 0, + 1, + 2, 3, 4, 5, 0, 0, 0, ]), expectedDim: new Int32Array([5, 1, 1]), expectedSize: new Int32Array([1, 2]), @@ -295,13 +332,15 @@ test('Uint16Array with single precision', () => { }, constant: new Uint16Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, + 1, + 2, 3, 4, 5, ]), // upconverted from 2 expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, 0, 0, + 1, + 2, 3, 4, 5, 0, 0, 0, ]), expectedDim: new Int32Array([5, 1, 1]), expectedSize: new Int32Array([1, 2]), @@ -318,13 +357,15 @@ test('Uint8Array with single precision', () => { }, constant: new Uint8Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, + 1, + 2, 3, 4, 5, ]), // upconverted from 1 expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, 0, 0, + 1, + 2, 3, 4, 5, 0, 0, 0, ]), expectedDim: new Int32Array([5, 1, 1]), expectedSize: new Int32Array([1, 2]), @@ -344,7 +385,9 @@ test('Array with unsigned precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 1 per RGBA, so only 1 of the 4 channels is used // NOTE: 6x6 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ], expectedBitRatio: 4, expectedPixels: new Uint8Array( @@ -352,7 +395,9 @@ test('Array with unsigned precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 1 per RGBA, so only 1 of the 4 channels is used // NOTE: 6x6 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]).buffer ), expectedDim: new Int32Array([33, 1, 1]), @@ -373,7 +418,9 @@ test('Float32Array with unsigned precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 1 per RGBA, so only 1 of the 4 channels is used // NOTE: 6x6 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ]), expectedBitRatio: 4, expectedPixels: new Uint8Array( @@ -381,7 +428,9 @@ test('Float32Array with unsigned precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 1 per RGBA, so only 1 of the 4 channels is used // NOTE: 6x6 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]).buffer ), expectedDim: new Int32Array([33, 1, 1]), @@ -402,7 +451,9 @@ test('Uint16Array with unsigned precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 2 per RGBA, so only 2 of the 4 channels is used // NOTE: 4x5 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ]), expectedBitRatio: 2, expectedPixels: new Uint8Array( @@ -410,7 +461,9 @@ test('Uint16Array with unsigned precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 2 per RGBA, so only 2 of the 4 channels is used // NOTE: 4x5 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, 0, 0, 0, 0, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, 0, 0, 0, 0, ]).buffer ), expectedDim: new Int32Array([33, 1, 1]), @@ -431,7 +484,9 @@ test('Uint8Array with unsigned precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so only 2 of the 4 channels is used // NOTE: 3x3 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ]), expectedBitRatio: 1, expectedPixels: new Uint8Array( @@ -439,7 +494,9 @@ test('Uint8Array with unsigned precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so only 2 of the 4 channels is used // NOTE: 3x3 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]).buffer ), expectedDim: new Int32Array([33, 1, 1]), @@ -460,14 +517,18 @@ test('Array with single precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ], expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]), expectedDim: new Int32Array([33, 1, 1]), expectedSize: new Int32Array([3, 3]), // 3 * 3 = 9 * 4 = 34 @@ -487,14 +548,18 @@ test('Float32Array with single precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ]), expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]), expectedDim: new Int32Array([33, 1, 1]), expectedSize: new Int32Array([3, 3]), // 3 * 3 = 9 * 4 = 34 @@ -514,7 +579,9 @@ test('Uint16Array with single precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ]), // upconverted from 2 expectedBitRatio: 4, @@ -522,7 +589,9 @@ test('Uint16Array with single precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]), expectedDim: new Int32Array([33, 1, 1]), expectedSize: new Int32Array([3, 3]), // 3 * 3 = 9 * 4 = 36 @@ -542,7 +611,9 @@ test('Uint8Array with single precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ]), // upconverted from 1 expectedBitRatio: 4, @@ -550,7 +621,9 @@ test('Uint8Array with single precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]), expectedDim: new Int32Array([33, 1, 1]), expectedSize: new Int32Array([3, 3]), // 3 * 3 = 9 * 4 = 36 @@ -571,7 +644,8 @@ test('Input(Array) with unsigned precision 5 length', () => { constant: input( [ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, + 1, + 2, 3, 4, 5, 0, ], [2, 3] ), @@ -579,7 +653,8 @@ test('Input(Array) with unsigned precision 5 length', () => { expectedPixels: new Uint8Array( new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, 0, 0, + 1, + 2, 3, 4, 5, 0, 0, 0, ]).buffer ), expectedDim: new Int32Array([2, 3, 1]), @@ -598,7 +673,8 @@ test('Input(Float32Array) with unsigned precision 5 length', () => { constant: input( new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, + 1, + 2, 3, 4, 5, ]), [5] ), @@ -606,7 +682,8 @@ test('Input(Float32Array) with unsigned precision 5 length', () => { expectedPixels: new Uint8Array( new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, 0, 0, + 1, + 2, 3, 4, 5, 0, 0, 0, ]).buffer ), expectedDim: new Int32Array([5, 1, 1]), @@ -625,7 +702,8 @@ test('Input(Uint16Array) with unsigned precision 5 length', () => { constant: input( new Uint16Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, + 1, + 2, 3, 4, 5, 0, ]), [2, 3] ), @@ -633,7 +711,8 @@ test('Input(Uint16Array) with unsigned precision 5 length', () => { expectedPixels: new Uint8Array( new Uint16Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, 0, 0, + 1, + 2, 3, 4, 5, 0, 0, 0, ]).buffer ), expectedDim: new Int32Array([2, 3, 1]), @@ -653,7 +732,8 @@ test('Input(Uint8Array) with unsigned precision 5 length', () => { expectedBitRatio: 1, expectedPixels: new Uint8Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, 0, 0, + 1, + 2, 3, 4, 5, 0, 0, 0, ]), expectedDim: new Int32Array([2, 3, 1]), expectedSize: new Int32Array([1, 2]), // 1 * 2 * 4 = 8 @@ -672,14 +752,16 @@ test('Input(Array) with single precision', () => { constant: input( [ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, + 1, + 2, 3, 4, 5, 0, ], [2, 3] ), expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, 0, 0, + 1, + 2, 3, 4, 5, 0, 0, 0, ]), expectedDim: new Int32Array([2, 3, 1]), expectedSize: new Int32Array([1, 2]), @@ -699,14 +781,16 @@ test('Input(Float32Array) with single precision', () => { constant: input( new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, + 1, + 2, 3, 4, 5, 0, ]), [2, 3] ), expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, 0, 0, + 1, + 2, 3, 4, 5, 0, 0, 0, ]), expectedDim: new Int32Array([2, 3, 1]), expectedSize: new Int32Array([1, 2]), @@ -726,7 +810,8 @@ test('Input(Uint16Array) with single precision', () => { constant: input( new Uint16Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, + 1, + 2, 3, 4, 5, 0, ]), [2, 3] ), @@ -734,7 +819,8 @@ test('Input(Uint16Array) with single precision', () => { expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, 0, 0, + 1, + 2, 3, 4, 5, 0, 0, 0, ]), expectedDim: new Int32Array([2, 3, 1]), expectedSize: new Int32Array([1, 2]), @@ -752,7 +838,8 @@ test('Input(Uint8Array) with single precision', () => { constant: input( new Uint8Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, + 1, + 2, 3, 4, 5, 0, ]), [2, 3] ), @@ -760,7 +847,8 @@ test('Input(Uint8Array) with single precision', () => { expectedBitRatio: 4, expectedPixels: new Float32Array([ // NOTE: formatted like rectangle on purpose, so you can see how the texture should look - 1, 2, 3, 4, 5, 0, 0, 0, + 1, + 2, 3, 4, 5, 0, 0, 0, ]), expectedDim: new Int32Array([2, 3, 1]), expectedSize: new Int32Array([1, 2]), @@ -781,7 +869,9 @@ test('Input(Array) with unsigned precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 1 per RGBA, so only 1 of the 4 channels is used // NOTE: 6x6 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ], [33] ), @@ -791,7 +881,9 @@ test('Input(Array) with unsigned precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 1 per RGBA, so only 1 of the 4 channels is used // NOTE: 6x6 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]).buffer ), expectedDim: new Int32Array([33, 1, 1]), @@ -813,7 +905,9 @@ test('Input(Float32Array) with unsigned precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 1 per RGBA, so only 1 of the 4 channels is used // NOTE: 6x6 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ]), [33] ), @@ -823,7 +917,9 @@ test('Input(Float32Array) with unsigned precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 1 per RGBA, so only 1 of the 4 channels is used // NOTE: 6x6 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]).buffer ), expectedDim: new Int32Array([33, 1, 1]), @@ -845,7 +941,9 @@ test('Input(Uint16Array) with unsigned precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 2 per RGBA, so only 2 of the 4 channels is used // NOTE: 4x5 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ]), [33] ), @@ -855,7 +953,9 @@ test('Input(Uint16Array) with unsigned precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 2 per RGBA, so only 2 of the 4 channels is used // NOTE: 4x5 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, 0, 0, 0, 0, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, 0, 0, 0, 0, ]).buffer ), expectedDim: new Int32Array([33, 1, 1]), @@ -877,7 +977,9 @@ test('Input(Uint8Array) with unsigned precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so only 2 of the 4 channels is used // NOTE: 3x3 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ]), [33] ), @@ -887,7 +989,9 @@ test('Input(Uint8Array) with unsigned precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so only 2 of the 4 channels is used // NOTE: 3x3 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]).buffer ), expectedDim: new Int32Array([33, 1, 1]), @@ -909,7 +1013,9 @@ test('Input(Array) with single precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ], [33] ), @@ -918,7 +1024,9 @@ test('Input(Array) with single precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]), expectedDim: new Int32Array([33, 1, 1]), expectedSize: new Int32Array([3, 3]), // 3 * 3 = 9 * 4 = 34 @@ -939,7 +1047,9 @@ test('Input(Float32Array) with single precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ]), [33] ), @@ -948,7 +1058,9 @@ test('Input(Float32Array) with single precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]), expectedDim: new Int32Array([33, 1, 1]), expectedSize: new Int32Array([3, 3]), // 3 * 3 = 9 * 4 = 34 @@ -969,7 +1081,9 @@ test('Input(Uint16Array) with single precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ]), [33] ), @@ -979,7 +1093,9 @@ test('Input(Uint16Array) with single precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA, so 4 of the 4 channels is used // NOTE: 3x3 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]), expectedDim: new Int32Array([33, 1, 1]), expectedSize: new Int32Array([3, 3]), // 3 * 3 = 9 * 4 = 36 @@ -1000,7 +1116,9 @@ test('Input(Uint8Array) with single precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA (8 bit, but upconverted to float32), so only 4 of the 4 channels is used // NOTE: 3x3 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, ]), [33] ), @@ -1010,7 +1128,9 @@ test('Input(Uint8Array) with single precision length 33', () => { // NOTE: formatted like rectangle on purpose, so you can see how the texture should look // NOTE: Packing is 4 per RGBA (8 bit, but upconverted to float32), so only 4 of the 4 channels is used // NOTE: 3x3 - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, + 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 0, 0, 0, ]), expectedDim: new Int32Array([33, 1, 1]), expectedSize: new Int32Array([3, 3]), // 3 * 3 = 9 * 4 = 36 diff --git a/test/internal/boolean.js b/test/internal/boolean.js index a4a1d233..bc876dda 100644 --- a/test/internal/boolean.js +++ b/test/internal/boolean.js @@ -80,9 +80,12 @@ test('boolean argument true gpu', () => { booleanArgumentTrue('webgl2'); }); -(GPU.isHeadlessGLSupported ? test : skip)('boolean argument true headlessgl', () => { - booleanArgumentTrue('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'boolean argument true headlessgl', + () => { + booleanArgumentTrue('headlessgl'); + } +); test('boolean argument true cpu', () => { booleanArgumentTrue('cpu'); @@ -122,9 +125,12 @@ test('boolean argument false gpu', () => { booleanArgumentFalse('webgl2'); }); -(GPU.isHeadlessGLSupported ? test : skip)('boolean argument false headlessgl', () => { - booleanArgumentFalse('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'boolean argument false headlessgl', + () => { + booleanArgumentFalse('headlessgl'); + } +); test('boolean argument false cpu', () => { booleanArgumentFalse('cpu'); @@ -165,9 +171,12 @@ test('boolean variable true gpu', () => { booleanVariableTrue('webgl2'); }); -(GPU.isHeadlessGLSupported ? test : skip)('boolean variable true headlessgl', () => { - booleanVariableTrue('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'boolean variable true headlessgl', + () => { + booleanVariableTrue('headlessgl'); + } +); test('boolean variable true cpu', () => { booleanVariableTrue('cpu'); @@ -208,9 +217,12 @@ test('boolean variable false gpu', () => { booleanVariableFalse('webgl2'); }); -(GPU.isHeadlessGLSupported ? test : skip)('boolean variable false headlessgl', () => { - booleanVariableFalse('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'boolean variable false headlessgl', + () => { + booleanVariableFalse('headlessgl'); + } +); test('boolean variable false cpu', () => { booleanVariableFalse('cpu'); @@ -251,9 +263,12 @@ test('boolean expression true gpu', () => { booleanExpressionTrue('webgl2'); }); -(GPU.isHeadlessGLSupported ? test : skip)('boolean expression true headlessgl', () => { - booleanExpressionTrue('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'boolean expression true headlessgl', + () => { + booleanExpressionTrue('headlessgl'); + } +); test('boolean expression true cpu', () => { booleanExpressionTrue('cpu'); @@ -290,13 +305,19 @@ test('boolean expression false gpu', () => { booleanExpressionFalse('webgl'); }); -(GPU.isWebGL2Supported ? test : skip)('boolean expression false webgl2', () => { - booleanExpressionFalse('webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'boolean expression false webgl2', + () => { + booleanExpressionFalse('webgl2'); + } +); -(GPU.isHeadlessGLSupported ? test : skip)('boolean expression false headlessgl', () => { - booleanExpressionFalse('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'boolean expression false headlessgl', + () => { + booleanExpressionFalse('headlessgl'); + } +); test('boolean expression false cpu', () => { booleanExpressionFalse('cpu'); diff --git a/test/internal/casting.js b/test/internal/casting.js index 568c2ddd..2b7b6b56 100644 --- a/test/internal/casting.js +++ b/test/internal/casting.js @@ -24,15 +24,24 @@ function castingOffsetByThreadXAndOutputX(mode) { gpu.destroy(); } -(GPU.isWebGLSupported ? test : skip)('casting offset by this.thread.x and this.output.x webgl', () => { - castingOffsetByThreadXAndOutputX('webgl'); -}); -(GPU.isWebGL2Supported ? test : skip)('casting offset by this.thread.x and this.output.x webgl2', () => { - castingOffsetByThreadXAndOutputX('webgl2'); -}); -(GPU.isHeadlessGLSupported ? test : skip)('casting offset by this.thread.x and this.output.x headlessgl', () => { - castingOffsetByThreadXAndOutputX('headlessgl'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'casting offset by this.thread.x and this.output.x webgl', + () => { + castingOffsetByThreadXAndOutputX('webgl'); + } +); +(GPU.isWebGL2Supported ? test : skip)( + 'casting offset by this.thread.x and this.output.x webgl2', + () => { + castingOffsetByThreadXAndOutputX('webgl2'); + } +); +(GPU.isHeadlessGLSupported ? test : skip)( + 'casting offset by this.thread.x and this.output.x headlessgl', + () => { + castingOffsetByThreadXAndOutputX('headlessgl'); + } +); function handleCastingIntsWithNativeFunctions(mode) { const gpu = new GPU({ mode }); @@ -56,15 +65,24 @@ function handleCastingIntsWithNativeFunctions(mode) { gpu.destroy(); } -(GPU.isWebGLSupported ? test : skip)('handle casting ints with native functions webgl', () => { - handleCastingIntsWithNativeFunctions('webgl'); -}); -(GPU.isWebGL2Supported ? test : skip)('handle casting ints with native functions webgl2', () => { - handleCastingIntsWithNativeFunctions('webgl2'); -}); -(GPU.isHeadlessGLSupported ? test : skip)('handle casting ints with native functions headlessgl', () => { - handleCastingIntsWithNativeFunctions('headlessgl'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'handle casting ints with native functions webgl', + () => { + handleCastingIntsWithNativeFunctions('webgl'); + } +); +(GPU.isWebGL2Supported ? test : skip)( + 'handle casting ints with native functions webgl2', + () => { + handleCastingIntsWithNativeFunctions('webgl2'); + } +); +(GPU.isHeadlessGLSupported ? test : skip)( + 'handle casting ints with native functions headlessgl', + () => { + handleCastingIntsWithNativeFunctions('headlessgl'); + } +); function handleCastingFloatsWithNativeFunctions(mode) { const gpu = new GPU({ mode }); @@ -92,15 +110,24 @@ function handleCastingFloatsWithNativeFunctions(mode) { gpu.destroy(); } -(GPU.isWebGLSupported ? test : skip)('handle casting floats with native functions webgl', () => { - handleCastingFloatsWithNativeFunctions('webgl'); -}); -(GPU.isWebGL2Supported ? test : skip)('handle casting floats with native functions webgl2', () => { - handleCastingFloatsWithNativeFunctions('webgl2'); -}); -(GPU.isHeadlessGLSupported ? test : skip)('handle casting floats with native functions headlessgl', () => { - handleCastingFloatsWithNativeFunctions('headlessgl'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'handle casting floats with native functions webgl', + () => { + handleCastingFloatsWithNativeFunctions('webgl'); + } +); +(GPU.isWebGL2Supported ? test : skip)( + 'handle casting floats with native functions webgl2', + () => { + handleCastingFloatsWithNativeFunctions('webgl2'); + } +); +(GPU.isHeadlessGLSupported ? test : skip)( + 'handle casting floats with native functions headlessgl', + () => { + handleCastingFloatsWithNativeFunctions('headlessgl'); + } +); function handleCastingMixedWithNativeFunctions(mode) { const gpu = new GPU({ mode }); @@ -127,15 +154,24 @@ function handleCastingMixedWithNativeFunctions(mode) { gpu.destroy(); } -(GPU.isWebGLSupported ? test : skip)('handle casting mixed with native functions webgl', () => { - handleCastingMixedWithNativeFunctions('webgl'); -}); -(GPU.isWebGL2Supported ? test : skip)('handle casting mixed with native functions webgl2', () => { - handleCastingMixedWithNativeFunctions('webgl2'); -}); -(GPU.isHeadlessGLSupported ? test : skip)('handle casting mixed with native functions headlessgl', () => { - handleCastingMixedWithNativeFunctions('headlessgl'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'handle casting mixed with native functions webgl', + () => { + handleCastingMixedWithNativeFunctions('webgl'); + } +); +(GPU.isWebGL2Supported ? test : skip)( + 'handle casting mixed with native functions webgl2', + () => { + handleCastingMixedWithNativeFunctions('webgl2'); + } +); +(GPU.isHeadlessGLSupported ? test : skip)( + 'handle casting mixed with native functions headlessgl', + () => { + handleCastingMixedWithNativeFunctions('headlessgl'); + } +); function handleCastingFloat(mode) { const gpu = new GPU({ mode }); @@ -169,9 +205,12 @@ function handleCastingFloat(mode) { handleCastingFloat('webgl2'); }); -(GPU.isHeadlessGLSupported ? test : skip)('handle casting float headlessgl', () => { - handleCastingFloat('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'handle casting float headlessgl', + () => { + handleCastingFloat('headlessgl'); + } +); function handleCastingBeforeReturn(mode) { const gpu = new GPU({ mode }); @@ -193,14 +232,23 @@ function handleCastingBeforeReturn(mode) { gpu.destroy(); } -(GPU.isWebGLSupported ? test : skip)('handle casting before return webgl', () => { - handleCastingBeforeReturn('webgl'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'handle casting before return webgl', + () => { + handleCastingBeforeReturn('webgl'); + } +); -(GPU.isWebGL2Supported ? test : skip)('handle casting before return webgl2', () => { - handleCastingBeforeReturn('webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'handle casting before return webgl2', + () => { + handleCastingBeforeReturn('webgl2'); + } +); -(GPU.isHeadlessGLSupported ? test : skip)('handle casting before return headlessgl', () => { - handleCastingBeforeReturn('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'handle casting before return headlessgl', + () => { + handleCastingBeforeReturn('headlessgl'); + } +); diff --git a/test/internal/constants-texture-switching.js b/test/internal/constants-texture-switching.js index a4add14e..aec55b1c 100644 --- a/test/internal/constants-texture-switching.js +++ b/test/internal/constants-texture-switching.js @@ -33,25 +33,40 @@ function testArray1D2(mode) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported ? test : skip)('Array1D(2) (GPU only) auto', () => { - testArray1D2(); -}); - -(GPU.isSinglePrecisionSupported ? test : skip)('Array1D(2) (GPU only) gpu', () => { - testArray1D2('gpu'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('Array1D(2) (GPU only) webgl', () => { - testArray1D2('webgl'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('Array1D(2) (GPU only) webgl2', () => { - testArray1D2('webgl2'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('Array1D(2) (GPU only) headlessgl', () => { - testArray1D2('headlessgl'); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'Array1D(2) (GPU only) auto', + () => { + testArray1D2(); + } +); + +(GPU.isSinglePrecisionSupported ? test : skip)( + 'Array1D(2) (GPU only) gpu', + () => { + testArray1D2('gpu'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'Array1D(2) (GPU only) webgl', + () => { + testArray1D2('webgl'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'Array1D(2) (GPU only) webgl2', + () => { + testArray1D2('webgl2'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'Array1D(2) (GPU only) headlessgl', + () => { + testArray1D2('headlessgl'); + } +); function testArray1D3(mode) { const gpu = new GPU({ mode }); @@ -83,31 +98,51 @@ function testArray1D3(mode) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported ? test : skip)('Array1D(3) (GPU only) auto', () => { - testArray1D3(); -}); - -(GPU.isSinglePrecisionSupported ? test : skip)('Array1D(3) (GPU only) gpu', () => { - testArray1D3('gpu'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('Array1D(3) (GPU only) webgl', () => { - testArray1D3('webgl'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('Array1D(3) (GPU only) webgl2', () => { - testArray1D3('webgl2'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('Array1D(3) (GPU only) headlessgl', () => { - testArray1D3('headlessgl'); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'Array1D(3) (GPU only) auto', + () => { + testArray1D3(); + } +); + +(GPU.isSinglePrecisionSupported ? test : skip)( + 'Array1D(3) (GPU only) gpu', + () => { + testArray1D3('gpu'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'Array1D(3) (GPU only) webgl', + () => { + testArray1D3('webgl'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'Array1D(3) (GPU only) webgl2', + () => { + testArray1D3('webgl2'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'Array1D(3) (GPU only) headlessgl', + () => { + testArray1D3('headlessgl'); + } +); function testArray1D4(mode) { const gpu = new GPU({ mode }); const texture = gpu .createKernel(function () { - return [this.thread.x, this.thread.x + 1, this.thread.x + 2, this.thread.x + 3]; + return [ + this.thread.x, + this.thread.x + 1, + this.thread.x + 2, + this.thread.x + 3, + ]; }) .setOutput([10]) .setPipeline(true) @@ -133,25 +168,40 @@ function testArray1D4(mode) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported ? test : skip)('Array1D(4) (GPU only) auto', () => { - testArray1D4(); -}); - -(GPU.isSinglePrecisionSupported ? test : skip)('Array1D(4) (GPU only) gpu', () => { - testArray1D4('gpu'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('Array1D(4) (GPU only) webgl', () => { - testArray1D4('webgl'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('Array1D(4) (GPU only) webgl2', () => { - testArray1D4('webgl2'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('Array1D(4) (GPU only) headlessgl', () => { - testArray1D4('headlessgl'); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'Array1D(4) (GPU only) auto', + () => { + testArray1D4(); + } +); + +(GPU.isSinglePrecisionSupported ? test : skip)( + 'Array1D(4) (GPU only) gpu', + () => { + testArray1D4('gpu'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'Array1D(4) (GPU only) webgl', + () => { + testArray1D4('webgl'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'Array1D(4) (GPU only) webgl2', + () => { + testArray1D4('webgl2'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'Array1D(4) (GPU only) headlessgl', + () => { + testArray1D4('headlessgl'); + } +); function testArray2D2(mode) { const gpu = new GPU({ mode }); @@ -183,25 +233,40 @@ function testArray2D2(mode) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported ? test : skip)('Array2D(2) (GPU only) auto', () => { - testArray2D2(); -}); - -(GPU.isSinglePrecisionSupported ? test : skip)('Array2D(2) (GPU only) gpu', () => { - testArray2D2('gpu'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('Array2D(2) (GPU only) webgl', () => { - testArray2D2('webgl'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('Array2D(2) (GPU only) webgl2', () => { - testArray2D2('webgl2'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('Array2D(2) (GPU only) headlessgl', () => { - testArray2D2('headlessgl'); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'Array2D(2) (GPU only) auto', + () => { + testArray2D2(); + } +); + +(GPU.isSinglePrecisionSupported ? test : skip)( + 'Array2D(2) (GPU only) gpu', + () => { + testArray2D2('gpu'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'Array2D(2) (GPU only) webgl', + () => { + testArray2D2('webgl'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'Array2D(2) (GPU only) webgl2', + () => { + testArray2D2('webgl2'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'Array2D(2) (GPU only) headlessgl', + () => { + testArray2D2('headlessgl'); + } +); function testArray2D3(mode) { const gpu = new GPU({ mode }); @@ -233,31 +298,51 @@ function testArray2D3(mode) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported ? test : skip)('Array2D(3) (GPU only) auto', () => { - testArray2D3(); -}); - -(GPU.isSinglePrecisionSupported ? test : skip)('Array1D(3) (GPU only) gpu', () => { - testArray2D3('gpu'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('Array2D(3) (GPU only) webgl', () => { - testArray2D3('webgl'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('Array2D(3) (GPU only) webgl2', () => { - testArray2D3('webgl2'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('Array2D(3) (GPU only) headlessgl', () => { - testArray2D3('headlessgl'); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'Array2D(3) (GPU only) auto', + () => { + testArray2D3(); + } +); + +(GPU.isSinglePrecisionSupported ? test : skip)( + 'Array1D(3) (GPU only) gpu', + () => { + testArray2D3('gpu'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'Array2D(3) (GPU only) webgl', + () => { + testArray2D3('webgl'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'Array2D(3) (GPU only) webgl2', + () => { + testArray2D3('webgl2'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'Array2D(3) (GPU only) headlessgl', + () => { + testArray2D3('headlessgl'); + } +); function testArray2D4(mode) { const gpu = new GPU({ mode }); const texture = gpu .createKernel(function () { - return [this.thread.x, this.thread.y, this.thread.x * this.thread.y, this.thread.x / this.thread.y]; + return [ + this.thread.x, + this.thread.y, + this.thread.x * this.thread.y, + this.thread.x / this.thread.y, + ]; }) .setOutput([10, 10]) .setPipeline(true) @@ -283,25 +368,40 @@ function testArray2D4(mode) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported ? test : skip)('Array2D(4) (GPU only) auto', () => { - testArray2D4(); -}); - -(GPU.isSinglePrecisionSupported ? test : skip)('Array1D(4) (GPU only) gpu', () => { - testArray2D4('gpu'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('Array2D(4) (GPU only) webgl', () => { - testArray2D4('webgl'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('Array2D(4) (GPU only) webgl2', () => { - testArray2D4('webgl2'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('Array2D(4) (GPU only) headlessgl', () => { - testArray2D4('headlessgl'); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'Array2D(4) (GPU only) auto', + () => { + testArray2D4(); + } +); + +(GPU.isSinglePrecisionSupported ? test : skip)( + 'Array1D(4) (GPU only) gpu', + () => { + testArray2D4('gpu'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'Array2D(4) (GPU only) webgl', + () => { + testArray2D4('webgl'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'Array2D(4) (GPU only) webgl2', + () => { + testArray2D4('webgl2'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'Array2D(4) (GPU only) headlessgl', + () => { + testArray2D4('headlessgl'); + } +); function testArray3D2(mode) { const gpu = new GPU({ mode }); @@ -333,25 +433,40 @@ function testArray3D2(mode) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported ? test : skip)('Array3D(2) (GPU only) auto', () => { - testArray3D2(); -}); - -(GPU.isSinglePrecisionSupported ? test : skip)('Array3D(2) (GPU only) gpu', () => { - testArray3D2('gpu'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('Array3D(2) (GPU only) webgl', () => { - testArray3D2('webgl'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('Array3D(2) (GPU only) webgl2', () => { - testArray3D2('webgl2'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('Array3D(2) (GPU only) headlessgl', () => { - testArray3D2('headlessgl'); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'Array3D(2) (GPU only) auto', + () => { + testArray3D2(); + } +); + +(GPU.isSinglePrecisionSupported ? test : skip)( + 'Array3D(2) (GPU only) gpu', + () => { + testArray3D2('gpu'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'Array3D(2) (GPU only) webgl', + () => { + testArray3D2('webgl'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'Array3D(2) (GPU only) webgl2', + () => { + testArray3D2('webgl2'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'Array3D(2) (GPU only) headlessgl', + () => { + testArray3D2('headlessgl'); + } +); function testArray3D3(mode) { const gpu = new GPU({ mode }); @@ -383,31 +498,51 @@ function testArray3D3(mode) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported ? test : skip)('Array3D(3) (GPU only) auto', () => { - testArray3D3(); -}); - -(GPU.isSinglePrecisionSupported ? test : skip)('Array3D(3) (GPU only) gpu', () => { - testArray3D3('gpu'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('Array3D(3) (GPU only) webgl', () => { - testArray3D3('webgl'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('Array3D(3) (GPU only) webgl2', () => { - testArray3D3('webgl2'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('Array3D(3) (GPU only) headlessgl', () => { - testArray3D3('headlessgl'); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'Array3D(3) (GPU only) auto', + () => { + testArray3D3(); + } +); + +(GPU.isSinglePrecisionSupported ? test : skip)( + 'Array3D(3) (GPU only) gpu', + () => { + testArray3D3('gpu'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'Array3D(3) (GPU only) webgl', + () => { + testArray3D3('webgl'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'Array3D(3) (GPU only) webgl2', + () => { + testArray3D3('webgl2'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'Array3D(3) (GPU only) headlessgl', + () => { + testArray3D3('headlessgl'); + } +); function testArray3D4(mode) { const gpu = new GPU({ mode }); const texture = gpu .createKernel(function () { - return [this.thread.x, this.thread.y, this.thread.z, this.thread.x * this.thread.y * this.thread.z]; + return [ + this.thread.x, + this.thread.y, + this.thread.z, + this.thread.x * this.thread.y * this.thread.z, + ]; }) .setOutput([10, 10, 10]) .setPipeline(true) @@ -433,22 +568,37 @@ function testArray3D4(mode) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported ? test : skip)('Array3D(4) (GPU only) auto', () => { - testArray3D4(); -}); - -(GPU.isSinglePrecisionSupported ? test : skip)('Array3D(4) (GPU only) gpu', () => { - testArray3D4('gpu'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('Array3D(4) (GPU only) webgl', () => { - testArray3D4('webgl'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('Array3D(4) (GPU only) webgl2', () => { - testArray3D4('webgl2'); -}); - -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('Array3D(4) (GPU only) headlessgl', () => { - testArray3D4('headlessgl'); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'Array3D(4) (GPU only) auto', + () => { + testArray3D4(); + } +); + +(GPU.isSinglePrecisionSupported ? test : skip)( + 'Array3D(4) (GPU only) gpu', + () => { + testArray3D4('gpu'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'Array3D(4) (GPU only) webgl', + () => { + testArray3D4('webgl'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'Array3D(4) (GPU only) webgl2', + () => { + testArray3D4('webgl2'); + } +); + +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'Array3D(4) (GPU only) headlessgl', + () => { + testArray3D4('headlessgl'); + } +); diff --git a/test/internal/context-inheritance.js b/test/internal/context-inheritance.js index d3abce23..d3af92b4 100644 --- a/test/internal/context-inheritance.js +++ b/test/internal/context-inheritance.js @@ -1,5 +1,10 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU, WebGLKernel, WebGL2Kernel, HeadlessGLKernel } = require('../../src'); +const { + GPU, + WebGLKernel, + WebGL2Kernel, + HeadlessGLKernel, +} = require('../../src'); describe('internal: context inheritance'); diff --git a/test/internal/deep-types.js b/test/internal/deep-types.js index 9afaee96..746fd94c 100644 --- a/test/internal/deep-types.js +++ b/test/internal/deep-types.js @@ -23,7 +23,10 @@ function oneLayerDeepFloat(mode) { const result = kernel(1.5); assert.equal(result[0], 2.5); assert.equal(FunctionBuilder.prototype.lookupReturnType.callCount, 1); - assert.equal(FunctionBuilder.prototype.lookupReturnType.args[0][0], 'childFunction'); + assert.equal( + FunctionBuilder.prototype.lookupReturnType.args[0][0], + 'childFunction' + ); } finally { FunctionBuilder.prototype.lookupReturnType.restore(); } @@ -35,9 +38,12 @@ function oneLayerDeepFloat(mode) { (GPU.isWebGL2Supported ? test : skip)('one layer deep float WebGL2', () => { oneLayerDeepFloat('webgl2'); }); -(GPU.isHeadlessGLSupported ? test : skip)('one layer deep float HeadlessGL', () => { - oneLayerDeepFloat('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'one layer deep float HeadlessGL', + () => { + oneLayerDeepFloat('headlessgl'); + } +); function twoLayerDeepFloat(mode) { const gpu = new GPU({ mode }); @@ -61,9 +67,18 @@ function twoLayerDeepFloat(mode) { const result = kernel(1.5); assert.equal(result[0], 2.5); assert.equal(FunctionBuilder.prototype.lookupReturnType.callCount, 3); - assert.equal(FunctionBuilder.prototype.lookupReturnType.args[0][0], 'child1Function'); - assert.equal(FunctionBuilder.prototype.lookupReturnType.args[1][0], 'child2Function'); - assert.equal(FunctionBuilder.prototype.lookupReturnType.args[2][0], 'child2Function'); + assert.equal( + FunctionBuilder.prototype.lookupReturnType.args[0][0], + 'child1Function' + ); + assert.equal( + FunctionBuilder.prototype.lookupReturnType.args[1][0], + 'child2Function' + ); + assert.equal( + FunctionBuilder.prototype.lookupReturnType.args[2][0], + 'child2Function' + ); } finally { FunctionBuilder.prototype.lookupReturnType.restore(); } @@ -75,9 +90,12 @@ function twoLayerDeepFloat(mode) { (GPU.isWebGL2Supported ? test : skip)('two layer deep float WebGL2', () => { twoLayerDeepFloat('webgl2'); }); -(GPU.isHeadlessGLSupported ? test : skip)('two layer deep float HeadlessGL', () => { - twoLayerDeepFloat('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'two layer deep float HeadlessGL', + () => { + twoLayerDeepFloat('headlessgl'); + } +); function twoArgumentLayerDeepFloat(mode) { const gpu = new GPU({ mode }); @@ -102,23 +120,41 @@ function twoArgumentLayerDeepFloat(mode) { assert.equal(kernel.returnType, 'Float'); assert.equal(result[0], 3.5); assert.equal(FunctionBuilder.prototype.lookupReturnType.callCount, 3); - assert.equal(FunctionBuilder.prototype.lookupReturnType.args[0][0], 'child2Function'); - assert.equal(FunctionBuilder.prototype.lookupReturnType.args[1][0], 'child1Function'); - assert.equal(FunctionBuilder.prototype.lookupReturnType.args[2][0], 'child2Function'); + assert.equal( + FunctionBuilder.prototype.lookupReturnType.args[0][0], + 'child2Function' + ); + assert.equal( + FunctionBuilder.prototype.lookupReturnType.args[1][0], + 'child1Function' + ); + assert.equal( + FunctionBuilder.prototype.lookupReturnType.args[2][0], + 'child2Function' + ); } finally { FunctionBuilder.prototype.lookupReturnType.restore(); } } -(GPU.isWebGLSupported ? test : skip)('two argument layer deep float WebGL', () => { - twoArgumentLayerDeepFloat('webgl'); -}); -(GPU.isWebGL2Supported ? test : skip)('two argument layer deep float WebGL2', () => { - twoArgumentLayerDeepFloat('webgl2'); -}); -(GPU.isHeadlessGLSupported ? test : skip)('two argument layer deep float HeadlessGL', () => { - twoArgumentLayerDeepFloat('headlessgl'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'two argument layer deep float WebGL', + () => { + twoArgumentLayerDeepFloat('webgl'); + } +); +(GPU.isWebGL2Supported ? test : skip)( + 'two argument layer deep float WebGL2', + () => { + twoArgumentLayerDeepFloat('webgl2'); + } +); +(GPU.isHeadlessGLSupported ? test : skip)( + 'two argument layer deep float HeadlessGL', + () => { + twoArgumentLayerDeepFloat('headlessgl'); + } +); function threeLayerDeepFloat(mode) { const gpu = new GPU({ mode }); @@ -134,7 +170,10 @@ function threeLayerDeepFloat(mode) { function child3Function(child3FunctionArgument1) { return child3FunctionArgument1 + 1; } - gpu.addFunction(child1Function).addFunction(child2Function).addFunction(child3Function); + gpu + .addFunction(child1Function) + .addFunction(child2Function) + .addFunction(child3Function); const kernel = gpu.createKernel( function (kernelArgument1) { return child1Function(kernelArgument1); @@ -146,11 +185,26 @@ function threeLayerDeepFloat(mode) { const result = kernel(1.5); assert.equal(result[0], 3.5); assert.equal(FunctionBuilder.prototype.lookupReturnType.callCount, 5); - assert.equal(FunctionBuilder.prototype.lookupReturnType.args[0][0], 'child1Function'); - assert.equal(FunctionBuilder.prototype.lookupReturnType.args[1][0], 'child2Function'); - assert.equal(FunctionBuilder.prototype.lookupReturnType.args[2][0], 'child3Function'); - assert.equal(FunctionBuilder.prototype.lookupReturnType.args[3][0], 'child2Function'); - assert.equal(FunctionBuilder.prototype.lookupReturnType.args[4][0], 'child3Function'); + assert.equal( + FunctionBuilder.prototype.lookupReturnType.args[0][0], + 'child1Function' + ); + assert.equal( + FunctionBuilder.prototype.lookupReturnType.args[1][0], + 'child2Function' + ); + assert.equal( + FunctionBuilder.prototype.lookupReturnType.args[2][0], + 'child3Function' + ); + assert.equal( + FunctionBuilder.prototype.lookupReturnType.args[3][0], + 'child2Function' + ); + assert.equal( + FunctionBuilder.prototype.lookupReturnType.args[4][0], + 'child3Function' + ); } finally { FunctionBuilder.prototype.lookupReturnType.restore(); } @@ -162,9 +216,12 @@ function threeLayerDeepFloat(mode) { (GPU.isWebGL2Supported ? test : skip)('three layer deep float WebGL2', () => { threeLayerDeepFloat('webgl2'); }); -(GPU.isHeadlessGLSupported ? test : skip)('three layer deep float HeadlessGL', () => { - threeLayerDeepFloat('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'three layer deep float HeadlessGL', + () => { + threeLayerDeepFloat('headlessgl'); + } +); function threeArgumentLayerDeepFloat(mode) { const gpu = new GPU({ mode }); @@ -180,7 +237,10 @@ function threeArgumentLayerDeepFloat(mode) { function child3Function(child3FunctionArgument1) { return child3FunctionArgument1 + 1; } - gpu.addFunction(child1Function).addFunction(child2Function).addFunction(child3Function); + gpu + .addFunction(child1Function) + .addFunction(child2Function) + .addFunction(child3Function); const kernel = gpu.createKernel( function (kernelArgument1) { return child1Function(child2Function(child3Function(kernelArgument1))); @@ -192,25 +252,49 @@ function threeArgumentLayerDeepFloat(mode) { const result = kernel(1.5); assert.equal(result[0], 4.5); assert.equal(FunctionBuilder.prototype.lookupReturnType.callCount, 5); - assert.equal(FunctionBuilder.prototype.lookupReturnType.args[0][0], 'child3Function'); - assert.equal(FunctionBuilder.prototype.lookupReturnType.args[1][0], 'child2Function'); - assert.equal(FunctionBuilder.prototype.lookupReturnType.args[2][0], 'child1Function'); - assert.equal(FunctionBuilder.prototype.lookupReturnType.args[3][0], 'child2Function'); - assert.equal(FunctionBuilder.prototype.lookupReturnType.args[4][0], 'child3Function'); + assert.equal( + FunctionBuilder.prototype.lookupReturnType.args[0][0], + 'child3Function' + ); + assert.equal( + FunctionBuilder.prototype.lookupReturnType.args[1][0], + 'child2Function' + ); + assert.equal( + FunctionBuilder.prototype.lookupReturnType.args[2][0], + 'child1Function' + ); + assert.equal( + FunctionBuilder.prototype.lookupReturnType.args[3][0], + 'child2Function' + ); + assert.equal( + FunctionBuilder.prototype.lookupReturnType.args[4][0], + 'child3Function' + ); } finally { FunctionBuilder.prototype.lookupReturnType.restore(); } } -(GPU.isWebGLSupported ? test : skip)('three argument layer deep float WebGL', () => { - threeArgumentLayerDeepFloat('webgl'); -}); -(GPU.isWebGL2Supported ? test : skip)('three argument layer deep float WebGL2', () => { - threeArgumentLayerDeepFloat('webgl2'); -}); -(GPU.isHeadlessGLSupported ? test : skip)('three argument layer deep float HeadlessGL', () => { - threeArgumentLayerDeepFloat('headlessgl'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'three argument layer deep float WebGL', + () => { + threeArgumentLayerDeepFloat('webgl'); + } +); +(GPU.isWebGL2Supported ? test : skip)( + 'three argument layer deep float WebGL2', + () => { + threeArgumentLayerDeepFloat('webgl2'); + } +); +(GPU.isHeadlessGLSupported ? test : skip)( + 'three argument layer deep float HeadlessGL', + () => { + threeArgumentLayerDeepFloat('headlessgl'); + } +); function threeArgumentLayerDeepNumberTexture1(mode) { const gpu = new GPU({ mode }); @@ -232,7 +316,10 @@ function threeArgumentLayerDeepNumberTexture1(mode) { function child3Function(child3FunctionArgument1) { return child3FunctionArgument1[this.thread.x] + 1; } - gpu.addFunction(child1Function).addFunction(child2Function).addFunction(child3Function); + gpu + .addFunction(child1Function) + .addFunction(child2Function) + .addFunction(child3Function); const kernel = gpu.createKernel( function (kernelArgument1) { return child1Function(child2Function(child3Function(kernelArgument1))); @@ -244,25 +331,49 @@ function threeArgumentLayerDeepNumberTexture1(mode) { const result = kernel(texture); assert.equal(result[0], 4.5); assert.equal(FunctionBuilder.prototype.lookupReturnType.callCount, 5); - assert.equal(FunctionBuilder.prototype.lookupReturnType.args[0][0], 'child3Function'); - assert.equal(FunctionBuilder.prototype.lookupReturnType.args[1][0], 'child2Function'); - assert.equal(FunctionBuilder.prototype.lookupReturnType.args[2][0], 'child1Function'); - assert.equal(FunctionBuilder.prototype.lookupReturnType.args[3][0], 'child2Function'); - assert.equal(FunctionBuilder.prototype.lookupReturnType.args[4][0], 'child3Function'); + assert.equal( + FunctionBuilder.prototype.lookupReturnType.args[0][0], + 'child3Function' + ); + assert.equal( + FunctionBuilder.prototype.lookupReturnType.args[1][0], + 'child2Function' + ); + assert.equal( + FunctionBuilder.prototype.lookupReturnType.args[2][0], + 'child1Function' + ); + assert.equal( + FunctionBuilder.prototype.lookupReturnType.args[3][0], + 'child2Function' + ); + assert.equal( + FunctionBuilder.prototype.lookupReturnType.args[4][0], + 'child3Function' + ); } finally { FunctionBuilder.prototype.lookupReturnType.restore(); } } -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('three argument layer deep NumberTexture(1) WebGL', () => { - threeArgumentLayerDeepNumberTexture1('webgl'); -}); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('three argument layer deep NumberTexture(1) WebGL2', () => { - threeArgumentLayerDeepNumberTexture1('webgl2'); -}); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('three argument layer deep NumberTexture(1) HeadlessGL', () => { - threeArgumentLayerDeepNumberTexture1('headlessgl'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'three argument layer deep NumberTexture(1) WebGL', + () => { + threeArgumentLayerDeepNumberTexture1('webgl'); + } +); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'three argument layer deep NumberTexture(1) WebGL2', + () => { + threeArgumentLayerDeepNumberTexture1('webgl2'); + } +); +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'three argument layer deep NumberTexture(1) HeadlessGL', + () => { + threeArgumentLayerDeepNumberTexture1('headlessgl'); + } +); function circlicalLogic(mode) { const gpu = new GPU({ mode }); @@ -330,15 +441,24 @@ function arrayTexture1(mode) { (GPU.isSinglePrecisionSupported ? test : skip)('ArrayTexture(1) gpu', () => { arrayTexture1('gpu'); }); -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('ArrayTexture(1) webgl', () => { - arrayTexture1('webgl'); -}); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('ArrayTexture(1) webgl2', () => { - arrayTexture1('webgl2'); -}); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('ArrayTexture(1) headlessgl', () => { - arrayTexture1('headlessgl'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'ArrayTexture(1) webgl', + () => { + arrayTexture1('webgl'); + } +); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'ArrayTexture(1) webgl2', + () => { + arrayTexture1('webgl2'); + } +); +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'ArrayTexture(1) headlessgl', + () => { + arrayTexture1('headlessgl'); + } +); (GPU.isSinglePrecisionSupported ? test : skip)('ArrayTexture(1) cpu', () => { arrayTexture1('cpu'); }); @@ -382,15 +502,24 @@ function arrayTexture2(mode) { (GPU.isSinglePrecisionSupported ? test : skip)('ArrayTexture(2) gpu', () => { arrayTexture2('gpu'); }); -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('ArrayTexture(2) webgl', () => { - arrayTexture2('webgl'); -}); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('ArrayTexture(2) webgl2', () => { - arrayTexture2('webgl2'); -}); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('ArrayTexture(2) headlessgl', () => { - arrayTexture2('headlessgl'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'ArrayTexture(2) webgl', + () => { + arrayTexture2('webgl'); + } +); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'ArrayTexture(2) webgl2', + () => { + arrayTexture2('webgl2'); + } +); +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'ArrayTexture(2) headlessgl', + () => { + arrayTexture2('headlessgl'); + } +); (GPU.isSinglePrecisionSupported ? test : skip)('ArrayTexture(2) cpu', () => { arrayTexture2('cpu'); }); @@ -434,15 +563,24 @@ function arrayTexture3(mode) { (GPU.isSinglePrecisionSupported ? test : skip)('ArrayTexture(3) gpu', () => { arrayTexture3('gpu'); }); -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('ArrayTexture(3) webgl', () => { - arrayTexture3('webgl'); -}); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('ArrayTexture(3) webgl2', () => { - arrayTexture3('webgl2'); -}); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('ArrayTexture(3) headlessgl', () => { - arrayTexture3('headlessgl'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'ArrayTexture(3) webgl', + () => { + arrayTexture3('webgl'); + } +); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'ArrayTexture(3) webgl2', + () => { + arrayTexture3('webgl2'); + } +); +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'ArrayTexture(3) headlessgl', + () => { + arrayTexture3('headlessgl'); + } +); (GPU.isSinglePrecisionSupported ? test : skip)('ArrayTexture(3) cpu', () => { arrayTexture3('cpu'); }); @@ -452,7 +590,16 @@ function arrayTexture4(mode) { function addOne(functionValue) { const declaredValue = functionValue[this.thread.x]; - return declaredValue[0] + 1 + declaredValue[1] + 1 + declaredValue[2] + 1 + declaredValue[3] + 1; + return ( + declaredValue[0] + + 1 + + declaredValue[1] + + 1 + + declaredValue[2] + + 1 + + declaredValue[3] + + 1 + ); } gpu.addFunction(addOne); const texture1 = gpu.createKernel( @@ -486,15 +633,24 @@ function arrayTexture4(mode) { (GPU.isSinglePrecisionSupported ? test : skip)('ArrayTexture(4) gpu', () => { arrayTexture4('gpu'); }); -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('ArrayTexture(4) webgl', () => { - arrayTexture4('webgl'); -}); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('ArrayTexture(4) webgl2', () => { - arrayTexture4('webgl2'); -}); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('ArrayTexture(4) headlessgl', () => { - arrayTexture4('headlessgl'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'ArrayTexture(4) webgl', + () => { + arrayTexture4('webgl'); + } +); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'ArrayTexture(4) webgl2', + () => { + arrayTexture4('webgl2'); + } +); +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'ArrayTexture(4) headlessgl', + () => { + arrayTexture4('headlessgl'); + } +); (GPU.isSinglePrecisionSupported ? test : skip)('ArrayTexture(4) cpu', () => { arrayTexture4('cpu'); }); @@ -511,13 +667,20 @@ function testTortureTest(mode) { } function addArrayArray(addArrayArrayArgument1, addArrayArrayArgument2) { - return addArrayArrayArgument1[this.thread.x] + addArrayArrayArgument2[this.thread.x]; + return ( + addArrayArrayArgument1[this.thread.x] + + addArrayArrayArgument2[this.thread.x] + ); } function addFloatFloat(addFloatFloatArgument1, addFloatFloatArgument2) { return addFloatFloatArgument1 + addFloatFloatArgument2; } - gpu.addFunction(addFloatArray).addFunction(addArrayFloat).addFunction(addArrayArray).addFunction(addFloatFloat); + gpu + .addFunction(addFloatArray) + .addFunction(addArrayFloat) + .addFunction(addArrayArray) + .addFunction(addFloatFloat); const texture = gpu.createKernel( function () { @@ -531,7 +694,10 @@ function testTortureTest(mode) { try { const kernel = gpu.createKernel( function (v1, v2, v3, v4, v5) { - return addFloatFloat(v4, addArrayFloat(v3, addFloatArray(addArrayArray(v1, v5), v2))); + return addFloatFloat( + v4, + addArrayFloat(v3, addFloatArray(addArrayArray(v1, v5), v2)) + ); }, { output: [1] } ); @@ -539,21 +705,66 @@ function testTortureTest(mode) { const result = kernel([1], texture, [3], 4, new Float32Array([5])); assert.equal(result[0], 1 + 2 + 3 + 4 + 5); assert.equal(FunctionBuilder.prototype.lookupReturnType.callCount, 7); - assert.equal(FunctionBuilder.prototype.lookupReturnType.returnValues.length, 7); - assert.equal(FunctionBuilder.prototype.lookupReturnType.args[0][0], 'addArrayArray'); - assert.equal(FunctionBuilder.prototype.lookupReturnType.returnValues[0], 'Number'); - assert.equal(FunctionBuilder.prototype.lookupReturnType.args[1][0], 'addFloatArray'); - assert.equal(FunctionBuilder.prototype.lookupReturnType.returnValues[1], 'Number'); - assert.equal(FunctionBuilder.prototype.lookupReturnType.args[2][0], 'addArrayFloat'); - assert.equal(FunctionBuilder.prototype.lookupReturnType.returnValues[2], 'Number'); - assert.equal(FunctionBuilder.prototype.lookupReturnType.args[3][0], 'addFloatFloat'); - assert.equal(FunctionBuilder.prototype.lookupReturnType.returnValues[3], 'Float'); - assert.equal(FunctionBuilder.prototype.lookupReturnType.args[4][0], 'addArrayFloat'); - assert.equal(FunctionBuilder.prototype.lookupReturnType.returnValues[4], 'Number'); - assert.equal(FunctionBuilder.prototype.lookupReturnType.args[5][0], 'addFloatArray'); - assert.equal(FunctionBuilder.prototype.lookupReturnType.returnValues[5], 'Number'); - assert.equal(FunctionBuilder.prototype.lookupReturnType.args[6][0], 'addArrayArray'); - assert.equal(FunctionBuilder.prototype.lookupReturnType.returnValues[6], 'Number'); + assert.equal( + FunctionBuilder.prototype.lookupReturnType.returnValues.length, + 7 + ); + assert.equal( + FunctionBuilder.prototype.lookupReturnType.args[0][0], + 'addArrayArray' + ); + assert.equal( + FunctionBuilder.prototype.lookupReturnType.returnValues[0], + 'Number' + ); + assert.equal( + FunctionBuilder.prototype.lookupReturnType.args[1][0], + 'addFloatArray' + ); + assert.equal( + FunctionBuilder.prototype.lookupReturnType.returnValues[1], + 'Number' + ); + assert.equal( + FunctionBuilder.prototype.lookupReturnType.args[2][0], + 'addArrayFloat' + ); + assert.equal( + FunctionBuilder.prototype.lookupReturnType.returnValues[2], + 'Number' + ); + assert.equal( + FunctionBuilder.prototype.lookupReturnType.args[3][0], + 'addFloatFloat' + ); + assert.equal( + FunctionBuilder.prototype.lookupReturnType.returnValues[3], + 'Float' + ); + assert.equal( + FunctionBuilder.prototype.lookupReturnType.args[4][0], + 'addArrayFloat' + ); + assert.equal( + FunctionBuilder.prototype.lookupReturnType.returnValues[4], + 'Number' + ); + assert.equal( + FunctionBuilder.prototype.lookupReturnType.args[5][0], + 'addFloatArray' + ); + assert.equal( + FunctionBuilder.prototype.lookupReturnType.returnValues[5], + 'Number' + ); + assert.equal( + FunctionBuilder.prototype.lookupReturnType.args[6][0], + 'addArrayArray' + ); + assert.equal( + FunctionBuilder.prototype.lookupReturnType.returnValues[6], + 'Number' + ); } finally { FunctionBuilder.prototype.lookupReturnType.restore(); } @@ -567,17 +778,26 @@ function testTortureTest(mode) { testTortureTest('gpu'); }); -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('torture test webgl', () => { - testTortureTest('webgl'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'torture test webgl', + () => { + testTortureTest('webgl'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('torture test webgl2', () => { - testTortureTest('webgl2'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'torture test webgl2', + () => { + testTortureTest('webgl2'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('torture test headlessgl', () => { - testTortureTest('headlessgl'); -}); +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'torture test headlessgl', + () => { + testTortureTest('headlessgl'); + } +); test('torture test cpu', () => { testTortureTest('cpu'); diff --git a/test/internal/different-texture-cloning.js b/test/internal/different-texture-cloning.js index 34135312..e908293a 100644 --- a/test/internal/different-texture-cloning.js +++ b/test/internal/different-texture-cloning.js @@ -24,7 +24,9 @@ function testArrayThenArray1D4(mode) { const array4TextureClone = array4Texture.clone(); assert.notEqual(arrayTextureClone, array4TextureClone); assert.deepEqual(arrayTextureClone.toArray(), new Float32Array([1])); - assert.deepEqual(array4TextureClone.toArray(), [new Float32Array([1, 2, 3, 4])]); + assert.deepEqual(array4TextureClone.toArray(), [ + new Float32Array([1, 2, 3, 4]), + ]); gpu.destroy(); } @@ -40,9 +42,12 @@ test('Array then Array1D(4) auto', () => { testArrayThenArray1D4('webgl2'); }); -(GPU.isHeadlessGLSupported ? test : skip)('Array then Array1D(4) headlessgl', () => { - testArrayThenArray1D4('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'Array then Array1D(4) headlessgl', + () => { + testArrayThenArray1D4('headlessgl'); + } +); function testArray1D4ThenArray(mode) { const gpu = new GPU({ mode }); @@ -64,7 +69,9 @@ function testArray1D4ThenArray(mode) { const arrayTexture = createTextureOf([1], 'Array'); const arrayTextureClone = arrayTexture.clone(); assert.notEqual(array4TextureClone, arrayTextureClone); - assert.deepEqual(array4TextureClone.toArray(), [new Float32Array([1, 2, 3, 4])]); + assert.deepEqual(array4TextureClone.toArray(), [ + new Float32Array([1, 2, 3, 4]), + ]); assert.deepEqual(arrayTextureClone.toArray(), new Float32Array([1])); gpu.destroy(); } @@ -81,6 +88,9 @@ test('Array1D(4) then Array auto', () => { testArray1D4ThenArray('webgl2'); }); -(GPU.isHeadlessGLSupported ? test : skip)('Array1D(4) then Array headlessgl', () => { - testArray1D4ThenArray('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'Array1D(4) then Array headlessgl', + () => { + testArray1D4ThenArray('headlessgl'); + } +); diff --git a/test/internal/function-builder.js b/test/internal/function-builder.js index 1068cf06..ab06a79a 100644 --- a/test/internal/function-builder.js +++ b/test/internal/function-builder.js @@ -1,5 +1,10 @@ const { assert, test, module: describe, only } = require('qunit'); -const { FunctionBuilder, CPUFunctionNode, WebGL2FunctionNode, WebGLFunctionNode } = require('../../src'); +const { + FunctionBuilder, + CPUFunctionNode, + WebGL2FunctionNode, + WebGLFunctionNode, +} = require('../../src'); describe('internal: function builder'); @@ -44,48 +49,105 @@ function threeLayerTemplate(FunctionNode) { test('traceFunctionCalls: 3 layer test cpu', () => { const builder = threeLayerTemplate(CPUFunctionNode); assert.deepEqual(builder.traceFunctionCalls('layerOne'), ['layerOne']); - assert.deepEqual(builder.traceFunctionCalls('layerTwo'), ['layerTwo', 'layerOne']); - assert.deepEqual(builder.traceFunctionCalls('layerThree'), ['layerThree', 'layerTwo', 'layerOne']); + assert.deepEqual(builder.traceFunctionCalls('layerTwo'), [ + 'layerTwo', + 'layerOne', + ]); + assert.deepEqual(builder.traceFunctionCalls('layerThree'), [ + 'layerThree', + 'layerTwo', + 'layerOne', + ]); }); test('traceFunctionCalls: 3 layer test webgl', () => { const builder = threeLayerTemplate(WebGLFunctionNode); assert.deepEqual(builder.traceFunctionCalls('layerOne'), ['layerOne']); - assert.deepEqual(builder.traceFunctionCalls('layerTwo'), ['layerTwo', 'layerOne']); - assert.deepEqual(builder.traceFunctionCalls('layerThree'), ['layerThree', 'layerTwo', 'layerOne']); + assert.deepEqual(builder.traceFunctionCalls('layerTwo'), [ + 'layerTwo', + 'layerOne', + ]); + assert.deepEqual(builder.traceFunctionCalls('layerThree'), [ + 'layerThree', + 'layerTwo', + 'layerOne', + ]); }); test('traceFunctionCalls: 3 layer test webgl2', () => { const builder = threeLayerTemplate(WebGL2FunctionNode); assert.deepEqual(builder.traceFunctionCalls('layerOne'), ['layerOne']); - assert.deepEqual(builder.traceFunctionCalls('layerTwo'), ['layerTwo', 'layerOne']); - assert.deepEqual(builder.traceFunctionCalls('layerThree'), ['layerThree', 'layerTwo', 'layerOne']); + assert.deepEqual(builder.traceFunctionCalls('layerTwo'), [ + 'layerTwo', + 'layerOne', + ]); + assert.deepEqual(builder.traceFunctionCalls('layerThree'), [ + 'layerThree', + 'layerTwo', + 'layerOne', + ]); }); /// Test the function tracing of 3 layers test('webglString: 3 layer test cpu', () => { const builder = threeLayerTemplate(CPUFunctionNode); - assert.equal(builder.getStringFromFunctionNames(['layerOne']), 'function layerOne() {\nreturn 42;\n}'); - assert.equal(builder.getString('layerOne'), builder.getStringFromFunctionNames(['layerOne'])); - - assert.equal(builder.getStringFromFunctionNames(['layerOne', 'layerTwo']), 'function layerOne() {\nreturn 42;\n}\nfunction layerTwo() {\nreturn (layerOne()*2);\n}'); - assert.equal(builder.getString('layerTwo'), builder.getStringFromFunctionNames(['layerOne', 'layerTwo'])); - - assert.equal(builder.getStringFromFunctionNames(['layerOne', 'layerTwo', 'layerThree']), 'function layerOne() {\nreturn 42;\n}\nfunction layerTwo() {\nreturn (layerOne()*2);\n}\nfunction layerThree() {\nreturn (layerTwo()*2);\n}'); - assert.equal(builder.getString('layerThree'), builder.getStringFromFunctionNames(['layerOne', 'layerTwo', 'layerThree'])); + assert.equal( + builder.getStringFromFunctionNames(['layerOne']), + 'function layerOne() {\nreturn 42;\n}' + ); + assert.equal( + builder.getString('layerOne'), + builder.getStringFromFunctionNames(['layerOne']) + ); + + assert.equal( + builder.getStringFromFunctionNames(['layerOne', 'layerTwo']), + 'function layerOne() {\nreturn 42;\n}\nfunction layerTwo() {\nreturn (layerOne()*2);\n}' + ); + assert.equal( + builder.getString('layerTwo'), + builder.getStringFromFunctionNames(['layerOne', 'layerTwo']) + ); + + assert.equal( + builder.getStringFromFunctionNames(['layerOne', 'layerTwo', 'layerThree']), + 'function layerOne() {\nreturn 42;\n}\nfunction layerTwo() {\nreturn (layerOne()*2);\n}\nfunction layerThree() {\nreturn (layerTwo()*2);\n}' + ); + assert.equal( + builder.getString('layerThree'), + builder.getStringFromFunctionNames(['layerOne', 'layerTwo', 'layerThree']) + ); assert.equal(builder.getString(null), builder.getString('layerThree')); }); test('webglString: 3 layer test webgl', () => { const builder = threeLayerTemplate(WebGLFunctionNode); - assert.equal(builder.getStringFromFunctionNames(['layerOne']), 'float layerOne() {\nreturn 42.0;\n}'); - assert.equal(builder.getString('layerOne'), builder.getStringFromFunctionNames(['layerOne'])); - - assert.equal(builder.getStringFromFunctionNames(['layerOne', 'layerTwo']), 'float layerOne() {\nreturn 42.0;\n}\nfloat layerTwo() {\nreturn (layerOne()*2.0);\n}'); - assert.equal(builder.getString('layerTwo'), builder.getStringFromFunctionNames(['layerOne', 'layerTwo'])); - - assert.equal(builder.getStringFromFunctionNames(['layerOne', 'layerTwo', 'layerThree']), 'float layerOne() {\nreturn 42.0;\n}\nfloat layerTwo() {\nreturn (layerOne()*2.0);\n}\nfloat layerThree() {\nreturn (layerTwo()*2.0);\n}'); - assert.equal(builder.getString('layerThree'), builder.getStringFromFunctionNames(['layerOne', 'layerTwo', 'layerThree'])); + assert.equal( + builder.getStringFromFunctionNames(['layerOne']), + 'float layerOne() {\nreturn 42.0;\n}' + ); + assert.equal( + builder.getString('layerOne'), + builder.getStringFromFunctionNames(['layerOne']) + ); + + assert.equal( + builder.getStringFromFunctionNames(['layerOne', 'layerTwo']), + 'float layerOne() {\nreturn 42.0;\n}\nfloat layerTwo() {\nreturn (layerOne()*2.0);\n}' + ); + assert.equal( + builder.getString('layerTwo'), + builder.getStringFromFunctionNames(['layerOne', 'layerTwo']) + ); + + assert.equal( + builder.getStringFromFunctionNames(['layerOne', 'layerTwo', 'layerThree']), + 'float layerOne() {\nreturn 42.0;\n}\nfloat layerTwo() {\nreturn (layerOne()*2.0);\n}\nfloat layerThree() {\nreturn (layerTwo()*2.0);\n}' + ); + assert.equal( + builder.getString('layerThree'), + builder.getStringFromFunctionNames(['layerOne', 'layerTwo', 'layerThree']) + ); assert.equal(builder.getString(null), builder.getString('layerThree')); }); @@ -93,13 +155,31 @@ test('webglString: 3 layer test webgl2', () => { const builder = threeLayerTemplate(WebGL2FunctionNode); assert.notEqual(builder, null, 'class creation check'); - assert.equal(builder.getStringFromFunctionNames(['layerOne']), 'float layerOne() {\nreturn 42.0;\n}'); - assert.equal(builder.getString('layerOne'), builder.getStringFromFunctionNames(['layerOne'])); - - assert.equal(builder.getStringFromFunctionNames(['layerOne', 'layerTwo']), 'float layerOne() {\nreturn 42.0;\n}\nfloat layerTwo() {\nreturn (layerOne()*2.0);\n}'); - assert.equal(builder.getString('layerTwo'), builder.getStringFromFunctionNames(['layerOne', 'layerTwo'])); - - assert.equal(builder.getStringFromFunctionNames(['layerOne', 'layerTwo', 'layerThree']), 'float layerOne() {\nreturn 42.0;\n}\nfloat layerTwo() {\nreturn (layerOne()*2.0);\n}\nfloat layerThree() {\nreturn (layerTwo()*2.0);\n}'); - assert.equal(builder.getString('layerThree'), builder.getStringFromFunctionNames(['layerOne', 'layerTwo', 'layerThree'])); + assert.equal( + builder.getStringFromFunctionNames(['layerOne']), + 'float layerOne() {\nreturn 42.0;\n}' + ); + assert.equal( + builder.getString('layerOne'), + builder.getStringFromFunctionNames(['layerOne']) + ); + + assert.equal( + builder.getStringFromFunctionNames(['layerOne', 'layerTwo']), + 'float layerOne() {\nreturn 42.0;\n}\nfloat layerTwo() {\nreturn (layerOne()*2.0);\n}' + ); + assert.equal( + builder.getString('layerTwo'), + builder.getStringFromFunctionNames(['layerOne', 'layerTwo']) + ); + + assert.equal( + builder.getStringFromFunctionNames(['layerOne', 'layerTwo', 'layerThree']), + 'float layerOne() {\nreturn 42.0;\n}\nfloat layerTwo() {\nreturn (layerOne()*2.0);\n}\nfloat layerThree() {\nreturn (layerTwo()*2.0);\n}' + ); + assert.equal( + builder.getString('layerThree'), + builder.getStringFromFunctionNames(['layerOne', 'layerTwo', 'layerThree']) + ); assert.equal(builder.getString(null), builder.getString('layerThree')); }); diff --git a/test/internal/function-composition.js b/test/internal/function-composition.js index 9831793f..c21f15a7 100644 --- a/test/internal/function-composition.js +++ b/test/internal/function-composition.js @@ -1,6 +1,12 @@ const { assert, test, skip, module: describe, only } = require('qunit'); const sinon = require('sinon'); -const { CPUFunctionNode, FunctionBuilder, GPU, WebGL2FunctionNode, WebGLFunctionNode } = require('../../src'); +const { + CPUFunctionNode, + FunctionBuilder, + GPU, + WebGL2FunctionNode, + WebGLFunctionNode, +} = require('../../src'); describe('internal: function composition return values'); @@ -18,22 +24,40 @@ function functionCompositionReturnValuesTest(mode) { } test('auto', () => { - assert.deepEqual(Array.from(functionCompositionReturnValuesTest()), [5, 5, 5, 5]); + assert.deepEqual( + Array.from(functionCompositionReturnValuesTest()), + [5, 5, 5, 5] + ); }); test('gpu', () => { - assert.deepEqual(Array.from(functionCompositionReturnValuesTest('gpu')), [5, 5, 5, 5]); + assert.deepEqual( + Array.from(functionCompositionReturnValuesTest('gpu')), + [5, 5, 5, 5] + ); }); (GPU.isWebGLSupported ? test : skip)('webgl', () => { - assert.deepEqual(Array.from(functionCompositionReturnValuesTest('webgl')), [5, 5, 5, 5]); + assert.deepEqual( + Array.from(functionCompositionReturnValuesTest('webgl')), + [5, 5, 5, 5] + ); }); (GPU.isWebGL2Supported ? test : skip)('webgl2', () => { - assert.deepEqual(Array.from(functionCompositionReturnValuesTest('webgl2')), [5, 5, 5, 5]); + assert.deepEqual( + Array.from(functionCompositionReturnValuesTest('webgl2')), + [5, 5, 5, 5] + ); }); (GPU.isHeadlessGLSupported ? test : skip)('headlessgl', () => { - assert.deepEqual(Array.from(functionCompositionReturnValuesTest('headlessgl')), [5, 5, 5, 5]); + assert.deepEqual( + Array.from(functionCompositionReturnValuesTest('headlessgl')), + [5, 5, 5, 5] + ); }); test('cpu', () => { - assert.deepEqual(Array.from(functionCompositionReturnValuesTest('cpu')), [5, 5, 5, 5]); + assert.deepEqual( + Array.from(functionCompositionReturnValuesTest('cpu')), + [5, 5, 5, 5] + ); }); describe('internal: function composition FunctionNode'); @@ -60,13 +84,22 @@ function functionCompositionFunctionNode(FunctionNode) { } test('CPUFunctionNode', () => { - assert.equal(functionCompositionFunctionNode(CPUFunctionNode), 'function kernel() {' + '\n' + '\nreturn inner();' + '\n}'); + assert.equal( + functionCompositionFunctionNode(CPUFunctionNode), + 'function kernel() {' + '\n' + '\nreturn inner();' + '\n}' + ); }); test('WebGLFunctionNode', () => { - assert.equal(functionCompositionFunctionNode(WebGLFunctionNode), 'float kernel() {' + '\n' + '\nreturn inner();' + '\n}'); + assert.equal( + functionCompositionFunctionNode(WebGLFunctionNode), + 'float kernel() {' + '\n' + '\nreturn inner();' + '\n}' + ); }); test('WebGL2FunctionNode', () => { - assert.equal(functionCompositionFunctionNode(WebGL2FunctionNode), 'float kernel() {' + '\n' + '\nreturn inner();' + '\n}'); + assert.equal( + functionCompositionFunctionNode(WebGL2FunctionNode), + 'float kernel() {' + '\n' + '\nreturn inner();' + '\n}' + ); }); describe('internal: number function composition FunctionBuilder'); @@ -94,13 +127,37 @@ function numberFunctionCompositionFunctionBuilder(FunctionNode) { } test('CPUFunctionNode', () => { - assert.equal(numberFunctionCompositionFunctionBuilder(CPUFunctionNode), 'function inner() {' + '\nreturn 1;' + '\n}' + '\nresultX[x] = inner();\ncontinue;'); + assert.equal( + numberFunctionCompositionFunctionBuilder(CPUFunctionNode), + 'function inner() {' + + '\nreturn 1;' + + '\n}' + + '\nresultX[x] = inner();\ncontinue;' + ); }); test('WebGLFunctionNode', () => { - assert.equal(numberFunctionCompositionFunctionBuilder(WebGLFunctionNode), 'float inner() {' + '\nreturn 1.0;' + '\n}' + '\nvoid kernel() {' + '\n' + '\nkernelResult = inner();return;' + '\n}'); + assert.equal( + numberFunctionCompositionFunctionBuilder(WebGLFunctionNode), + 'float inner() {' + + '\nreturn 1.0;' + + '\n}' + + '\nvoid kernel() {' + + '\n' + + '\nkernelResult = inner();return;' + + '\n}' + ); }); test('WebGL2FunctionNode', () => { - assert.equal(numberFunctionCompositionFunctionBuilder(WebGL2FunctionNode), 'float inner() {' + '\nreturn 1.0;' + '\n}' + '\nvoid kernel() {' + '\n' + '\nkernelResult = inner();return;' + '\n}'); + assert.equal( + numberFunctionCompositionFunctionBuilder(WebGL2FunctionNode), + 'float inner() {' + + '\nreturn 1.0;' + + '\n}' + + '\nvoid kernel() {' + + '\n' + + '\nkernelResult = inner();return;' + + '\n}' + ); }); describe('internal: Array(2) function composition FunctionBuilder'); @@ -128,11 +185,35 @@ function array2FunctionCompositionFunctionBuilder(FunctionNode) { } test('CPUFunctionNode', () => { - assert.equal(array2FunctionCompositionFunctionBuilder(CPUFunctionNode), 'function inner() {' + '\nreturn new Float32Array([1, 2, 3, 4]);' + '\n}' + '\nresultX[x] = inner()[0];\ncontinue;'); + assert.equal( + array2FunctionCompositionFunctionBuilder(CPUFunctionNode), + 'function inner() {' + + '\nreturn new Float32Array([1, 2, 3, 4]);' + + '\n}' + + '\nresultX[x] = inner()[0];\ncontinue;' + ); }); test('WebGLFunctionNode', () => { - assert.equal(array2FunctionCompositionFunctionBuilder(WebGLFunctionNode), 'vec4 inner() {' + '\nreturn vec4(1.0, 2.0, 3.0, 4.0);' + '\n}' + '\nvoid kernel() {' + '\n' + '\nkernelResult = inner()[0];return;' + '\n}'); + assert.equal( + array2FunctionCompositionFunctionBuilder(WebGLFunctionNode), + 'vec4 inner() {' + + '\nreturn vec4(1.0, 2.0, 3.0, 4.0);' + + '\n}' + + '\nvoid kernel() {' + + '\n' + + '\nkernelResult = inner()[0];return;' + + '\n}' + ); }); test('WebGL2FunctionNode', () => { - assert.equal(array2FunctionCompositionFunctionBuilder(WebGL2FunctionNode), 'vec4 inner() {' + '\nreturn vec4(1.0, 2.0, 3.0, 4.0);' + '\n}' + '\nvoid kernel() {' + '\n' + '\nkernelResult = inner()[0];return;' + '\n}'); + assert.equal( + array2FunctionCompositionFunctionBuilder(WebGL2FunctionNode), + 'vec4 inner() {' + + '\nreturn vec4(1.0, 2.0, 3.0, 4.0);' + + '\n}' + + '\nvoid kernel() {' + + '\n' + + '\nkernelResult = inner()[0];return;' + + '\n}' + ); }); diff --git a/test/internal/function-node.js b/test/internal/function-node.js index 74dade81..d5428f96 100644 --- a/test/internal/function-node.js +++ b/test/internal/function-node.js @@ -1,5 +1,9 @@ const { assert, test, module: describe, only } = require('qunit'); -const { CPUFunctionNode, WebGLFunctionNode, WebGL2FunctionNode } = require('../../src'); +const { + CPUFunctionNode, + WebGLFunctionNode, + WebGL2FunctionNode, +} = require('../../src'); describe('internal: function node'); @@ -15,7 +19,11 @@ test('hello_world: just return magic 42 cpu', () => { assert.notEqual(node.getJsAST(), null, 'AST fetch check'); - assert.equal(node.toString(), 'function hello_world() {' + '\nreturn 42;' + '\n}', 'function conversion check'); + assert.equal( + node.toString(), + 'function hello_world() {' + '\nreturn 42;' + '\n}', + 'function conversion check' + ); }); test('hello_world: just return magic 42 webgl', () => { @@ -29,7 +37,11 @@ test('hello_world: just return magic 42 webgl', () => { assert.notEqual(node.getJsAST(), null, 'AST fetch check'); - assert.equal(node.toString(), 'float hello_world() {' + '\nreturn 42.0;' + '\n}', 'function conversion check'); + assert.equal( + node.toString(), + 'float hello_world() {' + '\nreturn 42.0;' + '\n}', + 'function conversion check' + ); }); test('hello_world: just return magic 42 webgl2', () => { @@ -43,7 +55,11 @@ test('hello_world: just return magic 42 webgl2', () => { assert.notEqual(node.getJsAST(), null, 'AST fetch check'); - assert.equal(node.toString(), 'float hello_world() {' + '\nreturn 42.0;' + '\n}', 'function conversion check'); + assert.equal( + node.toString(), + 'float hello_world() {' + '\nreturn 42.0;' + '\n}', + 'function conversion check' + ); }); /// Test creation of function, that calls another function @@ -67,7 +83,11 @@ test('hello_inner: call a function inside a function cpu', () => { assert.notEqual(node.getJsAST(), null, 'AST fetch check'); - assert.equal(node.toString(), 'function hello_inner() {' + '\nreturn inner();' + '\n}', 'function conversion check'); + assert.equal( + node.toString(), + 'function hello_inner() {' + '\nreturn inner();' + '\n}', + 'function conversion check' + ); assert.deepEqual(node.calledFunctions, ['inner']); }); @@ -92,7 +112,11 @@ test('hello_inner: call a function inside a function webgl', () => { assert.notEqual(node.getJsAST(), null, 'AST fetch check'); - assert.equal(node.toString(), 'float hello_inner() {' + '\nreturn inner();' + '\n}', 'function conversion check'); + assert.equal( + node.toString(), + 'float hello_inner() {' + '\nreturn inner();' + '\n}', + 'function conversion check' + ); assert.deepEqual(node.calledFunctions, ['inner']); }); @@ -118,7 +142,11 @@ test('hello_inner: call a function inside a function webgl2', () => { assert.notEqual(node.getJsAST(), null, 'AST fetch check'); - assert.equal(node.toString(), 'float hello_inner() {' + '\nreturn inner();' + '\n}', 'function conversion check'); + assert.equal( + node.toString(), + 'float hello_inner() {' + '\nreturn inner();' + '\n}', + 'function conversion check' + ); assert.deepEqual(node.calledFunctions, ['inner']); }); @@ -141,7 +169,11 @@ test('Math.round implementation: A function with arguments cpu', () => { assert.notEqual(node.getJsAST(), null, 'AST fetch check'); - assert.equal(node.toString(), 'function foo(user_a) {' + '\nreturn Math.floor((user_a+0.5));' + '\n}', 'function conversion check'); + assert.equal( + node.toString(), + 'function foo(user_a) {' + '\nreturn Math.floor((user_a+0.5));' + '\n}', + 'function conversion check' + ); assert.deepEqual(node.calledFunctions, ['Math.floor']); }); @@ -161,7 +193,11 @@ test('Math.round implementation: A function with arguments webgl', () => { assert.notEqual(node.getJsAST(), null, 'AST fetch check'); - assert.equal(node.toString(), 'float foo(float user_a) {' + '\nreturn floor((user_a+0.5));' + '\n}', 'function conversion check'); + assert.equal( + node.toString(), + 'float foo(float user_a) {' + '\nreturn floor((user_a+0.5));' + '\n}', + 'function conversion check' + ); assert.deepEqual(node.calledFunctions, ['floor']); }); @@ -181,7 +217,11 @@ test('Math.round implementation: A function with arguments webgl2', () => { assert.notEqual(node.getJsAST(), null, 'AST fetch check'); - assert.equal(node.toString(), 'float foo(float user_a) {' + '\nreturn floor((user_a+0.5));' + '\n}', 'function conversion check'); + assert.equal( + node.toString(), + 'float foo(float user_a) {' + '\nreturn floor((user_a+0.5));' + '\n}', + 'function conversion check' + ); assert.deepEqual(node.calledFunctions, ['floor']); }); @@ -201,7 +241,13 @@ test('Two arguments test webgl', function (assert) { assert.notEqual(node.getJsAST(), null, 'AST fetch check'); - assert.equal(node.toString(), 'float add_together(float user_a, float user_b) {' + '\nreturn (user_a+user_b);' + '\n}', 'function conversion check'); + assert.equal( + node.toString(), + 'float add_together(float user_a, float user_b) {' + + '\nreturn (user_a+user_b);' + + '\n}', + 'function conversion check' + ); }); test('Two arguments test webgl2', function (assert) { @@ -218,7 +264,13 @@ test('Two arguments test webgl2', function (assert) { assert.notEqual(node.getJsAST(), null, 'AST fetch check'); - assert.equal(node.toString(), 'float add_together(float user_a, float user_b) {' + '\nreturn (user_a+user_b);' + '\n}', 'function conversion check'); + assert.equal( + node.toString(), + 'float add_together(float user_a, float user_b) {' + + '\nreturn (user_a+user_b);' + + '\n}', + 'function conversion check' + ); }); /// Test the creation of a hello_world function diff --git a/test/internal/function-return-type-detection.js b/test/internal/function-return-type-detection.js index 67e91872..c3493966 100644 --- a/test/internal/function-return-type-detection.js +++ b/test/internal/function-return-type-detection.js @@ -40,9 +40,12 @@ test('can detect Number gpu', () => { canDetectNumberFromAddedFunction('webgl2'); }); -(GPU.isHeadlessGLSupported ? test : skip)('can detect Number headlessgl', () => { - canDetectNumberFromAddedFunction('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'can detect Number headlessgl', + () => { + canDetectNumberFromAddedFunction('headlessgl'); + } +); test('can detect Number cpu', () => { canDetectNumberFromAddedFunction('cpu'); @@ -85,9 +88,12 @@ test('can detect Array(2) gpu', () => { canDetectArray2FromAddedFunction('webgl2'); }); -(GPU.isHeadlessGLSupported ? test : skip)('can detect Array(2) headlessgl', () => { - canDetectArray2FromAddedFunction('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'can detect Array(2) headlessgl', + () => { + canDetectArray2FromAddedFunction('headlessgl'); + } +); test('can detect Array(2) cpu', () => { canDetectArray2FromAddedFunction('cpu'); @@ -130,9 +136,12 @@ test('can detect Array(3) gpu', () => { canDetectArray3FromAddedFunction('webgl2'); }); -(GPU.isHeadlessGLSupported ? test : skip)('can detect Array(3) headlessgl', () => { - canDetectArray3FromAddedFunction('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'can detect Array(3) headlessgl', + () => { + canDetectArray3FromAddedFunction('headlessgl'); + } +); test('can detect Array(3) cpu', () => { canDetectArray3FromAddedFunction('cpu'); @@ -175,9 +184,12 @@ test('can detect Array(4) gpu', () => { canDetectArray4FromAddedFunction('webgl2'); }); -(GPU.isHeadlessGLSupported ? test : skip)('can detect Array(4) headlessgl', () => { - canDetectArray4FromAddedFunction('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'can detect Array(4) headlessgl', + () => { + canDetectArray4FromAddedFunction('headlessgl'); + } +); test('can detect Array(4) cpu', () => { canDetectArray4FromAddedFunction('cpu'); diff --git a/test/internal/function-tracer.js b/test/internal/function-tracer.js index 79586356..0f00f3e8 100644 --- a/test/internal/function-tracer.js +++ b/test/internal/function-tracer.js @@ -183,21 +183,45 @@ test('works with var & let VariableDeclarator together', () => { for (let i = 0; i < 1; i++) { let pop = 0; }`); const functionTracer = new FunctionTracer(ast); - assert.equal(functionTracer.contexts[0].bob.context['@contextType'], 'function'); + assert.equal( + functionTracer.contexts[0].bob.context['@contextType'], + 'function' + ); assert.equal(functionTracer.contexts[0].i, undefined); assert.equal(functionTracer.contexts[0].pop, undefined); - assert.equal(functionTracer.contexts[1].bob.context['@contextType'], 'function'); - assert.equal(functionTracer.contexts[1].i.context['@contextType'], 'function'); + assert.equal( + functionTracer.contexts[1].bob.context['@contextType'], + 'function' + ); + assert.equal( + functionTracer.contexts[1].i.context['@contextType'], + 'function' + ); assert.equal(functionTracer.contexts[1].pop, undefined); - assert.equal(functionTracer.contexts[2].bob.context['@contextType'], 'function'); - assert.equal(functionTracer.contexts[2].i.context['@contextType'], 'function'); + assert.equal( + functionTracer.contexts[2].bob.context['@contextType'], + 'function' + ); + assert.equal( + functionTracer.contexts[2].i.context['@contextType'], + 'function' + ); assert.equal(functionTracer.contexts[2].pop, undefined); - assert.equal(functionTracer.contexts[3].bob.context['@contextType'], 'function'); - assert.equal(functionTracer.contexts[3].i.context['@contextType'], 'function'); - assert.equal(functionTracer.contexts[3].pop.context['@contextType'], 'function'); + assert.equal( + functionTracer.contexts[3].bob.context['@contextType'], + 'function' + ); + assert.equal( + functionTracer.contexts[3].i.context['@contextType'], + 'function' + ); + assert.equal( + functionTracer.contexts[3].pop.context['@contextType'], + 'function' + ); }); test('works with FunctionExpression when runningContexts.length = 0', () => { @@ -563,7 +587,14 @@ test('does nothing with un-scan-ables', () => { called = true; }, }; - ['ThisExpression', 'Literal', 'DebuggerStatement', 'EmptyStatement', 'BreakStatement', 'ContinueStatement'].forEach(type => { + [ + 'ThisExpression', + 'Literal', + 'DebuggerStatement', + 'EmptyStatement', + 'BreakStatement', + 'ContinueStatement', + ].forEach(type => { FunctionTracer.prototype.scan.call(mockInstance, { type }); }); assert.ok(!called); diff --git a/test/internal/implied-else.js b/test/internal/implied-else.js index 632edb0f..c725dcfc 100644 --- a/test/internal/implied-else.js +++ b/test/internal/implied-else.js @@ -27,17 +27,26 @@ test('never reached when early return gpu', () => { neverReachedWhenEarlyReturn('gpu'); }); -(GPU.isWebGLSupported ? test : skip)('never reached when early return webgl', () => { - neverReachedWhenEarlyReturn('webgl'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'never reached when early return webgl', + () => { + neverReachedWhenEarlyReturn('webgl'); + } +); -(GPU.isWebGL2Supported ? test : skip)('never reached when early return webgl2', () => { - neverReachedWhenEarlyReturn('webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'never reached when early return webgl2', + () => { + neverReachedWhenEarlyReturn('webgl2'); + } +); -(GPU.isHeadlessGLSupported ? test : skip)('never reached when early return headlessgl', () => { - neverReachedWhenEarlyReturn('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'never reached when early return headlessgl', + () => { + neverReachedWhenEarlyReturn('headlessgl'); + } +); test('never reached when early return cpu', () => { neverReachedWhenEarlyReturn('cpu'); @@ -75,9 +84,12 @@ test('handles implied else gpu', () => { handlesImpliedElse('webgl2'); }); -(GPU.isHeadlessGLSupported ? test : skip)('handles implied else headlessgl', () => { - handlesImpliedElse('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'handles implied else headlessgl', + () => { + handlesImpliedElse('headlessgl'); + } +); test('handles implied else cpu', () => { handlesImpliedElse('cpu'); diff --git a/test/internal/kernel-run-shortcut.js b/test/internal/kernel-run-shortcut.js index 043e0d6f..1f527025 100644 --- a/test/internal/kernel-run-shortcut.js +++ b/test/internal/kernel-run-shortcut.js @@ -72,14 +72,23 @@ test('immutable saves switched kernel gpu', () => { testImmutableSavesSwitchedKernel('gpu'); }); -(GPU.isWebGLSupported ? test : skip)('immutable saves switched kernel webgl', () => { - testImmutableSavesSwitchedKernel('webgl'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'immutable saves switched kernel webgl', + () => { + testImmutableSavesSwitchedKernel('webgl'); + } +); -(GPU.isWebGL2Supported ? test : skip)('immutable saves switched kernel webgl2', () => { - testImmutableSavesSwitchedKernel('webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'immutable saves switched kernel webgl2', + () => { + testImmutableSavesSwitchedKernel('webgl2'); + } +); -(GPU.isHeadlessGLSupported ? test : skip)('immutable saves switched kernel headlessgl', () => { - testImmutableSavesSwitchedKernel('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'immutable saves switched kernel headlessgl', + () => { + testImmutableSavesSwitchedKernel('headlessgl'); + } +); diff --git a/test/internal/kernel.js b/test/internal/kernel.js index e32d71be..c5039b8a 100644 --- a/test/internal/kernel.js +++ b/test/internal/kernel.js @@ -1,5 +1,12 @@ const { assert, test, module: describe, skip } = require('qunit'); -const { GPU, CPUKernel, WebGLKernel, WebGL2Kernel, HeadlessGLKernel, Kernel } = require('../../src'); +const { + GPU, + CPUKernel, + WebGLKernel, + WebGL2Kernel, + HeadlessGLKernel, + Kernel, +} = require('../../src'); describe('internal: kernel'); @@ -8,17 +15,20 @@ describe('internal: kernel'); * @param {Kernel} Kernel */ function argumentTypesTest(Kernel) { - const kernel = new Kernel(`function(value) { return value[this.thread.x]; }`, { - output: [1], - functionBuilder: { - addKernel: function () {}, - addFunctions: function () {}, - getPrototypes: function () { - return []; + const kernel = new Kernel( + `function(value) { return value[this.thread.x]; }`, + { + output: [1], + functionBuilder: { + addKernel: function () {}, + addFunctions: function () {}, + getPrototypes: function () { + return []; + }, + addNativeFunctions: function () {}, }, - addNativeFunctions: function () {}, - }, - }); + } + ); kernel.build([1]); assert.equal(kernel.argumentTypes.length, 1); assert.equal(kernel.argumentTypes[0], 'Array'); @@ -37,9 +47,12 @@ test('CPUKernel argumentTypes', () => { argumentTypesTest(WebGL2Kernel); }); -(GPU.isHeadlessGLSupported ? test : skip)('HeadlessGLKernel argumentTypes', () => { - argumentTypesTest(HeadlessGLKernel); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'HeadlessGLKernel argumentTypes', + () => { + argumentTypesTest(HeadlessGLKernel); + } +); /** * @@ -76,9 +89,12 @@ test('WebGLKernel.setUniform1f only calls context when values change', () => { test('WebGL2Kernel.setUniform1f only calls context when values change', () => { setUniform1fTest(WebGL2Kernel); }); -(GPU.isHeadlessGLSupported ? test : skip)('HeadlessGLKernel.setUniform1f only calls context when values change', () => { - setUniform1fTest(HeadlessGLKernel); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'HeadlessGLKernel.setUniform1f only calls context when values change', + () => { + setUniform1fTest(HeadlessGLKernel); + } +); /** * @@ -115,9 +131,12 @@ test('WebGLKernel.setUniform1i only calls context when values change', () => { test('WebGL2Kernel.setUniform1i only calls context when values change', () => { setUniform1iTest(WebGL2Kernel); }); -(GPU.isHeadlessGLSupported ? test : skip)('HeadlessGLKernel.setUniform1i only calls context when values change', () => { - setUniform1iTest(HeadlessGLKernel); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'HeadlessGLKernel.setUniform1i only calls context when values change', + () => { + setUniform1iTest(HeadlessGLKernel); + } +); /** * @@ -153,9 +172,12 @@ test('WebGLKernel.setUniform2f only calls context when values change', () => { test('WebGL2Kernel.setUniform2f only calls context when values change', () => { setUniform2fTest(WebGL2Kernel); }); -(GPU.isHeadlessGLSupported ? test : skip)('HeadlessGLKernel.setUniform2f only calls context when values change', () => { - setUniform2fTest(HeadlessGLKernel); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'HeadlessGLKernel.setUniform2f only calls context when values change', + () => { + setUniform2fTest(HeadlessGLKernel); + } +); /** * diff --git a/test/internal/loop-int.js b/test/internal/loop-int.js index 85bd0773..b7911671 100644 --- a/test/internal/loop-int.js +++ b/test/internal/loop-int.js @@ -19,7 +19,16 @@ test('loop int constant output webgl', () => { argumentTypes: ['Array'], lookupFunctionArgumentBitRatio: () => 4, }); - assert.equal(functionNode.toString(), 'void kernel() {' + '\nfloat user_sum=0.0;' + '\nfor (int user_i=0;(user_i { @@ -37,7 +46,16 @@ test('loop int constant output webgl2', () => { argumentTypes: ['Array'], lookupFunctionArgumentBitRatio: () => 4, }); - assert.equal(functionNode.toString(), 'void kernel() {' + '\nfloat user_sum=0.0;' + '\nfor (int user_i=0;(user_i { @@ -76,23 +94,26 @@ test('loop int constant output webgl2', () => { gpu.destroy(); }); -(GPU.isHeadlessGLSupported ? test : skip)('loop int constant headlessgl', () => { - function kernel(a) { - let sum = 0; - for (let i = 0; i < this.constants.max; i++) { - sum += a[this.thread.x][i]; +(GPU.isHeadlessGLSupported ? test : skip)( + 'loop int constant headlessgl', + () => { + function kernel(a) { + let sum = 0; + for (let i = 0; i < this.constants.max; i++) { + sum += a[this.thread.x][i]; + } + return sum; } - return sum; - } - const gpu = new GPU({ mode: 'headlessgl' }); - const output = gpu.createKernel(kernel, { - constants: { max: 3 }, - output: [1], - })([[1, 2, 3]]); + const gpu = new GPU({ mode: 'headlessgl' }); + const output = gpu.createKernel(kernel, { + constants: { max: 3 }, + output: [1], + })([[1, 2, 3]]); - assert.equal(output, 6); - gpu.destroy(); -}); + assert.equal(output, 6); + gpu.destroy(); + } +); test('loop int literal output webgl', () => { function kernel(a) { @@ -108,7 +129,16 @@ test('loop int literal output webgl', () => { argumentTypes: ['Array'], lookupFunctionArgumentBitRatio: () => 4, }); - assert.equal(functionNode.toString(), 'void kernel() {' + '\nfloat user_sum=0.0;' + '\nfor (int user_i=0;(user_i<10);user_i++){' + '\nuser_sum+=get32(user_a, user_aSize, user_aDim, 0, threadId.x, user_i);}' + '\n' + '\nkernelResult = user_sum;return;' + '\n}'); + assert.equal( + functionNode.toString(), + 'void kernel() {' + + '\nfloat user_sum=0.0;' + + '\nfor (int user_i=0;(user_i<10);user_i++){' + + '\nuser_sum+=get32(user_a, user_aSize, user_aDim, 0, threadId.x, user_i);}' + + '\n' + + '\nkernelResult = user_sum;return;' + + '\n}' + ); }); test('loop int literal output webgl2', () => { @@ -125,7 +155,16 @@ test('loop int literal output webgl2', () => { argumentTypes: ['Array'], lookupFunctionArgumentBitRatio: () => 4, }); - assert.equal(functionNode.toString(), 'void kernel() {' + '\nfloat user_sum=0.0;' + '\nfor (int user_i=0;(user_i<10);user_i++){' + '\nuser_sum+=get32(user_a, user_aSize, user_aDim, 0, threadId.x, user_i);}' + '\n' + '\nkernelResult = user_sum;return;' + '\n}'); + assert.equal( + functionNode.toString(), + 'void kernel() {' + + '\nfloat user_sum=0.0;' + + '\nfor (int user_i=0;(user_i<10);user_i++){' + + '\nuser_sum+=get32(user_a, user_aSize, user_aDim, 0, threadId.x, user_i);}' + + '\n' + + '\nkernelResult = user_sum;return;' + + '\n}' + ); }); (GPU.isWebGLSupported ? test : skip)('loop int literal webgl', () => { @@ -156,19 +195,22 @@ test('loop int literal output webgl2', () => { gpu.destroy(); }); -(GPU.isHeadlessGLSupported ? test : skip)('loop int literal headlessgl', () => { - function kernel(a) { - let sum = 0; - for (let i = 0; i < 3; i++) { - sum += a[this.thread.x][i]; +(GPU.isHeadlessGLSupported ? test : skip)( + 'loop int literal headlessgl', + () => { + function kernel(a) { + let sum = 0; + for (let i = 0; i < 3; i++) { + sum += a[this.thread.x][i]; + } + return sum; } - return sum; + const gpu = new GPU({ mode: 'headlessgl' }); + const output = gpu.createKernel(kernel, { output: [1] })([[1, 2, 3]]); + assert.equal(output, 6); + gpu.destroy(); } - const gpu = new GPU({ mode: 'headlessgl' }); - const output = gpu.createKernel(kernel, { output: [1] })([[1, 2, 3]]); - assert.equal(output, 6); - gpu.destroy(); -}); +); test('loop int parameter output webgl', () => { function kernel(a, b) { @@ -184,7 +226,19 @@ test('loop int parameter output webgl', () => { argumentTypes: ['Number', 'Array'], lookupFunctionArgumentBitRatio: () => 4, }); - assert.equal(functionNode.toString(), 'void kernel() {' + '\nfloat user_sum=0.0;' + '\nint user_i=0;' + '\nfor (int safeI=0;safeI { @@ -201,7 +255,19 @@ test('loop int parameter output webgl2', () => { argumentTypes: ['Number', 'Array'], lookupFunctionArgumentBitRatio: () => 4, }); - assert.equal(functionNode.toString(), 'void kernel() {' + '\nfloat user_sum=0.0;' + '\nint user_i=0;' + '\nfor (int safeI=0;safeI { @@ -232,19 +298,22 @@ test('loop int parameter output webgl2', () => { gpu.destroy(); }); -(GPU.isHeadlessGLSupported ? test : skip)('loop int parameter headlessgl', () => { - function kernel(a, b) { - let sum = 0; - for (let i = 0; i < a; i++) { - sum += b[this.thread.x][i]; +(GPU.isHeadlessGLSupported ? test : skip)( + 'loop int parameter headlessgl', + () => { + function kernel(a, b) { + let sum = 0; + for (let i = 0; i < a; i++) { + sum += b[this.thread.x][i]; + } + return sum; } - return sum; + const gpu = new GPU({ mode: 'headlessgl' }); + const output = gpu.createKernel(kernel, { output: [1] })(3, [[1, 2, 3]]); + assert.equal(output, 6); + gpu.destroy(); } - const gpu = new GPU({ mode: 'headlessgl' }); - const output = gpu.createKernel(kernel, { output: [1] })(3, [[1, 2, 3]]); - assert.equal(output, 6); - gpu.destroy(); -}); +); (GPU.isWebGLSupported ? test : skip)('loop int dynamic output webgl', () => { function kernel(a) { @@ -282,20 +351,23 @@ test('loop int parameter output webgl2', () => { gpu.destroy(); }); -(GPU.isHeadlessGLSupported ? test : skip)('loop int dynamic output headlessgl', () => { - function kernel(a) { - let sum = 0; - for (let i = 0; i < this.output.x; i++) { - sum += a[this.thread.x][i]; +(GPU.isHeadlessGLSupported ? test : skip)( + 'loop int dynamic output headlessgl', + () => { + function kernel(a) { + let sum = 0; + for (let i = 0; i < this.output.x; i++) { + sum += a[this.thread.x][i]; + } + return sum; } - return sum; - } - const gpu = new GPU({ mode: 'headlessgl' }); - const output = gpu.createKernel(kernel, { - dynamicOutput: true, - output: [1], - })([[3]]); + const gpu = new GPU({ mode: 'headlessgl' }); + const output = gpu.createKernel(kernel, { + dynamicOutput: true, + output: [1], + })([[3]]); - assert.deepEqual(Array.from(output), [3]); - gpu.destroy(); -}); + assert.deepEqual(Array.from(output), [3]); + gpu.destroy(); + } +); diff --git a/test/internal/loop-max.js b/test/internal/loop-max.js index f6604db2..df94a4fd 100644 --- a/test/internal/loop-max.js +++ b/test/internal/loop-max.js @@ -21,7 +21,19 @@ test('loop max output webgl', () => { } ); - assert.equal(functionNode.toString(), 'void kernel() {' + '\nfloat user_sum=0.0;' + '\nint user_i=0;' + '\nfor (int safeI=0;safeI { @@ -42,7 +54,19 @@ test('loop max output webgl2', () => { } ); - assert.equal(functionNode.toString(), 'void kernel() {' + '\nfloat user_sum=0.0;' + '\nint user_i=0;' + '\nfor (int safeI=0;safeI { diff --git a/test/internal/math.random.js b/test/internal/math.random.js index 66175258..afa9d41d 100644 --- a/test/internal/math.random.js +++ b/test/internal/math.random.js @@ -33,7 +33,12 @@ function mathRandomUnique(mode) { const results = []; for (let i = 0; i < checkCount; i++) { const result = kernel(); - assert.ok(results.indexOf(result[0]) === -1, `duplication at index ${results.indexOf(result[0])} from new value ${result[0]}. Values ${JSON.stringify(results)}`); + assert.ok( + results.indexOf(result[0]) === -1, + `duplication at index ${results.indexOf(result[0])} from new value ${ + result[0] + }. Values ${JSON.stringify(results)}` + ); results.push(result[0]); seed2 = result[0]; assert.ok(stub.called); @@ -65,9 +70,12 @@ test('unique every time gpu', () => { mathRandomUnique('webgl2'); }); -(GPU.isHeadlessGLSupported ? test : skip)('unique every time headlessgl', () => { - mathRandomUnique('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'unique every time headlessgl', + () => { + mathRandomUnique('headlessgl'); + } +); describe('never above 1'); @@ -111,13 +119,19 @@ test('never above 1 every time gpu', () => { mathRandomNeverAboveOne('webgl'); }); -(GPU.isWebGL2Supported ? test : skip)('never above 1 every time webgl2', () => { - mathRandomNeverAboveOne('webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'never above 1 every time webgl2', + () => { + mathRandomNeverAboveOne('webgl2'); + } +); -(GPU.isHeadlessGLSupported ? test : skip)('never above 1 every time headlessgl', () => { - mathRandomNeverAboveOne('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'never above 1 every time headlessgl', + () => { + mathRandomNeverAboveOne('headlessgl'); + } +); test('never above 1 every time cpu', () => { mathRandomNeverAboveOne('cpu'); diff --git a/test/internal/matrix-multiply-precision.js b/test/internal/matrix-multiply-precision.js index 85d7f215..1eef5f6a 100644 --- a/test/internal/matrix-multiply-precision.js +++ b/test/internal/matrix-multiply-precision.js @@ -79,17 +79,26 @@ test('512x512 unsigned precision gpu', () => { test512x512Matrix('unsigned', 'gpu'); }); -(GPU.isWebGLSupported ? test : skip)('512x512 unsigned precision webgl', () => { - test512x512Matrix('unsigned', 'webgl'); -}); +(GPU.isWebGLSupported ? test : skip)( + '512x512 unsigned precision webgl', + () => { + test512x512Matrix('unsigned', 'webgl'); + } +); -(GPU.isWebGL2Supported ? test : skip)('512x512 unsigned precision webgl2', () => { - test512x512Matrix('unsigned', 'webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + '512x512 unsigned precision webgl2', + () => { + test512x512Matrix('unsigned', 'webgl2'); + } +); -(GPU.isHeadlessGLSupported ? test : skip)('512x512 unsigned precision headlessgl', () => { - test512x512Matrix('unsigned', 'headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + '512x512 unsigned precision headlessgl', + () => { + test512x512Matrix('unsigned', 'headlessgl'); + } +); test('512x512 unsigned precision cpu', () => { test512x512Matrix('unsigned', 'cpu'); @@ -146,61 +155,97 @@ test('10x512 unsigned precision gpu', () => { test10x512Matrix('unsigned', 'webgl'); }); -(GPU.isWebGL2Supported ? test : skip)('10x512 unsigned precision webgl2', () => { - test10x512Matrix('unsigned', 'webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + '10x512 unsigned precision webgl2', + () => { + test10x512Matrix('unsigned', 'webgl2'); + } +); -(GPU.isHeadlessGLSupported ? test : skip)('10x512 unsigned precision headlessgl', () => { - test10x512Matrix('unsigned', 'headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + '10x512 unsigned precision headlessgl', + () => { + test10x512Matrix('unsigned', 'headlessgl'); + } +); test('10x512 unsigned precision cpu', () => { test10x512Matrix('unsigned', 'cpu'); }); -(GPU.isSinglePrecisionSupported ? test : skip)('512x512 single precision auto', () => { - test512x512Matrix('single'); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + '512x512 single precision auto', + () => { + test512x512Matrix('single'); + } +); -(GPU.isSinglePrecisionSupported ? test : skip)('512x512 single precision gpu', () => { - test512x512Matrix('single', 'gpu'); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + '512x512 single precision gpu', + () => { + test512x512Matrix('single', 'gpu'); + } +); -(GPU.isWebGLSupported && GPU.isSinglePrecisionSupported ? test : skip)('512x512 single precision webgl', () => { - test512x512Matrix('single', 'webgl'); -}); +(GPU.isWebGLSupported && GPU.isSinglePrecisionSupported ? test : skip)( + '512x512 single precision webgl', + () => { + test512x512Matrix('single', 'webgl'); + } +); -(GPU.isWebGL2Supported && GPU.isSinglePrecisionSupported ? test : skip)('512x512 single precision webgl2', () => { - test512x512Matrix('single', 'webgl2'); -}); +(GPU.isWebGL2Supported && GPU.isSinglePrecisionSupported ? test : skip)( + '512x512 single precision webgl2', + () => { + test512x512Matrix('single', 'webgl2'); + } +); -(GPU.isHeadlessGLSupported && GPU.isSinglePrecisionSupported ? test : skip)('512x512 single precision headlessgl', () => { - test512x512Matrix('single', 'headlessgl'); -}); +(GPU.isHeadlessGLSupported && GPU.isSinglePrecisionSupported ? test : skip)( + '512x512 single precision headlessgl', + () => { + test512x512Matrix('single', 'headlessgl'); + } +); test('512x512 single precision cpu', () => { test512x512Matrix('single', 'cpu'); }); -(GPU.isSinglePrecisionSupported ? test : skip)('10x512 single precision auto', () => { - test10x512Matrix('single'); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + '10x512 single precision auto', + () => { + test10x512Matrix('single'); + } +); -(GPU.isSinglePrecisionSupported ? test : skip)('10x512 single precision gpu', () => { - test10x512Matrix('single', 'gpu'); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + '10x512 single precision gpu', + () => { + test10x512Matrix('single', 'gpu'); + } +); -(GPU.isWebGLSupported && GPU.isSinglePrecisionSupported ? test : skip)('10x512 single precision webgl', () => { - test10x512Matrix('single', 'webgl'); -}); +(GPU.isWebGLSupported && GPU.isSinglePrecisionSupported ? test : skip)( + '10x512 single precision webgl', + () => { + test10x512Matrix('single', 'webgl'); + } +); -(GPU.isWebGL2Supported && GPU.isSinglePrecisionSupported ? test : skip)('10x512 single precision webgl2', () => { - test10x512Matrix('single', 'webgl2'); -}); +(GPU.isWebGL2Supported && GPU.isSinglePrecisionSupported ? test : skip)( + '10x512 single precision webgl2', + () => { + test10x512Matrix('single', 'webgl2'); + } +); -(GPU.isHeadlessGLSupported && GPU.isSinglePrecisionSupported ? test : skip)('10x512 single precision headlessgl', () => { - test10x512Matrix('single', 'headlessgl'); -}); +(GPU.isHeadlessGLSupported && GPU.isSinglePrecisionSupported ? test : skip)( + '10x512 single precision headlessgl', + () => { + test10x512Matrix('single', 'headlessgl'); + } +); test('10x512 single precision cpu', () => { test10x512Matrix('precision', 'cpu'); diff --git a/test/internal/mixed-memory-optimize.js b/test/internal/mixed-memory-optimize.js index 91e22441..5e0050e8 100644 --- a/test/internal/mixed-memory-optimize.js +++ b/test/internal/mixed-memory-optimize.js @@ -42,21 +42,33 @@ function offOnOff(mode) { offOnOff(); }); -(GPU.isGPUSupported && GPU.isSinglePrecisionSupported ? test : skip)('off on off gpu', () => { - offOnOff('gpu'); -}); - -(GPU.isWebGLSupported && GPU.isSinglePrecisionSupported ? test : skip)('off on off webgl', () => { - offOnOff('webgl'); -}); - -(GPU.isWebGL2Supported && GPU.isSinglePrecisionSupported ? test : skip)('off on off webgl2', () => { - offOnOff('webgl2'); -}); - -(GPU.isHeadlessGLSupported && GPU.isSinglePrecisionSupported ? test : skip)('off on off headlessgl', () => { - offOnOff('headlessgl'); -}); +(GPU.isGPUSupported && GPU.isSinglePrecisionSupported ? test : skip)( + 'off on off gpu', + () => { + offOnOff('gpu'); + } +); + +(GPU.isWebGLSupported && GPU.isSinglePrecisionSupported ? test : skip)( + 'off on off webgl', + () => { + offOnOff('webgl'); + } +); + +(GPU.isWebGL2Supported && GPU.isSinglePrecisionSupported ? test : skip)( + 'off on off webgl2', + () => { + offOnOff('webgl2'); + } +); + +(GPU.isHeadlessGLSupported && GPU.isSinglePrecisionSupported ? test : skip)( + 'off on off headlessgl', + () => { + offOnOff('headlessgl'); + } +); test('off on off cpu', () => { assert.throws(() => { @@ -88,21 +100,33 @@ function onOffOn(mode) { onOffOn(); }); -(GPU.isGPUSupported && GPU.isSinglePrecisionSupported ? test : skip)('on off on gpu', () => { - onOffOn('gpu'); -}); - -(GPU.isWebGLSupported && GPU.isSinglePrecisionSupported ? test : skip)('on off on webgl', () => { - onOffOn('webgl'); -}); - -(GPU.isWebGL2Supported && GPU.isSinglePrecisionSupported ? test : skip)('on off on webgl2', () => { - onOffOn('webgl2'); -}); - -(GPU.isHeadlessGLSupported && GPU.isSinglePrecisionSupported ? test : skip)('on off on headlessgl', () => { - onOffOn('headlessgl'); -}); +(GPU.isGPUSupported && GPU.isSinglePrecisionSupported ? test : skip)( + 'on off on gpu', + () => { + onOffOn('gpu'); + } +); + +(GPU.isWebGLSupported && GPU.isSinglePrecisionSupported ? test : skip)( + 'on off on webgl', + () => { + onOffOn('webgl'); + } +); + +(GPU.isWebGL2Supported && GPU.isSinglePrecisionSupported ? test : skip)( + 'on off on webgl2', + () => { + onOffOn('webgl2'); + } +); + +(GPU.isHeadlessGLSupported && GPU.isSinglePrecisionSupported ? test : skip)( + 'on off on headlessgl', + () => { + onOffOn('headlessgl'); + } +); test('on off on cpu', () => { assert.throws(() => { diff --git a/test/internal/modes.js b/test/internal/modes.js index 0b3a2348..db54be2e 100644 --- a/test/internal/modes.js +++ b/test/internal/modes.js @@ -1,5 +1,11 @@ const { assert, skip, test, module: describe } = require('qunit'); -const { GPU, WebGLKernel, WebGL2Kernel, HeadlessGLKernel, CPUKernel } = require('../../src'); +const { + GPU, + WebGLKernel, + WebGL2Kernel, + HeadlessGLKernel, + CPUKernel, +} = require('../../src'); describe('internal: modes'); diff --git a/test/internal/precision.js b/test/internal/precision.js index 4ef71f5a..cfd7d7aa 100644 --- a/test/internal/precision.js +++ b/test/internal/precision.js @@ -53,27 +53,30 @@ describe('internal: precision'); gpu.destroy(); }); -(GPU.isHeadlessGLSupported ? test : skip)('HeadlessGL Decimal Precision', () => { - const gpu = new GPU({ mode: 'headlessgl' }); - const add = gpu - .createKernel(function (a, b) { - return a + b; - }) - .setOutput([1]); - let addResult = add(0.1, 0.2)[0]; - assert.equal(addResult.toFixed(7), (0.1 + 0.2).toFixed(7)); +(GPU.isHeadlessGLSupported ? test : skip)( + 'HeadlessGL Decimal Precision', + () => { + const gpu = new GPU({ mode: 'headlessgl' }); + const add = gpu + .createKernel(function (a, b) { + return a + b; + }) + .setOutput([1]); + let addResult = add(0.1, 0.2)[0]; + assert.equal(addResult.toFixed(7), (0.1 + 0.2).toFixed(7)); - const reflectValue = gpu - .createKernel(function (a) { - return a; - }) - .setOutput([1]); + const reflectValue = gpu + .createKernel(function (a) { + return a; + }) + .setOutput([1]); - //Just for sanity's sake, recurse the value to see if it spirals out of control - for (let i = 0; i < 100; i++) { - const newAddResult = reflectValue(addResult)[0]; - assert.equal(newAddResult, addResult); - addResult = newAddResult; + //Just for sanity's sake, recurse the value to see if it spirals out of control + for (let i = 0; i < 100; i++) { + const newAddResult = reflectValue(addResult)[0]; + assert.equal(newAddResult, addResult); + addResult = newAddResult; + } + gpu.destroy(); } - gpu.destroy(); -}); +); diff --git a/test/internal/recycling.js b/test/internal/recycling.js index e4109cfe..8a6ecf4b 100644 --- a/test/internal/recycling.js +++ b/test/internal/recycling.js @@ -18,7 +18,10 @@ function testImmutableKernelTextureRecycling(precision, mode) { } ); let result = kernel([0]); - const newTextureSpy = sinon.spy(kernel.texture.constructor.prototype, 'newTexture'); + const newTextureSpy = sinon.spy( + kernel.texture.constructor.prototype, + 'newTexture' + ); for (let i = 0; i < 10; i++) { let lastResult = result; result = kernel(result); @@ -39,17 +42,26 @@ test('immutable single precision kernel gpu', () => { testImmutableKernelTextureRecycling('single', 'gpu'); }); -(GPU.isWebGLSupported ? test : skip)('immutable single precision kernel webgl', () => { - testImmutableKernelTextureRecycling('single', 'webgl'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'immutable single precision kernel webgl', + () => { + testImmutableKernelTextureRecycling('single', 'webgl'); + } +); -(GPU.isWebGL2Supported ? test : skip)('immutable single precision kernel webgl2', () => { - testImmutableKernelTextureRecycling('single', 'webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'immutable single precision kernel webgl2', + () => { + testImmutableKernelTextureRecycling('single', 'webgl2'); + } +); -(GPU.isHeadlessGLSupported ? test : skip)('immutable single precision kernel headlessgl', () => { - testImmutableKernelTextureRecycling('single', 'headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'immutable single precision kernel headlessgl', + () => { + testImmutableKernelTextureRecycling('single', 'headlessgl'); + } +); test('immutable unsigned precision kernel auto', () => { testImmutableKernelTextureRecycling('unsigned'); @@ -59,17 +71,26 @@ test('immutable unsigned precision kernel gpu', () => { testImmutableKernelTextureRecycling('unsigned', 'gpu'); }); -(GPU.isWebGLSupported ? test : skip)('immutable unsigned precision kernel webgl', () => { - testImmutableKernelTextureRecycling('unsigned', 'webgl'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'immutable unsigned precision kernel webgl', + () => { + testImmutableKernelTextureRecycling('unsigned', 'webgl'); + } +); -(GPU.isWebGL2Supported ? test : skip)('immutable unsigned precision kernel webgl2', () => { - testImmutableKernelTextureRecycling('unsigned', 'webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'immutable unsigned precision kernel webgl2', + () => { + testImmutableKernelTextureRecycling('unsigned', 'webgl2'); + } +); -(GPU.isHeadlessGLSupported ? test : skip)('immutable unsigned precision headlessgl', () => { - testImmutableKernelTextureRecycling('unsigned', 'headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'immutable unsigned precision headlessgl', + () => { + testImmutableKernelTextureRecycling('unsigned', 'headlessgl'); + } +); function testImmutableMappedKernelTextureRecycling(precision, mode) { const gpu = new GPU({ mode }); @@ -93,7 +114,10 @@ function testImmutableMappedKernelTextureRecycling(precision, mode) { } ); let map = kernel([0], [11]); - const newTextureSpy = sinon.spy(kernel.texture.constructor.prototype, 'newTexture'); + const newTextureSpy = sinon.spy( + kernel.texture.constructor.prototype, + 'newTexture' + ); for (let i = 0; i < 10; i++) { let lastResults = map; map = kernel(map.result, map.oneOffValue); @@ -116,17 +140,26 @@ test('immutable single precision mapped kernel gpu', () => { testImmutableMappedKernelTextureRecycling('single', 'gpu'); }); -(GPU.isWebGLSupported ? test : skip)('immutable single precision mapped kernel webgl', () => { - testImmutableMappedKernelTextureRecycling('single', 'webgl'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'immutable single precision mapped kernel webgl', + () => { + testImmutableMappedKernelTextureRecycling('single', 'webgl'); + } +); -(GPU.isWebGL2Supported ? test : skip)('immutable single precision mapped kernel webgl2', () => { - testImmutableMappedKernelTextureRecycling('single', 'webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'immutable single precision mapped kernel webgl2', + () => { + testImmutableMappedKernelTextureRecycling('single', 'webgl2'); + } +); -(GPU.isHeadlessGLSupported ? test : skip)('immutable single precision mapped kernel headlessgl', () => { - testImmutableMappedKernelTextureRecycling('single', 'headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'immutable single precision mapped kernel headlessgl', + () => { + testImmutableMappedKernelTextureRecycling('single', 'headlessgl'); + } +); test('immutable unsigned precision mapped kernel auto', () => { testImmutableMappedKernelTextureRecycling('unsigned'); @@ -136,17 +169,26 @@ test('immutable unsigned precision mapped kernel gpu', () => { testImmutableMappedKernelTextureRecycling('unsigned', 'gpu'); }); -(GPU.isWebGLSupported ? test : skip)('immutable unsigned precision mapped kernel webgl', () => { - testImmutableMappedKernelTextureRecycling('unsigned', 'webgl'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'immutable unsigned precision mapped kernel webgl', + () => { + testImmutableMappedKernelTextureRecycling('unsigned', 'webgl'); + } +); -(GPU.isWebGL2Supported ? test : skip)('immutable unsigned precision mapped kernel webgl2', () => { - testImmutableMappedKernelTextureRecycling('unsigned', 'webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'immutable unsigned precision mapped kernel webgl2', + () => { + testImmutableMappedKernelTextureRecycling('unsigned', 'webgl2'); + } +); -(GPU.isHeadlessGLSupported ? test : skip)('immutable unsigned precision mapped kernel headlessgl', () => { - testImmutableMappedKernelTextureRecycling('unsigned', 'headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'immutable unsigned precision mapped kernel headlessgl', + () => { + testImmutableMappedKernelTextureRecycling('unsigned', 'headlessgl'); + } +); function testImmutableTextureDelete(precision, done, mode) { const gpu = new GPU({ mode }); @@ -204,17 +246,26 @@ test('immutable single precision texture delete gpu', t => { testImmutableTextureDelete('single', t.async(), 'gpu'); }); -(GPU.isWebGLSupported ? test : skip)('immutable single precision texture delete webgl', t => { - testImmutableTextureDelete('single', t.async(), 'webgl'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'immutable single precision texture delete webgl', + t => { + testImmutableTextureDelete('single', t.async(), 'webgl'); + } +); -(GPU.isWebGL2Supported ? test : skip)('immutable single precision texture delete webgl2', t => { - testImmutableTextureDelete('single', t.async(), 'webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'immutable single precision texture delete webgl2', + t => { + testImmutableTextureDelete('single', t.async(), 'webgl2'); + } +); -(GPU.isHeadlessGLSupported ? test : skip)('immutable single precision texture delete headlessgl', t => { - testImmutableTextureDelete('single', t.async(), 'headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'immutable single precision texture delete headlessgl', + t => { + testImmutableTextureDelete('single', t.async(), 'headlessgl'); + } +); test('immutable unsigned precision texture delete auto', t => { testImmutableTextureDelete('unsigned', t.async()); @@ -224,17 +275,26 @@ test('immutable unsigned precision texture delete gpu', t => { testImmutableTextureDelete('unsigned', t.async(), 'gpu'); }); -(GPU.isWebGLSupported ? test : skip)('immutable unsigned precision texture delete webgl', t => { - testImmutableTextureDelete('unsigned', t.async(), 'webgl'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'immutable unsigned precision texture delete webgl', + t => { + testImmutableTextureDelete('unsigned', t.async(), 'webgl'); + } +); -(GPU.isWebGL2Supported ? test : skip)('immutable unsigned precision texture delete webgl2', t => { - testImmutableTextureDelete('unsigned', t.async(), 'webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'immutable unsigned precision texture delete webgl2', + t => { + testImmutableTextureDelete('unsigned', t.async(), 'webgl2'); + } +); -(GPU.isHeadlessGLSupported ? test : skip)('immutable unsigned precision texture delete headlessgl', t => { - testImmutableTextureDelete('unsigned', t.async(), 'headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'immutable unsigned precision texture delete headlessgl', + t => { + testImmutableTextureDelete('unsigned', t.async(), 'headlessgl'); + } +); function testImmutableKernelTextureDoesNotLeak(precision, done, mode) { const gpu = new GPU({ mode }); @@ -278,17 +338,26 @@ test('immutable unsigned precision kernel.texture does not leak gpu', t => { testImmutableKernelTextureDoesNotLeak('unsigned', t.async(), 'gpu'); }); -(GPU.isWebGLSupported ? test : skip)('immutable unsigned precision kernel.texture does not leak webgl', t => { - testImmutableKernelTextureDoesNotLeak('unsigned', t.async(), 'webgl'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'immutable unsigned precision kernel.texture does not leak webgl', + t => { + testImmutableKernelTextureDoesNotLeak('unsigned', t.async(), 'webgl'); + } +); -(GPU.isWebGL2Supported ? test : skip)('immutable unsigned precision kernel.texture does not leak webgl2', t => { - testImmutableKernelTextureDoesNotLeak('unsigned', t.async(), 'webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'immutable unsigned precision kernel.texture does not leak webgl2', + t => { + testImmutableKernelTextureDoesNotLeak('unsigned', t.async(), 'webgl2'); + } +); -(GPU.isHeadlessGLSupported ? test : skip)('immutable unsigned precision kernel.texture does not leak headlessgl', t => { - testImmutableKernelTextureDoesNotLeak('unsigned', t.async(), 'headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'immutable unsigned precision kernel.texture does not leak headlessgl', + t => { + testImmutableKernelTextureDoesNotLeak('unsigned', t.async(), 'headlessgl'); + } +); test('immutable single precision kernel.texture does not leak auto', t => { testImmutableKernelTextureDoesNotLeak('single', t.async()); @@ -298,17 +367,26 @@ test('immutable single precision kernel.texture does not leak gpu', t => { testImmutableKernelTextureDoesNotLeak('single', t.async(), 'gpu'); }); -(GPU.isWebGLSupported ? test : skip)('immutable single precision kernel.texture does not leak webgl', t => { - testImmutableKernelTextureDoesNotLeak('single', t.async(), 'webgl'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'immutable single precision kernel.texture does not leak webgl', + t => { + testImmutableKernelTextureDoesNotLeak('single', t.async(), 'webgl'); + } +); -(GPU.isWebGL2Supported ? test : skip)('immutable single precision kernel.texture does not leak webgl2', t => { - testImmutableKernelTextureDoesNotLeak('single', t.async(), 'webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'immutable single precision kernel.texture does not leak webgl2', + t => { + testImmutableKernelTextureDoesNotLeak('single', t.async(), 'webgl2'); + } +); -(GPU.isHeadlessGLSupported ? test : skip)('immutable single precision kernel.texture does not leak headlessgl', t => { - testImmutableKernelTextureDoesNotLeak('single', t.async(), 'headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'immutable single precision kernel.texture does not leak headlessgl', + t => { + testImmutableKernelTextureDoesNotLeak('single', t.async(), 'headlessgl'); + } +); function testImmutableKernelMappedTexturesDoesNotLeak(precision, done, mode) { const gpu = new GPU({ mode }); @@ -374,17 +452,38 @@ test('immutable unsigned precision kernel.mappedTextures does not leak gpu', t = testImmutableKernelMappedTexturesDoesNotLeak('unsigned', t.async(), 'gpu'); }); -(GPU.isWebGLSupported ? test : skip)('immutable unsigned precision kernel.mappedTextures does not leak webgl', t => { - testImmutableKernelMappedTexturesDoesNotLeak('unsigned', t.async(), 'webgl'); -}); - -(GPU.isWebGL2Supported ? test : skip)('immutable unsigned precision kernel.mappedTextures does not leak webgl2', t => { - testImmutableKernelMappedTexturesDoesNotLeak('unsigned', t.async(), 'webgl2'); -}); - -(GPU.isHeadlessGLSupported ? test : skip)('immutable unsigned precision kernel.mappedTextures does not leak headlessgl', t => { - testImmutableKernelMappedTexturesDoesNotLeak('unsigned', t.async(), 'headlessgl'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'immutable unsigned precision kernel.mappedTextures does not leak webgl', + t => { + testImmutableKernelMappedTexturesDoesNotLeak( + 'unsigned', + t.async(), + 'webgl' + ); + } +); + +(GPU.isWebGL2Supported ? test : skip)( + 'immutable unsigned precision kernel.mappedTextures does not leak webgl2', + t => { + testImmutableKernelMappedTexturesDoesNotLeak( + 'unsigned', + t.async(), + 'webgl2' + ); + } +); + +(GPU.isHeadlessGLSupported ? test : skip)( + 'immutable unsigned precision kernel.mappedTextures does not leak headlessgl', + t => { + testImmutableKernelMappedTexturesDoesNotLeak( + 'unsigned', + t.async(), + 'headlessgl' + ); + } +); test('immutable single precision kernel.mappedTextures does not leak auto', t => { testImmutableKernelMappedTexturesDoesNotLeak('single', t.async()); @@ -394,17 +493,34 @@ test('immutable single precision kernel.mappedTextures does not leak gpu', t => testImmutableKernelMappedTexturesDoesNotLeak('single', t.async(), 'gpu'); }); -(GPU.isWebGLSupported ? test : skip)('immutable single precision kernel.mappedTextures does not leak webgl', t => { - testImmutableKernelMappedTexturesDoesNotLeak('single', t.async(), 'webgl'); -}); - -(GPU.isWebGL2Supported ? test : skip)('immutable single precision kernel.mappedTextures does not leak webgl2', t => { - testImmutableKernelMappedTexturesDoesNotLeak('single', t.async(), 'webgl2'); -}); - -(GPU.isHeadlessGLSupported ? test : skip)('immutable single precision kernel.mappedTextures does not leak headlessgl', t => { - testImmutableKernelMappedTexturesDoesNotLeak('single', t.async(), 'headlessgl'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'immutable single precision kernel.mappedTextures does not leak webgl', + t => { + testImmutableKernelMappedTexturesDoesNotLeak('single', t.async(), 'webgl'); + } +); + +(GPU.isWebGL2Supported ? test : skip)( + 'immutable single precision kernel.mappedTextures does not leak webgl2', + t => { + testImmutableKernelMappedTexturesDoesNotLeak( + 'single', + t.async(), + 'webgl2' + ); + } +); + +(GPU.isHeadlessGLSupported ? test : skip)( + 'immutable single precision kernel.mappedTextures does not leak headlessgl', + t => { + testImmutableKernelMappedTexturesDoesNotLeak( + 'single', + t.async(), + 'headlessgl' + ); + } +); function testCloning(mode) { const gpu = new GPU({ mode }); @@ -425,17 +541,26 @@ function testCloning(mode) { gpu.destroy(); } -(GPU.isWebGLSupported ? test : skip)('cloning sets up framebuffer with correct size webgl', () => { - testCloning('webgl'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'cloning sets up framebuffer with correct size webgl', + () => { + testCloning('webgl'); + } +); -(GPU.isWebGL2Supported ? test : skip)('cloning sets up framebuffer with correct size webgl2', () => { - testCloning('webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'cloning sets up framebuffer with correct size webgl2', + () => { + testCloning('webgl2'); + } +); -(GPU.isHeadlessGLSupported ? test : skip)('cloning sets up framebuffer with correct size headlessgl', () => { - testCloning('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'cloning sets up framebuffer with correct size headlessgl', + () => { + testCloning('headlessgl'); + } +); function testMutableLeak(mode) { const gpu = new GPU({ mode }); @@ -449,7 +574,10 @@ function testMutableLeak(mode) { } ); kernel.build(); - const cloneTextureSpy = sinon.spy(kernel.texture.constructor.prototype, 'beforeMutate'); + const cloneTextureSpy = sinon.spy( + kernel.texture.constructor.prototype, + 'beforeMutate' + ); const texture1 = kernel(); const texture2 = kernel(); assert.equal(cloneTextureSpy.callCount, 0); @@ -475,9 +603,12 @@ test('test mutable leak gpu', () => { testMutableLeak('webgl2'); }); -(GPU.isHeadlessGLSupported ? test : skip)('test mutable leak headlessgl', () => { - testMutableLeak('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'test mutable leak headlessgl', + () => { + testMutableLeak('headlessgl'); + } +); describe('internal: cpu recycling behaviour'); @@ -533,7 +664,12 @@ test('recycle CPU cube', () => { const gpu = new GPU({ mode: 'cpu' }); const kernel = gpu.createKernel( function (v) { - return this.thread.x + this.thread.y * this.output.x + this.thread.z * this.output.y * this.output.x + v[0]; + return ( + this.thread.x + + this.thread.y * this.output.x + + this.thread.z * this.output.y * this.output.x + + v[0] + ); }, { output: [2, 2, 2], @@ -624,7 +760,12 @@ test('non-recycle CPU cube', () => { const gpu = new GPU({ mode: 'cpu' }); const kernel = gpu.createKernel( function (v) { - return this.thread.x + this.thread.y * this.output.x + this.thread.z * this.output.y * this.output.x + v[0]; + return ( + this.thread.x + + this.thread.y * this.output.x + + this.thread.z * this.output.y * this.output.x + + v[0] + ); }, { output: [2, 2, 2], @@ -683,8 +824,12 @@ function testSameSourceDestinationFromResultThrows(error, precision, mode) { gpu.destroy(); } -const gpuError = new Error('Source and destination textures are the same. Use immutable = true and manually cleanup kernel output texture memory with texture.delete()'); -const cpuError = new Error('Source and destination arrays are the same. Use immutable = true'); +const gpuError = new Error( + 'Source and destination textures are the same. Use immutable = true and manually cleanup kernel output texture memory with texture.delete()' +); +const cpuError = new Error( + 'Source and destination arrays are the same. Use immutable = true' +); test('single precision same source and destination from result mutable throws auto', () => { testSameSourceDestinationFromResultThrows(gpuError, 'single'); @@ -694,17 +839,30 @@ test('single precision same source and destination from result mutable throws gp testSameSourceDestinationFromResultThrows(gpuError, 'single', 'gpu'); }); -(GPU.isWebGLSupported ? test : skip)('single precision same source and destination from result mutable throws webgl', () => { - testSameSourceDestinationFromResultThrows(gpuError, 'single', 'webgl'); -}); - -(GPU.isWebGL2Supported ? test : skip)('single precision same source and destination from result mutable throws webgl2', () => { - testSameSourceDestinationFromResultThrows(gpuError, 'single', 'webgl2'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'single precision same source and destination from result mutable throws webgl', + () => { + testSameSourceDestinationFromResultThrows(gpuError, 'single', 'webgl'); + } +); -(GPU.isHeadlessGLSupported ? test : skip)('single precision same source and destination from result mutable throws headlessgl', () => { - testSameSourceDestinationFromResultThrows(gpuError, 'single', 'headlessgl'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'single precision same source and destination from result mutable throws webgl2', + () => { + testSameSourceDestinationFromResultThrows(gpuError, 'single', 'webgl2'); + } +); + +(GPU.isHeadlessGLSupported ? test : skip)( + 'single precision same source and destination from result mutable throws headlessgl', + () => { + testSameSourceDestinationFromResultThrows( + gpuError, + 'single', + 'headlessgl' + ); + } +); test('single precision same source and destination from result mutable throws cpu', () => { testSameSourceDestinationFromResultThrows(cpuError, 'single', 'cpu'); @@ -718,23 +876,40 @@ test('unsigned precision same source and destination from result mutable throws testSameSourceDestinationFromResultThrows(gpuError, 'unsigned', 'gpu'); }); -(GPU.isWebGLSupported ? test : skip)('unsigned precision same source and destination from result mutable throws webgl', () => { - testSameSourceDestinationFromResultThrows(gpuError, 'unsigned', 'webgl'); -}); - -(GPU.isWebGL2Supported ? test : skip)('unsigned precision same source and destination from result mutable throws webgl2', () => { - testSameSourceDestinationFromResultThrows(gpuError, 'unsigned', 'webgl2'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'unsigned precision same source and destination from result mutable throws webgl', + () => { + testSameSourceDestinationFromResultThrows(gpuError, 'unsigned', 'webgl'); + } +); -(GPU.isHeadlessGLSupported ? test : skip)('unsigned precision same source and destination from result mutable throws headlessgl', () => { - testSameSourceDestinationFromResultThrows(gpuError, 'unsigned', 'headlessgl'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'unsigned precision same source and destination from result mutable throws webgl2', + () => { + testSameSourceDestinationFromResultThrows(gpuError, 'unsigned', 'webgl2'); + } +); + +(GPU.isHeadlessGLSupported ? test : skip)( + 'unsigned precision same source and destination from result mutable throws headlessgl', + () => { + testSameSourceDestinationFromResultThrows( + gpuError, + 'unsigned', + 'headlessgl' + ); + } +); test('unsigned precision same source and destination from result mutable throws cpu', () => { testSameSourceDestinationFromResultThrows(cpuError, 'unsigned', 'cpu'); }); -function testSameSourceDestinationFromMappedResultThrows(error, precision, mode) { +function testSameSourceDestinationFromMappedResultThrows( + error, + precision, + mode +) { const gpu = new GPU({ mode }); const kernel = gpu.createKernelMap( { @@ -753,7 +928,10 @@ function testSameSourceDestinationFromMappedResultThrows(error, precision, mode) } ); let { result, mappedResult } = kernel([0]); - assert.equal((mappedResult.toArray ? mappedResult.toArray() : mappedResult)[0], 1); + assert.equal( + (mappedResult.toArray ? mappedResult.toArray() : mappedResult)[0], + 1 + ); assert.throws(() => kernel(mappedResult), error); assert.throws(() => kernel(result), error); gpu.destroy(); @@ -767,17 +945,38 @@ test('single precision same source and destination from mapped result mutable th testSameSourceDestinationFromMappedResultThrows(gpuError, 'single', 'gpu'); }); -(GPU.isWebGLSupported ? test : skip)('single precision same source and destination from mapped result mutable throws webgl', () => { - testSameSourceDestinationFromMappedResultThrows(gpuError, 'single', 'webgl'); -}); - -(GPU.isWebGL2Supported ? test : skip)('single precision same source and destination from mapped result mutable throws webgl2', () => { - testSameSourceDestinationFromMappedResultThrows(gpuError, 'single', 'webgl2'); -}); - -(GPU.isHeadlessGLSupported ? test : skip)('single precision same source and destination from mapped result mutable throws headlessgl', () => { - testSameSourceDestinationFromMappedResultThrows(gpuError, 'single', 'headlessgl'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'single precision same source and destination from mapped result mutable throws webgl', + () => { + testSameSourceDestinationFromMappedResultThrows( + gpuError, + 'single', + 'webgl' + ); + } +); + +(GPU.isWebGL2Supported ? test : skip)( + 'single precision same source and destination from mapped result mutable throws webgl2', + () => { + testSameSourceDestinationFromMappedResultThrows( + gpuError, + 'single', + 'webgl2' + ); + } +); + +(GPU.isHeadlessGLSupported ? test : skip)( + 'single precision same source and destination from mapped result mutable throws headlessgl', + () => { + testSameSourceDestinationFromMappedResultThrows( + gpuError, + 'single', + 'headlessgl' + ); + } +); test('single precision same source and destination from mapped result mutable throws cpu', () => { testSameSourceDestinationFromMappedResultThrows(cpuError, 'single', 'cpu'); @@ -791,17 +990,38 @@ test('unsigned precision same source and destination from mapped result mutable testSameSourceDestinationFromMappedResultThrows(gpuError, 'unsigned', 'gpu'); }); -(GPU.isWebGLSupported ? test : skip)('unsigned precision same source and destination from mapped result mutable throws webgl', () => { - testSameSourceDestinationFromMappedResultThrows(gpuError, 'unsigned', 'webgl'); -}); - -(GPU.isWebGL2Supported ? test : skip)('unsigned precision same source and destination from mapped result mutable throws webgl2', () => { - testSameSourceDestinationFromMappedResultThrows(gpuError, 'unsigned', 'webgl2'); -}); - -(GPU.isHeadlessGLSupported ? test : skip)('unsigned precision same source and destination from mapped result mutable throws headlessgl', () => { - testSameSourceDestinationFromMappedResultThrows(gpuError, 'unsigned', 'headlessgl'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'unsigned precision same source and destination from mapped result mutable throws webgl', + () => { + testSameSourceDestinationFromMappedResultThrows( + gpuError, + 'unsigned', + 'webgl' + ); + } +); + +(GPU.isWebGL2Supported ? test : skip)( + 'unsigned precision same source and destination from mapped result mutable throws webgl2', + () => { + testSameSourceDestinationFromMappedResultThrows( + gpuError, + 'unsigned', + 'webgl2' + ); + } +); + +(GPU.isHeadlessGLSupported ? test : skip)( + 'unsigned precision same source and destination from mapped result mutable throws headlessgl', + () => { + testSameSourceDestinationFromMappedResultThrows( + gpuError, + 'unsigned', + 'headlessgl' + ); + } +); test('unsigned precision same source and destination from mapped result mutable throws cpu', () => { testSameSourceDestinationFromMappedResultThrows(cpuError, 'unsigned', 'cpu'); @@ -838,17 +1058,26 @@ test('output texture is cloned when recompiling gpu', () => { testOutputTextureIsClonedWhenRecompiling('gpu'); }); -(GPU.isWebGLSupported ? test : skip)('output texture is cloned when recompiling webgl', () => { - testOutputTextureIsClonedWhenRecompiling('webgl'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'output texture is cloned when recompiling webgl', + () => { + testOutputTextureIsClonedWhenRecompiling('webgl'); + } +); -(GPU.isWebGL2Supported ? test : skip)('output texture is cloned when recompiling webgl2', () => { - testOutputTextureIsClonedWhenRecompiling('webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'output texture is cloned when recompiling webgl2', + () => { + testOutputTextureIsClonedWhenRecompiling('webgl2'); + } +); -(GPU.isHeadlessGLSupported ? test : skip)('output texture is cloned when recompiling headlessgl', () => { - testOutputTextureIsClonedWhenRecompiling('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'output texture is cloned when recompiling headlessgl', + () => { + testOutputTextureIsClonedWhenRecompiling('headlessgl'); + } +); function testMappedOutputTextureIsClonedWhenRecompiling(mode) { const gpu = new GPU({ mode }); @@ -897,14 +1126,23 @@ test('mapped output texture is cloned when recompiling gpu', () => { testMappedOutputTextureIsClonedWhenRecompiling('gpu'); }); -(GPU.isWebGLSupported ? test : skip)('mapped output texture is cloned when recompiling webgl', () => { - testMappedOutputTextureIsClonedWhenRecompiling('webgl'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'mapped output texture is cloned when recompiling webgl', + () => { + testMappedOutputTextureIsClonedWhenRecompiling('webgl'); + } +); -(GPU.isWebGL2Supported ? test : skip)('mapped output texture is cloned when recompiling webgl2', () => { - testMappedOutputTextureIsClonedWhenRecompiling('webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'mapped output texture is cloned when recompiling webgl2', + () => { + testMappedOutputTextureIsClonedWhenRecompiling('webgl2'); + } +); -(GPU.isHeadlessGLSupported ? test : skip)('mapped output texture is cloned when recompiling headlessgl', () => { - testMappedOutputTextureIsClonedWhenRecompiling('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'mapped output texture is cloned when recompiling headlessgl', + () => { + testMappedOutputTextureIsClonedWhenRecompiling('headlessgl'); + } +); diff --git a/test/internal/texture-index.js b/test/internal/texture-index.js index b8d9c577..99076712 100644 --- a/test/internal/texture-index.js +++ b/test/internal/texture-index.js @@ -25,24 +25,38 @@ function createKernelWithNumberConstants(mode) { test('createKernel with number constants auto', () => { createKernelWithNumberConstants(); }); -(GPU.isWebGL2Supported ? test : skip)('createKernel with number constants gpu', () => { - createKernelWithNumberConstants('gpu'); -}); -(GPU.isWebGL2Supported ? test : skip)('createKernel with number constants webgl', () => { - createKernelWithNumberConstants('webgl'); -}); -(GPU.isWebGL2Supported ? test : skip)('createKernel with number constants webgl2', () => { - createKernelWithNumberConstants('webgl2'); -}); -(GPU.isHeadlessGLSupported ? test : skip)('createKernel with number constants headlessgl', () => { - createKernelWithNumberConstants('headlessgl'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'createKernel with number constants gpu', + () => { + createKernelWithNumberConstants('gpu'); + } +); +(GPU.isWebGL2Supported ? test : skip)( + 'createKernel with number constants webgl', + () => { + createKernelWithNumberConstants('webgl'); + } +); +(GPU.isWebGL2Supported ? test : skip)( + 'createKernel with number constants webgl2', + () => { + createKernelWithNumberConstants('webgl2'); + } +); +(GPU.isHeadlessGLSupported ? test : skip)( + 'createKernel with number constants headlessgl', + () => { + createKernelWithNumberConstants('headlessgl'); + } +); function createKernelWithArrayConstants(mode) { const gpu = new GPU({ mode }); const kernel = gpu.createKernel( function () { - return this.constants.v1[this.thread.x] + this.constants.v2[this.thread.x]; + return ( + this.constants.v1[this.thread.x] + this.constants.v2[this.thread.x] + ); }, { output: [1], constants: { v1: [1], v2: [1] } } ); @@ -60,18 +74,30 @@ function createKernelWithArrayConstants(mode) { test('createKernel with array constants auto', () => { createKernelWithArrayConstants(); }); -(GPU.isGPUSupported ? test : skip)('createKernel with array constants gpu', () => { - createKernelWithArrayConstants('gpu'); -}); -(GPU.isWebGLSupported ? test : skip)('createKernel with array constants webgl', () => { - createKernelWithArrayConstants('webgl'); -}); -(GPU.isWebGL2Supported ? test : skip)('createKernel with array constants webgl2', () => { - createKernelWithArrayConstants('webgl2'); -}); -(GPU.isHeadlessGLSupported ? test : skip)('createKernel with array constants headlessgl', () => { - createKernelWithArrayConstants('headlessgl'); -}); +(GPU.isGPUSupported ? test : skip)( + 'createKernel with array constants gpu', + () => { + createKernelWithArrayConstants('gpu'); + } +); +(GPU.isWebGLSupported ? test : skip)( + 'createKernel with array constants webgl', + () => { + createKernelWithArrayConstants('webgl'); + } +); +(GPU.isWebGL2Supported ? test : skip)( + 'createKernel with array constants webgl2', + () => { + createKernelWithArrayConstants('webgl2'); + } +); +(GPU.isHeadlessGLSupported ? test : skip)( + 'createKernel with array constants headlessgl', + () => { + createKernelWithArrayConstants('headlessgl'); + } +); function creatKernelWithNumberConstantsAndArrayArguments(mode) { const gpu = new GPU({ mode }); @@ -85,7 +111,12 @@ function creatKernelWithNumberConstantsAndArrayArguments(mode) { const texture2 = textureGetter(); const kernel = gpu.createKernel( function (value1, value2) { - return value1[this.thread.x] + value2[this.thread.x] + this.constants.v1 + this.constants.v2; + return ( + value1[this.thread.x] + + value2[this.thread.x] + + this.constants.v1 + + this.constants.v2 + ); }, { output: [1], constants: { v1: 1, v2: 1 } } ); @@ -106,18 +137,30 @@ function creatKernelWithNumberConstantsAndArrayArguments(mode) { test('createKernel with number constants & array arguments auto', () => { creatKernelWithNumberConstantsAndArrayArguments(); }); -(GPU.isGPUSupported ? test : skip)('createKernel with number constants & array arguments gpu', () => { - creatKernelWithNumberConstantsAndArrayArguments('gpu'); -}); -(GPU.isWebGLSupported ? test : skip)('createKernel with number constants & array arguments webgl', () => { - creatKernelWithNumberConstantsAndArrayArguments('webgl'); -}); -(GPU.isWebGL2Supported ? test : skip)('createKernel with number constants & array arguments webgl2', () => { - creatKernelWithNumberConstantsAndArrayArguments('webgl2'); -}); -(GPU.isHeadlessGLSupported ? test : skip)('createKernel with number constants & array arguments headlessgl', () => { - creatKernelWithNumberConstantsAndArrayArguments('headlessgl'); -}); +(GPU.isGPUSupported ? test : skip)( + 'createKernel with number constants & array arguments gpu', + () => { + creatKernelWithNumberConstantsAndArrayArguments('gpu'); + } +); +(GPU.isWebGLSupported ? test : skip)( + 'createKernel with number constants & array arguments webgl', + () => { + creatKernelWithNumberConstantsAndArrayArguments('webgl'); + } +); +(GPU.isWebGL2Supported ? test : skip)( + 'createKernel with number constants & array arguments webgl2', + () => { + creatKernelWithNumberConstantsAndArrayArguments('webgl2'); + } +); +(GPU.isHeadlessGLSupported ? test : skip)( + 'createKernel with number constants & array arguments headlessgl', + () => { + creatKernelWithNumberConstantsAndArrayArguments('headlessgl'); + } +); function createKernelMapWithArrayConstantsAndTextureArguments(mode) { const gpu = new GPU({ mode }); @@ -143,7 +186,12 @@ function createKernelMapWithArrayConstantsAndTextureArguments(mode) { mappedValue2: calcValue2, }, function (value1, value2) { - return calcValue1(value1[this.thread.x] + value2[this.thread.x]) + calcValue2(this.constants.v1[this.thread.x] + this.constants.v2[this.thread.x]); + return ( + calcValue1(value1[this.thread.x] + value2[this.thread.x]) + + calcValue2( + this.constants.v1[this.thread.x] + this.constants.v2[this.thread.x] + ) + ); }, { output: [1], constants: { v1: [1], v2: [1] } } ); @@ -163,15 +211,27 @@ function createKernelMapWithArrayConstantsAndTextureArguments(mode) { test('createKernelMap with array constants & texture arguments auto', () => { createKernelMapWithArrayConstantsAndTextureArguments(); }); -(GPU.isGPUSupported ? test : skip)('createKernelMap with array constants & texture arguments gpu', () => { - createKernelMapWithArrayConstantsAndTextureArguments('gpu'); -}); -(GPU.isWebGLSupported ? test : skip)('createKernelMap with array constants & texture arguments webgl', () => { - createKernelMapWithArrayConstantsAndTextureArguments('webgl'); -}); -(GPU.isWebGL2Supported ? test : skip)('createKernelMap with array constants & texture arguments webgl2', () => { - createKernelMapWithArrayConstantsAndTextureArguments('webgl2'); -}); -(GPU.isHeadlessGLSupported ? test : skip)('createKernelMap with array constants & texture arguments headlessgl', () => { - createKernelMapWithArrayConstantsAndTextureArguments('headlessgl'); -}); +(GPU.isGPUSupported ? test : skip)( + 'createKernelMap with array constants & texture arguments gpu', + () => { + createKernelMapWithArrayConstantsAndTextureArguments('gpu'); + } +); +(GPU.isWebGLSupported ? test : skip)( + 'createKernelMap with array constants & texture arguments webgl', + () => { + createKernelMapWithArrayConstantsAndTextureArguments('webgl'); + } +); +(GPU.isWebGL2Supported ? test : skip)( + 'createKernelMap with array constants & texture arguments webgl2', + () => { + createKernelMapWithArrayConstantsAndTextureArguments('webgl2'); + } +); +(GPU.isHeadlessGLSupported ? test : skip)( + 'createKernelMap with array constants & texture arguments headlessgl', + () => { + createKernelMapWithArrayConstantsAndTextureArguments('headlessgl'); + } +); diff --git a/test/internal/underscores.js b/test/internal/underscores.js index 926136be..3654dd32 100644 --- a/test/internal/underscores.js +++ b/test/internal/underscores.js @@ -95,9 +95,12 @@ test('texture argument gpu', () => { (GPU.isWebGL2Supported ? test : skip)('texture argument webgl2', () => { testTextureArgument('webgl2'); }); -(GPU.isHeadlessGLSupported ? test : skip)('texture argument headlessgl', () => { - testTextureArgument('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'texture argument headlessgl', + () => { + testTextureArgument('headlessgl'); + } +); test('texture argument cpu', () => { testTextureArgument('cpu'); }); @@ -133,9 +136,12 @@ test('array2 texture argument gpu', () => { (GPU.isWebGL2Supported ? test : skip)('array2 texture argument webgl2', () => { testArray2TextureArgument('webgl2'); }); -(GPU.isHeadlessGLSupported ? test : skip)('array2 texture argument headlessgl', () => { - testArray2TextureArgument('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'array2 texture argument headlessgl', + () => { + testArray2TextureArgument('headlessgl'); + } +); function testNumberConstant(mode) { const gpu = new GPU({ mode }); @@ -244,6 +250,9 @@ test('texture constant gpu', () => { (GPU.isWebGL2Supported ? test : skip)('texture constant webgl2', () => { testTextureConstant('webgl2'); }); -(GPU.isHeadlessGLSupported ? test : skip)('texture constant headlessgl', () => { - testTextureConstant('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'texture constant headlessgl', + () => { + testTextureConstant('headlessgl'); + } +); diff --git a/test/internal/utils.js b/test/internal/utils.js index 24b8ade1..5e988a7b 100644 --- a/test/internal/utils.js +++ b/test/internal/utils.js @@ -5,7 +5,10 @@ describe('internal: utils'); test('systemEndianness not null', () => { assert.ok(utils.systemEndianness() !== null, 'not null check'); - assert.ok(utils.systemEndianness() === 'LE' || utils.systemEndianness() === 'BE', 'value = ' + utils.systemEndianness()); + assert.ok( + utils.systemEndianness() === 'LE' || utils.systemEndianness() === 'BE', + 'value = ' + utils.systemEndianness() + ); }); test('isFunction', () => { @@ -23,7 +26,10 @@ test('getFunctionName_fromString', () => { }); test('getParamNames_fromString', () => { - assert.deepEqual(['a', 'b', 'c'], utils.getArgumentNamesFromString('function test(a,b,c) { }')); + assert.deepEqual( + ['a', 'b', 'c'], + utils.getArgumentNamesFromString('function test(a,b,c) { }') + ); }); test('closestSquareDimensions 2', () => { @@ -43,90 +49,158 @@ test('closestSquareDimensions 7', () => { }); test('getDimensions Array of 6, padded', () => { - assert.deepEqual(Array.from(utils.getDimensions(new Array(6).fill(1), true)), [6, 1, 1]); + assert.deepEqual( + Array.from(utils.getDimensions(new Array(6).fill(1), true)), + [6, 1, 1] + ); }); test('getDimensions Array of 6,1,1, padded', () => { - assert.deepEqual(Array.from(utils.getDimensions([[[1, 1, 1, 1, 1, 1]]], true)), [6, 1, 1]); + assert.deepEqual( + Array.from(utils.getDimensions([[[1, 1, 1, 1, 1, 1]]], true)), + [6, 1, 1] + ); }); test('getDimensions Array of 1,6,1, padded', () => { - assert.deepEqual(Array.from(utils.getDimensions([[[1], [1], [1], [1], [1], [1]]], true)), [1, 6, 1]); + assert.deepEqual( + Array.from(utils.getDimensions([[[1], [1], [1], [1], [1], [1]]], true)), + [1, 6, 1] + ); }); test('getDimensions Array of 1,1,6, padded', () => { - assert.deepEqual(Array.from(utils.getDimensions([[[1]], [[1]], [[1]], [[1]], [[1]], [[1]]], true)), [1, 1, 6]); + assert.deepEqual( + Array.from( + utils.getDimensions([[[1]], [[1]], [[1]], [[1]], [[1]], [[1]]], true) + ), + [1, 1, 6] + ); }); test('getMemoryOptimizedFloatTextureSize [6,1,1], bitRatio 4', () => { - assert.deepEqual(Array.from(utils.getMemoryOptimizedFloatTextureSize([6, 1, 1], 4)), [1, 2]); + assert.deepEqual( + Array.from(utils.getMemoryOptimizedFloatTextureSize([6, 1, 1], 4)), + [1, 2] + ); }); test('getMemoryOptimizedFloatTextureSize [1,6,1], bitRatio 4', () => { - assert.deepEqual(Array.from(utils.getMemoryOptimizedFloatTextureSize([1, 6, 1], 4)), [1, 2]); + assert.deepEqual( + Array.from(utils.getMemoryOptimizedFloatTextureSize([1, 6, 1], 4)), + [1, 2] + ); }); test('getMemoryOptimizedFloatTextureSize [1,1,6], bitRatio 4', () => { - assert.deepEqual(Array.from(utils.getMemoryOptimizedFloatTextureSize([1, 1, 6], 4)), [1, 2]); + assert.deepEqual( + Array.from(utils.getMemoryOptimizedFloatTextureSize([1, 1, 6], 4)), + [1, 2] + ); }); test('getMemoryOptimizedFloatTextureSize [6,1,1], bitRatio 2', () => { - assert.deepEqual(Array.from(utils.getMemoryOptimizedFloatTextureSize([6, 1, 1], 2)), [2, 2]); + assert.deepEqual( + Array.from(utils.getMemoryOptimizedFloatTextureSize([6, 1, 1], 2)), + [2, 2] + ); }); test('getMemoryOptimizedFloatTextureSize [1,6,1], bitRatio 2', () => { - assert.deepEqual(Array.from(utils.getMemoryOptimizedFloatTextureSize([1, 6, 1], 2)), [2, 2]); + assert.deepEqual( + Array.from(utils.getMemoryOptimizedFloatTextureSize([1, 6, 1], 2)), + [2, 2] + ); }); test('getMemoryOptimizedFloatTextureSize [1,1,6], bitRatio 2', () => { - assert.deepEqual(Array.from(utils.getMemoryOptimizedFloatTextureSize([1, 1, 6], 2)), [2, 2]); + assert.deepEqual( + Array.from(utils.getMemoryOptimizedFloatTextureSize([1, 1, 6], 2)), + [2, 2] + ); }); test('getMemoryOptimizedFloatTextureSize [6,1,1], bitRatio 1', () => { - assert.deepEqual(Array.from(utils.getMemoryOptimizedFloatTextureSize([6, 1, 1], 1)), [4, 2]); + assert.deepEqual( + Array.from(utils.getMemoryOptimizedFloatTextureSize([6, 1, 1], 1)), + [4, 2] + ); }); test('getMemoryOptimizedFloatTextureSize [1,6,1], bitRatio 1', () => { - assert.deepEqual(Array.from(utils.getMemoryOptimizedFloatTextureSize([1, 6, 1], 1)), [4, 2]); + assert.deepEqual( + Array.from(utils.getMemoryOptimizedFloatTextureSize([1, 6, 1], 1)), + [4, 2] + ); }); test('getMemoryOptimizedFloatTextureSize [1,1,6], bitRatio 1', () => { - assert.deepEqual(Array.from(utils.getMemoryOptimizedFloatTextureSize([1, 1, 6], 1)), [4, 2]); + assert.deepEqual( + Array.from(utils.getMemoryOptimizedFloatTextureSize([1, 1, 6], 1)), + [4, 2] + ); }); test('getMemoryOptimizedPackedTextureSize [6,1,1], bitRatio 4', () => { - assert.deepEqual(Array.from(utils.getMemoryOptimizedPackedTextureSize([6, 1, 1], 4)), [4, 2]); + assert.deepEqual( + Array.from(utils.getMemoryOptimizedPackedTextureSize([6, 1, 1], 4)), + [4, 2] + ); }); test('getMemoryOptimizedPackedTextureSize [1,6,1], bitRatio 4', () => { - assert.deepEqual(Array.from(utils.getMemoryOptimizedPackedTextureSize([1, 6, 1], 4)), [4, 2]); + assert.deepEqual( + Array.from(utils.getMemoryOptimizedPackedTextureSize([1, 6, 1], 4)), + [4, 2] + ); }); test('getMemoryOptimizedPackedTextureSize [1,1,6], bitRatio 4', () => { - assert.deepEqual(Array.from(utils.getMemoryOptimizedPackedTextureSize([1, 1, 6], 4)), [4, 2]); + assert.deepEqual( + Array.from(utils.getMemoryOptimizedPackedTextureSize([1, 1, 6], 4)), + [4, 2] + ); }); test('getMemoryOptimizedPackedTextureSize [6,1,1], bitRatio 2', () => { - assert.deepEqual(Array.from(utils.getMemoryOptimizedPackedTextureSize([6, 1, 1], 2)), [2, 2]); + assert.deepEqual( + Array.from(utils.getMemoryOptimizedPackedTextureSize([6, 1, 1], 2)), + [2, 2] + ); }); test('getMemoryOptimizedPackedTextureSize [1,6,1], bitRatio 2', () => { - assert.deepEqual(Array.from(utils.getMemoryOptimizedPackedTextureSize([1, 6, 1], 2)), [2, 2]); + assert.deepEqual( + Array.from(utils.getMemoryOptimizedPackedTextureSize([1, 6, 1], 2)), + [2, 2] + ); }); test('getMemoryOptimizedPackedTextureSize [1,1,6], bitRatio 2', () => { - assert.deepEqual(Array.from(utils.getMemoryOptimizedPackedTextureSize([1, 1, 6], 2)), [2, 2]); + assert.deepEqual( + Array.from(utils.getMemoryOptimizedPackedTextureSize([1, 1, 6], 2)), + [2, 2] + ); }); test('getMemoryOptimizedPackedTextureSize [6,1,1], bitRatio 1', () => { - assert.deepEqual(Array.from(utils.getMemoryOptimizedPackedTextureSize([6, 1, 1], 1)), [1, 2]); + assert.deepEqual( + Array.from(utils.getMemoryOptimizedPackedTextureSize([6, 1, 1], 1)), + [1, 2] + ); }); test('getMemoryOptimizedPackedTextureSize [1,6,1], bitRatio 1', () => { - assert.deepEqual(Array.from(utils.getMemoryOptimizedPackedTextureSize([1, 6, 1], 1)), [1, 2]); + assert.deepEqual( + Array.from(utils.getMemoryOptimizedPackedTextureSize([1, 6, 1], 1)), + [1, 2] + ); }); test('getMemoryOptimizedPackedTextureSize [1,1,6], bitRatio 1', () => { - assert.deepEqual(Array.from(utils.getMemoryOptimizedPackedTextureSize([1, 1, 6], 1)), [1, 2]); + assert.deepEqual( + Array.from(utils.getMemoryOptimizedPackedTextureSize([1, 1, 6], 1)), + [1, 2] + ); }); test('getKernelTextureSize for [1,2] output, optimizeFloatMemory = true, and precision = "unsigned"', () => { @@ -269,7 +343,11 @@ test('erectPackedFloat', () => { test('erect2DPackedFloat', () => { const array = new Float32Array([0, 1, 2, 3, 4, 5, 6, 7, 8, 0, 0, 0, 0]); const result = utils.erect2DPackedFloat(array, 3, 3); - assert.deepEqual(result, [new Float32Array([0, 1, 2]), new Float32Array([3, 4, 5]), new Float32Array([6, 7, 8])]); + assert.deepEqual(result, [ + new Float32Array([0, 1, 2]), + new Float32Array([3, 4, 5]), + new Float32Array([6, 7, 8]), + ]); }); test('erect3DPackedFloat', () => { const array = new Float32Array([0, 1, 2, 3, 4, 5, 6, 7, 0, 0, 0, 0, 0]); @@ -287,7 +365,11 @@ test('erectMemoryOptimizedFloat', () => { test('erectMemoryOptimized2DFloat', () => { const array = new Float32Array([0, 1, 2, 3, 4, 5, 6, 7, 8, 0, 0, 0, 0]); const result = utils.erectMemoryOptimized2DFloat(array, 3, 3); - assert.deepEqual(result, [new Float32Array([0, 1, 2]), new Float32Array([3, 4, 5]), new Float32Array([6, 7, 8])]); + assert.deepEqual(result, [ + new Float32Array([0, 1, 2]), + new Float32Array([3, 4, 5]), + new Float32Array([6, 7, 8]), + ]); }); test('erectMemoryOptimized3DFloat', () => { const array = new Float32Array([0, 1, 2, 3, 4, 5, 6, 7, 0, 0, 0, 0, 0]); @@ -298,17 +380,29 @@ test('erectMemoryOptimized3DFloat', () => { ]); }); test('erectFloat', () => { - const array = new Float32Array([0, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 4, 0, 0, 0, 5, 0, 0, 0]); + const array = new Float32Array([ + 0, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 4, 0, 0, 0, 5, 0, 0, 0, + ]); const result = utils.erectFloat(array, 6); assert.deepEqual(result, new Float32Array([0, 1, 2, 3, 4, 5])); }); test('erect2DFloat', () => { - const array = new Float32Array([0, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 4, 0, 0, 0, 5, 0, 0, 0, 6, 0, 0, 0, 7, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0]); + const array = new Float32Array([ + 0, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 4, 0, 0, 0, 5, 0, 0, 0, 6, + 0, 0, 0, 7, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, + ]); const result = utils.erect2DFloat(array, 3, 3); - assert.deepEqual(result, [new Float32Array([0, 1, 2]), new Float32Array([3, 4, 5]), new Float32Array([6, 7, 8])]); + assert.deepEqual(result, [ + new Float32Array([0, 1, 2]), + new Float32Array([3, 4, 5]), + new Float32Array([6, 7, 8]), + ]); }); test('erect3DFloat', () => { - const array = new Float32Array([0, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 4, 0, 0, 0, 5, 0, 0, 0, 6, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0]); + const array = new Float32Array([ + 0, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 4, 0, 0, 0, 5, 0, 0, 0, 6, + 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, + ]); const result = utils.erect3DFloat(array, 2, 2, 2); assert.deepEqual(result, [ [new Float32Array([0, 1]), new Float32Array([2, 3])], @@ -316,12 +410,21 @@ test('erect3DFloat', () => { ]); }); test('erectArray2', () => { - const array = new Float32Array([0, 1, 0, 0, 2, 3, 0, 0, 4, 5, 0, 0, 6, 7, 0, 0]); + const array = new Float32Array([ + 0, 1, 0, 0, 2, 3, 0, 0, 4, 5, 0, 0, 6, 7, 0, 0, + ]); const result = utils.erectArray2(array, 4); - assert.deepEqual(result, [new Float32Array([0, 1]), new Float32Array([2, 3]), new Float32Array([4, 5]), new Float32Array([6, 7])]); + assert.deepEqual(result, [ + new Float32Array([0, 1]), + new Float32Array([2, 3]), + new Float32Array([4, 5]), + new Float32Array([6, 7]), + ]); }); test('erect2DArray2', () => { - const array = new Float32Array([0, 1, 0, 0, 2, 3, 0, 0, 4, 5, 0, 0, 6, 7, 0, 0]); + const array = new Float32Array([ + 0, 1, 0, 0, 2, 3, 0, 0, 4, 5, 0, 0, 6, 7, 0, 0, + ]); const result = utils.erect2DArray2(array, 2, 2); assert.deepEqual(result, [ [new Float32Array([0, 1]), new Float32Array([2, 3])], @@ -329,7 +432,10 @@ test('erect2DArray2', () => { ]); }); test('erect3DArray2', () => { - const array = new Float32Array([0, 1, 0, 0, 2, 3, 0, 0, 4, 5, 0, 0, 6, 7, 0, 0, 8, 9, 0, 0, 10, 11, 0, 0, 12, 13, 0, 0, 14, 15, 0, 0]); + const array = new Float32Array([ + 0, 1, 0, 0, 2, 3, 0, 0, 4, 5, 0, 0, 6, 7, 0, 0, 8, 9, 0, 0, 10, 11, 0, 0, + 12, 13, 0, 0, 14, 15, 0, 0, + ]); const result = utils.erect3DArray2(array, 2, 2, 2); assert.deepEqual(result, [ [ @@ -343,12 +449,21 @@ test('erect3DArray2', () => { ]); }); test('erectArray3', () => { - const array = new Float32Array([0, 1, 2, 0, 3, 4, 5, 0, 6, 7, 8, 0, 9, 10, 11, 0]); + const array = new Float32Array([ + 0, 1, 2, 0, 3, 4, 5, 0, 6, 7, 8, 0, 9, 10, 11, 0, + ]); const result = utils.erectArray3(array, 4); - assert.deepEqual(result, [new Float32Array([0, 1, 2]), new Float32Array([3, 4, 5]), new Float32Array([6, 7, 8]), new Float32Array([9, 10, 11])]); + assert.deepEqual(result, [ + new Float32Array([0, 1, 2]), + new Float32Array([3, 4, 5]), + new Float32Array([6, 7, 8]), + new Float32Array([9, 10, 11]), + ]); }); test('erect2DArray3', () => { - const array = new Float32Array([0, 1, 2, 0, 3, 4, 5, 0, 6, 7, 8, 0, 9, 10, 11, 0]); + const array = new Float32Array([ + 0, 1, 2, 0, 3, 4, 5, 0, 6, 7, 8, 0, 9, 10, 11, 0, + ]); const result = utils.erect2DArray3(array, 2, 2); assert.deepEqual(result, [ [new Float32Array([0, 1, 2]), new Float32Array([3, 4, 5])], @@ -356,7 +471,10 @@ test('erect2DArray3', () => { ]); }); test('erect3DArray3', () => { - const array = new Float32Array([0, 1, 2, 0, 3, 4, 5, 0, 6, 7, 8, 0, 9, 10, 11, 0, 12, 13, 14, 0, 15, 16, 17, 0, 18, 19, 20, 0, 21, 22, 23, 0]); + const array = new Float32Array([ + 0, 1, 2, 0, 3, 4, 5, 0, 6, 7, 8, 0, 9, 10, 11, 0, 12, 13, 14, 0, 15, 16, + 17, 0, 18, 19, 20, 0, 21, 22, 23, 0, + ]); const result = utils.erect3DArray3(array, 2, 2, 2); assert.deepEqual(result, [ [ @@ -370,12 +488,21 @@ test('erect3DArray3', () => { ]); }); test('erectArray4', () => { - const array = new Float32Array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]); + const array = new Float32Array([ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + ]); const result = utils.erectArray4(array, 4); - assert.deepEqual(result, [new Float32Array([0, 1, 2, 3]), new Float32Array([4, 5, 6, 7]), new Float32Array([8, 9, 10, 11]), new Float32Array([12, 13, 14, 15])]); + assert.deepEqual(result, [ + new Float32Array([0, 1, 2, 3]), + new Float32Array([4, 5, 6, 7]), + new Float32Array([8, 9, 10, 11]), + new Float32Array([12, 13, 14, 15]), + ]); }); test('erect2DArray4', () => { - const array = new Float32Array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]); + const array = new Float32Array([ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + ]); const result = utils.erect2DArray4(array, 2, 2); assert.deepEqual(result, [ [new Float32Array([0, 1, 2, 3]), new Float32Array([4, 5, 6, 7])], @@ -383,7 +510,10 @@ test('erect2DArray4', () => { ]); }); test('erect3DArray4', () => { - const array = new Float32Array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31]); + const array = new Float32Array([ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, + 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + ]); const result = utils.erect3DArray4(array, 2, 2, 2); assert.deepEqual(result, [ [ @@ -399,7 +529,26 @@ test('erect3DArray4', () => { test('flattenFunctionToString', () => { // since we use this internally, currently just testing if parsing simply works - [utils.erectPackedFloat, utils.erect2DPackedFloat, utils.erect3DPackedFloat, utils.erectMemoryOptimizedFloat, utils.erectMemoryOptimized2DFloat, utils.erectMemoryOptimized3DFloat, utils.erectFloat, utils.erect2DFloat, utils.erect3DFloat, utils.erectArray2, utils.erect2DArray2, utils.erect3DArray2, utils.erectArray3, utils.erect2DArray3, utils.erect3DArray3, utils.erectArray4, utils.erect2DArray4, utils.erect3DArray4].forEach(fn => + [ + utils.erectPackedFloat, + utils.erect2DPackedFloat, + utils.erect3DPackedFloat, + utils.erectMemoryOptimizedFloat, + utils.erectMemoryOptimized2DFloat, + utils.erectMemoryOptimized3DFloat, + utils.erectFloat, + utils.erect2DFloat, + utils.erect3DFloat, + utils.erectArray2, + utils.erect2DArray2, + utils.erect3DArray2, + utils.erectArray3, + utils.erect2DArray3, + utils.erect3DArray3, + utils.erectArray4, + utils.erect2DArray4, + utils.erect3DArray4, + ].forEach(fn => eval( utils.flattenFunctionToString(fn, { findDependency: () => {}, diff --git a/test/issues/114-create-kernel-map-run-second-time.js b/test/issues/114-create-kernel-map-run-second-time.js index 25c35fa0..05489115 100644 --- a/test/issues/114-create-kernel-map-run-second-time.js +++ b/test/issues/114-create-kernel-map-run-second-time.js @@ -26,18 +26,33 @@ function secondKernelMap(mode) { assert.deepEqual(Array.from(G), [2, 4, 6, 8, 10]); gpu.destroy(); } -(GPU.isKernelMapSupported ? test : skip)('Issue #114 - run createKernelMap the second time auto', () => { - secondKernelMap(); -}); -(GPU.isKernelMapSupported ? test : skip)('Issue #114 - run createKernelMap the second time gpu', () => { - secondKernelMap('gpu'); -}); -(GPU.isWebGLSupported ? test : skip)('Issue #114 - run createKernelMap the second time webgl', () => { - secondKernelMap('webgl'); -}); -(GPU.isWebGL2Supported ? test : skip)('Issue #114 - run createKernelMap the second time webgl2', () => { - secondKernelMap('webgl2'); -}); -(GPU.isHeadlessGLSupported && GPU.isKernelMapSupported ? test : skip)('Issue #114 - run createKernelMap the second time headlessgl', () => { - secondKernelMap('headlessgl'); -}); +(GPU.isKernelMapSupported ? test : skip)( + 'Issue #114 - run createKernelMap the second time auto', + () => { + secondKernelMap(); + } +); +(GPU.isKernelMapSupported ? test : skip)( + 'Issue #114 - run createKernelMap the second time gpu', + () => { + secondKernelMap('gpu'); + } +); +(GPU.isWebGLSupported ? test : skip)( + 'Issue #114 - run createKernelMap the second time webgl', + () => { + secondKernelMap('webgl'); + } +); +(GPU.isWebGL2Supported ? test : skip)( + 'Issue #114 - run createKernelMap the second time webgl2', + () => { + secondKernelMap('webgl2'); + } +); +(GPU.isHeadlessGLSupported && GPU.isKernelMapSupported ? test : skip)( + 'Issue #114 - run createKernelMap the second time headlessgl', + () => { + secondKernelMap('headlessgl'); + } +); diff --git a/test/issues/116-multiple-kernels-run-again.js b/test/issues/116-multiple-kernels-run-again.js index a1514c29..d2dc2151 100644 --- a/test/issues/116-multiple-kernels-run-again.js +++ b/test/issues/116-multiple-kernels-run-again.js @@ -36,25 +36,40 @@ function multipleKernels(mode) { gpu.destroy(); } -(GPU.isKernelMapSupported ? test : skip)('Issue #116 - multiple kernels run again auto', () => { - multipleKernels(); -}); +(GPU.isKernelMapSupported ? test : skip)( + 'Issue #116 - multiple kernels run again auto', + () => { + multipleKernels(); + } +); -(GPU.isKernelMapSupported ? test : skip)('Issue #116 - multiple kernels run again gpu', () => { - multipleKernels('gpu'); -}); +(GPU.isKernelMapSupported ? test : skip)( + 'Issue #116 - multiple kernels run again gpu', + () => { + multipleKernels('gpu'); + } +); -(GPU.isWebGLSupported ? test : skip)('Issue #116 - multiple kernels run again webgl', () => { - multipleKernels('webgl'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'Issue #116 - multiple kernels run again webgl', + () => { + multipleKernels('webgl'); + } +); -(GPU.isWebGL2Supported ? test : skip)('Issue #116 - multiple kernels run again webgl2', () => { - multipleKernels('webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'Issue #116 - multiple kernels run again webgl2', + () => { + multipleKernels('webgl2'); + } +); -(GPU.isHeadlessGLSupported && GPU.isKernelMapSupported ? test : skip)('Issue #116 - multiple kernels run again headlessgl', () => { - multipleKernels('headlessgl'); -}); +(GPU.isHeadlessGLSupported && GPU.isKernelMapSupported ? test : skip)( + 'Issue #116 - multiple kernels run again headlessgl', + () => { + multipleKernels('headlessgl'); + } +); test('Issue #116 - multiple kernels run again cpu', () => { multipleKernels('cpu'); diff --git a/test/issues/130-typed-array.js b/test/issues/130-typed-array.js index e1ba78dd..dc59d899 100644 --- a/test/issues/130-typed-array.js +++ b/test/issues/130-typed-array.js @@ -32,13 +32,19 @@ test('Issue #130 - typed array gpu', () => { typedArrays('webgl'); }); -(GPU.isWebGL2Supported ? test : skip)('Issue #130 - typed array webgl2', () => { - typedArrays('webgl2'); -}); - -(GPU.isHeadlessGLSupported ? test : skip)('Issue #130 - typed array headlessgl', () => { - typedArrays('headlessgl'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'Issue #130 - typed array webgl2', + () => { + typedArrays('webgl2'); + } +); + +(GPU.isHeadlessGLSupported ? test : skip)( + 'Issue #130 - typed array headlessgl', + () => { + typedArrays('headlessgl'); + } +); test('Issue #130 - typed array cpu', () => { typedArrays('cpu'); diff --git a/test/issues/147-missing-constant.js b/test/issues/147-missing-constant.js index 4b075ae0..0cc00b8d 100644 --- a/test/issues/147-missing-constant.js +++ b/test/issues/147-missing-constant.js @@ -30,17 +30,26 @@ test('Issue #147 - missing constant gpu', () => { missingConstant('gpu'); }); -(GPU.isWebGLSupported ? test : skip)('Issue #147 - missing constant webgl', () => { - missingConstant('webgl'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'Issue #147 - missing constant webgl', + () => { + missingConstant('webgl'); + } +); -(GPU.isWebGL2Supported ? test : skip)('Issue #147 - missing constant webgl2', () => { - missingConstant('webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'Issue #147 - missing constant webgl2', + () => { + missingConstant('webgl2'); + } +); -(GPU.isHeadlessGLSupported ? test : skip)('Issue #147 - missing constant headlessgl', () => { - missingConstant('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'Issue #147 - missing constant headlessgl', + () => { + missingConstant('headlessgl'); + } +); test('Issue #147 - missing constant cpu', () => { missingConstant('cpu'); diff --git a/test/issues/152-for-vars.js b/test/issues/152-for-vars.js index fdddd3d7..d12a3649 100644 --- a/test/issues/152-for-vars.js +++ b/test/issues/152-for-vars.js @@ -42,6 +42,9 @@ test('Issue #152 - for vars gpu', () => { forVars('webgl2'); }); -(GPU.isHeadlessGLSupported ? test : skip)('Issue #152 - for vars headlessgl', () => { - forVars('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'Issue #152 - for vars headlessgl', + () => { + forVars('headlessgl'); + } +); diff --git a/test/issues/159-3d.js b/test/issues/159-3d.js index 9391f543..d24b0360 100644 --- a/test/issues/159-3d.js +++ b/test/issues/159-3d.js @@ -61,9 +61,12 @@ describe('issue # 159'); threeD('webgl2'); }); - (GPU.isHeadlessGLSupported ? test : skip)('Issue #159 - for vars headlessgl', () => { - threeD('headlessgl'); - }); + (GPU.isHeadlessGLSupported ? test : skip)( + 'Issue #159 - for vars headlessgl', + () => { + threeD('headlessgl'); + } + ); test('Issue #159 - for vars cpu', () => { threeD('cpu'); diff --git a/test/issues/174-webgl-context-warning.js b/test/issues/174-webgl-context-warning.js index c037e032..9abff4e6 100644 --- a/test/issues/174-webgl-context-warning.js +++ b/test/issues/174-webgl-context-warning.js @@ -35,7 +35,11 @@ function manyKernels(mode, kernelCount, t) { ); kernel(input); kernel2(); - assert.strictEqual(kernel.context, kernel2.context, 'contexts should be the same object'); + assert.strictEqual( + kernel.context, + kernel2.context, + 'contexts should be the same object' + ); manyKernels(mode, kernelCount, t); const canvas = kernel.canvas; const eventListener = canvas.addEventListener('webglcontextlost', e => { @@ -46,10 +50,16 @@ function manyKernels(mode, kernelCount, t) { gpu.destroy(); } -(GPU.isWebGLSupported ? test : skip)('Issue #174 - webgl context leak webgl', t => { - manyKernels('webgl', 10, t); -}); +(GPU.isWebGLSupported ? test : skip)( + 'Issue #174 - webgl context leak webgl', + t => { + manyKernels('webgl', 10, t); + } +); -(GPU.isWebGL2Supported ? test : skip)('Issue #174 - webgl context leak webgl2', t => { - manyKernels('webgl2', 10, t); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'Issue #174 - webgl context leak webgl2', + t => { + manyKernels('webgl2', 10, t); + } +); diff --git a/test/issues/195-read-from-texture2d.js b/test/issues/195-read-from-texture2d.js index c38edf94..62f7207c 100644 --- a/test/issues/195-read-from-texture2d.js +++ b/test/issues/195-read-from-texture2d.js @@ -53,14 +53,23 @@ test('Issue #195 Read from Texture 2D (GPU only) gpu', () => { readFromTexture('gpu'); }); -(GPU.isWebGLSupported ? test : skip)('Issue #195 Read from Texture 2D (GPU only) webgl', () => { - readFromTexture('webgl'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'Issue #195 Read from Texture 2D (GPU only) webgl', + () => { + readFromTexture('webgl'); + } +); -(GPU.isWebGL2Supported ? test : skip)('Issue #195 Read from Texture 2D (GPU Only) webgl2', () => { - readFromTexture('webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'Issue #195 Read from Texture 2D (GPU Only) webgl2', + () => { + readFromTexture('webgl2'); + } +); -(GPU.isHeadlessGLSupported ? test : skip)('Issue #195 Read from Texture 2D (GPU Only) headlessgl', () => { - readFromTexture('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'Issue #195 Read from Texture 2D (GPU Only) headlessgl', + () => { + readFromTexture('headlessgl'); + } +); diff --git a/test/issues/207-same-function-reuse.js b/test/issues/207-same-function-reuse.js index f70398b3..a9e50f77 100644 --- a/test/issues/207-same-function-reuse.js +++ b/test/issues/207-same-function-reuse.js @@ -19,7 +19,10 @@ function sameFunctionReuse(mode) { function customAdder(customAdderArg1, customAdderArg2) { return customAdderArg1 + customAdderArg2; } - return someFun1(1, 2) + someFun2(kernelArg1[this.thread.x], kernelArg2[this.thread.x]); + return ( + someFun1(1, 2) + + someFun2(kernelArg1[this.thread.x], kernelArg2[this.thread.x]) + ); }) .setOutput([6]); @@ -38,17 +41,26 @@ test('Issue #207 - same function reuse gpu', () => { sameFunctionReuse('gpu'); }); -(GPU.isWebGLSupported ? test : skip)('Issue #207 - same function reuse webgl', () => { - sameFunctionReuse('webgl'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'Issue #207 - same function reuse webgl', + () => { + sameFunctionReuse('webgl'); + } +); -(GPU.isWebGL2Supported ? test : skip)('Issue #207 - same function reuse webgl2', () => { - sameFunctionReuse('webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'Issue #207 - same function reuse webgl2', + () => { + sameFunctionReuse('webgl2'); + } +); -(GPU.isHeadlessGLSupported ? test : skip)('Issue #207 - same function reuse headlessgl', () => { - sameFunctionReuse('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'Issue #207 - same function reuse headlessgl', + () => { + sameFunctionReuse('headlessgl'); + } +); test('Issue #207 - same function reuse cpu', () => { sameFunctionReuse('cpu'); diff --git a/test/issues/212-funky-function-support.js b/test/issues/212-funky-function-support.js index 7ab9f304..67052cae 100644 --- a/test/issues/212-funky-function-support.js +++ b/test/issues/212-funky-function-support.js @@ -44,17 +44,26 @@ test('Issue #212 - funky function support gpu', () => { funky('gpu'); }); -(GPU.isWebGLSupported ? test : skip)('Issue #212 - funky function support webgl', () => { - funky('webgl'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'Issue #212 - funky function support webgl', + () => { + funky('webgl'); + } +); -(GPU.isWebGL2Supported ? test : skip)('Issue #212 - funky function support webgl2', () => { - funky('webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'Issue #212 - funky function support webgl2', + () => { + funky('webgl2'); + } +); -(GPU.isHeadlessGLSupported ? test : skip)('Issue #212 - funky function support headlessgl', () => { - funky('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'Issue #212 - funky function support headlessgl', + () => { + funky('headlessgl'); + } +); test('Issue #212 - funky function support cpu', () => { funky('cpu'); diff --git a/test/issues/233-kernel-map-single-precision.js b/test/issues/233-kernel-map-single-precision.js index 6d3fa5a2..d947884e 100644 --- a/test/issues/233-kernel-map-single-precision.js +++ b/test/issues/233-kernel-map-single-precision.js @@ -57,25 +57,40 @@ function kernelMapSinglePrecision(mode) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported && GPU.isKernelMapSupported ? test : skip)('Issue #233 - kernel map with single precision auto', () => { - kernelMapSinglePrecision(); -}); +(GPU.isSinglePrecisionSupported && GPU.isKernelMapSupported ? test : skip)( + 'Issue #233 - kernel map with single precision auto', + () => { + kernelMapSinglePrecision(); + } +); -(GPU.isSinglePrecisionSupported && GPU.isKernelMapSupported ? test : skip)('Issue #233 - kernel map with single precision gpu', () => { - kernelMapSinglePrecision('gpu'); -}); +(GPU.isSinglePrecisionSupported && GPU.isKernelMapSupported ? test : skip)( + 'Issue #233 - kernel map with single precision gpu', + () => { + kernelMapSinglePrecision('gpu'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('Issue #233 - kernel map with single precision webgl', () => { - kernelMapSinglePrecision('webgl'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'Issue #233 - kernel map with single precision webgl', + () => { + kernelMapSinglePrecision('webgl'); + } +); -(GPU.isWebGL2Supported ? test : skip)('Issue #233 - kernel map with single precision webgl2', () => { - kernelMapSinglePrecision('webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'Issue #233 - kernel map with single precision webgl2', + () => { + kernelMapSinglePrecision('webgl2'); + } +); -(GPU.isHeadlessGLSupported && GPU.isKernelMapSupported ? test : skip)('Issue #233 - kernel map with single precision headlessgl', () => { - kernelMapSinglePrecision('headlessgl'); -}); +(GPU.isHeadlessGLSupported && GPU.isKernelMapSupported ? test : skip)( + 'Issue #233 - kernel map with single precision headlessgl', + () => { + kernelMapSinglePrecision('headlessgl'); + } +); test('Issue #233 - kernel map with single precision cpu', () => { kernelMapSinglePrecision('cpu'); @@ -163,25 +178,40 @@ function kernelMapSinglePrecision2D(mode) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported && GPU.isKernelMapSupported ? test : skip)('Issue #233 - kernel map with single precision 2d auto', () => { - kernelMapSinglePrecision2D(); -}); +(GPU.isSinglePrecisionSupported && GPU.isKernelMapSupported ? test : skip)( + 'Issue #233 - kernel map with single precision 2d auto', + () => { + kernelMapSinglePrecision2D(); + } +); -(GPU.isSinglePrecisionSupported && GPU.isKernelMapSupported ? test : skip)('Issue #233 - kernel map with single precision 2d gpu', () => { - kernelMapSinglePrecision2D('gpu'); -}); +(GPU.isSinglePrecisionSupported && GPU.isKernelMapSupported ? test : skip)( + 'Issue #233 - kernel map with single precision 2d gpu', + () => { + kernelMapSinglePrecision2D('gpu'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('Issue #233 - kernel map with single precision 2d webgl', () => { - kernelMapSinglePrecision2D('webgl'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'Issue #233 - kernel map with single precision 2d webgl', + () => { + kernelMapSinglePrecision2D('webgl'); + } +); -(GPU.isWebGL2Supported ? test : skip)('Issue #233 - kernel map with single precision 2d webgl2', () => { - kernelMapSinglePrecision2D('webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'Issue #233 - kernel map with single precision 2d webgl2', + () => { + kernelMapSinglePrecision2D('webgl2'); + } +); -(GPU.isHeadlessGLSupported && GPU.isKernelMapSupported ? test : skip)('Issue #233 - kernel map with single precision 2d headlessgl', () => { - kernelMapSinglePrecision2D('headlessgl'); -}); +(GPU.isHeadlessGLSupported && GPU.isKernelMapSupported ? test : skip)( + 'Issue #233 - kernel map with single precision 2d headlessgl', + () => { + kernelMapSinglePrecision2D('headlessgl'); + } +); test('Issue #233 - kernel map with single precision 2d cpu', () => { kernelMapSinglePrecision2D('cpu'); @@ -276,25 +306,40 @@ function kernelMapSinglePrecision3D(mode) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported && GPU.isKernelMapSupported ? test : skip)('Issue #233 - kernel map with single precision 3d auto', () => { - kernelMapSinglePrecision3D(); -}); +(GPU.isSinglePrecisionSupported && GPU.isKernelMapSupported ? test : skip)( + 'Issue #233 - kernel map with single precision 3d auto', + () => { + kernelMapSinglePrecision3D(); + } +); -(GPU.isSinglePrecisionSupported && GPU.isKernelMapSupported ? test : skip)('Issue #233 - kernel map with single precision 3d gpu', () => { - kernelMapSinglePrecision3D('gpu'); -}); +(GPU.isSinglePrecisionSupported && GPU.isKernelMapSupported ? test : skip)( + 'Issue #233 - kernel map with single precision 3d gpu', + () => { + kernelMapSinglePrecision3D('gpu'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('Issue #233 - kernel map with single precision 3d webgl', () => { - kernelMapSinglePrecision3D('webgl'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'Issue #233 - kernel map with single precision 3d webgl', + () => { + kernelMapSinglePrecision3D('webgl'); + } +); -(GPU.isWebGL2Supported ? test : skip)('Issue #233 - kernel map with single precision 3d webgl2', () => { - kernelMapSinglePrecision3D('webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'Issue #233 - kernel map with single precision 3d webgl2', + () => { + kernelMapSinglePrecision3D('webgl2'); + } +); -(GPU.isHeadlessGLSupported && GPU.isKernelMapSupported ? test : skip)('Issue #233 - kernel map with single precision 3d headlessgl', () => { - kernelMapSinglePrecision3D('headlessgl'); -}); +(GPU.isHeadlessGLSupported && GPU.isKernelMapSupported ? test : skip)( + 'Issue #233 - kernel map with single precision 3d headlessgl', + () => { + kernelMapSinglePrecision3D('headlessgl'); + } +); test('Issue #233 - kernel map with single precision 3d cpu', () => { kernelMapSinglePrecision3D('cpu'); diff --git a/test/issues/241-CPU-vs-GPU-maps-output-differently.js b/test/issues/241-CPU-vs-GPU-maps-output-differently.js index 56c388bb..19067a92 100644 --- a/test/issues/241-CPU-vs-GPU-maps-output-differently.js +++ b/test/issues/241-CPU-vs-GPU-maps-output-differently.js @@ -34,17 +34,26 @@ test('Issue #241 small 2d array input output test gpu', () => { buildIndexTestKernel('gpu'); }); -(GPU.isWebGLSupported ? test : skip)('Issue #241 small 2d array input output test webgl', () => { - buildIndexTestKernel('webgl'); -}); - -(GPU.isWebGL2Supported ? test : skip)('Issue #241 small 2d array input output test webgl2', () => { - buildIndexTestKernel('webgl2'); -}); - -(GPU.isHeadlessGLSupported ? test : skip)('Issue #241 small 2d array input output test headlessgl', () => { - buildIndexTestKernel('headlessgl'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'Issue #241 small 2d array input output test webgl', + () => { + buildIndexTestKernel('webgl'); + } +); + +(GPU.isWebGL2Supported ? test : skip)( + 'Issue #241 small 2d array input output test webgl2', + () => { + buildIndexTestKernel('webgl2'); + } +); + +(GPU.isHeadlessGLSupported ? test : skip)( + 'Issue #241 small 2d array input output test headlessgl', + () => { + buildIndexTestKernel('headlessgl'); + } +); test('Issue #241 small 2d array input output test cpu', () => { buildIndexTestKernel('cpu'); diff --git a/test/issues/259-atan2.js b/test/issues/259-atan2.js index c9853209..6d113467 100644 --- a/test/issues/259-atan2.js +++ b/test/issues/259-atan2.js @@ -33,9 +33,12 @@ test('Issue #259 atan2 - gpu', () => { buildAtan2KernelResult('webgl2'); }); -(GPU.isHeadlessGLSupported ? test : skip)('Issue #259 atan2 - headlessgl', () => { - buildAtan2KernelResult('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'Issue #259 atan2 - headlessgl', + () => { + buildAtan2KernelResult('headlessgl'); + } +); test('Issue #259 atan2 - cpu', () => { buildAtan2KernelResult('cpu'); diff --git a/test/issues/263-to-string.js b/test/issues/263-to-string.js index c0d90e4d..3560be38 100644 --- a/test/issues/263-to-string.js +++ b/test/issues/263-to-string.js @@ -21,21 +21,30 @@ function toString(mode, context, canvas) { gpu.destroy(); } -(GPU.isWebGLSupported ? test : skip)('Issue #263 toString single function - webgl', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl'); - toString('webgl', context, canvas); -}); +(GPU.isWebGLSupported ? test : skip)( + 'Issue #263 toString single function - webgl', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl'); + toString('webgl', context, canvas); + } +); -(GPU.isWebGL2Supported ? test : skip)('Issue #263 toString single function - webgl2', () => { - const canvas = document.createElement('canvas'); - const context = canvas.getContext('webgl2'); - toString('webgl2', context, canvas); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'Issue #263 toString single function - webgl2', + () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('webgl2'); + toString('webgl2', context, canvas); + } +); -(GPU.isHeadlessGLSupported ? test : skip)('Issue #263 toString single function - headlessgl', () => { - toString('headlessgl', require('gl')(1, 1), null); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'Issue #263 toString single function - headlessgl', + () => { + toString('headlessgl', require('gl')(1, 1), null); + } +); test('Issue #263 toString single function - cpu', () => { toString('cpu'); diff --git a/test/issues/267-immutable-sub-kernels.js b/test/issues/267-immutable-sub-kernels.js index d85ecc0e..30a8b137 100644 --- a/test/issues/267-immutable-sub-kernels.js +++ b/test/issues/267-immutable-sub-kernels.js @@ -43,17 +43,26 @@ test('Issue #267 immutable kernel output without floats - gpu', () => { immutableKernelWithoutFloats('gpu'); }); -(GPU.isWebGL2Supported ? test : skip)('Issue #267 immutable kernel output without floats - webgl', () => { - immutableKernelWithoutFloats('webgl'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'Issue #267 immutable kernel output without floats - webgl', + () => { + immutableKernelWithoutFloats('webgl'); + } +); -(GPU.isWebGL2Supported ? test : skip)('Issue #267 immutable kernel output without floats - webgl2', () => { - immutableKernelWithoutFloats('webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'Issue #267 immutable kernel output without floats - webgl2', + () => { + immutableKernelWithoutFloats('webgl2'); + } +); -(GPU.isHeadlessGLSupported ? test : skip)('Issue #267 immutable kernel output without floats - headlessgl', () => { - immutableKernelWithoutFloats('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'Issue #267 immutable kernel output without floats - headlessgl', + () => { + immutableKernelWithoutFloats('headlessgl'); + } +); function immutableKernelWithFloats(mode) { const gpu = new GPU({ mode }); @@ -82,25 +91,40 @@ function immutableKernelWithFloats(mode) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported ? test : skip)('Issue #267 immutable kernel output with floats - auto', () => { - immutableKernelWithFloats(); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'Issue #267 immutable kernel output with floats - auto', + () => { + immutableKernelWithFloats(); + } +); -(GPU.isSinglePrecisionSupported ? test : skip)('Issue #267 immutable kernel output with floats - gpu', () => { - immutableKernelWithFloats('gpu'); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'Issue #267 immutable kernel output with floats - gpu', + () => { + immutableKernelWithFloats('gpu'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('Issue #267 immutable kernel output with floats - webgl', () => { - immutableKernelWithFloats('webgl'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'Issue #267 immutable kernel output with floats - webgl', + () => { + immutableKernelWithFloats('webgl'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)('Issue #267 immutable kernel output with floats - webgl2', () => { - immutableKernelWithFloats('webgl2'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGL2Supported ? test : skip)( + 'Issue #267 immutable kernel output with floats - webgl2', + () => { + immutableKernelWithFloats('webgl2'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)('Issue #267 immutable kernel output with floats - headlessgl', () => { - immutableKernelWithFloats('headlessgl'); -}); +(GPU.isSinglePrecisionSupported && GPU.isHeadlessGLSupported ? test : skip)( + 'Issue #267 immutable kernel output with floats - headlessgl', + () => { + immutableKernelWithFloats('headlessgl'); + } +); describe('issue #267 sub kernel'); @@ -148,25 +172,40 @@ function immutableSubKernelsWithoutFloats(mode) { assert.equal(result3, 4); gpu.destroy(); } -(GPU.isKernelMapSupported ? test : skip)('Issue #267 immutable sub-kernel output - auto', () => { - immutableSubKernelsWithoutFloats(); -}); +(GPU.isKernelMapSupported ? test : skip)( + 'Issue #267 immutable sub-kernel output - auto', + () => { + immutableSubKernelsWithoutFloats(); + } +); -(GPU.isKernelMapSupported ? test : skip)('Issue #267 immutable sub-kernel output - gpu', () => { - immutableSubKernelsWithoutFloats('gpu'); -}); +(GPU.isKernelMapSupported ? test : skip)( + 'Issue #267 immutable sub-kernel output - gpu', + () => { + immutableSubKernelsWithoutFloats('gpu'); + } +); -(GPU.isWebGLSupported ? test : skip)('Issue #267 immutable sub-kernel output - webgl', () => { - immutableSubKernelsWithoutFloats('webgl'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'Issue #267 immutable sub-kernel output - webgl', + () => { + immutableSubKernelsWithoutFloats('webgl'); + } +); -(GPU.isWebGL2Supported ? test : skip)('Issue #267 immutable sub-kernel output - webgl2', () => { - immutableSubKernelsWithoutFloats('webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'Issue #267 immutable sub-kernel output - webgl2', + () => { + immutableSubKernelsWithoutFloats('webgl2'); + } +); -(GPU.isHeadlessGLSupported && GPU.isKernelMapSupported ? test : skip)('Issue #267 immutable sub-kernel output - headlessgl', () => { - immutableSubKernelsWithoutFloats('headlessgl'); -}); +(GPU.isHeadlessGLSupported && GPU.isKernelMapSupported ? test : skip)( + 'Issue #267 immutable sub-kernel output - headlessgl', + () => { + immutableSubKernelsWithoutFloats('headlessgl'); + } +); describe('issue #267 sub kernels mixed'); @@ -224,25 +263,40 @@ function immutableKernelsMixedWithoutFloats(mode) { gpu.destroy(); } -(GPU.isKernelMapSupported ? test : skip)('Issue #267 immutable kernel & sub-kernel output without floats - auto', () => { - immutableKernelsMixedWithoutFloats(); -}); +(GPU.isKernelMapSupported ? test : skip)( + 'Issue #267 immutable kernel & sub-kernel output without floats - auto', + () => { + immutableKernelsMixedWithoutFloats(); + } +); -(GPU.isKernelMapSupported ? test : skip)('Issue #267 immutable kernel & sub-kernel output without floats - gpu', () => { - immutableKernelsMixedWithoutFloats('gpu'); -}); +(GPU.isKernelMapSupported ? test : skip)( + 'Issue #267 immutable kernel & sub-kernel output without floats - gpu', + () => { + immutableKernelsMixedWithoutFloats('gpu'); + } +); -(GPU.isWebGLSupported ? test : skip)('Issue #267 immutable kernel & sub-kernel output without floats - webgl', () => { - immutableKernelsMixedWithoutFloats('webgl'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'Issue #267 immutable kernel & sub-kernel output without floats - webgl', + () => { + immutableKernelsMixedWithoutFloats('webgl'); + } +); -(GPU.isWebGL2Supported ? test : skip)('Issue #267 immutable kernel & sub-kernel output without floats - webgl2', () => { - immutableKernelsMixedWithoutFloats('webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'Issue #267 immutable kernel & sub-kernel output without floats - webgl2', + () => { + immutableKernelsMixedWithoutFloats('webgl2'); + } +); -(GPU.isHeadlessGLSupported && GPU.isKernelMapSupported ? test : skip)('Issue #267 immutable kernel & sub-kernel output without floats - headlessgl', () => { - immutableKernelsMixedWithoutFloats('headlessgl'); -}); +(GPU.isHeadlessGLSupported && GPU.isKernelMapSupported ? test : skip)( + 'Issue #267 immutable kernel & sub-kernel output without floats - headlessgl', + () => { + immutableKernelsMixedWithoutFloats('headlessgl'); + } +); test('Issue #267 immutable kernel & sub-kernel output without floats - cpu', () => { immutableKernelsMixedWithoutFloats('cpu'); diff --git a/test/issues/279-wrong-canvas-size.js b/test/issues/279-wrong-canvas-size.js index 18138346..08545bcd 100644 --- a/test/issues/279-wrong-canvas-size.js +++ b/test/issues/279-wrong-canvas-size.js @@ -32,25 +32,37 @@ function wrongCanvasSizeOptimized(mode) { gpu.destroy(); } -(GPU.isCanvasSupported ? test : skip)('Issue #279 wrong canvas size optimized - cpu', () => { - wrongCanvasSizeOptimized('cpu'); -}); +(GPU.isCanvasSupported ? test : skip)( + 'Issue #279 wrong canvas size optimized - cpu', + () => { + wrongCanvasSizeOptimized('cpu'); + } +); test('Issue #279 wrong canvas size optimized - gpu', () => { wrongCanvasSizeOptimized('gpu'); }); -(GPU.isWebGLSupported ? test : skip)('Issue #279 wrong canvas size optimized - webgl', () => { - wrongCanvasSizeOptimized('webgl'); -}); - -(GPU.isWebGL2Supported ? test : skip)('Issue #279 wrong canvas size optimized - webgl2', () => { - wrongCanvasSizeOptimized('webgl2'); -}); - -(GPU.isHeadlessGLSupported ? test : skip)('Issue #279 wrong canvas size optimized - headlessgl', () => { - wrongCanvasSizeOptimized('headlessgl'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'Issue #279 wrong canvas size optimized - webgl', + () => { + wrongCanvasSizeOptimized('webgl'); + } +); + +(GPU.isWebGL2Supported ? test : skip)( + 'Issue #279 wrong canvas size optimized - webgl2', + () => { + wrongCanvasSizeOptimized('webgl2'); + } +); + +(GPU.isHeadlessGLSupported ? test : skip)( + 'Issue #279 wrong canvas size optimized - headlessgl', + () => { + wrongCanvasSizeOptimized('headlessgl'); + } +); function wrongCanvasSizeUnoptimized(mode) { const gpu = new GPU({ mode }); @@ -78,22 +90,34 @@ function wrongCanvasSizeUnoptimized(mode) { gpu.destroy(); } -(GPU.isCanvasSupported ? test : skip)('Issue #279 wrong canvas size unoptimized - cpu', () => { - wrongCanvasSizeUnoptimized('cpu'); -}); +(GPU.isCanvasSupported ? test : skip)( + 'Issue #279 wrong canvas size unoptimized - cpu', + () => { + wrongCanvasSizeUnoptimized('cpu'); + } +); test('Issue #279 wrong canvas size unoptimized - gpu', () => { wrongCanvasSizeUnoptimized('gpu'); }); -(GPU.isWebGLSupported ? test : skip)('Issue #279 wrong canvas size unoptimized - webgl', () => { - wrongCanvasSizeUnoptimized('webgl'); -}); - -(GPU.isWebGL2Supported ? test : skip)('Issue #279 wrong canvas size unoptimized - webgl2', () => { - wrongCanvasSizeUnoptimized('webgl2'); -}); - -(GPU.isHeadlessGLSupported ? test : skip)('Issue #279 wrong canvas size unoptimized - headlessgl', () => { - wrongCanvasSizeUnoptimized('headlessgl'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'Issue #279 wrong canvas size unoptimized - webgl', + () => { + wrongCanvasSizeUnoptimized('webgl'); + } +); + +(GPU.isWebGL2Supported ? test : skip)( + 'Issue #279 wrong canvas size unoptimized - webgl2', + () => { + wrongCanvasSizeUnoptimized('webgl2'); + } +); + +(GPU.isHeadlessGLSupported ? test : skip)( + 'Issue #279 wrong canvas size unoptimized - headlessgl', + () => { + wrongCanvasSizeUnoptimized('headlessgl'); + } +); diff --git a/test/issues/300-nested-array-index.js b/test/issues/300-nested-array-index.js index 14f0b935..379049c9 100644 --- a/test/issues/300-nested-array-index.js +++ b/test/issues/300-nested-array-index.js @@ -36,17 +36,26 @@ test('Issue #300 nested array index - gpu', () => { nestedArrayIndex('gpu'); }); -(GPU.isWebGLSupported ? test : skip)('Issue #300 nested array index - webgl', () => { - nestedArrayIndex('webgl'); -}); - -(GPU.isWebGL2Supported ? test : skip)('Issue #300 nested array index - webgl2', () => { - nestedArrayIndex('webgl2'); -}); - -(GPU.isHeadlessGLSupported ? test : skip)('Issue #300 nested array index - headlessgl', () => { - nestedArrayIndex('headlessgl'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'Issue #300 nested array index - webgl', + () => { + nestedArrayIndex('webgl'); + } +); + +(GPU.isWebGL2Supported ? test : skip)( + 'Issue #300 nested array index - webgl2', + () => { + nestedArrayIndex('webgl2'); + } +); + +(GPU.isHeadlessGLSupported ? test : skip)( + 'Issue #300 nested array index - headlessgl', + () => { + nestedArrayIndex('headlessgl'); + } +); test('Issue #300 nested array index - cpu', () => { nestedArrayIndex('cpu'); diff --git a/test/issues/31-nested-var-declare-test.js b/test/issues/31-nested-var-declare-test.js index 2a87d935..9fed2a2d 100644 --- a/test/issues/31-nested-var-declare-test.js +++ b/test/issues/31-nested-var-declare-test.js @@ -1,5 +1,11 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU, FunctionBuilder, WebGLFunctionNode, WebGL2FunctionNode, CPUFunctionNode } = require('../../src'); +const { + GPU, + FunctionBuilder, + WebGLFunctionNode, + WebGL2FunctionNode, + CPUFunctionNode, +} = require('../../src'); describe('issue #31 redeclare'); @@ -37,17 +43,26 @@ test('Issue #31 - nestedVarRedeclare gpu', () => { nestedVarRedeclareTest('gpu'); }); -(GPU.isWebGLSupported ? test : skip)('Issue #31 - nestedVarRedeclare webgl', () => { - nestedVarRedeclareTest('webgl'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'Issue #31 - nestedVarRedeclare webgl', + () => { + nestedVarRedeclareTest('webgl'); + } +); -(GPU.isWebGL2Supported ? test : skip)('Issue #31 - nestedVarRedeclare webgl2', () => { - nestedVarRedeclareTest('webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'Issue #31 - nestedVarRedeclare webgl2', + () => { + nestedVarRedeclareTest('webgl2'); + } +); -(GPU.isHeadlessGLSupported ? test : skip)('Issue #31 - nestedVarRedeclare headlessgl', () => { - nestedVarRedeclareTest('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'Issue #31 - nestedVarRedeclare headlessgl', + () => { + nestedVarRedeclareTest('headlessgl'); + } +); test('Issue #31 - nestedVarRedeclare cpu', () => { nestedVarRedeclareTest('cpu'); @@ -129,17 +144,26 @@ test('Issue #31 - nestedVarDeclare gpu', () => { nestedVarDeclareTest('gpu'); }); -(GPU.isWebGLSupported ? test : skip)('Issue #31 - nestedVarDeclare webgl', () => { - nestedVarDeclareTest('webgl'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'Issue #31 - nestedVarDeclare webgl', + () => { + nestedVarDeclareTest('webgl'); + } +); -(GPU.isWebGL2Supported ? test : skip)('Issue #31 - nestedVarDeclare webgl2', () => { - nestedVarDeclareTest('webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'Issue #31 - nestedVarDeclare webgl2', + () => { + nestedVarDeclareTest('webgl2'); + } +); -(GPU.isHeadlessGLSupported ? test : skip)('Issue #31 - nestedVarDeclare headlessgl', () => { - nestedVarDeclareTest('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'Issue #31 - nestedVarDeclare headlessgl', + () => { + nestedVarDeclareTest('headlessgl'); + } +); test('Issue #31 - nestedVarDeclare cpu', () => { nestedVarDeclareTest('cpu'); @@ -200,5 +224,16 @@ test('Issue #31 - nestedVarDeclare : AST handling cpu', () => { ], }); - assert.equal(builder.getStringFromFunctionNames(['nestedVarDeclareFunction']), 'function nestedVarDeclareFunction() {' + '\nlet user_result=0;' + '\nfor (let user_i=0;(user_i<10);++user_i){' + '\nfor (let user_i=0;(user_i<20);++user_i){' + '\nuser_result+=1;}' + '\n}' + '\n' + '\nreturn user_result;' + '\n}'); + assert.equal( + builder.getStringFromFunctionNames(['nestedVarDeclareFunction']), + 'function nestedVarDeclareFunction() {' + + '\nlet user_result=0;' + + '\nfor (let user_i=0;(user_i<10);++user_i){' + + '\nfor (let user_i=0;(user_i<20);++user_i){' + + '\nuser_result+=1;}' + + '\n}' + + '\n' + + '\nreturn user_result;' + + '\n}' + ); }); diff --git a/test/issues/313-variable-lookup.js b/test/issues/313-variable-lookup.js index 722e403b..feeb164c 100644 --- a/test/issues/313-variable-lookup.js +++ b/test/issues/313-variable-lookup.js @@ -35,15 +35,24 @@ test('Issue #313 Mismatch argument lookup - auto', () => { test('Issue #313 Mismatch argument lookup - gpu', () => { variableLookup('gpu'); }); -(GPU.isWebGLSupported ? test : skip)('Issue #313 Mismatch argument lookup - webgl', () => { - variableLookup('webgl'); -}); -(GPU.isWebGL2Supported ? test : skip)('Issue #313 Mismatch argument lookup - webgl2', () => { - variableLookup('webgl2'); -}); -(GPU.isHeadlessGLSupported ? test : skip)('Issue #313 Mismatch argument lookup - headlessgl', () => { - variableLookup('headlessgl'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'Issue #313 Mismatch argument lookup - webgl', + () => { + variableLookup('webgl'); + } +); +(GPU.isWebGL2Supported ? test : skip)( + 'Issue #313 Mismatch argument lookup - webgl2', + () => { + variableLookup('webgl2'); + } +); +(GPU.isHeadlessGLSupported ? test : skip)( + 'Issue #313 Mismatch argument lookup - headlessgl', + () => { + variableLookup('headlessgl'); + } +); test('Issue #313 Mismatch argument lookup - cpu', () => { variableLookup('cpu'); }); diff --git a/test/issues/314-large-input-array-addressing.js b/test/issues/314-large-input-array-addressing.js index 5831c2b3..7d58e2a6 100644 --- a/test/issues/314-large-input-array-addressing.js +++ b/test/issues/314-large-input-array-addressing.js @@ -7,7 +7,9 @@ describe('issue #314'); // after this fix max addressing is 2^31 which is the max a int32 can handle // run out of heap before being able to create a butter that big! // wanted to use uints but caused more problems than it solved -const DATA_MAX = (GPU.isHeadlessGLSupported ? HeadlessGLKernel : WebGLKernel).features.maxTextureSize * 8; +const DATA_MAX = + (GPU.isHeadlessGLSupported ? HeadlessGLKernel : WebGLKernel).features + .maxTextureSize * 8; const divisor = 100; const data = new Uint16Array(DATA_MAX); let v = 0; @@ -52,13 +54,22 @@ test('Issue #314 Large array addressing - gpu', () => { buildLargeArrayAddressKernel('gpu'); }); -(GPU.isWebGLSupported ? test : skip)('Issue #314 Large array addressing - webgl', () => { - buildLargeArrayAddressKernel('webgl'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'Issue #314 Large array addressing - webgl', + () => { + buildLargeArrayAddressKernel('webgl'); + } +); -(GPU.isWebGL2Supported ? test : skip)('Issue #314 Large array addressing - webgl2', () => { - buildLargeArrayAddressKernel('webgl2'); -}); -(GPU.isHeadlessGLSupported ? test : skip)('Issue #314 Large array addressing - headlessgl', () => { - buildLargeArrayAddressKernel('headlessgl'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'Issue #314 Large array addressing - webgl2', + () => { + buildLargeArrayAddressKernel('webgl2'); + } +); +(GPU.isHeadlessGLSupported ? test : skip)( + 'Issue #314 Large array addressing - headlessgl', + () => { + buildLargeArrayAddressKernel('headlessgl'); + } +); diff --git a/test/issues/346-uint8array-converted.js b/test/issues/346-uint8array-converted.js index 9b1e501d..4e29c297 100644 --- a/test/issues/346-uint8array-converted.js +++ b/test/issues/346-uint8array-converted.js @@ -36,26 +36,44 @@ function buildUintArrayInputKernel(mode, data) { gpu.destroy(); } -(GPU.isWebGLSupported ? test : skip)('Issue #346 uint8 input array - webgl', () => { - buildUintArrayInputKernel('webgl', uint8data); -}); +(GPU.isWebGLSupported ? test : skip)( + 'Issue #346 uint8 input array - webgl', + () => { + buildUintArrayInputKernel('webgl', uint8data); + } +); -(GPU.isWebGL2Supported ? test : skip)('Issue #346 uint8 input array - webgl2', () => { - buildUintArrayInputKernel('webgl2', uint8data); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'Issue #346 uint8 input array - webgl2', + () => { + buildUintArrayInputKernel('webgl2', uint8data); + } +); -(GPU.isHeadlessGLSupported ? test : skip)('Issue #346 uint8 input array - headlessgl', () => { - buildUintArrayInputKernel('headlessgl', uint8data); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'Issue #346 uint8 input array - headlessgl', + () => { + buildUintArrayInputKernel('headlessgl', uint8data); + } +); -(GPU.isWebGLSupported ? test : skip)('Issue #346 uint16 input array - webgl', () => { - buildUintArrayInputKernel('webgl', uint16data); -}); +(GPU.isWebGLSupported ? test : skip)( + 'Issue #346 uint16 input array - webgl', + () => { + buildUintArrayInputKernel('webgl', uint16data); + } +); -(GPU.isWebGL2Supported ? test : skip)('Issue #346 uint16 input array - webgl2', () => { - buildUintArrayInputKernel('webgl2', uint16data); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'Issue #346 uint16 input array - webgl2', + () => { + buildUintArrayInputKernel('webgl2', uint16data); + } +); -(GPU.isHeadlessGLSupported ? test : skip)('Issue #346 uint16 input array - headlessgl', () => { - buildUintArrayInputKernel('headlessgl', uint16data); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'Issue #346 uint16 input array - headlessgl', + () => { + buildUintArrayInputKernel('headlessgl', uint16data); + } +); diff --git a/test/issues/349-division-by-factors-of-3.js b/test/issues/349-division-by-factors-of-3.js index d5f73c31..c36ac7c8 100644 --- a/test/issues/349-division-by-factors-of-3.js +++ b/test/issues/349-division-by-factors-of-3.js @@ -18,25 +18,40 @@ function testDivideByThree(mode) { gpu.destroy(); } -(GPU.isSinglePrecisionSupported ? test : skip)('Issue #349 - divide by three auto', () => { - testDivideByThree(); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'Issue #349 - divide by three auto', + () => { + testDivideByThree(); + } +); -(GPU.isSinglePrecisionSupported ? test : skip)('Issue #349 - divide by three gpu', () => { - testDivideByThree('gpu'); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'Issue #349 - divide by three gpu', + () => { + testDivideByThree('gpu'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('Issue #349 - divide by three webgl', () => { - testDivideByThree('webgl'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'Issue #349 - divide by three webgl', + () => { + testDivideByThree('webgl'); + } +); -(GPU.isWebGL2Supported ? test : skip)('Issue #349 - divide by three webgl2', () => { - testDivideByThree('webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'Issue #349 - divide by three webgl2', + () => { + testDivideByThree('webgl2'); + } +); -(GPU.isHeadlessGLSupported ? test : skip)('Issue #349 - divide by three headlessgl', () => { - testDivideByThree('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'Issue #349 - divide by three headlessgl', + () => { + testDivideByThree('headlessgl'); + } +); test('Issue #349 - divide by three cpu', () => { testDivideByThree('cpu'); @@ -51,8 +66,14 @@ function someRandomWholeNumberDivisions(mode) { const expectedResults = new Float32Array(DATA_MAX); const maxWholeNumberRepresentation = Math.sqrt(16777217); for (let i = 0; i < DATA_MAX; i++) { - divisorData[i] = parseInt(Math.random() * maxWholeNumberRepresentation + 1, 10); - expectedResults[i] = parseInt(Math.random() * maxWholeNumberRepresentation + 1, 10); + divisorData[i] = parseInt( + Math.random() * maxWholeNumberRepresentation + 1, + 10 + ); + expectedResults[i] = parseInt( + Math.random() * maxWholeNumberRepresentation + 1, + 10 + ); dividendData[i] = divisorData[i] * expectedResults[i]; } const gpu = new GPU({ mode }); @@ -74,25 +95,50 @@ function someRandomWholeNumberDivisions(mode) { break; } } - assert.ok(same, same ? '' : 'not all elements are the same, failed on index:' + i + ' ' + dividendData[i] + '/' + divisorData[i]); + assert.ok( + same, + same + ? '' + : 'not all elements are the same, failed on index:' + + i + + ' ' + + dividendData[i] + + '/' + + divisorData[i] + ); gpu.destroy(); } -(GPU.isSinglePrecisionSupported ? test : skip)('Issue #349 - some random whole number divisions auto', () => { - someRandomWholeNumberDivisions(); -}); -(GPU.isSinglePrecisionSupported ? test : skip)('Issue #349 - some random whole number divisions gpu', () => { - someRandomWholeNumberDivisions('gpu'); -}); -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('Issue #349 - some random whole number divisions webgl', () => { - someRandomWholeNumberDivisions('webgl'); -}); -(GPU.isWebGL2Supported ? test : skip)('Issue #349 - some random whole number divisions webgl2', () => { - someRandomWholeNumberDivisions('webgl2'); -}); -(GPU.isHeadlessGLSupported ? test : skip)('Issue #349 - some random whole number divisions headlessgl', () => { - someRandomWholeNumberDivisions('headlessgl'); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'Issue #349 - some random whole number divisions auto', + () => { + someRandomWholeNumberDivisions(); + } +); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'Issue #349 - some random whole number divisions gpu', + () => { + someRandomWholeNumberDivisions('gpu'); + } +); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'Issue #349 - some random whole number divisions webgl', + () => { + someRandomWholeNumberDivisions('webgl'); + } +); +(GPU.isWebGL2Supported ? test : skip)( + 'Issue #349 - some random whole number divisions webgl2', + () => { + someRandomWholeNumberDivisions('webgl2'); + } +); +(GPU.isHeadlessGLSupported ? test : skip)( + 'Issue #349 - some random whole number divisions headlessgl', + () => { + someRandomWholeNumberDivisions('headlessgl'); + } +); test('Issue #349 - some random whole number divisions cpu', () => { someRandomWholeNumberDivisions('cpu'); }); @@ -120,31 +166,54 @@ function testDisableFixIntegerDivisionBug(mode) { ); if (!gpu.Kernel.features.isIntegerDivisionAccurate) { - assert.ok(idFix(6, 3)[0] === 2 && idFix(6030401, 3991)[0] === 1511 && (idDixOff(6, 3)[0] !== 2 || idDixOff(6030401, 3991)[0] !== 1511), 'when bug is present should show bug!'); + assert.ok( + idFix(6, 3)[0] === 2 && + idFix(6030401, 3991)[0] === 1511 && + (idDixOff(6, 3)[0] !== 2 || idDixOff(6030401, 3991)[0] !== 1511), + 'when bug is present should show bug!' + ); } else { - assert.ok(idFix(6, 3)[0] === 2 && idDixOff(6, 3)[0] === 2, "when bug isn't present should not show bug!"); + assert.ok( + idFix(6, 3)[0] === 2 && idDixOff(6, 3)[0] === 2, + "when bug isn't present should not show bug!" + ); } gpu.destroy(); } -(GPU.isSinglePrecisionSupported ? test : skip)('Issue #349 - test disable fix integer division bug auto', () => { - testDisableFixIntegerDivisionBug(); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'Issue #349 - test disable fix integer division bug auto', + () => { + testDisableFixIntegerDivisionBug(); + } +); -(GPU.isSinglePrecisionSupported ? test : skip)('Issue #349 - test disable fix integer division bug gpu', () => { - testDisableFixIntegerDivisionBug('gpu'); -}); +(GPU.isSinglePrecisionSupported ? test : skip)( + 'Issue #349 - test disable fix integer division bug gpu', + () => { + testDisableFixIntegerDivisionBug('gpu'); + } +); -(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)('Issue #349 - test disable fix integer division bug webgl', () => { - testDisableFixIntegerDivisionBug('webgl'); -}); +(GPU.isSinglePrecisionSupported && GPU.isWebGLSupported ? test : skip)( + 'Issue #349 - test disable fix integer division bug webgl', + () => { + testDisableFixIntegerDivisionBug('webgl'); + } +); -(GPU.isWebGL2Supported ? test : skip)('Issue #349 - test disable fix integer division bug webgl2', () => { - testDisableFixIntegerDivisionBug('webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'Issue #349 - test disable fix integer division bug webgl2', + () => { + testDisableFixIntegerDivisionBug('webgl2'); + } +); -(GPU.isHeadlessGLSupported ? test : skip)('Issue #349 - test disable fix integer division bug headlessgl', () => { - testDisableFixIntegerDivisionBug('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'Issue #349 - test disable fix integer division bug headlessgl', + () => { + testDisableFixIntegerDivisionBug('headlessgl'); + } +); test('Issue #349 - test disable fix integer division bug cpu', () => { testDisableFixIntegerDivisionBug('cpu'); diff --git a/test/issues/357-modulus-issue.js b/test/issues/357-modulus-issue.js index 868991b2..7dab4df8 100644 --- a/test/issues/357-modulus-issue.js +++ b/test/issues/357-modulus-issue.js @@ -25,14 +25,23 @@ function testModKernel(mode) { gpu.destroy(); } -(GPU.isWebGLSupported ? test : skip)('Issue #357 - modulus issue webgl', () => { - testModKernel('webgl'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'Issue #357 - modulus issue webgl', + () => { + testModKernel('webgl'); + } +); -(GPU.isWebGL2Supported ? test : skip)('Issue #357 - modulus issue webgl2', () => { - testModKernel('webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'Issue #357 - modulus issue webgl2', + () => { + testModKernel('webgl2'); + } +); -(GPU.isHeadlessGLSupported ? test : skip)('Issue #357 - modulus issue headlessgl', () => { - testModKernel('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'Issue #357 - modulus issue headlessgl', + () => { + testModKernel('headlessgl'); + } +); diff --git a/test/issues/359-addfunction-params-wrong.js b/test/issues/359-addfunction-params-wrong.js index 4c630ecf..9f54f6ca 100644 --- a/test/issues/359-addfunction-params-wrong.js +++ b/test/issues/359-addfunction-params-wrong.js @@ -31,14 +31,23 @@ function testAddFunctionKernel(mode) { gpu.destroy(); } -(GPU.isWebGLSupported ? test : skip)('Issue #359 - addFunction calls addFunction issue webgl', () => { - testAddFunctionKernel('webgl'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'Issue #359 - addFunction calls addFunction issue webgl', + () => { + testAddFunctionKernel('webgl'); + } +); -(GPU.isWebGL2Supported ? test : skip)('Issue #359 - addFunction calls addFunction issue webgl2', () => { - testAddFunctionKernel('webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'Issue #359 - addFunction calls addFunction issue webgl2', + () => { + testAddFunctionKernel('webgl2'); + } +); -(GPU.isHeadlessGLSupported ? test : skip)('Issue #359 - addFunction calls addFunction issue headlessgl', () => { - testAddFunctionKernel('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'Issue #359 - addFunction calls addFunction issue headlessgl', + () => { + testAddFunctionKernel('headlessgl'); + } +); diff --git a/test/issues/378-only-first-iteration.js b/test/issues/378-only-first-iteration.js index b5214b81..58e3b672 100644 --- a/test/issues/378-only-first-iteration.js +++ b/test/issues/378-only-first-iteration.js @@ -21,18 +21,30 @@ function testOnlyFirstIterationSafari(mode) { const result = kernel(5); - assert.deepEqual(Array.from(result), [18, 18, 18, 18, 18, 18, 18, 18, 18, 18]); + assert.deepEqual( + Array.from(result), + [18, 18, 18, 18, 18, 18, 18, 18, 18, 18] + ); gpu.destroy(); } -(GPU.isWebGLSupported ? test : skip)('Issue #378 - only first iteration safari webgl', () => { - testOnlyFirstIterationSafari('webgl'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'Issue #378 - only first iteration safari webgl', + () => { + testOnlyFirstIterationSafari('webgl'); + } +); -(GPU.isWebGL2Supported ? test : skip)('Issue #378 - only first iteration safari webgl2', () => { - testOnlyFirstIterationSafari('webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'Issue #378 - only first iteration safari webgl2', + () => { + testOnlyFirstIterationSafari('webgl2'); + } +); -(GPU.isHeadlessGLSupported ? test : skip)('Issue #378 - only first iteration safari headlessgl', () => { - testOnlyFirstIterationSafari('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'Issue #378 - only first iteration safari headlessgl', + () => { + testOnlyFirstIterationSafari('headlessgl'); + } +); diff --git a/test/issues/382-bad-constant.js b/test/issues/382-bad-constant.js index ded3b512..7811dee3 100644 --- a/test/issues/382-bad-constant.js +++ b/test/issues/382-bad-constant.js @@ -8,7 +8,9 @@ function testModKernel(mode) { const conflictingName = 0.4; const kernel = gpu .createKernel(function (a, conflictingName) { - return a[this.thread.x] + this.constants.conflictingName + conflictingName; + return ( + a[this.thread.x] + this.constants.conflictingName + conflictingName + ); }) .setOutput([1]) .setConstants({ @@ -25,10 +27,16 @@ function testModKernel(mode) { testModKernel('webgl'); }); -(GPU.isWebGL2Supported ? test : skip)('Issue #382 - bad constant webgl2', () => { - testModKernel('webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'Issue #382 - bad constant webgl2', + () => { + testModKernel('webgl2'); + } +); -(GPU.isHeadlessGLSupported ? test : skip)('Issue #382 - bad constant headlessgl', () => { - testModKernel('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'Issue #382 - bad constant headlessgl', + () => { + testModKernel('headlessgl'); + } +); diff --git a/test/issues/390-thread-assignment.js b/test/issues/390-thread-assignment.js index f3e73bde..7864ea5f 100644 --- a/test/issues/390-thread-assignment.js +++ b/test/issues/390-thread-assignment.js @@ -1,5 +1,9 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { WebGLFunctionNode, WebGL2FunctionNode, CPUFunctionNode } = require('../../src'); +const { + WebGLFunctionNode, + WebGL2FunctionNode, + CPUFunctionNode, +} = require('../../src'); describe('issue #390'); @@ -13,7 +17,15 @@ test('Issue #390 - thread assignment webgl', function (assert) { }.toString(), { output: [1], returnType: 'Number' } ); - assert.equal(node.toString(), 'float assignThreadToVar() {' + '\nfloat user_x=float(threadId.x);' + '\nfloat user_y=float(threadId.y);' + '\nfloat user_sum=(user_x+user_y);' + '\nreturn user_sum;' + '\n}'); + assert.equal( + node.toString(), + 'float assignThreadToVar() {' + + '\nfloat user_x=float(threadId.x);' + + '\nfloat user_y=float(threadId.y);' + + '\nfloat user_sum=(user_x+user_y);' + + '\nreturn user_sum;' + + '\n}' + ); const { x, y, sum } = node.contexts[1]; assert.equal(x.name, 'x'); assert.equal(x.valueType, 'Number'); @@ -33,7 +45,15 @@ test('Issue #390 - thread assignment webgl2', function (assert) { }.toString(), { output: [1], returnType: 'Number' } ); - assert.equal(node.toString(), 'float assignThreadToVar() {' + '\nfloat user_x=float(threadId.x);' + '\nfloat user_y=float(threadId.y);' + '\nfloat user_sum=(user_x+user_y);' + '\nreturn user_sum;' + '\n}'); + assert.equal( + node.toString(), + 'float assignThreadToVar() {' + + '\nfloat user_x=float(threadId.x);' + + '\nfloat user_y=float(threadId.y);' + + '\nfloat user_sum=(user_x+user_y);' + + '\nreturn user_sum;' + + '\n}' + ); const { x, y, sum } = node.contexts[1]; assert.equal(x.name, 'x'); assert.equal(x.valueType, 'Number'); @@ -53,7 +73,15 @@ test('Issue #390 - thread assignment cpu', function (assert) { }.toString(), { output: [1] } ); - assert.equal(node.toString(), 'function assignThreadToVar() {' + '\nconst user_x=_this.thread.x;' + '\nconst user_y=_this.thread.y;' + '\nconst user_sum=(user_x+user_y);' + '\nreturn user_sum;' + '\n}'); + assert.equal( + node.toString(), + 'function assignThreadToVar() {' + + '\nconst user_x=_this.thread.x;' + + '\nconst user_y=_this.thread.y;' + + '\nconst user_sum=(user_x+user_y);' + + '\nreturn user_sum;' + + '\n}' + ); const { x, y, z, sum } = node.contexts[1]; assert.equal(x.name, 'x'); assert.equal(x.valueType, 'Integer'); @@ -76,7 +104,16 @@ test('Issue #390 (related) - output assignment webgl', function (assert) { output: [1, 2, 3], } ); - assert.equal(node.toString(), 'float assignThreadToVar() {' + '\nfloat user_x=1.0;' + '\nfloat user_y=2.0;' + '\nfloat user_z=3.0;' + '\nfloat user_sum=((user_x+user_y)+user_z);' + '\nreturn user_sum;' + '\n}'); + assert.equal( + node.toString(), + 'float assignThreadToVar() {' + + '\nfloat user_x=1.0;' + + '\nfloat user_y=2.0;' + + '\nfloat user_z=3.0;' + + '\nfloat user_sum=((user_x+user_y)+user_z);' + + '\nreturn user_sum;' + + '\n}' + ); const { x, y, z, sum } = node.contexts[1]; assert.equal(x.name, 'x'); assert.equal(x.valueType, 'Number'); @@ -101,7 +138,16 @@ test('Issue #390 (related) - output assignment webgl2', function (assert) { output: [1, 2, 3], } ); - assert.equal(node.toString(), 'float assignThreadToVar() {' + '\nfloat user_x=1.0;' + '\nfloat user_y=2.0;' + '\nfloat user_z=3.0;' + '\nfloat user_sum=((user_x+user_y)+user_z);' + '\nreturn user_sum;' + '\n}'); + assert.equal( + node.toString(), + 'float assignThreadToVar() {' + + '\nfloat user_x=1.0;' + + '\nfloat user_y=2.0;' + + '\nfloat user_z=3.0;' + + '\nfloat user_sum=((user_x+user_y)+user_z);' + + '\nreturn user_sum;' + + '\n}' + ); const context = node.contexts[1]; const { x, y, z, sum } = context; assert.equal(x.name, 'x'); @@ -127,7 +173,16 @@ test('Issue #390 (related) - output assignment cpu', function (assert) { output: [1, 2, 3], } ); - assert.equal(node.toString(), 'function assignThreadToVar() {' + '\nconst user_x=outputX;' + '\nconst user_y=outputY;' + '\nconst user_z=outputZ;' + '\nconst user_sum=((user_x+user_y)+user_z);' + '\nreturn user_sum;' + '\n}'); + assert.equal( + node.toString(), + 'function assignThreadToVar() {' + + '\nconst user_x=outputX;' + + '\nconst user_y=outputY;' + + '\nconst user_z=outputZ;' + + '\nconst user_sum=((user_x+user_y)+user_z);' + + '\nreturn user_sum;' + + '\n}' + ); const context = node.contexts[1]; const { x, y, z, sum } = context; assert.equal(context['@contextType'], 'const/let'); diff --git a/test/issues/396-combine-kernels-example.js b/test/issues/396-combine-kernels-example.js index dd4a8d65..1eb69c33 100644 --- a/test/issues/396-combine-kernels-example.js +++ b/test/issues/396-combine-kernels-example.js @@ -21,7 +21,11 @@ function combineKernelsExample(mode) { return multiply(add(a, b), c); }); - const result = superKernel([1, 2, 3, 4, 5], [1, 2, 3, 4, 5], [1, 2, 3, 4, 5]); + const result = superKernel( + [1, 2, 3, 4, 5], + [1, 2, 3, 4, 5], + [1, 2, 3, 4, 5] + ); assert.deepEqual(Array.from(result), [2, 8, 18, 32, 50]); gpu.destroy(); } diff --git a/test/issues/399-double-definition.js b/test/issues/399-double-definition.js index 88d58927..db85e4a0 100644 --- a/test/issues/399-double-definition.js +++ b/test/issues/399-double-definition.js @@ -22,17 +22,26 @@ function doubleDefinitionUnsignedPrecision(mode) { gpu.destroy(); } -(GPU.isWebGLSupported ? test : skip)('Issue #399 - double definition unsigned precision webgl', () => { - doubleDefinitionUnsignedPrecision('webgl'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'Issue #399 - double definition unsigned precision webgl', + () => { + doubleDefinitionUnsignedPrecision('webgl'); + } +); -(GPU.isWebGL2Supported ? test : skip)('Issue #399 - double definition unsigned precision webgl2', () => { - doubleDefinitionUnsignedPrecision('webgl2'); -}); +(GPU.isWebGL2Supported ? test : skip)( + 'Issue #399 - double definition unsigned precision webgl2', + () => { + doubleDefinitionUnsignedPrecision('webgl2'); + } +); -(GPU.isHeadlessGLSupported ? test : skip)('Issue #399 - double definition unsigned precision headlessgl', () => { - doubleDefinitionUnsignedPrecision('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'Issue #399 - double definition unsigned precision headlessgl', + () => { + doubleDefinitionUnsignedPrecision('headlessgl'); + } +); function doubleDefinitionSinglePrecision(mode) { const gpu = new GPU({ mode }); @@ -53,14 +62,23 @@ function doubleDefinitionSinglePrecision(mode) { gpu.destroy(); } -(GPU.isWebGLSupported && GPU.isSinglePrecisionSupported ? test : skip)('Issue #399 - double definition single precision webgl', () => { - doubleDefinitionSinglePrecision('webgl'); -}); +(GPU.isWebGLSupported && GPU.isSinglePrecisionSupported ? test : skip)( + 'Issue #399 - double definition single precision webgl', + () => { + doubleDefinitionSinglePrecision('webgl'); + } +); -(GPU.isWebGL2Supported && GPU.isSinglePrecisionSupported ? test : skip)('Issue #399 - double definition single precision webgl2', () => { - doubleDefinitionSinglePrecision('webgl2'); -}); +(GPU.isWebGL2Supported && GPU.isSinglePrecisionSupported ? test : skip)( + 'Issue #399 - double definition single precision webgl2', + () => { + doubleDefinitionSinglePrecision('webgl2'); + } +); -(GPU.isHeadlessGLSupported && GPU.isSinglePrecisionSupported ? test : skip)('Issue #399 - double definition single precision headlessgl', () => { - doubleDefinitionSinglePrecision('headlessgl'); -}); +(GPU.isHeadlessGLSupported && GPU.isSinglePrecisionSupported ? test : skip)( + 'Issue #399 - double definition single precision headlessgl', + () => { + doubleDefinitionSinglePrecision('headlessgl'); + } +); diff --git a/test/issues/401-cpu-canvas-check.js b/test/issues/401-cpu-canvas-check.js index e4c752b6..ea583066 100644 --- a/test/issues/401-cpu-canvas-check.js +++ b/test/issues/401-cpu-canvas-check.js @@ -41,5 +41,9 @@ test('Issue #401 - cpu no canvas', function (assert) { }, [] ); - assert.equal(true, true, 'ok when canvas is not available and not using graphical output'); + assert.equal( + true, + true, + 'ok when canvas is not available and not using graphical output' + ); }); diff --git a/test/issues/422-warnings.js b/test/issues/422-warnings.js index d0675813..9ac22756 100644 --- a/test/issues/422-warnings.js +++ b/test/issues/422-warnings.js @@ -10,7 +10,12 @@ function warnings(mode) { return a[this.thread.x] + b[this.thread.x]; }) .setOutput([10]); - assert.deepEqual(Array.from(kernel([0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9])), [0, 2, 4, 6, 8, 10, 12, 14, 16, 18]); + assert.deepEqual( + Array.from( + kernel([0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) + ), + [0, 2, 4, 6, 8, 10, 12, 14, 16, 18] + ); gpu.destroy(); } diff --git a/test/issues/472-compilation-issue.js b/test/issues/472-compilation-issue.js index 2bb1a591..34bfcbc7 100644 --- a/test/issues/472-compilation-issue.js +++ b/test/issues/472-compilation-issue.js @@ -20,7 +20,13 @@ function testCompilationIssue(mode) { output: [2, 2], graphical: true, }); - render(new Uint8ClampedArray([230, 233, 240, 255, 231, 234, 241, 255, 232, 235, 242, 255, 233, 236, 243, 255]), 14 * Math.sin(Date.now() / 400)); + render( + new Uint8ClampedArray([ + 230, 233, 240, 255, 231, 234, 241, 255, 232, 235, 242, 255, 233, 236, + 243, 255, + ]), + 14 * Math.sin(Date.now() / 400) + ); assert.equal(render.getPixels().length, 2 * 2 * 4); gpu.destroy(); } diff --git a/test/issues/473-4-pixels.js b/test/issues/473-4-pixels.js index 16a116a8..732e3670 100644 --- a/test/issues/473-4-pixels.js +++ b/test/issues/473-4-pixels.js @@ -39,9 +39,12 @@ test('RGB static output gpu', () => { testOnly4PixelsAreShownRGBStaticOutput('webgl2'); }); -(GPU.isHeadlessGLSupported ? test : skip)('RGB static output headlessgl', () => { - testOnly4PixelsAreShownRGBStaticOutput('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'RGB static output headlessgl', + () => { + testOnly4PixelsAreShownRGBStaticOutput('headlessgl'); + } +); (GPU.isCanvasSupported ? test : skip)('RGB static output cpu', () => { testOnly4PixelsAreShownRGBStaticOutput('cpu'); @@ -83,9 +86,12 @@ test('RGBA static output gpu', () => { testOnly4PixelsAreShownRGBAStaticOutput('webgl2'); }); -(GPU.isHeadlessGLSupported ? test : skip)('RGBA static output headlessgl', () => { - testOnly4PixelsAreShownRGBAStaticOutput('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'RGBA static output headlessgl', + () => { + testOnly4PixelsAreShownRGBAStaticOutput('headlessgl'); + } +); (GPU.isCanvasSupported ? test : skip)('RGBA static output cpu', () => { testOnly4PixelsAreShownRGBAStaticOutput('cpu'); @@ -135,9 +141,12 @@ test('rgb dynamic output gpu', () => { testOnly4PixelsAreShownRGBDynamicOutput('webgl2'); }); -(GPU.isHeadlessGLSupported ? test : skip)('rgb dynamic output headlessgl', () => { - testOnly4PixelsAreShownRGBDynamicOutput('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'rgb dynamic output headlessgl', + () => { + testOnly4PixelsAreShownRGBDynamicOutput('headlessgl'); + } +); (GPU.isCanvasSupported ? test : skip)('rgb dynamic output cpu', () => { testOnly4PixelsAreShownRGBDynamicOutput('cpu'); @@ -187,9 +196,12 @@ test('rgba dynamic output gpu', () => { testOnly4PixelsAreShownRGBADynamicOutput('webgl2'); }); -(GPU.isHeadlessGLSupported ? test : skip)('rgba dynamic output headlessgl', () => { - testOnly4PixelsAreShownRGBADynamicOutput('headlessgl'); -}); +(GPU.isHeadlessGLSupported ? test : skip)( + 'rgba dynamic output headlessgl', + () => { + testOnly4PixelsAreShownRGBADynamicOutput('headlessgl'); + } +); (GPU.isCanvasSupported ? test : skip)('rgba dynamic output cpu', () => { testOnly4PixelsAreShownRGBADynamicOutput('cpu'); diff --git a/test/issues/493-strange-literal.js b/test/issues/493-strange-literal.js index f7851671..5f29b914 100644 --- a/test/issues/493-strange-literal.js +++ b/test/issues/493-strange-literal.js @@ -7,14 +7,25 @@ function testStrangeLiteral(mode) { const gpu = new GPU({ mode }); function kernelFunction(array) { - const xFactor = (1 - 0) * this.constants.x + this.thread.x * this.constants.y; - const yFactor = (1 - 0.5) * this.constants.x + this.thread.x * this.constants.y; + const xFactor = + (1 - 0) * this.constants.x + this.thread.x * this.constants.y; + const yFactor = + (1 - 0.5) * this.constants.x + this.thread.x * this.constants.y; const value = array[this.thread.x]; return [value[0] / xFactor, value[1] / yFactor]; } - const kernel1 = gpu.createKernel(kernelFunction).setArgumentTypes({ array: 'Array1D(2)' }).setConstants({ x: 1, y: 1 }).setOutput([1]); + const kernel1 = gpu + .createKernel(kernelFunction) + .setArgumentTypes({ array: 'Array1D(2)' }) + .setConstants({ x: 1, y: 1 }) + .setOutput([1]); assert.deepEqual(kernel1([[1, 2]]), [new Float32Array([1, 4])]); - const kernel2 = gpu.createKernel(kernelFunction).setStrictIntegers(true).setArgumentTypes({ array: 'Array1D(2)' }).setConstants({ x: 1, y: 1 }).setOutput([1]); + const kernel2 = gpu + .createKernel(kernelFunction) + .setStrictIntegers(true) + .setArgumentTypes({ array: 'Array1D(2)' }) + .setConstants({ x: 1, y: 1 }) + .setOutput([1]); assert.deepEqual(kernel2([[1, 2]]), [new Float32Array([1, 4])]); gpu.destroy(); } diff --git a/test/issues/500-sticky-arrays.js b/test/issues/500-sticky-arrays.js index 2696ab90..d1bed238 100644 --- a/test/issues/500-sticky-arrays.js +++ b/test/issues/500-sticky-arrays.js @@ -12,7 +12,11 @@ function testStickyArrays(mode) { gpu.addFunction(processImage); const kernel = gpu.createKernel( function (image1, image2, image3) { - return [processImage(image1), processImage(image2), processImage(image3)]; + return [ + processImage(image1), + processImage(image2), + processImage(image3), + ]; }, { output: [1] } ); diff --git a/test/issues/553-permanent-flip.js b/test/issues/553-permanent-flip.js index 627f01e7..a5900015 100644 --- a/test/issues/553-permanent-flip.js +++ b/test/issues/553-permanent-flip.js @@ -16,7 +16,10 @@ function testFixPermanentFlip(precision, mode) { ); const arr = [1, 2, 3, 4]; for (let i = 0; i < 4; i++) { - assert.deepEqual(kernel(999, arr, new Image(2, 2), 999), new Float32Array(arr)); + assert.deepEqual( + kernel(999, arr, new Image(2, 2), 999), + new Float32Array(arr) + ); } gpu.destroy(); diff --git a/test/issues/556-minify-for-loop.js b/test/issues/556-minify-for-loop.js index d1a0a908..d364a1c5 100644 --- a/test/issues/556-minify-for-loop.js +++ b/test/issues/556-minify-for-loop.js @@ -3,7 +3,8 @@ const { GPU, WebGLFunctionNode } = require('../../src'); describe('issue #556 - minify for loop'); -const source = 'function w(t,e){for(var r=0,i=0;i { const mockCanvas = { getContext: () => mockContext, }; - testMinificationMadness('cpu', typeof HTMLCanvasElement === 'undefined' ? mockCanvas : null); + testMinificationMadness( + 'cpu', + typeof HTMLCanvasElement === 'undefined' ? mockCanvas : null + ); }); diff --git a/test/issues/586-unable-to-resize.js b/test/issues/586-unable-to-resize.js index 87eee1cc..cfdd1baf 100644 --- a/test/issues/586-unable-to-resize.js +++ b/test/issues/586-unable-to-resize.js @@ -22,7 +22,12 @@ function testResize(convert, mode) { var t1 = createTexture1(); var t2 = createTexture2(); - assert.deepEqual(convert(t2), [new Float32Array([1, 1, 1, 1]), new Float32Array([1, 1, 1, 1]), new Float32Array([1, 1, 1, 1]), new Float32Array([1, 1, 1, 1])]); + assert.deepEqual(convert(t2), [ + new Float32Array([1, 1, 1, 1]), + new Float32Array([1, 1, 1, 1]), + new Float32Array([1, 1, 1, 1]), + new Float32Array([1, 1, 1, 1]), + ]); gpu.destroy(); } diff --git a/test/issues/91-create-kernel-map-array.js b/test/issues/91-create-kernel-map-array.js index 66475cdb..2a2c6d5b 100644 --- a/test/issues/91-create-kernel-map-array.js +++ b/test/issues/91-create-kernel-map-array.js @@ -1,5 +1,11 @@ const { assert, skip, test, module: describe } = require('qunit'); -const { GPU, HeadlessGLKernel, WebGLKernel, WebGL2Kernel, CPUKernel } = require('../../src'); +const { + GPU, + HeadlessGLKernel, + WebGLKernel, + WebGL2Kernel, + CPUKernel, +} = require('../../src'); describe('issue #91'); @@ -41,24 +47,51 @@ function getResult(mode) { gpu.destroy(); return kernels; } -(GPU.isWebGL2Supported || (GPU.isHeadlessGLSupported && HeadlessGLKernel.features.kernelMap) ? test : skip)('Issue #91 - type detection auto', () => { +(GPU.isWebGL2Supported || + (GPU.isHeadlessGLSupported && HeadlessGLKernel.features.kernelMap) + ? test + : skip)('Issue #91 - type detection auto', () => { getResult(); }); -(GPU.isWebGL2Supported || (GPU.isHeadlessGLSupported && HeadlessGLKernel.features.kernelMap) ? test : skip)('Issue #91 - type detection gpu', () => { +(GPU.isWebGL2Supported || + (GPU.isHeadlessGLSupported && HeadlessGLKernel.features.kernelMap) + ? test + : skip)('Issue #91 - type detection gpu', () => { getResult('gpu'); }); -(GPU.isWebGLSupported ? test : skip)('Issue #91 - type detection webgl', () => { - const kernel = getResult('webgl'); - assert.equal(kernel.kernel.constructor, WebGLKernel, 'kernel type is wrong'); -}); -(GPU.isWebGL2Supported ? test : skip)('Issue #91 - type detection webgl2', () => { - const kernel = getResult('webgl2'); - assert.equal(kernel.kernel.constructor, WebGL2Kernel, 'kernel type is wrong'); -}); -(GPU.isHeadlessGLSupported ? test : skip)('Issue #91 - type detection headlessgl', () => { - const kernel = getResult('headlessgl'); - assert.equal(kernel.kernel.constructor, HeadlessGLKernel, 'kernel type is wrong'); -}); +(GPU.isWebGLSupported ? test : skip)( + 'Issue #91 - type detection webgl', + () => { + const kernel = getResult('webgl'); + assert.equal( + kernel.kernel.constructor, + WebGLKernel, + 'kernel type is wrong' + ); + } +); +(GPU.isWebGL2Supported ? test : skip)( + 'Issue #91 - type detection webgl2', + () => { + const kernel = getResult('webgl2'); + assert.equal( + kernel.kernel.constructor, + WebGL2Kernel, + 'kernel type is wrong' + ); + } +); +(GPU.isHeadlessGLSupported ? test : skip)( + 'Issue #91 - type detection headlessgl', + () => { + const kernel = getResult('headlessgl'); + assert.equal( + kernel.kernel.constructor, + HeadlessGLKernel, + 'kernel type is wrong' + ); + } +); test('Issue #91 - type detection cpu', () => { const kernel = getResult('cpu'); assert.equal(kernel.kernel.constructor, CPUKernel, 'kernel type is wrong'); diff --git a/test/issues/96-param-names.js b/test/issues/96-param-names.js index a2f35392..c9b44424 100644 --- a/test/issues/96-param-names.js +++ b/test/issues/96-param-names.js @@ -43,9 +43,12 @@ function getResult(mode) { gpu.destroy(); return result; } -(GPU.isKernelMapSupported ? test : skip)('Issue #96 - param names auto', () => { - getResult(); -}); +(GPU.isKernelMapSupported ? test : skip)( + 'Issue #96 - param names auto', + () => { + getResult(); + } +); (GPU.isKernelMapSupported ? test : skip)('Issue #96 - param names gpu', () => { getResult('gpu'); }); @@ -55,9 +58,12 @@ function getResult(mode) { (GPU.isWebGL2Supported ? test : skip)('Issue #96 - param names webgl2', () => { getResult('webgl2'); }); -(GPU.isHeadlessGLSupported && GPU.isKernelMapSupported ? test : skip)('Issue #96 - param names headlessgl', () => { - getResult('headlessgl'); -}); +(GPU.isHeadlessGLSupported && GPU.isKernelMapSupported ? test : skip)( + 'Issue #96 - param names headlessgl', + () => { + getResult('headlessgl'); + } +); test('Issue #96 - param names cpu', () => { getResult('cpu'); }); diff --git a/test/test-utils.js b/test/test-utils.js index a35ca2fe..2821bff3 100644 --- a/test/test-utils.js +++ b/test/test-utils.js @@ -60,7 +60,12 @@ const testUtils = { ); visualKernelA(rgba); - return [visualKernelR.getPixels(), visualKernelG.getPixels(), visualKernelB.getPixels(), visualKernelA.getPixels()]; + return [ + visualKernelR.getPixels(), + visualKernelG.getPixels(), + visualKernelB.getPixels(), + visualKernelA.getPixels(), + ]; }, }; From baf8e7eba7311116d75ed52f68460dc65f70561a Mon Sep 17 00:00:00 2001 From: 17097231932 <17097231932@163.com> Date: Sun, 29 Jan 2023 14:51:04 +0800 Subject: [PATCH 09/11] do some change on examples --- examples/advanced-typescript.ts | 24 +- examples/cat-image/index.html | 134 +- examples/fluid.html | 2166 +++++++++------- examples/internal-variable-precision.html | 94 +- examples/json-saving.js | 12 +- examples/mandelbrot-set.html | 224 +- examples/mandelbulb.html | 1282 +++++----- examples/parallel-raytracer.html | 2760 ++++++++++++--------- examples/random.html | 111 +- examples/raster-globe/index.html | 242 +- examples/raytracer.html | 1116 +++++---- examples/simple-javascript.js | 12 +- examples/simple-typescript.ts | 19 +- examples/slow-fade.html | 82 +- examples/video/index.html | 205 +- index.html | 75 - package.json | 2 +- 17 files changed, 4808 insertions(+), 3752 deletions(-) delete mode 100644 index.html diff --git a/examples/advanced-typescript.ts b/examples/advanced-typescript.ts index fa837224..c7e824b1 100644 --- a/examples/advanced-typescript.ts +++ b/examples/advanced-typescript.ts @@ -16,20 +16,24 @@ import { IKernelFunctionThis, IConstantsThis, KernelOutput, - ISubKernelsResults -} from '../src'; + ISubKernelsResults, +} from '..'; const gpu = new GPU(); interface IConstants extends IConstantsThis { - rotation: number, + rotation: number; } interface IThis extends IKernelFunctionThis { - constants: IConstants, + constants: IConstants; } -function kernelFunction(this: IThis, degrees: number, divisors: [number, number]): [number, number] { +function kernelFunction( + this: IThis, + degrees: number, + divisors: [number, number] +): [number, number] { const bounds = subKernel(this.constants.rotation * degrees); return [bounds[0] / divisors[0], bounds[1] / divisors[1]]; } @@ -42,9 +46,13 @@ interface IKernelMapResult extends ISubKernelsResults { test: KernelOutput; } -const kernelMap = gpu.createKernelMap>({ - test: subKernel, -}, kernelFunction) +const kernelMap = gpu + .createKernelMap>( + { + test: subKernel, + }, + kernelFunction + ) .setConstants({ rotation: 45, }) diff --git a/examples/cat-image/index.html b/examples/cat-image/index.html index 0c6842ce..b77bca90 100644 --- a/examples/cat-image/index.html +++ b/examples/cat-image/index.html @@ -1,69 +1,77 @@ - - - Cat image with GPU.js - - - -

Image to GPU.js from https://observablehq.com/@fil/image-to-gpu

-
- - + + +

+ Image to GPU.js from + https://observablehq.com/@fil/image-to-gpu +

+
+ + + const logFps = document.querySelector('#log-fps'); + const image = new Image(); + image.src = './cat.jpg'; + image.onload = () => { + const array = imageToArray(image); + const render = new GPU({ mode: 'gpu' }) + .createKernel(kernel) + .setConstants({ w: image.width, h: image.height }) + .setOutput([image.width, image.height]) + .setGraphical(true); + const canvas = render.canvas; + document.body.appendChild(canvas); + let lastCalledTime; + let fps; + function callRender() { + const wobble = 14 * Math.sin(Date.now() / 400); + render(array, wobble); + const delta = (Date.now() - lastCalledTime) / 1000; + lastCalledTime = Date.now(); + fps = 1 / delta; + logFps.innerHTML = fps.toFixed(0) + ' FPS'; + window.requestAnimationFrame(() => { + callRender(); + }); + } + callRender(); + }; + diff --git a/examples/fluid.html b/examples/fluid.html index 2b3fd1ba..6f1eb5ad 100644 --- a/examples/fluid.html +++ b/examples/fluid.html @@ -1,43 +1,44 @@ - - - SSPS - Chadams Studios (slightly upgraded) - - + + - + + + - - - diff --git a/examples/internal-variable-precision.html b/examples/internal-variable-precision.html index 0cf6ee42..fc2b5e9e 100644 --- a/examples/internal-variable-precision.html +++ b/examples/internal-variable-precision.html @@ -1,52 +1,52 @@ - - - GPU.js Internal Variable Precision - - -

GPU.js Internal variable precision:

- - - + + requestAnimationFrame(render); + diff --git a/examples/json-saving.js b/examples/json-saving.js index d9286ab5..3dbc4fc5 100644 --- a/examples/json-saving.js +++ b/examples/json-saving.js @@ -1,9 +1,12 @@ -const { GPU } = require('../src'); +const { GPU } = require('..'); const gpu1 = new GPU(); -const kernel1 = gpu1.createKernel(function(value) { - return value * 100; -}, { output: [1] }); +const kernel1 = gpu1.createKernel( + function (value) { + return value * 100; + }, + { output: [1] } +); const resultFromRegularKernel = kernel1(42); const json = kernel1.toJSON(); @@ -14,4 +17,3 @@ const gpu2 = new GPU(); const kernel2 = gpu2.createKernel(json); const resultFromJsonKernel = kernel2(42); console.log(resultFromJsonKernel); - diff --git a/examples/mandelbrot-set.html b/examples/mandelbrot-set.html index ca484e1a..9d60edf8 100644 --- a/examples/mandelbrot-set.html +++ b/examples/mandelbrot-set.html @@ -1,123 +1,133 @@ - - - -
Left click to zoom in, right click to zoom out.
- - + + +
Left click to zoom in, right click to zoom out.
+ + + window.requestAnimationFrame(render); + diff --git a/examples/mandelbulb.html b/examples/mandelbulb.html index 5b93c642..bb5c5658 100644 --- a/examples/mandelbulb.html +++ b/examples/mandelbulb.html @@ -1,587 +1,719 @@ - - - - - Frakal - - - -
- -
-

Mandelbulb - Real-time 3d fractal
in Javascript

- Kamil Kiełczewski Airavana -
-
Instruction
-
Click on picture and move mouse around
- A S D W E C keys for change view poin position
- Push ESC to stop move and unlock mouse + + + + + Frakal + + + +
+ +
+

+ Mandelbulb - Real-time 3d fractal
+ in Javascript +

+ Kamil Kiełczewski Airavana +
+
Instruction
+
+ Click on picture and + move mouse around
+ A S D W E C keys for change view poin + position
+ Push ESC to stop move and unlock mouse +
+
+
+
Calculate Light
+
+ +
+
+
+
+ Level of Details (and camera speed)
+ Mouse whell or + +/- keys +
+
+ +
+
+
-
-
Calculate Light
-
-
-
-
- Level of Details (and camera speed)
- Mouse whell or +/- keys + + - - + // ---------------------------------------------------- + // + // Main + // + // ---------------------------------------------------- + let raytracerParams = new RaytracerParams(); + let tmpMouseWhellY = -3000; + let locked = false; + let start; + refreshScreenSize(); + //let raytracer = initFractalGPU(raytracerParams); + initGui(raytracerParams); + + window.requestAnimationFrame(refreshWindow); + + diff --git a/examples/parallel-raytracer.html b/examples/parallel-raytracer.html index 59c0fbce..d4e06917 100644 --- a/examples/parallel-raytracer.html +++ b/examples/parallel-raytracer.html @@ -1,1210 +1,1718 @@ - - - - GPU.js Raytracer - - - - -
-
-

A parallel raytracer built with TypeScript and GPU.js (WebGL/GLSL).

-

GitHub: http://github.com/jin/raytracer

+ span.canvas { + padding-left: 2px; + padding-right: 2px; + } + + + +
+
+

+ A parallel raytracer built with TypeScript and + GPU.js (WebGL/GLSL). +

+

+ GitHub: + http://github.com/jin/raytracer +

-

Press W, A, S, D to move the camera around.

+

Press W, A, S, D to move the camera around.

-

-

Current mode

- GPU - -

-

-

FPS

Loading.. - -

-

-

Number of spheres

- 4 -

+

+ Current mode + GPU + +

+

+ FPSLoading.. + +

+

+ Number of spheres + 4 + +

-

-

Grid dimension

- 2 -

-

- - -

- The canvas is 640px by 640px. Each canvas object is controlled by a single GPU.js kernel and a single thread is spawned for each pixel to compute the color of the pixel. -

+

+ Grid dimension + 2 + +

+
+ + +

+ The canvas is 640px by 640px. Each canvas object is controlled by a + single GPU.js kernel and a single thread is spawned for each pixel + to compute the color of the pixel. +

-

- Increase the dimensions of the grid to break the canvas up into tiles, so that there are multiple kernels controlling multiple tiles. With this approach, the kernels will run sequentially, computing one canvas after another.
-

-

+

+ Increase the dimensions of the grid to break the canvas up into + tiles, so that there are multiple kernels controlling multiple + tiles. With this approach, the kernels will run sequentially, + computing one canvas after another.
+

+
-

-

Benchmark

-
- +
+ Benchmark +
+ +
+ Benchmark the performance of the parallelized GPU and sequential CPU + kernels. This will render 30 frames each and compute min, max, median + frame rendering durations, and speedups.
+
+
+
+
+
- Benchmark the performance of the parallelized GPU and sequential CPU kernels. - This will render 30 frames each and compute min, max, median frame rendering durations, and speedups.
-

-
-
-
-
-
- - - - + - + return [gpuKernels, cpuKernels]; + }; + var addFunctions = function (gpu, functions) { + return functions.forEach(function (f) { + return gpu.addFunction(f); + }); + }; + var scene = Scene.generateScene(); + var _a = generateKernels(kernelDimension, scene), + gpuKernels = _a[0], + cpuKernels = _a[1]; + var renderLoop = renderer(gpuKernels, cpuKernels, scene); + window.onload = renderLoop; + + diff --git a/examples/random.html b/examples/random.html index 0ef1b50c..4489b870 100644 --- a/examples/random.html +++ b/examples/random.html @@ -1,66 +1,69 @@ - - - GPU.js Random Examples - - -

CPU Random

- -

WebGL1 Random

- -

WebGL2 Random

- - - - + + requestAnimationFrame(draw); + diff --git a/examples/raster-globe/index.html b/examples/raster-globe/index.html index def70c16..8f10131b 100644 --- a/examples/raster-globe/index.html +++ b/examples/raster-globe/index.html @@ -1,135 +1,143 @@ - - - Raster projection with GPU.js - - - -

Raster projection with GPU.js from https://observablehq.com/d/b70d084526a1a764

-
- - + + +

+ Raster projection with GPU.js from + https://observablehq.com/d/b70d084526a1a764 +

+
+ + + // apply rotation + const rotation = applyRotation(rotate0, rotate1, rotate2, lambda, phi); + const lambdan = rotation[0]; + const phin = rotation[1]; + //var n = n0(lambda, phi, this.constants.srcw, this.constants.srch); + //this.color(pixels[n]/256, pixels[n+1]/256,pixels[n+2]/256,1); + const pixel = + pixels[pixely(phin, this.constants.srch)][ + pixelx(lambdan, this.constants.srcw) + ]; + this.color(pixel[0], pixel[1], pixel[2], 1); + } + }; + const gpu = new GPU(); + const logFps = document.querySelector('#log-fps'); + const image = new Image(); + image.src = './earth-map.jpg'; + image.onload = () => { + const w = 975; + const h = 975; + const render = gpu + .createKernel(kernel, { functions: [applyRotation, frac] }) + .setConstants({ w, h, srcw: image.width, srch: image.height }) + .setOutput([w, h]) + .setTactic('precision') + .setGraphical(true); + const canvas = render.canvas; + document.body.appendChild(canvas); + let lastCalledTime; + let fps; + function callRender() { + let r0 = (-Date.now() / 30) % 360, + r1 = 35 * Math.sin((-Date.now() / 1030) % 360), + r2 = 0, + scale = 0.49; + render(image, r0, r1, r2, scale); + delta = (Date.now() - lastCalledTime) / 1000; + lastCalledTime = Date.now(); + fps = 1 / delta; + logFps.innerHTML = fps.toFixed(0) + ' FPS'; + window.requestAnimationFrame(() => { + callRender(); + }); + } + callRender(); + }; + diff --git a/examples/raytracer.html b/examples/raytracer.html index 274d598a..e570f8ec 100644 --- a/examples/raytracer.html +++ b/examples/raytracer.html @@ -1,520 +1,678 @@ - - - - - GPU.js Raytracer - - - - - - -
-
-

- From https://staceytay.com/raytracer/. A simple ray tracer with Lambertian and specular reflection, - built with GPU.js. Read more - about ray tracing and GPU.js in - my blog - post. Code available - on GitHub. -

-
-
- - -
-
-
- -
-
- -
-
- fps -
-
-
- - + - + function showGPUCanvas() { + cpuCanvas.style.display = 'none'; + gpuCanvas.style.display = ''; + canvas = gpuCanvas; + } + + diff --git a/examples/simple-javascript.js b/examples/simple-javascript.js index 24123d25..2b5cf7d9 100644 --- a/examples/simple-javascript.js +++ b/examples/simple-javascript.js @@ -1,17 +1,21 @@ -const { GPU } = require('../src'); +const { GPU } = require('..'); const gpu = new GPU({ mode: 'gpu' }); // Look ma! I can javascript on my GPU! function kernelFunction(anInt, anArray, aNestedArray) { - const x = .25 + anInt + anArray[this.thread.x] + aNestedArray[this.thread.x][this.thread.y]; + const x = + 0.25 + + anInt + + anArray[this.thread.x] + + aNestedArray[this.thread.x][this.thread.y]; return x; } const kernel = gpu.createKernel(kernelFunction, { - output: [1] + output: [1], }); -const result = kernel(1, [.25], [[1.5]]); +const result = kernel(1, [0.25], [[1.5]]); console.log(result[0]); // 3 diff --git a/examples/simple-typescript.ts b/examples/simple-typescript.ts index a8ca3110..5f892513 100644 --- a/examples/simple-typescript.ts +++ b/examples/simple-typescript.ts @@ -1,16 +1,25 @@ -import { GPU, KernelFunction, IKernelRunShortcut } from '../src'; +import { GPU, KernelFunction, IKernelRunShortcut } from '..'; const gpu = new GPU({ mode: 'gpu' }); // Look ma! I can typescript on my GPU! -const kernelFunction: KernelFunction = function(anInt: number, anArray: number[], aNestedArray: number[][]) { - const x = .25 + anInt + anArray[this.thread.x] + aNestedArray[this.thread.x][this.thread.y]; +const kernelFunction: KernelFunction = function ( + anInt: number, + anArray: number[], + aNestedArray: number[][] +) { + const x = + 0.25 + + anInt + + anArray[this.thread.x] + + aNestedArray[this.thread.x][this.thread.y]; return x; }; -const kernel: IKernelRunShortcut = gpu.createKernel(kernelFunction) +const kernel: IKernelRunShortcut = gpu + .createKernel(kernelFunction) .setOutput([1]); -const result = kernel(1, [.25], [[1.5]]); +const result = kernel(1, [0.25], [[1.5]]); console.log(result[0]); // 3 diff --git a/examples/slow-fade.html b/examples/slow-fade.html index 4c2ea171..31328fe8 100644 --- a/examples/slow-fade.html +++ b/examples/slow-fade.html @@ -1,46 +1,46 @@ - - - Slow Fade - - -

Slow Fade

-
- -
- - - + + window.requestAnimationFrame(doDraw); + diff --git a/examples/video/index.html b/examples/video/index.html index 07b441d3..dcd7526a 100644 --- a/examples/video/index.html +++ b/examples/video/index.html @@ -1,101 +1,118 @@ - - - Video input with GPU.js - - - -

Video input (and output) with GPU.js

- -
-
-
-
-
-
- -
-
-

Video

- -
-
-

GPU.js Graphical Output 0 fps

-
-
- - + + +

Video input (and output) with GPU.js

+ +
+
+
+
+
+
+ +
+
+

Video

+ +
+
+

+ GPU.js Graphical Output 0 fps +

+
+
+ + - + render(); + return () => { + canvasParent.removeChild(kernel.canvas); + gpu.destroy(); + disposed = true; + }; + } + + function calcFPS() { + delta = (Date.now() - lastCalledTime) / 1000; + lastCalledTime = Date.now(); + fps = 1 / delta; + fpsNumber.innerHTML = fps.toFixed(0); + } + + diff --git a/index.html b/index.html deleted file mode 100644 index a6217998..00000000 --- a/index.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - Slow Fade - - -

Slow Fade

-
- -
- - - - - diff --git a/package.json b/package.json index b095fd90..f29cb603 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,7 @@ "test": "qunit test/issues test/internal test/features", "test:browser": "node scripts/build-tests.js", "coverage": "c8 qunit test/issues test/internal test/features", - "lint": "prettier -w *.js *.json src test scripts", + "lint": "prettier -w *.js *.json src test scripts examples", "build": "rollup -c --bundleConfigAsCjs" }, "repository": { From 6d2be08bd698a1ae2ed3530d53f38393ab908b0f Mon Sep 17 00:00:00 2001 From: 17097231932 <17097231932@163.com> Date: Sun, 29 Jan 2023 16:21:12 +0800 Subject: [PATCH 10/11] let test can be run --- .gitignore | 1 + package.json | 9 +- pnpm-lock.yaml | 23 +- src/backend/function-node.js | 1 + src/browser.js | 15 + src/utils.js | 6 +- test/all-template.html | 2 +- test/all.html | 797 ------------------ test/benchmark-faster.js | 2 +- test/benchmark.js | 2 +- test/features/add-custom-function.js | 2 +- test/features/add-custom-native-function.js | 2 +- test/features/add-typed-functions.js | 2 +- test/features/argument-array-types.js | 2 +- test/features/argument-array1d-types.js | 2 +- test/features/argument-array2d-types.js | 2 +- test/features/argument-array3d-types.js | 2 +- test/features/arithmetic-operators.js | 2 +- test/features/assignment-operators.js | 2 +- test/features/basic-math.js | 2 +- test/features/bitwise-operators.js | 2 +- test/features/boolean-from-expression.js | 2 +- test/features/canvas.js | 2 +- test/features/clear-textures.js | 2 +- test/features/clone-textures.js | 2 +- test/features/combine-kernels.js | 2 +- test/features/constants-array.js | 2 +- test/features/constants-bool.js | 2 +- test/features/constants-canvas.js | 2 +- test/features/constants-float.js | 2 +- test/features/constants-image-array.js | 2 +- test/features/constants-image.js | 2 +- test/features/constants-integer.js | 2 +- test/features/constants-texture.js | 2 +- test/features/cpu-with-textures.js | 2 +- test/features/create-kernel-map.js | 2 +- test/features/demo.js | 2 +- test/features/destroy.js | 2 +- test/features/destructured-assignment.js | 2 +- test/features/dev-mode.js | 2 +- test/features/dynamic-arguments.js | 2 +- test/features/dynamic-output.js | 2 +- test/features/function-return.js | 2 +- test/features/get-canvas.js | 2 +- test/features/get-pixels.js | 2 +- test/features/if-else.js | 2 +- test/features/image-array.js | 2 +- test/features/image.js | 2 +- test/features/infinity.js | 2 +- test/features/inject-native.js | 2 +- test/features/input.js | 2 +- test/features/internally-defined-matrices.js | 2 +- test/features/json.js | 2 +- test/features/legacy-encoder.js | 7 +- test/features/loops.js | 2 +- test/features/math-object.js | 2 +- test/features/nested-function.js | 2 +- test/features/optimize-float-memory.js | 2 +- test/features/output.js | 2 +- test/features/promise-api.js | 2 +- test/features/raw-output.js | 2 +- test/features/read-color-texture.js | 2 +- test/features/read-from-texture.js | 2 +- test/features/read-image-bitmap.js | 2 +- test/features/read-image-data.js | 2 +- test/features/return-arrays.js | 2 +- test/features/single-precision-textures.js | 2 +- test/features/single-precision.js | 2 +- test/features/switches.js | 2 +- test/features/tactic.js | 2 +- test/features/ternary.js | 2 +- test/features/to-string/as-file.js | 2 +- .../precision/single/arguments/array.js | 2 +- .../precision/single/arguments/array2.js | 2 +- .../precision/single/arguments/array2d.js | 2 +- .../precision/single/arguments/array2d2.js | 2 +- .../precision/single/arguments/array2d3.js | 2 +- .../precision/single/arguments/array3.js | 2 +- .../precision/single/arguments/array3d.js | 2 +- .../precision/single/arguments/array4.js | 2 +- .../precision/single/arguments/boolean.js | 2 +- .../precision/single/arguments/float.js | 2 +- .../precision/single/arguments/html-canvas.js | 2 +- .../single/arguments/html-image-array.js | 2 +- .../precision/single/arguments/html-image.js | 2 +- .../precision/single/arguments/html-video.js | 2 +- .../precision/single/arguments/input.js | 2 +- .../precision/single/arguments/integer.js | 2 +- .../memory-optimized-number-texture.js | 2 +- .../single/arguments/number-texture.js | 2 +- .../precision/single/constants/array.js | 2 +- .../precision/single/constants/array2.js | 2 +- .../precision/single/constants/array2d.js | 2 +- .../precision/single/constants/array3.js | 2 +- .../precision/single/constants/array3d.js | 2 +- .../precision/single/constants/array4.js | 2 +- .../precision/single/constants/boolean.js | 2 +- .../precision/single/constants/float.js | 2 +- .../precision/single/constants/html-canvas.js | 2 +- .../single/constants/html-image-array.js | 2 +- .../precision/single/constants/html-image.js | 2 +- .../precision/single/constants/input.js | 2 +- .../precision/single/constants/integer.js | 2 +- .../memory-optimized-number-texture.js | 2 +- .../single/constants/number-texture.js | 2 +- .../to-string/precision/single/graphical.js | 2 +- .../single/kernel-map/array/array.js | 2 +- .../single/kernel-map/array/array2d.js | 2 +- .../single/kernel-map/array/array3d.js | 2 +- .../array/memory-optimized-number-texture.js | 2 +- .../single/kernel-map/array/number-texture.js | 2 +- .../single/kernel-map/object/array.js | 2 +- .../single/kernel-map/object/array2d.js | 2 +- .../single/kernel-map/object/array3d.js | 2 +- .../object/memory-optimized-number-texture.js | 2 +- .../kernel-map/object/number-texture.js | 2 +- .../precision/single/returns/array.js | 2 +- .../precision/single/returns/array2d.js | 2 +- .../precision/single/returns/array3d.js | 2 +- .../precision/single/returns/texture.js | 2 +- .../precision/unsigned/arguments/array.js | 2 +- .../precision/unsigned/arguments/array2.js | 2 +- .../precision/unsigned/arguments/array2d.js | 2 +- .../precision/unsigned/arguments/array3.js | 2 +- .../precision/unsigned/arguments/array3d.js | 2 +- .../precision/unsigned/arguments/array4.js | 2 +- .../precision/unsigned/arguments/boolean.js | 2 +- .../precision/unsigned/arguments/float.js | 2 +- .../unsigned/arguments/html-canvas.js | 2 +- .../unsigned/arguments/html-image-array.js | 2 +- .../unsigned/arguments/html-image.js | 2 +- .../unsigned/arguments/html-video.js | 2 +- .../precision/unsigned/arguments/input.js | 2 +- .../precision/unsigned/arguments/integer.js | 2 +- .../memory-optimized-number-texture.js | 2 +- .../unsigned/arguments/number-texture.js | 2 +- .../precision/unsigned/constants/array.js | 2 +- .../precision/unsigned/constants/array2.js | 2 +- .../precision/unsigned/constants/array2d.js | 2 +- .../precision/unsigned/constants/array3.js | 2 +- .../precision/unsigned/constants/array3d.js | 2 +- .../precision/unsigned/constants/array4.js | 2 +- .../precision/unsigned/constants/boolean.js | 2 +- .../precision/unsigned/constants/float.js | 2 +- .../unsigned/constants/html-canvas.js | 2 +- .../unsigned/constants/html-image-array.js | 2 +- .../unsigned/constants/html-image.js | 2 +- .../precision/unsigned/constants/input.js | 2 +- .../precision/unsigned/constants/integer.js | 2 +- .../memory-optimized-number-texture.js | 2 +- .../unsigned/constants/number-texture.js | 2 +- .../to-string/precision/unsigned/graphical.js | 2 +- .../unsigned/kernel-map/array/array.js | 2 +- .../unsigned/kernel-map/array/array2d.js | 2 +- .../unsigned/kernel-map/array/array3d.js | 2 +- .../array/memory-optimized-number-texture.js | 2 +- .../kernel-map/array/number-texture.js | 2 +- .../unsigned/kernel-map/object/array.js | 2 +- .../unsigned/kernel-map/object/array2d.js | 2 +- .../unsigned/kernel-map/object/array3d.js | 2 +- .../object/memory-optimized-number-texture.js | 2 +- .../kernel-map/object/number-texture.js | 2 +- .../precision/unsigned/returns/array.js | 2 +- .../precision/unsigned/returns/array2d.js | 2 +- .../precision/unsigned/returns/array3d.js | 2 +- .../precision/unsigned/returns/texture.js | 2 +- test/features/type-management.js | 2 +- test/features/unsigned-precision-textures.js | 2 +- test/features/video.js | 2 +- test/index.js | 2 +- test/internal/argument-texture-switching.js | 2 +- test/internal/backend/cpu-kernel.js | 2 +- test/internal/backend/function-node/isSafe.js | 2 +- .../function-node/isSafeDependencies.js | 2 +- test/internal/backend/gl-kernel.js | 2 +- .../backend/headless-gl/kernel/index.js | 2 +- .../function-node/astBinaryExpression.js | 2 +- .../web-gl/function-node/astCallExpression.js | 2 +- .../web-gl/function-node/astForStatement.js | 2 +- .../function-node/astVariableDeclaration.js | 2 +- .../backend/web-gl/function-node/contexts.js | 2 +- .../firstAvailableTypeFromAst.js | 2 +- .../function-node/getVariableSignature.js | 2 +- .../web-gl/function-node/getVariableType.js | 2 +- .../web-gl/kernel-value/dynamic-html-image.js | 2 +- ...dynamic-memory-optimized-number-texture.js | 2 +- .../kernel-value/dynamic-number-texture.js | 2 +- .../kernel-value/dynamic-single-array.js | 2 +- .../kernel-value/dynamic-single-array1d-i.js | 2 +- .../kernel-value/dynamic-single-array2d-i.js | 2 +- .../kernel-value/dynamic-single-array3d-i.js | 2 +- .../kernel-value/dynamic-single-input.js | 2 +- .../kernel-value/dynamic-unsigned-array.js | 2 +- .../kernel-value/dynamic-unsigned-input.js | 2 +- .../backend/web-gl/kernel-value/html-image.js | 2 +- .../memory-optimized-number-texture.js | 2 +- .../web-gl/kernel-value/number-texture.js | 2 +- .../web-gl/kernel-value/single-array.js | 2 +- .../web-gl/kernel-value/single-array1d-i.js | 2 +- .../web-gl/kernel-value/single-array2d-i.js | 2 +- .../web-gl/kernel-value/single-array3d-i.js | 2 +- .../web-gl/kernel-value/single-input.js | 2 +- .../web-gl/kernel-value/unsigned-array.js | 2 +- .../web-gl/kernel-value/unsigned-input.js | 2 +- test/internal/backend/web-gl/kernel/index.js | 2 +- .../backend/web-gl/kernel/setupArguments.js | 2 +- .../backend/web-gl/kernel/setupConstants.js | 2 +- .../kernel-value/dynamic-html-image-array.js | 2 +- .../kernel-value/dynamic-single-array.js | 2 +- .../kernel-value/dynamic-single-input.js | 2 +- .../web-gl2/kernel-value/html-image-array.js | 2 +- .../web-gl2/kernel-value/single-input.js | 2 +- test/internal/backend/web-gl2/kernel/index.js | 2 +- .../backend/web-gl2/kernel/setupArguments.js | 2 +- .../backend/web-gl2/kernel/setupConstants.js | 2 +- test/internal/boolean.js | 2 +- test/internal/casting.js | 2 +- test/internal/constants-texture-switching.js | 2 +- test/internal/constructor-features.js | 2 +- test/internal/context-inheritance.js | 7 +- test/internal/deep-types.js | 2 +- test/internal/deprecated.js | 2 +- test/internal/different-texture-cloning.js | 2 +- test/internal/function-builder.js | 2 +- test/internal/function-composition.js | 2 +- test/internal/function-node.js | 2 +- .../function-return-type-detection.js | 2 +- test/internal/function-tracer.js | 2 +- test/internal/gpu-methods.js | 2 +- test/internal/implied-else.js | 2 +- test/internal/kernel-run-shortcut.js | 2 +- test/internal/kernel.js | 2 +- test/internal/loop-int.js | 2 +- test/internal/loop-max.js | 2 +- test/internal/math.random.js | 2 +- test/internal/matrix-multiply-precision.js | 2 +- test/internal/mixed-memory-optimize.js | 2 +- test/internal/modes.js | 2 +- test/internal/overloading.js | 2 +- test/internal/precision.js | 2 +- test/internal/recycling.js | 2 +- test/internal/texture-index.js | 2 +- test/internal/underscores.js | 2 +- test/internal/utils.js | 2 +- .../114-create-kernel-map-run-second-time.js | 2 +- test/issues/116-multiple-kernels-run-again.js | 2 +- test/issues/130-typed-array.js | 2 +- test/issues/147-missing-constant.js | 2 +- test/issues/152-for-vars.js | 2 +- test/issues/159-3d.js | 2 +- test/issues/174-webgl-context-warning.js | 2 +- test/issues/195-read-from-texture2d.js | 2 +- test/issues/207-same-function-reuse.js | 2 +- test/issues/212-funky-function-support.js | 2 +- .../issues/233-kernel-map-single-precision.js | 2 +- .../241-CPU-vs-GPU-maps-output-differently.js | 2 +- test/issues/259-atan2.js | 2 +- test/issues/263-to-string.js | 2 +- test/issues/267-immutable-sub-kernels.js | 2 +- test/issues/270-cache.js | 2 +- test/issues/279-wrong-canvas-size.js | 2 +- test/issues/300-nested-array-index.js | 2 +- test/issues/31-nested-var-declare-test.js | 2 +- test/issues/313-variable-lookup.js | 2 +- .../314-large-input-array-addressing.js | 2 +- test/issues/335-missing-z-index-issue.js | 2 +- test/issues/346-uint8array-converted.js | 2 +- test/issues/349-division-by-factors-of-3.js | 2 +- test/issues/357-modulus-issue.js | 2 +- test/issues/359-addfunction-params-wrong.js | 2 +- test/issues/378-only-first-iteration.js | 2 +- test/issues/382-bad-constant.js | 2 +- test/issues/390-thread-assignment.js | 2 +- test/issues/396-combine-kernels-example.js | 2 +- test/issues/399-double-definition.js | 2 +- test/issues/401-cpu-canvas-check.js | 2 +- test/issues/410-if-statement.js | 2 +- test/issues/422-warnings.js | 2 +- test/issues/470-modulus-wrong.js | 2 +- test/issues/471-canvas-issue.js | 2 +- test/issues/472-compilation-issue.js | 2 +- test/issues/473-4-pixels.js | 2 +- test/issues/487-dynamic-arguments.js | 2 +- test/issues/493-strange-literal.js | 2 +- test/issues/500-sticky-arrays.js | 2 +- test/issues/519-sanitize-names.js | 2 +- test/issues/553-permanent-flip.js | 2 +- test/issues/556-minify-for-loop.js | 2 +- test/issues/560-minification-madness.js | 2 +- test/issues/564-boolean.js | 2 +- test/issues/567-wrong-modulus.js | 2 +- test/issues/585-inaccurate-lookups.js | 2 +- test/issues/586-unable-to-resize.js | 2 +- test/issues/608-rewritten-arrays.js | 2 +- test/issues/91-create-kernel-map-array.js | 2 +- test/issues/96-param-names.js | 2 +- 296 files changed, 323 insertions(+), 1117 deletions(-) delete mode 100644 test/all.html diff --git a/.gitignore b/.gitignore index bd79c98b..c80efe47 100644 --- a/.gitignore +++ b/.gitignore @@ -37,3 +37,4 @@ yarn.lock # build result dist +test/all.html diff --git a/package.json b/package.json index f29cb603..acdf6972 100644 --- a/package.json +++ b/package.json @@ -26,10 +26,10 @@ "test": "test" }, "dependencies": { - "acorn": "^7.1.1", - "gl": "^5.0.3", + "acorn": "^8.8.2", + "gl": "^6.0.2", "gl-wiretap": "^0.6.2", - "gpu-mock.js": "^1.3.0" + "gpu-mock.js": "^1.3.1" }, "devDependencies": { "@rollup/plugin-commonjs": "^24.0.1", @@ -51,7 +51,8 @@ "test:browser": "node scripts/build-tests.js", "coverage": "c8 qunit test/issues test/internal test/features", "lint": "prettier -w *.js *.json src test scripts examples", - "build": "rollup -c --bundleConfigAsCjs" + "build": "rollup -c --bundleConfigAsCjs", + "watch": "pnpm run build --watch" }, "repository": { "type": "git", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3eafab1e..e72de7c8 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -5,13 +5,13 @@ specifiers: '@rollup/plugin-node-resolve': ^15.0.1 '@rollup/plugin-replace': ^5.0.2 '@rollup/plugin-terser': ^0.4.0 - acorn: ^7.1.1 + acorn: ^8.8.2 benchmark: ^2.1.4 c8: ^7.12.0 esno: ^0.16.3 - gl: ^5.0.3 + gl: ^6.0.2 gl-wiretap: ^0.6.2 - gpu-mock.js: ^1.3.0 + gpu-mock.js: ^1.3.1 prettier: ^2.8.3 qunit: ^2.9.1 read-dir-deep: ^7.0.1 @@ -20,8 +20,8 @@ specifiers: source-map-support: ^0.5.21 dependencies: - acorn: 7.4.1 - gl: 5.0.3 + acorn: 8.8.2 + gl: 6.0.2 gl-wiretap: 0.6.2 gpu-mock.js: 1.3.1 @@ -310,17 +310,10 @@ packages: resolution: {integrity: sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==} dev: false - /acorn/7.4.1: - resolution: {integrity: sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==} - engines: {node: '>=0.4.0'} - hasBin: true - dev: false - /acorn/8.8.2: resolution: {integrity: sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==} engines: {node: '>=0.4.0'} hasBin: true - dev: true /agent-base/6.0.2: resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} @@ -981,9 +974,9 @@ packages: resolution: {integrity: sha512-fxy1XGiPkfzK+T3XKDbY7yaqMBmozCGvAFyTwaZA3imeZH83w7Hr3r3bYlMRWIyzMI/lDUvUMM/92LE2OwqFyQ==} dev: false - /gl/5.0.3: - resolution: {integrity: sha512-toWmb3Rgli5Wl9ygjZeglFBVLDYMOomy+rXlVZVDCoIRV+6mQE5nY4NgQgokYIc5oQzc1pvWY9lQJ0hGn61ZUg==} - engines: {node: '>=12.0.0'} + /gl/6.0.2: + resolution: {integrity: sha512-yBbfpChOtFvg5D+KtMaBFvj6yt3vUnheNAH+UrQH2TfDB8kr0tERdL0Tjhe0W7xJ6jR6ftQBluTZR9jXUnKe8g==} + engines: {node: '>=14.0.0'} requiresBuild: true dependencies: bindings: 1.5.0 diff --git a/src/backend/function-node.js b/src/backend/function-node.js index c8e2ecf5..e313ac2a 100644 --- a/src/backend/function-node.js +++ b/src/backend/function-node.js @@ -217,6 +217,7 @@ export class FunctionNode { const ast = Object.freeze( inParser.parse(`const parser_${this.name} = ${this.source};`, { locations: true, + ecmaVersion: 'latest', }) ); // take out the function object, outside the var declarations diff --git a/src/browser.js b/src/browser.js index 99980955..d4ecb57b 100644 --- a/src/browser.js +++ b/src/browser.js @@ -47,4 +47,19 @@ GPU.plugins = { mathRandom, }; +Object.defineProperties(GPU, { + GLKernel: { + get() { + console.warn('The browser build does not support GLKernel'); + return CPUKernel; + }, + }, + HeadlessGLKernel: { + get() { + console.warn('The browser build does not support HeadlessGLKernel'); + return CPUKernel; + }, + }, +}); + export default GPU; diff --git a/src/utils.js b/src/utils.js index ab50ca50..64ff9f97 100644 --- a/src/utils.js +++ b/src/utils.js @@ -659,7 +659,7 @@ export const utils = { if (!flattened) { flattened = settings.flattened = {}; } - const ast = acorn.parse(source); + const ast = acorn.parse(source, { ecmaVersion: 'latest' }); const functionDependencies = []; let indent = 0; @@ -1108,7 +1108,9 @@ export const utils = { getMinifySafeName: fn => { try { - const ast = acorn.parse(`const value = ${fn.toString()}`); + const ast = acorn.parse(`const value = ${fn.toString()}`, { + ecmaVersion: 'latest', + }); const { init } = ast.body[0].declarations[0]; return init.body.name || init.body.body[0].argument.name; } catch (e) { diff --git a/test/all-template.html b/test/all-template.html index f00e1cfb..c0bc0db2 100644 --- a/test/all-template.html +++ b/test/all-template.html @@ -25,7 +25,7 @@ }, }; window.require = module => { - if (module.match(/[.][.]\/src$/)) return browserGPU; + if (module.match(/^[\.\/]+$/)) return browserGPU; if (module === 'sinon') return sinon; if (module === 'qunit') return QUnit; if (module === 'acorn') return acorn; diff --git a/test/all.html b/test/all.html deleted file mode 100644 index 2678878f..00000000 --- a/test/all.html +++ /dev/null @@ -1,797 +0,0 @@ - - - - - GPU.JS : Test All - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/benchmark-faster.js b/test/benchmark-faster.js index d28a2016..19b2b0d8 100644 --- a/test/benchmark-faster.js +++ b/test/benchmark-faster.js @@ -1,4 +1,4 @@ -const { GPU } = require('../src/index.js'); +const { GPU } = require('..'); const Benchmark = require('benchmark'); const suite = new Benchmark.Suite(); diff --git a/test/benchmark.js b/test/benchmark.js index afa3326e..595885c3 100644 --- a/test/benchmark.js +++ b/test/benchmark.js @@ -1,4 +1,4 @@ -const { GPU } = require('../src/index.js'); +const { GPU } = require('..'); const Benchmark = require('benchmark'); const suite = new Benchmark.Suite(); diff --git a/test/features/add-custom-function.js b/test/features/add-custom-function.js index 2687173e..b661e6e8 100644 --- a/test/features/add-custom-function.js +++ b/test/features/add-custom-function.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('features: add custom function'); diff --git a/test/features/add-custom-native-function.js b/test/features/add-custom-native-function.js index f3e7f414..7fb0ebb9 100644 --- a/test/features/add-custom-native-function.js +++ b/test/features/add-custom-native-function.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('features: add native'); diff --git a/test/features/add-typed-functions.js b/test/features/add-typed-functions.js index 116eb36d..3762eec7 100644 --- a/test/features/add-typed-functions.js +++ b/test/features/add-typed-functions.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('features: add typed functions vec2Test'); diff --git a/test/features/argument-array-types.js b/test/features/argument-array-types.js index f96d7501..6596c921 100644 --- a/test/features/argument-array-types.js +++ b/test/features/argument-array-types.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('argument array types'); diff --git a/test/features/argument-array1d-types.js b/test/features/argument-array1d-types.js index bcfd8ac7..9f17ae96 100644 --- a/test/features/argument-array1d-types.js +++ b/test/features/argument-array1d-types.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('argument array 1 types'); diff --git a/test/features/argument-array2d-types.js b/test/features/argument-array2d-types.js index 98334f3e..c98b1ec4 100644 --- a/test/features/argument-array2d-types.js +++ b/test/features/argument-array2d-types.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('argument array 2 types'); diff --git a/test/features/argument-array3d-types.js b/test/features/argument-array3d-types.js index 7cad15a3..35464d33 100644 --- a/test/features/argument-array3d-types.js +++ b/test/features/argument-array3d-types.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('argument array 3 types'); diff --git a/test/features/arithmetic-operators.js b/test/features/arithmetic-operators.js index 743674d6..f3d1a570 100644 --- a/test/features/arithmetic-operators.js +++ b/test/features/arithmetic-operators.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('features: arithmetic operators'); diff --git a/test/features/assignment-operators.js b/test/features/assignment-operators.js index 4c10f053..33557660 100644 --- a/test/features/assignment-operators.js +++ b/test/features/assignment-operators.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('features: assignment operators'); diff --git a/test/features/basic-math.js b/test/features/basic-math.js index 5d12d761..c26118bd 100644 --- a/test/features/basic-math.js +++ b/test/features/basic-math.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('features: basic math'); diff --git a/test/features/bitwise-operators.js b/test/features/bitwise-operators.js index a0403f84..07874129 100644 --- a/test/features/bitwise-operators.js +++ b/test/features/bitwise-operators.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('feature: bitwise operators'); diff --git a/test/features/boolean-from-expression.js b/test/features/boolean-from-expression.js index c6e4e2ca..15c49616 100644 --- a/test/features/boolean-from-expression.js +++ b/test/features/boolean-from-expression.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('feature: bitwise operators'); diff --git a/test/features/canvas.js b/test/features/canvas.js index f841b387..3f0f41b4 100644 --- a/test/features/canvas.js +++ b/test/features/canvas.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); const { greenCanvas } = require('../browser-test-utils'); describe('features: canvas argument'); diff --git a/test/features/clear-textures.js b/test/features/clear-textures.js index 4e394fb0..e1ec9c26 100644 --- a/test/features/clear-textures.js +++ b/test/features/clear-textures.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('features: clear textures'); diff --git a/test/features/clone-textures.js b/test/features/clone-textures.js index 7e7e4d05..60aa56ab 100644 --- a/test/features/clone-textures.js +++ b/test/features/clone-textures.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('features: clone textures'); diff --git a/test/features/combine-kernels.js b/test/features/combine-kernels.js index acab8862..26e878d5 100644 --- a/test/features/combine-kernels.js +++ b/test/features/combine-kernels.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('features: combine kernels'); diff --git a/test/features/constants-array.js b/test/features/constants-array.js index 253ab9ad..6f9467a1 100644 --- a/test/features/constants-array.js +++ b/test/features/constants-array.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('features: constants array'); diff --git a/test/features/constants-bool.js b/test/features/constants-bool.js index 646a33fc..82d0dab8 100644 --- a/test/features/constants-bool.js +++ b/test/features/constants-bool.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('features: constants bool'); diff --git a/test/features/constants-canvas.js b/test/features/constants-canvas.js index f6f09be4..5e308c90 100644 --- a/test/features/constants-canvas.js +++ b/test/features/constants-canvas.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); const { greenCanvas } = require('../browser-test-utils'); describe('features: constants canvas'); diff --git a/test/features/constants-float.js b/test/features/constants-float.js index 2d92a808..83297688 100644 --- a/test/features/constants-float.js +++ b/test/features/constants-float.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('features: constants float'); diff --git a/test/features/constants-image-array.js b/test/features/constants-image-array.js index 756b0c58..9decfe74 100644 --- a/test/features/constants-image-array.js +++ b/test/features/constants-image-array.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe } = require('qunit'); -const { GPU, WebGLKernel } = require('../../src'); +const { GPU, WebGLKernel } = require('../..'); describe('features: constants image array'); diff --git a/test/features/constants-image.js b/test/features/constants-image.js index 4943c7b9..6e9e5451 100644 --- a/test/features/constants-image.js +++ b/test/features/constants-image.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('features: constants image'); diff --git a/test/features/constants-integer.js b/test/features/constants-integer.js index 67c01d72..56af7f5d 100644 --- a/test/features/constants-integer.js +++ b/test/features/constants-integer.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('features: constants integer'); diff --git a/test/features/constants-texture.js b/test/features/constants-texture.js index 07d2fcde..6b8565dd 100644 --- a/test/features/constants-texture.js +++ b/test/features/constants-texture.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('features: constants texture 1d'); diff --git a/test/features/cpu-with-textures.js b/test/features/cpu-with-textures.js index 72a959c5..ca8b5f43 100644 --- a/test/features/cpu-with-textures.js +++ b/test/features/cpu-with-textures.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('features: CPU with Textures'); diff --git a/test/features/create-kernel-map.js b/test/features/create-kernel-map.js index b7cca528..eb1051c7 100644 --- a/test/features/create-kernel-map.js +++ b/test/features/create-kernel-map.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU, alias } = require('../../src'); +const { GPU, alias } = require('../..'); describe('features: create kernel map'); diff --git a/test/features/demo.js b/test/features/demo.js index 86e40feb..f247fc60 100644 --- a/test/features/demo.js +++ b/test/features/demo.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('features: demo'); diff --git a/test/features/destroy.js b/test/features/destroy.js index 8f041635..346ae51f 100644 --- a/test/features/destroy.js +++ b/test/features/destroy.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe } = require('qunit'); -const { GPU, WebGLKernel } = require('../../src'); +const { GPU, WebGLKernel } = require('../..'); const sinon = require('sinon'); describe('features: destroy'); diff --git a/test/features/destructured-assignment.js b/test/features/destructured-assignment.js index b7456e50..252dbbec 100644 --- a/test/features/destructured-assignment.js +++ b/test/features/destructured-assignment.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('features: destructured assignment'); diff --git a/test/features/dev-mode.js b/test/features/dev-mode.js index 693bbb39..b17710d7 100644 --- a/test/features/dev-mode.js +++ b/test/features/dev-mode.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU, input } = require('../../src'); +const { GPU, input } = require('../..'); describe('features: dev mode'); diff --git a/test/features/dynamic-arguments.js b/test/features/dynamic-arguments.js index e454a5c8..6339af29 100644 --- a/test/features/dynamic-arguments.js +++ b/test/features/dynamic-arguments.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU, input } = require('../../src'); +const { GPU, input } = require('../..'); describe('features: dynamic arguments'); diff --git a/test/features/dynamic-output.js b/test/features/dynamic-output.js index e20d9c82..08961f5f 100644 --- a/test/features/dynamic-output.js +++ b/test/features/dynamic-output.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('features: dynamic output'); diff --git a/test/features/function-return.js b/test/features/function-return.js index fcf92180..52a15480 100644 --- a/test/features/function-return.js +++ b/test/features/function-return.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('features: function return'); diff --git a/test/features/get-canvas.js b/test/features/get-canvas.js index 6191d382..b8db2fd0 100644 --- a/test/features/get-canvas.js +++ b/test/features/get-canvas.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('get canvas'); diff --git a/test/features/get-pixels.js b/test/features/get-pixels.js index 71c871e1..65de1d0a 100644 --- a/test/features/get-pixels.js +++ b/test/features/get-pixels.js @@ -1,5 +1,5 @@ const { assert, test, module: describe, only, skip } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('features: getPixels'); diff --git a/test/features/if-else.js b/test/features/if-else.js index 48ed92e3..1f2494f9 100644 --- a/test/features/if-else.js +++ b/test/features/if-else.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('if else boolean'); diff --git a/test/features/image-array.js b/test/features/image-array.js index c92b1de0..d69dc659 100644 --- a/test/features/image-array.js +++ b/test/features/image-array.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU, CPUKernel } = require('../../src'); +const { GPU, CPUKernel } = require('../..'); describe('features: image array'); diff --git a/test/features/image.js b/test/features/image.js index 2a356d77..d44d8270 100644 --- a/test/features/image.js +++ b/test/features/image.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('image'); diff --git a/test/features/infinity.js b/test/features/infinity.js index 00d6dbff..efd5d8be 100644 --- a/test/features/infinity.js +++ b/test/features/infinity.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('infinity'); diff --git a/test/features/inject-native.js b/test/features/inject-native.js index 6be098ff..0876260b 100644 --- a/test/features/inject-native.js +++ b/test/features/inject-native.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('features: inject native'); diff --git a/test/features/input.js b/test/features/input.js index bf69dfb7..06f9ac1b 100644 --- a/test/features/input.js +++ b/test/features/input.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU, input } = require('../../src'); +const { GPU, input } = require('../..'); describe('input'); diff --git a/test/features/internally-defined-matrices.js b/test/features/internally-defined-matrices.js index 025dc8a0..94ae4627 100644 --- a/test/features/internally-defined-matrices.js +++ b/test/features/internally-defined-matrices.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('features: internally defined matrices'); diff --git a/test/features/json.js b/test/features/json.js index b373b6b6..159e2f54 100644 --- a/test/features/json.js +++ b/test/features/json.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('json serialize'); diff --git a/test/features/legacy-encoder.js b/test/features/legacy-encoder.js index 67cfa6bb..a56ec533 100644 --- a/test/features/legacy-encoder.js +++ b/test/features/legacy-encoder.js @@ -1,10 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { - GPU, - HeadlessGLKernel, - WebGLKernel, - WebGL2Kernel, -} = require('../../src'); +const { GPU, HeadlessGLKernel, WebGLKernel, WebGL2Kernel } = require('../..'); describe('features: legacy encoder'); diff --git a/test/features/loops.js b/test/features/loops.js index 7a431685..4b4f0060 100644 --- a/test/features/loops.js +++ b/test/features/loops.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('loops - for'); diff --git a/test/features/math-object.js b/test/features/math-object.js index 2a18d369..fc59e7ea 100644 --- a/test/features/math-object.js +++ b/test/features/math-object.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('features: math object'); diff --git a/test/features/nested-function.js b/test/features/nested-function.js index a5d753df..5eb3f582 100644 --- a/test/features/nested-function.js +++ b/test/features/nested-function.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('nested function'); diff --git a/test/features/optimize-float-memory.js b/test/features/optimize-float-memory.js index 8875420b..743568f4 100644 --- a/test/features/optimize-float-memory.js +++ b/test/features/optimize-float-memory.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU, utils } = require('../../src'); +const { GPU, utils } = require('../..'); describe('feature: optimizeFloatMemory'); diff --git a/test/features/output.js b/test/features/output.js index 07cfcbb9..8b6bcf6f 100644 --- a/test/features/output.js +++ b/test/features/output.js @@ -1,5 +1,5 @@ const { assert, test, module: describe, only, skip } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('features: output'); diff --git a/test/features/promise-api.js b/test/features/promise-api.js index 44d45da3..b8cd9ce8 100644 --- a/test/features/promise-api.js +++ b/test/features/promise-api.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('features: promise api'); diff --git a/test/features/raw-output.js b/test/features/raw-output.js index a4602fc1..c75f5303 100644 --- a/test/features/raw-output.js +++ b/test/features/raw-output.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('features: raw output'); diff --git a/test/features/read-color-texture.js b/test/features/read-color-texture.js index 4981d9c8..16abae3c 100644 --- a/test/features/read-color-texture.js +++ b/test/features/read-color-texture.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('features: read color texture'); diff --git a/test/features/read-from-texture.js b/test/features/read-from-texture.js index 793a136b..251d5a3e 100644 --- a/test/features/read-from-texture.js +++ b/test/features/read-from-texture.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe } = require('qunit'); -const { GPU, HeadlessGLKernel } = require('../../src'); +const { GPU, HeadlessGLKernel } = require('../..'); describe('features: read from texture'); diff --git a/test/features/read-image-bitmap.js b/test/features/read-image-bitmap.js index a0132ba9..0c11e7ea 100644 --- a/test/features/read-image-bitmap.js +++ b/test/features/read-image-bitmap.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('features: read from image bitmap'); diff --git a/test/features/read-image-data.js b/test/features/read-image-data.js index 51e269ad..2383b6bb 100644 --- a/test/features/read-image-data.js +++ b/test/features/read-image-data.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('features: read from image data'); diff --git a/test/features/return-arrays.js b/test/features/return-arrays.js index c16f69f7..3a4d47da 100644 --- a/test/features/return-arrays.js +++ b/test/features/return-arrays.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('features: return arrays'); diff --git a/test/features/single-precision-textures.js b/test/features/single-precision-textures.js index 153a7c25..af147d3b 100644 --- a/test/features/single-precision-textures.js +++ b/test/features/single-precision-textures.js @@ -1,5 +1,5 @@ const { assert, skip, test, only, module: describe } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('features: single precision textures'); diff --git a/test/features/single-precision.js b/test/features/single-precision.js index d31c7fb8..c530a140 100644 --- a/test/features/single-precision.js +++ b/test/features/single-precision.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('features: single precision'); diff --git a/test/features/switches.js b/test/features/switches.js index 406a834b..aed58711 100644 --- a/test/features/switches.js +++ b/test/features/switches.js @@ -1,5 +1,5 @@ const { assert, skip, test, only, module: describe } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('features: switches'); diff --git a/test/features/tactic.js b/test/features/tactic.js index 02900770..bed4247c 100644 --- a/test/features/tactic.js +++ b/test/features/tactic.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('internal: tactic'); diff --git a/test/features/ternary.js b/test/features/ternary.js index 4e6b009e..11ac077d 100644 --- a/test/features/ternary.js +++ b/test/features/ternary.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('feature: Ternary'); diff --git a/test/features/to-string/as-file.js b/test/features/to-string/as-file.js index 94fdd202..30face01 100644 --- a/test/features/to-string/as-file.js +++ b/test/features/to-string/as-file.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../src'); +const { GPU } = require('../../..'); describe('features: to-string as file'); diff --git a/test/features/to-string/precision/single/arguments/array.js b/test/features/to-string/precision/single/arguments/array.js index 517c3bff..d95b1b84 100644 --- a/test/features/to-string/precision/single/arguments/array.js +++ b/test/features/to-string/precision/single/arguments/array.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../../src'); +const { GPU } = require('../../../../../..'); describe('feature: to-string single precision arguments Array'); diff --git a/test/features/to-string/precision/single/arguments/array2.js b/test/features/to-string/precision/single/arguments/array2.js index 35dabddc..6402290e 100644 --- a/test/features/to-string/precision/single/arguments/array2.js +++ b/test/features/to-string/precision/single/arguments/array2.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../../src'); +const { GPU } = require('../../../../../..'); describe('feature: to-string single precision arguments Array(2)'); diff --git a/test/features/to-string/precision/single/arguments/array2d.js b/test/features/to-string/precision/single/arguments/array2d.js index 0c90e719..e51eb9fa 100644 --- a/test/features/to-string/precision/single/arguments/array2d.js +++ b/test/features/to-string/precision/single/arguments/array2d.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../../src'); +const { GPU } = require('../../../../../..'); describe('feature: to-string single precision arguments Array2D'); diff --git a/test/features/to-string/precision/single/arguments/array2d2.js b/test/features/to-string/precision/single/arguments/array2d2.js index a6208ddb..a7cfcb45 100644 --- a/test/features/to-string/precision/single/arguments/array2d2.js +++ b/test/features/to-string/precision/single/arguments/array2d2.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../../src'); +const { GPU } = require('../../../../../..'); describe('feature: to-string single precision arguments Array2D(2)'); diff --git a/test/features/to-string/precision/single/arguments/array2d3.js b/test/features/to-string/precision/single/arguments/array2d3.js index a7bf1718..f2902137 100644 --- a/test/features/to-string/precision/single/arguments/array2d3.js +++ b/test/features/to-string/precision/single/arguments/array2d3.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../../src'); +const { GPU } = require('../../../../../..'); describe('feature: to-string single precision arguments Array2D(3)'); diff --git a/test/features/to-string/precision/single/arguments/array3.js b/test/features/to-string/precision/single/arguments/array3.js index 1d0c33d4..9e8867b1 100644 --- a/test/features/to-string/precision/single/arguments/array3.js +++ b/test/features/to-string/precision/single/arguments/array3.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../../src'); +const { GPU } = require('../../../../../..'); describe('feature: to-string single precision arguments Array(3)'); diff --git a/test/features/to-string/precision/single/arguments/array3d.js b/test/features/to-string/precision/single/arguments/array3d.js index b0524cc2..8f20d4d6 100644 --- a/test/features/to-string/precision/single/arguments/array3d.js +++ b/test/features/to-string/precision/single/arguments/array3d.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../../src'); +const { GPU } = require('../../../../../..'); describe('feature: to-string single precision arguments Array3D'); diff --git a/test/features/to-string/precision/single/arguments/array4.js b/test/features/to-string/precision/single/arguments/array4.js index ebea2ab7..1fd4ed97 100644 --- a/test/features/to-string/precision/single/arguments/array4.js +++ b/test/features/to-string/precision/single/arguments/array4.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../../src'); +const { GPU } = require('../../../../../..'); describe('feature: to-string single precision arguments Array(4)'); diff --git a/test/features/to-string/precision/single/arguments/boolean.js b/test/features/to-string/precision/single/arguments/boolean.js index dc861262..f00b31b1 100644 --- a/test/features/to-string/precision/single/arguments/boolean.js +++ b/test/features/to-string/precision/single/arguments/boolean.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../../src'); +const { GPU } = require('../../../../../..'); describe('feature: to-string single precision arguments Boolean'); diff --git a/test/features/to-string/precision/single/arguments/float.js b/test/features/to-string/precision/single/arguments/float.js index 77eaddf9..85726c03 100644 --- a/test/features/to-string/precision/single/arguments/float.js +++ b/test/features/to-string/precision/single/arguments/float.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../../src'); +const { GPU } = require('../../../../../..'); describe('feature: to-string single precision arguments Float'); diff --git a/test/features/to-string/precision/single/arguments/html-canvas.js b/test/features/to-string/precision/single/arguments/html-canvas.js index c5c14de0..02f27b5f 100644 --- a/test/features/to-string/precision/single/arguments/html-canvas.js +++ b/test/features/to-string/precision/single/arguments/html-canvas.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../../src'); +const { GPU } = require('../../../../../..'); const { greenCanvas } = require('../../../../../browser-test-utils'); describe('feature: to-string single precision arguments HTMLCanvas'); diff --git a/test/features/to-string/precision/single/arguments/html-image-array.js b/test/features/to-string/precision/single/arguments/html-image-array.js index 0d2725e5..cb9c8636 100644 --- a/test/features/to-string/precision/single/arguments/html-image-array.js +++ b/test/features/to-string/precision/single/arguments/html-image-array.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU, CPUKernel } = require('../../../../../../src'); +const { GPU, CPUKernel } = require('../../../../../..'); describe('feature: to-string single precision arguments HTMLImageArray'); diff --git a/test/features/to-string/precision/single/arguments/html-image.js b/test/features/to-string/precision/single/arguments/html-image.js index eb2f7db8..e11967e7 100644 --- a/test/features/to-string/precision/single/arguments/html-image.js +++ b/test/features/to-string/precision/single/arguments/html-image.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../../src'); +const { GPU } = require('../../../../../..'); describe('feature: to-string single precision arguments HTMLImage'); diff --git a/test/features/to-string/precision/single/arguments/html-video.js b/test/features/to-string/precision/single/arguments/html-video.js index 40b62ec3..e4493473 100644 --- a/test/features/to-string/precision/single/arguments/html-video.js +++ b/test/features/to-string/precision/single/arguments/html-video.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../../src'); +const { GPU } = require('../../../../../..'); describe('feature: to-string single precision arguments HTMLVideo'); diff --git a/test/features/to-string/precision/single/arguments/input.js b/test/features/to-string/precision/single/arguments/input.js index f6aca281..97a7e387 100644 --- a/test/features/to-string/precision/single/arguments/input.js +++ b/test/features/to-string/precision/single/arguments/input.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU, input } = require('../../../../../../src'); +const { GPU, input } = require('../../../../../..'); describe('feature: to-string single precision arguments Input'); diff --git a/test/features/to-string/precision/single/arguments/integer.js b/test/features/to-string/precision/single/arguments/integer.js index d266789e..27def7a6 100644 --- a/test/features/to-string/precision/single/arguments/integer.js +++ b/test/features/to-string/precision/single/arguments/integer.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../../src'); +const { GPU } = require('../../../../../..'); describe('feature: to-string single precision arguments Integer'); diff --git a/test/features/to-string/precision/single/arguments/memory-optimized-number-texture.js b/test/features/to-string/precision/single/arguments/memory-optimized-number-texture.js index 9f2fe765..1f66ef00 100644 --- a/test/features/to-string/precision/single/arguments/memory-optimized-number-texture.js +++ b/test/features/to-string/precision/single/arguments/memory-optimized-number-texture.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../../src'); +const { GPU } = require('../../../../../..'); describe( 'feature: to-string single precision arguments MemoryOptimizedNumberTexture' diff --git a/test/features/to-string/precision/single/arguments/number-texture.js b/test/features/to-string/precision/single/arguments/number-texture.js index 2716e54c..3f203204 100644 --- a/test/features/to-string/precision/single/arguments/number-texture.js +++ b/test/features/to-string/precision/single/arguments/number-texture.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../../src'); +const { GPU } = require('../../../../../..'); describe('feature: to-string single precision arguments NumberTexture'); diff --git a/test/features/to-string/precision/single/constants/array.js b/test/features/to-string/precision/single/constants/array.js index 0cc5cdfa..06a118c6 100644 --- a/test/features/to-string/precision/single/constants/array.js +++ b/test/features/to-string/precision/single/constants/array.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../../src'); +const { GPU } = require('../../../../../..'); describe('feature: to-string single precision constants Array'); diff --git a/test/features/to-string/precision/single/constants/array2.js b/test/features/to-string/precision/single/constants/array2.js index ded5828a..11967c22 100644 --- a/test/features/to-string/precision/single/constants/array2.js +++ b/test/features/to-string/precision/single/constants/array2.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../../src'); +const { GPU } = require('../../../../../..'); describe('feature: to-string single precision constants Array(2)'); diff --git a/test/features/to-string/precision/single/constants/array2d.js b/test/features/to-string/precision/single/constants/array2d.js index 6a4a3f1d..493d996a 100644 --- a/test/features/to-string/precision/single/constants/array2d.js +++ b/test/features/to-string/precision/single/constants/array2d.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../../src'); +const { GPU } = require('../../../../../..'); describe('feature: to-string single precision constants 2d Array'); diff --git a/test/features/to-string/precision/single/constants/array3.js b/test/features/to-string/precision/single/constants/array3.js index 93ec4ca1..b88b1e68 100644 --- a/test/features/to-string/precision/single/constants/array3.js +++ b/test/features/to-string/precision/single/constants/array3.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../../src'); +const { GPU } = require('../../../../../..'); describe('feature: to-string single precision constants Array(3)'); diff --git a/test/features/to-string/precision/single/constants/array3d.js b/test/features/to-string/precision/single/constants/array3d.js index cb1c6db6..4f76dd59 100644 --- a/test/features/to-string/precision/single/constants/array3d.js +++ b/test/features/to-string/precision/single/constants/array3d.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../../src'); +const { GPU } = require('../../../../../..'); describe('feature: to-string single precision constants 3d Array'); diff --git a/test/features/to-string/precision/single/constants/array4.js b/test/features/to-string/precision/single/constants/array4.js index 32b5cfba..8faaabc2 100644 --- a/test/features/to-string/precision/single/constants/array4.js +++ b/test/features/to-string/precision/single/constants/array4.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../../src'); +const { GPU } = require('../../../../../..'); describe('feature: to-string single precision constants Array(4)'); diff --git a/test/features/to-string/precision/single/constants/boolean.js b/test/features/to-string/precision/single/constants/boolean.js index cc8bcf74..691d5a94 100644 --- a/test/features/to-string/precision/single/constants/boolean.js +++ b/test/features/to-string/precision/single/constants/boolean.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../../src'); +const { GPU } = require('../../../../../..'); describe('feature: to-string single precision constants Boolean'); diff --git a/test/features/to-string/precision/single/constants/float.js b/test/features/to-string/precision/single/constants/float.js index 62c86dfa..462f31ca 100644 --- a/test/features/to-string/precision/single/constants/float.js +++ b/test/features/to-string/precision/single/constants/float.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../../src'); +const { GPU } = require('../../../../../..'); describe('feature: to-string single precision constants Float'); diff --git a/test/features/to-string/precision/single/constants/html-canvas.js b/test/features/to-string/precision/single/constants/html-canvas.js index 8aebc537..0d7a6d6a 100644 --- a/test/features/to-string/precision/single/constants/html-canvas.js +++ b/test/features/to-string/precision/single/constants/html-canvas.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../../src'); +const { GPU } = require('../../../../../..'); const { greenCanvas } = require('../../../../../browser-test-utils'); describe('feature: to-string single precision constants HTMLCanvas'); diff --git a/test/features/to-string/precision/single/constants/html-image-array.js b/test/features/to-string/precision/single/constants/html-image-array.js index e8ecf1fe..aff11f6b 100644 --- a/test/features/to-string/precision/single/constants/html-image-array.js +++ b/test/features/to-string/precision/single/constants/html-image-array.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU, CPUKernel } = require('../../../../../../src'); +const { GPU, CPUKernel } = require('../../../../../..'); describe('feature: to-string single precision constants HTMLImageArray'); diff --git a/test/features/to-string/precision/single/constants/html-image.js b/test/features/to-string/precision/single/constants/html-image.js index 76a90c71..0a6ad2d7 100644 --- a/test/features/to-string/precision/single/constants/html-image.js +++ b/test/features/to-string/precision/single/constants/html-image.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../../src'); +const { GPU } = require('../../../../../..'); describe('feature: to-string single precision constants HTMLImage'); diff --git a/test/features/to-string/precision/single/constants/input.js b/test/features/to-string/precision/single/constants/input.js index 3d4949b9..c906408b 100644 --- a/test/features/to-string/precision/single/constants/input.js +++ b/test/features/to-string/precision/single/constants/input.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU, input } = require('../../../../../../src'); +const { GPU, input } = require('../../../../../..'); describe('feature: to-string single precision constants Input'); diff --git a/test/features/to-string/precision/single/constants/integer.js b/test/features/to-string/precision/single/constants/integer.js index 10afc964..49b3e5ae 100644 --- a/test/features/to-string/precision/single/constants/integer.js +++ b/test/features/to-string/precision/single/constants/integer.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../../src'); +const { GPU } = require('../../../../../..'); describe('feature: to-string single precision constants Integer'); diff --git a/test/features/to-string/precision/single/constants/memory-optimized-number-texture.js b/test/features/to-string/precision/single/constants/memory-optimized-number-texture.js index d55810fd..fff3e328 100644 --- a/test/features/to-string/precision/single/constants/memory-optimized-number-texture.js +++ b/test/features/to-string/precision/single/constants/memory-optimized-number-texture.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../../src'); +const { GPU } = require('../../../../../..'); describe( 'feature: to-string single precision constants MemoryOptimizedNumberTexture' diff --git a/test/features/to-string/precision/single/constants/number-texture.js b/test/features/to-string/precision/single/constants/number-texture.js index f604b1ed..23a10569 100644 --- a/test/features/to-string/precision/single/constants/number-texture.js +++ b/test/features/to-string/precision/single/constants/number-texture.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../../src'); +const { GPU } = require('../../../../../..'); describe('feature: to-string single precision constants NumberTexture'); diff --git a/test/features/to-string/precision/single/graphical.js b/test/features/to-string/precision/single/graphical.js index 9ba2fd70..32b87b72 100644 --- a/test/features/to-string/precision/single/graphical.js +++ b/test/features/to-string/precision/single/graphical.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../src'); +const { GPU } = require('../../../../..'); describe('feature: to-string single precision graphical'); diff --git a/test/features/to-string/precision/single/kernel-map/array/array.js b/test/features/to-string/precision/single/kernel-map/array/array.js index 9407de13..12f67399 100644 --- a/test/features/to-string/precision/single/kernel-map/array/array.js +++ b/test/features/to-string/precision/single/kernel-map/array/array.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../../../src'); +const { GPU } = require('../../../../../../..'); describe( 'feature: to-string single precision array style kernel map returns Array' diff --git a/test/features/to-string/precision/single/kernel-map/array/array2d.js b/test/features/to-string/precision/single/kernel-map/array/array2d.js index 8b8c724b..fb66c523 100644 --- a/test/features/to-string/precision/single/kernel-map/array/array2d.js +++ b/test/features/to-string/precision/single/kernel-map/array/array2d.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../../../src'); +const { GPU } = require('../../../../../../..'); describe( 'feature: to-string single precision array style kernel map returns 2D Array' diff --git a/test/features/to-string/precision/single/kernel-map/array/array3d.js b/test/features/to-string/precision/single/kernel-map/array/array3d.js index ae90e843..059219f1 100644 --- a/test/features/to-string/precision/single/kernel-map/array/array3d.js +++ b/test/features/to-string/precision/single/kernel-map/array/array3d.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../../../src'); +const { GPU } = require('../../../../../../..'); describe( 'feature: to-string single precision array style kernel map returns Array3d' diff --git a/test/features/to-string/precision/single/kernel-map/array/memory-optimized-number-texture.js b/test/features/to-string/precision/single/kernel-map/array/memory-optimized-number-texture.js index edb31d6d..608159fd 100644 --- a/test/features/to-string/precision/single/kernel-map/array/memory-optimized-number-texture.js +++ b/test/features/to-string/precision/single/kernel-map/array/memory-optimized-number-texture.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../../../src'); +const { GPU } = require('../../../../../../..'); describe( 'feature: to-string single precision array style kernel map returns MemoryOptimizedNumberTexture' diff --git a/test/features/to-string/precision/single/kernel-map/array/number-texture.js b/test/features/to-string/precision/single/kernel-map/array/number-texture.js index 250bcefb..44f47073 100644 --- a/test/features/to-string/precision/single/kernel-map/array/number-texture.js +++ b/test/features/to-string/precision/single/kernel-map/array/number-texture.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../../../src'); +const { GPU } = require('../../../../../../..'); describe( 'feature: to-string single precision array style kernel map returns NumberTexture' diff --git a/test/features/to-string/precision/single/kernel-map/object/array.js b/test/features/to-string/precision/single/kernel-map/object/array.js index 0671d4d3..b2fda5cc 100644 --- a/test/features/to-string/precision/single/kernel-map/object/array.js +++ b/test/features/to-string/precision/single/kernel-map/object/array.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../../../src'); +const { GPU } = require('../../../../../../..'); describe('feature: to-string single precision object style returns Array'); diff --git a/test/features/to-string/precision/single/kernel-map/object/array2d.js b/test/features/to-string/precision/single/kernel-map/object/array2d.js index e1da95a0..069488f3 100644 --- a/test/features/to-string/precision/single/kernel-map/object/array2d.js +++ b/test/features/to-string/precision/single/kernel-map/object/array2d.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../../../src'); +const { GPU } = require('../../../../../../..'); describe('feature: to-string single precision object style returns Array2D'); diff --git a/test/features/to-string/precision/single/kernel-map/object/array3d.js b/test/features/to-string/precision/single/kernel-map/object/array3d.js index 2d5a9059..3efea9db 100644 --- a/test/features/to-string/precision/single/kernel-map/object/array3d.js +++ b/test/features/to-string/precision/single/kernel-map/object/array3d.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../../../src'); +const { GPU } = require('../../../../../../..'); describe('feature: to-string single precision object style returns Array3d'); diff --git a/test/features/to-string/precision/single/kernel-map/object/memory-optimized-number-texture.js b/test/features/to-string/precision/single/kernel-map/object/memory-optimized-number-texture.js index a703208f..bf097a00 100644 --- a/test/features/to-string/precision/single/kernel-map/object/memory-optimized-number-texture.js +++ b/test/features/to-string/precision/single/kernel-map/object/memory-optimized-number-texture.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../../../src'); +const { GPU } = require('../../../../../../..'); describe( 'feature: to-string single precision object style kernel map returns MemoryOptimizedNumberTexture' diff --git a/test/features/to-string/precision/single/kernel-map/object/number-texture.js b/test/features/to-string/precision/single/kernel-map/object/number-texture.js index a75e5894..5fe73ed5 100644 --- a/test/features/to-string/precision/single/kernel-map/object/number-texture.js +++ b/test/features/to-string/precision/single/kernel-map/object/number-texture.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../../../src'); +const { GPU } = require('../../../../../../..'); describe( 'feature: to-string single precision object style kernel map returns NumberTexture' diff --git a/test/features/to-string/precision/single/returns/array.js b/test/features/to-string/precision/single/returns/array.js index b536b2eb..95f519e0 100644 --- a/test/features/to-string/precision/single/returns/array.js +++ b/test/features/to-string/precision/single/returns/array.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../../src'); +const { GPU } = require('../../../../../..'); describe('feature: to-string single precision returns Array'); diff --git a/test/features/to-string/precision/single/returns/array2d.js b/test/features/to-string/precision/single/returns/array2d.js index 3b595d82..09dcb15c 100644 --- a/test/features/to-string/precision/single/returns/array2d.js +++ b/test/features/to-string/precision/single/returns/array2d.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../../src'); +const { GPU } = require('../../../../../..'); describe('feature: to-string single precision returns Array2D'); diff --git a/test/features/to-string/precision/single/returns/array3d.js b/test/features/to-string/precision/single/returns/array3d.js index a94245f6..e0b2ebe7 100644 --- a/test/features/to-string/precision/single/returns/array3d.js +++ b/test/features/to-string/precision/single/returns/array3d.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../../src'); +const { GPU } = require('../../../../../..'); describe('feature: to-string single precision returns Array3d'); diff --git a/test/features/to-string/precision/single/returns/texture.js b/test/features/to-string/precision/single/returns/texture.js index 31191b0d..34e7105a 100644 --- a/test/features/to-string/precision/single/returns/texture.js +++ b/test/features/to-string/precision/single/returns/texture.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../../src'); +const { GPU } = require('../../../../../..'); describe('feature: to-string single precision returns Texture'); diff --git a/test/features/to-string/precision/unsigned/arguments/array.js b/test/features/to-string/precision/unsigned/arguments/array.js index ef81f8a4..9256795e 100644 --- a/test/features/to-string/precision/unsigned/arguments/array.js +++ b/test/features/to-string/precision/unsigned/arguments/array.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../../src'); +const { GPU } = require('../../../../../..'); describe('feature: to-string unsigned precision arguments Array'); diff --git a/test/features/to-string/precision/unsigned/arguments/array2.js b/test/features/to-string/precision/unsigned/arguments/array2.js index 52201f96..537e7fc8 100644 --- a/test/features/to-string/precision/unsigned/arguments/array2.js +++ b/test/features/to-string/precision/unsigned/arguments/array2.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../../src'); +const { GPU } = require('../../../../../..'); describe('feature: to-string unsigned precision arguments Array(2)'); diff --git a/test/features/to-string/precision/unsigned/arguments/array2d.js b/test/features/to-string/precision/unsigned/arguments/array2d.js index fe0f4a9a..425b2452 100644 --- a/test/features/to-string/precision/unsigned/arguments/array2d.js +++ b/test/features/to-string/precision/unsigned/arguments/array2d.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../../src'); +const { GPU } = require('../../../../../..'); describe('feature: to-string unsigned precision arguments Array2D'); diff --git a/test/features/to-string/precision/unsigned/arguments/array3.js b/test/features/to-string/precision/unsigned/arguments/array3.js index b0333d9c..3bb4c14d 100644 --- a/test/features/to-string/precision/unsigned/arguments/array3.js +++ b/test/features/to-string/precision/unsigned/arguments/array3.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../../src'); +const { GPU } = require('../../../../../..'); describe('feature: to-string unsigned precision arguments Array(3)'); diff --git a/test/features/to-string/precision/unsigned/arguments/array3d.js b/test/features/to-string/precision/unsigned/arguments/array3d.js index ae66310c..c657d915 100644 --- a/test/features/to-string/precision/unsigned/arguments/array3d.js +++ b/test/features/to-string/precision/unsigned/arguments/array3d.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../../src'); +const { GPU } = require('../../../../../..'); describe('feature: to-string unsigned precision arguments Array3D'); diff --git a/test/features/to-string/precision/unsigned/arguments/array4.js b/test/features/to-string/precision/unsigned/arguments/array4.js index f8e32097..4f1a343c 100644 --- a/test/features/to-string/precision/unsigned/arguments/array4.js +++ b/test/features/to-string/precision/unsigned/arguments/array4.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../../src'); +const { GPU } = require('../../../../../..'); describe('feature: to-string unsigned precision arguments Array(4)'); diff --git a/test/features/to-string/precision/unsigned/arguments/boolean.js b/test/features/to-string/precision/unsigned/arguments/boolean.js index 6f7874cb..2dd585b6 100644 --- a/test/features/to-string/precision/unsigned/arguments/boolean.js +++ b/test/features/to-string/precision/unsigned/arguments/boolean.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../../src'); +const { GPU } = require('../../../../../..'); describe('feature: to-string unsigned precision arguments Boolean'); diff --git a/test/features/to-string/precision/unsigned/arguments/float.js b/test/features/to-string/precision/unsigned/arguments/float.js index 16c347c9..920bcb02 100644 --- a/test/features/to-string/precision/unsigned/arguments/float.js +++ b/test/features/to-string/precision/unsigned/arguments/float.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../../src'); +const { GPU } = require('../../../../../..'); describe('feature: to-string unsigned precision arguments Float'); diff --git a/test/features/to-string/precision/unsigned/arguments/html-canvas.js b/test/features/to-string/precision/unsigned/arguments/html-canvas.js index f4050e0e..62b03344 100644 --- a/test/features/to-string/precision/unsigned/arguments/html-canvas.js +++ b/test/features/to-string/precision/unsigned/arguments/html-canvas.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../../src'); +const { GPU } = require('../../../../../..'); const { greenCanvas } = require('../../../../../browser-test-utils'); describe('feature: to-string unsigned precision arguments HTMLCanvas'); diff --git a/test/features/to-string/precision/unsigned/arguments/html-image-array.js b/test/features/to-string/precision/unsigned/arguments/html-image-array.js index 6dfd236e..44ef2f2d 100644 --- a/test/features/to-string/precision/unsigned/arguments/html-image-array.js +++ b/test/features/to-string/precision/unsigned/arguments/html-image-array.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU, CPUKernel } = require('../../../../../../src'); +const { GPU, CPUKernel } = require('../../../../../..'); describe('feature: to-string unsigned precision arguments HTMLImageArray'); diff --git a/test/features/to-string/precision/unsigned/arguments/html-image.js b/test/features/to-string/precision/unsigned/arguments/html-image.js index ace04072..f60f43f3 100644 --- a/test/features/to-string/precision/unsigned/arguments/html-image.js +++ b/test/features/to-string/precision/unsigned/arguments/html-image.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../../src'); +const { GPU } = require('../../../../../..'); describe('feature: to-string unsigned precision arguments HTMLImage'); diff --git a/test/features/to-string/precision/unsigned/arguments/html-video.js b/test/features/to-string/precision/unsigned/arguments/html-video.js index 4efda3d7..2cb26d5b 100644 --- a/test/features/to-string/precision/unsigned/arguments/html-video.js +++ b/test/features/to-string/precision/unsigned/arguments/html-video.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../../src'); +const { GPU } = require('../../../../../..'); describe('feature: to-string unsigned precision arguments HTMLVideo'); diff --git a/test/features/to-string/precision/unsigned/arguments/input.js b/test/features/to-string/precision/unsigned/arguments/input.js index a6e98a16..73d769c3 100644 --- a/test/features/to-string/precision/unsigned/arguments/input.js +++ b/test/features/to-string/precision/unsigned/arguments/input.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU, input } = require('../../../../../../src'); +const { GPU, input } = require('../../../../../..'); describe('feature: to-string unsigned precision arguments Input'); diff --git a/test/features/to-string/precision/unsigned/arguments/integer.js b/test/features/to-string/precision/unsigned/arguments/integer.js index a33823d0..7e1e1313 100644 --- a/test/features/to-string/precision/unsigned/arguments/integer.js +++ b/test/features/to-string/precision/unsigned/arguments/integer.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../../src'); +const { GPU } = require('../../../../../..'); describe('feature: to-string unsigned precision arguments Integer'); diff --git a/test/features/to-string/precision/unsigned/arguments/memory-optimized-number-texture.js b/test/features/to-string/precision/unsigned/arguments/memory-optimized-number-texture.js index 385121f5..55289fdc 100644 --- a/test/features/to-string/precision/unsigned/arguments/memory-optimized-number-texture.js +++ b/test/features/to-string/precision/unsigned/arguments/memory-optimized-number-texture.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../../src'); +const { GPU } = require('../../../../../..'); describe( 'feature: to-string unsigned precision arguments MemoryOptimizedNumberTexture' diff --git a/test/features/to-string/precision/unsigned/arguments/number-texture.js b/test/features/to-string/precision/unsigned/arguments/number-texture.js index 821f94d5..0771eafa 100644 --- a/test/features/to-string/precision/unsigned/arguments/number-texture.js +++ b/test/features/to-string/precision/unsigned/arguments/number-texture.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../../src'); +const { GPU } = require('../../../../../..'); describe('feature: to-string unsigned precision arguments NumberTexture'); diff --git a/test/features/to-string/precision/unsigned/constants/array.js b/test/features/to-string/precision/unsigned/constants/array.js index 7ac1f114..7992852b 100644 --- a/test/features/to-string/precision/unsigned/constants/array.js +++ b/test/features/to-string/precision/unsigned/constants/array.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../../src'); +const { GPU } = require('../../../../../..'); describe('feature: to-string unsigned precision constants Array'); diff --git a/test/features/to-string/precision/unsigned/constants/array2.js b/test/features/to-string/precision/unsigned/constants/array2.js index 1efb64c1..3a48039f 100644 --- a/test/features/to-string/precision/unsigned/constants/array2.js +++ b/test/features/to-string/precision/unsigned/constants/array2.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../../src'); +const { GPU } = require('../../../../../..'); describe('feature: to-string unsigned precision constants Array(2)'); diff --git a/test/features/to-string/precision/unsigned/constants/array2d.js b/test/features/to-string/precision/unsigned/constants/array2d.js index 6f5c9cec..6d18229d 100644 --- a/test/features/to-string/precision/unsigned/constants/array2d.js +++ b/test/features/to-string/precision/unsigned/constants/array2d.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../../src'); +const { GPU } = require('../../../../../..'); describe('feature: to-string unsigned precision constants Array2D'); diff --git a/test/features/to-string/precision/unsigned/constants/array3.js b/test/features/to-string/precision/unsigned/constants/array3.js index 92a0ea49..04853984 100644 --- a/test/features/to-string/precision/unsigned/constants/array3.js +++ b/test/features/to-string/precision/unsigned/constants/array3.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../../src'); +const { GPU } = require('../../../../../..'); describe('feature: to-string unsigned precision constants Array(3)'); diff --git a/test/features/to-string/precision/unsigned/constants/array3d.js b/test/features/to-string/precision/unsigned/constants/array3d.js index 83db0b5a..d5cef7e8 100644 --- a/test/features/to-string/precision/unsigned/constants/array3d.js +++ b/test/features/to-string/precision/unsigned/constants/array3d.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../../src'); +const { GPU } = require('../../../../../..'); describe('feature: to-string unsigned precision constants Array3D'); diff --git a/test/features/to-string/precision/unsigned/constants/array4.js b/test/features/to-string/precision/unsigned/constants/array4.js index 8580a74f..fa9451f8 100644 --- a/test/features/to-string/precision/unsigned/constants/array4.js +++ b/test/features/to-string/precision/unsigned/constants/array4.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../../src'); +const { GPU } = require('../../../../../..'); describe('feature: to-string unsigned precision constants Array(4)'); diff --git a/test/features/to-string/precision/unsigned/constants/boolean.js b/test/features/to-string/precision/unsigned/constants/boolean.js index c1a8ac86..a641d6cc 100644 --- a/test/features/to-string/precision/unsigned/constants/boolean.js +++ b/test/features/to-string/precision/unsigned/constants/boolean.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../../src'); +const { GPU } = require('../../../../../..'); describe('feature: to-string unsigned precision constants Boolean'); diff --git a/test/features/to-string/precision/unsigned/constants/float.js b/test/features/to-string/precision/unsigned/constants/float.js index 070ddf6a..bbd3fcf7 100644 --- a/test/features/to-string/precision/unsigned/constants/float.js +++ b/test/features/to-string/precision/unsigned/constants/float.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../../src'); +const { GPU } = require('../../../../../..'); describe('feature: to-string unsigned precision constants Float'); diff --git a/test/features/to-string/precision/unsigned/constants/html-canvas.js b/test/features/to-string/precision/unsigned/constants/html-canvas.js index eed2bd20..1f6edfda 100644 --- a/test/features/to-string/precision/unsigned/constants/html-canvas.js +++ b/test/features/to-string/precision/unsigned/constants/html-canvas.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../../src'); +const { GPU } = require('../../../../../..'); const { greenCanvas } = require('../../../../../browser-test-utils'); describe('feature: to-string unsigned precision constants HTMLCanvas'); diff --git a/test/features/to-string/precision/unsigned/constants/html-image-array.js b/test/features/to-string/precision/unsigned/constants/html-image-array.js index 26c200fa..7becef4f 100644 --- a/test/features/to-string/precision/unsigned/constants/html-image-array.js +++ b/test/features/to-string/precision/unsigned/constants/html-image-array.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU, CPUKernel } = require('../../../../../../src'); +const { GPU, CPUKernel } = require('../../../../../..'); describe('feature: to-string unsigned precision constants HTMLImageArray'); diff --git a/test/features/to-string/precision/unsigned/constants/html-image.js b/test/features/to-string/precision/unsigned/constants/html-image.js index f9681f59..c133a99e 100644 --- a/test/features/to-string/precision/unsigned/constants/html-image.js +++ b/test/features/to-string/precision/unsigned/constants/html-image.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU, utils } = require('../../../../../../src'); +const { GPU, utils } = require('../../../../../..'); const { loadImage, imageToArray, diff --git a/test/features/to-string/precision/unsigned/constants/input.js b/test/features/to-string/precision/unsigned/constants/input.js index 1e7d0c49..1639a659 100644 --- a/test/features/to-string/precision/unsigned/constants/input.js +++ b/test/features/to-string/precision/unsigned/constants/input.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU, input } = require('../../../../../../src'); +const { GPU, input } = require('../../../../../..'); describe('feature: to-string unsigned precision constants Input'); diff --git a/test/features/to-string/precision/unsigned/constants/integer.js b/test/features/to-string/precision/unsigned/constants/integer.js index 3e8e77fc..c7dd0f8a 100644 --- a/test/features/to-string/precision/unsigned/constants/integer.js +++ b/test/features/to-string/precision/unsigned/constants/integer.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../../src'); +const { GPU } = require('../../../../../..'); describe('feature: to-string unsigned precision constants Integer'); diff --git a/test/features/to-string/precision/unsigned/constants/memory-optimized-number-texture.js b/test/features/to-string/precision/unsigned/constants/memory-optimized-number-texture.js index d7204791..479f9e43 100644 --- a/test/features/to-string/precision/unsigned/constants/memory-optimized-number-texture.js +++ b/test/features/to-string/precision/unsigned/constants/memory-optimized-number-texture.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../../src'); +const { GPU } = require('../../../../../..'); describe( 'feature: to-string unsigned precision constants MemoryOptimizedNumberTexture' diff --git a/test/features/to-string/precision/unsigned/constants/number-texture.js b/test/features/to-string/precision/unsigned/constants/number-texture.js index 405f7c65..6a4a081b 100644 --- a/test/features/to-string/precision/unsigned/constants/number-texture.js +++ b/test/features/to-string/precision/unsigned/constants/number-texture.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../../src'); +const { GPU } = require('../../../../../..'); describe('feature: to-string unsigned precision constants NumberTexture'); diff --git a/test/features/to-string/precision/unsigned/graphical.js b/test/features/to-string/precision/unsigned/graphical.js index 8a65fbf1..e4678782 100644 --- a/test/features/to-string/precision/unsigned/graphical.js +++ b/test/features/to-string/precision/unsigned/graphical.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../src'); +const { GPU } = require('../../../../..'); describe('feature: to-string unsigned precision graphical'); diff --git a/test/features/to-string/precision/unsigned/kernel-map/array/array.js b/test/features/to-string/precision/unsigned/kernel-map/array/array.js index 6f49b413..10530dc7 100644 --- a/test/features/to-string/precision/unsigned/kernel-map/array/array.js +++ b/test/features/to-string/precision/unsigned/kernel-map/array/array.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../../../src'); +const { GPU } = require('../../../../../../..'); describe( 'feature: to-string unsigned precision array style kernel map returns Array' diff --git a/test/features/to-string/precision/unsigned/kernel-map/array/array2d.js b/test/features/to-string/precision/unsigned/kernel-map/array/array2d.js index 3f8c1f71..8e19e08f 100644 --- a/test/features/to-string/precision/unsigned/kernel-map/array/array2d.js +++ b/test/features/to-string/precision/unsigned/kernel-map/array/array2d.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../../../src'); +const { GPU } = require('../../../../../../..'); describe( 'feature: to-string unsigned precision array style kernel map returns Array2D' diff --git a/test/features/to-string/precision/unsigned/kernel-map/array/array3d.js b/test/features/to-string/precision/unsigned/kernel-map/array/array3d.js index 512ffc7a..292e0187 100644 --- a/test/features/to-string/precision/unsigned/kernel-map/array/array3d.js +++ b/test/features/to-string/precision/unsigned/kernel-map/array/array3d.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../../../src'); +const { GPU } = require('../../../../../../..'); describe( 'feature: to-string unsigned precision array style kernel map returns Array3d' diff --git a/test/features/to-string/precision/unsigned/kernel-map/array/memory-optimized-number-texture.js b/test/features/to-string/precision/unsigned/kernel-map/array/memory-optimized-number-texture.js index 846f8e92..7b78a141 100644 --- a/test/features/to-string/precision/unsigned/kernel-map/array/memory-optimized-number-texture.js +++ b/test/features/to-string/precision/unsigned/kernel-map/array/memory-optimized-number-texture.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../../../src'); +const { GPU } = require('../../../../../../..'); describe( 'feature: to-string unsigned precision array style kernel map returns MemoryOptimizedNumberTexture' diff --git a/test/features/to-string/precision/unsigned/kernel-map/array/number-texture.js b/test/features/to-string/precision/unsigned/kernel-map/array/number-texture.js index 095ed9bd..35f616b8 100644 --- a/test/features/to-string/precision/unsigned/kernel-map/array/number-texture.js +++ b/test/features/to-string/precision/unsigned/kernel-map/array/number-texture.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../../../src'); +const { GPU } = require('../../../../../../..'); describe( 'feature: to-string unsigned precision array style kernel map returns NumberTexture' diff --git a/test/features/to-string/precision/unsigned/kernel-map/object/array.js b/test/features/to-string/precision/unsigned/kernel-map/object/array.js index a1e08f2d..cd99bcd9 100644 --- a/test/features/to-string/precision/unsigned/kernel-map/object/array.js +++ b/test/features/to-string/precision/unsigned/kernel-map/object/array.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../../../src'); +const { GPU } = require('../../../../../../..'); describe('feature: to-string unsigned precision object style returns Array'); diff --git a/test/features/to-string/precision/unsigned/kernel-map/object/array2d.js b/test/features/to-string/precision/unsigned/kernel-map/object/array2d.js index 41f6c0fe..66d94bef 100644 --- a/test/features/to-string/precision/unsigned/kernel-map/object/array2d.js +++ b/test/features/to-string/precision/unsigned/kernel-map/object/array2d.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../../../src'); +const { GPU } = require('../../../../../../..'); describe('feature: to-string unsigned precision object style returns Array2D'); diff --git a/test/features/to-string/precision/unsigned/kernel-map/object/array3d.js b/test/features/to-string/precision/unsigned/kernel-map/object/array3d.js index f70b3838..a5a84e38 100644 --- a/test/features/to-string/precision/unsigned/kernel-map/object/array3d.js +++ b/test/features/to-string/precision/unsigned/kernel-map/object/array3d.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../../../src'); +const { GPU } = require('../../../../../../..'); describe('feature: to-string unsigned precision object style returns Array3d'); diff --git a/test/features/to-string/precision/unsigned/kernel-map/object/memory-optimized-number-texture.js b/test/features/to-string/precision/unsigned/kernel-map/object/memory-optimized-number-texture.js index ae0e23a6..a757cceb 100644 --- a/test/features/to-string/precision/unsigned/kernel-map/object/memory-optimized-number-texture.js +++ b/test/features/to-string/precision/unsigned/kernel-map/object/memory-optimized-number-texture.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../../../src'); +const { GPU } = require('../../../../../../..'); describe( 'feature: to-string unsigned precision object style kernel map returns MemoryOptimizedNumberTexture' diff --git a/test/features/to-string/precision/unsigned/kernel-map/object/number-texture.js b/test/features/to-string/precision/unsigned/kernel-map/object/number-texture.js index 868a7351..f4462e5f 100644 --- a/test/features/to-string/precision/unsigned/kernel-map/object/number-texture.js +++ b/test/features/to-string/precision/unsigned/kernel-map/object/number-texture.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../../../src'); +const { GPU } = require('../../../../../../..'); describe( 'feature: to-string unsigned precision object style kernel map returns NumberTexture' diff --git a/test/features/to-string/precision/unsigned/returns/array.js b/test/features/to-string/precision/unsigned/returns/array.js index 6f31d1ca..923ae90e 100644 --- a/test/features/to-string/precision/unsigned/returns/array.js +++ b/test/features/to-string/precision/unsigned/returns/array.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../../src'); +const { GPU } = require('../../../../../..'); describe('feature: to-string unsigned precision returns Array'); diff --git a/test/features/to-string/precision/unsigned/returns/array2d.js b/test/features/to-string/precision/unsigned/returns/array2d.js index 15fb3972..a9355687 100644 --- a/test/features/to-string/precision/unsigned/returns/array2d.js +++ b/test/features/to-string/precision/unsigned/returns/array2d.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../../src'); +const { GPU } = require('../../../../../..'); describe('feature: to-string unsigned precision returns Array2D'); diff --git a/test/features/to-string/precision/unsigned/returns/array3d.js b/test/features/to-string/precision/unsigned/returns/array3d.js index 08d27dc1..cabf23f8 100644 --- a/test/features/to-string/precision/unsigned/returns/array3d.js +++ b/test/features/to-string/precision/unsigned/returns/array3d.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../../src'); +const { GPU } = require('../../../../../..'); describe('feature: to-string unsigned precision returns Array3d'); diff --git a/test/features/to-string/precision/unsigned/returns/texture.js b/test/features/to-string/precision/unsigned/returns/texture.js index 7c335646..1ca3eb59 100644 --- a/test/features/to-string/precision/unsigned/returns/texture.js +++ b/test/features/to-string/precision/unsigned/returns/texture.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../../../../../src'); +const { GPU } = require('../../../../../..'); describe('feature: to-string unsigned precision returns Texture'); diff --git a/test/features/type-management.js b/test/features/type-management.js index f5784d59..e34c2a7f 100644 --- a/test/features/type-management.js +++ b/test/features/type-management.js @@ -4,7 +4,7 @@ const { WebGLFunctionNode, WebGL2FunctionNode, CPUFunctionNode, -} = require('../../src'); +} = require('../..'); describe('features: type management'); diff --git a/test/features/unsigned-precision-textures.js b/test/features/unsigned-precision-textures.js index b63ebfa3..efc74e4e 100644 --- a/test/features/unsigned-precision-textures.js +++ b/test/features/unsigned-precision-textures.js @@ -1,5 +1,5 @@ const { assert, skip, test, only, module: describe } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('features: unsigned precision textures'); diff --git a/test/features/video.js b/test/features/video.js index 13268220..579ffcf3 100644 --- a/test/features/video.js +++ b/test/features/video.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('video'); diff --git a/test/index.js b/test/index.js index 81e1c630..c1a4e707 100644 --- a/test/index.js +++ b/test/index.js @@ -1,6 +1,6 @@ const { expect } = require('chai'); -const GPU = require('../src/index.js'); +const GPU = require('..'); describe('Test Node GPU', () => { describe('gpu mode', () => { diff --git a/test/internal/argument-texture-switching.js b/test/internal/argument-texture-switching.js index 0d62bb6b..ae565919 100644 --- a/test/internal/argument-texture-switching.js +++ b/test/internal/argument-texture-switching.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('internal: argument texture switching'); diff --git a/test/internal/backend/cpu-kernel.js b/test/internal/backend/cpu-kernel.js index a308a547..5b9701de 100644 --- a/test/internal/backend/cpu-kernel.js +++ b/test/internal/backend/cpu-kernel.js @@ -1,6 +1,6 @@ const sinon = require('sinon'); const { assert, skip, test, module: describe, only } = require('qunit'); -const { CPUKernel } = require('../../../src'); +const { CPUKernel } = require('../../..'); describe('internal: CPUKernel'); diff --git a/test/internal/backend/function-node/isSafe.js b/test/internal/backend/function-node/isSafe.js index 86bd6822..1c0558c8 100644 --- a/test/internal/backend/function-node/isSafe.js +++ b/test/internal/backend/function-node/isSafe.js @@ -1,5 +1,5 @@ const { assert, test, module: describe, only } = require('qunit'); -const { FunctionNode } = require(process.cwd() + '/src'); +const { FunctionNode } = require('../../../..'); describe('FunctionNode.isSafe()'); diff --git a/test/internal/backend/function-node/isSafeDependencies.js b/test/internal/backend/function-node/isSafeDependencies.js index 28fee075..14d733b6 100644 --- a/test/internal/backend/function-node/isSafeDependencies.js +++ b/test/internal/backend/function-node/isSafeDependencies.js @@ -1,5 +1,5 @@ const { assert, test, module: describe, only } = require('qunit'); -const { FunctionNode } = require(process.cwd() + '/src'); +const { FunctionNode } = require('../../../..'); describe('FunctionNode.isSafeDependencies()'); diff --git a/test/internal/backend/gl-kernel.js b/test/internal/backend/gl-kernel.js index d6d8a098..5e49364d 100644 --- a/test/internal/backend/gl-kernel.js +++ b/test/internal/backend/gl-kernel.js @@ -1,6 +1,6 @@ const { assert, test, module: describe, only, skip } = require('qunit'); const sinon = require('sinon'); -const { GLKernel, GPU } = require(process.cwd() + '/src'); +const { GLKernel, GPU } = require('../../..'); describe('GLKernel'); diff --git a/test/internal/backend/headless-gl/kernel/index.js b/test/internal/backend/headless-gl/kernel/index.js index daad0c6e..3190e15f 100644 --- a/test/internal/backend/headless-gl/kernel/index.js +++ b/test/internal/backend/headless-gl/kernel/index.js @@ -12,7 +12,7 @@ describe('internal: HeadlessGLKernel'); }, }; // this is done late on purpose! Do not change this, as it causes HeadlessGL to initialize with certain values - const { HeadlessGLKernel } = require('../../../../../src'); + const { HeadlessGLKernel } = require('../../../../..'); HeadlessGLKernel.setupFeatureChecks(); assert.ok(true); delete global.document; diff --git a/test/internal/backend/web-gl/function-node/astBinaryExpression.js b/test/internal/backend/web-gl/function-node/astBinaryExpression.js index 10b909d7..94e58e2e 100644 --- a/test/internal/backend/web-gl/function-node/astBinaryExpression.js +++ b/test/internal/backend/web-gl/function-node/astBinaryExpression.js @@ -1,5 +1,5 @@ const { assert, test, module: describe, only } = require('qunit'); -const { WebGLFunctionNode } = require(process.cwd() + '/src'); +const { WebGLFunctionNode } = require('../../../../..'); describe('WebGLFunctionNode.astBinaryExpression()'); diff --git a/test/internal/backend/web-gl/function-node/astCallExpression.js b/test/internal/backend/web-gl/function-node/astCallExpression.js index 71350391..2bee99d1 100644 --- a/test/internal/backend/web-gl/function-node/astCallExpression.js +++ b/test/internal/backend/web-gl/function-node/astCallExpression.js @@ -1,5 +1,5 @@ const { assert, test, module: describe, only } = require('qunit'); -const { WebGLFunctionNode } = require(process.cwd() + '/src'); +const { WebGLFunctionNode } = require('../../../../..'); describe('WebGLFunctionNode.astCallExpression()'); diff --git a/test/internal/backend/web-gl/function-node/astForStatement.js b/test/internal/backend/web-gl/function-node/astForStatement.js index 4804bb1a..7b538f9c 100644 --- a/test/internal/backend/web-gl/function-node/astForStatement.js +++ b/test/internal/backend/web-gl/function-node/astForStatement.js @@ -1,5 +1,5 @@ const { assert, test, module: describe, only } = require('qunit'); -const { WebGLFunctionNode } = require(process.cwd() + '/src'); +const { WebGLFunctionNode } = require('../../../../..'); describe('WebGLFunctionNode.astForStatement()'); diff --git a/test/internal/backend/web-gl/function-node/astVariableDeclaration.js b/test/internal/backend/web-gl/function-node/astVariableDeclaration.js index 3fe255dd..1c5fb742 100644 --- a/test/internal/backend/web-gl/function-node/astVariableDeclaration.js +++ b/test/internal/backend/web-gl/function-node/astVariableDeclaration.js @@ -1,5 +1,5 @@ const { assert, test, module: describe, only } = require('qunit'); -const { WebGLFunctionNode } = require(process.cwd() + '/src'); +const { WebGLFunctionNode } = require('../../../../..'); describe('WebGLFunctionNode.getVariableSignature()'); diff --git a/test/internal/backend/web-gl/function-node/contexts.js b/test/internal/backend/web-gl/function-node/contexts.js index 8345b56f..699c0eb1 100644 --- a/test/internal/backend/web-gl/function-node/contexts.js +++ b/test/internal/backend/web-gl/function-node/contexts.js @@ -1,5 +1,5 @@ const { assert, test, module: describe, only } = require('qunit'); -const { WebGLFunctionNode } = require(process.cwd() + '/src'); +const { WebGLFunctionNode } = require('../../../../..'); describe('WebGLFunctionNode.contexts'); diff --git a/test/internal/backend/web-gl/function-node/firstAvailableTypeFromAst.js b/test/internal/backend/web-gl/function-node/firstAvailableTypeFromAst.js index 5c661375..991501a1 100644 --- a/test/internal/backend/web-gl/function-node/firstAvailableTypeFromAst.js +++ b/test/internal/backend/web-gl/function-node/firstAvailableTypeFromAst.js @@ -1,5 +1,5 @@ const { assert, test, module: describe, only } = require('qunit'); -const { WebGLFunctionNode } = require(process.cwd() + '/src'); +const { WebGLFunctionNode } = require('../../../../..'); describe('WebGLFunctionNode.getType()'); diff --git a/test/internal/backend/web-gl/function-node/getVariableSignature.js b/test/internal/backend/web-gl/function-node/getVariableSignature.js index 0366db77..486b0945 100644 --- a/test/internal/backend/web-gl/function-node/getVariableSignature.js +++ b/test/internal/backend/web-gl/function-node/getVariableSignature.js @@ -1,5 +1,5 @@ const { assert, test, module: describe, only } = require('qunit'); -const { WebGLFunctionNode } = require(process.cwd() + '/src'); +const { WebGLFunctionNode } = require('../../../../..'); describe('WebGLFunctionNode.getVariableSignature()'); diff --git a/test/internal/backend/web-gl/function-node/getVariableType.js b/test/internal/backend/web-gl/function-node/getVariableType.js index fe403be0..7373e728 100644 --- a/test/internal/backend/web-gl/function-node/getVariableType.js +++ b/test/internal/backend/web-gl/function-node/getVariableType.js @@ -1,5 +1,5 @@ const { assert, test, module: describe, only } = require('qunit'); -const { WebGLFunctionNode, GLKernel } = require(process.cwd() + '/src'); +const { WebGLFunctionNode, GLKernel } = require('../../../../..'); describe('WebGLFunctionNode.getVariableType()'); diff --git a/test/internal/backend/web-gl/kernel-value/dynamic-html-image.js b/test/internal/backend/web-gl/kernel-value/dynamic-html-image.js index 1d017f55..7c472a9c 100644 --- a/test/internal/backend/web-gl/kernel-value/dynamic-html-image.js +++ b/test/internal/backend/web-gl/kernel-value/dynamic-html-image.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { webGLKernelValueMaps } = require('../../../../../src'); +const { webGLKernelValueMaps } = require('../../../../..'); describe('internal: WebGLKernelValueDynamicHTMLImage'); diff --git a/test/internal/backend/web-gl/kernel-value/dynamic-memory-optimized-number-texture.js b/test/internal/backend/web-gl/kernel-value/dynamic-memory-optimized-number-texture.js index ab16008d..35f4d7da 100644 --- a/test/internal/backend/web-gl/kernel-value/dynamic-memory-optimized-number-texture.js +++ b/test/internal/backend/web-gl/kernel-value/dynamic-memory-optimized-number-texture.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { webGLKernelValueMaps } = require('../../../../../src'); +const { webGLKernelValueMaps } = require('../../../../..'); describe('internal: WebGLKernelValueDynamicMemoryOptimizedNumberTexture'); diff --git a/test/internal/backend/web-gl/kernel-value/dynamic-number-texture.js b/test/internal/backend/web-gl/kernel-value/dynamic-number-texture.js index f3bf8a62..3ac27fd4 100644 --- a/test/internal/backend/web-gl/kernel-value/dynamic-number-texture.js +++ b/test/internal/backend/web-gl/kernel-value/dynamic-number-texture.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { webGLKernelValueMaps } = require('../../../../../src'); +const { webGLKernelValueMaps } = require('../../../../..'); describe('internal: WebGLKernelValueDynamicNumberTexture'); diff --git a/test/internal/backend/web-gl/kernel-value/dynamic-single-array.js b/test/internal/backend/web-gl/kernel-value/dynamic-single-array.js index 0db64b10..17d99e58 100644 --- a/test/internal/backend/web-gl/kernel-value/dynamic-single-array.js +++ b/test/internal/backend/web-gl/kernel-value/dynamic-single-array.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { webGLKernelValueMaps } = require('../../../../../src'); +const { webGLKernelValueMaps } = require('../../../../..'); describe('internal: WebGLKernelValueDynamicSingleArray'); diff --git a/test/internal/backend/web-gl/kernel-value/dynamic-single-array1d-i.js b/test/internal/backend/web-gl/kernel-value/dynamic-single-array1d-i.js index c5652f3e..08951fcb 100644 --- a/test/internal/backend/web-gl/kernel-value/dynamic-single-array1d-i.js +++ b/test/internal/backend/web-gl/kernel-value/dynamic-single-array1d-i.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { webGLKernelValueMaps } = require('../../../../../src'); +const { webGLKernelValueMaps } = require('../../../../..'); describe('internal: WebGLKernelValueDynamicSingleArray1DI'); diff --git a/test/internal/backend/web-gl/kernel-value/dynamic-single-array2d-i.js b/test/internal/backend/web-gl/kernel-value/dynamic-single-array2d-i.js index 2d7fe4b6..e2e379f8 100644 --- a/test/internal/backend/web-gl/kernel-value/dynamic-single-array2d-i.js +++ b/test/internal/backend/web-gl/kernel-value/dynamic-single-array2d-i.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { webGLKernelValueMaps } = require('../../../../../src'); +const { webGLKernelValueMaps } = require('../../../../..'); describe('internal: WebGLKernelValueDynamicSingleArray2DI'); diff --git a/test/internal/backend/web-gl/kernel-value/dynamic-single-array3d-i.js b/test/internal/backend/web-gl/kernel-value/dynamic-single-array3d-i.js index 06b34bb9..b96923f9 100644 --- a/test/internal/backend/web-gl/kernel-value/dynamic-single-array3d-i.js +++ b/test/internal/backend/web-gl/kernel-value/dynamic-single-array3d-i.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { webGLKernelValueMaps } = require('../../../../../src'); +const { webGLKernelValueMaps } = require('../../../../..'); describe('internal: WebGLKernelValueDynamicSingleArray3DI'); diff --git a/test/internal/backend/web-gl/kernel-value/dynamic-single-input.js b/test/internal/backend/web-gl/kernel-value/dynamic-single-input.js index a8a6a9ab..9fee9d63 100644 --- a/test/internal/backend/web-gl/kernel-value/dynamic-single-input.js +++ b/test/internal/backend/web-gl/kernel-value/dynamic-single-input.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { webGLKernelValueMaps } = require('../../../../../src'); +const { webGLKernelValueMaps } = require('../../../../..'); describe('internal: WebGLKernelValueDynamicSingleInput'); diff --git a/test/internal/backend/web-gl/kernel-value/dynamic-unsigned-array.js b/test/internal/backend/web-gl/kernel-value/dynamic-unsigned-array.js index d73432e3..e28786ad 100644 --- a/test/internal/backend/web-gl/kernel-value/dynamic-unsigned-array.js +++ b/test/internal/backend/web-gl/kernel-value/dynamic-unsigned-array.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { webGLKernelValueMaps } = require('../../../../../src'); +const { webGLKernelValueMaps } = require('../../../../..'); describe('internal: WebGLKernelValueDynamicUnsignedArray'); diff --git a/test/internal/backend/web-gl/kernel-value/dynamic-unsigned-input.js b/test/internal/backend/web-gl/kernel-value/dynamic-unsigned-input.js index 30326669..a5ac6c59 100644 --- a/test/internal/backend/web-gl/kernel-value/dynamic-unsigned-input.js +++ b/test/internal/backend/web-gl/kernel-value/dynamic-unsigned-input.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { webGLKernelValueMaps } = require('../../../../../src'); +const { webGLKernelValueMaps } = require('../../../../..'); describe('internal: WebGLKernelValueUnsignedSingleInput'); diff --git a/test/internal/backend/web-gl/kernel-value/html-image.js b/test/internal/backend/web-gl/kernel-value/html-image.js index 28a85e30..6326ba43 100644 --- a/test/internal/backend/web-gl/kernel-value/html-image.js +++ b/test/internal/backend/web-gl/kernel-value/html-image.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { webGLKernelValueMaps } = require('../../../../../src'); +const { webGLKernelValueMaps } = require('../../../../..'); describe('internal: WebGLKernelValueHTMLImage'); diff --git a/test/internal/backend/web-gl/kernel-value/memory-optimized-number-texture.js b/test/internal/backend/web-gl/kernel-value/memory-optimized-number-texture.js index 4513db04..093ac310 100644 --- a/test/internal/backend/web-gl/kernel-value/memory-optimized-number-texture.js +++ b/test/internal/backend/web-gl/kernel-value/memory-optimized-number-texture.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { webGLKernelValueMaps } = require('../../../../../src'); +const { webGLKernelValueMaps } = require('../../../../..'); describe('internal: WebGLKernelValueMemoryOptimizedNumberTexture'); diff --git a/test/internal/backend/web-gl/kernel-value/number-texture.js b/test/internal/backend/web-gl/kernel-value/number-texture.js index 793ec518..9efafdb5 100644 --- a/test/internal/backend/web-gl/kernel-value/number-texture.js +++ b/test/internal/backend/web-gl/kernel-value/number-texture.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { webGLKernelValueMaps } = require('../../../../../src'); +const { webGLKernelValueMaps } = require('../../../../..'); describe('internal: WebGLKernelValueNumberTexture'); diff --git a/test/internal/backend/web-gl/kernel-value/single-array.js b/test/internal/backend/web-gl/kernel-value/single-array.js index 73b69daf..02b5ecf1 100644 --- a/test/internal/backend/web-gl/kernel-value/single-array.js +++ b/test/internal/backend/web-gl/kernel-value/single-array.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { webGLKernelValueMaps } = require('../../../../../src'); +const { webGLKernelValueMaps } = require('../../../../..'); describe('internal: WebGLKernelValueSingleArray'); diff --git a/test/internal/backend/web-gl/kernel-value/single-array1d-i.js b/test/internal/backend/web-gl/kernel-value/single-array1d-i.js index 7636a6db..29908ba7 100644 --- a/test/internal/backend/web-gl/kernel-value/single-array1d-i.js +++ b/test/internal/backend/web-gl/kernel-value/single-array1d-i.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { webGLKernelValueMaps } = require('../../../../../src'); +const { webGLKernelValueMaps } = require('../../../../..'); describe('internal: WebGLKernelValueSingleArray1DI'); diff --git a/test/internal/backend/web-gl/kernel-value/single-array2d-i.js b/test/internal/backend/web-gl/kernel-value/single-array2d-i.js index 1098700a..48533d24 100644 --- a/test/internal/backend/web-gl/kernel-value/single-array2d-i.js +++ b/test/internal/backend/web-gl/kernel-value/single-array2d-i.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { webGLKernelValueMaps } = require('../../../../../src'); +const { webGLKernelValueMaps } = require('../../../../..'); describe('internal: WebGLKernelValueSingleArray2DI'); diff --git a/test/internal/backend/web-gl/kernel-value/single-array3d-i.js b/test/internal/backend/web-gl/kernel-value/single-array3d-i.js index 4faf9160..afaa236c 100644 --- a/test/internal/backend/web-gl/kernel-value/single-array3d-i.js +++ b/test/internal/backend/web-gl/kernel-value/single-array3d-i.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { webGLKernelValueMaps } = require('../../../../../src'); +const { webGLKernelValueMaps } = require('../../../../..'); describe('internal: WebGLKernelValueSingleArray3DI'); diff --git a/test/internal/backend/web-gl/kernel-value/single-input.js b/test/internal/backend/web-gl/kernel-value/single-input.js index 3c655f76..6a830761 100644 --- a/test/internal/backend/web-gl/kernel-value/single-input.js +++ b/test/internal/backend/web-gl/kernel-value/single-input.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { webGLKernelValueMaps } = require('../../../../../src'); +const { webGLKernelValueMaps } = require('../../../../..'); describe('internal: WebGLKernelValueSingleInput'); diff --git a/test/internal/backend/web-gl/kernel-value/unsigned-array.js b/test/internal/backend/web-gl/kernel-value/unsigned-array.js index 327cde52..5b544859 100644 --- a/test/internal/backend/web-gl/kernel-value/unsigned-array.js +++ b/test/internal/backend/web-gl/kernel-value/unsigned-array.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { webGLKernelValueMaps } = require('../../../../../src'); +const { webGLKernelValueMaps } = require('../../../../..'); describe('internal: WebGLKernelValueUnsignedArray'); diff --git a/test/internal/backend/web-gl/kernel-value/unsigned-input.js b/test/internal/backend/web-gl/kernel-value/unsigned-input.js index 88414e1f..8936681a 100644 --- a/test/internal/backend/web-gl/kernel-value/unsigned-input.js +++ b/test/internal/backend/web-gl/kernel-value/unsigned-input.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { webGLKernelValueMaps } = require('../../../../../src'); +const { webGLKernelValueMaps } = require('../../../../..'); describe('internal: WebGLKernelValueUnsignedInput'); diff --git a/test/internal/backend/web-gl/kernel/index.js b/test/internal/backend/web-gl/kernel/index.js index 85613cfd..7382a455 100644 --- a/test/internal/backend/web-gl/kernel/index.js +++ b/test/internal/backend/web-gl/kernel/index.js @@ -1,6 +1,6 @@ const sinon = require('sinon'); const { assert, skip, test, module: describe, only } = require('qunit'); -const { WebGLKernel } = require('../../../../../src'); +const { WebGLKernel } = require('../../../../..'); describe('internal: WebGLKernel'); diff --git a/test/internal/backend/web-gl/kernel/setupArguments.js b/test/internal/backend/web-gl/kernel/setupArguments.js index 7f280872..1fe7c1f3 100644 --- a/test/internal/backend/web-gl/kernel/setupArguments.js +++ b/test/internal/backend/web-gl/kernel/setupArguments.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { WebGLKernel, input } = require('../../../../../src'); +const { WebGLKernel, input } = require('../../../../..'); describe('internal WebGLKernel.setupArguments Array'); const gl = { diff --git a/test/internal/backend/web-gl/kernel/setupConstants.js b/test/internal/backend/web-gl/kernel/setupConstants.js index 8aea5f61..bd2c0b72 100644 --- a/test/internal/backend/web-gl/kernel/setupConstants.js +++ b/test/internal/backend/web-gl/kernel/setupConstants.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { WebGLKernel, input } = require('../../../../../src'); +const { WebGLKernel, input } = require('../../../../..'); describe('internal WebGLKernel.setupConstants Array'); const gl = { diff --git a/test/internal/backend/web-gl2/kernel-value/dynamic-html-image-array.js b/test/internal/backend/web-gl2/kernel-value/dynamic-html-image-array.js index 1c72a4eb..267233b3 100644 --- a/test/internal/backend/web-gl2/kernel-value/dynamic-html-image-array.js +++ b/test/internal/backend/web-gl2/kernel-value/dynamic-html-image-array.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { webGL2KernelValueMaps } = require('../../../../../src'); +const { webGL2KernelValueMaps } = require('../../../../..'); describe('internal: WebGL2KernelValueDynamicHTMLImage'); diff --git a/test/internal/backend/web-gl2/kernel-value/dynamic-single-array.js b/test/internal/backend/web-gl2/kernel-value/dynamic-single-array.js index 8318eb8c..13962d67 100644 --- a/test/internal/backend/web-gl2/kernel-value/dynamic-single-array.js +++ b/test/internal/backend/web-gl2/kernel-value/dynamic-single-array.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { webGL2KernelValueMaps } = require('../../../../../src'); +const { webGL2KernelValueMaps } = require('../../../../..'); describe('internal: WebGL2KernelValueDynamicSingleArray'); diff --git a/test/internal/backend/web-gl2/kernel-value/dynamic-single-input.js b/test/internal/backend/web-gl2/kernel-value/dynamic-single-input.js index eb4f0cd0..b69850d5 100644 --- a/test/internal/backend/web-gl2/kernel-value/dynamic-single-input.js +++ b/test/internal/backend/web-gl2/kernel-value/dynamic-single-input.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { webGL2KernelValueMaps } = require('../../../../../src'); +const { webGL2KernelValueMaps } = require('../../../../..'); describe('internal: WebGLKernelValueDynamicSingleInput'); diff --git a/test/internal/backend/web-gl2/kernel-value/html-image-array.js b/test/internal/backend/web-gl2/kernel-value/html-image-array.js index a92d2dd1..d5ca4e23 100644 --- a/test/internal/backend/web-gl2/kernel-value/html-image-array.js +++ b/test/internal/backend/web-gl2/kernel-value/html-image-array.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { webGL2KernelValueMaps } = require('../../../../../src'); +const { webGL2KernelValueMaps } = require('../../../../..'); describe('internal: WebGL2KernelValueHTMLImageArray'); diff --git a/test/internal/backend/web-gl2/kernel-value/single-input.js b/test/internal/backend/web-gl2/kernel-value/single-input.js index b53d6260..16823c12 100644 --- a/test/internal/backend/web-gl2/kernel-value/single-input.js +++ b/test/internal/backend/web-gl2/kernel-value/single-input.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { webGL2KernelValueMaps } = require('../../../../../src'); +const { webGL2KernelValueMaps } = require('../../../../..'); describe('internal: WebGL2KernelValueSingleInput'); diff --git a/test/internal/backend/web-gl2/kernel/index.js b/test/internal/backend/web-gl2/kernel/index.js index 88f7f172..7cba8a7c 100644 --- a/test/internal/backend/web-gl2/kernel/index.js +++ b/test/internal/backend/web-gl2/kernel/index.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { WebGL2Kernel } = require('../../../../../src'); +const { WebGL2Kernel } = require('../../../../..'); describe('internal: WebGL2Kernel'); diff --git a/test/internal/backend/web-gl2/kernel/setupArguments.js b/test/internal/backend/web-gl2/kernel/setupArguments.js index 231bf04d..dc8404a2 100644 --- a/test/internal/backend/web-gl2/kernel/setupArguments.js +++ b/test/internal/backend/web-gl2/kernel/setupArguments.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { WebGL2Kernel, input } = require('../../../../../src'); +const { WebGL2Kernel, input } = require('../../../../..'); describe('internal WebGL2Kernel.setupArguments Array'); const gl = { diff --git a/test/internal/backend/web-gl2/kernel/setupConstants.js b/test/internal/backend/web-gl2/kernel/setupConstants.js index 00ece59e..3a889b73 100644 --- a/test/internal/backend/web-gl2/kernel/setupConstants.js +++ b/test/internal/backend/web-gl2/kernel/setupConstants.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { WebGL2Kernel, input } = require('../../../../../src'); +const { WebGL2Kernel, input } = require('../../../../..'); describe('internal WebGL2Kernel.setupConstants Array'); const gl = { diff --git a/test/internal/boolean.js b/test/internal/boolean.js index bc876dda..6563b0dc 100644 --- a/test/internal/boolean.js +++ b/test/internal/boolean.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('internal: boolean'); diff --git a/test/internal/casting.js b/test/internal/casting.js index 2b7b6b56..b6b7177e 100644 --- a/test/internal/casting.js +++ b/test/internal/casting.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('internal: casting'); diff --git a/test/internal/constants-texture-switching.js b/test/internal/constants-texture-switching.js index aec55b1c..594ab437 100644 --- a/test/internal/constants-texture-switching.js +++ b/test/internal/constants-texture-switching.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('internal: constants texture switching'); diff --git a/test/internal/constructor-features.js b/test/internal/constructor-features.js index de3a1865..261e714c 100644 --- a/test/internal/constructor-features.js +++ b/test/internal/constructor-features.js @@ -1,5 +1,5 @@ const { assert, test, module: describe, only, skip } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('internal: constructor features'); diff --git a/test/internal/context-inheritance.js b/test/internal/context-inheritance.js index d3af92b4..8ba08831 100644 --- a/test/internal/context-inheritance.js +++ b/test/internal/context-inheritance.js @@ -1,10 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { - GPU, - WebGLKernel, - WebGL2Kernel, - HeadlessGLKernel, -} = require('../../src'); +const { GPU, WebGLKernel, WebGL2Kernel, HeadlessGLKernel } = require('../..'); describe('internal: context inheritance'); diff --git a/test/internal/deep-types.js b/test/internal/deep-types.js index 746fd94c..606c9a0e 100644 --- a/test/internal/deep-types.js +++ b/test/internal/deep-types.js @@ -1,6 +1,6 @@ const sinon = require('sinon'); const { assert, test, module: describe, only, skip } = require('qunit'); -const { GPU, FunctionBuilder } = require('../../src'); +const { GPU, FunctionBuilder } = require('../..'); describe('internal: deep types'); diff --git a/test/internal/deprecated.js b/test/internal/deprecated.js index 8d950258..db0e193f 100644 --- a/test/internal/deprecated.js +++ b/test/internal/deprecated.js @@ -1,5 +1,5 @@ const { assert, test, module: describe, only, skip } = require('qunit'); -const { GPU, Kernel } = require('../../src'); +const { GPU, Kernel } = require('../..'); describe('internal: deprecated'); diff --git a/test/internal/different-texture-cloning.js b/test/internal/different-texture-cloning.js index e908293a..18acb7c6 100644 --- a/test/internal/different-texture-cloning.js +++ b/test/internal/different-texture-cloning.js @@ -1,5 +1,5 @@ const { assert, test, module: describe, only, skip } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('internal: different texture cloning'); diff --git a/test/internal/function-builder.js b/test/internal/function-builder.js index ab06a79a..cb97d3e6 100644 --- a/test/internal/function-builder.js +++ b/test/internal/function-builder.js @@ -4,7 +4,7 @@ const { CPUFunctionNode, WebGL2FunctionNode, WebGLFunctionNode, -} = require('../../src'); +} = require('../..'); describe('internal: function builder'); diff --git a/test/internal/function-composition.js b/test/internal/function-composition.js index c21f15a7..f658f365 100644 --- a/test/internal/function-composition.js +++ b/test/internal/function-composition.js @@ -6,7 +6,7 @@ const { GPU, WebGL2FunctionNode, WebGLFunctionNode, -} = require('../../src'); +} = require('../..'); describe('internal: function composition return values'); diff --git a/test/internal/function-node.js b/test/internal/function-node.js index d5428f96..8280dc58 100644 --- a/test/internal/function-node.js +++ b/test/internal/function-node.js @@ -3,7 +3,7 @@ const { CPUFunctionNode, WebGLFunctionNode, WebGL2FunctionNode, -} = require('../../src'); +} = require('../..'); describe('internal: function node'); diff --git a/test/internal/function-return-type-detection.js b/test/internal/function-return-type-detection.js index c3493966..292dbc14 100644 --- a/test/internal/function-return-type-detection.js +++ b/test/internal/function-return-type-detection.js @@ -1,5 +1,5 @@ const { assert, test, skip, module: describe, only } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('internal: Function return type detection'); diff --git a/test/internal/function-tracer.js b/test/internal/function-tracer.js index 0f00f3e8..2f00eed6 100644 --- a/test/internal/function-tracer.js +++ b/test/internal/function-tracer.js @@ -1,7 +1,7 @@ const { assert, test, skip, module: describe, only } = require('qunit'); const sinon = require('sinon'); const acorn = require('acorn'); -const { FunctionTracer } = require('../../src'); +const { FunctionTracer } = require('../..'); describe('internal: FunctionTracer'); diff --git a/test/internal/gpu-methods.js b/test/internal/gpu-methods.js index baad0d65..50c6e811 100644 --- a/test/internal/gpu-methods.js +++ b/test/internal/gpu-methods.js @@ -1,5 +1,5 @@ const { assert, test, skip, module: describe, only } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('internal: GPU methods'); diff --git a/test/internal/implied-else.js b/test/internal/implied-else.js index c725dcfc..8db318c5 100644 --- a/test/internal/implied-else.js +++ b/test/internal/implied-else.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('internal: Implied else'); diff --git a/test/internal/kernel-run-shortcut.js b/test/internal/kernel-run-shortcut.js index 1f527025..c9ec675e 100644 --- a/test/internal/kernel-run-shortcut.js +++ b/test/internal/kernel-run-shortcut.js @@ -1,6 +1,6 @@ const { assert, test, module: describe, skip } = require('qunit'); const sinon = require('sinon'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('internal: kernelRunShortcut'); diff --git a/test/internal/kernel.js b/test/internal/kernel.js index c5039b8a..5097c455 100644 --- a/test/internal/kernel.js +++ b/test/internal/kernel.js @@ -6,7 +6,7 @@ const { WebGL2Kernel, HeadlessGLKernel, Kernel, -} = require('../../src'); +} = require('../..'); describe('internal: kernel'); diff --git a/test/internal/loop-int.js b/test/internal/loop-int.js index b7911671..d62512cd 100644 --- a/test/internal/loop-int.js +++ b/test/internal/loop-int.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU, WebGLFunctionNode, WebGL2FunctionNode } = require('../../src'); +const { GPU, WebGLFunctionNode, WebGL2FunctionNode } = require('../..'); describe('internal: loop int'); test('loop int constant output webgl', () => { diff --git a/test/internal/loop-max.js b/test/internal/loop-max.js index df94a4fd..bf3058b0 100644 --- a/test/internal/loop-max.js +++ b/test/internal/loop-max.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU, WebGLFunctionNode, WebGL2FunctionNode } = require('../../src'); +const { GPU, WebGLFunctionNode, WebGL2FunctionNode } = require('../..'); describe('internal: loop max'); diff --git a/test/internal/math.random.js b/test/internal/math.random.js index afa9d41d..f7ae4caf 100644 --- a/test/internal/math.random.js +++ b/test/internal/math.random.js @@ -3,7 +3,7 @@ const sinon = require('sinon'); const { GPU, plugins: { mathRandom }, -} = require('../../src'); +} = require('../..'); describe('Math.random() unique'); diff --git a/test/internal/matrix-multiply-precision.js b/test/internal/matrix-multiply-precision.js index 1eef5f6a..7fb4a344 100644 --- a/test/internal/matrix-multiply-precision.js +++ b/test/internal/matrix-multiply-precision.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('internal: matrix multiply precision'); diff --git a/test/internal/mixed-memory-optimize.js b/test/internal/mixed-memory-optimize.js index 5e0050e8..a39d9e03 100644 --- a/test/internal/mixed-memory-optimize.js +++ b/test/internal/mixed-memory-optimize.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('internal: mixed memory optimize'); diff --git a/test/internal/modes.js b/test/internal/modes.js index db54be2e..fb10e43e 100644 --- a/test/internal/modes.js +++ b/test/internal/modes.js @@ -5,7 +5,7 @@ const { WebGL2Kernel, HeadlessGLKernel, CPUKernel, -} = require('../../src'); +} = require('../..'); describe('internal: modes'); diff --git a/test/internal/overloading.js b/test/internal/overloading.js index 042ffb88..0c25e528 100644 --- a/test/internal/overloading.js +++ b/test/internal/overloading.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('internal: overloading'); // TODO: planned for after v2, overload generated functions so as to cut down on casting diff --git a/test/internal/precision.js b/test/internal/precision.js index cfd7d7aa..e7b5e16e 100644 --- a/test/internal/precision.js +++ b/test/internal/precision.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('internal: precision'); diff --git a/test/internal/recycling.js b/test/internal/recycling.js index 8a6ecf4b..9044c9b4 100644 --- a/test/internal/recycling.js +++ b/test/internal/recycling.js @@ -1,6 +1,6 @@ const sinon = require('sinon'); const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('internal: recycling'); diff --git a/test/internal/texture-index.js b/test/internal/texture-index.js index 99076712..98b5ff35 100644 --- a/test/internal/texture-index.js +++ b/test/internal/texture-index.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('internal: texture index'); diff --git a/test/internal/underscores.js b/test/internal/underscores.js index 3654dd32..1c139d7d 100644 --- a/test/internal/underscores.js +++ b/test/internal/underscores.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('internal: underscores'); diff --git a/test/internal/utils.js b/test/internal/utils.js index 5e988a7b..7117e825 100644 --- a/test/internal/utils.js +++ b/test/internal/utils.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { utils } = require('../../src'); +const { utils } = require('../..'); describe('internal: utils'); diff --git a/test/issues/114-create-kernel-map-run-second-time.js b/test/issues/114-create-kernel-map-run-second-time.js index 05489115..25d25bf7 100644 --- a/test/issues/114-create-kernel-map-run-second-time.js +++ b/test/issues/114-create-kernel-map-run-second-time.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('issue # 114'); diff --git a/test/issues/116-multiple-kernels-run-again.js b/test/issues/116-multiple-kernels-run-again.js index d2dc2151..3c161ec2 100644 --- a/test/issues/116-multiple-kernels-run-again.js +++ b/test/issues/116-multiple-kernels-run-again.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('issue #116'); diff --git a/test/issues/130-typed-array.js b/test/issues/130-typed-array.js index dc59d899..aa71901e 100644 --- a/test/issues/130-typed-array.js +++ b/test/issues/130-typed-array.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('issue #130'); diff --git a/test/issues/147-missing-constant.js b/test/issues/147-missing-constant.js index 0cc00b8d..2a32a5aa 100644 --- a/test/issues/147-missing-constant.js +++ b/test/issues/147-missing-constant.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('issue #147'); diff --git a/test/issues/152-for-vars.js b/test/issues/152-for-vars.js index d12a3649..c00e0f31 100644 --- a/test/issues/152-for-vars.js +++ b/test/issues/152-for-vars.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('issue #152'); diff --git a/test/issues/159-3d.js b/test/issues/159-3d.js index d24b0360..733a6f50 100644 --- a/test/issues/159-3d.js +++ b/test/issues/159-3d.js @@ -3,7 +3,7 @@ const { assert, skip, test, module: describe } = require('qunit'); describe('issue # 159'); (function () { - const { GPU } = require('../../src'); + const { GPU } = require('../..'); function threeD(mode) { const gpu = new GPU({ mode }); diff --git a/test/issues/174-webgl-context-warning.js b/test/issues/174-webgl-context-warning.js index 9abff4e6..ff487705 100644 --- a/test/issues/174-webgl-context-warning.js +++ b/test/issues/174-webgl-context-warning.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('issue # 174'); diff --git a/test/issues/195-read-from-texture2d.js b/test/issues/195-read-from-texture2d.js index 62f7207c..4ca54e81 100644 --- a/test/issues/195-read-from-texture2d.js +++ b/test/issues/195-read-from-texture2d.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('issue #195'); diff --git a/test/issues/207-same-function-reuse.js b/test/issues/207-same-function-reuse.js index a9e50f77..10ca314e 100644 --- a/test/issues/207-same-function-reuse.js +++ b/test/issues/207-same-function-reuse.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('issue #207'); diff --git a/test/issues/212-funky-function-support.js b/test/issues/212-funky-function-support.js index 67052cae..bdff8dfe 100644 --- a/test/issues/212-funky-function-support.js +++ b/test/issues/212-funky-function-support.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('issue #212'); diff --git a/test/issues/233-kernel-map-single-precision.js b/test/issues/233-kernel-map-single-precision.js index d947884e..ab80ab9a 100644 --- a/test/issues/233-kernel-map-single-precision.js +++ b/test/issues/233-kernel-map-single-precision.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('issue # 233'); diff --git a/test/issues/241-CPU-vs-GPU-maps-output-differently.js b/test/issues/241-CPU-vs-GPU-maps-output-differently.js index 19067a92..aa45d8bc 100644 --- a/test/issues/241-CPU-vs-GPU-maps-output-differently.js +++ b/test/issues/241-CPU-vs-GPU-maps-output-differently.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('issue #241'); diff --git a/test/issues/259-atan2.js b/test/issues/259-atan2.js index 6d113467..fee39146 100644 --- a/test/issues/259-atan2.js +++ b/test/issues/259-atan2.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('issue #259'); diff --git a/test/issues/263-to-string.js b/test/issues/263-to-string.js index 3560be38..197f3e92 100644 --- a/test/issues/263-to-string.js +++ b/test/issues/263-to-string.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('issue #263'); diff --git a/test/issues/267-immutable-sub-kernels.js b/test/issues/267-immutable-sub-kernels.js index 30a8b137..150cdff5 100644 --- a/test/issues/267-immutable-sub-kernels.js +++ b/test/issues/267-immutable-sub-kernels.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('issue #267 kernel'); diff --git a/test/issues/270-cache.js b/test/issues/270-cache.js index 611db3af..6e835821 100644 --- a/test/issues/270-cache.js +++ b/test/issues/270-cache.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe } = require('qunit'); -const { WebGLKernel } = require('../../src'); +const { WebGLKernel } = require('../..'); describe('issue # 270'); diff --git a/test/issues/279-wrong-canvas-size.js b/test/issues/279-wrong-canvas-size.js index 08545bcd..8c9d7c75 100644 --- a/test/issues/279-wrong-canvas-size.js +++ b/test/issues/279-wrong-canvas-size.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('issue #279'); diff --git a/test/issues/300-nested-array-index.js b/test/issues/300-nested-array-index.js index 379049c9..1f6612df 100644 --- a/test/issues/300-nested-array-index.js +++ b/test/issues/300-nested-array-index.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('issue #300'); diff --git a/test/issues/31-nested-var-declare-test.js b/test/issues/31-nested-var-declare-test.js index 9fed2a2d..88365cea 100644 --- a/test/issues/31-nested-var-declare-test.js +++ b/test/issues/31-nested-var-declare-test.js @@ -5,7 +5,7 @@ const { WebGLFunctionNode, WebGL2FunctionNode, CPUFunctionNode, -} = require('../../src'); +} = require('../..'); describe('issue #31 redeclare'); diff --git a/test/issues/313-variable-lookup.js b/test/issues/313-variable-lookup.js index feeb164c..3e103686 100644 --- a/test/issues/313-variable-lookup.js +++ b/test/issues/313-variable-lookup.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('issue #313'); diff --git a/test/issues/314-large-input-array-addressing.js b/test/issues/314-large-input-array-addressing.js index 7d58e2a6..5e828351 100644 --- a/test/issues/314-large-input-array-addressing.js +++ b/test/issues/314-large-input-array-addressing.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe } = require('qunit'); -const { GPU, WebGLKernel, HeadlessGLKernel } = require('../../src'); +const { GPU, WebGLKernel, HeadlessGLKernel } = require('../..'); describe('issue #314'); diff --git a/test/issues/335-missing-z-index-issue.js b/test/issues/335-missing-z-index-issue.js index e2dacc35..10245040 100644 --- a/test/issues/335-missing-z-index-issue.js +++ b/test/issues/335-missing-z-index-issue.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('issue #335'); diff --git a/test/issues/346-uint8array-converted.js b/test/issues/346-uint8array-converted.js index 4e29c297..655cfcdb 100644 --- a/test/issues/346-uint8array-converted.js +++ b/test/issues/346-uint8array-converted.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('issue #346'); diff --git a/test/issues/349-division-by-factors-of-3.js b/test/issues/349-division-by-factors-of-3.js index c36ac7c8..12d50aec 100644 --- a/test/issues/349-division-by-factors-of-3.js +++ b/test/issues/349-division-by-factors-of-3.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('issue #349 divide by 3'); diff --git a/test/issues/357-modulus-issue.js b/test/issues/357-modulus-issue.js index 7dab4df8..31c8c497 100644 --- a/test/issues/357-modulus-issue.js +++ b/test/issues/357-modulus-issue.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('issue #357'); diff --git a/test/issues/359-addfunction-params-wrong.js b/test/issues/359-addfunction-params-wrong.js index 9f54f6ca..13f808ec 100644 --- a/test/issues/359-addfunction-params-wrong.js +++ b/test/issues/359-addfunction-params-wrong.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('issue #359'); diff --git a/test/issues/378-only-first-iteration.js b/test/issues/378-only-first-iteration.js index 58e3b672..4b58057f 100644 --- a/test/issues/378-only-first-iteration.js +++ b/test/issues/378-only-first-iteration.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('issue #378'); diff --git a/test/issues/382-bad-constant.js b/test/issues/382-bad-constant.js index 7811dee3..be20d1dc 100644 --- a/test/issues/382-bad-constant.js +++ b/test/issues/382-bad-constant.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('issue #382'); diff --git a/test/issues/390-thread-assignment.js b/test/issues/390-thread-assignment.js index 7864ea5f..fdfddaf5 100644 --- a/test/issues/390-thread-assignment.js +++ b/test/issues/390-thread-assignment.js @@ -3,7 +3,7 @@ const { WebGLFunctionNode, WebGL2FunctionNode, CPUFunctionNode, -} = require('../../src'); +} = require('../..'); describe('issue #390'); diff --git a/test/issues/396-combine-kernels-example.js b/test/issues/396-combine-kernels-example.js index 1eb69c33..b41d1dc2 100644 --- a/test/issues/396-combine-kernels-example.js +++ b/test/issues/396-combine-kernels-example.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('issue #396 - combine kernels example'); diff --git a/test/issues/399-double-definition.js b/test/issues/399-double-definition.js index db85e4a0..892f68cb 100644 --- a/test/issues/399-double-definition.js +++ b/test/issues/399-double-definition.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('issue #399'); diff --git a/test/issues/401-cpu-canvas-check.js b/test/issues/401-cpu-canvas-check.js index ea583066..ab25c86e 100644 --- a/test/issues/401-cpu-canvas-check.js +++ b/test/issues/401-cpu-canvas-check.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe } = require('qunit'); -const { GPU, CPUKernel } = require('../../src'); +const { GPU, CPUKernel } = require('../..'); describe('issue #401'); diff --git a/test/issues/410-if-statement.js b/test/issues/410-if-statement.js index bc42c127..ac9101bd 100644 --- a/test/issues/410-if-statement.js +++ b/test/issues/410-if-statement.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('issue #410 - if statement when unsigned on NVidia'); diff --git a/test/issues/422-warnings.js b/test/issues/422-warnings.js index 9ac22756..f72c4232 100644 --- a/test/issues/422-warnings.js +++ b/test/issues/422-warnings.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('issue #422 - warnings'); diff --git a/test/issues/470-modulus-wrong.js b/test/issues/470-modulus-wrong.js index ff7010f1..07619ae5 100644 --- a/test/issues/470-modulus-wrong.js +++ b/test/issues/470-modulus-wrong.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('issue #470 - modulus wrong'); diff --git a/test/issues/471-canvas-issue.js b/test/issues/471-canvas-issue.js index f1646300..f2110164 100644 --- a/test/issues/471-canvas-issue.js +++ b/test/issues/471-canvas-issue.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('issue #471 - canvas issue'); diff --git a/test/issues/472-compilation-issue.js b/test/issues/472-compilation-issue.js index 34bfcbc7..a987ceb7 100644 --- a/test/issues/472-compilation-issue.js +++ b/test/issues/472-compilation-issue.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('issue #472 - compilation issue'); diff --git a/test/issues/473-4-pixels.js b/test/issues/473-4-pixels.js index 732e3670..5d55f349 100644 --- a/test/issues/473-4-pixels.js +++ b/test/issues/473-4-pixels.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('issue #473 - only 4 pixels are shown'); diff --git a/test/issues/487-dynamic-arguments.js b/test/issues/487-dynamic-arguments.js index c6e48a88..dbd2cf8c 100644 --- a/test/issues/487-dynamic-arguments.js +++ b/test/issues/487-dynamic-arguments.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('issue #487 - pipeline dynamic arguments'); diff --git a/test/issues/493-strange-literal.js b/test/issues/493-strange-literal.js index 5f29b914..3bcaeeaf 100644 --- a/test/issues/493-strange-literal.js +++ b/test/issues/493-strange-literal.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('issue #493 - strange literal'); diff --git a/test/issues/500-sticky-arrays.js b/test/issues/500-sticky-arrays.js index d1bed238..b8ea0b2c 100644 --- a/test/issues/500-sticky-arrays.js +++ b/test/issues/500-sticky-arrays.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('issue #500 - strange literal'); diff --git a/test/issues/519-sanitize-names.js b/test/issues/519-sanitize-names.js index 6d18ec63..a791cdbc 100644 --- a/test/issues/519-sanitize-names.js +++ b/test/issues/519-sanitize-names.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('issue #519 - sanitize names'); diff --git a/test/issues/553-permanent-flip.js b/test/issues/553-permanent-flip.js index a5900015..3d3cde52 100644 --- a/test/issues/553-permanent-flip.js +++ b/test/issues/553-permanent-flip.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('issue #553 - permanent flip'); diff --git a/test/issues/556-minify-for-loop.js b/test/issues/556-minify-for-loop.js index d364a1c5..8d736887 100644 --- a/test/issues/556-minify-for-loop.js +++ b/test/issues/556-minify-for-loop.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU, WebGLFunctionNode } = require('../../src'); +const { GPU, WebGLFunctionNode } = require('../..'); describe('issue #556 - minify for loop'); diff --git a/test/issues/560-minification-madness.js b/test/issues/560-minification-madness.js index bea28347..e0f2b406 100644 --- a/test/issues/560-minification-madness.js +++ b/test/issues/560-minification-madness.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('issue #560 - minification madness'); diff --git a/test/issues/564-boolean.js b/test/issues/564-boolean.js index 2ab4df83..cf319af0 100644 --- a/test/issues/564-boolean.js +++ b/test/issues/564-boolean.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('issue #564 - boolean handled'); diff --git a/test/issues/567-wrong-modulus.js b/test/issues/567-wrong-modulus.js index ea0a2ba1..dc0c155b 100644 --- a/test/issues/567-wrong-modulus.js +++ b/test/issues/567-wrong-modulus.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('issue #567 - wrong modulus'); diff --git a/test/issues/585-inaccurate-lookups.js b/test/issues/585-inaccurate-lookups.js index e60df573..4e635c07 100644 --- a/test/issues/585-inaccurate-lookups.js +++ b/test/issues/585-inaccurate-lookups.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('issue #585 - inaccurate lookups'); diff --git a/test/issues/586-unable-to-resize.js b/test/issues/586-unable-to-resize.js index cfdd1baf..359456a1 100644 --- a/test/issues/586-unable-to-resize.js +++ b/test/issues/586-unable-to-resize.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('issue #586 - unable to resize'); diff --git a/test/issues/608-rewritten-arrays.js b/test/issues/608-rewritten-arrays.js index fc86e193..679630ed 100644 --- a/test/issues/608-rewritten-arrays.js +++ b/test/issues/608-rewritten-arrays.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('issue #608 - rewritten arrays'); diff --git a/test/issues/91-create-kernel-map-array.js b/test/issues/91-create-kernel-map-array.js index 2a2c6d5b..65a8678b 100644 --- a/test/issues/91-create-kernel-map-array.js +++ b/test/issues/91-create-kernel-map-array.js @@ -5,7 +5,7 @@ const { WebGLKernel, WebGL2Kernel, CPUKernel, -} = require('../../src'); +} = require('../..'); describe('issue #91'); diff --git a/test/issues/96-param-names.js b/test/issues/96-param-names.js index c9b44424..b61d7ec0 100644 --- a/test/issues/96-param-names.js +++ b/test/issues/96-param-names.js @@ -1,5 +1,5 @@ const { assert, skip, test, module: describe, only } = require('qunit'); -const { GPU } = require('../../src'); +const { GPU } = require('../..'); describe('issue #96'); From 8057e04d3914f09b480eede05506757806bbcaf8 Mon Sep 17 00:00:00 2001 From: 17097231932 <17097231932@163.com> Date: Sun, 29 Jan 2023 18:40:17 +0800 Subject: [PATCH 11/11] Restore the browser compatibility layer of the GL module (my fault) --- .prettierignore | 51 ++++++++++++++++++++++++++++++ .prettierrc | 36 +++++++++++----------- package.json | 3 +- pnpm-lock.yaml | 15 +++++++++ rollup.config.js | 50 ++++++++++++++++++++++-------- src/browser.js | 80 +++++++++--------------------------------------- src/gpu.js | 24 +++++---------- src/index.js | 5 --- 8 files changed, 146 insertions(+), 118 deletions(-) create mode 100644 .prettierignore diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 00000000..7ad4cfaa --- /dev/null +++ b/.prettierignore @@ -0,0 +1,51 @@ +dist +node_modules +test/all.html + +*.md + +# lock files +yarn.lock +pnpm-lock.yaml +package-lock.json + +# Logs +logs +*.log +npm-debug.log* + +# Runtime data +pids +*.pid +*.seed + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# node-waf configuration +.lock-wscript + +# Dependency directory +node_modules + +# Optional npm cache directory +.npm + +# Optional REPL history +.node_repl_history + +# intellij +.idea + +#yarn +yarn.lock + +# OSX .DS_Store +.DS_Store + +# build result +dist +test/all.html diff --git a/.prettierrc b/.prettierrc index 7460189a..a55ab933 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,18 +1,18 @@ -{ - "arrowParens": "avoid", - "bracketSpacing": true, - "endOfLine": "lf", - "htmlWhitespaceSensitivity": "css", - "insertPragma": false, - "jsxSingleQuote": false, - "printWidth": 79, - "proseWrap": "preserve", - "quoteProps": "as-needed", - "requirePragma": false, - "semi": true, - "singleQuote": true, - "tabWidth": 2, - "trailingComma": "es5", - "useTabs": false, - "vueIndentScriptAndStyle": false -} +{ + "arrowParens": "avoid", + "bracketSpacing": true, + "endOfLine": "lf", + "htmlWhitespaceSensitivity": "css", + "insertPragma": false, + "jsxSingleQuote": false, + "printWidth": 79, + "proseWrap": "preserve", + "quoteProps": "as-needed", + "requirePragma": false, + "semi": true, + "singleQuote": true, + "tabWidth": 2, + "trailingComma": "es5", + "useTabs": false, + "vueIndentScriptAndStyle": false +} diff --git a/package.json b/package.json index acdf6972..39861cc2 100644 --- a/package.json +++ b/package.json @@ -33,6 +33,7 @@ }, "devDependencies": { "@rollup/plugin-commonjs": "^24.0.1", + "@rollup/plugin-json": "^6.0.0", "@rollup/plugin-node-resolve": "^15.0.1", "@rollup/plugin-replace": "^5.0.2", "@rollup/plugin-terser": "^0.4.0", @@ -50,7 +51,7 @@ "test": "qunit test/issues test/internal test/features", "test:browser": "node scripts/build-tests.js", "coverage": "c8 qunit test/issues test/internal test/features", - "lint": "prettier -w *.js *.json src test scripts examples", + "lint": "prettier -w . --cache --no-color --loglevel warn", "build": "rollup -c --bundleConfigAsCjs", "watch": "pnpm run build --watch" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e72de7c8..9dde14be 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -2,6 +2,7 @@ lockfileVersion: 5.4 specifiers: '@rollup/plugin-commonjs': ^24.0.1 + '@rollup/plugin-json': ^6.0.0 '@rollup/plugin-node-resolve': ^15.0.1 '@rollup/plugin-replace': ^5.0.2 '@rollup/plugin-terser': ^0.4.0 @@ -27,6 +28,7 @@ dependencies: devDependencies: '@rollup/plugin-commonjs': 24.0.1_rollup@3.12.0 + '@rollup/plugin-json': 6.0.0_rollup@3.12.0 '@rollup/plugin-node-resolve': 15.0.1_rollup@3.12.0 '@rollup/plugin-replace': 5.0.2_rollup@3.12.0 '@rollup/plugin-terser': 0.4.0_rollup@3.12.0 @@ -187,6 +189,19 @@ packages: rollup: 3.12.0 dev: true + /@rollup/plugin-json/6.0.0_rollup@3.12.0: + resolution: {integrity: sha512-i/4C5Jrdr1XUarRhVu27EEwjt4GObltD7c+MkCIpO2QIbojw8MUs+CCTqOphQi3Qtg1FLmYt+l+6YeoIf51J7w==} + engines: {node: '>=14.0.0'} + peerDependencies: + rollup: ^1.20.0||^2.0.0||^3.0.0 + peerDependenciesMeta: + rollup: + optional: true + dependencies: + '@rollup/pluginutils': 5.0.2_rollup@3.12.0 + rollup: 3.12.0 + dev: true + /@rollup/plugin-node-resolve/15.0.1_rollup@3.12.0: resolution: {integrity: sha512-ReY88T7JhJjeRVbfCyNj+NXAG3IIsVMsX9b5/9jC98dRP8/yxlZdz7mHZbHk5zHr24wZZICS5AcXsFZAXYUQEg==} engines: {node: '>=14.0.0'} diff --git a/rollup.config.js b/rollup.config.js index c72718b0..675cccfe 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -2,6 +2,7 @@ import { defineConfig } from 'rollup'; import resolve from '@rollup/plugin-node-resolve'; import commonjs from '@rollup/plugin-commonjs'; import terser from '@rollup/plugin-terser'; +import json from '@rollup/plugin-json'; import fs from 'fs'; @@ -21,6 +22,39 @@ const banner = `/** * Copyright (c) ${new Date().getFullYear()} gpu.js Team */`; +/** + * + * @returns {import('rollup').Plugin} + */ +function pluginReplaceGL() { + const glID = 'gl?replaceEntry'; + const content = `export { default } from 'gl/src/javascript/browser-index';`; + + return { + resolveId(id) { + if (id === 'gl') { + return glID; + } + }, + load(id) { + if (id === glID) { + return content; + } + }, + }; +} + +function commonConfig(plugins = []) { + return defineConfig({ + plugins: [resolve(), commonjs(), json(), ...plugins], + onwarn(msg, warn) { + if (!/Circular/.test(msg)) { + warn(msg); + } + }, + }); +} + function createOutput(name, format, opts, minify = false) { return { banner, @@ -40,37 +74,29 @@ function buildBrowser(isCore) { return defineConfig({ input: './src/browser.js', - plugins: [resolve(), commonjs()], output: [ createOutput(id, 'umd', options), createOutput(id, 'umd', options, true), createOutput(id + '.esm', 'esm'), ], - onwarn(msg, warn) { - if (!/Circular/.test(msg)) { - warn(msg); - } - }, external: isCore ? ['acorn'] : [], + + ...commonConfig([pluginReplaceGL()]), }); } function buildNode() { return defineConfig({ input: './src/index.js', - plugins: [resolve(), commonjs()], output: [ createOutput('gpu-node', 'cjs'), createOutput('gpu-node.esm', 'esm'), ], - onwarn(msg, warn) { - if (!/Circular/.test(msg)) { - warn(msg); - } - }, external: Object.keys(pkg.dependencies).filter(v => v !== 'gpu-mock.js'), + + ...commonConfig(), }); } diff --git a/src/browser.js b/src/browser.js index d4ecb57b..5b023437 100644 --- a/src/browser.js +++ b/src/browser.js @@ -1,65 +1,15 @@ -import { GPU } from './gpu'; -import { alias } from './alias'; -import { utils } from './utils'; -import { Input, input } from './input'; -import { Texture } from './texture'; -import { FunctionBuilder } from './backend/function-builder'; -import { FunctionNode } from './backend/function-node'; -import { CPUFunctionNode } from './backend/cpu/function-node'; -import { CPUKernel } from './backend/cpu/kernel'; - -import { WebGLFunctionNode } from './backend/web-gl/function-node'; -import { WebGLKernel } from './backend/web-gl/kernel'; -import { kernelValueMaps as webGLKernelValueMaps } from './backend/web-gl/kernel-value-maps'; - -import { WebGL2FunctionNode } from './backend/web-gl2/function-node'; -import { WebGL2Kernel } from './backend/web-gl2/kernel'; -import { kernelValueMaps as webGL2KernelValueMaps } from './backend/web-gl2/kernel-value-maps'; - -import { Kernel } from './backend/kernel'; - -import { FunctionTracer } from './backend/function-tracer'; - -import mathRandom from './plugins/math-random-uniformly-distributed'; - -GPU.alias = alias; -GPU.utils = utils; -GPU.Input = Input; -GPU.input = input; -GPU.Texture = Texture; -GPU.FunctionBuilder = FunctionBuilder; -GPU.FunctionNode = FunctionNode; -GPU.CPUFunctionNode = CPUFunctionNode; -GPU.CPUKernel = CPUKernel; - -GPU.WebGLFunctionNode = WebGLFunctionNode; -GPU.WebGLKernel = WebGLKernel; -GPU.webGLKernelValueMaps = webGLKernelValueMaps; - -GPU.WebGL2FunctionNode = WebGL2FunctionNode; -GPU.WebGL2Kernel = WebGL2Kernel; -GPU.webGL2KernelValueMaps = webGL2KernelValueMaps; - -GPU.Kernel = Kernel; -GPU.FunctionTracer = FunctionTracer; - -GPU.plugins = { - mathRandom, -}; - -Object.defineProperties(GPU, { - GLKernel: { - get() { - console.warn('The browser build does not support GLKernel'); - return CPUKernel; - }, - }, - HeadlessGLKernel: { - get() { - console.warn('The browser build does not support HeadlessGLKernel'); - return CPUKernel; - }, - }, -}); - -export default GPU; +import * as lib from './index'; +const GPU = lib.GPU; + +for (const p in lib) { + if (!Object.prototype.hasOwnProperty.call(lib, p)) { + continue; + } + if (p === 'GPU') { + //prevent recursive reference + continue; + } + GPU[p] = lib[p]; +} + +export default lib; diff --git a/src/gpu.js b/src/gpu.js index 5865c596..f2e27220 100644 --- a/src/gpu.js +++ b/src/gpu.js @@ -1,16 +1,16 @@ import { gpuMock } from 'gpu-mock.js'; -import { utils } from './utils'; -import { Kernel } from './backend/kernel'; import { CPUKernel } from './backend/cpu/kernel'; -import { WebGL2Kernel } from './backend/web-gl2/kernel'; +import { HeadlessGLKernel } from './backend/headless-gl/kernel'; +import { Kernel } from './backend/kernel'; import { WebGLKernel } from './backend/web-gl/kernel'; +import { WebGL2Kernel } from './backend/web-gl2/kernel'; import { kernelRunShortcut } from './kernel-run-shortcut'; - +import { utils } from './utils'; /** * * @type {Array.} */ -export const kernelOrder = [WebGL2Kernel, WebGLKernel]; +export const kernelOrder = [HeadlessGLKernel, WebGL2Kernel, WebGLKernel]; /** * @@ -19,19 +19,11 @@ export const kernelOrder = [WebGL2Kernel, WebGLKernel]; export const kernelTypes = ['gpu', 'cpu']; const internalKernels = { + headlessgl: HeadlessGLKernel, webgl2: WebGL2Kernel, webgl: WebGLKernel, }; -/** - * - * @param {import('./backend/headless-gl/kernel').HeadlessGLKernel} HeadlessGLKernel - */ -export function setupNode(HeadlessGLKernel) { - kernelOrder.unshift(HeadlessGLKernel); - internalKernels.headlessgl = HeadlessGLKernel; -} - let validate = true; /** @@ -91,9 +83,7 @@ export class GPU { * @desc TRUE if platform supports HeadlessGL */ static get isHeadlessGLSupported() { - return ( - 'headlessgl' in internalKernels && internalKernels.headlessgl.isSupported - ); + return HeadlessGLKernel.isSupported; } /** diff --git a/src/index.js b/src/index.js index 88d03985..1feff7b6 100644 --- a/src/index.js +++ b/src/index.js @@ -29,8 +29,3 @@ import mathRandom from './plugins/math-random-uniformly-distributed'; export const plugins = { mathRandom, }; - -import { setupNode } from './gpu'; -import { HeadlessGLKernel } from './backend/headless-gl/kernel'; - -setupNode(HeadlessGLKernel);