diff --git a/src/nodes/package-declaration.js b/src/nodes/package-declaration.js index b794b6a..39a753f 100644 --- a/src/nodes/package-declaration.js +++ b/src/nodes/package-declaration.js @@ -5,10 +5,9 @@ const { } = require("prettier"); module.exports = (path, opts, print) => { - const packageName = path - .getValue() - .pkg.names.join(".") - .toLowerCase(); + const { + pkg: { names: names } + } = path.getValue(); - return concat(["package ", packageName, literalline, literalline]); + return concat(["package ", names.join("."), literalline, literalline]); }; diff --git a/src/nodes/package-declaration.spec.js b/src/nodes/package-declaration.spec.js index 17bb6ab..efc29f3 100644 --- a/src/nodes/package-declaration.spec.js +++ b/src/nodes/package-declaration.spec.js @@ -12,8 +12,8 @@ describe("package-declaration", () => { "package com.github.thing.app\n" )); - test("uppercase", () => - expect("package COM.github.thing.APP").toChangeFormat( - "package com.github.thing.app\n" + test("differing cases", () => + expect("package COM.gitHub.thing.APP").toChangeFormat( + "package COM.gitHub.thing.APP\n" )); });