GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - typescript-package/wrapper: A lightweight TypeScript library to wrap the text with the opening and closing chars.

BranchesTags
Open more actions menu

Latest commit

 

History

9 Commits
9 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
src
src
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
ng-package.json
ng-package.json
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 
tsconfig.lib.json
tsconfig.lib.json
 
 
tsconfig.lib.prod.json
tsconfig.lib.prod.json
 
 
tsconfig.spec.json
tsconfig.spec.json
 
 

Repository files navigation

typescript-package/wrapper

A lightweight TypeScript library to wrap the text with the opening and closing chars.

npm version GitHub issues GitHub license


Table of contents

  • Installation
  • Api
  • Git
    • Commit
    • Versioning
  • License

Installation

npm install @typescript-package/wrapper

Api

import {
   // Object.
   Wrap,
   Wrapper,
   // Type
   Wrapped
} from '@typescript-package/wrapper';

Wrap

import { Wrap } from "@typescript-package/wrapper";

// Initialize.
const htmlTag = new Wrap('<', '>', 'div');

// The `Wrap` object.
console.log(htmlTag); // Output: Wrap {'<div>', #closing: '>', #opening: '<', #text: 'div'}

console.log(htmlTag.valueOf()); // Output: <div>

// Initialize.
const bbCode = new Wrap('[', ']', 'quote');

console.log(bbCode); // Output: Wrap {'[quote]', #closing: ']', #opening: '[', #text: 'quote'}

console.log(bbCode.valueOf()); // Output: [quote]

Wrapper

import { Wrapper } from "@typescript-package/wrapper";

// Initialize.
const htmlTag = new Wrapper(
  '<',
  '>',
  'div'
);

// The `Wrap` object.
console.log(htmlTag); // Output: Wrapper {'<div>', #closing: '>', #opening: '<', #text: 'div'}

console.log(htmlTag.valueOf()); // Output: <div>

// Initialize.
const bbCode = new Wrapper('[', ']', 'quote');

console.log(bbCode); // Output: Wrapper {'[quote]', #closing: ']', #opening: '[', #text: 'quote'}

// Wrap the valueOf [quote]
console.log(bbCode.wrap()); // Output: [[quote]]

// Wrap the valueOf [quote] with the specified `opening` and `closing` chars.
console.log(bbCode.wrap(`(`, `)`)); // Output: ([quote])

// Wrap the specified text with the `opening` and `closing` chars.
console.log(bbCode.wrapOn(`/italic`)); // Output: [/italic]

// Replace the `opening` and `closing` chars.
console.log(bbCode.rewrap(`(`, `)`)); // Output: (quote)

// Wraps the `text` inside.
console.log(bbCode.wrapText(`(`, `)`)); // Output: [(quote)]

// Returns the primitive value.
console.log(bbCode.valueOf()); // Output: [quote]

GIT

Commit

  • AngularJS Git Commit Message Conventions
  • Karma Git Commit Msg
  • Conventional Commits

Versioning

Semantic Versioning 2.0.0

Given a version number MAJOR.MINOR.PATCH, increment the:

  • MAJOR version when you make incompatible API changes,
  • MINOR version when you add functionality in a backwards-compatible manner, and
  • PATCH version when you make backwards-compatible bug fixes.

Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format.

FAQ How should I deal with revisions in the 0.y.z initial development phase?

The simplest thing to do is start your initial development release at 0.1.0 and then increment the minor version for each subsequent release.

How do I know when to release 1.0.0?

If your software is being used in production, it should probably already be 1.0.0. If you have a stable API on which users have come to depend, you should be 1.0.0. If you’re worrying a lot about backwards compatibility, you should probably already be 1.0.0.

License

MIT © typescript-package (license)

About

A lightweight TypeScript library to wrap the text with the opening and closing chars.

Topics

textwrapwrapper

Resources

Readme
MIT license
Activity
Custom properties

Stars

0 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Sponsor this project

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.