Skip to content

Commit

Permalink
fix: array.find to array.filter
Browse files Browse the repository at this point in the history
  • Loading branch information
sylvia1106 committed Nov 6, 2019
1 parent 5e36034 commit bdf35a0
Show file tree
Hide file tree
Showing 4 changed files with 149 additions and 9 deletions.
136 changes: 136 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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",
Expand Down
4 changes: 1 addition & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
13 changes: 8 additions & 5 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down

0 comments on commit bdf35a0

Please sign in to comment.