diff --git a/.github/workflows/auto-tag.yml b/.github/workflows/auto-tag.yml new file mode 100644 index 0000000..f5eff1d --- /dev/null +++ b/.github/workflows/auto-tag.yml @@ -0,0 +1,33 @@ +name: Tag and Push + +on: + push: + branches: + - main + +jobs: + tag-and-push: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + + - name: Install jq + run: sudo apt-get install jq + + - name: Get version from package.json + id: version + run: echo ::set-output name=version::$(jq -r .version package.json) + + - name: Tag and push to GitHub + run: | + git config --local user.email "i.ozguradem@gmail.com" + git config --local user.name "Özgür Adem Işıklı" + git tag -a "v${{ steps.version.outputs.version }}" -m "Version ${{ steps.version.outputs.version }}" + git push origin "v${{ steps.version.outputs.version }}" \ No newline at end of file diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml new file mode 100644 index 0000000..02f301b --- /dev/null +++ b/.github/workflows/npm-publish.yml @@ -0,0 +1,20 @@ +name: NPM Publish +on: + push: + branches: + - main + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - uses: actions/setup-node@v1 + with: + node-version: 20 + - run: npm install + - run: npm test + - run: npm run build + - uses: JS-DevTools/npm-publish@v1 + with: + token: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index dffa2cd..ccb9d6a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,10 +1,9 @@ -name: Tests +name: Build and deploy on: push: branches: - - main - + - '*' jobs: units: runs-on: ubuntu-latest diff --git a/package-lock.json b/package-lock.json index f0091b8..fab85f2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,19 +1,20 @@ { "name": "robust-validator", - "version": "1.0.0", + "version": "0.1.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "robust-validator", - "version": "1.0.0", + "version": "0.1.0", "license": "ISC", "devDependencies": { "@babel/preset-env": "^7.23.6", "@babel/preset-typescript": "^7.23.3", "@jest/globals": "^29.7.0", "@types/jest": "^29.5.11", - "@typescript-eslint/eslint-plugin": "^6.14.0", + "@typescript-eslint/eslint-plugin": "^6.15.0", + "@typescript-eslint/parser": "^6.15.0", "eslint": "^8.56.0", "eslint-config-standard-with-typescript": "^43.0.0", "eslint-plugin-import": "^2.29.1", @@ -2942,16 +2943,16 @@ "dev": true }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "6.14.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.14.0.tgz", - "integrity": "sha512-1ZJBykBCXaSHG94vMMKmiHoL0MhNHKSVlcHVYZNw+BKxufhqQVTOawNpwwI1P5nIFZ/4jLVop0mcY6mJJDFNaw==", + "version": "6.15.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.15.0.tgz", + "integrity": "sha512-j5qoikQqPccq9QoBAupOP+CBu8BaJ8BLjaXSioDISeTZkVO3ig7oSIKh3H+rEpee7xCXtWwSB4KIL5l6hWZzpg==", "dev": true, "dependencies": { "@eslint-community/regexpp": "^4.5.1", - "@typescript-eslint/scope-manager": "6.14.0", - "@typescript-eslint/type-utils": "6.14.0", - "@typescript-eslint/utils": "6.14.0", - "@typescript-eslint/visitor-keys": "6.14.0", + "@typescript-eslint/scope-manager": "6.15.0", + "@typescript-eslint/type-utils": "6.15.0", + "@typescript-eslint/utils": "6.15.0", + "@typescript-eslint/visitor-keys": "6.15.0", "debug": "^4.3.4", "graphemer": "^1.4.0", "ignore": "^5.2.4", @@ -2976,53 +2977,6 @@ } } }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/scope-manager": { - "version": "6.14.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.14.0.tgz", - "integrity": "sha512-VT7CFWHbZipPncAZtuALr9y3EuzY1b1t1AEkIq2bTXUPKw+pHoXflGNG5L+Gv6nKul1cz1VH8fz16IThIU0tdg==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "6.14.0", - "@typescript-eslint/visitor-keys": "6.14.0" - }, - "engines": { - "node": "^16.0.0 || >=18.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/types": { - "version": "6.14.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.14.0.tgz", - "integrity": "sha512-uty9H2K4Xs8E47z3SnXEPRNDfsis8JO27amp2GNCnzGETEW3yTqEIVg5+AI7U276oGF/tw6ZA+UesxeQ104ceA==", - "dev": true, - "engines": { - "node": "^16.0.0 || >=18.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/visitor-keys": { - "version": "6.14.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.14.0.tgz", - "integrity": "sha512-fB5cw6GRhJUz03MrROVuj5Zm/Q+XWlVdIsFj+Zb1Hvqouc8t+XP2H5y53QYU/MGtd2dPg6/vJJlhoX3xc2ehfw==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "6.14.0", - "eslint-visitor-keys": "^3.4.1" - }, - "engines": { - "node": "^16.0.0 || >=18.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/lru-cache": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", @@ -3057,15 +3011,15 @@ "dev": true }, "node_modules/@typescript-eslint/parser": { - "version": "6.13.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.13.2.tgz", - "integrity": "sha512-MUkcC+7Wt/QOGeVlM8aGGJZy1XV5YKjTpq9jK6r6/iLsGXhBVaGP5N0UYvFsu9BFlSpwY9kMretzdBH01rkRXg==", + "version": "6.15.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.15.0.tgz", + "integrity": "sha512-MkgKNnsjC6QwcMdlNAel24jjkEO/0hQaMDLqP4S9zq5HBAUJNQB6y+3DwLjX7b3l2b37eNAxMPLwb3/kh8VKdA==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "6.13.2", - "@typescript-eslint/types": "6.13.2", - "@typescript-eslint/typescript-estree": "6.13.2", - "@typescript-eslint/visitor-keys": "6.13.2", + "@typescript-eslint/scope-manager": "6.15.0", + "@typescript-eslint/types": "6.15.0", + "@typescript-eslint/typescript-estree": "6.15.0", + "@typescript-eslint/visitor-keys": "6.15.0", "debug": "^4.3.4" }, "engines": { @@ -3085,13 +3039,13 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "6.13.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.13.2.tgz", - "integrity": "sha512-CXQA0xo7z6x13FeDYCgBkjWzNqzBn8RXaE3QVQVIUm74fWJLkJkaHmHdKStrxQllGh6Q4eUGyNpMe0b1hMkXFA==", + "version": "6.15.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.15.0.tgz", + "integrity": "sha512-+BdvxYBltqrmgCNu4Li+fGDIkW9n//NrruzG9X1vBzaNK+ExVXPoGB71kneaVw/Jp+4rH/vaMAGC6JfMbHstVg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.13.2", - "@typescript-eslint/visitor-keys": "6.13.2" + "@typescript-eslint/types": "6.15.0", + "@typescript-eslint/visitor-keys": "6.15.0" }, "engines": { "node": "^16.0.0 || >=18.0.0" @@ -3102,13 +3056,13 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "6.14.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.14.0.tgz", - "integrity": "sha512-x6OC9Q7HfYKqjnuNu5a7kffIYs3No30isapRBJl1iCHLitD8O0lFbRcVGiOcuyN837fqXzPZ1NS10maQzZMKqw==", + "version": "6.15.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.15.0.tgz", + "integrity": "sha512-CnmHKTfX6450Bo49hPg2OkIm/D/TVYV7jO1MCfPYGwf6x3GO0VU8YMO5AYMn+u3X05lRRxA4fWCz87GFQV6yVQ==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "6.14.0", - "@typescript-eslint/utils": "6.14.0", + "@typescript-eslint/typescript-estree": "6.15.0", + "@typescript-eslint/utils": "6.15.0", "debug": "^4.3.4", "ts-api-utils": "^1.0.1" }, @@ -3128,100 +3082,10 @@ } } }, - "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/types": { - "version": "6.14.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.14.0.tgz", - "integrity": "sha512-uty9H2K4Xs8E47z3SnXEPRNDfsis8JO27amp2GNCnzGETEW3yTqEIVg5+AI7U276oGF/tw6ZA+UesxeQ104ceA==", - "dev": true, - "engines": { - "node": "^16.0.0 || >=18.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/typescript-estree": { - "version": "6.14.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.14.0.tgz", - "integrity": "sha512-yPkaLwK0yH2mZKFE/bXkPAkkFgOv15GJAUzgUVonAbv0Hr4PK/N2yaA/4XQbTZQdygiDkpt5DkxPELqHguNvyw==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "6.14.0", - "@typescript-eslint/visitor-keys": "6.14.0", - "debug": "^4.3.4", - "globby": "^11.1.0", - "is-glob": "^4.0.3", - "semver": "^7.5.4", - "ts-api-utils": "^1.0.1" - }, - "engines": { - "node": "^16.0.0 || >=18.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/visitor-keys": { - "version": "6.14.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.14.0.tgz", - "integrity": "sha512-fB5cw6GRhJUz03MrROVuj5Zm/Q+XWlVdIsFj+Zb1Hvqouc8t+XP2H5y53QYU/MGtd2dPg6/vJJlhoX3xc2ehfw==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "6.14.0", - "eslint-visitor-keys": "^3.4.1" - }, - "engines": { - "node": "^16.0.0 || >=18.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/type-utils/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@typescript-eslint/type-utils/node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@typescript-eslint/type-utils/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, "node_modules/@typescript-eslint/types": { - "version": "6.13.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.13.2.tgz", - "integrity": "sha512-7sxbQ+EMRubQc3wTfTsycgYpSujyVbI1xw+3UMRUcrhSy+pN09y/lWzeKDbvhoqcRbHdc+APLs/PWYi/cisLPg==", + "version": "6.15.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.15.0.tgz", + "integrity": "sha512-yXjbt//E4T/ee8Ia1b5mGlbNj9fB9lJP4jqLbZualwpP2BCQ5is6BcWwxpIsY4XKAhmdv3hrW92GdtJbatC6dQ==", "dev": true, "engines": { "node": "^16.0.0 || >=18.0.0" @@ -3232,13 +3096,13 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "6.13.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.13.2.tgz", - "integrity": "sha512-SuD8YLQv6WHnOEtKv8D6HZUzOub855cfPnPMKvdM/Bh1plv1f7Q/0iFUDLKKlxHcEstQnaUU4QZskgQq74t+3w==", + "version": "6.15.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.15.0.tgz", + "integrity": "sha512-7mVZJN7Hd15OmGuWrp2T9UvqR2Ecg+1j/Bp1jXUEY2GZKV6FXlOIoqVDmLpBiEiq3katvj/2n2mR0SDwtloCew==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.13.2", - "@typescript-eslint/visitor-keys": "6.13.2", + "@typescript-eslint/types": "6.15.0", + "@typescript-eslint/visitor-keys": "6.15.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -3292,17 +3156,17 @@ "dev": true }, "node_modules/@typescript-eslint/utils": { - "version": "6.14.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.14.0.tgz", - "integrity": "sha512-XwRTnbvRr7Ey9a1NT6jqdKX8y/atWG+8fAIu3z73HSP8h06i3r/ClMhmaF/RGWGW1tHJEwij1uEg2GbEmPYvYg==", + "version": "6.15.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.15.0.tgz", + "integrity": "sha512-eF82p0Wrrlt8fQSRL0bGXzK5nWPRV2dYQZdajcfzOD9+cQz9O7ugifrJxclB+xVOvWvagXfqS4Es7vpLP4augw==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", "@types/json-schema": "^7.0.12", "@types/semver": "^7.5.0", - "@typescript-eslint/scope-manager": "6.14.0", - "@typescript-eslint/types": "6.14.0", - "@typescript-eslint/typescript-estree": "6.14.0", + "@typescript-eslint/scope-manager": "6.15.0", + "@typescript-eslint/types": "6.15.0", + "@typescript-eslint/typescript-estree": "6.15.0", "semver": "^7.5.4" }, "engines": { @@ -3316,80 +3180,6 @@ "eslint": "^7.0.0 || ^8.0.0" } }, - "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/scope-manager": { - "version": "6.14.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.14.0.tgz", - "integrity": "sha512-VT7CFWHbZipPncAZtuALr9y3EuzY1b1t1AEkIq2bTXUPKw+pHoXflGNG5L+Gv6nKul1cz1VH8fz16IThIU0tdg==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "6.14.0", - "@typescript-eslint/visitor-keys": "6.14.0" - }, - "engines": { - "node": "^16.0.0 || >=18.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/types": { - "version": "6.14.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.14.0.tgz", - "integrity": "sha512-uty9H2K4Xs8E47z3SnXEPRNDfsis8JO27amp2GNCnzGETEW3yTqEIVg5+AI7U276oGF/tw6ZA+UesxeQ104ceA==", - "dev": true, - "engines": { - "node": "^16.0.0 || >=18.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/typescript-estree": { - "version": "6.14.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.14.0.tgz", - "integrity": "sha512-yPkaLwK0yH2mZKFE/bXkPAkkFgOv15GJAUzgUVonAbv0Hr4PK/N2yaA/4XQbTZQdygiDkpt5DkxPELqHguNvyw==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "6.14.0", - "@typescript-eslint/visitor-keys": "6.14.0", - "debug": "^4.3.4", - "globby": "^11.1.0", - "is-glob": "^4.0.3", - "semver": "^7.5.4", - "ts-api-utils": "^1.0.1" - }, - "engines": { - "node": "^16.0.0 || >=18.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/visitor-keys": { - "version": "6.14.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.14.0.tgz", - "integrity": "sha512-fB5cw6GRhJUz03MrROVuj5Zm/Q+XWlVdIsFj+Zb1Hvqouc8t+XP2H5y53QYU/MGtd2dPg6/vJJlhoX3xc2ehfw==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "6.14.0", - "eslint-visitor-keys": "^3.4.1" - }, - "engines": { - "node": "^16.0.0 || >=18.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, "node_modules/@typescript-eslint/utils/node_modules/lru-cache": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", @@ -3424,12 +3214,12 @@ "dev": true }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "6.13.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.13.2.tgz", - "integrity": "sha512-OGznFs0eAQXJsp+xSd6k/O1UbFi/K/L7WjqeRoFE7vadjAF9y0uppXhYNQNEqygjou782maGClOoZwPqF0Drlw==", + "version": "6.15.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.15.0.tgz", + "integrity": "sha512-1zvtdC1a9h5Tb5jU9x3ADNXO9yjP8rXlaoChu0DQX40vf5ACVpYIVIZhIMZ6d5sDXH7vq4dsZBT1fEGj8D2n2w==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.13.2", + "@typescript-eslint/types": "6.15.0", "eslint-visitor-keys": "^3.4.1" }, "engines": { diff --git a/package.json b/package.json index 1dbfd93..7b8d7cd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "robust-validator", - "version": "1.0.0", + "version": "0.1.0", "description": "", "main": "dist/index.js", "types": "dist/index.d.ts", @@ -26,8 +26,9 @@ "@babel/preset-typescript": "^7.23.3", "@jest/globals": "^29.7.0", "@types/jest": "^29.5.11", + "@typescript-eslint/eslint-plugin": "^6.15.0", + "@typescript-eslint/parser": "^6.15.0", "eslint": "^8.56.0", - "@typescript-eslint/eslint-plugin": "^6.14.0", "eslint-config-standard-with-typescript": "^43.0.0", "eslint-plugin-import": "^2.29.1", "eslint-plugin-n": "^16.4.0", diff --git a/src/Helpers/validate.ts b/src/Helpers/validate.ts index 08ea230..9e4d1bc 100644 --- a/src/Helpers/validate.ts +++ b/src/Helpers/validate.ts @@ -73,7 +73,7 @@ const getResults = async ( rule.name, rule.params, options.language, - options.translations + options.translations || {} ), }); diff --git a/tests/Helpers/getValueViaPath.test.ts b/tests/Helpers/getValueViaPath.test.ts index 19ec6b0..1f2b9e1 100644 --- a/tests/Helpers/getValueViaPath.test.ts +++ b/tests/Helpers/getValueViaPath.test.ts @@ -1,4 +1,4 @@ -import { describe, expect } from "@jest/globals"; +import { describe, expect, it } from "@jest/globals"; import { getValueViaPath } from "../../src/Helpers"; describe("getValueViaPath() function", () => { diff --git a/tests/Rules/accepted.test.ts b/tests/Rules/accepted.test.ts index 3013ed0..b8aa160 100644 --- a/tests/Rules/accepted.test.ts +++ b/tests/Rules/accepted.test.ts @@ -1,4 +1,4 @@ -import { describe, expect } from "@jest/globals"; +import { describe, expect, it } from "@jest/globals"; import accepted from "../../src/Rules/accepted"; describe("accepted() ", () => { diff --git a/tests/Rules/after.test.ts b/tests/Rules/after.test.ts index c7f66ac..fa7b785 100644 --- a/tests/Rules/after.test.ts +++ b/tests/Rules/after.test.ts @@ -1,4 +1,4 @@ -import { describe, expect } from "@jest/globals"; +import { describe, expect, it } from "@jest/globals"; import after from "../../src/Rules/after"; describe("after() ", () => { diff --git a/tests/Rules/afterOrEqual.test.ts b/tests/Rules/afterOrEqual.test.ts index 2a03ea1..bf24acd 100644 --- a/tests/Rules/afterOrEqual.test.ts +++ b/tests/Rules/afterOrEqual.test.ts @@ -1,4 +1,4 @@ -import { describe, expect } from "@jest/globals"; +import { describe, expect, it } from "@jest/globals"; import afterOrEqual from "../../src/Rules/afterOrEqual"; describe("afterOrEqual() ", () => { diff --git a/tests/Rules/alpha.test.ts b/tests/Rules/alpha.test.ts index b5a4254..0070a5a 100644 --- a/tests/Rules/alpha.test.ts +++ b/tests/Rules/alpha.test.ts @@ -1,4 +1,4 @@ -import { describe, expect } from "@jest/globals"; +import { describe, expect, it } from "@jest/globals"; import alpha from "../../src/Rules/alpha"; describe("alpha() ", () => { diff --git a/tests/Rules/alphaDash.test.ts b/tests/Rules/alphaDash.test.ts index dcb5cf4..f24559a 100644 --- a/tests/Rules/alphaDash.test.ts +++ b/tests/Rules/alphaDash.test.ts @@ -1,4 +1,4 @@ -import { describe, expect } from "@jest/globals"; +import { describe, expect, it } from "@jest/globals"; import alphaDash from "../../src/Rules/alphaDash"; describe("alphaDash() ", () => { diff --git a/tests/Rules/alphaNum.test.ts b/tests/Rules/alphaNum.test.ts index 9f1c671..174835f 100644 --- a/tests/Rules/alphaNum.test.ts +++ b/tests/Rules/alphaNum.test.ts @@ -1,4 +1,4 @@ -import { describe, expect } from "@jest/globals"; +import { describe, expect, it } from "@jest/globals"; import alphaNum from "../../src/Rules/alphaNum"; describe("alphaNum() ", () => { diff --git a/tests/Rules/array.test.ts b/tests/Rules/array.test.ts index cc984b6..7acc783 100644 --- a/tests/Rules/array.test.ts +++ b/tests/Rules/array.test.ts @@ -1,4 +1,4 @@ -import { describe, expect } from "@jest/globals"; +import { describe, expect, it } from "@jest/globals"; import array from "../../src/Rules/array"; describe("array() ", () => { diff --git a/tests/Rules/before.test.ts b/tests/Rules/before.test.ts index 73fe915..cc4ac98 100644 --- a/tests/Rules/before.test.ts +++ b/tests/Rules/before.test.ts @@ -1,4 +1,4 @@ -import { describe, expect } from "@jest/globals"; +import { describe, expect, it } from "@jest/globals"; import before from "../../src/Rules/before"; describe("before() ", () => { diff --git a/tests/Rules/beforeOrEqual.test.ts b/tests/Rules/beforeOrEqual.test.ts index a0a8c29..bd32e99 100644 --- a/tests/Rules/beforeOrEqual.test.ts +++ b/tests/Rules/beforeOrEqual.test.ts @@ -1,4 +1,4 @@ -import { describe, expect } from "@jest/globals"; +import { describe, expect, it } from "@jest/globals"; import beforeOrEqual from "../../src/Rules/beforeOrEqual"; describe("beforeOrEqual() ", () => { diff --git a/tests/Rules/between.test.ts b/tests/Rules/between.test.ts index 0c475f6..3b4ce62 100644 --- a/tests/Rules/between.test.ts +++ b/tests/Rules/between.test.ts @@ -1,4 +1,4 @@ -import { describe, expect } from "@jest/globals"; +import { describe, expect, test } from "@jest/globals"; import between from "../../src/Rules/between"; describe("between() ", () => { diff --git a/tests/Rules/boolean.test.ts b/tests/Rules/boolean.test.ts index 184f287..9ef99a4 100644 --- a/tests/Rules/boolean.test.ts +++ b/tests/Rules/boolean.test.ts @@ -1,4 +1,4 @@ -import { describe, expect } from "@jest/globals"; +import { describe, expect, it } from "@jest/globals"; import boolean from "../../src/Rules/boolean"; describe("boolean() ", () => { diff --git a/tests/Rules/confirmed.test.ts b/tests/Rules/confirmed.test.ts index 5f9169b..58851d8 100644 --- a/tests/Rules/confirmed.test.ts +++ b/tests/Rules/confirmed.test.ts @@ -1,4 +1,4 @@ -import { describe, expect } from "@jest/globals"; +import { describe, expect, it } from "@jest/globals"; import confirmed from "../../src/Rules/confirmed"; const toContext = (value: any) => { diff --git a/tests/Rules/date.test.ts b/tests/Rules/date.test.ts index 6f80684..c4570c3 100644 --- a/tests/Rules/date.test.ts +++ b/tests/Rules/date.test.ts @@ -1,4 +1,4 @@ -import { describe, expect } from "@jest/globals"; +import { describe, expect, it } from "@jest/globals"; import date from "../../src/Rules/date"; describe("date() ", () => { diff --git a/tests/Rules/digits.test.ts b/tests/Rules/digits.test.ts index 5319f0a..71f26ed 100644 --- a/tests/Rules/digits.test.ts +++ b/tests/Rules/digits.test.ts @@ -1,4 +1,4 @@ -import { describe, expect } from "@jest/globals"; +import { describe, expect, it } from "@jest/globals"; import digits from "../../src/Rules/digits"; describe("digits() ", () => { diff --git a/tests/Rules/digitsBetween.spec.ts b/tests/Rules/digitsBetween.test.ts similarity index 96% rename from tests/Rules/digitsBetween.spec.ts rename to tests/Rules/digitsBetween.test.ts index 8b5a0f7..d2d4d65 100644 --- a/tests/Rules/digitsBetween.spec.ts +++ b/tests/Rules/digitsBetween.test.ts @@ -1,4 +1,4 @@ -import { describe, expect } from "@jest/globals"; +import { describe, expect, test } from "@jest/globals"; import digitsBetween from "../../src/Rules/digitsBetween"; describe("digitsBetween() ", () => { diff --git a/tests/Rules/email.spec.ts b/tests/Rules/email.test.ts similarity index 93% rename from tests/Rules/email.spec.ts rename to tests/Rules/email.test.ts index 461610d..f9de0c5 100644 --- a/tests/Rules/email.spec.ts +++ b/tests/Rules/email.test.ts @@ -1,4 +1,4 @@ -import { describe, expect } from "@jest/globals"; +import { describe, expect, it } from "@jest/globals"; import email from "../../src/Rules/email"; describe("email() ", () => { diff --git a/tests/Rules/hex.spec.ts b/tests/Rules/hex.test.ts similarity index 92% rename from tests/Rules/hex.spec.ts rename to tests/Rules/hex.test.ts index d6ac8bf..5c174aa 100644 --- a/tests/Rules/hex.spec.ts +++ b/tests/Rules/hex.test.ts @@ -1,4 +1,4 @@ -import { describe, expect } from "@jest/globals"; +import { describe, expect, it } from "@jest/globals"; import hex from "../../src/Rules/hex"; describe("hex() ", () => { diff --git a/tests/Rules/in.spec.ts b/tests/Rules/in.test.ts similarity index 96% rename from tests/Rules/in.spec.ts rename to tests/Rules/in.test.ts index d447095..1efd6c0 100644 --- a/tests/Rules/in.spec.ts +++ b/tests/Rules/in.test.ts @@ -1,4 +1,4 @@ -import { describe, expect } from "@jest/globals"; +import { describe, expect, it } from "@jest/globals"; import inFunction from "../../src/Rules/in"; describe("in() ", () => { diff --git a/tests/Rules/integer.spec.ts b/tests/Rules/integer.test.ts similarity index 95% rename from tests/Rules/integer.spec.ts rename to tests/Rules/integer.test.ts index 66e1b86..7bfb554 100644 --- a/tests/Rules/integer.spec.ts +++ b/tests/Rules/integer.test.ts @@ -1,4 +1,4 @@ -import { describe, expect } from "@jest/globals"; +import { describe, expect, it } from "@jest/globals"; import integer from "../../src/Rules/integer"; describe("integer() ", () => { diff --git a/tests/Rules/max.spec.ts b/tests/Rules/max.test.ts similarity index 95% rename from tests/Rules/max.spec.ts rename to tests/Rules/max.test.ts index 435ae9f..6f6f834 100644 --- a/tests/Rules/max.spec.ts +++ b/tests/Rules/max.test.ts @@ -1,4 +1,4 @@ -import { describe, expect } from "@jest/globals"; +import { describe, expect, test } from "@jest/globals"; import max from "../../src/Rules/max"; describe("max() ", () => { diff --git a/tests/Rules/min.spec.ts b/tests/Rules/min.test.ts similarity index 95% rename from tests/Rules/min.spec.ts rename to tests/Rules/min.test.ts index 80fb880..9dee9ca 100644 --- a/tests/Rules/min.spec.ts +++ b/tests/Rules/min.test.ts @@ -1,4 +1,4 @@ -import { describe, expect } from "@jest/globals"; +import { describe, expect, test } from "@jest/globals"; import min from "../../src/Rules/min"; describe("min() ", () => { diff --git a/tests/Rules/notIn.spec.ts b/tests/Rules/notIn.test.ts similarity index 96% rename from tests/Rules/notIn.spec.ts rename to tests/Rules/notIn.test.ts index a2ec76e..b1c8862 100644 --- a/tests/Rules/notIn.spec.ts +++ b/tests/Rules/notIn.test.ts @@ -1,4 +1,4 @@ -import { describe, expect } from "@jest/globals"; +import { describe, expect, it } from "@jest/globals"; import notIn from "../../src/Rules/notIn"; describe("notIn() ", () => { diff --git a/tests/Rules/numeric.spec.ts b/tests/Rules/numeric.test.ts similarity index 93% rename from tests/Rules/numeric.spec.ts rename to tests/Rules/numeric.test.ts index 48dfa3d..9bbf375 100644 --- a/tests/Rules/numeric.spec.ts +++ b/tests/Rules/numeric.test.ts @@ -1,4 +1,4 @@ -import { describe, expect } from "@jest/globals"; +import { describe, expect, test } from "@jest/globals"; import numeric from "../../src/Rules/numeric"; describe("numeric() ", () => { diff --git a/tests/Rules/required.spec.ts b/tests/Rules/required.test.ts similarity index 94% rename from tests/Rules/required.spec.ts rename to tests/Rules/required.test.ts index 714aed1..9837a8d 100644 --- a/tests/Rules/required.spec.ts +++ b/tests/Rules/required.test.ts @@ -1,4 +1,4 @@ -import { describe, expect } from "@jest/globals"; +import { describe, expect, it } from "@jest/globals"; import required from "../../src/Rules/required"; describe("required() ", () => { diff --git a/tests/Rules/size.spec.ts b/tests/Rules/size.test.ts similarity index 94% rename from tests/Rules/size.spec.ts rename to tests/Rules/size.test.ts index 62e01be..93c1e34 100644 --- a/tests/Rules/size.spec.ts +++ b/tests/Rules/size.test.ts @@ -1,4 +1,4 @@ -import { describe, expect } from "@jest/globals"; +import { describe, expect, it } from "@jest/globals"; import size from "../../src/Rules/size"; describe("size() ", () => { diff --git a/tests/Rules/string.spec.ts b/tests/Rules/string.test.ts similarity index 90% rename from tests/Rules/string.spec.ts rename to tests/Rules/string.test.ts index 4bdb7be..e59a895 100644 --- a/tests/Rules/string.spec.ts +++ b/tests/Rules/string.test.ts @@ -1,4 +1,4 @@ -import { describe, expect } from "@jest/globals"; +import { describe, expect, it } from "@jest/globals"; import string from "../../src/Rules/string"; describe("string() ", () => { diff --git a/tests/Rules/url.spec.ts b/tests/Rules/url.test.ts similarity index 94% rename from tests/Rules/url.spec.ts rename to tests/Rules/url.test.ts index f48cc6d..46b088d 100644 --- a/tests/Rules/url.spec.ts +++ b/tests/Rules/url.test.ts @@ -1,4 +1,4 @@ -import { describe, expect } from "@jest/globals"; +import { describe, expect, it } from "@jest/globals"; import url from "../../src/Rules/url"; describe("url() ", () => { diff --git a/tsconfig.json b/tsconfig.json index 2cbe8ee..6f023df 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,15 +1,20 @@ { "compilerOptions": { - "module": "es2020", "target": "es5", + "module": "commonjs", + "lib": ["es6", "dom"], + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + "moduleResolution": "node", "declaration": true, "outDir": "./dist", - "resolveJsonModule": true, - "moduleResolution": "node", - "lib": ["es2016", "dom", "es5"], - "esModuleInterop": true + "rootDir": "./src", + "types": ["node"] }, - "include": ["src/**/*"], + "include": ["src/**/*.ts"], + "exclude": ["node_modules", "dist", "docs"], "watchOptions": { "watchFile": "useFsEvents", "watchDirectory": "useFsEvents",