Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

strip-trailing-slashes

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

strip-trailing-slashes

A function that removes all slashes from the end of a string.

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

Strip Trailing Slashes

A function that removes all slashes from the end of a string.

This function:

  • makes no assumptions about the kind of slash (forward / or backward \)
  • does not care what the current operating system or file system is
  • does not care what the operating system or file system was for the string's source
  • does not distinguish between file system path, a URL, or any other kind of string

If there is one or more slashes at the end of a string, they get removed.

That is all there is to it.

API

stripTrailingSlashes(text)

text

Type: String

The string of text you want to remove trailing slashes from. If this is not a string, it will throw a TypeError.

Keywords

clip

FAQs

Package last updated on 11 Jul 2017

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