first commit
This commit is contained in:
57
build/node_modules/trim-right-x/index.js
generated
vendored
Normal file
57
build/node_modules/trim-right-x/index.js
generated
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
/**
|
||||
* @file This method removes whitespace from the right end of a string.
|
||||
* @version 3.0.0
|
||||
* @author Xotic750 <Xotic750@gmail.com>
|
||||
* @copyright Xotic750
|
||||
* @license {@link <https://opensource.org/licenses/MIT> MIT}
|
||||
* @module trim-right-x
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
var requireCoercibleToString = require('require-coercible-to-string-x');
|
||||
var Rx = require('cached-constructors-x').RegExp;
|
||||
var reRight2016 = new Rx('[' + require('white-space-x').string2016 + ']+$');
|
||||
var reRight2018 = new Rx('[' + require('white-space-x').string2018 + ']+$');
|
||||
var replace = ''.replace;
|
||||
|
||||
var $trimRight2016 = function trimRight2016(string) {
|
||||
return replace.call(requireCoercibleToString(string), reRight2016, '');
|
||||
};
|
||||
|
||||
var $trimRight2018 = function trimRight2018(string) {
|
||||
return replace.call(requireCoercibleToString(string), reRight2018, '');
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
/**
|
||||
* A reference to trimRight2018.
|
||||
*/
|
||||
trimRight: $trimRight2018,
|
||||
|
||||
/**
|
||||
* This method removes whitespace from the right end of a string. (ES2016)
|
||||
*
|
||||
* @param {string} string - The string to trim the right end whitespace from.
|
||||
* @throws {TypeError} If string is null or undefined or not coercible.
|
||||
* @returns {string} The right trimmed string.
|
||||
* @example
|
||||
* var trimRight = require('trim-right-x');
|
||||
*
|
||||
* trimRight(' \t\na \t\n') === ' \t\na'; // true
|
||||
*/
|
||||
trimRight2016: $trimRight2016,
|
||||
|
||||
/**
|
||||
* This method removes whitespace from the right end of a string. (ES2018)
|
||||
*
|
||||
* @param {string} string - The string to trim the right end whitespace from.
|
||||
* @throws {TypeError} If string is null or undefined or not coercible.
|
||||
* @returns {string} The right trimmed string.
|
||||
* @example
|
||||
* var trimRight = require('trim-right-x');
|
||||
*
|
||||
* trimRight(' \t\na \t\n') === ' \t\na'; // true
|
||||
*/
|
||||
trimRight2018: $trimRight2018
|
||||
};
|
||||
Reference in New Issue
Block a user