Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ts-transformer-keys

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ts-transformer-keys - npm Package Compare versions

Comparing version 0.3.4 to 0.3.5

4

package.json
{
"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';
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc