@waiting/shared-types-dev
Advanced tools
Comparing version 18.0.4 to 18.0.5
@@ -1,1 +0,1 @@ | ||
export * from './types.js'; | ||
export type * from './types.js'; |
@@ -1,2 +0,2 @@ | ||
export * from './types.js'; | ||
export {}; | ||
//# sourceMappingURL=index.js.map |
@@ -1,2 +0,2 @@ | ||
export * from './callstack/index.js'; | ||
export type * from './callstack/index.js'; | ||
export * from './ts-morph/index.js'; | ||
@@ -3,0 +3,0 @@ export { createObjectLiteralExpression, isKeysCallExpression, isKeysImportExpression, processImportDeclaration, } from './ts/ts-common.js'; |
@@ -1,2 +0,1 @@ | ||
export * from './callstack/index.js'; | ||
export * from './ts-morph/index.js'; | ||
@@ -3,0 +2,0 @@ export { createObjectLiteralExpression, isKeysCallExpression, isKeysImportExpression, processImportDeclaration, } from './ts/ts-common.js'; |
@@ -1,3 +0,1 @@ | ||
/* eslint-disable max-len */ | ||
// eslint-disable-next-line import/no-extraneous-dependencies | ||
import ts from 'typescript'; | ||
@@ -4,0 +2,0 @@ /** |
@@ -1,4 +0,2 @@ | ||
/* eslint-disable max-len */ | ||
import { join } from 'node:path'; | ||
// eslint-disable-next-line import/no-extraneous-dependencies | ||
import ts from 'typescript'; | ||
@@ -5,0 +3,0 @@ import { baseDir } from '../../base.js'; |
@@ -10,2 +10,2 @@ import ts from 'typescript'; | ||
export declare function transTypetoLiteralObj(program: ts.Program, options: TransTypetoLiteralObjOpts): ts.TransformerFactory<ts.SourceFile>; | ||
export declare function computeCallExpressionToLiteralObj(funcName?: TransFormOptions['needle'] | undefined): unknown; | ||
export declare function computeCallExpressionToLiteralObj(funcName?: TransFormOptions['needle']): unknown; |
@@ -1,6 +0,4 @@ | ||
/* eslint-disable max-len */ | ||
import assert from 'node:assert'; | ||
import { getCallerStack } from '@waiting/shared-core'; | ||
import { SyntaxKind } from 'ts-morph'; | ||
// eslint-disable-next-line import/no-extraneous-dependencies | ||
import ts from 'typescript'; | ||
@@ -7,0 +5,0 @@ import { createObjectLiteralExpression, isKeysCallExpression, isKeysImportExpression, processImportDeclaration, } from '../ts/ts-common.js'; |
@@ -1,2 +0,2 @@ | ||
import type { SourceFile, Node, CallExpression, TypeNode, ProjectOptions, Type } from 'ts-morph'; | ||
import type { CallExpression, Node, ProjectOptions, SourceFile, Type, TypeNode } from 'ts-morph'; | ||
import { ts } from 'ts-morph'; | ||
@@ -27,3 +27,3 @@ import type { CallerInfo } from '../callstack/index.js'; | ||
} | ||
export declare function retrieveCallExpressionByPos(options: RetrieveCallExpressionByPosOpts, needle?: string | undefined): CallExpression | undefined; | ||
export declare function retrieveCallExpressionByPos(options: RetrieveCallExpressionByPosOpts, needle?: string): CallExpression | undefined; | ||
/** | ||
@@ -36,2 +36,2 @@ * Retrieve variable name from CallExpression CallerInfo | ||
*/ | ||
export declare function retrieveVarInfoFromCallExpressionCallerInfo(options: CallerInfo, needle?: string | undefined, sourceFile?: SourceFile | undefined): VariableNameInfo | undefined; | ||
export declare function retrieveVarInfoFromCallExpressionCallerInfo(options: CallerInfo, needle?: string, sourceFile?: SourceFile): VariableNameInfo | undefined; |
@@ -140,3 +140,2 @@ import assert from 'node:assert'; | ||
if (kind === SyntaxKind.VariableDeclaration && sym) { | ||
// eslint-disable-next-line | ||
// const name = input.getNameNode().getText() as string | ||
@@ -161,3 +160,2 @@ const name = sym.getName(); // variable name: dbDict | ||
typeReferenceText = typeReference.getText(); | ||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access | ||
// if (typeReference.getKind() !== SyntaxKind.TypeReference) { | ||
@@ -168,3 +166,3 @@ // throw new TypeError(`Variable type must be TypeReference, like "const dict: DbDict<Db> = ..."`) | ||
} | ||
catch (ex) { | ||
catch { | ||
void 0; | ||
@@ -185,3 +183,2 @@ } | ||
// ts.SyntaxKind.CallExpression may 203 or 204.... | ||
// eslint-disable-next-line @typescript-eslint/prefer-ts-expect-error | ||
// @ts-ignore | ||
@@ -188,0 +185,0 @@ expressions = file.getDescendantsOfKind(203); |
@@ -1,3 +0,2 @@ | ||
/* eslint-disable @typescript-eslint/ban-types */ | ||
import assert from 'assert'; | ||
import assert from 'node:assert'; | ||
import { deepFind } from '../util.js'; | ||
@@ -214,3 +213,3 @@ import { findCallExpressionsByName, retrieveFirstTypeArgTextFromCallExpression, retrieveVarInfoFromCallExpression, } from './morph-common.js'; | ||
} | ||
const propKey = pidPath.length > 1 ? pidPath.slice(-1)[0] : ''; | ||
const propKey = pidPath.length > 1 ? pidPath.at(-1) : ''; | ||
if (!propKey) { | ||
@@ -217,0 +216,0 @@ throw new TypeError('propKey empty'); |
import type { LiteralObject } from '@waiting/shared-types'; | ||
import type { ts, SourceFile, CallExpression } from 'ts-morph'; | ||
import type { CallExpression, SourceFile, ts } from 'ts-morph'; | ||
export interface TransFormOptions { | ||
@@ -4,0 +4,0 @@ sourceFile: SourceFile; |
import type { LiteralObject } from '@waiting/shared-types'; | ||
import { type ImportDeclaration, type Node, type ObjectLiteralExpression, type TypeChecker, type CallExpression } from 'typescript'; | ||
import { type CallExpression, type ImportDeclaration, type Node, type ObjectLiteralExpression, type TypeChecker } from 'typescript'; | ||
export declare function createObjectLiteralExpression(input: LiteralObject): ObjectLiteralExpression; | ||
@@ -4,0 +4,0 @@ /** |
@@ -0,5 +1,6 @@ | ||
/* eslint-disable unicorn/prefer-module */ | ||
import { createRequire } from 'node:module'; | ||
import { dirname } from 'node:path'; | ||
import { pathResolve } from '@waiting/shared-core'; | ||
import { factory, isCallExpression, isImportDeclaration, isJSDocSignature, SyntaxKind, } from 'typescript'; | ||
import { SyntaxKind, factory, isCallExpression, isImportDeclaration, isJSDocSignature, } from 'typescript'; | ||
export function createObjectLiteralExpression(input) { | ||
@@ -98,3 +99,3 @@ const arr = Object.entries(input).map(([key, value]) => { | ||
} | ||
catch (ex) { | ||
catch { | ||
// console.info({ module }) | ||
@@ -101,0 +102,0 @@ return false; |
@@ -1,2 +0,1 @@ | ||
// eslint-disable-next-line @typescript-eslint/ban-types | ||
export function deepFind(obj, paths) { | ||
@@ -3,0 +2,0 @@ let ret = { |
{ | ||
"name": "@waiting/shared-types-dev", | ||
"author": "waiting", | ||
"version": "18.0.4", | ||
"version": "18.0.5", | ||
"description": "shared typescript types develop", | ||
@@ -35,4 +35,3 @@ "private": false, | ||
"dependencies": { | ||
"@waiting/shared-core": "^23.21.0", | ||
"@waiting/shared-types": "^23.21.0", | ||
"@waiting/shared-core": "^23.22.0", | ||
"ts-morph": "^23.0.0" | ||
@@ -77,3 +76,3 @@ }, | ||
}, | ||
"gitHead": "b55729234446240829aa5fcaf5e4640462db412f" | ||
"gitHead": "422b9ebbab51772a0559380f0b5c86f72cbb696b" | ||
} |
export * from './types.js' | ||
export type * from './types.js' | ||
export * from './callstack/index.js' | ||
export type * from './callstack/index.js' | ||
export * from './ts-morph/index.js' | ||
@@ -4,0 +4,0 @@ |
@@ -1,3 +0,2 @@ | ||
/* eslint-disable max-len */ | ||
// eslint-disable-next-line import/no-extraneous-dependencies | ||
import ts from 'typescript' | ||
@@ -4,0 +3,0 @@ |
@@ -1,5 +0,5 @@ | ||
/* eslint-disable max-len */ | ||
import { join } from 'node:path' | ||
// eslint-disable-next-line import/no-extraneous-dependencies | ||
import ts from 'typescript' | ||
@@ -6,0 +6,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* eslint-disable max-len */ | ||
import assert from 'node:assert' | ||
@@ -7,3 +7,2 @@ | ||
import { SyntaxKind } from 'ts-morph' | ||
// eslint-disable-next-line import/no-extraneous-dependencies | ||
import ts from 'typescript' | ||
@@ -26,4 +25,4 @@ | ||
import type { | ||
CallExpressionPosKey, | ||
TransFormOptions, | ||
CallExpressionPosKey, | ||
} from '../ts-morph/tpl-literal.types.js' | ||
@@ -144,3 +143,3 @@ | ||
export function computeCallExpressionToLiteralObj(funcName?: TransFormOptions['needle'] | undefined): unknown { | ||
export function computeCallExpressionToLiteralObj(funcName?: TransFormOptions['needle']): unknown { | ||
@@ -147,0 +146,0 @@ const callerInfo = getCallerStack(2, true) |
@@ -5,8 +5,8 @@ import assert from 'node:assert' | ||
import type { | ||
SourceFile, | ||
CallExpression, | ||
Node, | ||
CallExpression, | ||
TypeNode, | ||
ProjectOptions, | ||
SourceFile, | ||
Type, | ||
TypeNode, | ||
} from 'ts-morph' | ||
@@ -220,3 +220,3 @@ import { | ||
if (kind === SyntaxKind.VariableDeclaration && sym) { | ||
// eslint-disable-next-line | ||
// const name = input.getNameNode().getText() as string | ||
@@ -243,3 +243,3 @@ const name = sym.getName() // variable name: dbDict | ||
typeReferenceText = typeReference.getText() | ||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access | ||
// if (typeReference.getKind() !== SyntaxKind.TypeReference) { | ||
@@ -250,3 +250,3 @@ // throw new TypeError(`Variable type must be TypeReference, like "const dict: DbDict<Db> = ..."`) | ||
} | ||
catch (ex) { void 0 } | ||
catch { void 0 } | ||
@@ -270,3 +270,3 @@ const ret = { | ||
options: RetrieveCallExpressionByPosOpts, | ||
needle?: string | undefined, | ||
needle?: string, | ||
): CallExpression | undefined { | ||
@@ -278,3 +278,3 @@ | ||
// ts.SyntaxKind.CallExpression may 203 or 204.... | ||
// eslint-disable-next-line @typescript-eslint/prefer-ts-expect-error | ||
// @ts-ignore | ||
@@ -356,4 +356,4 @@ expressions = file.getDescendantsOfKind(203) | ||
options: CallerInfo, | ||
needle?: string | undefined, | ||
sourceFile?: SourceFile | undefined, | ||
needle?: string, | ||
sourceFile?: SourceFile, | ||
): VariableNameInfo | undefined { | ||
@@ -360,0 +360,0 @@ |
@@ -1,12 +0,11 @@ | ||
/* eslint-disable @typescript-eslint/ban-types */ | ||
import assert from 'assert' | ||
import assert from 'node:assert' | ||
import type { LiteralObject } from '@waiting/shared-types' | ||
import type { | ||
ts, | ||
Identifier, | ||
SourceFile, | ||
Symbol, | ||
TypeAliasDeclaration, | ||
Symbol, | ||
TypeChecker, | ||
ts, | ||
} from 'ts-morph' | ||
@@ -311,3 +310,3 @@ | ||
} | ||
const propKey = pidPath.length > 1 ? pidPath.slice(-1)[0] : '' | ||
const propKey = pidPath.length > 1 ? pidPath.at(-1) : '' | ||
if (! propKey) { | ||
@@ -314,0 +313,0 @@ throw new TypeError('propKey empty') |
@@ -1,7 +0,6 @@ | ||
/* eslint-disable @typescript-eslint/ban-types */ | ||
import type { LiteralObject } from '@waiting/shared-types' | ||
import type { | ||
CallExpression, | ||
SourceFile, | ||
ts, | ||
SourceFile, | ||
CallExpression, | ||
} from 'ts-morph' | ||
@@ -8,0 +7,0 @@ |
@@ -0,1 +1,2 @@ | ||
/* eslint-disable unicorn/prefer-module */ | ||
import { createRequire } from 'node:module' | ||
@@ -7,2 +8,3 @@ import { dirname } from 'node:path' | ||
import { | ||
type CallExpression, | ||
type ImportClause, | ||
@@ -13,8 +15,8 @@ type ImportDeclaration, | ||
type Node, | ||
type ObjectLiteralElementLike, | ||
type ObjectLiteralExpression, | ||
type PropertyAssignment, | ||
type ObjectLiteralExpression, | ||
type ObjectLiteralElementLike, | ||
type StringLiteral, | ||
type TypeChecker, | ||
type CallExpression, | ||
SyntaxKind, | ||
factory, | ||
@@ -24,3 +26,2 @@ isCallExpression, | ||
isJSDocSignature, | ||
SyntaxKind, | ||
} from 'typescript' | ||
@@ -172,3 +173,3 @@ | ||
} | ||
catch (ex) { | ||
catch { | ||
// console.info({ module }) | ||
@@ -175,0 +176,0 @@ return false |
@@ -1,3 +0,1 @@ | ||
// eslint-disable-next-line @typescript-eslint/ban-types | ||
export function deepFind(obj: object, paths: string[]): unknown { | ||
@@ -4,0 +2,0 @@ let ret = { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
2
116387
2373
- Removed@waiting/shared-types@^23.21.0