Skip to content

Commit

Permalink
ci: add linting
Browse files Browse the repository at this point in the history
  • Loading branch information
bchew committed Feb 6, 2025
1 parent be11f53 commit 3eebcd7
Show file tree
Hide file tree
Showing 7 changed files with 4,543 additions and 775 deletions.
1 change: 1 addition & 0 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ jobs:
with:
node-version: ${{ matrix.node }}
- run: npm ci --update-notifier=false
- run: npm run lint
- run: npm test
10 changes: 5 additions & 5 deletions dynamo-adapter.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
const {promisify} = require('util');
const {DynamoTable} = require('./slim');
const { promisify } = require('util');
const { DynamoTable } = require('./slim');

const isCallback = (fn) => typeof fn === 'function';

const validateCall = (methodName, args, minLength) => {
if (args.length < minLength)
throw new Error(`Incorrect args supplied to method ${methodName}: expected: ${minLength} got: ${args.length}`);
}
};

/**
Provides an adapter for the DynamoTable class to allow for promisified
Expand All @@ -18,14 +18,14 @@ class DynamoAdapter {
this.hooks = options.hooks || {};

// Delegate externally accessed properties
Object.keys(this._delegate).forEach(key => {
Object.keys(this._delegate).forEach((key) => {
this[key] = this._delegate[key];
});

// NOTE: Rebind all methods so they can be passed without the class instance
// Since we only instantiate once per table and maintain the instances,
// the performance should be a big concern
Object.getOwnPropertyNames(DynamoAdapter.prototype).forEach(key => {
Object.getOwnPropertyNames(DynamoAdapter.prototype).forEach((key) => {
if (typeof this[key] === 'function') this[key] = this[key].bind(this);
});

Expand Down
3 changes: 3 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const eslintConfigAdslot = require('eslint-config-adslot');

module.exports = [...eslintConfigAdslot];
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const {DynamoTable} = require('./slim');
const { DynamoTable } = require('./slim');
const DynamoAdapter = require('./dynamo-adapter');

// Library is a factory function which also provides the DynamoTable class
Expand Down
Loading

0 comments on commit 3eebcd7

Please # to comment.