ast-kit
Advanced tools
Comparing version 0.9.5 to 0.10.0
@@ -116,2 +116,26 @@ // src/check.ts | ||
// src/create.ts | ||
function createStringLiteral(value) { | ||
return { | ||
type: "StringLiteral", | ||
value, | ||
extra: { | ||
rawValue: value, | ||
raw: JSON.stringify(value) | ||
} | ||
}; | ||
} | ||
function createTSUnionType(types) { | ||
return { | ||
type: "TSUnionType", | ||
types | ||
}; | ||
} | ||
function createTSLiteralType(literal) { | ||
return { | ||
type: "TSLiteralType", | ||
literal | ||
}; | ||
} | ||
// src/lang.ts | ||
@@ -629,2 +653,5 @@ import { extname } from "pathe"; | ||
babelParseExpression, | ||
createStringLiteral, | ||
createTSLiteralType, | ||
createTSUnionType, | ||
escapeKey, | ||
@@ -631,0 +658,0 @@ getLang, |
@@ -27,2 +27,6 @@ import * as t from '@babel/types'; | ||
declare function createStringLiteral(value: string): t.StringLiteral; | ||
declare function createTSUnionType(types: t.TSType[]): t.TSUnionType; | ||
declare function createTSLiteralType(literal: t.TSLiteralType['literal']): t.TSLiteralType; | ||
declare const REGEX_DTS: RegExp; | ||
@@ -86,2 +90,2 @@ declare const REGEX_LANG_TS: RegExp; | ||
export { GetNode, ImportBinding, LiteralUnion, NodeType, ObjectPropertyLike, REGEX_DTS, REGEX_LANG_JSX, REGEX_LANG_TS, TS_NODE_TYPES, WithScope, attachScopes, babelParse, babelParseExpression, escapeKey, getLang, isCallOf, isDts, isFunctionType, isIdentifierOf, isLiteralType, isReferenced, isTs, isTypeOf, resolveIdentifier, resolveLiteral, resolveObjectKey, resolveString, resolveTemplateLiteral, unwrapTSNode, walkAST, walkASTAsync, walkASTSetup, walkImportDeclaration }; | ||
export { GetNode, ImportBinding, LiteralUnion, NodeType, ObjectPropertyLike, REGEX_DTS, REGEX_LANG_JSX, REGEX_LANG_TS, TS_NODE_TYPES, WithScope, attachScopes, babelParse, babelParseExpression, createStringLiteral, createTSLiteralType, createTSUnionType, escapeKey, getLang, isCallOf, isDts, isFunctionType, isIdentifierOf, isLiteralType, isReferenced, isTs, isTypeOf, resolveIdentifier, resolveLiteral, resolveObjectKey, resolveString, resolveTemplateLiteral, unwrapTSNode, walkAST, walkASTAsync, walkASTSetup, walkImportDeclaration }; |
@@ -116,2 +116,26 @@ // src/check.ts | ||
// src/create.ts | ||
function createStringLiteral(value) { | ||
return { | ||
type: "StringLiteral", | ||
value, | ||
extra: { | ||
rawValue: value, | ||
raw: JSON.stringify(value) | ||
} | ||
}; | ||
} | ||
function createTSUnionType(types) { | ||
return { | ||
type: "TSUnionType", | ||
types | ||
}; | ||
} | ||
function createTSLiteralType(literal) { | ||
return { | ||
type: "TSLiteralType", | ||
literal | ||
}; | ||
} | ||
// src/lang.ts | ||
@@ -629,2 +653,5 @@ import { extname } from "pathe"; | ||
babelParseExpression, | ||
createStringLiteral, | ||
createTSLiteralType, | ||
createTSUnionType, | ||
escapeKey, | ||
@@ -631,0 +658,0 @@ getLang, |
{ | ||
"name": "ast-kit", | ||
"version": "0.9.5", | ||
"version": "0.10.0", | ||
"packageManager": "pnpm@8.6.12", | ||
@@ -24,6 +24,2 @@ "description": "AST Toolkit.", | ||
".": { | ||
"types": { | ||
"require": "./dist/index.d.cts", | ||
"import": "./dist/index.d.ts" | ||
}, | ||
"require": "./dist/index.cjs", | ||
@@ -38,22 +34,22 @@ "import": "./dist/index.js" | ||
"dependencies": { | ||
"@babel/parser": "^7.22.7", | ||
"@rollup/pluginutils": "^5.0.2", | ||
"@babel/parser": "^7.22.10", | ||
"@rollup/pluginutils": "^5.0.3", | ||
"pathe": "^1.1.1" | ||
}, | ||
"devDependencies": { | ||
"@babel/types": "^7.22.5", | ||
"@sxzz/eslint-config": "^3.3.2", | ||
"@babel/types": "^7.22.10", | ||
"@sxzz/eslint-config": "^3.4.0", | ||
"@sxzz/prettier-config": "^1.0.4", | ||
"@types/node": "^20.4.8", | ||
"@vitest/coverage-v8": "^0.34.1", | ||
"@vitest/ui": "^0.34.1", | ||
"bumpp": "^9.1.1", | ||
"eslint": "^8.46.0", | ||
"@types/node": "^20.5.1", | ||
"@vitest/coverage-v8": "^0.34.2", | ||
"@vitest/ui": "^0.34.2", | ||
"bumpp": "^9.2.0", | ||
"eslint": "^8.47.0", | ||
"estree-walker": "^3.0.3", | ||
"fast-glob": "^3.3.1", | ||
"prettier": "^3.0.1", | ||
"prettier": "^3.0.2", | ||
"tsup": "^7.2.0", | ||
"tsx": "^3.12.7", | ||
"typescript": "^5.1.6", | ||
"vitest": "^0.34.1" | ||
"vitest": "^0.34.2" | ||
}, | ||
@@ -60,0 +56,0 @@ "engines": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
73243
2087
Updated@babel/parser@^7.22.10
Updated@rollup/pluginutils@^5.0.3