Comparing version 0.5.0 to 0.5.1
@@ -1,59 +0,3 @@ | ||
"use strict"; | ||
var __create = Object.create; | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __getProtoOf = Object.getPrototypeOf; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __export = (target, all) => { | ||
for (var name in all) | ||
__defProp(target, name, { get: all[name], enumerable: true }); | ||
}; | ||
var __copyProps = (to, from, except, desc) => { | ||
if (from && typeof from === "object" || typeof from === "function") { | ||
for (let key of __getOwnPropNames(from)) | ||
if (!__hasOwnProp.call(to, key) && key !== except) | ||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | ||
} | ||
return to; | ||
}; | ||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( | ||
// If the importer is in node compatibility mode or this is not an ESM | ||
// file that has been converted to a CommonJS file using a Babel- | ||
// compatible transform (i.e. "__esModule" has not been set), then set | ||
// "default" to the CommonJS "module.exports" for node compatibility. | ||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, | ||
mod | ||
)); | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
// src/index.ts | ||
var src_exports = {}; | ||
__export(src_exports, { | ||
REGEX_DTS: () => REGEX_DTS, | ||
REGEX_LANG_JSX: () => REGEX_LANG_JSX, | ||
REGEX_LANG_TS: () => REGEX_LANG_TS, | ||
TS_NODE_TYPES: () => TS_NODE_TYPES, | ||
attachScopes: () => attachScopes, | ||
babelParse: () => babelParse, | ||
escapeKey: () => escapeKey, | ||
getLang: () => getLang, | ||
isCallOf: () => isCallOf, | ||
isDts: () => isDts, | ||
isFunctionType: () => isFunctionType, | ||
isLiteralType: () => isLiteralType, | ||
isTs: () => isTs, | ||
isTypeOf: () => isTypeOf, | ||
resolveIdentifier: () => resolveIdentifier, | ||
resolveLiteral: () => resolveLiteral, | ||
resolveString: () => resolveString, | ||
resolveTemplateLiteral: () => resolveTemplateLiteral, | ||
unwrapTSNode: () => unwrapTSNode, | ||
walkAST: () => walkAST, | ||
walkImportDeclaration: () => walkImportDeclaration | ||
}); | ||
module.exports = __toCommonJS(src_exports); | ||
// src/lang.ts | ||
var import_pathe = __toESM(require("pathe")); | ||
import pathe from "pathe"; | ||
var REGEX_DTS = /\.d\.[cm]?ts$/; | ||
@@ -65,3 +9,3 @@ var REGEX_LANG_TS = /^[cm]?tsx?$/; | ||
return "dts"; | ||
return import_pathe.default.extname(filename).replace(/^\./, ""); | ||
return pathe.extname(filename).replace(/^\./, ""); | ||
} | ||
@@ -76,3 +20,3 @@ function isDts(filename) { | ||
// src/parse.ts | ||
var import_parser = require("@babel/parser"); | ||
import { parse } from "@babel/parser"; | ||
function babelParse(code, lang, options = {}) { | ||
@@ -89,3 +33,3 @@ const plugins = [...options.plugins || []]; | ||
} | ||
const { program } = (0, import_parser.parse)(code, { | ||
const { program } = parse(code, { | ||
sourceType: "module", | ||
@@ -99,3 +43,3 @@ plugins, | ||
// src/utils.ts | ||
var import_parser2 = require("@babel/parser"); | ||
import { parseExpression } from "@babel/parser"; | ||
function isTypeOf(node, types) { | ||
@@ -144,3 +88,3 @@ return types.some((type) => { | ||
try { | ||
const node = (0, import_parser2.parseExpression)(`({${rawKey}: 1})`); | ||
const node = parseExpression(`({${rawKey}: 1})`); | ||
if (node.properties[0].key.type === "Identifier") | ||
@@ -220,4 +164,6 @@ return rawKey; | ||
// src/scope.ts | ||
var import_pluginutils = require("@rollup/pluginutils"); | ||
var attachScopes = import_pluginutils.attachScopes; | ||
import { | ||
attachScopes as _attachScopes | ||
} from "@rollup/pluginutils"; | ||
var attachScopes = _attachScopes; | ||
@@ -398,1 +344,24 @@ // node_modules/.pnpm/estree-walker@3.0.3/node_modules/estree-walker/src/walker.js | ||
} | ||
export { | ||
REGEX_DTS, | ||
REGEX_LANG_JSX, | ||
REGEX_LANG_TS, | ||
TS_NODE_TYPES, | ||
attachScopes, | ||
babelParse, | ||
escapeKey, | ||
getLang, | ||
isCallOf, | ||
isDts, | ||
isFunctionType, | ||
isLiteralType, | ||
isTs, | ||
isTypeOf, | ||
resolveIdentifier, | ||
resolveLiteral, | ||
resolveString, | ||
resolveTemplateLiteral, | ||
unwrapTSNode, | ||
walkAST, | ||
walkImportDeclaration | ||
}; |
@@ -1,59 +0,3 @@ | ||
"use strict"; | ||
var __create = Object.create; | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __getProtoOf = Object.getPrototypeOf; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __export = (target, all) => { | ||
for (var name in all) | ||
__defProp(target, name, { get: all[name], enumerable: true }); | ||
}; | ||
var __copyProps = (to, from, except, desc) => { | ||
if (from && typeof from === "object" || typeof from === "function") { | ||
for (let key of __getOwnPropNames(from)) | ||
if (!__hasOwnProp.call(to, key) && key !== except) | ||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | ||
} | ||
return to; | ||
}; | ||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( | ||
// If the importer is in node compatibility mode or this is not an ESM | ||
// file that has been converted to a CommonJS file using a Babel- | ||
// compatible transform (i.e. "__esModule" has not been set), then set | ||
// "default" to the CommonJS "module.exports" for node compatibility. | ||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, | ||
mod | ||
)); | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
// src/index.ts | ||
var src_exports = {}; | ||
__export(src_exports, { | ||
REGEX_DTS: () => REGEX_DTS, | ||
REGEX_LANG_JSX: () => REGEX_LANG_JSX, | ||
REGEX_LANG_TS: () => REGEX_LANG_TS, | ||
TS_NODE_TYPES: () => TS_NODE_TYPES, | ||
attachScopes: () => attachScopes, | ||
babelParse: () => babelParse, | ||
escapeKey: () => escapeKey, | ||
getLang: () => getLang, | ||
isCallOf: () => isCallOf, | ||
isDts: () => isDts, | ||
isFunctionType: () => isFunctionType, | ||
isLiteralType: () => isLiteralType, | ||
isTs: () => isTs, | ||
isTypeOf: () => isTypeOf, | ||
resolveIdentifier: () => resolveIdentifier, | ||
resolveLiteral: () => resolveLiteral, | ||
resolveString: () => resolveString, | ||
resolveTemplateLiteral: () => resolveTemplateLiteral, | ||
unwrapTSNode: () => unwrapTSNode, | ||
walkAST: () => walkAST, | ||
walkImportDeclaration: () => walkImportDeclaration | ||
}); | ||
module.exports = __toCommonJS(src_exports); | ||
// src/lang.ts | ||
var import_pathe = __toESM(require("pathe")); | ||
import pathe from "pathe"; | ||
var REGEX_DTS = /\.d\.[cm]?ts$/; | ||
@@ -65,3 +9,3 @@ var REGEX_LANG_TS = /^[cm]?tsx?$/; | ||
return "dts"; | ||
return import_pathe.default.extname(filename).replace(/^\./, ""); | ||
return pathe.extname(filename).replace(/^\./, ""); | ||
} | ||
@@ -76,3 +20,3 @@ function isDts(filename) { | ||
// src/parse.ts | ||
var import_parser = require("@babel/parser"); | ||
import { parse } from "@babel/parser"; | ||
function babelParse(code, lang, options = {}) { | ||
@@ -89,3 +33,3 @@ const plugins = [...options.plugins || []]; | ||
} | ||
const { program } = (0, import_parser.parse)(code, { | ||
const { program } = parse(code, { | ||
sourceType: "module", | ||
@@ -99,3 +43,3 @@ plugins, | ||
// src/utils.ts | ||
var import_parser2 = require("@babel/parser"); | ||
import { parseExpression } from "@babel/parser"; | ||
function isTypeOf(node, types) { | ||
@@ -144,3 +88,3 @@ return types.some((type) => { | ||
try { | ||
const node = (0, import_parser2.parseExpression)(`({${rawKey}: 1})`); | ||
const node = parseExpression(`({${rawKey}: 1})`); | ||
if (node.properties[0].key.type === "Identifier") | ||
@@ -220,4 +164,6 @@ return rawKey; | ||
// src/scope.ts | ||
var import_pluginutils = require("@rollup/pluginutils"); | ||
var attachScopes = import_pluginutils.attachScopes; | ||
import { | ||
attachScopes as _attachScopes | ||
} from "@rollup/pluginutils"; | ||
var attachScopes = _attachScopes; | ||
@@ -398,1 +344,24 @@ // node_modules/.pnpm/estree-walker@3.0.3/node_modules/estree-walker/src/walker.js | ||
} | ||
export { | ||
REGEX_DTS, | ||
REGEX_LANG_JSX, | ||
REGEX_LANG_TS, | ||
TS_NODE_TYPES, | ||
attachScopes, | ||
babelParse, | ||
escapeKey, | ||
getLang, | ||
isCallOf, | ||
isDts, | ||
isFunctionType, | ||
isLiteralType, | ||
isTs, | ||
isTypeOf, | ||
resolveIdentifier, | ||
resolveLiteral, | ||
resolveString, | ||
resolveTemplateLiteral, | ||
unwrapTSNode, | ||
walkAST, | ||
walkImportDeclaration | ||
}; |
{ | ||
"name": "ast-kit", | ||
"version": "0.5.0", | ||
"version": "0.5.1", | ||
"packageManager": "pnpm@8.6.0", | ||
"description": "AST Toolkit.", | ||
"type": "module", | ||
"license": "MIT", | ||
@@ -19,3 +20,3 @@ "homepage": "https://github.com/sxzz/ast-kit#readme", | ||
"main": "./dist/index.js", | ||
"module": "./dist/index.mjs", | ||
"module": "./dist/index.js", | ||
"types": "./dist/index.d.ts", | ||
@@ -25,4 +26,4 @@ "exports": { | ||
"types": "./dist/index.d.ts", | ||
"require": "./dist/index.js", | ||
"import": "./dist/index.mjs" | ||
"import": "./dist/index.js", | ||
"require": "./dist/index.cjs" | ||
}, | ||
@@ -41,4 +42,3 @@ "./*": "./*" | ||
"@babel/types": "^7.22.4", | ||
"@sxzz/eslint-config-prettier": "^2.4.6", | ||
"@sxzz/eslint-config-ts": "^2.4.6", | ||
"@sxzz/eslint-config": "^3.0.0-beta.12", | ||
"@types/node": "^18.16.16", | ||
@@ -61,5 +61,5 @@ "@vitest/coverage-c8": "^0.31.4", | ||
"scripts": { | ||
"lint": "eslint . --ext .vue,.js,.ts,.jsx,.tsx,.json,.md", | ||
"lint": "eslint .", | ||
"lint:fix": "pnpm run lint --fix", | ||
"build": "tsup && tsx scripts/postbuild.mts", | ||
"build": "tsup", | ||
"test": "vitest", | ||
@@ -66,0 +66,0 @@ "release": "bumpp && pnpm publish" |
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
14
Yes
38133
1136