Comparing version 4.8.0 to 4.9.0
@@ -21,2 +21,5 @@ "use strict"; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -27,2 +30,3 @@ exports.Def = exports.deepGenerate = exports.Code = void 0; | ||
const prettier_1 = __importStar(require("prettier")); | ||
const parser_typescript_1 = __importDefault(require("prettier/parser-typescript")); | ||
const is_plain_object_1 = require("./is-plain-object"); | ||
@@ -227,7 +231,9 @@ const ConditionalOutput_1 = require("./ConditionalOutput"); | ||
exports.deepGenerate = deepGenerate; | ||
const configPromise = prettier_1.resolveConfig('./'); | ||
// Use an optional call here in case we are using standalone prettier. This can happen when loaded through a CDN from | ||
// a browser (or Deno), because prettier has `"browser": "./standalone.js"` in it's package.json. | ||
const configPromise = prettier_1.resolveConfig === null || prettier_1.resolveConfig === void 0 ? void 0 : prettier_1.resolveConfig('./'); | ||
async function maybePrettyWithConfig(input, options) { | ||
try { | ||
const config = await configPromise; | ||
return prettier_1.default.format(input.trim(), { parser: 'typescript', ...config, ...options }); | ||
return prettier_1.default.format(input.trim(), { parser: 'typescript', plugins: [parser_typescript_1.default], ...config, ...options }); | ||
} | ||
@@ -273,3 +279,3 @@ catch (e) { | ||
try { | ||
return prettier_1.default.format(input.trim(), { parser: 'typescript' }); | ||
return prettier_1.default.format(input.trim(), { parser: 'typescript', plugins: [parser_typescript_1.default] }); | ||
} | ||
@@ -276,0 +282,0 @@ catch (e) { |
{ | ||
"name": "ts-poet", | ||
"version": "4.8.0", | ||
"version": "4.9.0", | ||
"description": "code generation DSL for TypeScript", | ||
@@ -5,0 +5,0 @@ "main": "build/index.js", |
@@ -12,10 +12,8 @@ ![npm](https://img.shields.io/npm/v/ts-poet) | ||
```typescript | ||
import { Observable } from 'rxjs/Observable'; | ||
import { Observable } from "rxjs/Observable"; | ||
class Greeter { | ||
export class Greeter { | ||
private name: string; | ||
constructor(private name: string) { | ||
} | ||
constructor(private name: string) {} | ||
@@ -39,3 +37,3 @@ greet(): Observable<string> { | ||
greet(): ${Observable}<string> { | ||
return ${Observable}.from(\`Hello $name\`)}; | ||
return ${Observable}.from(\`Hello $name\`); | ||
} | ||
@@ -42,0 +40,0 @@ `; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
85075
28
1440
153