Commit d4c56d42 by Richard Hansen Committed by Kewde

Run `npx eslint --fix .` to auto-fix lint issues

parent 8c23ffbb
......@@ -8,7 +8,7 @@ exports.compare = {
var db = new sqlite3.Database('');
var file = fs.readFileSync('benchmark/insert-transaction.sql', 'utf8');
db.exec(file);
db.close(finished)
db.close(finished);
},
'insert with transaction and two statements': function(finished) {
......
var cf = require('@mapbox/cloudfriend');
var package_json = require('../package.json')
var package_json = require('../package.json');
module.exports = {
AWSTemplateFormatVersion: '2010-09-09',
Description: 'user for publishing to s3://mapbox-node-binary/' + package_json.name,
Resources: {
User: {
Type: 'AWS::IAM::User',
Properties: {
Policies: [
{
PolicyName: 'list',
PolicyDocument: {
Statement: [
{
Action: ['s3:ListBucket'],
Effect: 'Allow',
Resource: 'arn:aws:s3:::mapbox-node-binary',
Condition : {
StringLike : {
"s3:prefix": [ package_json.name + "/*"]
AWSTemplateFormatVersion: '2010-09-09',
Description: 'user for publishing to s3://mapbox-node-binary/' + package_json.name,
Resources: {
User: {
Type: 'AWS::IAM::User',
Properties: {
Policies: [
{
PolicyName: 'list',
PolicyDocument: {
Statement: [
{
Action: ['s3:ListBucket'],
Effect: 'Allow',
Resource: 'arn:aws:s3:::mapbox-node-binary',
Condition : {
StringLike : {
"s3:prefix": [ package_json.name + "/*"]
}
}
}
]
}
},
{
PolicyName: 'publish',
PolicyDocument: {
Statement: [
{
Action: ['s3:DeleteObject', 's3:GetObject', 's3:GetObjectAcl', 's3:PutObject', 's3:PutObjectAcl'],
Effect: 'Allow',
Resource: 'arn:aws:s3:::mapbox-node-binary/' + package_json.name + '/*'
}
]
}
}
}
}
]
]
}
},
{
PolicyName: 'publish',
PolicyDocument: {
Statement: [
{
Action: ['s3:DeleteObject', 's3:GetObject', 's3:GetObjectAcl', 's3:PutObject', 's3:PutObjectAcl'],
Effect: 'Allow',
Resource: 'arn:aws:s3:::mapbox-node-binary/' + package_json.name + '/*'
}
]
},
AccessKey: {
Type: 'AWS::IAM::AccessKey',
Properties: {
UserName: cf.ref('User')
}
}
]
}
}
},
AccessKey: {
Type: 'AWS::IAM::AccessKey',
Properties: {
UserName: cf.ref('User')
}
Outputs: {
AccessKeyId: {
Value: cf.ref('AccessKey')
},
SecretAccessKey: {
Value: cf.getAtt('AccessKey', 'SecretAccessKey')
}
}
},
Outputs: {
AccessKeyId: {
Value: cf.ref('AccessKey')
},
SecretAccessKey: {
Value: cf.getAtt('AccessKey', 'SecretAccessKey')
}
}
};
......@@ -270,7 +270,7 @@ describe('prepare', function() {
before(function(done) { db = new sqlite3.Database('test/support/prepare.db', sqlite3.OPEN_READONLY, done); });
it('should retrieve particular rows', function(done) {
db.prepare("SELECT txt, num, flt, blb FROM foo WHERE num > 5000")
db.prepare("SELECT txt, num, flt, blb FROM foo WHERE num > 5000")
.all(function(err, rows) {
if (err) throw err;
assert.ok(rows.length === 0);
......
......@@ -16,7 +16,7 @@ function createdb(callback) {
str += chars[Math.floor(Math.random() * chars.length)];
}
return str;
};
}
if (existsSync(db_path)) {
......@@ -38,7 +38,7 @@ function createdb(callback) {
});
});
}
};
}
if (require.main === module) {
createdb();
......
......@@ -15,8 +15,8 @@ exports.deleteFile = function(name) {
exports.ensureExists = function(name,cb) {
if (!pathExists(name)) {
fs.mkdirSync(name);
};
}
}
};
assert.fileDoesNotExist = function(name) {
try {
......
......@@ -48,7 +48,7 @@ describe('unicode', function() {
} else if (first < 0xe0) {
return String.fromCharCode((first & 0x1f) << 0x6 | random_choice(trailing_values) & 0x3f);
} else if (first == 0xe0) {
return String.fromCharCode(((first & 0xf) << 0xc) | ((random_choice(subranges[0]) & 0x3f) << 6) | random_choice(trailing_values) & 0x3f);
return String.fromCharCode(((first & 0xf) << 0xc) | ((random_choice(subranges[0]) & 0x3f) << 6) | random_choice(trailing_values) & 0x3f);
} else if (first == 0xed) {
return String.fromCharCode(((first & 0xf) << 0xc) | ((random_choice(subranges[1]) & 0x3f) << 6) | random_choice(trailing_values) & 0x3f);
} else if (first < 0xf0) {
......@@ -58,7 +58,7 @@ describe('unicode', function() {
function randomString() {
var str = '',
i;
i;
for (i = Math.random() * 300; i > 0; i--) {
str += random_utf8();
......@@ -68,7 +68,7 @@ describe('unicode', function() {
}
// Generate random data.
// Generate random data.
var data = [];
var length = Math.floor(Math.random() * 1000) + 200;
for (var i = 0; i < length; i++) {
......
......@@ -20,7 +20,7 @@ describe('query properties', function() {
if (err) throw err;
assert.equal(row.count, 3); // equals 3
});
})
});
});
db.wait(done);
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment