(jsonContent, fieldName, baseDirectory, state)
| 42407 | return value; |
| 42408 | } |
| 42409 | function readPackageJsonPathField(jsonContent, fieldName, baseDirectory, state) { |
| 42410 | var fileName = readPackageJsonField(jsonContent, fieldName, "string", state); |
| 42411 | if (fileName === undefined) { |
| 42412 | return; |
| 42413 | } |
| 42414 | if (!fileName) { |
| 42415 | if (state.traceEnabled) { |
| 42416 | trace(state.host, ts.Diagnostics.package_json_had_a_falsy_0_field, fieldName); |
| 42417 | } |
| 42418 | return; |
| 42419 | } |
| 42420 | var path = ts.normalizePath(ts.combinePaths(baseDirectory, fileName)); |
| 42421 | if (state.traceEnabled) { |
| 42422 | trace(state.host, ts.Diagnostics.package_json_has_0_field_1_that_references_2, fieldName, fileName, path); |
| 42423 | } |
| 42424 | return path; |
| 42425 | } |
| 42426 | function readPackageJsonTypesFields(jsonContent, baseDirectory, state) { |
| 42427 | return readPackageJsonPathField(jsonContent, "typings", baseDirectory, state) |
| 42428 | || readPackageJsonPathField(jsonContent, "types", baseDirectory, state); |
no test coverage detected
searching dependent graphs…