@travetto/transformer
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -10,3 +10,3 @@ { | ||
"dependencies": { | ||
"@travetto/base": "^1.0.1" | ||
"@travetto/base": "^1.0.2" | ||
}, | ||
@@ -32,4 +32,4 @@ "title": "Transformation", | ||
}, | ||
"version": "1.0.1", | ||
"gitHead": "8f3d485c2997143df05241d7d12a24dd46525071" | ||
"version": "1.0.2", | ||
"gitHead": "9ca7c2f3ea75622df49ef9773aa9dd7340aa580f" | ||
} |
@@ -85,2 +85,15 @@ import * as ts from 'typescript'; | ||
} | ||
/** | ||
* Create property access | ||
*/ | ||
static createAccess(first: string | ts.Expression, second: string | ts.Identifier, ...items: (string | ts.Identifier)[]) { | ||
if (typeof first === 'string') { | ||
first = ts.createIdentifier(first); | ||
} | ||
return items.reduce( | ||
(acc, p) => ts.createPropertyAccess(acc, p), | ||
ts.createPropertyAccess(first, second) | ||
); | ||
} | ||
} |
@@ -31,3 +31,3 @@ import * as ts from 'typescript'; | ||
const pth = require.resolve(src.fileName); | ||
const base = FsUtil.resolveUnix(FsUtil.toUnix(pth)); | ||
const base = FsUtil.toUnix(pth); | ||
@@ -62,3 +62,3 @@ const imports = new Map<string, Import>(); | ||
*/ | ||
public static addImports(file: ts.SourceFile, ...imports: Import[]) { | ||
static addImports(file: ts.SourceFile, ...imports: Import[]) { | ||
if (!imports.length) { | ||
@@ -65,0 +65,0 @@ return file; |
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
58811
1568
Updated@travetto/base@^1.0.2