Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ Lambda.prototype._runHandler = function (handler, event, program, context) {
return timeout - (currentTime - startTime);
};

if (['nodejs4.3', 'nodejs6.10'].indexOf(program.runtime) == -1) {
if (['nodejs4.3', 'nodejs6.10'].indexOf(program.runtime) === -1) {
console.error("Runtime [" + program.runtime + "] is not supported.");
process.exit(254);
}
Expand Down Expand Up @@ -203,11 +203,11 @@ Lambda.prototype._fileCopy = function (program, src, dest, excludeNodeModules, c
// Formatting for `filter` of `fs.copy`
const dirBlobs = [];
const pattern = '{' + excludes.map(function (str) {
if (str.charAt(str.length - 1) == path.sep) {
if (str.charAt(str.length - 1) === path.sep) {
str = str.substr(0, str.length - 1);
dirBlobs.push(str);
}
if (str.charAt(0) == path.sep)
if (str.charAt(0) === path.sep)
return path.join(srcAbsolutePath, str);
if (str.indexOf(path.sep) >= 0)
return path.join(path.resolve('/**'), str);
Expand Down Expand Up @@ -452,7 +452,7 @@ Lambda.prototype._archivePrebuilt = function (program, archiveCallback) {
// (Used if there is a problem with `_ fileCopy`)
// If there is no problem even if deleting `_rsync`, this switching process is deleted
var copyFunction = '_fileCopy';
if (process.env.NODE_LAMBDA_COPY_FUNCTION == 'rsync') {
if (process.env.NODE_LAMBDA_COPY_FUNCTION === 'rsync') {
console.log('=> INFO: Use rsync for copy');
copyFunction = '_rsync';
}
Expand Down Expand Up @@ -494,7 +494,7 @@ Lambda.prototype._buildAndArchive = function (program, archiveCallback) {
// (Used if there is a problem with `_ fileCopy`)
// If there is no problem even if deleting `_rsync`, this switching process is deleted
var copyFunction = '_fileCopy';
if (process.env.NODE_LAMBDA_COPY_FUNCTION == 'rsync') {
if (process.env.NODE_LAMBDA_COPY_FUNCTION === 'rsync') {
console.log('=> INFO: Use rsync for copy');
copyFunction = '_rsync';
}
Expand Down Expand Up @@ -782,7 +782,7 @@ Lambda.prototype.deploy = function (program) {
return result.filter(function(res) {
return res.length > 0;
}).length > 0;
}).length == 0;
}).length === 0;
if (!resultsIsEmpty) {
console.log('=> All tasks done. Results follow: ');
console.log(JSON.stringify(results, null, ' '));
Expand Down
2 changes: 1 addition & 1 deletion lib/schedule_events.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ ScheduleEvents.prototype = {
const _params = _this._addPermissionParams(params);
_this.lambda.addPermission(_params, (err, data) => {
if (err) {
if (err.code != 'ResourceConflictException') throw err;
if (err.code !== 'ResourceConflictException') throw err;
// If it exists it will result in an error but there is no problem.
resolve('Already exists permission');
}
Expand Down
10 changes: 5 additions & 5 deletions test/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ function _timeout(params) {
// Even if timeout is set for the whole test for Windows,
// if it is set in local it will be valid.
// For Windows, do not set it with local.
if (process.platform != 'win32') {
if (process.platform !== 'win32') {
params.this.timeout(params.sec * 1000);
}
}

describe('lib/main', function () {
if (process.platform == 'win32') {
if (process.platform === 'win32') {
// It seems that it takes time for file operation in Windows.
// So set `timeout(60000)` for the whole test.
this.timeout(60000);
Expand Down Expand Up @@ -272,7 +272,7 @@ describe('lib/main', function () {
assert.notInclude(contents, 'fuga', 'Target: "__unittest/fuga"');

contents = fs.readdirSync(path.join(codeDirectory, '__unittest', 'hoge'));
assert.isTrue(contents.length == 0, 'directory:__unittest/hoge is empty');
assert.equal(contents.length, 0, 'directory:__unittest/hoge is empty');
done();
});
});
Expand Down Expand Up @@ -309,7 +309,7 @@ describe('lib/main', function () {
}

describe('_fileCopy', function() { rsyncTests('_fileCopy'); });
if (process.platform == 'win32') {
if (process.platform === 'win32') {
it('For Windows, `_rsync` tests pending');
} else {
describe('_rsync', function() { rsyncTests('_rsync'); });
Expand Down Expand Up @@ -343,7 +343,7 @@ describe('lib/main', function () {
});

describe('_postInstallScript', function () {
if (process.platform == 'win32') {
if (process.platform === 'win32') {
return it('`_postInstallScript` test does not support Windows.');
}

Expand Down