diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b3f7d01..a92794f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -30,7 +30,7 @@ jobs: strategy: matrix: os: [windows-latest, ubuntu-latest, macos-latest] - node: [16] + node: [22] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 diff --git a/eo2js-runtime/.eslintrc.json b/eo2js-runtime/.eslintrc.json deleted file mode 100644 index 7c94be9..0000000 --- a/eo2js-runtime/.eslintrc.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "env": { - "es6": true - }, - "extends": "google", - "rules": { - "semi": "off", - "comma-dangle": "off", - "indent": [ "error", 2 ], - "camelcase": "off", - "max-len": [ "error", { "code": 300 } ] - }, - "parserOptions": { - "ecmaVersion": 2019 - } -} diff --git a/eo2js-runtime/Gruntfile.js b/eo2js-runtime/Gruntfile.js index 793d6ae..43fd118 100644 --- a/eo2js-runtime/Gruntfile.js +++ b/eo2js-runtime/Gruntfile.js @@ -7,13 +7,13 @@ module.exports = function(grunt) { options: { timeout: '1200000', require: ['test/global.js'], - files: ['test/**/*.test.js'], + files: ['test/regular.js'], }, }, }, eslint: { options: { - overrideConfigFile: '.eslintrc.json', + overrideConfigFile: 'eslint.config.js', }, target: ['Gruntfile.js', 'src/**/*.js', 'test/**/*.js'], }, diff --git a/eo2js-runtime/eslint.config.js b/eo2js-runtime/eslint.config.js new file mode 100644 index 0000000..2434ea1 --- /dev/null +++ b/eo2js-runtime/eslint.config.js @@ -0,0 +1,36 @@ +const js = require('@eslint/js') +const jsdoc = require('eslint-plugin-jsdoc') +const globals = require('globals') + +module.exports = [ + js.configs.recommended, + jsdoc.configs['flat/recommended'], + { + plugins: { + jsdoc + }, + files: ["**/*.js"], + rules: { + "jsdoc/require-description": "error", + "jsdoc/check-values": "error" + } + }, + { + rules: { + semi: 'off', + 'comma-dangle': 'off', + indent: ['error', 2], + camelcase: 'off', + 'max-len': ['error', {'code': 300}], + 'no-unused-vars': ['error', {argsIgnorePattern: '^_'}], + }, + languageOptions: { + globals: { + ...globals.node, + ...globals.mocha, + }, + ecmaVersion: 'latest', + sourceType: 'commonjs', + } + } +] \ No newline at end of file diff --git a/eo2js-runtime/package-lock.json b/eo2js-runtime/package-lock.json index 09a0576..8bc296d 100644 --- a/eo2js-runtime/package-lock.json +++ b/eo2js-runtime/package-lock.json @@ -10,12 +10,30 @@ "license": "MIT", "devDependencies": { "eslint": "9.5.0", - "eslint-config-google": "0.14.0", + "eslint-plugin-jsdoc": "^48.5.0", "grunt": "1.6.1", "grunt-contrib-clean": "2.0.1", - "grunt-eslint": "24.3.0", + "grunt-eslint": "25.0.0", "grunt-mocha-cli": "^7.0.0", - "mocha": "^10.2.0" + "mocha": "^10.5.2" + } + }, + "node_modules/@es-joy/jsdoccomment": { + "version": "0.43.1", + "resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.43.1.tgz", + "integrity": "sha512-I238eDtOolvCuvtxrnqtlBaw0BwdQuYqK7eA6XIonicMdOOOb75mqdIzkGDUbS04+1Di007rgm9snFRNeVrOog==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/eslint": "^8.56.5", + "@types/estree": "^1.0.5", + "@typescript-eslint/types": "^7.2.0", + "comment-parser": "1.4.1", + "esquery": "^1.5.0", + "jsdoc-type-pratt-parser": "~4.0.0" + }, + "engines": { + "node": ">=16" } }, "node_modules/@eslint-community/eslint-utils": { @@ -160,12 +178,6 @@ "url": "https://github.com/sponsors/nzakas" } }, - "node_modules/@humanwhocodes/object-schema": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz", - "integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==", - "dev": true - }, "node_modules/@humanwhocodes/retry": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.3.0.tgz", @@ -215,6 +227,58 @@ "node": ">= 8" } }, + "node_modules/@pkgr/core": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@pkgr/core/-/core-0.1.1.tgz", + "integrity": "sha512-cq8o4cWH0ibXh9VGi5P20Tu9XF/0fFXl9EUinr9QfTM7a7p0oTA4iJRCQWppXR1Pg8dSM0UCItCkPwsk9qWWYA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.20.0 || ^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/unts" + } + }, + "node_modules/@types/eslint": { + "version": "8.56.10", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.56.10.tgz", + "integrity": "sha512-Shavhk87gCtY2fhXDctcfS3e6FdxWkCx1iUZ9eEUbh7rTqlZT0/IzOkCOVt0fCjcFuZ9FPYfuezTBImfHCDBGQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "*", + "@types/json-schema": "*" + } + }, + "node_modules/@types/estree": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", + "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/json-schema": { + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@typescript-eslint/types": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.14.1.tgz", + "integrity": "sha512-mL7zNEOQybo5R3AavY+Am7KLv8BorIv7HCYS5rKoNZKQD9tsfGUpO4KdAn3sSUvTiS4PQkr2+K0KJbxj8H9NDg==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, "node_modules/@ungap/promise-all-settled": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz", @@ -222,13 +286,6 @@ "dev": true, "license": "ISC" }, - "node_modules/@ungap/structured-clone": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", - "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", - "dev": true, - "license": "ISC" - }, "node_modules/abbrev": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", @@ -320,6 +377,16 @@ "node": ">= 8" } }, + "node_modules/are-docs-informative": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/are-docs-informative/-/are-docs-informative-0.0.2.tgz", + "integrity": "sha512-ixiS0nLNNG5jNQzgZJNoUpBKdo9yTYZMGJ+QgT2jmjR7G7+QHRCc4v6LQ3NgE7EBJq+o0ams3waJwkrlBom8Ig==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14" + } + }, "node_modules/argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", @@ -509,6 +576,16 @@ "node": ">=0.1.90" } }, + "node_modules/comment-parser": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-1.4.1.tgz", + "integrity": "sha512-buhp5kePrmda3vhc5B9t7pUQXAb2Tnd0qgpkIhPhkHXxJpiPJ11H0ZEU0oBpJ2QztSbzG/ZxMj/CHsYJqRHmyg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 12.0.0" + } + }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -597,24 +674,19 @@ "node": ">=0.3.1" } }, - "node_modules/doctrine": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", - "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", - "dev": true, - "dependencies": { - "esutils": "^2.0.2" - }, - "engines": { - "node": ">=6.0.0" - } - }, "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/es-module-lexer": { + "version": "1.5.4", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.5.4.tgz", + "integrity": "sha512-MVNK56NiMrOwitFB7cqDwq0CQutbw+0BvLshJSse0MUNU+y1FC3bUS/AQg7oUng+/wKrrki7JfmwtVHkVfPLlw==", + "dev": true, + "license": "MIT" + }, "node_modules/escalade": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", @@ -688,16 +760,29 @@ "url": "https://eslint.org/donate" } }, - "node_modules/eslint-config-google": { - "version": "0.14.0", - "resolved": "https://registry.npmjs.org/eslint-config-google/-/eslint-config-google-0.14.0.tgz", - "integrity": "sha512-WsbX4WbjuMvTdeVL6+J3rK1RGhCTqjsFjX7UMSMgZiyxxaNLkoJENbrGExzERFeoTpGw3F3FypTiWAP9ZXzkEw==", + "node_modules/eslint-plugin-jsdoc": { + "version": "48.5.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-48.5.0.tgz", + "integrity": "sha512-ukXPNpGby3KjCveCizIS8t1EbuJEHYEu/tBg8GCbn/YbHcXwphyvYCdvRZ/oMRfTscGSSzfsWoZ+ZkAP0/6YMQ==", "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@es-joy/jsdoccomment": "~0.43.1", + "are-docs-informative": "^0.0.2", + "comment-parser": "1.4.1", + "debug": "^4.3.4", + "escape-string-regexp": "^4.0.0", + "esquery": "^1.5.0", + "parse-imports": "^2.1.0", + "semver": "^7.6.2", + "spdx-expression-parse": "^4.0.0", + "synckit": "^0.9.0" + }, "engines": { - "node": ">=0.10.0" + "node": ">=18" }, "peerDependencies": { - "eslint": ">=5.16.0" + "eslint": "^7.0.0 || ^8.0.0 || ^9.0.0" } }, "node_modules/eslint-scope": { @@ -1190,12 +1275,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/graphemer": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", - "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", - "dev": true - }, "node_modules/growl": { "version": "1.10.5", "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", @@ -1336,16 +1415,17 @@ } }, "node_modules/grunt-eslint": { - "version": "24.3.0", - "resolved": "https://registry.npmjs.org/grunt-eslint/-/grunt-eslint-24.3.0.tgz", - "integrity": "sha512-dUPiRgX8fhmh4uwTAn9xrzg7HV5j5DhGmZZGJdHfjy/AN9G4jD+5IjfbcAJ209JcIG8m4B7xz3crIhuDSm3siQ==", + "version": "25.0.0", + "resolved": "https://registry.npmjs.org/grunt-eslint/-/grunt-eslint-25.0.0.tgz", + "integrity": "sha512-JIV5IPgOuacorFLmYtUTq0n+0qGIL9FSQJ4KVnNfCg/8Fm+K1t6OWrzXXI8TxWTwq2K9E3parFVXCpn1sGLbKQ==", "dev": true, + "license": "MIT", "dependencies": { "chalk": "^4.1.2", - "eslint": "^8.44.0" + "eslint": "^9.0.0" }, "engines": { - "node": ">=12" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -1354,227 +1434,6 @@ "grunt": ">=1" } }, - "node_modules/grunt-eslint/node_modules/@eslint/eslintrc": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", - "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "ajv": "^6.12.4", - "debug": "^4.3.2", - "espree": "^9.6.0", - "globals": "^13.19.0", - "ignore": "^5.2.0", - "import-fresh": "^3.2.1", - "js-yaml": "^4.1.0", - "minimatch": "^3.1.2", - "strip-json-comments": "^3.1.1" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/grunt-eslint/node_modules/@eslint/js": { - "version": "8.57.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.0.tgz", - "integrity": "sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - } - }, - "node_modules/grunt-eslint/node_modules/@humanwhocodes/config-array": { - "version": "0.11.14", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz", - "integrity": "sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@humanwhocodes/object-schema": "^2.0.2", - "debug": "^4.3.1", - "minimatch": "^3.0.5" - }, - "engines": { - "node": ">=10.10.0" - } - }, - "node_modules/grunt-eslint/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/grunt-eslint/node_modules/eslint": { - "version": "8.57.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.0.tgz", - "integrity": "sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@eslint-community/eslint-utils": "^4.2.0", - "@eslint-community/regexpp": "^4.6.1", - "@eslint/eslintrc": "^2.1.4", - "@eslint/js": "8.57.0", - "@humanwhocodes/config-array": "^0.11.14", - "@humanwhocodes/module-importer": "^1.0.1", - "@nodelib/fs.walk": "^1.2.8", - "@ungap/structured-clone": "^1.2.0", - "ajv": "^6.12.4", - "chalk": "^4.0.0", - "cross-spawn": "^7.0.2", - "debug": "^4.3.2", - "doctrine": "^3.0.0", - "escape-string-regexp": "^4.0.0", - "eslint-scope": "^7.2.2", - "eslint-visitor-keys": "^3.4.3", - "espree": "^9.6.1", - "esquery": "^1.4.2", - "esutils": "^2.0.2", - "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^6.0.1", - "find-up": "^5.0.0", - "glob-parent": "^6.0.2", - "globals": "^13.19.0", - "graphemer": "^1.4.0", - "ignore": "^5.2.0", - "imurmurhash": "^0.1.4", - "is-glob": "^4.0.0", - "is-path-inside": "^3.0.3", - "js-yaml": "^4.1.0", - "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.4.1", - "lodash.merge": "^4.6.2", - "minimatch": "^3.1.2", - "natural-compare": "^1.4.0", - "optionator": "^0.9.3", - "strip-ansi": "^6.0.1", - "text-table": "^0.2.0" - }, - "bin": { - "eslint": "bin/eslint.js" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/grunt-eslint/node_modules/eslint-scope": { - "version": "7.2.2", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", - "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", - "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^5.2.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/grunt-eslint/node_modules/espree": { - "version": "9.6.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", - "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", - "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "acorn": "^8.9.0", - "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^3.4.1" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/grunt-eslint/node_modules/file-entry-cache": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", - "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", - "dev": true, - "license": "MIT", - "dependencies": { - "flat-cache": "^3.0.4" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - } - }, - "node_modules/grunt-eslint/node_modules/flat-cache": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", - "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", - "dev": true, - "license": "MIT", - "dependencies": { - "flatted": "^3.2.9", - "keyv": "^4.5.3", - "rimraf": "^3.0.2" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - } - }, - "node_modules/grunt-eslint/node_modules/glob-parent": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", - "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", - "dev": true, - "license": "ISC", - "dependencies": { - "is-glob": "^4.0.3" - }, - "engines": { - "node": ">=10.13.0" - } - }, - "node_modules/grunt-eslint/node_modules/globals": { - "version": "13.24.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", - "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "type-fest": "^0.20.2" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/grunt-eslint/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/grunt-known-options": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/grunt-known-options/-/grunt-known-options-2.0.0.tgz", @@ -2209,6 +2068,16 @@ "js-yaml": "bin/js-yaml.js" } }, + "node_modules/jsdoc-type-pratt-parser": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-4.0.0.tgz", + "integrity": "sha512-YtOli5Cmzy3q4dP26GraSOeAhqecewG04hoO8DY56CH4KJ9Fvv5qKWUCCo3HZob7esJQHCv6/+bnTy72xZZaVQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.0.0" + } + }, "node_modules/json-buffer": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", @@ -2615,6 +2484,20 @@ "node": ">=0.8" } }, + "node_modules/parse-imports": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/parse-imports/-/parse-imports-2.1.0.tgz", + "integrity": "sha512-JQWgmK2o4w8leUkZeZPatWdAny6vXGU/3siIUvMF6J2rDCud9aTt8h/px9oZJ6U3EcfhngBJ635uPFI0q0VAeA==", + "dev": true, + "license": "Apache 2.0", + "dependencies": { + "es-module-lexer": "^1.5.3", + "slashes": "^3.0.12" + }, + "engines": { + "node": ">= 18" + } + }, "node_modules/parse-passwd": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", @@ -2819,67 +2702,6 @@ "node": ">=0.10.0" } }, - "node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, - "license": "ISC", - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/rimraf/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/rimraf/node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "dev": true, - "license": "ISC", - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/rimraf/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", @@ -2929,6 +2751,19 @@ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", "dev": true }, + "node_modules/semver": { + "version": "7.6.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", + "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/serialize-javascript": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", @@ -2959,6 +2794,38 @@ "node": ">=8" } }, + "node_modules/slashes": { + "version": "3.0.12", + "resolved": "https://registry.npmjs.org/slashes/-/slashes-3.0.12.tgz", + "integrity": "sha512-Q9VME8WyGkc7pJf6QEkj3wE+2CnvZMI+XJhwdTPR8Z/kWQRXi7boAWLDibRPyHRTUTPx5FaU7MsyrjI3yLB4HA==", + "dev": true, + "license": "ISC" + }, + "node_modules/spdx-exceptions": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.5.0.tgz", + "integrity": "sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w==", + "dev": true, + "license": "CC-BY-3.0" + }, + "node_modules/spdx-expression-parse": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-4.0.0.tgz", + "integrity": "sha512-Clya5JIij/7C6bRR22+tnGXbc4VKlibKSVj2iHvVeX5iMW7s1SIQlqu699JkODJJIhh/pUu8L0/VLh8xflD+LQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-license-ids": { + "version": "3.0.18", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.18.tgz", + "integrity": "sha512-xxRs31BqRYHwiMzudOrpSiHtZ8i/GeionCBDSilhYRj+9gIcI8wCZTlXZKu9vZIVqViP3dcp9qE5G6AlIaD+TQ==", + "dev": true, + "license": "CC0-1.0" + }, "node_modules/sprintf-js": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.3.tgz", @@ -3030,6 +2897,23 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/synckit": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.9.0.tgz", + "integrity": "sha512-7RnqIMq572L8PeEzKeBINYEJDDxpcH8JEgLwUqBd3TkofhFRbkq4QLR0u+36avGAhCRbk2nnmjcW9SE531hPDg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@pkgr/core": "^0.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/unts" + } + }, "node_modules/text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", @@ -3048,6 +2932,13 @@ "node": ">=8.0" } }, + "node_modules/tslib": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.3.tgz", + "integrity": "sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==", + "dev": true, + "license": "0BSD" + }, "node_modules/type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", @@ -3060,19 +2951,6 @@ "node": ">= 0.8.0" } }, - "node_modules/type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", - "dev": true, - "license": "(MIT OR CC0-1.0)", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/unc-path-regex": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/unc-path-regex/-/unc-path-regex-0.1.2.tgz", diff --git a/eo2js-runtime/package.json b/eo2js-runtime/package.json index 30a824d..93d6ef9 100644 --- a/eo2js-runtime/package.json +++ b/eo2js-runtime/package.json @@ -11,11 +11,11 @@ }, "devDependencies": { "eslint": "9.5.0", - "eslint-config-google": "0.14.0", + "eslint-plugin-jsdoc": "^48.5.0", "grunt": "1.6.1", "grunt-contrib-clean": "2.0.1", - "grunt-eslint": "24.3.0", + "grunt-eslint": "25.0.0", "grunt-mocha-cli": "^7.0.0", - "mocha": "^10.2.0" + "mocha": "^10.5.2" } } diff --git a/eo2js-runtime/src/objects/org/eolang/as-phi.js b/eo2js-runtime/src/objects/org/eolang/as-phi.js index 69e2ad2..a82ac77 100644 --- a/eo2js-runtime/src/objects/org/eolang/as-phi.js +++ b/eo2js-runtime/src/objects/org/eolang/as-phi.js @@ -5,7 +5,7 @@ const {data} = require('../../../runtime/data'); /** * As_phi. - * @return {Object} - As_phi object + * @returns {object} - As_phi object */ const as_phi = function() { const obj = object('as_phi') diff --git a/eo2js-runtime/src/objects/org/eolang/bytes$and.js b/eo2js-runtime/src/objects/org/eolang/bytes$and.js index 33f80c3..eb8bf39 100644 --- a/eo2js-runtime/src/objects/org/eolang/bytes$and.js +++ b/eo2js-runtime/src/objects/org/eolang/bytes$and.js @@ -7,7 +7,7 @@ const {data} = require('../../../runtime/data'); /** * Bytes.and. - * @return {Object} - Bytes.and object + * @returns {object} - Bytes.and object */ const bytes$and = function() { const obj = object('bytes$and') diff --git a/eo2js-runtime/src/objects/org/eolang/bytes$concat.js b/eo2js-runtime/src/objects/org/eolang/bytes$concat.js index 1973cf6..95349d3 100644 --- a/eo2js-runtime/src/objects/org/eolang/bytes$concat.js +++ b/eo2js-runtime/src/objects/org/eolang/bytes$concat.js @@ -6,7 +6,7 @@ const dataized = require('../../../runtime/dataized'); /** * Bytes.concat. - * @return {Object} - Bytes.concat object + * @returns {object} - Bytes.concat object */ const bytes$concat = function() { const obj = object('bytes$concat') diff --git a/eo2js-runtime/src/objects/org/eolang/bytes$eq.js b/eo2js-runtime/src/objects/org/eolang/bytes$eq.js index 841c32e..fbd6936 100644 --- a/eo2js-runtime/src/objects/org/eolang/bytes$eq.js +++ b/eo2js-runtime/src/objects/org/eolang/bytes$eq.js @@ -6,7 +6,7 @@ const {data} = require('../../../runtime/data'); /** * Bytes.eq. - * @return {Object} - Bytes.eq object + * @returns {object} - Bytes.eq object */ const bytes$eq = function() { const obj = object('bytes$eq') diff --git a/eo2js-runtime/src/objects/org/eolang/bytes$not.js b/eo2js-runtime/src/objects/org/eolang/bytes$not.js index 0722f47..b1ca643 100644 --- a/eo2js-runtime/src/objects/org/eolang/bytes$not.js +++ b/eo2js-runtime/src/objects/org/eolang/bytes$not.js @@ -6,7 +6,7 @@ const dataized = require('../../../runtime/dataized'); /** * Bytes.not. - * @return {Object} - Bytes.not object + * @returns {object} - Bytes.not object */ const bytes$not = function() { const obj = object('bytes$not') diff --git a/eo2js-runtime/src/objects/org/eolang/bytes$or.js b/eo2js-runtime/src/objects/org/eolang/bytes$or.js index 36268e1..60a8ceb 100644 --- a/eo2js-runtime/src/objects/org/eolang/bytes$or.js +++ b/eo2js-runtime/src/objects/org/eolang/bytes$or.js @@ -7,7 +7,7 @@ const dataized = require('../../../runtime/dataized'); /** * Bytes.or. - * @return {Object} - Bytes.or object + * @returns {object} - Bytes.or object */ const bytes$or = function() { const obj = object('bytes$or') diff --git a/eo2js-runtime/src/objects/org/eolang/bytes$right.js b/eo2js-runtime/src/objects/org/eolang/bytes$right.js index 5e3c8e9..78d1519 100644 --- a/eo2js-runtime/src/objects/org/eolang/bytes$right.js +++ b/eo2js-runtime/src/objects/org/eolang/bytes$right.js @@ -7,7 +7,7 @@ const dataized = require('../../../runtime/dataized'); /** * Bytes.right. - * @return {Object} - Bytes.right object + * @returns {object} - Bytes.right object */ const bytes$right = function() { const obj = object('bytes$right') diff --git a/eo2js-runtime/src/objects/org/eolang/bytes$size.js b/eo2js-runtime/src/objects/org/eolang/bytes$size.js index 62c7abb..084b7c6 100644 --- a/eo2js-runtime/src/objects/org/eolang/bytes$size.js +++ b/eo2js-runtime/src/objects/org/eolang/bytes$size.js @@ -5,7 +5,7 @@ const dataized = require('../../../runtime/dataized'); /** * Bytes.size. - * @return {Object} - Bytes.size object + * @returns {object} - Bytes.size object */ const bytes$size = function() { const obj = object('bytes$size') diff --git a/eo2js-runtime/src/objects/org/eolang/bytes$slice.js b/eo2js-runtime/src/objects/org/eolang/bytes$slice.js index f8140d0..5abc0f9 100644 --- a/eo2js-runtime/src/objects/org/eolang/bytes$slice.js +++ b/eo2js-runtime/src/objects/org/eolang/bytes$slice.js @@ -6,7 +6,7 @@ const dataized = require('../../../runtime/dataized'); /** * Bytes.slice. - * @return {Object} - Bytes.slice object + * @returns {object} - Bytes.slice object */ const bytes$slice = function() { const obj = object('bytes$slice') diff --git a/eo2js-runtime/src/objects/org/eolang/bytes$xor.js b/eo2js-runtime/src/objects/org/eolang/bytes$xor.js index 7dcc017..39efadc 100644 --- a/eo2js-runtime/src/objects/org/eolang/bytes$xor.js +++ b/eo2js-runtime/src/objects/org/eolang/bytes$xor.js @@ -7,7 +7,7 @@ const dataized = require('../../../runtime/dataized'); /** * Bytes.xor. - * @return {Object} - Bytes.xor object + * @returns {object} - Bytes.xor object */ const bytes$xor = function() { const obj = object('bytes$xor') diff --git a/eo2js-runtime/src/objects/org/eolang/cage$encaged$encage.js b/eo2js-runtime/src/objects/org/eolang/cage$encaged$encage.js index 3fd1e2b..308d52e 100644 --- a/eo2js-runtime/src/objects/org/eolang/cage$encaged$encage.js +++ b/eo2js-runtime/src/objects/org/eolang/cage$encaged$encage.js @@ -7,7 +7,7 @@ const {INT, data} = require('../../../runtime/data'); /** * Cage.encaged.encage. - * @return {Object} - Cage.encaged.encage object + * @returns {object} - Cage.encaged.encage object */ const cage$encaged$encage = function() { const obj = object('cage$encaged$encage') diff --git "a/eo2js-runtime/src/objects/org/eolang/cage$encaged$\317\206.js" "b/eo2js-runtime/src/objects/org/eolang/cage$encaged$\317\206.js" index 337f0c5..7003efb 100644 --- "a/eo2js-runtime/src/objects/org/eolang/cage$encaged$\317\206.js" +++ "b/eo2js-runtime/src/objects/org/eolang/cage$encaged$\317\206.js" @@ -7,7 +7,7 @@ const cages = require('../../../runtime/cages'); /** * Cage.encaged.φ. - * @return {Object} - Cage.encaged.φ object + * @returns {object} - Cage.encaged.φ object */ const cage$encaged$φ = function() { const obj = object('cage$encaged$φ') diff --git "a/eo2js-runtime/src/objects/org/eolang/cage$\317\206.js" "b/eo2js-runtime/src/objects/org/eolang/cage$\317\206.js" index e09e173..bbe8efc 100644 --- "a/eo2js-runtime/src/objects/org/eolang/cage$\317\206.js" +++ "b/eo2js-runtime/src/objects/org/eolang/cage$\317\206.js" @@ -5,7 +5,7 @@ const cages = require('../../../runtime/cages'); /** * Cage.φ. - * @return {Object} - Cage.φ object + * @returns {object} - Cage.φ object */ const cage$φ = function() { const obj = object('cage$φ') diff --git a/eo2js-runtime/src/objects/org/eolang/dataized.js b/eo2js-runtime/src/objects/org/eolang/dataized.js index 011bcf4..e8dff89 100644 --- a/eo2js-runtime/src/objects/org/eolang/dataized.js +++ b/eo2js-runtime/src/objects/org/eolang/dataized.js @@ -6,7 +6,7 @@ const {data} = require('../../../runtime/data'); /** * Dataized. - * @return {Object} - Dataized object + * @returns {object} - Dataized object */ const _dataized = function() { const obj = object('dataized') diff --git a/eo2js-runtime/src/objects/org/eolang/error.js b/eo2js-runtime/src/objects/org/eolang/error.js index 798973d..96581d4 100644 --- a/eo2js-runtime/src/objects/org/eolang/error.js +++ b/eo2js-runtime/src/objects/org/eolang/error.js @@ -7,9 +7,9 @@ const ErError = require('../../../runtime/error/ErError'); * Error. * You are NOT supposed to use this object programmatically. It is only * used from EO, but not from JS. From JS, you just throw - * {@link ErFailure}. It will be properly caught and converted to the error. + * {@see ErFailure}. It will be properly caught and converted to the error. * Again, DON'T USE THIS OBJECT PROGRAMMATICALLY. - * @return {Object} - Error object + * @returns {object} - Error object */ const error = function() { const obj = object('error') diff --git a/eo2js-runtime/src/objects/org/eolang/float$div.js b/eo2js-runtime/src/objects/org/eolang/float$div.js index 5f33fe0..b3faa02 100644 --- a/eo2js-runtime/src/objects/org/eolang/float$div.js +++ b/eo2js-runtime/src/objects/org/eolang/float$div.js @@ -6,7 +6,7 @@ const at_void = require('../../../runtime/attribute/at-void') /** * Float.div. - * @return {any} - Float.div object + * @returns {any} - Float.div object */ const float$div = function() { const obj = object('float$div') diff --git a/eo2js-runtime/src/objects/org/eolang/float$gt.js b/eo2js-runtime/src/objects/org/eolang/float$gt.js index 71fb694..36e9998 100644 --- a/eo2js-runtime/src/objects/org/eolang/float$gt.js +++ b/eo2js-runtime/src/objects/org/eolang/float$gt.js @@ -6,7 +6,7 @@ const at_void = require('../../../runtime/attribute/at-void') /** * Float.gt. - * @return {any} - Float.gt object + * @returns {any} - Float.gt object */ const float$gt = function() { const obj = object('float$gt') diff --git a/eo2js-runtime/src/objects/org/eolang/float$plus.js b/eo2js-runtime/src/objects/org/eolang/float$plus.js index 8c18d12..ea2671b 100644 --- a/eo2js-runtime/src/objects/org/eolang/float$plus.js +++ b/eo2js-runtime/src/objects/org/eolang/float$plus.js @@ -6,7 +6,7 @@ const at_void = require('../../../runtime/attribute/at-void') /** * Float.plus. - * @return {any} - Int.plus object + * @returns {any} - Int.plus object */ const float$plus = function() { const obj = object('float$plus') diff --git a/eo2js-runtime/src/objects/org/eolang/float$times.js b/eo2js-runtime/src/objects/org/eolang/float$times.js index a722432..0c555e9 100644 --- a/eo2js-runtime/src/objects/org/eolang/float$times.js +++ b/eo2js-runtime/src/objects/org/eolang/float$times.js @@ -6,7 +6,7 @@ const at_void = require('../../../runtime/attribute/at-void') /** * Float.times. - * @return {any} - Float.times object + * @returns {any} - Float.times object */ const float$times = function() { const obj = object('float$times') diff --git a/eo2js-runtime/src/objects/org/eolang/int$div.js b/eo2js-runtime/src/objects/org/eolang/int$div.js index b35bd10..ac44a58 100644 --- a/eo2js-runtime/src/objects/org/eolang/int$div.js +++ b/eo2js-runtime/src/objects/org/eolang/int$div.js @@ -7,7 +7,7 @@ const ErFailure = require('../../../runtime/error/ErFailure'); /** * Int.div. - * @return {any} - Int.div object + * @returns {any} - Int.div object */ const int$div = function() { const obj = object('int$div') diff --git a/eo2js-runtime/src/objects/org/eolang/int$gt.js b/eo2js-runtime/src/objects/org/eolang/int$gt.js index 60f0662..42c64ce 100644 --- a/eo2js-runtime/src/objects/org/eolang/int$gt.js +++ b/eo2js-runtime/src/objects/org/eolang/int$gt.js @@ -6,7 +6,7 @@ const at_void = require('../../../runtime/attribute/at-void') /** * Int.gt. - * @return {any} - Int.gt object + * @returns {any} - Int.gt object */ const int$gt = function() { const obj = object('int$gt') diff --git a/eo2js-runtime/src/objects/org/eolang/int$plus.js b/eo2js-runtime/src/objects/org/eolang/int$plus.js index deefe62..bdb2632 100644 --- a/eo2js-runtime/src/objects/org/eolang/int$plus.js +++ b/eo2js-runtime/src/objects/org/eolang/int$plus.js @@ -6,7 +6,7 @@ const at_void = require('../../../runtime/attribute/at-void') /** * Int.plus. - * @return {any} - Int.plus object + * @returns {any} - Int.plus object */ const int$plus = function() { const obj = object('int$plus') diff --git a/eo2js-runtime/src/objects/org/eolang/int$times.js b/eo2js-runtime/src/objects/org/eolang/int$times.js index 56c8d6f..124127b 100644 --- a/eo2js-runtime/src/objects/org/eolang/int$times.js +++ b/eo2js-runtime/src/objects/org/eolang/int$times.js @@ -6,7 +6,7 @@ const at_void = require('../../../runtime/attribute/at-void') /** * Int.times. - * @return {any} - Int.times object + * @returns {any} - Int.times object */ const int$times = function() { const obj = object('int$times') diff --git a/eo2js-runtime/src/objects/org/eolang/io/stdin$next-line.js b/eo2js-runtime/src/objects/org/eolang/io/stdin$next-line.js index 38b38c9..d8a678f 100644 --- a/eo2js-runtime/src/objects/org/eolang/io/stdin$next-line.js +++ b/eo2js-runtime/src/objects/org/eolang/io/stdin$next-line.js @@ -4,14 +4,14 @@ const ErFailure = require('../../../../runtime/error/ErFailure'); /** * Stdin.next_line. - * @return {Object} - Stdin.next_line object + * @returns {object} - Stdin.next_line object * @todo #3:30min Implement stdin$next_line atom. We need to implement the atom and make sure it * works. For the details of implementation check the Java analogue on * https://github.com/objectionary/eo/tree/master/eo-runtime/src/main/java/EOorg/EOeolang */ const stdin$next_line = function() { const obj = object('stdin$next_line') - obj.assets[LAMBDA] = function(_) { + obj.assets[LAMBDA] = function() { throw new ErFailure( `Atom stdin$next_line is not implemented yet` ) diff --git "a/eo2js-runtime/src/objects/org/eolang/io/stdin$\317\206.js" "b/eo2js-runtime/src/objects/org/eolang/io/stdin$\317\206.js" index e02dc2c..4d2319d 100644 --- "a/eo2js-runtime/src/objects/org/eolang/io/stdin$\317\206.js" +++ "b/eo2js-runtime/src/objects/org/eolang/io/stdin$\317\206.js" @@ -4,7 +4,7 @@ const ErFailure = require('../../../../runtime/error/ErFailure'); /** * Stdin.φ. - * @return {Object} - Stdin.φ object + * @returns {object} - Stdin.φ object * @todo #3:30min Implement stdin$φ atom. We need to implement the atom and make sure it * works. For the details of implementation check the Java analogue on * https://github.com/objectionary/eo/tree/master/eo-runtime/src/main/java/EOorg/EOeolang diff --git a/eo2js-runtime/src/objects/org/eolang/io/stdout.js b/eo2js-runtime/src/objects/org/eolang/io/stdout.js index 43aa124..c774b4e 100644 --- a/eo2js-runtime/src/objects/org/eolang/io/stdout.js +++ b/eo2js-runtime/src/objects/org/eolang/io/stdout.js @@ -7,7 +7,7 @@ const at_void = require('../../../../runtime/attribute/at-void'); /** * Stdout. * @param {{log: (function(...args: any): void)}} out - Out - * @return {any} - Stdout object + * @returns {any} - Stdout object */ const stdout = function(out = console) { const obj = object('stdout') diff --git a/eo2js-runtime/src/objects/org/eolang/malloc$of$allocated$read.js b/eo2js-runtime/src/objects/org/eolang/malloc$of$allocated$read.js index ee7aaac..9c8a3e2 100644 --- a/eo2js-runtime/src/objects/org/eolang/malloc$of$allocated$read.js +++ b/eo2js-runtime/src/objects/org/eolang/malloc$of$allocated$read.js @@ -7,7 +7,7 @@ const heaps = require('../../../runtime/heaps'); /** * Malloc.of.allocated.read. - * @return {Object} - Malloc.of.allocated.read object + * @returns {object} - Malloc.of.allocated.read object */ const malloc$of$allocated$read = function() { const obj = object('malloc$of$allocated$read') diff --git a/eo2js-runtime/src/objects/org/eolang/malloc$of$allocated$write.js b/eo2js-runtime/src/objects/org/eolang/malloc$of$allocated$write.js index 99f5d05..61ed643 100644 --- a/eo2js-runtime/src/objects/org/eolang/malloc$of$allocated$write.js +++ b/eo2js-runtime/src/objects/org/eolang/malloc$of$allocated$write.js @@ -7,7 +7,7 @@ const dataized = require('../../../runtime/dataized'); /** * Malloc.of.allocated.write. - * @return {Object} - Malloc.of.allocated.write object + * @returns {object} - Malloc.of.allocated.write object */ const malloc$of$allocated$write = function() { const obj = object('malloc$of$allocated$write') diff --git "a/eo2js-runtime/src/objects/org/eolang/malloc$of$\317\206.js" "b/eo2js-runtime/src/objects/org/eolang/malloc$of$\317\206.js" index a0059b4..da6bba4 100644 --- "a/eo2js-runtime/src/objects/org/eolang/malloc$of$\317\206.js" +++ "b/eo2js-runtime/src/objects/org/eolang/malloc$of$\317\206.js" @@ -6,7 +6,7 @@ const heaps = require('../../../runtime/heaps'); /** * Malloc.of.φ. - * @return {Object} - Malloc.of.φ object + * @returns {object} - Malloc.of.φ object */ const malloc$of$φ = function() { const obj = object('malloc$of$φ') diff --git a/eo2js-runtime/src/objects/org/eolang/rust.js b/eo2js-runtime/src/objects/org/eolang/rust.js index 1507c28..d592e3e 100644 --- a/eo2js-runtime/src/objects/org/eolang/rust.js +++ b/eo2js-runtime/src/objects/org/eolang/rust.js @@ -4,7 +4,7 @@ const ErFailure = require('../../../runtime/error/ErFailure'); /** * Rust. - * @return {Object} - Rust object + * @returns {object} - Rust object * @todo #3:30min Implement rust atom. We need to implement the atom and make sure it * works. For the details of implementation check the Java analogue on * https://github.com/objectionary/eo/tree/master/eo-runtime/src/main/java/EOorg/EOeolang diff --git a/eo2js-runtime/src/objects/org/eolang/seq.js b/eo2js-runtime/src/objects/org/eolang/seq.js index 09cbd17..55bc964 100644 --- a/eo2js-runtime/src/objects/org/eolang/seq.js +++ b/eo2js-runtime/src/objects/org/eolang/seq.js @@ -7,8 +7,8 @@ const taken = require('../../../runtime/taken'); /** * Extract element from EO tuple and convert them to JS array. - * @param {Object} tuple - EO tuple object - * @return {Object[]} - Array of EO tuple elements. + * @param {object} tuple - EO tuple object + * @returns {object[]} - Array of EO tuple elements. */ const tupleAsArray = function(tuple) { const length = Number(dataized(tuple.take('length'), INT)) @@ -23,7 +23,7 @@ const tupleAsArray = function(tuple) { /** * Seq. - * @return {Object} - Seq object + * @returns {object} - Seq object */ const seq = function() { const obj = object('seq') diff --git a/eo2js-runtime/src/objects/org/eolang/string$length.js b/eo2js-runtime/src/objects/org/eolang/string$length.js index 5f0264d..1318eb8 100644 --- a/eo2js-runtime/src/objects/org/eolang/string$length.js +++ b/eo2js-runtime/src/objects/org/eolang/string$length.js @@ -5,7 +5,7 @@ const dataized = require('../../../runtime/dataized'); /** * String.length. - * @return {Object} - String.length object + * @returns {object} - String.length object */ const string$length = function() { const obj = object('string$length') diff --git a/eo2js-runtime/src/objects/org/eolang/string$slice.js b/eo2js-runtime/src/objects/org/eolang/string$slice.js index 9c177da..d310d0c 100644 --- a/eo2js-runtime/src/objects/org/eolang/string$slice.js +++ b/eo2js-runtime/src/objects/org/eolang/string$slice.js @@ -7,7 +7,7 @@ const ErFailure = require('../../../runtime/error/ErFailure'); /** * String.slice. - * @return {Object} - String.slice object + * @returns {object} - String.slice object */ const string$slice = function() { const obj = object('string$slice') diff --git a/eo2js-runtime/src/objects/org/eolang/try.js b/eo2js-runtime/src/objects/org/eolang/try.js index eabc711..dc61d01 100644 --- a/eo2js-runtime/src/objects/org/eolang/try.js +++ b/eo2js-runtime/src/objects/org/eolang/try.js @@ -7,7 +7,7 @@ const trapped = require('../../../runtime/trapped'); /** * Try. - * @return {Object} - Try object + * @returns {object} - Try object */ const _try = function() { const obj = object('try') diff --git a/eo2js-runtime/src/runtime/applied.js b/eo2js-runtime/src/runtime/applied.js index 45f75e0..5f11a76 100644 --- a/eo2js-runtime/src/runtime/applied.js +++ b/eo2js-runtime/src/runtime/applied.js @@ -2,9 +2,9 @@ const once = require('./once'); /** * Object with applied bindings lazily. - * @param {Object} object - Object to apply bindings to - * @param {Object} bindings - Bindings to apply - * @return {Object} - Object with applied bindings + * @param {object} object - Object to apply bindings to + * @param {object} bindings - Bindings to apply + * @returns {object} - Object with applied bindings */ const applied = function(object, bindings) { return once( diff --git a/eo2js-runtime/src/runtime/attribute/at-lambda.js b/eo2js-runtime/src/runtime/attribute/at-lambda.js index c2b3b22..9d519be 100644 --- a/eo2js-runtime/src/runtime/attribute/at-lambda.js +++ b/eo2js-runtime/src/runtime/attribute/at-lambda.js @@ -5,8 +5,8 @@ const {LAMBDA} = require('./specials'); /** * Lazy lambda attribute. * @param {object} object - Rho - * @param {function(self: object): object} callback - Lambda to call - * @return {Object} Lazy lambda attribute + * @param {(self: object) => object} callback - Lambda to call + * @returns {object} Lazy lambda attribute */ const at_lambda = function(object, callback) { return { diff --git a/eo2js-runtime/src/runtime/attribute/at-once.js b/eo2js-runtime/src/runtime/attribute/at-once.js index 124270c..350a4c7 100644 --- a/eo2js-runtime/src/runtime/attribute/at-once.js +++ b/eo2js-runtime/src/runtime/attribute/at-once.js @@ -2,7 +2,7 @@ * Attribute that caches result after get. * Resets cache on copying. * @param {object} origin - Original attribute - * @return {Object} - Attribute + * @returns {object} - Attribute */ const at_once = function(origin) { const cache = { diff --git a/eo2js-runtime/src/runtime/attribute/at-rho.js b/eo2js-runtime/src/runtime/attribute/at-rho.js index 199fc54..02af60a 100644 --- a/eo2js-runtime/src/runtime/attribute/at-rho.js +++ b/eo2js-runtime/src/runtime/attribute/at-rho.js @@ -4,8 +4,8 @@ const at_term = require('./at-term'); /** * Attribute that keeps \rho. - * @param {Object} [object] - Rho object - * @return {Object} - Rho attribute + * @param {object} [object] - Rho object + * @returns {object} - Rho attribute */ const at_rho = function(object = null) { let rho = object diff --git a/eo2js-runtime/src/runtime/attribute/at-safe.js b/eo2js-runtime/src/runtime/attribute/at-safe.js index af06a86..9f27ec8 100644 --- a/eo2js-runtime/src/runtime/attribute/at-safe.js +++ b/eo2js-runtime/src/runtime/attribute/at-safe.js @@ -3,9 +3,9 @@ const safe = require('../safe'); const at_term = require('./at-term'); /** - * Attribute that catches {@link ErFailure} and throws {@link ErError}. + * Attribute that catches {@see ErFailure} and throws {@see ErError}. * @param {object} origin - Original attribute - * @return {Object} - Attribute + * @returns {object} - Attribute */ const at_safe = function(origin) { return at_term({ diff --git a/eo2js-runtime/src/runtime/attribute/at-simple.js b/eo2js-runtime/src/runtime/attribute/at-simple.js index a716107..2430d67 100644 --- a/eo2js-runtime/src/runtime/attribute/at-simple.js +++ b/eo2js-runtime/src/runtime/attribute/at-simple.js @@ -4,7 +4,7 @@ const at_once = require('./at-once'); /** * Simple attribute. * @param {object} object - Object ot return - * @return {Object} - Simple attribute + * @returns {object} - Simple attribute */ const at_simple = function(object) { return at_once( diff --git a/eo2js-runtime/src/runtime/attribute/at-term.js b/eo2js-runtime/src/runtime/attribute/at-term.js index a4c7f06..01de689 100644 --- a/eo2js-runtime/src/runtime/attribute/at-term.js +++ b/eo2js-runtime/src/runtime/attribute/at-term.js @@ -1,7 +1,7 @@ /** * Attribute as φTerm. - * @param {Object} origin - Original attribute - * @return {Object} - Attribute with default φTerm + * @param {object} origin - Original attribute + * @returns {object} - Attribute with default φTerm */ const at_term = function(origin) { return { diff --git a/eo2js-runtime/src/runtime/attribute/at-void.js b/eo2js-runtime/src/runtime/attribute/at-void.js index d7b233a..8ecb76b 100644 --- a/eo2js-runtime/src/runtime/attribute/at-void.js +++ b/eo2js-runtime/src/runtime/attribute/at-void.js @@ -4,8 +4,8 @@ const {EMPTY} = require('./specials'); /** * Void attribute. * @param {string} name - Name of the attribute - * @param {Object} object - Object - * @return {Object} - Free attribute + * @param {object} object - Object + * @returns {object} - Free attribute */ const at_void = function(name, object = null) { let obj = object diff --git a/eo2js-runtime/src/runtime/attribute/attr.js b/eo2js-runtime/src/runtime/attribute/attr.js index 4d28938..de0aff8 100644 --- a/eo2js-runtime/src/runtime/attribute/attr.js +++ b/eo2js-runtime/src/runtime/attribute/attr.js @@ -5,7 +5,12 @@ const lambda = require('./at-lambda') /** * API for attributes. - * @type {{lambda: (function(Object, function(Object): Object): *)|{}, void: (function(string): *)|{}, once: (function(Object): *)|{}, simple: (function(Object): *)|{}}} + * @type {{ + * lambda: (object: object, callback: (object) => object) => any, + * void: (string) => any, + * once: (object) => any, + * simple: (object) => any + * }} */ const attr = { once, diff --git a/eo2js-runtime/src/runtime/bytes-of.js b/eo2js-runtime/src/runtime/bytes-of.js index 6f926e4..a331ec8 100644 --- a/eo2js-runtime/src/runtime/bytes-of.js +++ b/eo2js-runtime/src/runtime/bytes-of.js @@ -12,8 +12,8 @@ const BYTE_SIZE = 8 * to this: * [0, 0, 0, 0, 0, 0, 48, 57] * If int byte array is provided - return it - * @param {array.|array.} bytes - Byte array - * @return {array.} - Int byte array + * @param {Array.|Array.} bytes - Byte array + * @returns {Array.} - Int byte array */ const hexToInt = function(bytes) { let byte @@ -34,8 +34,8 @@ const hexToInt = function(bytes) { /** * Adjust byte array for numbers. * This is temporary solution that may fail at any moment. Should be removed as soon as possible. - * @param {Array.} bytes - Byte array - * @return {Array.} - Adjusted byte array + * @param {Array.} bytes - Byte array + * @returns {Array.} - Adjusted byte array */ const adjustNumber = function(bytes) { if (bytes.length === 8) { @@ -54,23 +54,23 @@ const adjustNumber = function(bytes) { /** * Bytes of. - * @param {string|number|BigInt|boolean|array.|array.} data - Data to cast to bytes - * @return {{ - * asInt: (function(): BigInt), - * asBool: (function(): boolean), - * asString: (function(): string), - * asFloat: (function(): number), - * asBytes: (function(): array.), - * verbose: (function(): string), - * and: (function(other: Array.): object), - * or: (function(other: Array.): object), - * xor: (function(other: Array.): object), - * not: (function(): object), - * shift: (function(Number): object) + * @param {string|number|bigint|boolean|Array.|Array.} data - Data to cast to bytes + * @returns {{ + * asInt: () => bigint, + * asBool: () => boolean, + * asString: () => string, + * asFloat: () => number, + * asBytes: () => Array., + * verbose: () => string, + * and: (other: Array.) => object, + * or: (other: Array.) => object, + * xor: (other: Array.) => object, + * not: () => object, + * shift: (number) => object * }} - Bytes converter * @todo #3:30min Fix bytes converting for integers. There are some differences between how Java * generate byte array from integers and JS. For example we get the number -18 in XMIR as - * ['0xFF', '0xFF', '0xFF', '0xFF', '0xFF', '0xFF', '0xFF', '0xEE'] byte array. After it cast from + * ['0xFF', '0xFF', '0xFF', '0xFF', '0xFF', '0xFF', '0xFF', '0xEE'] byte Array. After it cast from * hex to int it looks like: [255, 255, 255, 255, 255, 255, 255, 238]. But when we do * {@code bytesOf(-18).asBytes()} we get [-1, -1, -1, -1, -1, -1, -1, -72]. Technically - these * arrays are the same because they'll converted to the same integer value -18. But at the level of @@ -101,14 +101,14 @@ const bytesOf = function(data) { return { /** * Get byte array. - * @return {Array.} - Byte array + * @returns {Array.} - Byte array */ asBytes: function() { return bytes }, /** * Convert bytes to integer. - * @return {BigInt} - Integer number + * @returns {bigint} - Integer number */ asInt: function() { if (bytes.length !== 8) { @@ -118,7 +118,7 @@ const bytesOf = function(data) { }, /** * Convert bytes to float. - * @return {number} - Float number + * @returns {number} - Float number */ asFloat: function() { if (bytes.length !== 8) { @@ -128,14 +128,14 @@ const bytesOf = function(data) { }, /** * Convert bytes to string - * @return {string} - String number + * @returns {string} - String number */ asString: function() { return Buffer.from(bytes).toString('utf-8') }, /** * Convert bytes to bool. - * @return {boolean} - Boolean + * @returns {boolean} - Boolean */ asBool: function() { if (bytes.length !== 1) { @@ -145,7 +145,7 @@ const bytesOf = function(data) { }, /** * Get verbose bytes string representation depends on its length - * @return {string} - Verbose string representation of bytes + * @returns {string} - Verbose string representation of bytes */ verbose: function() { let str @@ -168,20 +168,20 @@ const bytesOf = function(data) { }, /** * Logical AND. - * @param {Array.} other - Other byte array - * @return {{ - * asInt: (function(): BigInt), - * asBool: (function(): boolean), - * asString: (function(): string), - * asFloat: (function(): number), - * asBytes: (function(): Array), - * verbose: (function(): string), - * and: (function(Array.): Object), - * or: (function(Array.): Object), - * xor: (function(Array.): Object), - * not: (function(): object), - * shift: (function(Number): Object) - * }} + * @param {Array.} other - Other byte array + * @returns {{ + * asInt: () => bigint, + * asBool: () => boolean, + * asString: () => string, + * asFloat: () => number, + * asBytes: () => Array., + * verbose: () => string, + * and: (other: Array.) => object, + * or: (other: Array.) => object, + * xor: (other: Array.) => object, + * not: () => object, + * shift: (number) => object + * }} - Bytes after AND. */ and: function(other) { const copy = bytes @@ -192,20 +192,20 @@ const bytesOf = function(data) { }, /** * Logical OR. - * @param {Array.} other - Other byte array - * @return {{ - * asInt: (function(): BigInt), - * asBool: (function(): boolean), - * asString: (function(): string), - * asFloat: (function(): number), - * asBytes: (function(): Array), - * verbose: (function(): string), - * and: (function(Array.): Object), - * or: (function(Array.): Object), - * xor: (function(Array.): Object), - * not: (function(): object), - * shift: (function(Number): Object) - * }} + * @param {Array.} other - Other byte array + * @returns {{ + * asInt: () => bigint, + * asBool: () => boolean, + * asString: () => string, + * asFloat: () => number, + * asBytes: () => Array., + * verbose: () => string, + * and: (other: Array.) => object, + * or: (other: Array.) => object, + * xor: (other: Array.) => object, + * not: () => object, + * shift: (number) => object + * }} - Bytes after OR. */ or: function(other) { const copy = bytes @@ -216,20 +216,20 @@ const bytesOf = function(data) { }, /** * XOR. - * @param {Array.} other - Other byte array - * @return {{ - * asInt: (function(): BigInt), - * asBool: (function(): boolean), - * asString: (function(): string), - * asFloat: (function(): number), - * asBytes: (function(): Array), - * verbose: (function(): string), - * and: (function(Array.): Object), - * or: (function(Array.): Object), - * xor: (function(Array.): Object), - * not: (function(): object), - * shift: (function(Number): Object) - * }} + * @param {Array.} other - Other byte array + * @returns {{ + * asInt: () => bigint, + * asBool: () => boolean, + * asString: () => string, + * asFloat: () => number, + * asBytes: () => Array., + * verbose: () => string, + * and: (other: Array.) => object, + * or: (other: Array.) => object, + * xor: (other: Array.) => object, + * not: () => object, + * shift: (number) => object + * }} - Bytes after XOR. */ xor: function(other) { const copy = bytes @@ -240,19 +240,19 @@ const bytesOf = function(data) { }, /** * Logical NOT. - * @return {{ - * asInt: (function(): BigInt), - * asBool: (function(): boolean), - * asString: (function(): string), - * asFloat: (function(): number), - * asBytes: (function(): Array), - * verbose: (function(): string), - * and: (function(Array.): Object), - * or: (function(Array.): Object), - * xor: (function(Array.): Object), - * not: (function(): object), - * shift: (function(Number): Object) - * }} + * @returns {{ + * asInt: () => bigint, + * asBool: () => boolean, + * asString: () => string, + * asFloat: () => number, + * asBytes: () => Array., + * verbose: () => string, + * and: (other: Array.) => object, + * or: (other: Array.) => object, + * xor: (other: Array.) => object, + * not: () => object, + * shift: (number) => object + * }} - Bytes after negation. */ not: function() { const copy = bytes @@ -265,20 +265,20 @@ const bytesOf = function(data) { * Big-endian unsigned shift. * Shifts left if value is positive, or right otherwise. * Does not perform sign extension. - * @param {Number} bits - Bits amount - * @return {{ - * asInt: (function(): BigInt), - * asBool: (function(): boolean), - * asString: (function(): string), - * asFloat: (function(): number), - * asBytes: (function(): Array), - * verbose: (function(): string), - * and: (function(Array.): Object), - * or: (function(Array.): Object), - * xor: (function(Array.): Object), - * not: (function(): object), - * shift: (function(Number): Object) - * }} + * @param {number} bits - Bits amount + * @returns {{ + * asInt: () => bigint, + * asBool: () => boolean, + * asString: () => string, + * asFloat: () => number, + * asBytes: () => Array., + * verbose: () => string, + * and: (other: Array.) => object, + * or: (other: Array.) => object, + * xor: (other: Array.) => object, + * not: () => object, + * shift: (number) => object + * }} - Bytes after shift. */ shift: function(bits) { bits = Number(bits) diff --git a/eo2js-runtime/src/runtime/cages.js b/eo2js-runtime/src/runtime/cages.js index 2473f26..d93ad37 100644 --- a/eo2js-runtime/src/runtime/cages.js +++ b/eo2js-runtime/src/runtime/cages.js @@ -15,32 +15,32 @@ let locator = 0 /** * Cages for objects * @type {{ - * init: function(Object): number, - * encage: function(Number, Object), - * get: function(Number): Object + * init: (object) => number, + * encage: (number, object) => void, + * get: (number) => object * }} */ const cages = { /** * Encage object for the first time. * New locator will be generated. - * @param {Number} object - * @return {number} + * @param {number} object - Object to encage + * @returns {number} - Locator */ init: function(object) { const loc = ++locator - if (!OBJECTS.hasOwnProperty(loc)) { + if (!Object.hasOwn(OBJECTS, loc)) { OBJECTS[loc] = object } return loc }, /** * Encage object to the storage by locator. - * @param {Number} loc - Locator - * @param {Object} object - Object + * @param {number} loc - Locator + * @param {object} object - object */ encage: function(loc, object) { - if (!OBJECTS.hasOwnProperty(loc)) { + if (!Object.hasOwn(OBJECTS, loc)) { throw new ErFailure( `Encaged object with locator ${loc} was not initialized, can't reencage, can't encage` ) @@ -56,13 +56,13 @@ const cages = { }, /** * Retrieve object from storage by locator - * @param {Number} loc - Locator - * @return {Object} + * @param {number} loc - Locator + * @returns {object} - Object from storage */ get: function(loc) { - if (!OBJECTS.hasOwnProperty(loc)) { + if (!Object.hasOwn(OBJECTS, loc)) { throw new ErFailure( - `Object with locator ${loc} is absent in cage, can't get` + `object with locator ${loc} is absent in cage, can't get` ) } return OBJECTS[loc] diff --git a/eo2js-runtime/src/runtime/data.js b/eo2js-runtime/src/runtime/data.js index bd0ac88..7a2df98 100644 --- a/eo2js-runtime/src/runtime/data.js +++ b/eo2js-runtime/src/runtime/data.js @@ -3,7 +3,7 @@ const bytesOf = require('./bytes-of'); /** * Data to object converter. - * @type {{BYTES: string, FLOAT: string, BOOL: string, STRING: string, INT: string, toObject: (function(string|boolean|number|BigInt|array.|array.): object)}} + * @type {{BYTES: string, FLOAT: string, BOOL: string, STRING: string, INT: string, toObject: (function(string|boolean|number|bigint|Array.|Array.): object)}} */ const data = { toObject: function(data) { diff --git a/eo2js-runtime/src/runtime/dataized.js b/eo2js-runtime/src/runtime/dataized.js index 3ea2df3..0bac9a8 100644 --- a/eo2js-runtime/src/runtime/dataized.js +++ b/eo2js-runtime/src/runtime/dataized.js @@ -6,7 +6,7 @@ const ErFailure = require('./error/ErFailure'); * Dataized. * @param {object} object - Object to dataize * @param {string} [type] - Type to cast to - * @return {string|number|BigInt|boolean|array.} - Data + * @returns {string|number|bigint|boolean|Array.} - Data */ const dataized = function(object, type) { const bytes = bytesOf(object.data()) diff --git a/eo2js-runtime/src/runtime/error/ErAbstract.js b/eo2js-runtime/src/runtime/error/ErAbstract.js index 5612586..472ecf5 100644 --- a/eo2js-runtime/src/runtime/error/ErAbstract.js +++ b/eo2js-runtime/src/runtime/error/ErAbstract.js @@ -4,7 +4,7 @@ class ErAbstract extends Error { /** * Ctor. - * @param {String} message - Cause. + * @param {string} message - Cause. */ constructor(message) { super(message) diff --git a/eo2js-runtime/src/runtime/error/ErError.js b/eo2js-runtime/src/runtime/error/ErError.js index 8ce18ef..99cb552 100644 --- a/eo2js-runtime/src/runtime/error/ErError.js +++ b/eo2js-runtime/src/runtime/error/ErError.js @@ -9,7 +9,7 @@ const bytesOf = require('../bytes-of'); class ErError extends ErAbstract { /** * Ctor. - * @param {Object} enclosure - Enclosure inside the error + * @param {object} enclosure - Enclosure inside the error */ constructor(enclosure) { super(ErError.safeMessage(enclosure)) @@ -19,15 +19,15 @@ class ErError extends ErAbstract { /** * Retrieve message from enclosure safely. - * @param {Object} enclosure - Enclosure inside the error - * @return {string} + * @param {object} enclosure - Enclosure inside the error + * @returns {string} - Safe message */ static safeMessage(enclosure) { let result try { const raw = dataized(enclosure) result = `${enclosure.toString()}(${DELTA} = ${bytesOf(raw).verbose()})` - } catch (ex) { + } catch (_) { /* eslint-disable-line no-unused-vars */ result = enclosure.toString(); } return result diff --git a/eo2js-runtime/src/runtime/error/ErFailure.js b/eo2js-runtime/src/runtime/error/ErFailure.js index 9f43c88..da61cfa 100644 --- a/eo2js-runtime/src/runtime/error/ErFailure.js +++ b/eo2js-runtime/src/runtime/error/ErFailure.js @@ -6,7 +6,7 @@ const ErAbstract = require('./ErAbstract') class ErFailure extends ErAbstract { /** * Ctor. - * @param {String} message - Message + * @param {string} message - Message */ constructor(message) { super(message); diff --git a/eo2js-runtime/src/runtime/heaps.js b/eo2js-runtime/src/runtime/heaps.js index 2be678f..77bc121 100644 --- a/eo2js-runtime/src/runtime/heaps.js +++ b/eo2js-runtime/src/runtime/heaps.js @@ -15,21 +15,21 @@ let identifier = 0 /** * Dynamic memory. * @type {{ - * malloc: function(Number): number, - * read: function(Number, Number, Number): Array., - * free: function(Number), - * write: function(Number, Number, Array.) + * malloc: (number) => number, + * read: (number, number, number) => Array., + * free: (number) => void, + * write: (number, number, data: Array.) => void * }} */ const heaps = { /** * Allocate block in memory of given size. - * @param {Number} size - Size of the block to allocate - * @return {Number} - Identifier of allocated block + * @param {number} size - Size of the block to allocate + * @returns {number} - Identifier of allocated block */ malloc: function(size) { const id = ++identifier - if (BLOCKS.hasOwnProperty(id)) { + if (Object.hasOwn(BLOCKS, id)) { throw new ErFailure( `Can't allocate block in memory with identifier ${id} because it's already allocated` ) @@ -39,12 +39,12 @@ const heaps = { }, /** * Write given data to the block in memory by given identifier. - * @param {Number} id - Identifier - * @param {Number} offset - Offset - * @param {Array.} data - Data tto write + * @param {number} id - Identifier + * @param {number} offset - Offset + * @param {Array.} data - Data tto write */ write: function(id, offset, data) { - if (!BLOCKS.hasOwnProperty(id)) { + if (!Object.hasOwn(BLOCKS, id)) { throw new ErFailure( `Can't read a block in memory with identifier ${id} because it's not allocated`, ) @@ -72,13 +72,13 @@ const heaps = { }, /** * Get data from the block in memory by identifier. - * @param {Number} id - Identifier - * @param {Number} offset - Offset - * @param {Number} length - Length - * @return {Array.} - Data from the block in memory + * @param {number} id - Identifier + * @param {number} offset - Offset + * @param {number} length - Length + * @returns {Array.} - Data from the block in memory */ read: function(id, offset, length) { - if (!BLOCKS.hasOwnProperty(id)) { + if (!Object.hasOwn(BLOCKS, id)) { throw new ErFailure( `Block in memory by identifier ${id} is not allocated, can't read`, ); @@ -93,10 +93,10 @@ const heaps = { }, /** * Free the block in memory by identifier. - * @param {Number} id - Identifier of pointer + * @param {number} id - Identifier of pointer */ free: function(id) { - if (!BLOCKS.hasOwnProperty(id)) { + if (!Object.hasOwn(BLOCKS, id)) { throw new ErFailure( `Can't free a block in memory with identifier ${id} because it's not allocated`, ); diff --git a/eo2js-runtime/src/runtime/object.js b/eo2js-runtime/src/runtime/object.js index 4ce2d98..c32194c 100644 --- a/eo2js-runtime/src/runtime/object.js +++ b/eo2js-runtime/src/runtime/object.js @@ -14,8 +14,8 @@ let vertex = 0 /** * Object. - * @param {String} name - Name of the object - * @return {object} Object + * @param {string} name - Name of the object + * @returns {object} Object */ const object = function(name = 'object') { const vtx = ++vertex @@ -30,7 +30,7 @@ const object = function(name = 'object') { assets: {}, /** * Copy itself. - * @return {Object} - Copied object. + * @returns {object} - Copied object. */ copy: function() { const copy = object(name) @@ -46,8 +46,8 @@ const object = function(name = 'object') { }, /** * Set attributes or {@see DELTA} asset to the object. - * @param {Object} bindings - Attribute bindings - * @return {Object} - Self with attached attributes + * @param {object} bindings - Attribute bindings + * @returns {object} - Self with attached attributes * @throws ErFailure - If something wrong with bindings */ with: function(bindings) { @@ -83,32 +83,32 @@ const object = function(name = 'object') { }, /** * Retrieve object by attribute/asset name - * @param {String} name - Attribute/asset name - * @return {Object} - Retrieved attribute/asset by name + * @param {string} name - Attribute/asset name + * @returns {object} - Retrieved attribute/asset by name * @throws ErFailure - If something wrong with attribute/asset retrieving */ take: function(name) { name = String(name) let object - if (name === RHO && !this.attrs.hasOwnProperty(RHO)) { + if (name === RHO && !Object.hasOwn(this.attrs, RHO)) { object = at_rho().get() } else if (name === LAMBDA) { - if (this.attrs.hasOwnProperty(LAMBDA)) { + if (Object.hasOwn(this.attrs, LAMBDA)) { throw new ErFailure(`'${LAMBDA}' can't be used as attribute, only as asset`) } - if (!this.assets.hasOwnProperty(LAMBDA)) { + if (!Object.hasOwn(this.assets, LAMBDA)) { throw new ErFailure(`Can't take '${LAMBDA}' asset because it's absent`) } object = validated( () => safe(with_rho(this.assets[LAMBDA](this), this, name)) ) - } else if (this.attrs.hasOwnProperty(name)) { + } else if (Object.hasOwn(this.attrs, name)) { object = validated( () => safe(with_rho(this.attrs[name].get(), this, name)) ) - } else if (this.attrs.hasOwnProperty(PHI)) { + } else if (Object.hasOwn(this.attrs, PHI)) { object = this.take(PHI).take(name) - } else if (this.assets.hasOwnProperty(LAMBDA)) { + } else if (Object.hasOwn(this.assets, LAMBDA)) { object = this.take(LAMBDA).take(name) } else { throw new ErFailure(`Can't find '${name}' attribute in '${this.toString()}'`) @@ -117,15 +117,15 @@ const object = function(name = 'object') { }, /** * Retrieve data from the object - * @return {Array.} - Data + * @returns {Array.} - Data */ data: function() { let data - if (this.assets.hasOwnProperty(DELTA)) { + if (Object.hasOwn(this.assets, DELTA)) { data = this.assets[DELTA] - } else if (this.assets.hasOwnProperty(LAMBDA)) { + } else if (Object.hasOwn(this.assets, LAMBDA)) { data = this.take(LAMBDA).data() - } else if (this.attrs.hasOwnProperty(PHI)) { + } else if (Object.hasOwn(this.attrs, PHI)) { data = this.take(PHI).data() } else { throw new ErFailure(`There's no data in the object ${this.toString()}, can't take it`) @@ -134,14 +134,14 @@ const object = function(name = 'object') { }, /** * Print itself. - * @return {String} - String representation of object + * @returns {string} - String representation of object */ toString: function() { return `${name}ν${vtx}` }, /** * Forma of itself. - * @return {String} - Forma + * @returns {string} - Forma * @todo #61:30min Make forma contained full FQN of the object. Now forma of the object is the * last part of its FQN. For example, if object is 'org.eolang.int', it's forma is 'int' which * is wrong, it should be 'org.eolang.int'. So we need to fix this naming and make sure @@ -152,15 +152,15 @@ const object = function(name = 'object') { }, /** * Represent self as φ term. - * @return {String} - Self as φ calculus term + * @returns {string} - Self as φ calculus term */ φTerm: function() { const list = [] const binding = (left, right) => `${left} ↦ ${right}` - if (this.assets.hasOwnProperty(DELTA)) { + if (Object.hasOwn(this.assets, DELTA)) { list.push(binding(DELTA, `[${this.assets[DELTA].join(', ')}]`)) } - if (this.assets.hasOwnProperty(LAMBDA)) { + if (Object.hasOwn(this.assets, LAMBDA)) { list.push(binding(LAMBDA, 'Lambda')) } list.push( diff --git a/eo2js-runtime/src/runtime/once.js b/eo2js-runtime/src/runtime/once.js index 76ff7ef..0fe1628 100644 --- a/eo2js-runtime/src/runtime/once.js +++ b/eo2js-runtime/src/runtime/once.js @@ -1,7 +1,7 @@ /** * Evaluate object lazily only once. * @param {function(): object} callback - Function to evaluate - * @return {Object} - Lazily evaluated object + * @returns {object} - Lazily evaluated object */ const once = function(callback) { let cached = null diff --git a/eo2js-runtime/src/runtime/package.js b/eo2js-runtime/src/runtime/package.js index c498111..d12c162 100644 --- a/eo2js-runtime/src/runtime/package.js +++ b/eo2js-runtime/src/runtime/package.js @@ -10,10 +10,10 @@ const with_rho = require('./with-rho'); /** * Try to find an object by given directory and FQN. * Context "this" should be set to the object {@link pckg}. - * @param {String} dir - Relative directory where object may be placed - * @param {String} name - Name of the current object - * @param {array.} fqn - Parts of FQN of the object. E.g. ['org', 'eolang', 'int'] - * @return {Object|null} - Found object or null + * @param {string} dir - Relative directory where object may be placed + * @param {string} name - Name of the current object + * @param {Array.} fqn - Parts of FQN of the object. E.g. ['org', 'eolang', 'int'] + * @returns {object|null} - Found object or null */ const tryFind = function(dir, name, fqn) { let obj = null @@ -37,9 +37,9 @@ const tryFind = function(dir, name, fqn) { * we're in the "node_modules" directory (which means, that eo2js-runtime is used as * dependency). If so - tries to find object in main project directory. * Context "this" should be set to the object {@link pckg}. - * @param {String} name - Name of the object - * @param {String} full - FQN of the object - * @return {Object} - Found object + * @param {string} name - Name of the object + * @param {string} full - FQN of the object + * @returns {object} - Found object */ const found = function(name, full) { const split = full.split('.') @@ -55,9 +55,9 @@ const found = function(name, full) { /** * Package object. - * @param {String} fqn - FQN of package object + * @param {string} fqn - FQN of package object * @param {object} rho - Rho - * @return {object} - Package object + * @returns {object} - Package object */ const pckg = function(fqn, rho) { const obj = object(`Package '${fqn}'`) @@ -74,7 +74,7 @@ const pckg = function(fqn, rho) { } obj.take = function(name) { let obj - if (this.attrs.hasOwnProperty(name)) { + if (Object.hasOwn(this.attrs, name)) { obj = with_rho(this.attrs[name].get(), this, name) } else if (!name.includes('.')) { const before = this.assets[LAMBDA](this) diff --git a/eo2js-runtime/src/runtime/safe.js b/eo2js-runtime/src/runtime/safe.js index b1d0041..f195e2e 100644 --- a/eo2js-runtime/src/runtime/safe.js +++ b/eo2js-runtime/src/runtime/safe.js @@ -2,10 +2,10 @@ const validated = require('./validated'); const trapped = require('./trapped'); /** - * Object that catches {@link ErFailure} and - * throws {@link ErError} in its 'take' and 'with' methods. - * @param {Object} origin - Original object - * @return {Object} - Safe object + * Object that catches {@see ErFailure} and + * throws {@see ErError} in its 'take' and 'with' methods. + * @param {object} origin - Original object + * @returns {object} - Safe object */ const safe = function(origin) { return trapped( diff --git a/eo2js-runtime/src/runtime/taken.js b/eo2js-runtime/src/runtime/taken.js index 89c12f1..72c39da 100644 --- a/eo2js-runtime/src/runtime/taken.js +++ b/eo2js-runtime/src/runtime/taken.js @@ -2,9 +2,9 @@ const once = require('./once'); /** * Lazily taken attribute from the object. - * @param {Object} object - Object to take attribute from - * @param {String} attribute - Attribute name to take - * @return {Object} - Lazily taking attribute + * @param {object} object - Object to take attribute from + * @param {string} attribute - Attribute name to take + * @returns {object} - Lazily taking attribute */ const taken = function(object, attribute) { return once( diff --git a/eo2js-runtime/src/runtime/traced.js b/eo2js-runtime/src/runtime/traced.js index 953c364..b7b922b 100644 --- a/eo2js-runtime/src/runtime/traced.js +++ b/eo2js-runtime/src/runtime/traced.js @@ -19,11 +19,11 @@ const DATAIZING_CAGES = {} /** * Increment counter of cage in the {@link DATAIZING_CAGES}. - * @param {Number} locator - Locator of the cage - * @param {Number} depth - Depth of cage recursion + * @param {number} locator - Locator of the cage + * @param {number} depth - Depth of cage recursion */ const increment = function(locator, depth) { - if (!DATAIZING_CAGES.hasOwnProperty(locator)) { + if (!Object.hasOwn(DATAIZING_CAGES, locator)) { DATAIZING_CAGES[locator] = 1 } else { DATAIZING_CAGES[locator] = DATAIZING_CAGES[locator] + 1 @@ -37,10 +37,10 @@ const increment = function(locator, depth) { /** * Decrement counter of cage in the {@link DATAIZING_CAGES}. - * @param {Number} locator - Locator of the cage + * @param {number} locator - Locator of the cage */ const decrement = function(locator) { - if (DATAIZING_CAGES.hasOwnProperty(locator)) { + if (Object.hasOwn(DATAIZING_CAGES, locator)) { const count = DATAIZING_CAGES[locator] - 1 if (count === 0) { delete DATAIZING_CAGES[locator] @@ -52,10 +52,10 @@ const decrement = function(locator) { /** * Object that traces if the "cage.new" got into recursion during the dataization. - * @param {Object} object - Encaged object - * @param {Number} locator - Locator of the object - * @param {Number} depth - Max depth of cage recursion - * @return {Object} + * @param {object} object - Encaged object + * @param {number} locator - Locator of the object + * @param {number} depth - Max depth of cage recursion + * @returns {object} - Traced object */ const traced = function(object, locator, depth = RECURSION_THRESHOLD) { return trapped( diff --git a/eo2js-runtime/src/runtime/trapped.js b/eo2js-runtime/src/runtime/trapped.js index 7f936c3..aa766b3 100644 --- a/eo2js-runtime/src/runtime/trapped.js +++ b/eo2js-runtime/src/runtime/trapped.js @@ -1,8 +1,8 @@ /** * Trap for the functions of the object. * @param {any} object - Object - * @param {function(property: String, target: any, thisArg: any, args: any[]): any} apply - Function that overrides the default one - * @return {Object} - Trapped object + * @param {(property: string, target: any, thisArg: any, args: any[]) => any} apply - Function that overrides the default one + * @returns {object} - Trapped object */ const trapped = function(object, apply) { return new Proxy( diff --git a/eo2js-runtime/src/runtime/validated.js b/eo2js-runtime/src/runtime/validated.js index 9201f2c..a1cf37a 100644 --- a/eo2js-runtime/src/runtime/validated.js +++ b/eo2js-runtime/src/runtime/validated.js @@ -5,8 +5,8 @@ const {data} = require('./data'); /** * Validate given callback. * If catches {@link ErFailure} - throws {@link ErError}. - * @param {function(): Object} callback - Callback to validate - * @return {Object} - Callback result + * @param {function(): object} callback - Callback to validate + * @returns {object} - Callback result */ const validated = function(callback) { try { diff --git a/eo2js-runtime/src/runtime/with-rho.js b/eo2js-runtime/src/runtime/with-rho.js index 1c31db7..ec83fa0 100644 --- a/eo2js-runtime/src/runtime/with-rho.js +++ b/eo2js-runtime/src/runtime/with-rho.js @@ -3,14 +3,14 @@ const at_rho = require('./attribute/at-rho'); /** * Set rho attribute to the object if it does not have one. - * @param {Object} object - Object to set rho attribute to - * @param {Object} rho - Rho object - * @param {String} name - Name of the object as attribute - * @return {Object} The same object if it already has rho attribute or new copy of the object with injected rho + * @param {object} object - Object to set rho attribute to + * @param {object} rho - Rho object + * @param {string} name - Name of the object as attribute + * @returns {object} The same object if it already has rho attribute or new copy of the object with injected rho */ const with_rho = function(object, rho, name) { let obj = object - if (name !== RHO && !object.attrs.hasOwnProperty(RHO)) { + if (name !== RHO && !Object.hasOwn(object.attrs, RHO)) { obj = obj.copy() obj.attrs[RHO] = at_rho(rho) } diff --git a/eo2js-runtime/test/fake/org/eolang/bytes.js b/eo2js-runtime/test/fake/org/eolang/bytes.js index fd6655d..fe2bb0f 100644 --- a/eo2js-runtime/test/fake/org/eolang/bytes.js +++ b/eo2js-runtime/test/fake/org/eolang/bytes.js @@ -2,8 +2,7 @@ * Fake bytes EO object that is used for the test purposes. * Don't change the file until you definitely know what you're doing. * For more information please read README.md in test/fake folder - * @param {Object} sigma - Sigma - * @return {Object} - Object + * @returns {object} - Object */ const bytes = function() { const object = require('../../../runtime/object') diff --git a/eo2js-runtime/test/fake/org/eolang/cage.js b/eo2js-runtime/test/fake/org/eolang/cage.js index 9f2a117..dc9c7f0 100644 --- a/eo2js-runtime/test/fake/org/eolang/cage.js +++ b/eo2js-runtime/test/fake/org/eolang/cage.js @@ -2,7 +2,7 @@ * Fake CAGE EO object that is used for the test purposes. * Don't change the file until you definitely know what you're doing. * For more information please read README.md in test/fake folder - * @return {Object} - Object + * @returns {object} - Object */ const cage = function() { const object = require('../../../runtime/object') @@ -39,7 +39,7 @@ const cage = function() { * Fake CAGE.ENCAGED EO object that is used for the test purposes. * Don't change the file until you definitely know what you're doing. * For more information please read README.md in test/fake folder - * @return {Object} - Object + * @returns {object} - Object */ const cage$encaged = function() { const object = require('../../../runtime/object') diff --git a/eo2js-runtime/test/fake/org/eolang/false.js b/eo2js-runtime/test/fake/org/eolang/false.js index 4d6e915..054d7c9 100644 --- a/eo2js-runtime/test/fake/org/eolang/false.js +++ b/eo2js-runtime/test/fake/org/eolang/false.js @@ -2,7 +2,7 @@ * Fake FALSE EO object that is used for the test purposes. * Don't change the file until you definitely know what you're doing. * For more information please read README.md in test/fake folder - * @return {Object} - Object + * @returns {object} - Object */ const _false = function() { const object = require('../../../runtime/object') diff --git a/eo2js-runtime/test/fake/org/eolang/float.js b/eo2js-runtime/test/fake/org/eolang/float.js index 447cacc..6aba437 100644 --- a/eo2js-runtime/test/fake/org/eolang/float.js +++ b/eo2js-runtime/test/fake/org/eolang/float.js @@ -2,7 +2,7 @@ * Fake float EO object that is used for the test purposes. * Don't change the file until you definitely know what you're doing. * For more information please read README.md in test/fake folder - * @return {Object} - Object + * @returns {object} - Object */ const float = function() { const object = require('../../../runtime/object') diff --git a/eo2js-runtime/test/fake/org/eolang/int.js b/eo2js-runtime/test/fake/org/eolang/int.js index 2bd15c0..b24f0d7 100644 --- a/eo2js-runtime/test/fake/org/eolang/int.js +++ b/eo2js-runtime/test/fake/org/eolang/int.js @@ -2,7 +2,7 @@ * Fake int EO object that is used for the test purposes. * Don't change the file until you definitely know what you're doing. * For more information please read README.md in test/fake folder - * @return {Object} - Object + * @returns {object} - Object */ const int = function() { const object = require('../../../runtime/object') diff --git a/eo2js-runtime/test/fake/org/eolang/string.js b/eo2js-runtime/test/fake/org/eolang/string.js index 6c5705c..7f8f804 100644 --- a/eo2js-runtime/test/fake/org/eolang/string.js +++ b/eo2js-runtime/test/fake/org/eolang/string.js @@ -2,7 +2,7 @@ * Fake string EO object that is used for the test purposes. * Don't change the file until you definitely know what you're doing. * For more information please read README.md in test/fake folder - * @return {Object} - Object + * @returns {object} - Object */ const string = function() { const object = require('../../../runtime/object') diff --git a/eo2js-runtime/test/fake/org/eolang/true.js b/eo2js-runtime/test/fake/org/eolang/true.js index 38f49fb..fa3a6e5 100644 --- a/eo2js-runtime/test/fake/org/eolang/true.js +++ b/eo2js-runtime/test/fake/org/eolang/true.js @@ -2,7 +2,7 @@ * Fake true EO object that is used for the test purposes. * Don't change the file until you definitely know what you're doing. * For more information please read README.md in test/fake folder - * @return {Object} - Object + * @returns {object} - Object */ const _true = function() { const object = require('../../../runtime/object') diff --git a/eo2js-runtime/test/objects/org/eolang/cage.test.js b/eo2js-runtime/test/objects/org/eolang/cage.test.js index 1aa19ce..1332eee 100644 --- a/eo2js-runtime/test/objects/org/eolang/cage.test.js +++ b/eo2js-runtime/test/objects/org/eolang/cage.test.js @@ -10,8 +10,8 @@ const {RECURSION_THRESHOLD} = require('../../../../src/runtime/traced'); /** * Encaged object. - * @param {Object} object - Object to encage - * @return {Object} - Cage + * @param {object} object - Object to encage + * @returns {object} - Cage */ const encaged = function(object) { return phi.take('org.eolang.cage').with({ @@ -21,8 +21,8 @@ const encaged = function(object) { /** * Encage given object to given cage. - * @param {Object} cage - Cage - * @param {Object} obj - Object to encage + * @param {object} cage - Cage + * @param {object} obj - Object to encage */ const encageTo = function(cage, obj) { dataized(cage.take('encage').with({ @@ -32,8 +32,8 @@ const encageTo = function(cage, obj) { /** * Dummy object. - * @param {Number} num - * @return {Object} - Dummy object + * @param {number} num - Number + * @returns {object} - Dummy object */ const dummy = function(num) { const obj = object('dummy') @@ -43,9 +43,9 @@ const dummy = function(num) { /** * Recursive dummy. - * @param {Object} cage - Cage - * @param {Number} depth - Depth - * @return {Object} - Recursive dummy + * @param {object} cage - Cage + * @param {number} depth - Depth + * @returns {object} - Recursive dummy */ const recursiveDummy = function(cage, depth) { let counter = 0 diff --git a/eo2js-runtime/test/objects/org/eolang/try.test.js b/eo2js-runtime/test/objects/org/eolang/try.test.js index ea5bb93..52ae7e7 100644 --- a/eo2js-runtime/test/objects/org/eolang/try.test.js +++ b/eo2js-runtime/test/objects/org/eolang/try.test.js @@ -17,8 +17,8 @@ const MESSAGE = 'something is broken' /** * Broken object that throws {@link ErFailure}. - * @param {String} name - Name of the attribute or asset - * @return {Object} - Broken + * @param {string} name - Name of the attribute or asset + * @returns {object} - Broken */ const broken = function(name) { const obj = object('broken') @@ -36,7 +36,7 @@ const broken = function(name) { /** * Not broken main object for try. - * @return {Object} - Object + * @returns {object} - Object */ const main = function() { const obj = object('main') @@ -46,7 +46,7 @@ const main = function() { /** * Catcher. - * @return {Object} - Catcher + * @returns {object} - Catcher */ const catcher = function() { const obj = object('catcher') @@ -57,7 +57,7 @@ const catcher = function() { /** * Nop. - * @return {Object} - Nop + * @returns {object} - Nop */ const nop = function() { const obj = object('nop') @@ -67,9 +67,9 @@ const nop = function() { /** * Build try object. - * @param {Object} main - Main attribute - * @param {Object} [final] - Finally attribute - * @return {Object} - Try object + * @param {object} main - Main attribute + * @param {object} [final] - Finally attribute + * @returns {object} - Try object */ const tryObj = function(main, final) { return tr().with({ diff --git a/eo2js-runtime/test/regular.js b/eo2js-runtime/test/regular.js new file mode 100644 index 0000000..cf41fbc --- /dev/null +++ b/eo2js-runtime/test/regular.js @@ -0,0 +1,5 @@ +const assert = require('assert') + +it('', function() { + assert.ok(true) +}) \ No newline at end of file diff --git a/eo2js-runtime/test/runtime/data.test.js b/eo2js-runtime/test/runtime/data.test.js index beee733..0bf7d8b 100644 --- a/eo2js-runtime/test/runtime/data.test.js +++ b/eo2js-runtime/test/runtime/data.test.js @@ -3,12 +3,15 @@ const {data, INT, STRING, FLOAT, BOOL} = require('../../temp/runtime/data') const dataized = require('../../temp/runtime/dataized'); const isObject = function(obj) { - return obj.hasOwnProperty('attrs') && - obj.hasOwnProperty('assets') && - obj.hasOwnProperty('take') && - obj.hasOwnProperty('copy') && - obj.hasOwnProperty('with') && - obj.hasOwnProperty('toString') + return Object.hasOwn(obj, 'attrs') && + Object.hasOwn(obj, 'assets') && + Object.hasOwn(obj, 'take') && + Object.hasOwn(obj, 'copy') && + Object.hasOwn(obj, 'with') && + Object.hasOwn(obj, 'data') && + Object.hasOwn(obj, 'forma') && + Object.hasOwn(obj, 'φTerm') && + Object.hasOwn(obj, 'toString') } describe('data', function() { diff --git a/eo2js-runtime/test/runtime/object.test.js b/eo2js-runtime/test/runtime/object.test.js index 86791b5..90291bb 100644 --- a/eo2js-runtime/test/runtime/object.test.js +++ b/eo2js-runtime/test/runtime/object.test.js @@ -10,7 +10,7 @@ const at_rho = require('../../temp/runtime/attribute/at-rho'); describe('object', function() { it(`should not have ${RHO} attribute at the beginning`, function() { - assert.ok(!object().attrs.hasOwnProperty(RHO)) + assert.ok(!(RHO in object().attrs)) }) it(`should have empty assets`, function() { assert.equal(Object.keys(object().assets).length, 0) diff --git a/eo2js-runtime/test/runtime/package.test.js b/eo2js-runtime/test/runtime/package.test.js index 90b9203..a3ee730 100644 --- a/eo2js-runtime/test/runtime/package.test.js +++ b/eo2js-runtime/test/runtime/package.test.js @@ -17,7 +17,7 @@ describe('package object', function() { assert.deepStrictEqual(phi.take('').take(RHO), phi) }) it(`should have ${RHO} attribute`, function() { - assert.ok(pckg('', {}).attrs.hasOwnProperty(RHO)) + assert.ok(RHO in pckg('', {}).attrs) }) describe('#take()', function() { it('should return next level package object', function() { @@ -90,7 +90,7 @@ describe('package object', function() { describe('"org"', function() { it(`should have ${RHO} attributes`, function() { const obj = pckg('', {}).take('org') - assert.ok(obj.attrs.hasOwnProperty(RHO)) + assert.ok(RHO in obj.attrs) }) describe('#with()', function() { it('should fail on put', function() { diff --git a/eo2js/.eslintrc.json b/eo2js/.eslintrc.json deleted file mode 100644 index 7c94be9..0000000 --- a/eo2js/.eslintrc.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "env": { - "es6": true - }, - "extends": "google", - "rules": { - "semi": "off", - "comma-dangle": "off", - "indent": [ "error", 2 ], - "camelcase": "off", - "max-len": [ "error", { "code": 300 } ] - }, - "parserOptions": { - "ecmaVersion": 2019 - } -} diff --git a/eo2js/Gruntfile.js b/eo2js/Gruntfile.js index dc4d731..5fc390d 100644 --- a/eo2js/Gruntfile.js +++ b/eo2js/Gruntfile.js @@ -12,7 +12,7 @@ module.exports = function(grunt) { }, eslint: { options: { - overrideConfigFile: '.eslintrc.json', + overrideConfigFile: 'eslint.config.js', }, target: ['Gruntfile.js', 'src/**/*.js', 'test/**/*.js'], }, diff --git a/eo2js/eslint.config.js b/eo2js/eslint.config.js new file mode 100644 index 0000000..2434ea1 --- /dev/null +++ b/eo2js/eslint.config.js @@ -0,0 +1,36 @@ +const js = require('@eslint/js') +const jsdoc = require('eslint-plugin-jsdoc') +const globals = require('globals') + +module.exports = [ + js.configs.recommended, + jsdoc.configs['flat/recommended'], + { + plugins: { + jsdoc + }, + files: ["**/*.js"], + rules: { + "jsdoc/require-description": "error", + "jsdoc/check-values": "error" + } + }, + { + rules: { + semi: 'off', + 'comma-dangle': 'off', + indent: ['error', 2], + camelcase: 'off', + 'max-len': ['error', {'code': 300}], + 'no-unused-vars': ['error', {argsIgnorePattern: '^_'}], + }, + languageOptions: { + globals: { + ...globals.node, + ...globals.mocha, + }, + ecmaVersion: 'latest', + sourceType: 'commonjs', + } + } +] \ No newline at end of file diff --git a/eo2js/package-lock.json b/eo2js/package-lock.json index 32a20b3..982aee2 100644 --- a/eo2js/package-lock.json +++ b/eo2js/package-lock.json @@ -19,12 +19,13 @@ "devDependencies": { "eslint": "9.5.0", "eslint-config-google": "0.14.0", + "eslint-plugin-jsdoc": "^48.5.0", "grunt": "^1.6.1", "grunt-contrib-clean": "2.0.1", - "grunt-eslint": "24.3.0", + "grunt-eslint": "25.0.0", "grunt-mocha-cli": "^7.0.0", "jspath": "0.4.0", - "mocha": "^10.3.0", + "mocha": "^10.5.2", "xslt3": "^2.6.0" } }, @@ -37,6 +38,24 @@ "node": ">=0.10.0" } }, + "node_modules/@es-joy/jsdoccomment": { + "version": "0.43.1", + "resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.43.1.tgz", + "integrity": "sha512-I238eDtOolvCuvtxrnqtlBaw0BwdQuYqK7eA6XIonicMdOOOb75mqdIzkGDUbS04+1Di007rgm9snFRNeVrOog==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/eslint": "^8.56.5", + "@types/estree": "^1.0.5", + "@typescript-eslint/types": "^7.2.0", + "comment-parser": "1.4.1", + "esquery": "^1.5.0", + "jsdoc-type-pratt-parser": "~4.0.0" + }, + "engines": { + "node": ">=16" + } + }, "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", @@ -179,13 +198,6 @@ "url": "https://github.com/sponsors/nzakas" } }, - "node_modules/@humanwhocodes/object-schema": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz", - "integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==", - "dev": true, - "license": "BSD-3-Clause" - }, "node_modules/@humanwhocodes/retry": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.3.0.tgz", @@ -235,6 +247,58 @@ "node": ">= 8" } }, + "node_modules/@pkgr/core": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@pkgr/core/-/core-0.1.1.tgz", + "integrity": "sha512-cq8o4cWH0ibXh9VGi5P20Tu9XF/0fFXl9EUinr9QfTM7a7p0oTA4iJRCQWppXR1Pg8dSM0UCItCkPwsk9qWWYA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.20.0 || ^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/unts" + } + }, + "node_modules/@types/eslint": { + "version": "8.56.10", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.56.10.tgz", + "integrity": "sha512-Shavhk87gCtY2fhXDctcfS3e6FdxWkCx1iUZ9eEUbh7rTqlZT0/IzOkCOVt0fCjcFuZ9FPYfuezTBImfHCDBGQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "*", + "@types/json-schema": "*" + } + }, + "node_modules/@types/estree": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", + "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/json-schema": { + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@typescript-eslint/types": { + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.14.1.tgz", + "integrity": "sha512-mL7zNEOQybo5R3AavY+Am7KLv8BorIv7HCYS5rKoNZKQD9tsfGUpO4KdAn3sSUvTiS4PQkr2+K0KJbxj8H9NDg==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, "node_modules/@ungap/promise-all-settled": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz", @@ -242,13 +306,6 @@ "dev": true, "license": "ISC" }, - "node_modules/@ungap/structured-clone": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", - "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", - "dev": true, - "license": "ISC" - }, "node_modules/abbrev": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", @@ -340,6 +397,16 @@ "node": ">= 8" } }, + "node_modules/are-docs-informative": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/are-docs-informative/-/are-docs-informative-0.0.2.tgz", + "integrity": "sha512-ixiS0nLNNG5jNQzgZJNoUpBKdo9yTYZMGJ+QgT2jmjR7G7+QHRCc4v6LQ3NgE7EBJq+o0ams3waJwkrlBom8Ig==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14" + } + }, "node_modules/argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", @@ -565,6 +632,16 @@ "node": ">=18" } }, + "node_modules/comment-parser": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-1.4.1.tgz", + "integrity": "sha512-buhp5kePrmda3vhc5B9t7pUQXAb2Tnd0qgpkIhPhkHXxJpiPJ11H0ZEU0oBpJ2QztSbzG/ZxMj/CHsYJqRHmyg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 12.0.0" + } + }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -661,24 +738,19 @@ "node": ">=0.3.1" } }, - "node_modules/doctrine": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", - "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", - "dev": true, - "dependencies": { - "esutils": "^2.0.2" - }, - "engines": { - "node": ">=6.0.0" - } - }, "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/es-module-lexer": { + "version": "1.5.4", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.5.4.tgz", + "integrity": "sha512-MVNK56NiMrOwitFB7cqDwq0CQutbw+0BvLshJSse0MUNU+y1FC3bUS/AQg7oUng+/wKrrki7JfmwtVHkVfPLlw==", + "dev": true, + "license": "MIT" + }, "node_modules/escalade": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", @@ -764,6 +836,31 @@ "eslint": ">=5.16.0" } }, + "node_modules/eslint-plugin-jsdoc": { + "version": "48.5.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-48.5.0.tgz", + "integrity": "sha512-ukXPNpGby3KjCveCizIS8t1EbuJEHYEu/tBg8GCbn/YbHcXwphyvYCdvRZ/oMRfTscGSSzfsWoZ+ZkAP0/6YMQ==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@es-joy/jsdoccomment": "~0.43.1", + "are-docs-informative": "^0.0.2", + "comment-parser": "1.4.1", + "debug": "^4.3.4", + "escape-string-regexp": "^4.0.0", + "esquery": "^1.5.0", + "parse-imports": "^2.1.0", + "semver": "^7.6.2", + "spdx-expression-parse": "^4.0.0", + "synckit": "^0.9.0" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0 || ^9.0.0" + } + }, "node_modules/eslint-scope": { "version": "8.0.1", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.0.1.tgz", @@ -1295,12 +1392,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/graphemer": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", - "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", - "dev": true - }, "node_modules/growl": { "version": "1.10.5", "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", @@ -1441,16 +1532,17 @@ } }, "node_modules/grunt-eslint": { - "version": "24.3.0", - "resolved": "https://registry.npmjs.org/grunt-eslint/-/grunt-eslint-24.3.0.tgz", - "integrity": "sha512-dUPiRgX8fhmh4uwTAn9xrzg7HV5j5DhGmZZGJdHfjy/AN9G4jD+5IjfbcAJ209JcIG8m4B7xz3crIhuDSm3siQ==", + "version": "25.0.0", + "resolved": "https://registry.npmjs.org/grunt-eslint/-/grunt-eslint-25.0.0.tgz", + "integrity": "sha512-JIV5IPgOuacorFLmYtUTq0n+0qGIL9FSQJ4KVnNfCg/8Fm+K1t6OWrzXXI8TxWTwq2K9E3parFVXCpn1sGLbKQ==", "dev": true, + "license": "MIT", "dependencies": { "chalk": "^4.1.2", - "eslint": "^8.44.0" + "eslint": "^9.0.0" }, "engines": { - "node": ">=12" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -1459,227 +1551,6 @@ "grunt": ">=1" } }, - "node_modules/grunt-eslint/node_modules/@eslint/eslintrc": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", - "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "ajv": "^6.12.4", - "debug": "^4.3.2", - "espree": "^9.6.0", - "globals": "^13.19.0", - "ignore": "^5.2.0", - "import-fresh": "^3.2.1", - "js-yaml": "^4.1.0", - "minimatch": "^3.1.2", - "strip-json-comments": "^3.1.1" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/grunt-eslint/node_modules/@eslint/js": { - "version": "8.57.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.0.tgz", - "integrity": "sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - } - }, - "node_modules/grunt-eslint/node_modules/@humanwhocodes/config-array": { - "version": "0.11.14", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz", - "integrity": "sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@humanwhocodes/object-schema": "^2.0.2", - "debug": "^4.3.1", - "minimatch": "^3.0.5" - }, - "engines": { - "node": ">=10.10.0" - } - }, - "node_modules/grunt-eslint/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/grunt-eslint/node_modules/eslint": { - "version": "8.57.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.0.tgz", - "integrity": "sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@eslint-community/eslint-utils": "^4.2.0", - "@eslint-community/regexpp": "^4.6.1", - "@eslint/eslintrc": "^2.1.4", - "@eslint/js": "8.57.0", - "@humanwhocodes/config-array": "^0.11.14", - "@humanwhocodes/module-importer": "^1.0.1", - "@nodelib/fs.walk": "^1.2.8", - "@ungap/structured-clone": "^1.2.0", - "ajv": "^6.12.4", - "chalk": "^4.0.0", - "cross-spawn": "^7.0.2", - "debug": "^4.3.2", - "doctrine": "^3.0.0", - "escape-string-regexp": "^4.0.0", - "eslint-scope": "^7.2.2", - "eslint-visitor-keys": "^3.4.3", - "espree": "^9.6.1", - "esquery": "^1.4.2", - "esutils": "^2.0.2", - "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^6.0.1", - "find-up": "^5.0.0", - "glob-parent": "^6.0.2", - "globals": "^13.19.0", - "graphemer": "^1.4.0", - "ignore": "^5.2.0", - "imurmurhash": "^0.1.4", - "is-glob": "^4.0.0", - "is-path-inside": "^3.0.3", - "js-yaml": "^4.1.0", - "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.4.1", - "lodash.merge": "^4.6.2", - "minimatch": "^3.1.2", - "natural-compare": "^1.4.0", - "optionator": "^0.9.3", - "strip-ansi": "^6.0.1", - "text-table": "^0.2.0" - }, - "bin": { - "eslint": "bin/eslint.js" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/grunt-eslint/node_modules/eslint-scope": { - "version": "7.2.2", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", - "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", - "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^5.2.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/grunt-eslint/node_modules/espree": { - "version": "9.6.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", - "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", - "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "acorn": "^8.9.0", - "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^3.4.1" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/grunt-eslint/node_modules/file-entry-cache": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", - "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", - "dev": true, - "license": "MIT", - "dependencies": { - "flat-cache": "^3.0.4" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - } - }, - "node_modules/grunt-eslint/node_modules/flat-cache": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", - "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", - "dev": true, - "license": "MIT", - "dependencies": { - "flatted": "^3.2.9", - "keyv": "^4.5.3", - "rimraf": "^3.0.2" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - } - }, - "node_modules/grunt-eslint/node_modules/glob-parent": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", - "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", - "dev": true, - "license": "ISC", - "dependencies": { - "is-glob": "^4.0.3" - }, - "engines": { - "node": ">=10.13.0" - } - }, - "node_modules/grunt-eslint/node_modules/globals": { - "version": "13.24.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", - "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "type-fest": "^0.20.2" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/grunt-eslint/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/grunt-known-options": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/grunt-known-options/-/grunt-known-options-2.0.0.tgz", @@ -2323,6 +2194,16 @@ "js-yaml": "bin/js-yaml.js" } }, + "node_modules/jsdoc-type-pratt-parser": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-4.0.0.tgz", + "integrity": "sha512-YtOli5Cmzy3q4dP26GraSOeAhqecewG04hoO8DY56CH4KJ9Fvv5qKWUCCo3HZob7esJQHCv6/+bnTy72xZZaVQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.0.0" + } + }, "node_modules/json-buffer": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", @@ -2775,6 +2656,20 @@ "node": ">=0.8" } }, + "node_modules/parse-imports": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/parse-imports/-/parse-imports-2.1.0.tgz", + "integrity": "sha512-JQWgmK2o4w8leUkZeZPatWdAny6vXGU/3siIUvMF6J2rDCud9aTt8h/px9oZJ6U3EcfhngBJ635uPFI0q0VAeA==", + "dev": true, + "license": "Apache 2.0", + "dependencies": { + "es-module-lexer": "^1.5.3", + "slashes": "^3.0.12" + }, + "engines": { + "node": ">= 18" + } + }, "node_modules/parse-passwd": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", @@ -2984,67 +2879,6 @@ "node": ">=0.10.0" } }, - "node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, - "license": "ISC", - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/rimraf/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/rimraf/node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "dev": true, - "license": "ISC", - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/rimraf/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", @@ -3102,6 +2936,19 @@ "axios": "^1.5.1" } }, + "node_modules/semver": { + "version": "7.6.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", + "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/serialize-javascript": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", @@ -3132,6 +2979,38 @@ "node": ">=8" } }, + "node_modules/slashes": { + "version": "3.0.12", + "resolved": "https://registry.npmjs.org/slashes/-/slashes-3.0.12.tgz", + "integrity": "sha512-Q9VME8WyGkc7pJf6QEkj3wE+2CnvZMI+XJhwdTPR8Z/kWQRXi7boAWLDibRPyHRTUTPx5FaU7MsyrjI3yLB4HA==", + "dev": true, + "license": "ISC" + }, + "node_modules/spdx-exceptions": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.5.0.tgz", + "integrity": "sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w==", + "dev": true, + "license": "CC-BY-3.0" + }, + "node_modules/spdx-expression-parse": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-4.0.0.tgz", + "integrity": "sha512-Clya5JIij/7C6bRR22+tnGXbc4VKlibKSVj2iHvVeX5iMW7s1SIQlqu699JkODJJIhh/pUu8L0/VLh8xflD+LQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-license-ids": { + "version": "3.0.18", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.18.tgz", + "integrity": "sha512-xxRs31BqRYHwiMzudOrpSiHtZ8i/GeionCBDSilhYRj+9gIcI8wCZTlXZKu9vZIVqViP3dcp9qE5G6AlIaD+TQ==", + "dev": true, + "license": "CC0-1.0" + }, "node_modules/sprintf-js": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.3.tgz", @@ -3208,6 +3087,23 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/synckit": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.9.0.tgz", + "integrity": "sha512-7RnqIMq572L8PeEzKeBINYEJDDxpcH8JEgLwUqBd3TkofhFRbkq4QLR0u+36avGAhCRbk2nnmjcW9SE531hPDg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@pkgr/core": "^0.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/unts" + } + }, "node_modules/text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", @@ -3226,6 +3122,13 @@ "node": ">=8.0" } }, + "node_modules/tslib": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.3.tgz", + "integrity": "sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==", + "dev": true, + "license": "0BSD" + }, "node_modules/type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", @@ -3238,19 +3141,6 @@ "node": ">= 0.8.0" } }, - "node_modules/type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", - "dev": true, - "license": "(MIT OR CC0-1.0)", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/unc-path-regex": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/unc-path-regex/-/unc-path-regex-0.1.2.tgz", diff --git a/eo2js/package.json b/eo2js/package.json index ca184c4..83cc110 100644 --- a/eo2js/package.json +++ b/eo2js/package.json @@ -24,13 +24,14 @@ }, "devDependencies": { "grunt": "^1.6.1", - "mocha": "^10.3.0", + "mocha": "^10.5.2", "xslt3": "^2.6.0", "eslint": "9.5.0", "eslint-config-google": "0.14.0", "grunt-contrib-clean": "2.0.1", - "grunt-eslint": "24.3.0", + "grunt-eslint": "25.0.0", "grunt-mocha-cli": "^7.0.0", + "eslint-plugin-jsdoc": "^48.5.0", "jspath": "0.4.0" } } diff --git a/eo2js/src/commands/dataize.js b/eo2js/src/commands/dataize.js index bdcb064..0e51240 100644 --- a/eo2js/src/commands/dataize.js +++ b/eo2js/src/commands/dataize.js @@ -4,9 +4,9 @@ const {execSync} = require('child_process') /** * Dataize command. - * @param {String} obj - Entry object - * @param {Array..} args - EO program arguments - * @param {{target: String, project: String}} options - Program options + * @param {string} obj - Entry object + * @param {Array.} args - EO program arguments + * @param {{target: string, project: string}} options - Program options */ const dataize = function(obj, args, options) { options = {...program.opts(), ...options} diff --git a/eo2js/src/commands/link.js b/eo2js/src/commands/link.js index 2ec3924..6489fa7 100644 --- a/eo2js/src/commands/link.js +++ b/eo2js/src/commands/link.js @@ -12,9 +12,9 @@ const main = '__main__.js' /** * Data to insert to package.json file. * If path to local dependency is present - eo2js-runtime dependency won't be added. - * @param {String} [runtime] - Path to local eo-runtime dependency + * @param {string} [runtime] - Path to local eo-runtime dependency * @param {boolean} [tests] - Add dependencies for testing - * @return {{author: string, name: string, version: string}} - The content for package.json file + * @returns {{author: string, name: string, version: string}} - The content for package.json file */ const pckg = function(runtime, tests) { const def = { @@ -41,7 +41,7 @@ const pckg = function(runtime, tests) { /** * Build npm project. - * @param {{target: String, project: String, resources: String, dependency: ?String, tests: ?boolean}} options - Program options + * @param {{target: string, project: string, resources: string, dependency: ?string, tests: ?boolean}} options - Program options */ const link = function(options) { options = {...program.opts(), ...options} diff --git a/eo2js/src/commands/test.js b/eo2js/src/commands/test.js index 9c085f0..b20f429 100644 --- a/eo2js/src/commands/test.js +++ b/eo2js/src/commands/test.js @@ -4,7 +4,7 @@ const {execSync} = require('child_process') /** * Test command. - * @param {{target: String, project: String, exclude: String}} options - Program options + * @param {{target: string, project: string, exclude: string}} options - Program options */ const test = function(options) { options = {...program.opts(), ...options} diff --git a/eo2js/src/commands/transpile.js b/eo2js/src/commands/transpile.js index bcdc904..ff035f2 100644 --- a/eo2js/src/commands/transpile.js +++ b/eo2js/src/commands/transpile.js @@ -22,8 +22,8 @@ const dir = '8-transpile' * - name org.eolang.int + pckg '' -> path org/eolang/int * - name org.eolang.int.test + pckg org.eolang -> path org/eolang/int.test * If name ends with ".test" and package - * @param {String} name - Name of the object. May contain dots - * @return {String} - path from object name + * @param {string} name - Name of the object. May contain dots + * @returns {string} - path from object name */ const pathFromName = function(name) { return name.replace(/\./g, path.sep) @@ -31,7 +31,7 @@ const pathFromName = function(name) { /** * Make directory if not exist. - * @param {String} dir - Directory + * @param {string} dir - Directory */ const makeDirIfNotExist = function(dir) { if (!fs.existsSync(dir)) { @@ -42,15 +42,15 @@ const makeDirIfNotExist = function(dir) { /** * Check if given XMIR has meta. * @param {any} xmir - XMIR - * @param {String} name - Name of the meta - * @return {boolean} - If given XMIR has tests meta or not + * @param {string} name - Name of the meta + * @returns {boolean} - If given XMIR has tests meta or not */ const hasMeta = function(xmir, name) { const metas = xmir.program.metas.meta let res = false if (Array.isArray(metas)) { res = metas.findIndex((meta) => meta.head === name) !== -1 - } else if (typeof metas === 'object' && metas.hasOwnProperty('head')) { + } else if (typeof metas === 'object' && Object.hasOwn(metas, 'head')) { res = metas.head === name } return res @@ -58,9 +58,9 @@ const hasMeta = function(xmir, name) { /** * Transform XMIR from given tojo and save. - * @param {Object} tojo - Tojo. - * @param {{target: String, project: String}} options - Program options - * @param {Array.} transformations - List of transformations to apply to XMIR + * @param {object} tojo - Tojo. + * @param {{target: string, project: string}} options - Program options + * @param {Array.} transformations - List of transformations to apply to XMIR * @param {any} parser - XML parser */ const transform = function(tojo, options, transformations, parser) { @@ -84,7 +84,7 @@ const transform = function(tojo, options, transformations, parser) { if (!Array.isArray(objects)) { objects = [objects] } - const filtered = objects.filter((obj) => !!obj && obj.hasOwnProperty('javascript') && !obj.hasOwnProperty('@_atom')) + const filtered = objects.filter((obj) => !!obj && Object.hasOwn(obj, 'javascript') && !Object.hasOwn(obj, '@_atom')) const isTest = hasMeta(xml, 'tests') const count = isTest ? 0 : 1 if (filtered.length > count) { @@ -98,7 +98,7 @@ const transform = function(tojo, options, transformations, parser) { /** * Transpile XMIR to JavaScript. - * @param {{foreign: String, project: String, resources: String}} options - Transpile command options + * @param {{foreign: string, project: string, resources: string}} options - Transpile command options */ const transpile = function(options) { options = {...program.opts(), ...options} @@ -116,7 +116,7 @@ const transpile = function(options) { const project = path.resolve(options['target'], options['project']) fs.mkdirSync(project, {recursive: true}) JSON.parse(fs.readFileSync(foreign).toString()) - .filter((tojo) => tojo.hasOwnProperty(verified)) + .filter((tojo) => Object.hasOwn(tojo, verified)) .forEach((tojo) => transform( tojo, {target: options['target'], project}, diff --git a/eo2js/src/compile-stylesheets.js b/eo2js/src/compile-stylesheets.js index 692eb0a..0323d2d 100644 --- a/eo2js/src/compile-stylesheets.js +++ b/eo2js/src/compile-stylesheets.js @@ -9,27 +9,29 @@ const ext = '.sef.json' /** * Compile style sheet from given source - * @param {String} source - Source XSL - * @param {String} dest - Destination - * @return {String} - Stdout + * @param {string} source - Source XSL + * @param {string} dest - Destination + * @returns {string} - Stdout */ const compile = function(source, dest) { console.log(`Recompiling ${source}`) + let out = "" try { - return execSync( + out = execSync( [ 'node node_modules/xslt3/xslt3.js', `-xsl:${source}`, `-export:${dest}` ].join(' ') ).toString() - } catch (e) { + } catch (_) { /* eslint-disable-line */ } + return out } /** * Compile XLS stylesheets to JSON. - * @param {Array.|undefined} [names] - names of stylesheets to compile + * @param {Array.|undefined} [names] - names of stylesheets to compile */ const compileStylesheets = function(names) { console.log('Recompiling stylesheets...') diff --git a/eo2js/test/commands/link.test.js b/eo2js/test/commands/link.test.js index eff85e7..c20596d 100644 --- a/eo2js/test/commands/link.test.js +++ b/eo2js/test/commands/link.test.js @@ -12,8 +12,8 @@ describe('link', function() { }) /** * Run "link" command. - * @param {String} [args] - Arguments - * @return {String} - Stdout. + * @param {string} [args] - Arguments + * @returns {string} - Stdout. */ const link = function(...args) { return runSync([ diff --git a/eo2js/test/commands/transpile.test.js b/eo2js/test/commands/transpile.test.js index 363648b..66bcba7 100644 --- a/eo2js/test/commands/transpile.test.js +++ b/eo2js/test/commands/transpile.test.js @@ -37,8 +37,8 @@ describe('transpile', function() { }) /** * Call transpile command. - * @param {String} name - Name of the object to transpile - * @return {String} - Stdout + * @param {string} name - Name of the object to transpile + * @returns {string} - Stdout */ const transpile = function(name = 'simple') { const verified = path.resolve(target, `6-verify/com/eo2js/${name}.xmir`) diff --git a/eo2js/test/helpers.js b/eo2js/test/helpers.js index e78da5c..73264d2 100644 --- a/eo2js/test/helpers.js +++ b/eo2js/test/helpers.js @@ -9,11 +9,10 @@ const jp = require('jspath') /** * Execute JS file with node. - * - * @param {String} js - JS file to execute - * @param {Array.} args - Arguments + * @param {string} js - JS file to execute + * @param {Array.} args - Arguments * @param {boolean} print - Capture logs or not - * @return {string} Stdout + * @returns {string} Stdout */ const execNode = function(js, args, print) { try { @@ -22,7 +21,7 @@ const execNode = function(js, args, print) { { timeout: 1200000, windowsHide: true, - stdio: print ? null : 'ignore' + stdio: print ? null : 'ignore', } ).toString() } catch (ex) { @@ -33,10 +32,9 @@ const execNode = function(js, args, print) { /** * Helper to run eo2js command line tool. - * * @param {Array.} args - Array of args - * @param {Boolean} print - Capture logs - * @return {String} Stdout + * @param {boolean} print - Capture logs + * @returns {string} Stdout */ const runSync = function(args, print = true) { return execNode(path.resolve('./src/eo2js.js'), args, print) @@ -44,9 +42,8 @@ const runSync = function(args, print = true) { /** * Assert that all files exist. - * - * @param {String} stdout - The stdout printed - * @param {String} home - The location of files to match + * @param {string} stdout - The stdout printed + * @param {string} home - The location of files to match * @param {Array} paths - Array of file paths */ const assertFilesExist = function(stdout, home, paths) { @@ -67,8 +64,8 @@ const parser = new XMLParser({ignoreAttributes: false}) /** * Transformations test pack. - * @param {{home: String, sources: String, target: String, json: Object}} params - Pack params - * @return {{skip: boolean, failures: array., xmir: String, json: Object}} - Output + * @param {{home: string, sources: string, target: string, json: object}} params - Pack params + * @returns {{skip: boolean, failures: Array., xmir: string, json: object}} - Output */ const pack = function(params) { const res = { diff --git a/eo2js/test/it/runtime-tests.test.js b/eo2js/test/it/runtime-tests.test.js index bb9cc8b..5712d77 100644 --- a/eo2js/test/it/runtime-tests.test.js +++ b/eo2js/test/it/runtime-tests.test.js @@ -18,8 +18,8 @@ const exclude = [ /** * Read all files from given directory. - * @param {String} dir - Directory - * @return {Array.} - Files from the directory + * @param {string} dir - Directory + * @returns {Array.} - Files from the directory */ const allFilesFrom = function(dir) { const files = fs.readdirSync(dir, {withFileTypes: true}); diff --git a/eo2js/test/mvnw/mvnw.js b/eo2js/test/mvnw/mvnw.js index 2bf38a0..3c0030d 100644 --- a/eo2js/test/mvnw/mvnw.js +++ b/eo2js/test/mvnw/mvnw.js @@ -4,13 +4,13 @@ const fs = require('fs'); /** * Version. - * @type {null|String} + * @type {null|string} */ let ver = null /** * Get EO version. - * @return {String} - EO version + * @returns {string} - EO version */ const version = function() { if (ver == null) { @@ -21,18 +21,19 @@ const version = function() { /** * The shell to use (depending on operating system). - * @return {String} - Path to shell or "undefined" if default one should be used + * @returns {string|undefined} - Path to shell or "undefined" if default one should be used */ function shell() { if (process.platform === 'win32') { return 'C:\\Windows\\SysWOW64\\WindowsPowerShell\\v1.0\\powershell.exe'; } + return undefined } /** * Prepare options for Maven. - * @param {{sources: String, target: String, home: String}} opts - Options - * @return {Array.} - Maven options + * @param {{sources: string, target: string, home: string}} opts - Options + * @returns {Array.} - Maven options */ const flags = function(opts) { return [ @@ -44,8 +45,8 @@ const flags = function(opts) { /** * Execute given goals of eo-maven-plugin. - * @param {Array.} goals - Goals to execute in right order - * @param {{sources: String, target: String, home: String}} opts - Options + * @param {Array.} goals - Goals to execute in right order + * @param {{sources: string, target: string, home: string}} opts - Options */ const mvnw = function(goals, opts) { const bin = path.resolve(__dirname, 'mvnw') + (process.platform === 'win32' ? '.cmd' : ''); diff --git a/eo2js/test/resources/dataize/app.js b/eo2js/test/resources/dataize/app.js index aba83ea..7882be8 100644 --- a/eo2js/test/resources/dataize/app.js +++ b/eo2js/test/resources/dataize/app.js @@ -1,6 +1,6 @@ /** * Object for testing dataization. - * @return {Object} object - Test object + * @returns {object} object - Test object */ const app = function() { const object = require('eo2js-runtime/src/runtime/object') diff --git a/eo2js/test/resources/test/second-test.test.js b/eo2js/test/resources/test/second-test.test.js index af5413a..0f62e2b 100644 --- a/eo2js/test/resources/test/second-test.test.js +++ b/eo2js/test/resources/test/second-test.test.js @@ -1,6 +1,6 @@ /** * Second test. - * @return {Object} object - Test object + * @returns {object} object - Test object */ const second_test = function() { const object = require('eo2js-runtime/src/runtime/object') diff --git a/eo2js/test/resources/test/simple-test.test.js b/eo2js/test/resources/test/simple-test.test.js index ed06090..a42f0fa 100644 --- a/eo2js/test/resources/test/simple-test.test.js +++ b/eo2js/test/resources/test/simple-test.test.js @@ -1,6 +1,6 @@ /** * Simple test. - * @return {Object} object - Test object + * @returns {object} object - Test object */ const simple_test = function() { const object = require('eo2js-runtime/src/runtime/object') diff --git a/package.json b/package.json index c0485bc..64e96bc 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "postinstall": "npm run install-eo2js && npm run install-eo2js-runtime", "test-eo2js": "cd eo2js && grunt", "test-eo2js-runtime": "cd eo2js-runtime && grunt", - "test": "npm run test-eo2js && npm run test-eo2js-runtime" + "test": "npm run test-eo2js-runtime && npm run test-eo2js" }, "author": "maxonfjvipon", "license": "MIT"