
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
tank-utils-browser
Advanced tools
类似于 lodash 的_.get, 链式引用出错低返回默认值; 使用回调的形式, 具有更好的可读性和代码提示
npm i tank-utils / yarn add tank-utils
函数签名:
/**
* @description 链式调用,出错保护
* @author anthhub
* @date 2019-05-25
* @export
* @template T
* @param {T} target
* @param {(target: T) => any} fn
* @param {*} [defaultValue=null]
* @returns {*}
*/
function _get<T>(target: T, fn: (target: T) => any, defaultValue?: any): any;
使用方式:
import {_get} from "../dist/index";
const obj = { a: { b: "1111" } };
_get(obj, obj => obj.a.b.c.d, null);
FAQs
tank-browser
We found that tank-utils-browser demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.