ts-transformer-keys
Advanced tools
Comparing version 0.3.4 to 0.3.5
{ | ||
"name": "ts-transformer-keys", | ||
"version": "0.3.4", | ||
"description": "Check equality of objects based on their contextual type in TypeScript", | ||
"version": "0.3.5", | ||
"description": "A TypeScript custom transformer which enables to obtain keys of given type.", | ||
"main": "index.js", | ||
@@ -6,0 +6,0 @@ "scripts": { |
@@ -36,3 +36,3 @@ # ts-transformer-keys | ||
### webpack (with awesome-typescript-loader) | ||
### webpack (with ts-loader or awesome-typescript-loader) | ||
@@ -51,3 +51,3 @@ See [examples/webpack](examples/webpack) for detail. | ||
test: /\.ts$/, | ||
loader: 'awesome-typescript-loader', | ||
loader: 'ts-loader', // or 'awesome-typescript-loader' | ||
options: { | ||
@@ -67,3 +67,3 @@ getCustomTransformers: program => ({ | ||
## Rollup (with rollup-plugin-typescript2) | ||
### Rollup (with rollup-plugin-typescript2) | ||
@@ -89,3 +89,3 @@ See [examples/rollup](examples/rollup) for detail. | ||
## ttypescript | ||
### ttypescript | ||
@@ -108,3 +108,3 @@ See [examples/ttypescript](examples/ttypescript) for detail. | ||
## TypeScript API | ||
### TypeScript API | ||
@@ -111,0 +111,0 @@ See [test](test) for detail. |
@@ -26,3 +26,3 @@ "use strict"; | ||
function isKeysCallExpression(node, typeChecker) { | ||
if (node.kind !== ts.SyntaxKind.CallExpression) { | ||
if (!ts.isCallExpression(node)) { | ||
return false; | ||
@@ -36,5 +36,6 @@ } | ||
return !!declaration | ||
&& !ts.isJSDocSignature(declaration) | ||
&& (path.join(declaration.getSourceFile().fileName) === indexTs) | ||
&& !!declaration['name'] | ||
&& (declaration['name'].getText() === 'keys'); | ||
&& !!declaration.name | ||
&& declaration.name.getText() === 'keys'; | ||
} |
@@ -29,6 +29,6 @@ import * as ts from 'typescript'; | ||
function isKeysCallExpression(node: ts.Node, typeChecker: ts.TypeChecker): node is ts.CallExpression { | ||
if (node.kind !== ts.SyntaxKind.CallExpression) { | ||
if (!ts.isCallExpression(node)) { | ||
return false; | ||
} | ||
const signature = typeChecker.getResolvedSignature(node as ts.CallExpression); | ||
const signature = typeChecker.getResolvedSignature(node); | ||
if (typeof signature === 'undefined') { | ||
@@ -39,5 +39,6 @@ return false; | ||
return !!declaration | ||
&& !ts.isJSDocSignature(declaration) | ||
&& (path.join(declaration.getSourceFile().fileName) === indexTs) | ||
&& !!declaration['name'] | ||
&& (declaration['name'].getText() === 'keys'); | ||
&& !!declaration.name | ||
&& declaration.name.getText() === 'keys'; | ||
} |
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
9601
80