
Security News
/Research
Fake Corepack Site Distributes Infostealer and Proxyware to Developers
A fake corepack.org site is impersonating the Node.js tool and delivers an infostealer and proxyware to developers who download it.
@ismartify/reactive
Advanced tools
[](https://badge.fury.io/js/%40ismartify%2Freactive) [](https://opensource.org/licenses/ISC)
一个基于 Vue 3 Reactivity 和 Lodash 的响应式对象操作工具库,为响应式数据提供简洁易用的链式操作接口。
# 使用 npm
npm install @ismartify/reactive
# 使用 pnpm
pnpm add @ismartify/reactive
# 使用 yarn
yarn add @ismartify/reactive
import { reactive } from '@vue/reactivity';
import { ISmartifyReactive } from '@ismartify/reactive';
// 创建响应式对象
const reactiveObj = reactive({
user: {
name: 'John Doe',
age: 30,
settings: {
theme: 'dark',
notifications: true
}
},
posts: []
});
// 创建 ISmartifyReactive 实例
const store = new ISmartifyReactive(reactiveObj);
// 链式操作
store
.set('user.age', 31)
.set('posts', [{ id: 1, title: 'Hello World' }])
.tap(); // 输出当前状态
// 获取嵌套属性
const userName = store.get('user.name'); // 'John Doe'
const theme = store.get('user.settings.theme'); // 'dark'
// 挑选属性
const userInfo = store.pick(['user.name', 'user.age']);
// { 'user.name': 'John Doe', 'user.age': 31 }
// 获取原始响应式对象
const raw = store.raw();
new ISmartifyReactive(reactiveObject?: Record<string, any>)
reactiveObject: 可选的 Vue 响应式对象。如果不传入,将创建一个空的响应式对象。注意:传入的对象必须是使用 reactive() 创建的响应式对象,否则会抛出错误。
get<T>(key: string, defaultValue?: T): T | undefined获取指定路径的值,支持嵌套路径。
const value = store.get('user.settings.theme');
const valueWithDefault = store.get('user.email', 'default@email.com');
set<T>(key: string, value: T): this设置指定路径的值,返回实例本身支持链式调用。
store.set('user.name', 'Jane Doe').set('user.age', 25);
pick(pattern: string | string[]): Record<string, any>从对象中挑选指定的属性。
// 单个属性
const name = store.pick('user.name'); // { 'user.name': 'Jane Doe' }
// 多个属性
const userInfo = store.pick(['user.name', 'user.age']);
tap(fn?: (store: Record<string, any>) => void): this调试方法,用于查看当前存储状态,默认输出到控制台。
// 默认输出
store.tap();
// 自定义处理
store.tap((data) => {
console.log('Current state:', data);
// 进行其他操作...
});
raw(): Record<string, any>返回原始的响应式对象。
const original = store.raw();
// 直接操作原始对象,但会失去响应式特性
get(object: any, path: string, defaultValue?: any): anyLodash 的 get 函数,用于安全地获取嵌套对象属性。
set(object: any, path: string, value: any): anyLodash 的 set 函数,用于设置嵌套对象属性。
pick(object: any, paths: string | string[]): Record<string, any>Lodash 的 pick 函数,用于从对象中挑选指定的属性。
isReactive(value: unknown): boolean检查一个值是否为 Vue 响应式对象。
import { reactive } from '@vue/reactivity';
import { isReactive } from '@ismartify/reactive';
const obj = { name: 'test' };
const reactiveObj = reactive(obj);
console.log(isReactive(obj)); // false
console.log(isReactive(reactiveObj)); // true
# 安装依赖
pnpm install
# 运行测试
pnpm test
# 构建项目
pnpm build
# 发布到 npm
pnpm run npm:publish
ISC License
欢迎提交 Issue 和 Pull Request!
FAQs
[](https://badge.fury.io/js/%40ismartify%2Freactive) [](https://opensource.org/licenses/ISC)
The npm package @ismartify/reactive receives a total of 0 weekly downloads. As such, @ismartify/reactive popularity was classified as not popular.
We found that @ismartify/reactive demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
/Research
A fake corepack.org site is impersonating the Node.js tool and delivers an infostealer and proxyware to developers who download it.

Research
/Security News
A large-scale campaign abused GitHub Actions in compromised repositories to exploit CVE-2026-41940 in cPanel and WHM and steal server credentials.

Security News
Five frontier LLMs generated the same nonexistent package names, leaving 53 available for potential slopsquatting across PyPI and npm.