angular-package
TwitterGitHub
Wrapper
Wrapper
  • Introduction
  • ❤ Benefits
    • Explanation
    • Designing
  • General concepts
  • Getting started
    • Skeleton
    • Installation
      • npm
    • Public API
    • Basic concepts
  • Wrap {}
    • Overview
    • Generic type variables
    • ★ Constructor
    • Accessors
      • closing
      • opening
      • text
      • [Symbol.toStringTag]
    • Properties
      • #closing
      • #opening
      • #text
    • Methods
      • Static
        • hasClosing()
        • hasOpening()
        • isWrap()
      • Instance
        • getClosing()
        • getOpening()
        • getText()
        • hasClosing()
        • hasOpening()
        • hasText()
        • isWrapped()
        • ★ replaceClosing()
        • ★ replaceOpening()
        • ★ replaceText()
        • toString()
        • valueOf()
    • Example usage
  • Wrapper {}
    • Overview
    • Generic type variables
    • Constructor
    • Accessors
      • [Symbol.toStringTag]
    • Methods
      • Static
        • define()
        • isWrapper()
        • replaceClosing()
        • replaceOpening()
        • unwrap()
      • Instance
        • isClosingIn()
        • isOpeningIn()
        • replaceClosingIn()
        • replaceOpeningIn()
        • removeWrapIn()
        • textReplaceClosing()
        • textReplaceOpening()
        • ⚠ textHasClosing()
        • ⚠ textHasOpening()
        • textUnwrap()
        • textWrap()
        • toArray()
        • toWrap()
        • unwrap()
        • unwrapText()
        • ★ wrap()
        • ★ wrapOn()
        • ★ wrapText()
    • Example usage
  • Type
    • Wrapped
  • Change log
    • Keep a changelog
    • CHANGELOG.md
    • v1.0.0
  • GIT
    • Commit
    • Semantic Versioning
  • License
    • MIT
  • Contact
    • ⋯ Chat
    • @ Email
  • Donate
    • ฿ Cryptocurrency
    • $ Fiat
  • More versions
Powered by GitBook
On this page
  • Wrapper()
  • Parameters
  • Returns
  • Example usage

Was this helpful?

  1. Wrapper {}

Constructor

PreviousGeneric type variablesNextAccessors

Last updated 3 years ago

Was this helpful?

Wrapper()

Creates a new instance with the and chars and optional .

wrapper.class.ts
constructor(opening: Opening, closing: Closing, text: Text = '' as Text) {
  super(opening, closing, text);
}

Parameters

opening:

The opening chars of a generic type variable placed before the given .

closing:

The closing chars of a generic type variable placed after the given .

text:

Optional text of a generic type variable to wrap by given and chars.

Returns

The return value is a new instance of .

Example usage

// Example usage.
import { Wrapper } from '@angular-package/wrapper';

// Returns Wrapper {'{{}}'} of type Wrapper<"{{", "", "}}">
new Wrapper(`{{`, `}}`);

// Returns Wrapper {'{{variable}}'} of type Wrapper<"{{", "variable", "}}">
new Wrapper(`{{`, `}}`, 'variable');

// Returns Wrapper {'nullnull'} of typr Wrapper<any, "", any>
new Wrapper(null as any, null as any);
Wrapper
Wrapper
opening
closing
text
text
text
opening
closing
Opening
Opening
Closing
Closing
Text
Text