Code Monkey home page Code Monkey logo

jerry's People

Contributors

dependabot[bot] avatar karthuslorin avatar yiidot avatar zhongdeming428 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

jerry's Issues

BugsList

  • 应当新增一个抛出函数参数不合法错误的 util 函数,减少重复代码。
  • keys 方法需要兼容 IE <= 9

New Features

✏️代表文档未更新

  • String

    • repeat 将指定字符串重复指定次数
    • insertStr 按指定间隔插入指定标记到字符串
    • trimLeft 去除字符串左侧空白
    • trimRight 去除字符串右侧空白
    • trim 去除字符串两侧空白
    • toPsw 将字符串转化为密码(psw123 -> ******)
    • getUrlParam 获取 URL 参数
    • setUrlParam 设置 URL 参数
    • curStr 切割字符串
    • truncate 截断字符串
    • mask 按指定格式遮盖字符串
    • camelize 转为驼峰命名法
    • underscored 转为下划线风格命名法
    • dasherize 转为连字符风格,CSS风格
    • capitalize 转为首字母大写风格
    • capitalizeEveryWord 所有单词转为首字母大写
    • randomColor 获取随机颜色字符串
    • reverseStr 获取随机颜色字符串
    • escapeHTML HTML字符串编码
    • unescapeHTML HTML字符串解码
    • fromCamelCase 将驼峰字符串转化为用指定间隔符隔开的字符串
    • isAnagram 判断两字符串是否是同字母异序字符串
  • Number

    • add 不损失精度的加法
    • sub 不损失精度的减法
    • mul 不损失精度的乘法
    • div 不损失精度的除法
    • factorial 阶乘
    • randomInt 随机整数
    • toCurrency 千分位化,添加指定金币符
    • toChineseAmount 大写中文金额
    • toPhoneNumber 电话号码格式化
    • toDate 日期格式化
  • Date

    • dateAdd 加法
    • dateSub 减法
    • getDatePeriod 计算两个日期之间的间隔天数
    • getFirstDateInMonth 计算给定日期所在月的第一天的日期
    • getLastDateInMonth 计算给定日期所在月的最后一天的日期
    • getFirstDateInQuarter 计算给定日期所在季度的第一天的日期
    • getLastDateInQuarter 计算给定日期所在季度的最后一天的日期
    • isLeapYear 判断是否是闰年
    • getDaysInMonth 判断给定日期所在月份的天数
  • Array

    • max 求最大值
    • min 求最小值
    • sum 求和
    • avg 求均值
    • variance 求方差
    • intersection 求交集
    • union 求并集
    • difference 求差集
    • flatten 展开数组
    • removeDup 去重
    • groupBy 按指定条件进行分组
    • shuffle 数组洗牌,做类似随机播放的功能很有用
    • compact 过滤数组中的 falsy 值,但不影响原数组
    • pluck 返回数组中每个对象的指定属性的值所组成的数组
    • pick 随机取一个元素返回
  • Function

    • throttle 函数节流
    • debounce 函数去抖
    • curry 函数柯里化
  • Event

    • addEvent 兼容模式的事件监听
    • removeEvent 兼容模式的事件移除
    • CustomEvents 自定义事件中心
    • ready domready 函数,在dom加载完后执行回调
  • Utils

    • isFunction 判断是否是函数
    • isNumber 判断是否是数字
    • isPlainObject 判断是否是纯对象,不可以是自定义类的实例
    • isObject 判断是否是对象,可以是自定义类的实例
    • isString 判断是否是字符串
    • isArray 判断是否是数字
    • isArrayLike 判断是否是类数组对象,此次数组不是类数组对象
    • isNaN 判断是否是 NaN
    • isSymbol 判断是否是 Symbol
    • isRegExp 判断正则
    • isDate 判断日期
    • isUndefined 判断是否是undefined
    • isNull 判断是否是 null
    • isInt 判断是否是 int
    • isFalsy 判断是否是 null/undefined/''/0/false/NaN
    • isElement 判断是否是 DOM 节点
    • getType 返回变量类型字符串
    • mixin 混淆,浅拷贝
    • each 遍历数组或对象
    • map 遍历数组或对象,返回数组
    • reduce 遍历数组或对象,返回一个累计值
    • filter 过滤数组或对象,返回一个新数组
    • contains 判断字符串、类数组对象或数组是否包含指定项
    • keys 返回对象的键,组成新数组(暂不支持 IE <= 9)
    • has 返回某个对象自身是否包含某属性
    • equals 返回两个遍历是否相等
    • deepClone 深拷贝
    • ajax 封装 ajax
    • conflict 防命名冲突:pencil2:
    • getBrowser 返回浏览器名称
    • getCookie 返回 cookie 值
    • delCookie 删除 cookie 值
    • setCookie 设置 cookie 值

TodoList

  • 添加 code conduct
  • 添加单元测试
  • 添加代码风格检查
  • 添加持续集成
  • 写 README
  • 写 ts 声明文件
  • 按需加载

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.