diff --git a/package-lock.json b/package-lock.json index cc7d0ed..1a4bcb8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4,6 +4,23 @@ "lockfileVersion": 1, "requires": true, "dependencies": { + "@babel/cli": { + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/cli/-/cli-7.7.0.tgz", + "integrity": "sha512-jECEqAq6Ngf3pOhLSg7od9WKyrIacyh1oNNYtRXNn+ummSHCTXBamGywOAtiae34Vk7zKuQNnLvo2BKTMCoV4A==", + "dev": true, + "requires": { + "chokidar": "2.1.8", + "commander": "2.20.3", + "convert-source-map": "1.6.0", + "fs-readdir-recursive": "1.1.0", + "glob": "7.1.5", + "lodash": "4.17.15", + "make-dir": "2.1.0", + "slash": "2.0.0", + "source-map": "0.5.7" + } + }, "@babel/code-frame": { "version": "7.5.5", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.5.5.tgz", @@ -318,6 +335,79 @@ } } }, + "@babel/helper-create-class-features-plugin": { + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.7.0.tgz", + "integrity": "sha512-MZiB5qvTWoyiFOgootmRSDV1udjIqJW/8lmxgzKq6oDqxdmHUjeP2ZUOmgHdYjmUVNABqRrHjYAYRvj8Eox/UA==", + "dev": true, + "requires": { + "@babel/helper-function-name": "7.7.0", + "@babel/helper-member-expression-to-functions": "7.7.0", + "@babel/helper-optimise-call-expression": "7.7.0", + "@babel/helper-plugin-utils": "7.0.0", + "@babel/helper-replace-supers": "7.7.0", + "@babel/helper-split-export-declaration": "7.7.0" + }, + "dependencies": { + "@babel/helper-function-name": { + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.7.0.tgz", + "integrity": "sha512-tDsJgMUAP00Ugv8O2aGEua5I2apkaQO7lBGUq1ocwN3G23JE5Dcq0uh3GvFTChPa4b40AWiAsLvCZOA2rdnQ7Q==", + "dev": true, + "requires": { + "@babel/helper-get-function-arity": "7.7.0", + "@babel/template": "7.7.0", + "@babel/types": "7.7.1" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.7.0.tgz", + "integrity": "sha512-tLdojOTz4vWcEnHWHCuPN5P85JLZWbm5Fx5ZsMEMPhF3Uoe3O7awrbM2nQ04bDOUToH/2tH/ezKEOR8zEYzqyw==", + "dev": true, + "requires": { + "@babel/types": "7.7.1" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.7.0.tgz", + "integrity": "sha512-HgYSI8rH08neWlAH3CcdkFg9qX9YsZysZI5GD8LjhQib/mM0jGOZOVkoUiiV2Hu978fRtjtsGsW6w0pKHUWtqA==", + "dev": true, + "requires": { + "@babel/types": "7.7.1" + } + }, + "@babel/parser": { + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.7.0.tgz", + "integrity": "sha512-GqL+Z0d7B7ADlQBMXlJgvXEbtt5qlqd1YQ5fr12hTSfh7O/vgrEIvJxU2e7aSVrEUn75zTZ6Nd0s8tthrlZnrQ==", + "dev": true + }, + "@babel/template": { + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.7.0.tgz", + "integrity": "sha512-OKcwSYOW1mhWbnTBgQY5lvg1Fxg+VyfQGjcBduZFljfc044J5iDlnDSfhQ867O17XHiSCxYHUxHg2b7ryitbUQ==", + "dev": true, + "requires": { + "@babel/code-frame": "7.5.5", + "@babel/parser": "7.7.0", + "@babel/types": "7.7.1" + } + }, + "@babel/types": { + "version": "7.7.1", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.1.tgz", + "integrity": "sha512-kN/XdANDab9x1z5gcjDc9ePpxexkt+1EQ2MQUiM4XnMvQfvp87/+6kY4Ko2maLXH+tei/DgJ/ybFITeqqRwDiA==", + "dev": true, + "requires": { + "esutils": "2.0.3", + "lodash": "4.17.15", + "to-fast-properties": "2.0.0" + } + } + } + }, "@babel/helper-create-regexp-features-plugin": { "version": "7.7.0", "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.7.0.tgz", @@ -1283,6 +1373,16 @@ "@babel/plugin-syntax-async-generators": "7.2.0" } }, + "@babel/plugin-proposal-class-properties": { + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.7.0.tgz", + "integrity": "sha512-tufDcFA1Vj+eWvwHN+jvMN6QsV5o+vUlytNKrbMiCeDL0F2j92RURzUsUMWE5EJkLyWxjdUslCsMQa9FWth16A==", + "dev": true, + "requires": { + "@babel/helper-create-class-features-plugin": "7.7.0", + "@babel/helper-plugin-utils": "7.0.0" + } + }, "@babel/plugin-proposal-dynamic-import": { "version": "7.7.0", "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.7.0.tgz", @@ -1387,6 +1487,15 @@ "@babel/helper-plugin-utils": "7.0.0" } }, + "@babel/plugin-syntax-typescript": { + "version": "7.3.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.3.3.tgz", + "integrity": "sha512-dGwbSMA1YhVS8+31CnPR7LB4pcbrzcV99wQzby4uAfrkZPYZlQ7ImwdpzLqi6Z6IL02b8IAL379CaMwo0x5Lag==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "7.0.0" + } + }, "@babel/plugin-transform-arrow-functions": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.2.0.tgz", @@ -1815,6 +1924,17 @@ "@babel/helper-plugin-utils": "7.0.0" } }, + "@babel/plugin-transform-typescript": { + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.7.0.tgz", + "integrity": "sha512-y3KYbcfKe+8ziRXiGhhnGrVysDBo5+aJdB+x8sanM0K41cnmK7Q5vBlQLMbOnW/HPjLG9bg7dLgYDQZZG9T09g==", + "dev": true, + "requires": { + "@babel/helper-create-class-features-plugin": "7.7.0", + "@babel/helper-plugin-utils": "7.0.0", + "@babel/plugin-syntax-typescript": "7.3.3" + } + }, "@babel/plugin-transform-unicode-regex": { "version": "7.7.0", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.7.0.tgz", @@ -1908,6 +2028,16 @@ } } }, + "@babel/preset-typescript": { + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.7.0.tgz", + "integrity": "sha512-WZ3qvtAJy8w/i6wqq5PuDnkCUXaLUTHIlJujfGHmHxsT5veAbEdEjl3cC/3nXfyD0bzlWsIiMdUhZgrXjd9QWg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "7.0.0", + "@babel/plugin-transform-typescript": "7.7.0" + } + }, "@babel/runtime": { "version": "7.7.0", "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.7.0.tgz", @@ -5418,6 +5548,12 @@ "null-check": "1.0.0" } }, + "fs-readdir-recursive": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fs-readdir-recursive/-/fs-readdir-recursive-1.1.0.tgz", + "integrity": "sha512-GNanXlVr2pf02+sPN40XN8HG+ePaNcvM0q5mZBd668Obwb0yD5GiUbZOFgwn8kGMY6I3mdyDJzieUy3PTYyTRA==", + "dev": true + }, "fs-write-stream-atomic": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz", diff --git a/package.json b/package.json index 8469403..cfc1f1a 100644 --- a/package.json +++ b/package.json @@ -7,8 +7,8 @@ "scripts": { "test": "jest --coverage", "start:dev": "webpack-dev-server", - "build": "rm -rf build && tsc && cp -r src/lib/*.js build/lib/", "demo": "rm -rf demo/js && webpack", + "build": "rm -rf build && tsc && cp -r src/lib/*.js build/lib/", "allready": "npm run test && npm run build && npm run demo", "publish:beta": "npm run allready && standard-version --prerelease beta && npm publish --tag beta", "publish:prod": "npm run allready && standard-version && git push --follow-tags origin master && npm publish" @@ -29,8 +29,11 @@ }, "homepage": "https://github.com/sylvia1106/idb-managed#readme", "devDependencies": { + "@babel/cli": "^7.7.0", + "@babel/plugin-proposal-class-properties": "^7.7.0", "@babel/plugin-transform-runtime": "^7.6.2", "@babel/preset-env": "^7.7.0", + "@babel/preset-typescript": "^7.7.0", "@babel/runtime": "^7.7.0", "@babel/runtime-corejs2": "^7.7.1", "@babel/runtime-corejs3": "^7.7.0", diff --git a/src/index.ts b/src/index.ts index b50982a..c4e7353 100644 --- a/src/index.ts +++ b/src/index.ts @@ -92,9 +92,7 @@ function customDBAddItemsParamChecker( "item's itemDuration", OPTIONAL ); - const theTable = tableListInDB.find( - table => table.tableName === itemOfTable.tableName - ); + const theTable = tableListInDB.filter(table => table.tableName === itemOfTable.tableName)[0]; if (!theTable) { throw `Table ${itemOfTable.tableName} does not exist`; } else if ( diff --git a/webpack.config.js b/webpack.config.js index eebbbe9..e33b001 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -5,11 +5,14 @@ const DEMO_PATH = './demo'; const BundleAnalyzerPlugin = require('webpack-bundle-analyzer') .BundleAnalyzerPlugin; const babelOptions = { - presets: [['@babel/preset-env', { - 'exclude': [ - '@babel/plugin-transform-typeof-symbol', - ] - }]], + presets: [ + [ + '@babel/preset-env', + { + exclude: ['@babel/plugin-transform-typeof-symbol'] + } + ] + ], plugins: [['@babel/plugin-transform-runtime', { corejs: 3 }]] }; module.exports = [