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