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

magicast

Package Overview
Dependencies
Maintainers
2
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

magicast - npm Package Compare versions

Comparing version 0.3.4 to 0.3.5

dist/shared/magicast.54e2233d.d.cts

2

dist/helpers.d.ts

@@ -1,2 +0,2 @@

import { a as Proxified, P as ProxifiedModule, e as ProxifiedFunctionCall, h as ProxifiedObject } from './shared/magicast.fe89c83b.js';
import { a as Proxified, P as ProxifiedModule, e as ProxifiedFunctionCall, h as ProxifiedObject } from './shared/magicast.54e2233d.js';
import { VariableDeclarator } from '@babel/types';

@@ -3,0 +3,0 @@

@@ -1,3 +0,3 @@

import { O as Options, P as ProxifiedModule, a as Proxified, G as GenerateOptions } from './shared/magicast.fe89c83b.js';
export { C as CodeFormatOptions, I as ImportItemInput, L as Loc, b as ParsedFileNode, d as ProxifiedArray, g as ProxifiedArrowFunctionExpression, e as ProxifiedFunctionCall, i as ProxifiedIdentifier, m as ProxifiedImportItem, l as ProxifiedImportsMap, j as ProxifiedLogicalExpression, k as ProxifiedMemberExpression, f as ProxifiedNewExpression, h as ProxifiedObject, n as ProxifiedValue, c as ProxyBase, o as ProxyType, T as Token, p as detectCodeFormat } from './shared/magicast.fe89c83b.js';
import { O as Options, P as ProxifiedModule, a as Proxified, G as GenerateOptions } from './shared/magicast.54e2233d.js';
export { C as CodeFormatOptions, I as ImportItemInput, L as Loc, b as ParsedFileNode, d as ProxifiedArray, g as ProxifiedArrowFunctionExpression, e as ProxifiedFunctionCall, i as ProxifiedIdentifier, m as ProxifiedImportItem, l as ProxifiedImportsMap, j as ProxifiedLogicalExpression, k as ProxifiedMemberExpression, f as ProxifiedNewExpression, h as ProxifiedObject, n as ProxifiedValue, c as ProxyBase, o as ProxyType, T as Token, p as detectCodeFormat } from './shared/magicast.54e2233d.js';
import { Node } from '@babel/types';

@@ -4,0 +4,0 @@ export { Node as ASTNode } from '@babel/types';

{
"name": "magicast",
"version": "0.3.4",
"version": "0.3.5",
"description": "Modify a JS/TS file and write back magically just like JSON!",

@@ -11,3 +11,2 @@ "repository": "unjs/magicast",

".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs",

@@ -17,3 +16,2 @@ "require": "./dist/index.cjs"

"./helpers": {
"types": "./helpers.d.ts",
"import": "./dist/helpers.mjs",

@@ -35,4 +33,4 @@ "require": "./dist/helpers.cjs"

"dev:ui": "vitest dev --ui",
"lint": "eslint --cache --ext .ts,.js,.mjs,.cjs . && prettier -c src test",
"lint:fix": "eslint --cache --ext .ts,.js,.mjs,.cjs . --fix && prettier -c src test -w",
"lint": "eslint --cache . && prettier -c .",
"lint:fix": "eslint --cache . --fix && prettier -c . -w",
"prepack": "pnpm run build",

@@ -46,25 +44,25 @@ "typecheck": "tsc --noEmit",

"dependencies": {
"@babel/parser": "^7.24.4",
"@babel/types": "^7.24.0",
"@babel/parser": "^7.25.4",
"@babel/types": "^7.25.4",
"source-map-js": "^1.2.0"
},
"devDependencies": {
"@types/node": "^20.12.7",
"@vitest/coverage-v8": "^1.5.0",
"@vitest/ui": "^1.5.0",
"@types/node": "^20.16.1",
"@vitest/coverage-v8": "^1.6.0",
"@vitest/ui": "^1.6.0",
"ast-types": "^0.16.1",
"changelogen": "^0.5.5",
"eslint": "^8.57.0",
"eslint-config-unjs": "^0.2.1",
"eslint": "^9.9.1",
"eslint-config-unjs": "^0.3.2",
"esno": "^4.7.0",
"giget": "^1.2.3",
"lint-staged": "^15.2.2",
"lint-staged": "^15.2.9",
"magicast": "workspace:*",
"prettier": "^3.2.5",
"recast": "^0.23.6",
"prettier": "^3.3.3",
"recast": "^0.23.9",
"simple-git-hooks": "^2.11.1",
"source-map": "npm:source-map-js@latest",
"typescript": "^5.4.5",
"typescript": "^5.5.4",
"unbuild": "^2.0.0",
"vitest": "^1.5.0"
"vitest": "^1.6.0"
},

@@ -83,3 +81,3 @@ "resolutions": {

},
"packageManager": "pnpm@8.15.6",
"packageManager": "pnpm@8.15.9",
"pnpm": {

@@ -86,0 +84,0 @@ "overrides": {

@@ -108,3 +108,3 @@ # 🧀 Magicast

const ast = mod.exports.default.$ast
const ast = mod.exports.default.$ast;
// do something with ast

@@ -121,10 +121,10 @@ ```

// Support for both bare object export and `defineConfig` wrapper
const options = mod.exports.default.$type === 'function-call'
? mod.exports.default.$args[0]
: mod.exports.default;
const options =
mod.exports.default.$type === "function-call"
? mod.exports.default.$args[0]
: mod.exports.default;
console.log(options.foo) // bar
console.log(options.foo); // bar
```
**Example:** Create a function call:

@@ -137,5 +137,8 @@

const options = mod.exports.default.list = builders.functionCall('create', [1, 2, 3])
const options = (mod.exports.default.list = builders.functionCall(
"create",
[1, 2, 3],
));
console.log(mod.generateCode()) // export default { list: create([1, 2, 3]) }
console.log(mod.generateCode()); // export default { list: create([1, 2, 3]) }
```

@@ -157,5 +160,7 @@

await writeFile(mod);
} catch (e) {
console.error('Unable to update config.js')
console.error('Please update it manually with the following instructions: ...')
} catch {
console.error("Unable to update config.js");
console.error(
"Please update it manually with the following instructions: ...",
);
// handle error

@@ -197,3 +202,2 @@ }

[npm-version-src]: https://img.shields.io/npm/v/magicast?style=flat&colorA=18181B&colorB=F0DB4F

@@ -200,0 +204,0 @@ [npm-version-href]: https://npmjs.com/package/magicast

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

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