New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@xapp/patterns

Package Overview
Dependencies
Maintainers
5
Versions
136
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@xapp/patterns

Patterns for TypeScript

  • 2.0.2
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
777
increased by112.3%
Maintainers
5
Weekly downloads
 
Created
Source

@xapp/patterns

Common TypeScript design patterns and data structures.

Builder

Extend the AbstractBuilder to leverage your own builder pattern.

import { AbstractBuilder } from "@xapp/patterns";

export interface MyObject {
  foo: string;
}

export class MyBuilder extends AbstractBuilder<MyObject> {
  private foo: string = "defaultFooValue";

  public withFoo(foo: string): MyBuilder {
    return this;
  }

  public build(): MyObject {
    const { foo } = this;
    return {
      foo,
    };
  }
}
  • Example - Unit Test
  • Example - Real World
  • Builder Pattern - Wikipedia

Graph

A graph is an abstract data type with vertices and edges that make the connections between them.

Tree

A tree is a data structure with a root and nodes that then expand from the root.

FAQs

Package last updated on 06 Feb 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc