remove-trailing-separator

WebJar for remove-trailing-separator

License

License

ISC
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

remove-trailing-separator
Last Version

Last Version

1.1.0
Release Date

Release Date

Type

Type

jar
Description

Description

remove-trailing-separator
WebJar for remove-trailing-separator
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/darsain/remove-trailing-separator

Download remove-trailing-separator

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/remove-trailing-separator/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>remove-trailing-separator</artifactId>
    <version>1.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/remove-trailing-separator/
implementation 'org.webjars.npm:remove-trailing-separator:1.1.0'
// https://jarcasting.com/artifacts/org.webjars.npm/remove-trailing-separator/
implementation ("org.webjars.npm:remove-trailing-separator:1.1.0")
'org.webjars.npm:remove-trailing-separator:jar:1.1.0'
<dependency org="org.webjars.npm" name="remove-trailing-separator" rev="1.1.0">
  <artifact name="remove-trailing-separator" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='remove-trailing-separator', version='1.1.0')
)
libraryDependencies += "org.webjars.npm" % "remove-trailing-separator" % "1.1.0"
[org.webjars.npm/remove-trailing-separator "1.1.0"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

remove-trailing-separator

NPM version Build Status: Linux Build Status: Windows Coverage Status

Removes all separators from the end of a string.

Install

npm install remove-trailing-separator

Examples

const removeTrailingSeparator = require('remove-trailing-separator');

removeTrailingSeparator('/foo/bar/')   // '/foo/bar'
removeTrailingSeparator('/foo/bar///') // '/foo/bar'

// leaves only/last separator
removeTrailingSeparator('/')    // '/'
removeTrailingSeparator('///')  // '/'

// returns empty string
removeTrailingSeparator('') // ''

Notable backslash, or win32 separator behavior

\ is considered a separator only on WIN32 systems. All POSIX compliant systems see backslash as a valid file name character, so it would break POSIX compliance to remove it there.

In practice, this means that this code will return different things depending on what system it runs on:

removeTrailingSeparator('\\foo\\')
// UNIX  => '\\foo\\'
// WIN32 => '\\foo'

Versions

Version
1.1.0