Javascriptで二分探索木

二分探索木(Binary Search Tree)とは 二分探索木(Binary Search Tree)は、効率的なデータの挿入、検索、削除を可能にするデータ構造です。...

2023年6月23日 · 3 分 · 1168 文字 · Seiri

Javascriptでバブルソート

バブルソート(Bubble Sort)とは バブルソート(Bubble Sort)は、アルゴリズムの中でも比較的単純なソート方法の一つです。要素の...

2023年6月23日 · 2 分 · 881 文字 · Seiri
【Salesforce】LWCライフサイクルフック

【Salesforce】LWCライフサイクルフック

LWCライフサイクルフックの説明 LWC のライフサイクルフックには、インスタンス化、接続、更新、破棄の 4 つのフェーズがあります。それぞれのフェーズ...

2022年12月29日 · 4 分 · 1538 文字 · Seiri
【Salesforce】LWC入門

【Salesforce】LWC入門

LWC(Lightning Web Component) とは LWC(Lightning Web Component) は、Web Componentsを使用して...

2022年12月29日 · 6 分 · 2793 文字 · Seiri
【Salesforce】LWC環境構築

【Salesforce】LWC環境構築

LWC の環境構築方法 LWC の環境構築の詳しい方法は以下のようになります。 Salesforce の Developer Edition アカウントを取得します。 Developer Edition アカウントは、開発者向けのアカウントで、...

2022年12月29日 · 2 分 · 503 文字 · Seiri
【Salesforce】LWC CSV出力方法

【Salesforce】LWC CSV出力方法

LWC で CSV 出力方法説明 LWC で CSV ファイルを出力する考え方は主に下記の流れとなります。 1.LWC のコンポーネントにデータを持たせます。 2.CSV を作成するため、各行の...

2022年3月29日 · 2 分 · 688 文字 · Seiri
AmplifyでS3と連携する方法

AmplifyでS3と連携する方法

準備 1.amplify add storageコマンドで、S3 を追加する amplify add storage ? Please select from one of the below mentioned services (Use arrow keys) ❯ Content (Images, audio, video, etc.) NoSQL Database 2.amplify pushコマンドで作成した S3 を AWS にデプロイ...

2022年1月21日 · 2 分 · 533 文字 · Seiri
AmplifyでGraphQLを呼出す方法

AmplifyでGraphQLを呼出す方法

準備 1.amplify add apiコマンドで、GraphQL API を追加する amplify add api ? Please select from one of the below mentioned services: > GraphQL ? Here is the GraphQL API that we will create. Select a setting to edit or continue: > Continue ? Choose a schema template: > Single object with fields...

2022年1月20日 · 1 分 · 433 文字 · Seiri
AmplifyでAPI Gatewayを呼出す方法

AmplifyでAPI Gatewayを呼出す方法

準備 1.amplify add apiコマンドで、Rest API を追加する amplify add api ? Please select from one of the below mentioned services GraphQL ❯ REST 2.amplify pushコマンドで作成した Rest API を AWS にデプロイし、 AWS のAPI G...

2022年1月20日 · 1 分 · 497 文字 · Seiri
AmplifyでのAuthUtilを作成する

AmplifyでのAuthUtilを作成する

前提 1.amplify add authコマンドで認証サービスを作成する amplify add auth ? Do you want to use the default authentication and security configuration? Default configuration ? How do you want users to be able to sign in? Username ? Do you want to configure advanced settings? No, I am done. 2.amplify pus...

2022年1月20日 · 3 分 · 1082 文字 · Seiri
JavaScript日付フォーマット

JavaScript日付フォーマット

JavaScript日付フォーマット方法 JavaScript 日付フォーマット方法を紹介します。 方法 1 JavaScript での日付フォーマットは正規表現と Date 型のgetFullYe...

2021年12月24日 · 2 分 · 968 文字 · Seiri

JSでのURLパラメータ取得

実装例 /** * パラーメタの取得 * @param {string} name パラメータ名 * @param {string} url URL * @returns {string} 取得パラメータ */ export const getParam = (name, url) => { if (!url) url = window.location.href; name = name.replace(/[\[\]]/g, '\\$&'); let regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)'), results = regex.exec(url); if (!results)...

2021年12月24日 · 1 分 · 114 文字 · Seiri

JSでのファイルサイズ変換関数

javascript でファイルサイズを変換する関数を作成するには、以下のようなコードを使用できます。 /** * ファイルサイズ変換 * @param {*} sizeInBytes バイト * @returns 変換後のサイズ */ function...

2021年12月24日 · 1 分 · 361 文字 · Seiri

JSでのイベントUtil作成

実装例 export class EventEmitter { constructor() { this.registry = {}; } on(name, listener) { this.registry[name] = this.registry[name] || []; this.registry[name].push(listener); return this; } once(name, listener) { const doOnce = function () { listener.apply(null, arguments); this.removeListener(name, doOnce); }.bind(this); this.on(name, doOnce); return this; } emit(name) { const args = Array.prototype.slice.call(arguments, 1); const listeners = this.registry[name]; let count = 0; if (listeners) { listeners.forEach((listener) => { count += 1; listener.apply(null, args);...

2021年12月21日 · 1 分 · 118 文字 · Seiri

JSでのストレージUtil作成

1.説明 セッションストレージとロカールストレージ Util の作成方法を共有します。 2.ソース /** * セッション */ export const session = { /** * セッションストレージ設定 *...

2021年12月21日 · 2 分 · 575 文字 · Seiri

JSでのレスポンスクラスハンドラーの作成

1.目的 レスポンスクラスハンドラーの作成方法を共有します。 2.ソース /** * リクエストの結果をハンドリングする. * @param {Promiss} promiss * @return reponse レスポンス => {success: XXX, data:...

2021年12月21日 · 1 分 · 246 文字 · Seiri
【Salesforce】LWCモーダル画面自分で作る

【Salesforce】LWCモーダル画面自分で作る

共通モーダル画面作成方法説明 共通モーダルはモーダルを開くための API を持ち、他のコンポーネントから呼び出すことができます。 他のコンポーネントで、...

2021年11月29日 · 2 分 · 541 文字 · Seiri

ブラウザを判断する方法

目的 JavaScript でブラウザを判断する方法を共有します。 実行方法 export const isIE11 = isIE11Test(navigator); export const isChrome = isChromeTest(navigator); export const isSafari = isSafariTest(navigator); export function isIE11Test(navigator) { return /Trident.*rv[ :]*11\./.test(navigator.userAgent); } export function isChromeTest(navigator) { return ( /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor) ); } export function isSafariTest(navigator) { return /^((?!chrome|android).)*safari/i.test(navigator.userAgent); }

2021年11月22日 · 1 分 · 68 文字 · Seiri

JavaScriptで配列を比較する方法

実装例 /** * 配列の比較 * @param array1 配列1 * @param array2 配列2 * @returns 同じの場合:True、その他の場合:False */ export const arraysEqual = (array1, array2) => { if (!array1 || !array2) { return false; } if (array1.length !== array2.length) { return...

2021年11月22日 · 1 分 · 112 文字 · Seiri

JavaScriptでオブジェクトをコピーする方法

実行例 /** * オブジェクトをコピー * @param obj 対象オブジェクト * @return 新しいオブジェクト */ export const deepCopy = (obj) => { if (Object(obj) !== obj) { return obj; } if (obj instanceof Set) { return new Set(obj); } if (obj instanceof Date) { return new Date(obj);...

2021年11月22日 · 1 分 · 148 文字 · Seiri