Hefty

Results 107 issues of Hefty

本文为读 lodash 源码的第三百六十四篇,后续文章会更新到这个仓库中,欢迎 star:[pocket-lodash](https://github.com/yeyuqiudeng/pocket-lodash) gitbook也会同步仓库的更新,gitbook地址:[pocket-lodash](https://www.gitbook.com/book/yeyuqiudeng/pocket-lodash/details) ## 依赖 ```javascript import baseGet from './.internal/baseGet.js' ``` [《lodash源码分析之baseGet》](https://github.com/yeyuqiudeng/pocket-lodash/issues/72) ## 源码分析 `propertyOf` 和 `property` 类似,不过 `propertyOf` 接收的是 `object` 参数,它所创建的函数接收的是属性路径参数,调用时,最终得到的结果也是从 `object` 上将对应属性路径上的值取出。 源码如下: ```javascript function propertyOf(object)...

系列文章
api

本文为读 lodash 源码的第三百六十三篇,后续文章会更新到这个仓库中,欢迎 star:[pocket-lodash](https://github.com/yeyuqiudeng/pocket-lodash) gitbook也会同步仓库的更新,gitbook地址:[pocket-lodash](https://www.gitbook.com/book/yeyuqiudeng/pocket-lodash/details) ## 依赖 ```javascript import baseProperty from './.internal/baseProperty.js' import basePropertyDeep from './.internal/basePropertyDeep.js' import isKey from './.internal/isKey.js' import toKey from './.internal/toKey.js' ``` [《lodash源码分析之baseProperty》](https://github.com/yeyuqiudeng/pocket-lodash/issues/107) [《lodash源码分析之basePropertyDeep》](https://github.com/yeyuqiudeng/pocket-lodash/issues/363) [《lodash源码分析之isKey》](https://github.com/yeyuqiudeng/pocket-lodash/issues/66) [《lodash源码分析之toKey》](https://github.com/yeyuqiudeng/pocket-lodash/issues/71) ##...

系列文章
api

本文为读 lodash 源码的第三百六十二篇,后续文章会更新到这个仓库中,欢迎 star:[pocket-lodash](https://github.com/yeyuqiudeng/pocket-lodash) gitbook也会同步仓库的更新,gitbook地址:[pocket-lodash](https://www.gitbook.com/book/yeyuqiudeng/pocket-lodash/details) ## 依赖 ```javascript import baseGet from './baseGet.js' ``` [《lodash源码分析之baseGet》](https://github.com/yeyuqiudeng/pocket-lodash/issues/72) ## 源码分析 `basePropertyDeep` 会接收一个属性路径 `path` ,返回一个函数,这个函数接收一个 `object` 参数,这个函数调用时,会取出 `object` 上对应属性路径 `path` 的值。 源码如下: ```javascript function basePropertyDeep(path)...

系列文章
internal

本文为读 lodash 源码的第三百六十一篇,后续文章会更新到这个仓库中,欢迎 star:[pocket-lodash](https://github.com/yeyuqiudeng/pocket-lodash) gitbook也会同步仓库的更新,gitbook地址:[pocket-lodash](https://www.gitbook.com/book/yeyuqiudeng/pocket-lodash/details) ## 依赖 ```javascript import some from './some.js' ``` [《lodash源码分析之some》](https://github.com/yeyuqiudeng/pocket-lodash/issues/214) ## 源码分析 `overSome` 接收一组断言函数 `iteratees` ,返回一个函数,在调用这个函数时,会依次调用断言函数,并将函数的参数作为断言函数的参数传入,如果其中一个断言函数返回的是真值,则得到 `true` ,否则返回 `false` 。 源码如下: ```javascript function overSome(iteratees) { return...

系列文章
api

本文为读 lodash 源码的第三百六十篇,后续文章会更新到这个仓库中,欢迎 star:[pocket-lodash](https://github.com/yeyuqiudeng/pocket-lodash) gitbook也会同步仓库的更新,gitbook地址:[pocket-lodash](https://www.gitbook.com/book/yeyuqiudeng/pocket-lodash/details) ## 依赖 ```javascript import every from './every.js' ``` [《lodash源码分析之every》](https://github.com/yeyuqiudeng/pocket-lodash/issues/144) ## 源码分析 `overEvery` 接收一组断言函数 `iteratees` ,返回一个函数,在调用这个函数时,会依次调用断言函数,并将函数的参数作为断言函数的参数传入,如果所有的断言函数都为真值,则返回 `true` ,否则返回 `false` 。 源码如下: ```javascript function overEvery(iteratees) { return...

系列文章
api

本文为读 lodash 源码的第三百五十九篇,后续文章会更新到这个仓库中,欢迎 star:[pocket-lodash](https://github.com/yeyuqiudeng/pocket-lodash) gitbook也会同步仓库的更新,gitbook地址:[pocket-lodash](https://www.gitbook.com/book/yeyuqiudeng/pocket-lodash/details) ## 依赖 ```javascript import map from './map.js' ``` [《lodash源码分析之map》](https://github.com/yeyuqiudeng/pocket-lodash/issues/16) ## 源码分析 `over` 接收一组函数 `iteratees` ,并返回一个函数,当函数被调用时,会遍历迭代器,并将函数的参数作为迭代器的参数传入,得到一组结果返回。 源码如下: ```javascript function over(iteratees) { return function(...args) { return map(iteratees,...

系列文章
api

本文为读 lodash 源码的第三百五十八篇,后续文章会更新到这个仓库中,欢迎 star:[pocket-lodash](https://github.com/yeyuqiudeng/pocket-lodash) gitbook也会同步仓库的更新,gitbook地址:[pocket-lodash](https://www.gitbook.com/book/yeyuqiudeng/pocket-lodash/details) ## 依赖 ```javascript import nth from './nth.js' ``` [《lodash源码分析之nth》](https://github.com/yeyuqiudeng/pocket-lodash/issues/58) ## 源码分析 `nthArg` 其实是 `nth` 的偏应用,接收参数 `n` ,返回一个函数,调用这个函数时,会返回该函数的第 `n` 个参数。 源码如下: ```javascript function nthArg(n) { return...

系列文章
api

本文为读 lodash 源码的第三百五十七篇,后续文章会更新到这个仓库中,欢迎 star:[pocket-lodash](https://github.com/yeyuqiudeng/pocket-lodash) gitbook也会同步仓库的更新,gitbook地址:[pocket-lodash](https://www.gitbook.com/book/yeyuqiudeng/pocket-lodash/details) ## 依赖 ```javascript import invoke from './invoke.js' ``` [《lodash源码分析之invoke》](https://github.com/yeyuqiudeng/pocket-lodash/issues/150) ## 源码分析 `methodOf` 和 `method` 的作用类似,不过接收的是 `object` 和 `args` ,返回的函数接收的参数是 `path` 。 源码如下: ```javascript function methodOf(object,...

系列文章
api

本文为读 lodash 源码的第三百五十六篇,后续文章会更新到这个仓库中,欢迎 star:[pocket-lodash](https://github.com/yeyuqiudeng/pocket-lodash) gitbook也会同步仓库的更新,gitbook地址:[pocket-lodash](https://www.gitbook.com/book/yeyuqiudeng/pocket-lodash/details) ## 依赖 ```javascript import invoke from './invoke.js' ``` [《lodash源码分析之invoke》](https://github.com/yeyuqiudeng/pocket-lodash/issues/150) ## 源码分析 `method` 是 `invoke` 的偏函数。接收路径 `path` 和参数 `args` ,返回一个函数,这个函数接收一个 `object` 作为参数,这个函数被调用时,会调用 `object` 对应路径 `path` 上的方法,并且将...

系列文章
api

本文为读 lodash 源码的第三百五十五篇,后续文章会更新到这个仓库中,欢迎 star:[pocket-lodash](https://github.com/yeyuqiudeng/pocket-lodash) gitbook也会同步仓库的更新,gitbook地址:[pocket-lodash](https://www.gitbook.com/book/yeyuqiudeng/pocket-lodash/details) ## 依赖 ```javascript import baseClone from './.internal/baseClone.js' import baseMatchesProperty from './.internal/baseMatchesProperty.js' ``` [《lodash源码分析之baseClone》](https://github.com/yeyuqiudeng/pocket-lodash/issues/199) [《lodash源码分析之baseMatchesProperty》](https://github.com/yeyuqiudeng/pocket-lodash/issues/355) ## 源码分析 `matchesProperty` 接收属性路径 `path` 和比较值 `srcValue` ,返回一个函数,这个函数接收一个 `object` ,用来判断 `object`...

系列文章
api