(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.returnExports = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o * @copyright Xotic750 * @license {@link MIT} * @module trim-right-x */ 'use strict'; var requireCoercibleToString = _dereq_('require-coercible-to-string-x'); var Rx = _dereq_('cached-constructors-x').RegExp; var reRight2016 = new Rx('[' + _dereq_('white-space-x').string2016 + ']+$'); var reRight2018 = new Rx('[' + _dereq_('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 }; },{"cached-constructors-x":2,"require-coercible-to-string-x":6,"white-space-x":10}],2:[function(_dereq_,module,exports){ /** * @file Constructors cached from literals. * @version 1.0.0 * @author Xotic750 * @copyright Xotic750 * @license {@link MIT} * @module cached-constructors-x */ 'use strict'; /** * Constructors cached from literals. * * @type Object * @example * var constructors = require('cached-constructors-x'); */ module.exports = { Array: [].constructor, Boolean: true.constructor, Number: (0).constructor, Object: {}.constructor, RegExp: (/(?:)/).constructor, String: ''.constructor }; },{}],3:[function(_dereq_,module,exports){ /** * @file Checks if `value` is `null` or `undefined`. * @version 1.4.1 * @author Xotic750 * @copyright Xotic750 * @license {@link MIT} * @module is-nil-x */ 'use strict'; var isUndefined = _dereq_('validate.io-undefined'); var isNull = _dereq_('lodash.isnull'); /** * Checks if `value` is `null` or `undefined`. * * @param {*} value - The value to check. * @returns {boolean} Returns `true` if `value` is nullish, else `false`. * @example * var isNil = require('is-nil-x'); * * isNil(null); // => true * isNil(void 0); // => true * isNil(NaN); // => false */ module.exports = function isNil(value) { return isNull(value) || isUndefined(value); }; },{"lodash.isnull":5,"validate.io-undefined":9}],4:[function(_dereq_,module,exports){ 'use strict'; var toStr = Object.prototype.toString; var hasSymbols = typeof Symbol === 'function' && typeof Symbol() === 'symbol'; if (hasSymbols) { var symToStr = Symbol.prototype.toString; var symStringRegex = /^Symbol\(.*\)$/; var isSymbolObject = function isSymbolObject(value) { if (typeof value.valueOf() !== 'symbol') { return false; } return symStringRegex.test(symToStr.call(value)); }; module.exports = function isSymbol(value) { if (typeof value === 'symbol') { return true; } if (toStr.call(value) !== '[object Symbol]') { return false; } try { return isSymbolObject(value); } catch (e) { return false; } }; } else { module.exports = function isSymbol(value) { // this environment does not support Symbols. return false; }; } },{}],5:[function(_dereq_,module,exports){ /** * lodash 3.0.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation * Based on Underscore.js 1.7.0 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ /** * Checks if `value` is `null`. * * @static * @memberOf _ * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is `null`, else `false`. * @example * * _.isNull(null); * // => true * * _.isNull(void 0); * // => false */ function isNull(value) { return value === null; } module.exports = isNull; },{}],6:[function(_dereq_,module,exports){ /** * @file Requires an argument is corecible then converts using ToString. * @version 1.0.0 * @author Xotic750 * @copyright Xotic750 * @license {@link MIT} * @module require-coercible-to-string-x */ 'use strict'; var requireObjectCoercible = _dereq_('require-object-coercible-x'); var toStr = _dereq_('to-string-x'); /** * This method requires an argument is corecible then converts using ToString. * * @param {*} value - The value to converted to a string. * @throws {TypeError} If value is null or undefined. * @returns {string} The value as a string. * @example * var requireCoercibleToString = require('require-coercible-to-string-x'); * * requireCoercibleToString(); // TypeError * requireCoercibleToString(null); // TypeError * requireCoercibleToString(Symbol('')); // TypeError * requireCoercibleToString(Object.create(null)); // TypeError * requireCoercibleToString(1); // '1' * requireCoercibleToString(true); // 'true' */ module.exports = function requireCoercibleToString(value) { return toStr(requireObjectCoercible(value)); }; },{"require-object-coercible-x":7,"to-string-x":8}],7:[function(_dereq_,module,exports){ /** * @file ES6-compliant shim for RequireObjectCoercible. * @see {@link http://www.ecma-international.org/ecma-262/6.0/#sec-requireobjectcoercible|7.2.1 RequireObjectCoercible ( argument )} * @version 1.4.1 * @author Xotic750 * @copyright Xotic750 * @license {@link MIT} * @module require-object-coercible-x */ 'use strict'; var isNil = _dereq_('is-nil-x'); /** * The abstract operation RequireObjectCoercible throws an error if argument * is a value that cannot be converted to an Object using ToObject. * * @param {*} value - The `value` to check. * @throws {TypeError} If `value` is a `null` or `undefined`. * @returns {string} The `value`. * @example * var RequireObjectCoercible = require('require-object-coercible-x'); * * RequireObjectCoercible(); // TypeError * RequireObjectCoercible(null); // TypeError * RequireObjectCoercible('abc'); // 'abc' * RequireObjectCoercible(true); // true * RequireObjectCoercible(Symbol('foo')); // Symbol('foo') */ module.exports = function RequireObjectCoercible(value) { if (isNil(value)) { throw new TypeError('Cannot call method on ' + value); } return value; }; },{"is-nil-x":3}],8:[function(_dereq_,module,exports){ /** * @file ES6-compliant shim for ToString. * @see {@link http://www.ecma-international.org/ecma-262/6.0/#sec-tostring|7.1.12 ToString ( argument )} * @version 1.4.2 * @author Xotic750 * @copyright Xotic750 * @license {@link MIT} * @module to-string-x */ 'use strict'; var castString = ''.constructor; var isSymbol = _dereq_('is-symbol'); /** * The abstract operation ToString converts argument to a value of type String. * * @param {*} value - The value to convert to a string. * @throws {TypeError} If `value` is a Symbol. * @returns {string} The converted value. * @example * var $toString = require('to-string-x'); * * $toString(); // 'undefined' * $toString(null); // 'null' * $toString('abc'); // 'abc' * $toString(true); // 'true' * $toString(Symbol('foo')); // TypeError * $toString(Symbol.iterator); // TypeError * $toString(Object(Symbol.iterator)); // TypeError * $toString(Object.create(null)); // TypeError */ module.exports = function ToString(value) { if (isSymbol(value)) { throw new TypeError('Cannot convert a Symbol value to a string'); } return castString(value); }; },{"is-symbol":4}],9:[function(_dereq_,module,exports){ /** * * VALIDATE: undefined * * * DESCRIPTION: * - Validates if a value is undefined. * * * NOTES: * [1] * * * TODO: * [1] * * * LICENSE: * MIT * * Copyright (c) 2014. Athan Reines. * * * AUTHOR: * Athan Reines. kgryte@gmail.com. 2014. * */ 'use strict'; /** * FUNCTION: isUndefined( value ) * Validates if a value is undefined. * * @param {*} value - value to be validated * @returns {Boolean} boolean indicating whether value is undefined */ function isUndefined( value ) { return value === void 0; } // end FUNCTION isUndefined() // EXPORTS // module.exports = isUndefined; },{}],10:[function(_dereq_,module,exports){ /** * @file List of ECMAScript white space characters. * @version 3.0.0 * @author Xotic750 * @copyright Xotic750 * @license {@link MIT} * @module white-space-x */ 'use strict'; /** * A record of a white space character. * * @typedef {Object} CharRecord * @property {number} code - The character code. * @property {string} description - A description of the character. * @property {boolean} es5 - Whether the spec lists this as a white space. * @property {boolean} es2015 - Whether the spec lists this as a white space. * @property {boolean} es2016 - Whether the spec lists this as a white space. * @property {boolean} es2017 - Whether the spec lists this as a white space. * @property {boolean} es2018 - Whether the spec lists this as a white space. * @property {string} string - The character string. */ /** * An array of the whitespace char codes, string, descriptions and language * presence in the specifications. * * @private * @type Array. */ var list = [ { code: 0x0009, description: 'Tab', es5: true, es2015: true, es2016: true, es2017: true, es2018: true, string: '\u0009' }, { code: 0x000a, description: 'Line Feed', es5: true, es2015: true, es2016: true, es2017: true, es2018: true, string: '\u000a' }, { code: 0x000b, description: 'Vertical Tab', es5: true, es2015: true, es2016: true, es2017: true, es2018: true, string: '\u000b' }, { code: 0x000c, description: 'Form Feed', es5: true, es2015: true, es2016: true, es2017: true, es2018: true, string: '\u000c' }, { code: 0x000d, description: 'Carriage Return', es5: true, es2015: true, es2016: true, es2017: true, es2018: true, string: '\u000d' }, { code: 0x0020, description: 'Space', es5: true, es2015: true, es2016: true, es2017: true, es2018: true, string: '\u0020' }, /* { code: 0x0085, description: 'Next line', es5: false, es2015: false, es2016: false, es2017: false, es2018: false, string: '\u0085' } */ { code: 0x00a0, description: 'No-break space', es5: true, es2015: true, es2016: true, es2017: true, es2018: true, string: '\u00a0' }, { code: 0x1680, description: 'Ogham space mark', es5: true, es2015: true, es2016: true, es2017: true, es2018: true, string: '\u1680' }, { code: 0x180e, description: 'Mongolian vowel separator', es5: true, es2015: true, es2016: true, es2017: false, es2018: false, string: '\u180e' }, { code: 0x2000, description: 'En quad', es5: true, es2015: true, es2016: true, es2017: true, es2018: true, string: '\u2000' }, { code: 0x2001, description: 'Em quad', es5: true, es2015: true, es2016: true, es2017: true, es2018: true, string: '\u2001' }, { code: 0x2002, description: 'En space', es5: true, es2015: true, es2016: true, es2017: true, es2018: true, string: '\u2002' }, { code: 0x2003, description: 'Em space', es5: true, es2015: true, es2016: true, es2017: true, es2018: true, string: '\u2003' }, { code: 0x2004, description: 'Three-per-em space', es5: true, es2015: true, es2016: true, es2017: true, es2018: true, string: '\u2004' }, { code: 0x2005, description: 'Four-per-em space', es5: true, es2015: true, es2016: true, es2017: true, es2018: true, string: '\u2005' }, { code: 0x2006, description: 'Six-per-em space', es5: true, es2015: true, es2016: true, es2017: true, es2018: true, string: '\u2006' }, { code: 0x2007, description: 'Figure space', es5: true, es2015: true, es2016: true, es2017: true, es2018: true, string: '\u2007' }, { code: 0x2008, description: 'Punctuation space', es5: true, es2015: true, es2016: true, es2017: true, es2018: true, string: '\u2008' }, { code: 0x2009, description: 'Thin space', es5: true, es2015: true, es2016: true, es2017: true, es2018: true, string: '\u2009' }, { code: 0x200a, description: 'Hair space', es5: true, es2015: true, es2016: true, es2017: true, es2018: true, string: '\u200a' }, /* { code: 0x200b, description: 'Zero width space', es5: false, es2015: false, es2016: false, es2017: false, es2018: false, string: '\u200b' }, */ { code: 0x2028, description: 'Line separator', es5: true, es2015: true, es2016: true, es2017: true, es2018: true, string: '\u2028' }, { code: 0x2029, description: 'Paragraph separator', es5: true, es2015: true, es2016: true, es2017: true, es2018: true, string: '\u2029' }, { code: 0x202f, description: 'Narrow no-break space', es5: true, es2015: true, es2016: true, es2017: true, es2018: true, string: '\u202f' }, { code: 0x205f, description: 'Medium mathematical space', es5: true, es2015: true, es2016: true, es2017: true, es2018: true, string: '\u205f' }, { code: 0x3000, description: 'Ideographic space', es5: true, es2015: true, es2016: true, es2017: true, es2018: true, string: '\u3000' }, { code: 0xfeff, description: 'Byte Order Mark', es5: true, es2015: true, es2016: true, es2017: true, es2018: true, string: '\ufeff' } ]; var stringES2016 = ''; var stringES2018 = ''; var length = list.length; for (var i = 0; i < length; i += 1) { if (list[i].es2016) { stringES2016 += list[i].string; } if (list[i].es2018) { stringES2018 += list[i].string; } } module.exports = { /** * An array of the whitespace char codes, string, descriptions and language * presence in the specifications. * * @type Array. * @example * var whiteSpace = require('white-space-x'); * whiteSpaces.list.foreach(function (item) { * console.log(lib.description, item.code, item.string); * }); */ list: list, /** * A string of the ES2017 to ES2018 whitespace characters. * * @type string */ string: stringES2018, /** * A string of the ES5 to ES2016 whitespace characters. * * @type string */ string5: stringES2016, /** * A string of the ES5 to ES2016 whitespace characters. * * @type string */ string2015: stringES2016, /** * A string of the ES5 to ES2016 whitespace characters. * * @type string * @example * var whiteSpace = require('white-space-x'); * var characters = [ * '\u0009', * '\u000a', * '\u000b', * '\u000c', * '\u000d', * '\u0020', * '\u00a0', * '\u1680', * '\u180e', * '\u2000', * '\u2001', * '\u2002', * '\u2003', * '\u2004', * '\u2005', * '\u2006', * '\u2007', * '\u2008', * '\u2009', * '\u200a', * '\u2028', * '\u2029', * '\u202f', * '\u205f', * '\u3000', * '\ufeff' * ]; * var ws = characters.join(''); * var re1 = new RegExp('^[' + whiteSpace.string2016 + ']+$)'); * re1.test(ws); // true */ string2016: stringES2016, /** * A string of the ES2017 to ES2018 whitespace characters. * * @type string */ string2017: stringES2018, /** * A string of the ES2017 to ES2018 whitespace characters. * * @type string * @example * var whiteSpace = require('white-space-x'); * var characters = [ * '\u0009', * '\u000a', * '\u000b', * '\u000c', * '\u000d', * '\u0020', * '\u00a0', * '\u1680', * '\u2000', * '\u2001', * '\u2002', * '\u2003', * '\u2004', * '\u2005', * '\u2006', * '\u2007', * '\u2008', * '\u2009', * '\u200a', * '\u2028', * '\u2029', * '\u202f', * '\u205f', * '\u3000', * '\ufeff' * ]; * var ws = characters.join(''); * var re1 = new RegExp('^[' + whiteSpace.string2018 + ']+$)'); * re1.test(ws); // true */ string2018: stringES2018 }; },{}]},{},[1])(1) });