From 6971f204ce5ee42e80283abf712b0385cd7cd961 Mon Sep 17 00:00:00 2001 From: wada Date: Thu, 25 May 2023 11:33:53 +0900 Subject: [PATCH] Update to Cubism 4 SDK for Web R7 --- CHANGELOG.md | 20 + README.ja.md | 9 +- README.md | 10 +- package-lock.json | 1116 +++++++++++++++++++------ package.json | 14 +- src/model/cubismmoc.ts | 23 +- src/model/cubismmodel.ts | 413 ++++++++- src/model/cubismusermodel.ts | 6 +- src/motion/acubismmotion.ts | 41 + src/motion/cubismexpressionmotion.ts | 131 +-- src/motion/cubismmotion.ts | 91 ++ src/physics/cubismphysics.ts | 23 +- src/rendering/cubismrenderer.ts | 10 +- src/rendering/cubismrenderer_webgl.ts | 6 +- src/utils/cubismjson.ts | 2 + src/utils/cubismjsonextension.ts | 29 +- tsconfig.json | 4 +- 17 files changed, 1563 insertions(+), 385 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 31cf083..504a93b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,25 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). +## [4-r.7] - 2023-05-25 + +### Added + +* Add compiler options `noImplicitAny` and `useUnknownInCatchVariables` to `tsconfig.json`. +* Add some function for checking consistency of MOC3. + * Add the function of checking consistency on reviving a MOC3. (`CubismMoc::Create`) +* Add a function to parse the opacity from `.motion3.json`. +* Add some functions to change Multiply and Screen colors on a per part basis. + +### Changed + +* Change access specifier for `CubismExpressionMotion`. + +### Fixed + +* Fix to support added compiler options `noImplicitAny` and `useUnknownInCatchVariables`. + + ## [4-r.6.2] - 2023-03-16 ### Fixed @@ -163,6 +182,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). * Reformat code using Prettier and ESLint. +[4-r.7]: https://github.com/Live2D/CubismWebFramework/compare/4-r.6.2...4-r.7 [4-r.6.2]: https://github.com/Live2D/CubismWebFramework/compare/4-r.6.1...4-r.6.2 [4-r.6.1]: https://github.com/Live2D/CubismWebFramework/compare/4-r.6...4-r.6.1 [4-r.6]: https://github.com/Live2D/CubismWebFramework/compare/4-r.5...4-r.6 diff --git a/README.ja.md b/README.ja.md index 5a12bc5..ea02b89 100644 --- a/README.ja.md +++ b/README.ja.md @@ -21,15 +21,14 @@ Live2D Cubism 4 Editor で出力したモデルをアプリケーションで利 ### Node.js -* 19.6.0 -* 18.14.0 -* 16.19.0 -* 14.21.2 +* 20.1.0 +* 18.16.0 +* 16.20.0 ### TypeScript -4.9.5 +5.0.4 ## 開発環境構築 diff --git a/README.md b/README.md index d330a67..04d0759 100644 --- a/README.md +++ b/README.md @@ -21,15 +21,13 @@ Please check the [license](LICENSE.md) before using this SDK. ### Node.js -* 19.6.0 -* 18.14.0 -* 16.19.0 -* 14.21.2 - +* 20.1.0 +* 18.16.0 +* 16.20.0 ### TypeScript -4.9.5 +5.0.4 ## Development environment construction diff --git a/package-lock.json b/package-lock.json index 7d27f8f..a75338f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,25 +5,49 @@ "packages": { "": { "devDependencies": { - "@typescript-eslint/eslint-plugin": "^5.52.0", - "@typescript-eslint/parser": "^5.52.0", - "eslint": "^8.34.0", - "eslint-config-prettier": "^8.6.0", + "@typescript-eslint/eslint-plugin": "^5.59.5", + "@typescript-eslint/parser": "^5.59.5", + "eslint": "^8.40.0", + "eslint-config-prettier": "^8.8.0", "eslint-plugin-prettier": "^4.2.1", - "prettier": "^2.8.4", - "rimraf": "^4.1.2", - "typescript": "^4.9.5" + "prettier": "^2.8.8", + "rimraf": "^5.0.0", + "typescript": "^5.0.4" + } + }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", + "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", + "dev": true, + "dependencies": { + "eslint-visitor-keys": "^3.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.5.1", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.5.1.tgz", + "integrity": "sha512-Z5ba73P98O1KUYCCJTUeVpja9RcGoMdncZ6T49FCUl2lN38JtCJ+3WgIDBv0AuY4WChU5PmtJmOCTlN6FZTFKQ==", + "dev": true, + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" } }, "node_modules/@eslint/eslintrc": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.4.1.tgz", - "integrity": "sha512-XXrH9Uarn0stsyldqDYq8r++mROmWRI1xKMXa640Bb//SY1+ECYX6VzT6Lcx5frD0V30XieqJ0oX9I2Xj5aoMA==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.0.3.tgz", + "integrity": "sha512-+5gy6OQfk+xx3q0d6jGZZC3f3KzAkXc/IanVxd1is/VIIziRqqt3ongQz0FiTUXqTk0c7aDB3OaFuKnuSoJicQ==", "dev": true, "dependencies": { "ajv": "^6.12.4", "debug": "^4.3.2", - "espree": "^9.4.0", + "espree": "^9.5.2", "globals": "^13.19.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", @@ -38,6 +62,15 @@ "url": "https://opencollective.com/eslint" } }, + "node_modules/@eslint/js": { + "version": "8.40.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.40.0.tgz", + "integrity": "sha512-ElyB54bJIhXQYVKjDSvCkPO1iU1tSAeVQJbllWJq1XQSmmA4dgFk8CbiBGpiOPxleE48vDogxCtmMYku4HSVLA==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, "node_modules/@humanwhocodes/config-array": { "version": "0.11.8", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.8.tgz", @@ -71,6 +104,50 @@ "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", "dev": true }, + "node_modules/@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "dev": true, + "dependencies": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@isaacs/cliui/node_modules/ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/strip-ansi": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.0.1.tgz", + "integrity": "sha512-cXNxvT8dFNRVfhVME3JAe98mkXDYN2O1l7jmcwMnOslDeESg1rF/OZMtK0nRAhiari1unG5cD4jG3rapUAkLbw==", + "dev": true, + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -106,6 +183,16 @@ "node": ">= 8" } }, + "node_modules/@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + "dev": true, + "optional": true, + "engines": { + "node": ">=14" + } + }, "node_modules/@types/json-schema": { "version": "7.0.11", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", @@ -113,25 +200,25 @@ "dev": true }, "node_modules/@types/semver": { - "version": "7.3.13", - "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.3.13.tgz", - "integrity": "sha512-21cFJr9z3g5dW8B0CVI9g2O9beqaThGQ6ZFBqHfwhzLDKUxaqTIy3vnfah/UPkfOiF2pLq+tGz+W8RyCskuslw==", + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.0.tgz", + "integrity": "sha512-G8hZ6XJiHnuhQKR7ZmysCeJWE08o8T0AXtk5darsCaTVsYZhhgUrq53jizaR2FvsoeCwJhlmwTjkXBY5Pn/ZHw==", "dev": true }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "5.52.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.52.0.tgz", - "integrity": "sha512-lHazYdvYVsBokwCdKOppvYJKaJ4S41CgKBcPvyd0xjZNbvQdhn/pnJlGtQksQ/NhInzdaeaSarlBjDXHuclEbg==", + "version": "5.59.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.59.5.tgz", + "integrity": "sha512-feA9xbVRWJZor+AnLNAr7A8JRWeZqHUf4T9tlP+TN04b05pFVhO5eN7/O93Y/1OUlLMHKbnJisgDURs/qvtqdg==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "5.52.0", - "@typescript-eslint/type-utils": "5.52.0", - "@typescript-eslint/utils": "5.52.0", + "@eslint-community/regexpp": "^4.4.0", + "@typescript-eslint/scope-manager": "5.59.5", + "@typescript-eslint/type-utils": "5.59.5", + "@typescript-eslint/utils": "5.59.5", "debug": "^4.3.4", "grapheme-splitter": "^1.0.4", "ignore": "^5.2.0", "natural-compare-lite": "^1.4.0", - "regexpp": "^3.2.0", "semver": "^7.3.7", "tsutils": "^3.21.0" }, @@ -153,14 +240,14 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "5.52.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.52.0.tgz", - "integrity": "sha512-e2KiLQOZRo4Y0D/b+3y08i3jsekoSkOYStROYmPUnGMEoA0h+k2qOH5H6tcjIc68WDvGwH+PaOrP1XRzLJ6QlA==", + "version": "5.59.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.59.5.tgz", + "integrity": "sha512-NJXQC4MRnF9N9yWqQE2/KLRSOLvrrlZb48NGVfBa+RuPMN6B7ZcK5jZOvhuygv4D64fRKnZI4L4p8+M+rfeQuw==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "5.52.0", - "@typescript-eslint/types": "5.52.0", - "@typescript-eslint/typescript-estree": "5.52.0", + "@typescript-eslint/scope-manager": "5.59.5", + "@typescript-eslint/types": "5.59.5", + "@typescript-eslint/typescript-estree": "5.59.5", "debug": "^4.3.4" }, "engines": { @@ -180,13 +267,13 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "5.52.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.52.0.tgz", - "integrity": "sha512-AR7sxxfBKiNV0FWBSARxM8DmNxrwgnYMPwmpkC1Pl1n+eT8/I2NAUPuwDy/FmDcC6F8pBfmOcaxcxRHspgOBMw==", + "version": "5.59.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.59.5.tgz", + "integrity": "sha512-jVecWwnkX6ZgutF+DovbBJirZcAxgxC0EOHYt/niMROf8p4PwxxG32Qdhj/iIQQIuOflLjNkxoXyArkcIP7C3A==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.52.0", - "@typescript-eslint/visitor-keys": "5.52.0" + "@typescript-eslint/types": "5.59.5", + "@typescript-eslint/visitor-keys": "5.59.5" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -197,13 +284,13 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "5.52.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.52.0.tgz", - "integrity": "sha512-tEKuUHfDOv852QGlpPtB3lHOoig5pyFQN/cUiZtpw99D93nEBjexRLre5sQZlkMoHry/lZr8qDAt2oAHLKA6Jw==", + "version": "5.59.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.59.5.tgz", + "integrity": "sha512-4eyhS7oGym67/pSxA2mmNq7X164oqDYNnZCUayBwJZIRVvKpBCMBzFnFxjeoDeShjtO6RQBHBuwybuX3POnDqg==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "5.52.0", - "@typescript-eslint/utils": "5.52.0", + "@typescript-eslint/typescript-estree": "5.59.5", + "@typescript-eslint/utils": "5.59.5", "debug": "^4.3.4", "tsutils": "^3.21.0" }, @@ -224,9 +311,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "5.52.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.52.0.tgz", - "integrity": "sha512-oV7XU4CHYfBhk78fS7tkum+/Dpgsfi91IIDy7fjCyq2k6KB63M6gMC0YIvy+iABzmXThCRI6xpCEyVObBdWSDQ==", + "version": "5.59.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.59.5.tgz", + "integrity": "sha512-xkfRPHbqSH4Ggx4eHRIO/eGL8XL4Ysb4woL8c87YuAo8Md7AUjyWKa9YMwTL519SyDPrfEgKdewjkxNCVeJW7w==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -237,13 +324,13 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "5.52.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.52.0.tgz", - "integrity": "sha512-WeWnjanyEwt6+fVrSR0MYgEpUAuROxuAH516WPjUblIrClzYJj0kBbjdnbQXLpgAN8qbEuGywiQsXUVDiAoEuQ==", + "version": "5.59.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.59.5.tgz", + "integrity": "sha512-+XXdLN2CZLZcD/mO7mQtJMvCkzRfmODbeSKuMY/yXbGkzvA9rJyDY5qDYNoiz2kP/dmyAxXquL2BvLQLJFPQIg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.52.0", - "@typescript-eslint/visitor-keys": "5.52.0", + "@typescript-eslint/types": "5.59.5", + "@typescript-eslint/visitor-keys": "5.59.5", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -264,18 +351,18 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "5.52.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.52.0.tgz", - "integrity": "sha512-As3lChhrbwWQLNk2HC8Ree96hldKIqk98EYvypd3It8Q1f8d5zWyIoaZEp2va5667M4ZyE7X8UUR+azXrFl+NA==", + "version": "5.59.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.59.5.tgz", + "integrity": "sha512-sCEHOiw+RbyTii9c3/qN74hYDPNORb8yWCoPLmB7BIflhplJ65u2PBpdRla12e3SSTJ2erRkPjz7ngLHhUegxA==", "dev": true, "dependencies": { + "@eslint-community/eslint-utils": "^4.2.0", "@types/json-schema": "^7.0.9", "@types/semver": "^7.3.12", - "@typescript-eslint/scope-manager": "5.52.0", - "@typescript-eslint/types": "5.52.0", - "@typescript-eslint/typescript-estree": "5.52.0", + "@typescript-eslint/scope-manager": "5.59.5", + "@typescript-eslint/types": "5.59.5", + "@typescript-eslint/typescript-estree": "5.59.5", "eslint-scope": "^5.1.1", - "eslint-utils": "^3.0.0", "semver": "^7.3.7" }, "engines": { @@ -290,12 +377,12 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "5.52.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.52.0.tgz", - "integrity": "sha512-qMwpw6SU5VHCPr99y274xhbm+PRViK/NATY6qzt+Et7+mThGuFSl/ompj2/hrBlRP/kq+BFdgagnOSgw9TB0eA==", + "version": "5.59.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.59.5.tgz", + "integrity": "sha512-qL+Oz+dbeBRTeyJTIy0eniD3uvqU7x+y1QceBismZ41hd4aBSRh8UAw4pZP0+XzLuPZmx4raNMq/I+59W2lXKA==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.52.0", + "@typescript-eslint/types": "5.59.5", "eslint-visitor-keys": "^3.3.0" }, "engines": { @@ -520,6 +607,18 @@ "node": ">=6.0.0" } }, + "node_modules/eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", + "dev": true + }, + "node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "dev": true + }, "node_modules/escape-string-regexp": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", @@ -533,12 +632,15 @@ } }, "node_modules/eslint": { - "version": "8.34.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.34.0.tgz", - "integrity": "sha512-1Z8iFsucw+7kSqXNZVslXS8Ioa4u2KM7GPwuKtkTFAqZ/cHMcEaR+1+Br0wLlot49cNxIiZk5wp8EAbPcYZxTg==", + "version": "8.40.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.40.0.tgz", + "integrity": "sha512-bvR+TsP9EHL3TqNtj9sCNJVAFK3fBN8Q7g5waghxyRsPLIMwL73XSKnZFK0hk/O2ANC+iAoq6PWMQ+IfBAJIiQ==", "dev": true, "dependencies": { - "@eslint/eslintrc": "^1.4.1", + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.4.0", + "@eslint/eslintrc": "^2.0.3", + "@eslint/js": "8.40.0", "@humanwhocodes/config-array": "^0.11.8", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", @@ -548,11 +650,10 @@ "debug": "^4.3.2", "doctrine": "^3.0.0", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^7.1.1", - "eslint-utils": "^3.0.0", - "eslint-visitor-keys": "^3.3.0", - "espree": "^9.4.0", - "esquery": "^1.4.0", + "eslint-scope": "^7.2.0", + "eslint-visitor-keys": "^3.4.1", + "espree": "^9.5.2", + "esquery": "^1.4.2", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", "file-entry-cache": "^6.0.1", @@ -573,7 +674,6 @@ "minimatch": "^3.1.2", "natural-compare": "^1.4.0", "optionator": "^0.9.1", - "regexpp": "^3.2.0", "strip-ansi": "^6.0.1", "strip-json-comments": "^3.1.0", "text-table": "^0.2.0" @@ -589,9 +689,9 @@ } }, "node_modules/eslint-config-prettier": { - "version": "8.6.0", - "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.6.0.tgz", - "integrity": "sha512-bAF0eLpLVqP5oEVUFKpMA+NnRFICwn9X8B5jrR9FcqnYBuPbqWEjTEspPWMj5ye6czoSLDweCzSo3Ko7gGrZaA==", + "version": "8.8.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.8.0.tgz", + "integrity": "sha512-wLbQiFre3tdGgpDv67NQKnJuTlcUVYHas3k+DZCc2U2BadthoEY4B7hLPvAxaqdyOGCzuLfii2fqGph10va7oA==", "dev": true, "bin": { "eslint-config-prettier": "bin/cli.js" @@ -634,46 +734,22 @@ "node": ">=8.0.0" } }, - "node_modules/eslint-utils": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", - "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", - "dev": true, - "dependencies": { - "eslint-visitor-keys": "^2.0.0" - }, - "engines": { - "node": "^10.0.0 || ^12.0.0 || >= 14.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/mysticatea" - }, - "peerDependencies": { - "eslint": ">=5" - } - }, - "node_modules/eslint-utils/node_modules/eslint-visitor-keys": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", - "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", - "dev": true, - "engines": { - "node": ">=10" - } - }, "node_modules/eslint-visitor-keys": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz", - "integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==", + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.1.tgz", + "integrity": "sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, "node_modules/eslint/node_modules/eslint-scope": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.1.tgz", - "integrity": "sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.0.tgz", + "integrity": "sha512-DYj5deGlHBfMt15J7rdtyKNq/Nqlv5KfU4iodrQ019XESsRnwXH9KAE0y3cwtUHDo2ob7CypAnCqefh6vioWRw==", "dev": true, "dependencies": { "esrecurse": "^4.3.0", @@ -681,6 +757,9 @@ }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, "node_modules/eslint/node_modules/estraverse": { @@ -693,14 +772,14 @@ } }, "node_modules/espree": { - "version": "9.4.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.4.1.tgz", - "integrity": "sha512-XwctdmTO6SIvCzd9810yyNzIrOrqNYV9Koizx4C/mRhf9uq0o4yHoCEU/670pOxOL/MSraektvSAji79kX90Vg==", + "version": "9.5.2", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.5.2.tgz", + "integrity": "sha512-7OASN1Wma5fum5SrNhFMAMJxOUAbhyfQ8dQ//PJaJbNw0URTPWqIghHWt1MmAANKhHZIYOHruW4Kw4ruUWOdGw==", "dev": true, "dependencies": { "acorn": "^8.8.0", "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^3.3.0" + "eslint-visitor-keys": "^3.4.1" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -710,9 +789,9 @@ } }, "node_modules/esquery": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", - "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", + "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", "dev": true, "dependencies": { "estraverse": "^5.1.0" @@ -904,6 +983,22 @@ "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==", "dev": true }, + "node_modules/foreground-child": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.1.1.tgz", + "integrity": "sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.0", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -1051,6 +1146,15 @@ "node": ">=0.10.0" } }, + "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/is-glob": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", @@ -1087,6 +1191,24 @@ "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", "dev": true }, + "node_modules/jackspeak": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-2.2.0.tgz", + "integrity": "sha512-r5XBrqIJfwRIjRt/Xr5fv9Wh09qyhHfKnYddDlpM+ibRR20qrYActpCAgU6U+d53EOEjzkvxPMVHSlgR7leXrQ==", + "dev": true, + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } + }, "node_modules/js-sdsl": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.3.0.tgz", @@ -1201,6 +1323,15 @@ "node": "*" } }, + "node_modules/minipass": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", + "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -1314,6 +1445,31 @@ "node": ">=8" } }, + "node_modules/path-scurry": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.8.0.tgz", + "integrity": "sha512-IjTrKseM404/UAWA8bBbL3Qp6O2wXkanuIE3seCxBH7ctRuvH1QRawy1N3nVDHGkdeZsjOsSe/8AQBL/VQCy2g==", + "dev": true, + "dependencies": { + "lru-cache": "^9.1.1", + "minipass": "^5.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/path-scurry/node_modules/lru-cache": { + "version": "9.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-9.1.1.tgz", + "integrity": "sha512-65/Jky17UwSb0BuB9V+MyDpsOtXKmYwzhyl+cOa9XUiI4uV2Ouy/2voFP3+al0BjZbJgMBD8FojMpAf+Z+qn4A==", + "dev": true, + "engines": { + "node": "14 || >=16.14" + } + }, "node_modules/path-type": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", @@ -1345,9 +1501,9 @@ } }, "node_modules/prettier": { - "version": "2.8.4", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.4.tgz", - "integrity": "sha512-vIS4Rlc2FNh0BySk3Wkd6xmwxB0FpOndW5fisM5H8hsZSxU2VWVB5CWIkIjWvrHjIhxk2g3bfMKM87zNTrZddw==", + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", + "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", "dev": true, "bin": { "prettier": "bin-prettier.js" @@ -1400,18 +1556,6 @@ } ] }, - "node_modules/regexpp": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", - "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", - "dev": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/mysticatea" - } - }, "node_modules/resolve-from": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", @@ -1432,10 +1576,13 @@ } }, "node_modules/rimraf": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-4.1.2.tgz", - "integrity": "sha512-BlIbgFryTbw3Dz6hyoWFhKk+unCcHMSkZGrTFVAx2WmttdBSonsdtRlwiuTbDqTKr+UlXIUqJVS4QT5tUzGENQ==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-5.0.0.tgz", + "integrity": "sha512-Jf9llaP+RvaEVS5nPShYFhtXIrb3LRKP281ib3So0KkeZKo2wIKyq0Re7TOSwanasA423PSr6CCIL4bP6T040g==", "dev": true, + "dependencies": { + "glob": "^10.0.0" + }, "bin": { "rimraf": "dist/cjs/src/bin.js" }, @@ -1446,6 +1593,52 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/rimraf/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==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/rimraf/node_modules/glob": { + "version": "10.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.2.3.tgz", + "integrity": "sha512-Kb4rfmBVE3eQTAimgmeqc2LwSnN0wIOkkUL6HmxEFxNJ4fHghYHVbFba/HcGcRjE6s9KoMNK3rSOwkL4PioZjg==", + "dev": true, + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^2.0.3", + "minimatch": "^9.0.0", + "minipass": "^5.0.0", + "path-scurry": "^1.7.0" + }, + "bin": { + "glob": "dist/cjs/src/bin.js" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/rimraf/node_modules/minimatch": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.0.tgz", + "integrity": "sha512-0jJj8AvgKqWN05mrwuqi8QYKx1WmYSUoKSxu5Qhs9prezTz10sxAHGNZe9J9cqIJzta8DWsleh2KaVaLl6Ru2w==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", @@ -1505,6 +1698,18 @@ "node": ">=8" } }, + "node_modules/signal-exit": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.0.2.tgz", + "integrity": "sha512-MY2/qGx4enyjprQnFaZsHib3Yadh3IXyV2C321GY0pjGfVBu4un0uDJkwgdxqO+Rdx8JMT8IfJIRwbYVz3Ob3Q==", + "dev": true, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/slash": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", @@ -1514,6 +1719,71 @@ "node": ">=8" } }, + "node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dev": true, + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/string-width-cjs": { + "name": "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/string-width-cjs/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==", + "dev": true + }, + "node_modules/string-width/node_modules/ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/string-width/node_modules/strip-ansi": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.0.1.tgz", + "integrity": "sha512-cXNxvT8dFNRVfhVME3JAe98mkXDYN2O1l7jmcwMnOslDeESg1rF/OZMtK0nRAhiari1unG5cD4jG3rapUAkLbw==", + "dev": true, + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, "node_modules/strip-ansi": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", @@ -1526,6 +1796,19 @@ "node": ">=8" } }, + "node_modules/strip-ansi-cjs": { + "name": "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/strip-json-comments": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", @@ -1614,16 +1897,16 @@ } }, "node_modules/typescript": { - "version": "4.9.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", - "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.4.tgz", + "integrity": "sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==", "dev": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" }, "engines": { - "node": ">=4.2.0" + "node": ">=12.20" } }, "node_modules/uri-js": { @@ -1659,6 +1942,100 @@ "node": ">=0.10.0" } }, + "node_modules/wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs": { + "name": "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/wrap-ansi-cjs/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==", + "dev": true + }, + "node_modules/wrap-ansi-cjs/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/wrap-ansi/node_modules/ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/strip-ansi": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.0.1.tgz", + "integrity": "sha512-cXNxvT8dFNRVfhVME3JAe98mkXDYN2O1l7jmcwMnOslDeESg1rF/OZMtK0nRAhiari1unG5cD4jG3rapUAkLbw==", + "dev": true, + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", @@ -1685,15 +2062,30 @@ } }, "dependencies": { + "@eslint-community/eslint-utils": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", + "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^3.3.0" + } + }, + "@eslint-community/regexpp": { + "version": "4.5.1", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.5.1.tgz", + "integrity": "sha512-Z5ba73P98O1KUYCCJTUeVpja9RcGoMdncZ6T49FCUl2lN38JtCJ+3WgIDBv0AuY4WChU5PmtJmOCTlN6FZTFKQ==", + "dev": true + }, "@eslint/eslintrc": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.4.1.tgz", - "integrity": "sha512-XXrH9Uarn0stsyldqDYq8r++mROmWRI1xKMXa640Bb//SY1+ECYX6VzT6Lcx5frD0V30XieqJ0oX9I2Xj5aoMA==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.0.3.tgz", + "integrity": "sha512-+5gy6OQfk+xx3q0d6jGZZC3f3KzAkXc/IanVxd1is/VIIziRqqt3ongQz0FiTUXqTk0c7aDB3OaFuKnuSoJicQ==", "dev": true, "requires": { "ajv": "^6.12.4", "debug": "^4.3.2", - "espree": "^9.4.0", + "espree": "^9.5.2", "globals": "^13.19.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", @@ -1702,6 +2094,12 @@ "strip-json-comments": "^3.1.1" } }, + "@eslint/js": { + "version": "8.40.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.40.0.tgz", + "integrity": "sha512-ElyB54bJIhXQYVKjDSvCkPO1iU1tSAeVQJbllWJq1XQSmmA4dgFk8CbiBGpiOPxleE48vDogxCtmMYku4HSVLA==", + "dev": true + }, "@humanwhocodes/config-array": { "version": "0.11.8", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.8.tgz", @@ -1725,6 +2123,37 @@ "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", "dev": true }, + "@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "dev": true, + "requires": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "dev": true + }, + "strip-ansi": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.0.1.tgz", + "integrity": "sha512-cXNxvT8dFNRVfhVME3JAe98mkXDYN2O1l7jmcwMnOslDeESg1rF/OZMtK0nRAhiari1unG5cD4jG3rapUAkLbw==", + "dev": true, + "requires": { + "ansi-regex": "^6.0.1" + } + } + } + }, "@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -1751,6 +2180,13 @@ "fastq": "^1.6.0" } }, + "@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + "dev": true, + "optional": true + }, "@types/json-schema": { "version": "7.0.11", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", @@ -1758,77 +2194,77 @@ "dev": true }, "@types/semver": { - "version": "7.3.13", - "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.3.13.tgz", - "integrity": "sha512-21cFJr9z3g5dW8B0CVI9g2O9beqaThGQ6ZFBqHfwhzLDKUxaqTIy3vnfah/UPkfOiF2pLq+tGz+W8RyCskuslw==", + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.0.tgz", + "integrity": "sha512-G8hZ6XJiHnuhQKR7ZmysCeJWE08o8T0AXtk5darsCaTVsYZhhgUrq53jizaR2FvsoeCwJhlmwTjkXBY5Pn/ZHw==", "dev": true }, "@typescript-eslint/eslint-plugin": { - "version": "5.52.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.52.0.tgz", - "integrity": "sha512-lHazYdvYVsBokwCdKOppvYJKaJ4S41CgKBcPvyd0xjZNbvQdhn/pnJlGtQksQ/NhInzdaeaSarlBjDXHuclEbg==", + "version": "5.59.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.59.5.tgz", + "integrity": "sha512-feA9xbVRWJZor+AnLNAr7A8JRWeZqHUf4T9tlP+TN04b05pFVhO5eN7/O93Y/1OUlLMHKbnJisgDURs/qvtqdg==", "dev": true, "requires": { - "@typescript-eslint/scope-manager": "5.52.0", - "@typescript-eslint/type-utils": "5.52.0", - "@typescript-eslint/utils": "5.52.0", + "@eslint-community/regexpp": "^4.4.0", + "@typescript-eslint/scope-manager": "5.59.5", + "@typescript-eslint/type-utils": "5.59.5", + "@typescript-eslint/utils": "5.59.5", "debug": "^4.3.4", "grapheme-splitter": "^1.0.4", "ignore": "^5.2.0", "natural-compare-lite": "^1.4.0", - "regexpp": "^3.2.0", "semver": "^7.3.7", "tsutils": "^3.21.0" } }, "@typescript-eslint/parser": { - "version": "5.52.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.52.0.tgz", - "integrity": "sha512-e2KiLQOZRo4Y0D/b+3y08i3jsekoSkOYStROYmPUnGMEoA0h+k2qOH5H6tcjIc68WDvGwH+PaOrP1XRzLJ6QlA==", + "version": "5.59.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.59.5.tgz", + "integrity": "sha512-NJXQC4MRnF9N9yWqQE2/KLRSOLvrrlZb48NGVfBa+RuPMN6B7ZcK5jZOvhuygv4D64fRKnZI4L4p8+M+rfeQuw==", "dev": true, "requires": { - "@typescript-eslint/scope-manager": "5.52.0", - "@typescript-eslint/types": "5.52.0", - "@typescript-eslint/typescript-estree": "5.52.0", + "@typescript-eslint/scope-manager": "5.59.5", + "@typescript-eslint/types": "5.59.5", + "@typescript-eslint/typescript-estree": "5.59.5", "debug": "^4.3.4" } }, "@typescript-eslint/scope-manager": { - "version": "5.52.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.52.0.tgz", - "integrity": "sha512-AR7sxxfBKiNV0FWBSARxM8DmNxrwgnYMPwmpkC1Pl1n+eT8/I2NAUPuwDy/FmDcC6F8pBfmOcaxcxRHspgOBMw==", + "version": "5.59.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.59.5.tgz", + "integrity": "sha512-jVecWwnkX6ZgutF+DovbBJirZcAxgxC0EOHYt/niMROf8p4PwxxG32Qdhj/iIQQIuOflLjNkxoXyArkcIP7C3A==", "dev": true, "requires": { - "@typescript-eslint/types": "5.52.0", - "@typescript-eslint/visitor-keys": "5.52.0" + "@typescript-eslint/types": "5.59.5", + "@typescript-eslint/visitor-keys": "5.59.5" } }, "@typescript-eslint/type-utils": { - "version": "5.52.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.52.0.tgz", - "integrity": "sha512-tEKuUHfDOv852QGlpPtB3lHOoig5pyFQN/cUiZtpw99D93nEBjexRLre5sQZlkMoHry/lZr8qDAt2oAHLKA6Jw==", + "version": "5.59.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.59.5.tgz", + "integrity": "sha512-4eyhS7oGym67/pSxA2mmNq7X164oqDYNnZCUayBwJZIRVvKpBCMBzFnFxjeoDeShjtO6RQBHBuwybuX3POnDqg==", "dev": true, "requires": { - "@typescript-eslint/typescript-estree": "5.52.0", - "@typescript-eslint/utils": "5.52.0", + "@typescript-eslint/typescript-estree": "5.59.5", + "@typescript-eslint/utils": "5.59.5", "debug": "^4.3.4", "tsutils": "^3.21.0" } }, "@typescript-eslint/types": { - "version": "5.52.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.52.0.tgz", - "integrity": "sha512-oV7XU4CHYfBhk78fS7tkum+/Dpgsfi91IIDy7fjCyq2k6KB63M6gMC0YIvy+iABzmXThCRI6xpCEyVObBdWSDQ==", + "version": "5.59.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.59.5.tgz", + "integrity": "sha512-xkfRPHbqSH4Ggx4eHRIO/eGL8XL4Ysb4woL8c87YuAo8Md7AUjyWKa9YMwTL519SyDPrfEgKdewjkxNCVeJW7w==", "dev": true }, "@typescript-eslint/typescript-estree": { - "version": "5.52.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.52.0.tgz", - "integrity": "sha512-WeWnjanyEwt6+fVrSR0MYgEpUAuROxuAH516WPjUblIrClzYJj0kBbjdnbQXLpgAN8qbEuGywiQsXUVDiAoEuQ==", + "version": "5.59.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.59.5.tgz", + "integrity": "sha512-+XXdLN2CZLZcD/mO7mQtJMvCkzRfmODbeSKuMY/yXbGkzvA9rJyDY5qDYNoiz2kP/dmyAxXquL2BvLQLJFPQIg==", "dev": true, "requires": { - "@typescript-eslint/types": "5.52.0", - "@typescript-eslint/visitor-keys": "5.52.0", + "@typescript-eslint/types": "5.59.5", + "@typescript-eslint/visitor-keys": "5.59.5", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -1837,28 +2273,28 @@ } }, "@typescript-eslint/utils": { - "version": "5.52.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.52.0.tgz", - "integrity": "sha512-As3lChhrbwWQLNk2HC8Ree96hldKIqk98EYvypd3It8Q1f8d5zWyIoaZEp2va5667M4ZyE7X8UUR+azXrFl+NA==", + "version": "5.59.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.59.5.tgz", + "integrity": "sha512-sCEHOiw+RbyTii9c3/qN74hYDPNORb8yWCoPLmB7BIflhplJ65u2PBpdRla12e3SSTJ2erRkPjz7ngLHhUegxA==", "dev": true, "requires": { + "@eslint-community/eslint-utils": "^4.2.0", "@types/json-schema": "^7.0.9", "@types/semver": "^7.3.12", - "@typescript-eslint/scope-manager": "5.52.0", - "@typescript-eslint/types": "5.52.0", - "@typescript-eslint/typescript-estree": "5.52.0", + "@typescript-eslint/scope-manager": "5.59.5", + "@typescript-eslint/types": "5.59.5", + "@typescript-eslint/typescript-estree": "5.59.5", "eslint-scope": "^5.1.1", - "eslint-utils": "^3.0.0", "semver": "^7.3.7" } }, "@typescript-eslint/visitor-keys": { - "version": "5.52.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.52.0.tgz", - "integrity": "sha512-qMwpw6SU5VHCPr99y274xhbm+PRViK/NATY6qzt+Et7+mThGuFSl/ompj2/hrBlRP/kq+BFdgagnOSgw9TB0eA==", + "version": "5.59.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.59.5.tgz", + "integrity": "sha512-qL+Oz+dbeBRTeyJTIy0eniD3uvqU7x+y1QceBismZ41hd4aBSRh8UAw4pZP0+XzLuPZmx4raNMq/I+59W2lXKA==", "dev": true, "requires": { - "@typescript-eslint/types": "5.52.0", + "@typescript-eslint/types": "5.59.5", "eslint-visitor-keys": "^3.3.0" } }, @@ -2020,6 +2456,18 @@ "esutils": "^2.0.2" } }, + "eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", + "dev": true + }, + "emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "dev": true + }, "escape-string-regexp": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", @@ -2027,12 +2475,15 @@ "dev": true }, "eslint": { - "version": "8.34.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.34.0.tgz", - "integrity": "sha512-1Z8iFsucw+7kSqXNZVslXS8Ioa4u2KM7GPwuKtkTFAqZ/cHMcEaR+1+Br0wLlot49cNxIiZk5wp8EAbPcYZxTg==", + "version": "8.40.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.40.0.tgz", + "integrity": "sha512-bvR+TsP9EHL3TqNtj9sCNJVAFK3fBN8Q7g5waghxyRsPLIMwL73XSKnZFK0hk/O2ANC+iAoq6PWMQ+IfBAJIiQ==", "dev": true, "requires": { - "@eslint/eslintrc": "^1.4.1", + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.4.0", + "@eslint/eslintrc": "^2.0.3", + "@eslint/js": "8.40.0", "@humanwhocodes/config-array": "^0.11.8", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", @@ -2042,11 +2493,10 @@ "debug": "^4.3.2", "doctrine": "^3.0.0", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^7.1.1", - "eslint-utils": "^3.0.0", - "eslint-visitor-keys": "^3.3.0", - "espree": "^9.4.0", - "esquery": "^1.4.0", + "eslint-scope": "^7.2.0", + "eslint-visitor-keys": "^3.4.1", + "espree": "^9.5.2", + "esquery": "^1.4.2", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", "file-entry-cache": "^6.0.1", @@ -2067,16 +2517,15 @@ "minimatch": "^3.1.2", "natural-compare": "^1.4.0", "optionator": "^0.9.1", - "regexpp": "^3.2.0", "strip-ansi": "^6.0.1", "strip-json-comments": "^3.1.0", "text-table": "^0.2.0" }, "dependencies": { "eslint-scope": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.1.tgz", - "integrity": "sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.0.tgz", + "integrity": "sha512-DYj5deGlHBfMt15J7rdtyKNq/Nqlv5KfU4iodrQ019XESsRnwXH9KAE0y3cwtUHDo2ob7CypAnCqefh6vioWRw==", "dev": true, "requires": { "esrecurse": "^4.3.0", @@ -2092,9 +2541,9 @@ } }, "eslint-config-prettier": { - "version": "8.6.0", - "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.6.0.tgz", - "integrity": "sha512-bAF0eLpLVqP5oEVUFKpMA+NnRFICwn9X8B5jrR9FcqnYBuPbqWEjTEspPWMj5ye6czoSLDweCzSo3Ko7gGrZaA==", + "version": "8.8.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.8.0.tgz", + "integrity": "sha512-wLbQiFre3tdGgpDv67NQKnJuTlcUVYHas3k+DZCc2U2BadthoEY4B7hLPvAxaqdyOGCzuLfii2fqGph10va7oA==", "dev": true, "requires": {} }, @@ -2117,44 +2566,27 @@ "estraverse": "^4.1.1" } }, - "eslint-utils": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", - "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", - "dev": true, - "requires": { - "eslint-visitor-keys": "^2.0.0" - }, - "dependencies": { - "eslint-visitor-keys": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", - "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", - "dev": true - } - } - }, "eslint-visitor-keys": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz", - "integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==", + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.1.tgz", + "integrity": "sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA==", "dev": true }, "espree": { - "version": "9.4.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.4.1.tgz", - "integrity": "sha512-XwctdmTO6SIvCzd9810yyNzIrOrqNYV9Koizx4C/mRhf9uq0o4yHoCEU/670pOxOL/MSraektvSAji79kX90Vg==", + "version": "9.5.2", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.5.2.tgz", + "integrity": "sha512-7OASN1Wma5fum5SrNhFMAMJxOUAbhyfQ8dQ//PJaJbNw0URTPWqIghHWt1MmAANKhHZIYOHruW4Kw4ruUWOdGw==", "dev": true, "requires": { "acorn": "^8.8.0", "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^3.3.0" + "eslint-visitor-keys": "^3.4.1" } }, "esquery": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", - "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", + "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", "dev": true, "requires": { "estraverse": "^5.1.0" @@ -2309,6 +2741,16 @@ "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==", "dev": true }, + "foreground-child": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.1.1.tgz", + "integrity": "sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==", + "dev": true, + "requires": { + "cross-spawn": "^7.0.0", + "signal-exit": "^4.0.1" + } + }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -2417,6 +2859,12 @@ "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", "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 + }, "is-glob": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", @@ -2444,6 +2892,16 @@ "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", "dev": true }, + "jackspeak": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-2.2.0.tgz", + "integrity": "sha512-r5XBrqIJfwRIjRt/Xr5fv9Wh09qyhHfKnYddDlpM+ibRR20qrYActpCAgU6U+d53EOEjzkvxPMVHSlgR7leXrQ==", + "dev": true, + "requires": { + "@isaacs/cliui": "^8.0.2", + "@pkgjs/parseargs": "^0.11.0" + } + }, "js-sdsl": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.3.0.tgz", @@ -2530,6 +2988,12 @@ "brace-expansion": "^1.1.7" } }, + "minipass": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", + "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", + "dev": true + }, "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -2616,6 +3080,24 @@ "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", "dev": true }, + "path-scurry": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.8.0.tgz", + "integrity": "sha512-IjTrKseM404/UAWA8bBbL3Qp6O2wXkanuIE3seCxBH7ctRuvH1QRawy1N3nVDHGkdeZsjOsSe/8AQBL/VQCy2g==", + "dev": true, + "requires": { + "lru-cache": "^9.1.1", + "minipass": "^5.0.0" + }, + "dependencies": { + "lru-cache": { + "version": "9.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-9.1.1.tgz", + "integrity": "sha512-65/Jky17UwSb0BuB9V+MyDpsOtXKmYwzhyl+cOa9XUiI4uV2Ouy/2voFP3+al0BjZbJgMBD8FojMpAf+Z+qn4A==", + "dev": true + } + } + }, "path-type": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", @@ -2635,9 +3117,9 @@ "dev": true }, "prettier": { - "version": "2.8.4", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.4.tgz", - "integrity": "sha512-vIS4Rlc2FNh0BySk3Wkd6xmwxB0FpOndW5fisM5H8hsZSxU2VWVB5CWIkIjWvrHjIhxk2g3bfMKM87zNTrZddw==", + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", + "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", "dev": true }, "prettier-linter-helpers": { @@ -2661,12 +3143,6 @@ "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", "dev": true }, - "regexpp": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", - "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", - "dev": true - }, "resolve-from": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", @@ -2680,10 +3156,46 @@ "dev": true }, "rimraf": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-4.1.2.tgz", - "integrity": "sha512-BlIbgFryTbw3Dz6hyoWFhKk+unCcHMSkZGrTFVAx2WmttdBSonsdtRlwiuTbDqTKr+UlXIUqJVS4QT5tUzGENQ==", - "dev": true + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-5.0.0.tgz", + "integrity": "sha512-Jf9llaP+RvaEVS5nPShYFhtXIrb3LRKP281ib3So0KkeZKo2wIKyq0Re7TOSwanasA423PSr6CCIL4bP6T040g==", + "dev": true, + "requires": { + "glob": "^10.0.0" + }, + "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==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0" + } + }, + "glob": { + "version": "10.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.2.3.tgz", + "integrity": "sha512-Kb4rfmBVE3eQTAimgmeqc2LwSnN0wIOkkUL6HmxEFxNJ4fHghYHVbFba/HcGcRjE6s9KoMNK3rSOwkL4PioZjg==", + "dev": true, + "requires": { + "foreground-child": "^3.1.0", + "jackspeak": "^2.0.3", + "minimatch": "^9.0.0", + "minipass": "^5.0.0", + "path-scurry": "^1.7.0" + } + }, + "minimatch": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.0.tgz", + "integrity": "sha512-0jJj8AvgKqWN05mrwuqi8QYKx1WmYSUoKSxu5Qhs9prezTz10sxAHGNZe9J9cqIJzta8DWsleh2KaVaLl6Ru2w==", + "dev": true, + "requires": { + "brace-expansion": "^2.0.1" + } + } + } }, "run-parallel": { "version": "1.2.0", @@ -2718,12 +3230,65 @@ "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", "dev": true }, + "signal-exit": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.0.2.tgz", + "integrity": "sha512-MY2/qGx4enyjprQnFaZsHib3Yadh3IXyV2C321GY0pjGfVBu4un0uDJkwgdxqO+Rdx8JMT8IfJIRwbYVz3Ob3Q==", + "dev": true + }, "slash": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "dev": true }, + "string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dev": true, + "requires": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "dependencies": { + "ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "dev": true + }, + "strip-ansi": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.0.1.tgz", + "integrity": "sha512-cXNxvT8dFNRVfhVME3JAe98mkXDYN2O1l7jmcwMnOslDeESg1rF/OZMtK0nRAhiari1unG5cD4jG3rapUAkLbw==", + "dev": true, + "requires": { + "ansi-regex": "^6.0.1" + } + } + } + }, + "string-width-cjs": { + "version": "npm:string-width@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" + }, + "dependencies": { + "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==", + "dev": true + } + } + }, "strip-ansi": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", @@ -2733,6 +3298,15 @@ "ansi-regex": "^5.0.1" } }, + "strip-ansi-cjs": { + "version": "npm:strip-ansi@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" + } + }, "strip-json-comments": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", @@ -2794,9 +3368,9 @@ "dev": true }, "typescript": { - "version": "4.9.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", - "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.4.tgz", + "integrity": "sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==", "dev": true }, "uri-js": { @@ -2823,6 +3397,70 @@ "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", "dev": true }, + "wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "dev": true, + "requires": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "dependencies": { + "ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "dev": true + }, + "ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "dev": true + }, + "strip-ansi": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.0.1.tgz", + "integrity": "sha512-cXNxvT8dFNRVfhVME3JAe98mkXDYN2O1l7jmcwMnOslDeESg1rF/OZMtK0nRAhiari1unG5cD4jG3rapUAkLbw==", + "dev": true, + "requires": { + "ansi-regex": "^6.0.1" + } + } + } + }, + "wrap-ansi-cjs": { + "version": "npm:wrap-ansi@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" + }, + "dependencies": { + "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==", + "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" + } + } + } + }, "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", diff --git a/package.json b/package.json index 8b50149..a065f4a 100644 --- a/package.json +++ b/package.json @@ -8,13 +8,13 @@ "clean": "rimraf dist" }, "devDependencies": { - "@typescript-eslint/eslint-plugin": "^5.52.0", - "@typescript-eslint/parser": "^5.52.0", - "eslint": "^8.34.0", - "eslint-config-prettier": "^8.6.0", + "@typescript-eslint/eslint-plugin": "^5.59.5", + "@typescript-eslint/parser": "^5.59.5", + "eslint": "^8.40.0", + "eslint-config-prettier": "^8.8.0", "eslint-plugin-prettier": "^4.2.1", - "prettier": "^2.8.4", - "rimraf": "^4.1.2", - "typescript": "^4.9.5" + "prettier": "^2.8.8", + "rimraf": "^5.0.0", + "typescript": "^5.0.4" } } diff --git a/src/model/cubismmoc.ts b/src/model/cubismmoc.ts index e86833c..fdc77c6 100644 --- a/src/model/cubismmoc.ts +++ b/src/model/cubismmoc.ts @@ -5,7 +5,7 @@ * that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html. */ -import { CSM_ASSERT } from '../utils/cubismdebug'; +import { CSM_ASSERT, CubismLogError } from '../utils/cubismdebug'; import { CubismModel } from './cubismmodel'; /** @@ -17,8 +17,23 @@ export class CubismMoc { /** * Mocデータの作成 */ - public static create(mocBytes: ArrayBuffer): CubismMoc { + public static create( + mocBytes: ArrayBuffer, + shouldCheckMocConsistency: boolean + ): CubismMoc { let cubismMoc: CubismMoc = null; + + if (shouldCheckMocConsistency) { + // .moc3の整合性を確認 + const consistency = this.hasMocConsistency(mocBytes); + + if (!consistency) { + // 整合性が確認できなければ処理しない + CubismLogError(`Inconsistent MOC3.`); + return cubismMoc; + } + } + const moc: Live2DCubismCore.Moc = Live2DCubismCore.Moc.fromArrayBuffer(mocBytes); @@ -114,9 +129,9 @@ export class CubismMoc { * .moc3 の整合性を検証する */ public static hasMocConsistency(mocBytes: ArrayBuffer): boolean { - const hasMocConsistency = + const isConsistent = Live2DCubismCore.Moc.prototype.hasMocConsistency(mocBytes); - return hasMocConsistency === 1 ? true : false; + return isConsistent === 1 ? true : false; } _moc: Live2DCubismCore.Moc; // Mocデータ diff --git a/src/model/cubismmodel.ts b/src/model/cubismmodel.ts index 2b00596..7de03fe 100644 --- a/src/model/cubismmodel.ts +++ b/src/model/cubismmodel.ts @@ -20,8 +20,31 @@ import { CSM_ASSERT } from '../utils/cubismdebug'; * その色を保持する構造体 */ export class DrawableColorData { - isOverwritten = false; - Color: CubismTextureColor = new CubismTextureColor(); + constructor( + isOverwritten = false, + color: CubismTextureColor = new CubismTextureColor() + ) { + this.isOverwritten = isOverwritten; + this.Color = color; + } + + public isOverwritten: boolean; + public Color: CubismTextureColor; +} +/** + * @brief テクスチャの色をRGBAで扱うための構造体 + */ +export class PartColorData { + constructor( + isOverwritten = false, + color: CubismTextureColor = new CubismTextureColor() + ) { + this.isOverwritten = isOverwritten; + this.Color = color; + } + + public isOverwritten: boolean; + public Color: CubismTextureColor; } /** @@ -35,8 +58,8 @@ export class DrawableCullingData { * @param isCulling */ public constructor(isOverwritten = false, isCulling = false) { - isOverwritten = this.isOverwritten; - isCulling = this.isCulling; + this.isOverwritten = isOverwritten; + this.isCulling = isCulling; } public isOverwritten: boolean; @@ -214,6 +237,150 @@ export class CubismModel { this._userScreenColors.at(index).Color.B = b; this._userScreenColors.at(index).Color.A = a; } + /** + * partの乗算色を取得する + * @param partIndex partのインデックス + * @returns 指定したpartの乗算色 + */ + public getPartMultiplyColor(partIndex: number): CubismTextureColor { + return this._userPartMultiplyColors.at(partIndex).Color; + } + + /** + * partのスクリーン色を取得する + * @param partIndex partのインデックス + * @returns 指定したpartのスクリーン色 + */ + public getPartScreenColor(partIndex: number): CubismTextureColor { + return this._userPartScreenColors.at(partIndex).Color; + } + + /** + * partのOverwriteColor setter関数 + * @param partIndex partのインデックス + * @param r 設定する色のR値 + * @param g 設定する色のG値 + * @param b 設定する色のB値 + * @param a 設定する色のA値 + * @param partColors 設定するpartのカラーデータ配列 + * @param drawableColors partに関連するDrawableのカラーデータ配列 + */ + public setPartColor( + partIndex: number, + r: number, + g: number, + b: number, + a: number, + partColors: csmVector, + drawableColors: csmVector + ) { + partColors.at(partIndex).Color.R = r; + partColors.at(partIndex).Color.G = g; + partColors.at(partIndex).Color.B = b; + partColors.at(partIndex).Color.A = a; + + if (partColors.at(partIndex).isOverwritten) { + for ( + let i = 0; + i < this._partChildDrawables.at(partIndex).getSize(); + ++i + ) { + const drawableIndex = this._partChildDrawables.at(partIndex).at(i); + drawableColors.at(drawableIndex).Color.R = r; + drawableColors.at(drawableIndex).Color.G = g; + drawableColors.at(drawableIndex).Color.B = b; + drawableColors.at(drawableIndex).Color.A = a; + } + } + } + + /** + * 乗算色をセットする + * @param partIndex partのインデックス + * @param color 設定する乗算色(CubismTextureColor) + */ + public setPartMultiplyColorByTextureColor( + partIndex: number, + color: CubismTextureColor + ) { + this.setPartMultiplyColorByRGBA( + partIndex, + color.R, + color.G, + color.B, + color.A + ); + } + + /** + * 乗算色をセットする + * @param partIndex partのインデックス + * @param r 設定する乗算色のR値 + * @param g 設定する乗算色のG値 + * @param b 設定する乗算色のB値 + * @param a 設定する乗算色のA値 + */ + public setPartMultiplyColorByRGBA( + partIndex: number, + r: number, + g: number, + b: number, + a: number + ) { + this.setPartColor( + partIndex, + r, + g, + b, + a, + this._userPartMultiplyColors, + this._userMultiplyColors + ); + } + + /** + * スクリーン色をセットする + * @param partIndex partのインデックス + * @param color 設定するスクリーン色(CubismTextureColor) + */ + public setPartScreenColorByTextureColor( + partIndex: number, + color: CubismTextureColor + ) { + this.setPartScreenColorByRGBA( + partIndex, + color.R, + color.G, + color.B, + color.A + ); + } + + /** + * スクリーン色をセットする + * @param partIndex partのインデックス + * @param r 設定するスクリーン色のR値 + * @param g 設定するスクリーン色のG値 + * @param b 設定するスクリーン色のB値 + * @param a 設定するスクリーン色のA値 + */ + public setPartScreenColorByRGBA( + partIndex: number, + r: number, + g: number, + b: number, + a: number + ) { + this.setPartColor( + partIndex, + r, + g, + b, + a, + this._userPartScreenColors, + this._userScreenColors + ); + } /** * SDKから指定したモデルの乗算色を上書きするか @@ -270,7 +437,7 @@ export class CubismModel { public getOverwriteFlagForDrawableScreenColors( drawableindex: number ): boolean { - return this._userMultiplyColors.at(drawableindex).isOverwritten; + return this._userScreenColors.at(drawableindex).isOverwritten; } /** @@ -297,6 +464,97 @@ export class CubismModel { this._userScreenColors.at(drawableindex).isOverwritten = value; } + /** + * SDKからpartの乗算色を上書きするか + * @param partIndex partのインデックス + * @returns true -> SDKからの情報を優先する + * false -> モデルに設定されている色情報を使用 + */ + public getOverwriteColorForPartMultiplyColors(partIndex: number) { + return this._userPartMultiplyColors.at(partIndex).isOverwritten; + } + + /** + * SDKからpartのスクリーン色を上書きするか + * @param partIndex partのインデックス + * @returns true -> SDKからの情報を優先する + * false -> モデルに設定されている色情報を使用 + */ + public getOverwriteColorForPartScreenColors(partIndex: number) { + return this._userPartScreenColors.at(partIndex).isOverwritten; + } + + /** + * partのOverwriteFlag setter関数 + * @param partIndex partのインデックス + * @param value true -> SDKからの情報を優先する + * false -> モデルに設定されている色情報を使用 + * @param partColors 設定するpartのカラーデータ配列 + * @param drawableColors partに関連するDrawableのカラーデータ配列 + */ + public setOverwriteColorForPartColors( + partIndex: number, + value: boolean, + partColors: csmVector, + drawableColors: csmVector + ) { + partColors.at(partIndex).isOverwritten = value; + + for (let i = 0; i < this._partChildDrawables.at(partIndex).getSize(); ++i) { + const drawableIndex = this._partChildDrawables.at(partIndex).at(i); + drawableColors.at(drawableIndex).isOverwritten = value; + + if (value) { + drawableColors.at(drawableIndex).Color.R = + partColors.at(partIndex).Color.R; + drawableColors.at(drawableIndex).Color.G = + partColors.at(partIndex).Color.G; + drawableColors.at(drawableIndex).Color.B = + partColors.at(partIndex).Color.B; + drawableColors.at(drawableIndex).Color.A = + partColors.at(partIndex).Color.A; + } + } + } + + /** + * SDKからpartのスクリーン色を上書きするかをセットする + * @param partIndex partのインデックス + * @param value true -> SDKからの情報を優先する + * false -> モデルに設定されている色情報を使用 + */ + public setOverwriteColorForPartMultiplyColors( + partIndex: number, + value: boolean + ) { + this._userPartMultiplyColors.at(partIndex).isOverwritten = value; + this.setOverwriteColorForPartColors( + partIndex, + value, + this._userPartMultiplyColors, + this._userMultiplyColors + ); + } + + /** + * SDKからpartのスクリーン色を上書きするかをセットする + * @param partIndex partのインデックス + * @param value true -> SDKからの情報を優先する + * false -> モデルに設定されている色情報を使用 + */ + public setOverwriteColorForPartScreenColors( + partIndex: number, + value: boolean + ) { + this._userPartScreenColors.at(partIndex).isOverwritten = value; + this.setOverwriteColorForPartColors( + partIndex, + value, + this._userPartScreenColors, + this._userScreenColors + ); + } + /** * Drawableのカリング情報を取得する。 * @@ -370,6 +628,24 @@ export class CubismModel { this._userCullings.at(drawableIndex).isOverwritten = isOverwrittenCullings; } + /** + * モデルの不透明度を取得する + * + * @returns 不透明度の値 + */ + public getModelOapcity(): number { + return this._modelOpacity; + } + + /** + * モデルの不透明度を設定する + * + * @param value 不透明度の値 + */ + public setModelOapcity(value: number) { + this._modelOpacity = value; + } + /** * モデルを取得 */ @@ -405,6 +681,17 @@ export class CubismModel { return partIndex; } + /** + * パーツのIDを取得する。 + * + * @param partIndex 取得するパーツのインデックス + * @return パーツのID + */ + public getPartId(partIndex: number): CubismIdHandle { + const partId = this._model.parts.ids[partIndex]; + return CubismFramework.getIdManager().getId(partId); + } + /** * パーツの個数の取得 * @return パーツの個数 @@ -832,7 +1119,7 @@ export class CubismModel { /** * Drawableの頂点インデックスリストの取得 - * @param drarableIndex Drawableのインデックス + * @param drawableIndex Drawableのインデックス * @return drawableの頂点インデックスリスト */ public getDrawableVertexIndices(drawableIndex: number): Uint16Array { @@ -1106,9 +1393,9 @@ export class CubismModel { } } + const partCount: number = this._model.parts.count; { const partIds: string[] = this._model.parts.ids; - const partCount: number = this._model.parts.count; this._partIds.prepareCapacity(partCount); for (let i = 0; i < partCount; ++i) { @@ -1116,41 +1403,98 @@ export class CubismModel { CubismFramework.getIdManager().getId(partIds[i]) ); } + + this._userPartMultiplyColors.prepareCapacity(partCount); + this._userPartScreenColors.prepareCapacity(partCount); + + this._partChildDrawables.prepareCapacity(partCount); } { const drawableIds: string[] = this._model.drawables.ids; const drawableCount: number = this._model.drawables.count; - this._userMultiplyColors = new csmVector(); - this._userMultiplyColors.updateSize( - drawableCount, - DrawableColorData, - true - ); - - this._userScreenColors = new csmVector(); - this._userScreenColors.updateSize(drawableCount, DrawableColorData, true); + this._userMultiplyColors.prepareCapacity(drawableCount); + this._userScreenColors.prepareCapacity(drawableCount); // カリング設定 - this._userCullings = new csmVector(); - this._userCullings.updateSize(drawableCount, DrawableCullingData, true); + this._userCullings.prepareCapacity(drawableCount); const userCulling: DrawableCullingData = new DrawableCullingData( false, false ); - this._drawableIds.prepareCapacity(drawableCount); - for (let i = 0; i < drawableCount; ++i) { - this._drawableIds.pushBack( - CubismFramework.getIdManager().getId(drawableIds[i]) - ); + // Part + { + for (let i = 0; i < partCount; ++i) { + const multiplyColor: CubismTextureColor = new CubismTextureColor( + 1.0, + 1.0, + 1.0, + 1.0 + ); + const screenColor: CubismTextureColor = new CubismTextureColor( + 0.0, + 0.0, + 0.0, + 1.0 + ); - // shaderに影響しない色で初期化 - this.setMultiplyColorByRGBA(i, 1.0, 1.0, 1.0, 1.0); - this.setScreenColorByRGBA(i, 0.0, 0.0, 0.0, 1.0); + const userMultiplyColor: PartColorData = new PartColorData( + false, + multiplyColor + ); + const userScreenColor: PartColorData = new PartColorData( + false, + screenColor + ); - this._userCullings.pushBack(userCulling); + this._userPartMultiplyColors.pushBack(userMultiplyColor); + this._userPartScreenColors.pushBack(userScreenColor); + this._partChildDrawables.pushBack(new csmVector()); + this._partChildDrawables.at(i).prepareCapacity(drawableCount); + } + } + + // Drawables + { + for (let i = 0; i < drawableCount; ++i) { + const multiplyColor: CubismTextureColor = new CubismTextureColor( + 1.0, + 1.0, + 1.0, + 1.0 + ); + const screenColor: CubismTextureColor = new CubismTextureColor( + 0.0, + 0.0, + 0.0, + 1.0 + ); + + const userMultiplyColor: DrawableColorData = new DrawableColorData( + false, + multiplyColor + ); + const userScreenColor: DrawableColorData = new DrawableColorData( + false, + screenColor + ); + + this._drawableIds.pushBack( + CubismFramework.getIdManager().getId(drawableIds[i]) + ); + + this._userMultiplyColors.pushBack(userMultiplyColor); + this._userScreenColors.pushBack(userScreenColor); + + this._userCullings.pushBack(userCulling); + + const parentIndex = this.getDrawableParentPartIndex(i); + if (parentIndex >= 0) { + this._partChildDrawables.at(parentIndex).pushBack(i); + } + } } } } @@ -1172,8 +1516,14 @@ export class CubismModel { this._isOverwrittenModelMultiplyColors = false; this._isOverwrittenModelScreenColors = false; this._isOverwrittenCullings = false; - this._userMultiplyColors = null; - this._userScreenColors = null; + this._modelOpacity = 1.0; + + this._userMultiplyColors = new csmVector(); + this._userScreenColors = new csmVector(); + this._userCullings = new csmVector(); + this._userPartMultiplyColors = new csmVector(); + this._userPartScreenColors = new csmVector(); + this._partChildDrawables = new csmVector>(); this._notExistPartId = new csmMap(); this._notExistParameterId = new csmMap(); @@ -1201,6 +1551,9 @@ export class CubismModel { private _isOverwrittenModelScreenColors: boolean; // SDK上でモデル全体のスクリーン色を上書きするか判定するフラグ private _userMultiplyColors: csmVector; // Drawableごとに設定する乗算色と上書きフラグを管理するリスト private _userScreenColors: csmVector; // Drawableごとに設定するスクリーン色と上書きフラグを管理するリスト + private _userPartScreenColors: csmVector; // Part 乗算色の配列 + private _userPartMultiplyColors: csmVector; // Part スクリーン色の配列 + private _partChildDrawables: csmVector>; // Partの子DrawableIndexの配列 private _model: Live2DCubismCore.Model; // モデル @@ -1210,6 +1563,8 @@ export class CubismModel { private _partOpacities: Float32Array; // パーツの不透明度のリスト + private _modelOpacity: number; // モデルの不透明度 + private _parameterIds: csmVector; private _partIds: csmVector; private _drawableIds: csmVector; diff --git a/src/model/cubismusermodel.ts b/src/model/cubismusermodel.ts index fed0c47..ba5c4f7 100644 --- a/src/model/cubismusermodel.ts +++ b/src/model/cubismusermodel.ts @@ -127,8 +127,8 @@ export class CubismUserModel { * * @param buffer moc3ファイルが読み込まれているバッファ */ - public loadModel(buffer: ArrayBuffer) { - this._moc = CubismMoc.create(buffer); + public loadModel(buffer: ArrayBuffer, shouldCheckMocConsistency = false) { + this._moc = CubismMoc.create(buffer, shouldCheckMocConsistency); if (this._moc == null) { CubismLogError('Failed to CubismMoc.create().'); @@ -359,6 +359,7 @@ export class CubismUserModel { this._accelerationX = 0.0; this._accelerationY = 0.0; this._accelerationZ = 0.0; + this._mocConsistency = false; this._debugMode = false; this._renderer = null; @@ -433,6 +434,7 @@ export class CubismUserModel { protected _accelerationX: number; // X軸方向の加速度 protected _accelerationY: number; // Y軸方向の加速度 protected _accelerationZ: number; // Z軸方向の加速度 + protected _mocConsistency: boolean; // MOC3一貫性検証するかどうか protected _debugMode: boolean; // デバッグモードかどうか private _renderer: CubismRenderer_WebGL; // レンダラ diff --git a/src/motion/acubismmotion.ts b/src/motion/acubismmotion.ts index 3afcad2..dfa263b 100644 --- a/src/motion/acubismmotion.ts +++ b/src/motion/acubismmotion.ts @@ -258,6 +258,46 @@ export abstract class ACubismMotion { */ public getFinishedMotionHandler = () => this._onFinishedMotion; + /** + * 透明度のカーブが存在するかどうかを確認する + * + * @returns true -> キーが存在する + * false -> キーが存在しない + */ + public isExistModelOpacity(): boolean { + return false; + } + + /** + * 透明度のカーブのインデックスを返す + * + * @returns success:透明度のカーブのインデックス + */ + public getModelOpacityIndex(): number { + return -1; + } + + /** + * 透明度のIdを返す + * + * @param index モーションカーブのインデックス + * @returns success:透明度のId + */ + public getModelOpacityId(index: number): CubismIdHandle { + return null; + } + + /** + * 指定時間の透明度の値を返す + * + * @returns success:モーションの現在時間におけるOpacityの値 + * + * @note 更新後の値を取るにはUpdateParameters() の後に呼び出す。 + */ + protected getModelOpacityValue(): number { + return 1.0; + } + public _fadeInSeconds: number; // フェードインにかかる時間[秒] public _fadeOutSeconds: number; // フェードアウトにかかる時間[秒] public _weight: number; // モーションの重み @@ -271,6 +311,7 @@ export abstract class ACubismMotion { // Namespace definition for compatibility. import * as $ from './acubismmotion'; +import { CubismIdHandle } from '../id/cubismid'; // eslint-disable-next-line @typescript-eslint/no-namespace export namespace Live2DCubismFramework { export const ACubismMotion = $.ACubismMotion; diff --git a/src/motion/cubismexpressionmotion.ts b/src/motion/cubismexpressionmotion.ts index 9ca0678..06e4ead 100644 --- a/src/motion/cubismexpressionmotion.ts +++ b/src/motion/cubismexpressionmotion.ts @@ -42,69 +42,7 @@ export class CubismExpressionMotion extends ACubismMotion { size: number ): CubismExpressionMotion { const expression: CubismExpressionMotion = new CubismExpressionMotion(); - - const json: CubismJson = CubismJson.create(buffer, size); - const root: Value = json.getRoot(); - - expression.setFadeInTime( - root.getValueByString(ExpressionKeyFadeIn).toFloat(DefaultFadeTime) - ); // フェードイン - expression.setFadeOutTime( - root.getValueByString(ExpressionKeyFadeOut).toFloat(DefaultFadeTime) - ); // フェードアウト - - // 各パラメータについて - const parameterCount = root - .getValueByString(ExpressionKeyParameters) - .getSize(); - expression._parameters.prepareCapacity(parameterCount); - - for (let i = 0; i < parameterCount; ++i) { - const param: Value = root - .getValueByString(ExpressionKeyParameters) - .getValueByIndex(i); - const parameterId: CubismIdHandle = CubismFramework.getIdManager().getId( - param.getValueByString(ExpressionKeyId).getRawString() - ); // パラメータID - - const value: number = param - .getValueByString(ExpressionKeyValue) - .toFloat(); // 値 - - // 計算方法の設定 - let blendType: ExpressionBlendType; - - if ( - param.getValueByString(ExpressionKeyBlend).isNull() || - param.getValueByString(ExpressionKeyBlend).getString() == BlendValueAdd - ) { - blendType = ExpressionBlendType.ExpressionBlendType_Add; - } else if ( - param.getValueByString(ExpressionKeyBlend).getString() == - BlendValueMultiply - ) { - blendType = ExpressionBlendType.ExpressionBlendType_Multiply; - } else if ( - param.getValueByString(ExpressionKeyBlend).getString() == - BlendValueOverwrite - ) { - blendType = ExpressionBlendType.ExpressionBlendType_Overwrite; - } else { - // その他 仕様にない値を設定した時は加算モードにすることで復旧 - blendType = ExpressionBlendType.ExpressionBlendType_Add; - } - - // 設定オブジェクトを作成してリストに追加する - const item: ExpressionParameter = new ExpressionParameter(); - - item.parameterId = parameterId; - item.blendType = blendType; - item.value = value; - - expression._parameters.pushBack(item); - } - - CubismJson.delete(json); // JSONデータは不要になったら削除する + expression.parse(buffer, size); return expression; } @@ -156,10 +94,75 @@ export class CubismExpressionMotion extends ACubismMotion { } } + protected parse(buffer: ArrayBuffer, size: number) { + const json: CubismJson = CubismJson.create(buffer, size); + const root: Value = json.getRoot(); + + this.setFadeInTime( + root.getValueByString(ExpressionKeyFadeIn).toFloat(DefaultFadeTime) + ); // フェードイン + this.setFadeOutTime( + root.getValueByString(ExpressionKeyFadeOut).toFloat(DefaultFadeTime) + ); // フェードアウト + + // 各パラメータについて + const parameterCount = root + .getValueByString(ExpressionKeyParameters) + .getSize(); + this._parameters.prepareCapacity(parameterCount); + + for (let i = 0; i < parameterCount; ++i) { + const param: Value = root + .getValueByString(ExpressionKeyParameters) + .getValueByIndex(i); + const parameterId: CubismIdHandle = CubismFramework.getIdManager().getId( + param.getValueByString(ExpressionKeyId).getRawString() + ); // パラメータID + + const value: number = param + .getValueByString(ExpressionKeyValue) + .toFloat(); // 値 + + // 計算方法の設定 + let blendType: ExpressionBlendType; + + if ( + param.getValueByString(ExpressionKeyBlend).isNull() || + param.getValueByString(ExpressionKeyBlend).getString() == BlendValueAdd + ) { + blendType = ExpressionBlendType.ExpressionBlendType_Add; + } else if ( + param.getValueByString(ExpressionKeyBlend).getString() == + BlendValueMultiply + ) { + blendType = ExpressionBlendType.ExpressionBlendType_Multiply; + } else if ( + param.getValueByString(ExpressionKeyBlend).getString() == + BlendValueOverwrite + ) { + blendType = ExpressionBlendType.ExpressionBlendType_Overwrite; + } else { + // その他 仕様にない値を設定した時は加算モードにすることで復旧 + blendType = ExpressionBlendType.ExpressionBlendType_Add; + } + + // 設定オブジェクトを作成してリストに追加する + const item: ExpressionParameter = new ExpressionParameter(); + + item.parameterId = parameterId; + item.blendType = blendType; + item.value = value; + + this._parameters.pushBack(item); + } + + CubismJson.delete(json); // JSONデータは不要になったら削除する + } + /** * コンストラクタ */ - constructor() { + protected constructor() { super(); this._parameters = new csmVector(); diff --git a/src/motion/cubismmotion.ts b/src/motion/cubismmotion.ts index 85a8d82..640d6b2 100644 --- a/src/motion/cubismmotion.ts +++ b/src/motion/cubismmotion.ts @@ -35,6 +35,9 @@ const TargetNameModel = 'Model'; const TargetNameParameter = 'Parameter'; const TargetNamePartOpacity = 'PartOpacity'; +// Id +const IdNameOpacity = 'Opacity'; + /** * Cubism SDK R2 以前のモーションを再現させるなら true 、アニメータのモーションを正しく再現するなら false 。 */ @@ -284,6 +287,11 @@ export class CubismMotion extends ACubismMotion { CubismFramework.getIdManager().getId(EffectNameLipSync); } + if (this._modelCurveIdOpacity == null) { + this._modelCurveIdOpacity = + CubismFramework.getIdManager().getId(IdNameOpacity); + } + let timeOffsetSeconds: number = userTimeSeconds - motionQueueEntry.getStartTime(); @@ -357,6 +365,9 @@ export class CubismMotion extends ACubismMotion { eyeBlinkValue = value; } else if (curves.at(c).id == this._modelCurveIdLipSync) { lipSyncValue = value; + } else if (curves.at(c).id == this._modelCurveIdOpacity) { + this._modelOpacity = value; + model.setModelOapcity(this.getModelOpacityValue()); } } @@ -696,8 +707,10 @@ export class CubismMotion extends ACubismMotion { this._motionData = null; this._modelCurveIdEyeBlink = null; this._modelCurveIdLipSync = null; + this._modelCurveIdOpacity = null; this._eyeBlinkParameterIds = null; this._lipSyncParameterIds = null; + this._modelOpacity = 1.0; } /** @@ -971,6 +984,81 @@ export class CubismMotion extends ACubismMotion { return this._firedEventValues; } + /** + * 透明度のカーブが存在するかどうかを確認する + * + * @returns true -> キーが存在する + * false -> キーが存在しない + */ + public isExistModelOpacity(): boolean { + for (let i = 0; i < this._motionData.curveCount; i++) { + const curve: CubismMotionCurve = this._motionData.curves.at(i); + + if (curve.type != CubismMotionCurveTarget.CubismMotionCurveTarget_Model) { + continue; + } + + if (curve.id.getString().s.localeCompare(IdNameOpacity) == 0) { + return true; + } + } + + return false; + } + + /** + * 透明度のカーブのインデックスを返す + * + * @returns success:透明度のカーブのインデックス + */ + public getModelOpacityIndex(): number { + if (this.isExistModelOpacity()) { + for (let i = 0; i < this._motionData.curveCount; i++) { + const curve: CubismMotionCurve = this._motionData.curves.at(i); + + if ( + curve.type != CubismMotionCurveTarget.CubismMotionCurveTarget_Model + ) { + continue; + } + + if (curve.id.getString().s.localeCompare(IdNameOpacity) == 0) { + return i; + } + } + } + return -1; + } + + /** + * 透明度のIdを返す + * + * @param index モーションカーブのインデックス + * @returns success:透明度のカーブのインデックス + */ + public getModelOpacityId(index: number): CubismIdHandle { + if (index != -1) { + const curve: CubismMotionCurve = this._motionData.curves.at(index); + + if (curve.type == CubismMotionCurveTarget.CubismMotionCurveTarget_Model) { + if (curve.id.getString().s.localeCompare(IdNameOpacity) == 0) { + return CubismFramework.getIdManager().getId(curve.id.getString().s); + } + } + } + + return null; + } + + /** + * 現在時間の透明度の値を返す + * + * @returns success:モーションの当該時間におけるOpacityの値 + */ + public getModelOpacityValue(): number { + return this._modelOpacity; + } + public _sourceFrameRate: number; // ロードしたファイルのFPS。記述が無ければデフォルト値15fpsとなる public _loopDurationSeconds: number; // mtnファイルで定義される一連のモーションの長さ public _isLoop: boolean; // ループするか? @@ -984,6 +1072,9 @@ export class CubismMotion extends ACubismMotion { public _modelCurveIdEyeBlink: CubismIdHandle; // モデルが持つ自動まばたき用パラメータIDのハンドル。 モデルとモーションを対応付ける。 public _modelCurveIdLipSync: CubismIdHandle; // モデルが持つリップシンク用パラメータIDのハンドル。 モデルとモーションを対応付ける。 + public _modelCurveIdOpacity: CubismIdHandle; // モデルが持つ不透明度用パラメータIDのハンドル。 モデルとモーションを対応付ける。 + + public _modelOpacity: number; // モーションから取得した不透明度 } // Namespace definition for compatibility. diff --git a/src/physics/cubismphysics.ts b/src/physics/cubismphysics.ts index e4ef0e1..1fa23d8 100644 --- a/src/physics/cubismphysics.ts +++ b/src/physics/cubismphysics.ts @@ -186,8 +186,8 @@ export class CubismPhysics { for (let j = 0; j < this._physicsRig.settings.at(i).outputCount; ++j) { // initialize - currentRigOutput.outputs[j] = 0.0; - previousRigOutput.outputs[j] = 0.0; + currentRigOutput.outputs.set(j, 0.0); + previousRigOutput.outputs.set(j, 0.0); this._physicsRig.outputs.at(outputIndex + j).destinationParameterIndex = -1; @@ -395,8 +395,8 @@ export class CubismPhysics { this._options.gravity ); - this._currentRigOutputs.at(settingIndex).outputs[i] = outputValue; - this._previousRigOutputs.at(settingIndex).outputs[i] = outputValue; + this._currentRigOutputs.at(settingIndex).outputs.set(i, outputValue); + this._previousRigOutputs.at(settingIndex).outputs.set(i, outputValue); const destinationParameterIndex: number = currentOutputs[i].destinationParameterIndex; @@ -532,8 +532,12 @@ export class CubismPhysics { currentSetting.baseOutputIndex ); for (let i = 0; i < currentSetting.outputCount; ++i) { - this._previousRigOutputs.at(settingIndex).outputs[i] = - this._currentRigOutputs.at(settingIndex).outputs[i]; + this._previousRigOutputs + .at(settingIndex) + .outputs.set( + i, + this._currentRigOutputs.at(settingIndex).outputs.at(i) + ); } } @@ -645,7 +649,7 @@ export class CubismPhysics { this._options.gravity ); - this._currentRigOutputs.at(settingIndex).outputs[i] = outputValue; + this._currentRigOutputs.at(settingIndex).outputs.set(i, outputValue); const destinationParameterIndex: number = currentOutputs[i].destinationParameterIndex; @@ -732,8 +736,9 @@ export class CubismPhysics { outParameterValues, parameterMinimumValues[destinationParameterIndex], parameterMaximumValues[destinationParameterIndex], - this._previousRigOutputs.at(settingIndex).outputs[i] * (1 - weight) + - this._currentRigOutputs.at(settingIndex).outputs[i] * weight, + this._previousRigOutputs.at(settingIndex).outputs.at(i) * + (1 - weight) + + this._currentRigOutputs.at(settingIndex).outputs.at(i) * weight, currentOutputs[i] ); diff --git a/src/rendering/cubismrenderer.ts b/src/rendering/cubismrenderer.ts index d6da43e..fadc69b 100644 --- a/src/rendering/cubismrenderer.ts +++ b/src/rendering/cubismrenderer.ts @@ -288,11 +288,11 @@ export class CubismTextureColor { /** * コンストラクタ */ - constructor() { - this.R = 1.0; - this.G = 1.0; - this.B = 1.0; - this.A = 1.0; + constructor(r = 1.0, g = 1.0, b = 1.0, a = 1.0) { + this.R = r; + this.G = g; + this.B = b; + this.A = a; } R: number; // 赤チャンネル diff --git a/src/rendering/cubismrenderer_webgl.ts b/src/rendering/cubismrenderer_webgl.ts index 93590d1..af5909a 100644 --- a/src/rendering/cubismrenderer_webgl.ts +++ b/src/rendering/cubismrenderer_webgl.ts @@ -478,7 +478,7 @@ export class CubismClippingManager_WebGL { index < this._clearedFrameBufferflags.getSize(); index++ ) { - this._clearedFrameBufferflags[index] = false; + this._clearedFrameBufferflags.set(index, false); } // 実際にマスクを生成する @@ -626,12 +626,12 @@ export class CubismClippingManager_WebGL { ); // マスクがクリアされていないなら処理する - if (!this._clearedFrameBufferflags[clipContext._bufferIndex]) { + if (!this._clearedFrameBufferflags.at(clipContext._bufferIndex)) { // マスクをクリアする // (仮仕様) 1が無効(描かれない)領域、0が有効(描かれる)領域。(シェーダーCd*Csで0に近い値をかけてマスクを作る。1をかけると何も起こらない) this.gl.clearColor(1.0, 1.0, 1.0, 1.0); this.gl.clear(this.gl.COLOR_BUFFER_BIT); - this._clearedFrameBufferflags[clipContext._bufferIndex] = true; + this._clearedFrameBufferflags.set(clipContext._bufferIndex, true); } // 今回専用の変換を適用して描く diff --git a/src/utils/cubismjson.ts b/src/utils/cubismjson.ts index 728d479..6c8e362 100644 --- a/src/utils/cubismjson.ts +++ b/src/utils/cubismjson.ts @@ -214,6 +214,8 @@ export abstract class Value { public static errorValue: Value; // 一時的な返り値として返すエラー。 CubismFramework::Disposeするまではdeleteしない public static nullValue: Value; // 一時的な返り値として返すNULL。 CubismFramework::Disposeするまではdeleteしない + + [key: string]: any; // 明示的に連想配列をany型で指定 } /** diff --git a/src/utils/cubismjsonextension.ts b/src/utils/cubismjsonextension.ts index 7d3b533..98c99ee 100644 --- a/src/utils/cubismjsonextension.ts +++ b/src/utils/cubismjsonextension.ts @@ -25,11 +25,14 @@ export class CubismJsonExtension { static parseJsonObject(obj: Value, map: JsonMap) { Object.keys(obj).forEach((key) => { if (typeof obj[key] == 'boolean') { - map.put(key, new JsonBoolean(obj[key])); + const convValue = Boolean(obj[key]); + map.put(key, new JsonBoolean(convValue)); } else if (typeof obj[key] == 'string') { - map.put(key, new JsonString(obj[key])); + const convValue = String(obj[key]); + map.put(key, new JsonString(convValue)); } else if (typeof obj[key] == 'number') { - map.put(key, new JsonFloat(obj[key])); + const convValue = Number(obj[key]); + map.put(key, new JsonFloat(convValue)); } else if (obj[key] instanceof Array) { map.put(key, CubismJsonExtension.parseJsonArray(obj[key])); } else if (obj[key] instanceof Object) { @@ -52,12 +55,15 @@ export class CubismJsonExtension { Object.keys(obj).forEach((key) => { const convKey = Number(key); if (typeof convKey == 'number') { - if (typeof obj[convKey] == 'boolean') { - arr.add(new JsonBoolean(obj[convKey])); - } else if (typeof obj[convKey] == 'string') { - arr.add(new JsonString(obj[convKey])); - } else if (typeof obj[convKey] == 'number') { - arr.add(new JsonFloat(obj[convKey])); + if (typeof obj[key] == 'boolean') { + const convValue = Boolean(obj[key]); + arr.add(new JsonBoolean(convValue)); + } else if (typeof obj[key] == 'string') { + const convValue = String(obj[key]); + arr.add(new JsonString(convValue)); + } else if (typeof obj[key] == 'number') { + const convValue = Number(obj[key]); + arr.add(new JsonFloat(convValue)); } else if (obj[key] instanceof Array) { arr.add(this.parseJsonArray(obj[key])); } else if (obj[key] instanceof Object) { @@ -75,9 +81,10 @@ export class CubismJsonExtension { } else if (obj[key] == null) { arr.add(new JsonNullvalue()); } else { + const convValue = Array(obj[key]); // 配列ともObjectとも判定できなかった場合でも処理する - for (let i = 0; i < obj[key].length; i++) { - arr.add(obj[key][i]); + for (let i = 0; i < convValue.length; i++) { + arr.add(convValue[i]); } } }); diff --git a/tsconfig.json b/tsconfig.json index f9f9789..615e8dc 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -9,7 +9,9 @@ "declaration": true, "declarationMap": true, "sourceMap": true, - "emitDecoratorMetadata": true + "emitDecoratorMetadata": true, + "noImplicitAny": true, + "useUnknownInCatchVariables": true }, "include": [ "src/**/*.ts",