Skip to content

Conversation

@r7kamura
Copy link
Contributor

@r7kamura r7kamura commented Aug 1, 2015

String is used as shortcut syntax as we use like npm install user/repo.
See https://docs.npmjs.com/files/package.json#repository for more details.

How to reproduce error

diff --git a/test/fixture/package.json b/test/fixture/package.json
index c02f8fa..1b42a19 100644
--- a/test/fixture/package.json
+++ b/test/fixture/package.json
@@ -1,9 +1,6 @@
 {
   "name": "esdoc-test-fixture",
   "version": "1.2.3",
-  "repository": {
-    "type": "git",
-    "url": "https://github.com/h13i32maru/esdoc"
-  },
+  "repository": "h13i32maru/esdoc",
   "main": "./out/src/MyClass.js"
 }
$ npm run test

> esdoc@0.1.4 test /Users/r7kamura/src/github.com/h13i32maru/esdoc
> node ./script/test.js

error: could not parse /Users/r7kamura/src/github.com/h13i32maru/esdoc/test/fixture/src/UnknownSyntax.js
badge.svg
/Users/r7kamura/src/github.com/h13i32maru/esdoc/src/Publisher/Builder/DocBuilder.js:230
      if (indexInfo.url.indexOf('git@github.com:') === 0) {
                       ^
TypeError: Cannot read property 'indexOf' of undefined
    at IdentifiersDocBuilder._getInfo (/Users/r7kamura/src/github.com/h13i32maru/esdoc/src/Publisher/Builder/DocBuilder.js:147:22)

String is used as shortcut syntax as we use for `npm install user/repo`.
See https://docs.npmjs.com/files/package.json#repository for more details.
h13i32maru added a commit that referenced this pull request Aug 2, 2015
Fix error on string repository property in package.json
@h13i32maru h13i32maru merged commit 5b94826 into esdoc:master Aug 2, 2015
@h13i32maru
Copy link
Member

Thanks for PR 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants