並び順

ブックマーク数

期間指定

  • から
  • まで

1 - 40 件 / 183件

新着順 人気順

javascript constructor function exampleの検索結果1 - 40 件 / 183件

  • Google TypeScript Style Guide

    // Good: choose between two options as appropriate (see below). import * as ng from '@angular/core'; import {Foo} from './foo'; // Only when needed: default imports. import Button from 'Button'; // Sometimes needed to import libraries for their side effects: import 'jasmine'; import '@polymer/paper-button'; Import paths TypeScript code must use paths to import other TypeScript code. Paths may be r

    • Node.jsのMySQLパッケージにおけるエスケープ処理だけでは防げない「隠れた」SQLインジェクション - GMO Flatt Security Blog

      ※本記事は筆者styprが英語で執筆した記事を株式会社Flatt Security社内で日本語に翻訳したものになります。 TL;DR Node.jsのエコシステムで最も人気のあるMySQLパッケージの一つである mysqljs/mysql (https://github.com/mysqljs/mysql)において、クエリのエスケープ関数の予期せぬ動作がSQLインジェクションを引き起こす可能性があることが判明しました。 通常、クエリのエスケープ関数やプレースホルダはSQLインジェクションを防ぐことが知られています。しかし、mysqljs/mysql は、値の種類によってエスケープ方法が異なることが知られており、攻撃者が異なる値の種類でパラメータを渡すと、最終的に予期せぬ動作を引き起こす可能性があります。予期せぬ動作とは、バグのような動作やSQLインジェクションなどです。 ほぼすべてのオンラ

        Node.jsのMySQLパッケージにおけるエスケープ処理だけでは防げない「隠れた」SQLインジェクション - GMO Flatt Security Blog
      • 実装例から見る React のテストの書き方 - Cybozu Inside Out | サイボウズエンジニアのブログ

        2024/04/17: 更新 内容を更新した記事を書きましたので、よかったらこちらも併せて、ご覧ください。 zenn.dev こんにちは!フロントエンドエキスパートチームの@nus3_です。 kintone のフロントエンド刷新プロジェクト(フロリア)では、品質を保ったまま開発を加速させるためにフロントエンドのテストを積極的に行っています。 今回はそんなフロントエンドのテストの実装例をいくつか紹介します。この記事がフロントエンドのテストを行う上での参考になれば幸いです。 テストに使用する主なパッケージ コンポーネントのテスト 補足: Testing Library の記法をチェックしてくれるeslint-plugin-testing-library カスタムフックのテスト 補足: React v18 では @testing-library/react の renderHook を使う 参考

          実装例から見る React のテストの書き方 - Cybozu Inside Out | サイボウズエンジニアのブログ
        • JavaScriptのES2023・ES2022の新機能まとめ - ICS MEDIA

          JavaScriptの仕様であるECMAScriptはEcma Internationalによって定められています。ECMAScript 2015(ES6)の登場以降は、ECMAScript 2016、ECMAScript 2017・・・と、年次で仕様が更新されています。ECMAScript 2022(ES2022)は2022年6月22日のEcma InternationalのGA 123rd meetingにて、ECMAScript 2023(ES2023)は2023年6月27日のGA 125th meetingで承認されました。 ES2022とES2023はすでに多くのブラウザやNode.js環境で利用可能です。本記事では新仕様と使いどころを紹介します。 ES2023 - 配列の非破壊操作 ES2023では配列を非破壊で操作できるメソッドが追加されています。非破壊とは、元の配列を変更せ

            JavaScriptのES2023・ES2022の新機能まとめ - ICS MEDIA
          • AWS CDKを始めるハンズオン ─ IaCの第一歩をAWS LambdaとDynamoDBのシンプルな仕組みで学ぶ|ハイクラス転職・求人情報サイト アンビ(AMBI)

            AWS CDKを始めるハンズオン ─ IaCの第一歩をAWS LambdaとDynamoDBのシンプルな仕組みで学ぶ アマゾン ウェブ サービスが提供するIaC(Infrastructure as Code)の開発キットがAWS CDK(AWS Cloud Development Kit)です。本記事はAWS CDK入門者向けのチュートリアルとして、AWSでソリューションアーキテクトを務める吉川幸弘(@WinterYukky)さんによる、AWS Lambda関数でDynamoDBテーブルをスキャンするシンプルなハンズオンです。 みなさん、こんにちは。アマゾン ウェブ サービス ジャパン合同会社でソリューションアーキテクトを務めている吉川幸弘と申します。私は普段、西日本のお客様を中心に技術的なご支援や課題解決などをしています。 さっそくですが、みなさんはInfrastructure as C

              AWS CDKを始めるハンズオン ─ IaCの第一歩をAWS LambdaとDynamoDBのシンプルな仕組みで学ぶ|ハイクラス転職・求人情報サイト アンビ(AMBI)
            • Announcing TypeScript 5.0 - TypeScript

              Today we’re excited to announce the release of TypeScript 5.0! This release brings many new features, while aiming to make TypeScript smaller, simpler, and faster. We’ve implemented the new decorators standard, added functionality to better support ESM projects in Node and bundlers, provided new ways for library authors to control generic inference, expanded our JSDoc functionality, simplified con

                Announcing TypeScript 5.0 - TypeScript
              • JavaScriptデザインパターン入門 - Qiita

                1. はじめに JavaScriptデザインパターンは、JavaScriptを使ってプログラムを書くときによく出くわす問題を解決するためのガイドです。これらのパターンの背後にある考え方を理解することで、自分の問題に適用することができます。また、これらのパターンが自分のコードに役立つ場合を見つけることもできます。 2. モジュールパターン モジュールパターンは、JavaScriptのモジュールシステムの一部で、データを保護する方法を提供します。これは、モジュール内のプライベートなデータと動作を保護し、一方で公開APIを提供する方法です。これにより、プライベートとパブリックのアクセスレベルを持つ自己完結型のモジュールオブジェクトを作成することができます。 これは、JavaやC++のような言語でクラスにアクセス修飾子を使用するのに似ています。 JavaScriptでは、クロージャを使用してモジュ

                  JavaScriptデザインパターン入門 - Qiita
                • Introducing Deopt Explorer - TypeScript

                  Over the past few months, during the lead-up to the TypeScript 5.0 beta, our team spent a good portion of our time looking for ways to improve the performance of our compiler so that your projects build faster. One of the ways we improved was by looking into an oft overlooked aspect of many JavaScript VMs: inline caching. A Brief Primer on Inline Caching Inline caching is an optimization often use

                    Introducing Deopt Explorer - TypeScript
                  • Reactでオーディオプラグインを作れる時代になったという話

                    はじめに この記事では、VST(オーディオプラグインの形式の一つ)開発に突如現れた、 React-JUCEという黒船について紹介します VSTとは DAW(Digital Audio Workstation)と呼ばれる音楽制作ソフトウェアでは、VSTと呼ばれるプラグインの仕組みが標準的に用いられています。 VST形式で開発すると、CubaseやロジックといったDAW上でMIDIやオーディオを処理するプラグインを動作させることができます。 VSTの開発においては、JUCE と呼ばれるフレームワークを用いてC++で開発されることが多いようです。 今までのVST開発のツライところ 音楽家でありエンジニアである筆者は、 ずっと興味がありつつも、VST開発からこれまで一定の距離をおいてきました。 その理由としては、 C++こわい 信号処理こわい UIを命令的に記述したくない(※後述します) という理

                      Reactでオーディオプラグインを作れる時代になったという話
                    • Modern Node.js Patterns for 2025

                      Node.js has undergone a remarkable transformation since its early days. If you’ve been writing Node.js for several years, you’ve likely witnessed this evolution firsthand—from the callback-heavy, CommonJS-dominated landscape to today’s clean, standards-based development experience. The changes aren’t just cosmetic; they represent a fundamental shift in how we approach server-side JavaScript develo

                      • WebKit Features in Safari 16.4

                        Mar 27, 2023 by Patrick Angle, Marcos Caceres, Razvan Caliman, Jon Davis, Brady Eidson, Timothy Hatcher, Ryosuke Niwa, and Jen Simmons ContentsWeb Push on iOS and iPadOSImprovements for Web AppsWeb ComponentsCSSHTMLJavaScript and WebAssemblyWeb APIImages, Video, and AudioWKWebViewDeveloper ToolingWeb InspectorSafari Web ExtensionsSafari Content BlockersNew Restrictions in Lockdown ModeMore Improve

                          WebKit Features in Safari 16.4
                        • How to refactor code with GitHub Copilot

                          We’ve all been there—staring at a function that looks like it was written by an over-caffeinated goblin at 3 AM (maybe even your alter ego). You could pretend it doesn’t exist, or you could refactor it. Luckily, GitHub Copilot makes the second option less painful. Let’s get to it. What is code refactoring? Feel free to breeze past this section if you already know what’s involved with refactoring c

                            How to refactor code with GitHub Copilot
                          • JavaScript Best Practices | The WebStorm Blog

                            IDEs CLion DataGrip DataSpell Fleet GoLand IntelliJ IDEA PhpStorm PyCharm RustRover Rider RubyMine WebStorm Plugins & Services Big Data Tools Code With Me JetBrains Platform Scala Toolbox App Writerside JetBrains AI Grazie Junie JetBrains for Data Kineto Team Tools Datalore Space TeamCity Upsource YouTrack Hub Qodana CodeCanvas .NET & Visual Studio .NET Tools ReSharper C++ Languages & Frameworks K

                              JavaScript Best Practices | The WebStorm Blog
                            • Using WebAssembly threads from C, C++ and Rust

                              Learn how to bring multithreaded applications written in other languages to WebAssembly. WebAssembly threads support is one of the most important performance additions to WebAssembly. It allows you to either run parts of your code in parallel on separate cores, or the same code over independent parts of the input data, scaling it to as many cores as the user has and significantly reducing the over

                                Using WebAssembly threads from C, C++ and Rust
                              • Announcing TypeScript 4.5 - TypeScript

                                Today we’re excited to announce the release of TypeScript 4.5! If you’re not yet familiar with TypeScript, it’s a language that builds on JavaScript by adding statically checked types. When you use static types, you can run the TypeScript compiler to check for bugs like typos and mismatches in the shapes of your data, and get handy suggestions. These types don’t change your program, and you can re

                                  Announcing TypeScript 4.5 - TypeScript
                                • An introduction to WebAssembly for JavaScript Developers

                                  If you transmit a number whereas an integer encoded on 64 bits is expected you will get an exception: let run = async () => { try { let bytecode = await fetch("add/add.wasm"); let wasm = await WebAssembly.instantiateStreaming(bytecode); console.log(wasm.instance.exports.addInt64(1,2)); } catch(e) { console.error(e); } }; > run().then(); TypeError: wasm function signature contains illegal type Call

                                  • Reconstructing TypeScript, part 0: intro and background

                                    Jake Donham > Technical Difficulties > Reconstructing TypeScript, part 0 Reconstructing TypeScript, part 0: intro and background2021-09-07I've been building a "document development environment" called Programmable Matter that supports live code embedded in documents, with a simple TypeScript-like programming language. It's been fun figuring out how to implement it—the type system in TypeScript is

                                    • `undefined` vs. `null` revisited

                                      Many programming languages have one “non-value” called null. It indicates that a variable does not currently point to an object – for example, when it hasn’t been initialized yet. In contrast, JavaScript has two such non-values: undefined and null. In this blog post, we examine how they differ and how to best use or avoid them. undefined vs. null  # Both values are very similar and often used inte

                                      • DevTools architecture refresh: migrating DevTools to TypeScript  |  Blog  |  Chrome for Developers

                                        This post is part of a series of blog posts describing the changes we are making to DevTools' architecture and how it is built. Following up on our migration to JavaScript modules and migration to Web Components, today we are continuing our blog post series on the changes we are making to Devtools' architecture and how it is built. (If you have not seen it already, we posted a video on our work of

                                        • Faster JavaScript calls · V8

                                          Show navigation JavaScript allows calling a function with a different number of arguments than the expected number of parameters, i.e., one can pass fewer or more arguments than the declared formal parameters. The former case is called under-application and the latter is called over-application. In the under-application case, the remaining parameters get assigned the undefined value. In the over-a

                                          • Announcing TypeScript 4.7 - TypeScript

                                            Today we’re excited to announce the availability of TypeScript 4.7! If you’re not yet familiar with TypeScript, it’s a language that builds on JavaScript and adds syntax for types. Types help describe what kinds of values you’re working with and what kinds of functions you’re calling. TypeScript can use this information to help you avoid about mistakes like typos, missing arguments, or forgetting

                                              Announcing TypeScript 4.7 - TypeScript
                                            • typeorm + absurd-sql on Browser のロマン構成

                                              ロマン構成が動いたので紹介します。 コード: https://github.com/mizchi/absurd-sql-example-with-typeorm デモ: https://heuristic-perlman-94f8f4.netlify.app tldr Steam の某クリッカーゲームをやってたら放置ゲーでも作りたい気分になってきた。 複雑なデータを管理するならブラウザ内に本物の sqlite を持ってきたい sqlite は持ってこれたけど TS の中で 生 SQL 書くのがだるかった(補完支援がない)ので ORM でラップしたい Typeorm + absurd-sql の構成を試したら色々大変だったけど動いた つまりブラウザでこのコードが動く。 // ... @Entity() class User { @PrimaryGeneratedColumn() id: nu

                                                typeorm + absurd-sql on Browser のロマン構成
                                              • Announcing TypeScript 4.7 Beta - TypeScript

                                                Today we are excited to announce the beta release of TypeScript 4.7! To get started using the beta, you can use npm with the following command: npm install typescript@beta You can also get editor support by Downloading for Visual Studio 2022/2019 Following directions for Visual Studio Code and Sublime Text 3. Here’s a quick list of what’s new in TypeScript 4.7! ECMAScript Module Support in Node.js

                                                  Announcing TypeScript 4.7 Beta - TypeScript
                                                • Patterns for Reactivity with Modern Vanilla JavaScript – Frontend Masters Blog

                                                  “Reactivity” is how systems react to changes in data. There are many types of reactivity, but for this article, reactivity is when data changes, you do things. Reactivity Patterns are Core to Web Development We handle a lot with JavaScript in websites and web apps since the browser is an entirely asynchronous environment. We must respond to user inputs, communicate with servers, log, perform, etc.

                                                    Patterns for Reactivity with Modern Vanilla JavaScript – Frontend Masters Blog
                                                  • Announcing TypeScript 5.0 Beta - TypeScript

                                                    Today we’re excited to announce our beta release of TypeScript 5.0! This release brings many new features, while aiming to make TypeScript, smaller, simpler, and faster. We’ve implemented the new decorators standard, functionality to better support ESM projects in Node and bundlers, new ways for library authors to control generic inference, expanded our JSDoc functionality, simplified configuratio

                                                      Announcing TypeScript 5.0 Beta - TypeScript
                                                    • ts-blank-space

                                                      What is ts-blank-space? ts-blank-space is a fast type-stripping compiler that converts TypeScript to JavaScript. It supports a modern subset of TypeScript by erasing the types and replacing them with whitespace. That's it. It is not a type checker and does not perform any other code transformations. The underlying technique can improve build performance and simplify development. The implementation

                                                      • The story of web framework Hono, from the creator of Hono

                                                        The story of web framework Hono, from the creator of Hono2024-10-17 Hono is a fast, lightweight web framework that runs anywhere JavaScript does, built with Web Standards. Of course, it runs on Cloudflare Workers. It was three years ago, in December 2021. At that time, I wanted to create applications for Cloudflare Workers, but the code became verbose without using a framework, and couldn't find a

                                                          The story of web framework Hono, from the creator of Hono
                                                        • Announcing TypeScript 5.2 - TypeScript

                                                          Today we’re excited to announce the release of TypeScript 5.2! If you’re not familiar with TypeScript, it’s a language that builds on top of JavaScript by making it possible to declare and describe types. Writing types in our code allows us to explain intent and have other tools check our code to catch mistakes like typos, issues with null and undefined, and more. Types also power TypeScript’s edi

                                                            Announcing TypeScript 5.2 - TypeScript
                                                          • WebKit Features in Safari 17.0

                                                            Sep 18, 2023 by Jen Simmons and the Safari / WebKit Team Today’s the day for Safari 17.0. It’s now available for iOS 17 and iPadOS 17. [Update September 26th] And now, Safari 17.0 is available for macOS Ventura, and macOS Monterey, and macOS Sonoma. Safari 17.0 is also available in the vision OS Simulator, where you can test your website by downloading the latest beta of Xcode 15, which supports t

                                                              WebKit Features in Safari 17.0
                                                            • Announcing TypeScript 4.9 - TypeScript

                                                              Today we are excited to announce the availability of TypeScript 4.9! If you’re not familiar with TypeScript, it’s a language that builds on JavaScript by adding types and type-checking. Types can describe things like the shapes of our objects, how functions can be called, and whether a property can be null or undefined. TypeScript can check these types to make sure we’re not making mistakes in our

                                                                Announcing TypeScript 4.9 - TypeScript
                                                              • We've added JavaScript-native RPC to Cloudflare Workers

                                                                We've added JavaScript-native RPC to Cloudflare Workers2024-04-05 Cloudflare Workers now features a built-in RPC (Remote Procedure Call) system enabling seamless Worker-to-Worker and Worker-to-Durable Object communication, with almost no boilerplate. You just define a class: export class MyService extends WorkerEntrypoint { sum(a, b) { return a + b; } } And then you call it: let three = await env.

                                                                  We've added JavaScript-native RPC to Cloudflare Workers
                                                                • Object Structure in JavaScript Engines

                                                                  Object Structure in JavaScript EnginesFrom a developer's perspective, objects in JavaScript are quite flexible and understandable. We can add, remove, and modify object properties on our own. However, few people think about how objects are stored in memory and processed by JS engines. Can a developer's actions, directly or indirectly, impact performance and memory consumption? Let's try to delve i

                                                                    Object Structure in JavaScript Engines
                                                                  • All JavaScript and TypeScript Features of the last 3 years

                                                                    TypeScript as envisioned by Stable DiffusionThis article goes through almost all of the changes of the last 3 years (and some from earlier) in JavaScript / ECMAScript and TypeScript . Not all of the following features will be relevant to you or even practical, but they should instead serve to show what’s possible and to deepen your understanding of these languages. There are a lot of TypeScript fe

                                                                      All JavaScript and TypeScript Features of the last 3 years
                                                                    • WebKit Features in Safari 17.4

                                                                      ContentsArchitectural improvementsWeb AppsForm elementsCSSWeb APIJavaScriptMediaSVGWebGLWeb AssemblyWeb InspectorChanges to SafariSafari ExtensionsWeb AuthenticationBug Fixes and moreUpdating to Safari 17.4Feedback Just like Safari 15.4 and Safari 16.4, this March’s release of Safari 17.4 is a significant one for web developers. We’re proud to announce another 46 features and 146 bug fixes. You ca

                                                                        WebKit Features in Safari 17.4
                                                                      • Crimes with Go Generics

                                                                        Queue[T] To start things out, let's show off a problem in computer science that is normally difficult. Let's make a MPMS (multiple producer, multiple subscriber) queue. First we are going to need a struct to wrap everything around. It will look like this: type Queue[T any] struct { data chan T } This creates a type named Queue that takes a type argument T. This T can be absolutely anything, but th

                                                                        • Announcing TypeScript 5.8 - TypeScript

                                                                          Today we’re excited to announce the release of TypeScript 5.8! If you’re not familiar with TypeScript, it’s a language that builds on top of JavaScript by adding syntax for types. Writing types in our code allows us to explain intent and have other tools check our code to catch mistakes like typos, issues with null and undefined, and more. Types also power TypeScript’s editor tooling like the auto

                                                                            Announcing TypeScript 5.8 - TypeScript
                                                                          • Golang Mini Reference 2022: A Quick Guide to the Modern Go Programming Language (REVIEW COPY)

                                                                            Golang Mini Reference 2022 A Quick Guide to the Modern Go Programming Language (REVIEW COPY) Harry Yoon Version 0.9.0, 2022-08-24 REVIEW COPY This is review copy, not to be shared or distributed to others. Please forward any feedback or comments to the author. • feedback@codingbookspress.com The book is tentatively scheduled to be published on September 14th, 2022. We hope that when the release da

                                                                            • AST vs. Bytecode: Interpreters in the Age of Meta-Compilation

                                                                              233 AST vs. Bytecode: Interpreters in the Age of Meta-Compilation OCTAVE LAROSE, University of Kent, UK SOPHIE KALEBA, University of Kent, UK HUMPHREY BURCHELL, University of Kent, UK STEFAN MARR, University of Kent, UK Thanks to partial evaluation and meta-tracing, it became practical to build language implementations that reach state-of-the-art peak performance by implementing only an interprete

                                                                              • Announcing TypeScript 5.2 RC - TypeScript

                                                                                Today we’re excited to announce our Release Candidate of TypeScript 5.2! Between now and the stable release of TypeScript 5.2, we expect no further changes apart from critical bug fixes. To get started using the RC, you can get it through NuGet, or through npm with the following command: npm install -D typescript@rc Here’s a quick list of what’s new in TypeScript 5.2! using Declarations and Explic

                                                                                  Announcing TypeScript 5.2 RC - TypeScript
                                                                                • Introducing humanfs (formerly fsx): A modern filesystem API for JavaScript - Human Who Codes

                                                                                  The JavaScript APIs we have today are so much better than those we had even a decade ago. Consider the transition for XMLHttpRequest to fetch(): the developer experience is dramatically better, allowing us to write more succinct, functional code that accomplishes the same thing. The introduction of promises for asynchronous programming allowed this change, along with a series of other changes that