Skip to content

Commit

Permalink
chore: format code style
Browse files Browse the repository at this point in the history
  • Loading branch information
azu committed Jan 19, 2015
1 parent 1541388 commit fc706e0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions lib/get-package-json.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
// LICENSE : MIT
"use strict";
var fs = require("fs");

var assert = require("assert");
var pather = require("path");
var path = require("path");
var packageName = require("../package.json").name;

function findPackageDir(paths) {
if (!paths) {
return null;
}
for (var i = 0; i < paths.length; ++i) {
var dir = pather.dirname(paths[i]);
var dirName = dir.split(pather.sep).pop();
var dir = path.dirname(paths[i]);
var dirName = dir.split(path.sep).pop();
if (dirName !== packageName) {
return dir;
}
Expand All @@ -26,6 +26,6 @@ function findPackageDir(paths) {
function getPackageJSON(paths) {
var dir = findPackageDir(paths);
assert(dir, "package.json is not found");
return require(pather.resolve(dir, "package.json"));
return require(path.resolve(dir, "package.json"));
}
module.exports = getPackageJSON;
2 changes: 1 addition & 1 deletion test/get-test-dir-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
var assert = require("assert");
var getTestDir = require("../lib/get-test-dir");
describe("get-test-dir-test", function () {
context("When package.json does not have directories properties", function () {
context("when package.json does not have directories properties", function () {
it("should return directories properties", function () {
var packageJsonMock = {};
var expected = "test/";
Expand Down

0 comments on commit fc706e0

Please sign in to comment.