npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

wii-fe-utils

v1.2.3

Published

utils for js

Readme

wii-fe-utils

前端开发公共工具库 提供即插即用的js工具

  • 当前版本 version 1.2.3

安装方式

npm install wii-fe-utils

目前有以下几种工具

查找对象中的值或者key

该工具主要用来查找某个对象中的值或者key。

  • 如果查找类型是值,则返回该值所在父节点
  • 如果查找类型是key,则返回该key的值

Find支持三个参数,Find(toFind, Obj, type)

| 名称 | 意义 | 类型 | 默认值 | | - | :- | :-: | :-: | | toFind | 需要查找的内容 | String | |
| obj | 在哪个object对象内查找 | Object | |
| toFind | 查找类型,支持两种类型值 'key' 和 'value' | String | value |

使用方式

// 引入Find方法
import {Find} from 'wii-fe-utils'

// 测试对象
let object = {
	key: 'index',
	name: {
		first_name: 'warren',
		last_name: 'yang'
	}
}

console.log('Find value -----> ', Find('yang', object, 'value')) 
// Find value -----> 返回object.name对象

console.log('Find key -----> ', Find('first_name', object, 'key'))
// Find key -----> warren

比较两个对象是否是相同的对象

该工具主要用来比较两个对象是否相同(值)

  • 默认深比较,支持浅比较配置

IsSameObj支持三个参数,IsSameObj(obj1, obj2, deep)

| 名称 | 意义 | 类型 | 默认值 | | - | :- | :-: | :-: | | obj1 | 比较的其中一个对象 | Object | |
| obj2 | 比较的其中一个对象 | Object | |
| deep | 比较方式,是否深比较,默认进行深比较 | Boolean | true |

使用方式

// 引入IsSameObj方法
import {IsSameObj} from 'wii-fe-utils'

// 测试对象
let object1 = {
	key: 'index',
	name: {
		first_name: 'warren',
		last_name: 'yang'
	}
}

let object2 = {
	key: 'index',
	name: {
		first_name: 'warren',
		last_name: 'yang'
	}
}

let object3 = {
	key: 'index',
	name: {
		first_name: 'godaangel',
		last_name: 'yang'
	}
}

console.log('IsSameObj -----> ', IsSameObj(object1, object2))
// IsSameObj -----> true

console.log('IsSameObj -----> ', IsSameObj(object1, object3))
// IsSameObj -----> false

时间处理相关工具