並び順

ブックマーク数

期間指定

  • から
  • まで

1 - 15 件 / 15件

新着順 人気順

lodashの検索結果1 - 15 件 / 15件

タグ検索の該当結果が少ないため、タイトル検索結果を表示しています。

lodashに関するエントリは15件あります。 javascriptnode.jslibrary などが関連タグです。 人気エントリには 『lodash やめ方 - Qiita』などがあります。
  • lodash やめ方 - Qiita

    みなさん、 lodash で消耗してますか? 私は消耗しています。 なぜ lodash で消耗するかというと、とにかく思考停止でインストールされ、 node_modules 下で大量に重複します。サイズが大きいlodashが複数バンドルされてビルドされると、重篤なパフォーマンス上の問題を引き起こします。 lodash には実装上の問題もあり、異様に丁寧に、そして富豪的に作られており、その結果ビルドサイズが無駄に大きいです。丁寧に作られて入るのですが、現代のフロントエンド水準や一般的なポリフィルと噛み合っていません。というわけで、常々やめたいと思っています。 ちゃんとES201xを追ってる人からすると、ほとんどの lodash のメソッドは不要に見えるはずです。本エントリは、思考停止で lodash で実装しようとする人に、ちょっと考え直しては? と投げつける用の記事になります。 現代におい

      lodash やめ方 - Qiita
    • lodashの代わりにjustを使う

      なるべくlodashを使わず標準の機能で済まそうとしている[^1]が、どうしても標準だと面倒で欲しくなるケースがある。 例えば1つの配列をn個に分ける_.chunkなどはちょうどよいだろう。 You Dont Need Lodash Underscoreを参考に自前実装すると最低でもこのぐらいは必要だ。 const chunk = (input, size) => input.reduce((arr, item, idx) => idx % size === 0 ? [...arr, [item]] : [...arr.slice(0, -1), [...arr.slice(-1)[0], item]] , []);

        lodashの代わりにjustを使う
      • GitHub - samber/lo: 💥 A Lodash-style Go library based on Go 1.18+ Generics (map, filter, contains, find...)

        ✨ samber/lo is a Lodash-style Go library based on Go 1.18+ Generics. This project started as an experiment with the new generics implementation. It may look like Lodash in some aspects. I used to code with the fantastic "go-funk" package, but "go-funk" uses reflection and therefore is not typesafe. As expected, benchmarks demonstrate that generics are much faster than implementations based on the

          GitHub - samber/lo: 💥 A Lodash-style Go library based on Go 1.18+ Generics (map, filter, contains, find...)
        • lodash 互換の debounce と throttle だけを提供するライブラリを作った - hokaccha memo

          最近は ECMAScript 自身の機能も豊富になってきて lodash のユーティリティ関数の出番はだいぶ少なってきたけど、debounce と throttle だけは未だに使う機会がまあまあある。 しかし、lodash は何も考えずに使うとバンドルサイズが肥大化するのでいい感じに Tree Shaking するために lodash-es を使う必用があったり、自分が使っている機能とは全然関係ないアップデートが Dependabot から大量に降ってきたりしてしんどかったりする。 lodash は lodash.debounce のように個別のモジュールも提供されているけど、Last Published が 5 years ago になっていたりして、あまり継続的にメンテされてない様子が伺える。これに関する Issue は探すといっぱいあって、対応したいけど手が回ってないみたいな様子ら

            lodash 互換の debounce と throttle だけを提供するライブラリを作った - hokaccha memo
          • Lodash Documentation

            _.chunk(array, [size=1])source npm package Creates an array of elements split into groups the length of size. If array can't be split evenly, the final chunk will be the remaining elements. Since3.0.0 Argumentsarray (Array): The array to process.[size=1] (number): The length of each chunkReturns(Array): Returns the new array of chunks. Example

            • 【JavaScript】lodashの使い方 - Qiita

              関数 is系 真偽値を返す関数群です。数十種類存在するため大抵のものはカバーされています。 引数にとった値が期待通りならtrueを返し、そうでなければfalseを返します。 主にif文での判定に使うでしょう。 _.isString("abc"); // true _.isString(1); // false _.isNumber(1); // true _.isNumber('abc'); // false _.isArray([1,2,3]); // true _.isArray(20); // false // nullもしくはundefinedならtrueを返す _.isNil(null) // true _.isNil(undefined) // true _.isNil("abc") // false each / forEach 配列やオブジェクトを第一引数に受け取り、繰り返

                【JavaScript】lodashの使い方 - Qiita
              • CDNから引っ張ったjqueryやlodashをtypescriptで使う - Qiita

                はじめに TypeScriptは近年ますます重要視されている。またCDNを活用して自社サーバーの負荷を減らし、ページの表示速度を向上する手段としても重宝されている。 ただし、ライブラリそれぞれの特性の違い、webpackの環境の違いなどで、設定でつまずくことも多々ある。 設定の仕方 HTML まずはHTMLにタグを追加し、CDNからjQueryとLodashを引っ張ってくる。CDNは別にどこでも良いが、ここは例として、cdnjsを使う。 <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.9/lodash.min.js"></scr

                  CDNから引っ張ったjqueryやlodashをtypescriptで使う - Qiita
                • You Might Not Need Lodash

                  YOU MIGHT NOT NEED LODASH But you should use Lodash. It’s a great library, well crafted, battle tested and with a very skilled and active community contributing. The goal of this project is NOT to provide drop in replacements, but to show how to achieve similar functionalities in plain Javascript, to understand how things work behind the hood. Being a learning platform, some implementations have b

                    You Might Not Need Lodash
                  • Snyk research team discovers severe prototype pollution security vulnerabilities affecting all versions of lodash | Snyk

                    On July 2nd, 2019, Snyk published a high severity prototype pollution security vulnerability (CVE-2019-10744) affecting all versions of lodash, as the result of an on-going analysis lead by the Snyk security research team. UPDATE: lodash published version 4.17.12 on July 9th which includes Snyk fixes and remediates the vulnerability. We strongly recommend you update to the latest version of lodash

                      Snyk research team discovers severe prototype pollution security vulnerabilities affecting all versions of lodash | Snyk
                    • Lessons on tree-shaking Lodash with Webpack and Babel

                      Tree-shaking and code-splitting are two techniques to reduce the size of JavaScript bundles in web applications. Code-splitting is bundling your code in a way so that it’s grouped into many small bundles that can be loaded as they are needed. Tree-shaking is the process of removing unused code during the bundle process. The Civic Apps team has embraced the methods provided by React to implement co

                        Lessons on tree-shaking Lodash with Webpack and Babel
                      • CommonJS と ESModules が混在している環境で、lodash を lodash-es に置き換え、バンドルサイズを減らす - Mobile Factory Tech Blog

                        こんにちは、21卒エンジニアの id:d-kimuson です。 先日、プロダクトで使用している lodash を lodash-es に置き換えることで、バンドルサイズの削減をしました。 lodash を lodash-es に置き換える話はよくありますが、今回のプロダクトは運用歴が長く CommonJS と ESModules が混在している少し特殊な環境での試みだったので、知見を共有したいと思います。 利用されていないコードを消し、バンドルサイズを減らす lodash はバンドルサイズの大きなライブラリです。minified な状態で 69.9KB のサイズになります。 参考: lodash v4.17.21 ❘ Bundlephobia webpack にはデッドコードを削除する TreeShaking という機能があり、ライブラリのデッドコードを削除することができるのでバンドルサ

                          CommonJS と ESModules が混在している環境で、lodash を lodash-es に置き換え、バンドルサイズを減らす - Mobile Factory Tech Blog
                        • lodash自分用メモ Collection - Qiita

                          lodashは見ておこうと思い立ち、サイトの日本語メモを作成しました。 ↓ lodashのES6で書くとこうなるというのはこちらのサイト You Might Not Need Lodash _.countBy(collection, [iteratee=_.identity]) 配列から、[iteratee=_.identity]で渡した条件の結果をkey、条件に当てはまる値の数をvalueに返す。 公式)Creates an object composed of keys generated from the results of running each element of collection thru iteratee. The corresponding value of each key is the number of times the key was returned

                            lodash自分用メモ Collection - Qiita
                          • lodashの配列/オブジェクト系関数の索引を作ってみた - Qiita

                            lodash のArray/Object/Collection系の関数は非常に多く、どれがどれか混乱しがち。これらを探しやすくするために、索引として使えるように分類してみました。 ※1: 渡された配列/オブジェクト自体を変更しない。 ※2: 渡された配列/オブジェクト自体を変更する。 [Array] 分割・結合 [※1] chunk : 指定サイズで分割 _.chunk(array, [size=1]) concat : 配列結合 _.concat(array, [values]) [Array] 除去 [※1] compact : false 的な値除去 _.compact(array) drop : 先頭n個撤去 _.drop(array, [n=1]) dropRight : 末尾n個撤去 _.dropRight(array, [n=1]) dropWhile : 先頭から評価成立し

                              lodashの配列/オブジェクト系関数の索引を作ってみた - Qiita
                            • Lodashを使って2つのオブジェクトのDiffを抽出する - tacamy--blog

                              JavaScriptで2つのオブジェクトの差分を出したいとき、Lodashの omitBy を使うと簡単に書けた。 const before = { a: 1, b: 2, c: 3 } const after = { a: 0, b: 1, c: 3 } const diff = _.omitBy(after, (v, k) => before[k] === v) この場合、 diff の結果は👇こうなる。 console.log(diff) // { a: 0, b: 1 } 差分がない場合は空のオブジェクトが返ってくる。 ちなみに、 omitBy の第一引数に渡すオブジェクトのkeyとvalueを基にしてもうひとつのオブジェクトの値と比較してるから、👇こんな感じだとDiffは出ない。 after は a っていうkeyしか持ってないから。 const before = { a:

                                Lodashを使って2つのオブジェクトのDiffを抽出する - tacamy--blog
                              • [JavaScript] 配列の操作はLodashを使いこなせると便利 | DevelopersIO

                                こんにちは、CX事業本部 Delivery部の若槻です。 Lodashは、軽量なJavaScriptユーティリティライブラリです。 Lodash 配列やオブジェクト、文字列などに対して頻用される処理がモジュールとして用意されています。 今回は、Lodashで配列操作を行える便利そうなモジュールをいくつか見つけたので紹介します。 インストール Lodashをnpmでインストールします。 npm install lodash TypeScript環境で使う場合は型定義も合わせてインストールします。 npm -D install @types/lodash インポート Lodashをインポートします。 // Load the full build. var _ = require('lodash'); // Load the core build. var _ = require('lodash

                                  [JavaScript] 配列の操作はLodashを使いこなせると便利 | DevelopersIO
                                1

                                新着記事