Socket
Socket
Sign inDemoInstall

trim-left-x

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

trim-left-x - npm Package Compare versions

Comparing version 1.2.0 to 1.3.0

.eslintignore

17

.eslintrc.json
{
"root": true,
"extends": "@ljharb",
"plugins": [
"import"
],
"rules": {
"indent": ["error", 2, {
"SwitchCase": 1
}],
"global-require": 0,
"max-params": 0,
"block-scoped-var": 1
}
}
"extends": [
"@xotic750/eslint-config-standard-x"
]
}
/**
* @file
* <a href="https://travis-ci.org/Xotic750/trim-left-x"
* title="Travis status">
* <img
* src="https://travis-ci.org/Xotic750/trim-left-x.svg?branch=master"
* alt="Travis status" height="18">
* </a>
* <a href="https://david-dm.org/Xotic750/trim-left-x"
* title="Dependency status">
* <img src="https://david-dm.org/Xotic750/trim-left-x.svg"
* alt="Dependency status" height="18"/>
* </a>
* <a
* href="https://david-dm.org/Xotic750/trim-left-x#info=devDependencies"
* title="devDependency status">
* <img src="https://david-dm.org/Xotic750/trim-left-x/dev-status.svg"
* alt="devDependency status" height="18"/>
* </a>
* <a href="https://badge.fury.io/js/trim-left-x" title="npm version">
* <img src="https://badge.fury.io/js/trim-left-x.svg"
* alt="npm version" height="18">
* </a>
*
* This method removes whitespace from the left end of a string.
*
* Requires ES3 or above.
*
* @version 1.2.0
* @file This method removes whitespace from the left end of a string.
* @version 1.3.0
* @author Xotic750 <Xotic750@gmail.com>

@@ -36,27 +10,19 @@ * @copyright Xotic750

/* eslint strict: 1 */
'use strict';
/* global module */
var $toString = require('to-string-x');
var reLeft = new RegExp('^[' + require('white-space-x').string + ']+');
;(function () { // eslint-disable-line no-extra-semi
'use strict';
var $toString = require('to-string-x');
var ws = require('white-space-x').ws;
var reLeft = new RegExp('^[' + ws + ']+');
/**
* This method removes whitespace from the left end of a string
*
* @param {String} string The string to trim the left end whitespace from.
* @return {undefined|string} The left trimmed string.
* @example
* var trimLeft = require('trim-left-x');
*
* trimLeft(' \t\na \t\n') === 'a \t\n'; // true
*/
module.exports = function trimLeft(string) {
return $toString(string).replace(reLeft, '');
};
}());
/**
* This method removes whitespace from the left end of a string.
*
* @param {string} string - The string to trim the left end whitespace from.
* @returns {undefined|string} The left trimmed string.
* @example
* var trimLeft = require('trim-left-x');
*
* trimLeft(' \t\na \t\n') === 'a \t\n'; // true
*/
module.exports = function trimLeft(string) {
return $toString(string).replace(reLeft, '');
};
(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<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
/**
* @file
* <a href="https://travis-ci.org/Xotic750/trim-left-x"
* title="Travis status">
* <img
* src="https://travis-ci.org/Xotic750/trim-left-x.svg?branch=master"
* alt="Travis status" height="18">
* </a>
* <a href="https://david-dm.org/Xotic750/trim-left-x"
* title="Dependency status">
* <img src="https://david-dm.org/Xotic750/trim-left-x.svg"
* alt="Dependency status" height="18"/>
* </a>
* <a
* href="https://david-dm.org/Xotic750/trim-left-x#info=devDependencies"
* title="devDependency status">
* <img src="https://david-dm.org/Xotic750/trim-left-x/dev-status.svg"
* alt="devDependency status" height="18"/>
* </a>
* <a href="https://badge.fury.io/js/trim-left-x" title="npm version">
* <img src="https://badge.fury.io/js/trim-left-x.svg"
* alt="npm version" height="18">
* </a>
*
* This method removes whitespace from the left end of a string.
*
* Requires ES3 or above.
*
* @version 1.2.0
* @file This method removes whitespace from the left end of a string.
* @version 1.3.0
* @author Xotic750 <Xotic750@gmail.com>

@@ -37,451 +11,87 @@ * @copyright Xotic750

/* eslint strict: 1 */
'use strict';
/* global module */
var $toString = _dereq_('to-string-x');
var reLeft = new RegExp('^[' + _dereq_('white-space-x').string + ']+');
;(function () { // eslint-disable-line no-extra-semi
'use strict';
var $toString = _dereq_('to-string-x');
var ws = _dereq_('white-space-x').ws;
var reLeft = new RegExp('^[' + ws + ']+');
/**
* This method removes whitespace from the left end of a string
*
* @param {String} string The string to trim the left end whitespace from.
* @return {undefined|string} The left trimmed string.
* @example
* var trimLeft = require('trim-left-x');
*
* trimLeft(' \t\na \t\n') === 'a \t\n'; // true
*/
module.exports = function trimLeft(string) {
return $toString(string).replace(reLeft, '');
};
}());
},{"to-string-x":13,"white-space-x":15}],2:[function(_dereq_,module,exports){
/**
* @file
* <a href="https://travis-ci.org/Xotic750/define-properties-x"
* title="Travis status">
* <img
* src="https://travis-ci.org/Xotic750/define-properties-x.svg?branch=master"
* alt="Travis status" height="18">
* </a>
* <a href="https://david-dm.org/Xotic750/define-properties-x"
* title="Dependency status">
* <img src="https://david-dm.org/Xotic750/define-properties-x.svg"
* alt="Dependency status" height="18"/>
* </a>
* <a
* href="https://david-dm.org/Xotic750/define-properties-x#info=devDependencies"
* title="devDependency status">
* <img src="https://david-dm.org/Xotic750/define-properties-x/dev-status.svg"
* alt="devDependency status" height="18"/>
* </a>
* <a href="https://badge.fury.io/js/define-properties-x" title="npm version">
* <img src="https://badge.fury.io/js/define-properties-x.svg"
* alt="npm version" height="18">
* </a>
* This method removes whitespace from the left end of a string.
*
* Define multiple non-enumerable properties at once.
* @param {string} string - The string to trim the left end whitespace from.
* @returns {undefined|string} The left trimmed string.
* @example
* var trimLeft = require('trim-left-x');
*
* Requires ES3 or above.
*
* @see {@link https://www.npmjs.com/package/define-properties|define-properties}
*
* @version 1.3.0
* @author Xotic750 <Xotic750@gmail.com>
* @copyright Xotic750
* @license {@link <https://opensource.org/licenses/MIT> MIT}
* @module define-properties-x
* trimLeft(' \t\na \t\n') === 'a \t\n'; // true
*/
module.exports = function trimLeft(string) {
return $toString(string).replace(reLeft, '');
};
/* eslint strict: 1, max-statements: 1, id-length: 1, no-restricted-syntax: 1,
no-param-reassign: 1 */
},{"to-string-x":5,"white-space-x":6}],2:[function(_dereq_,module,exports){
var isFunction = _dereq_('is-function')
/* global module */
module.exports = forEach
;(function () { // eslint-disable-line no-extra-semi
var toString = Object.prototype.toString
var hasOwnProperty = Object.prototype.hasOwnProperty
'use strict';
function forEach(list, iterator, context) {
if (!isFunction(iterator)) {
throw new TypeError('iterator must be a function')
}
var hasSymbols = _dereq_('has-symbol-support-x');
var isFunction = _dereq_('is-function-x');
var isUndefined = _dereq_('validate.io-undefined');
var forEach = _dereq_('foreach');
var $keys = isFunction(Object.keys) ? Object.keys : _dereq_('object-keys');
var $getOwnPropertySymbols = isFunction(Object.getOwnPropertySymbols) && Object.getOwnPropertySymbols;
var $defineProperty = isFunction(Object.defineProperty) && Object.defineProperty;
var supportsDescriptors = Boolean($defineProperty) && (function () {
var obj = {};
try {
$defineProperty(obj, 'x', {
enumerable: false,
value: obj
});
for (var unused in obj) {
/* jshint forin:false */
return false;
}
return obj.x === obj;
} catch (e) { /* this is IE 8. */
return false;
if (arguments.length < 3) {
context = this
}
}());
if (toString.call(list) === '[object Array]')
forEachArray(list, iterator, context)
else if (typeof list === 'string')
forEachString(list, iterator, context)
else
forEachObject(list, iterator, context)
}
/**
* Method `property`.
*
* @private
* @param {Object} object The object on which to define the property.
* @param {string|Symbol} prop The property name.
* @param {*} value The value of the property.
* @param {boolean} [force=false] If `true` then set property regardless.
*/
var property = function (object, prop, value, force) {
if (prop in object && !force) {
return;
function forEachArray(array, iterator, context) {
for (var i = 0, len = array.length; i < len; i++) {
if (hasOwnProperty.call(array, i)) {
iterator.call(context, array[i], i, array)
}
}
if (supportsDescriptors) {
$defineProperty(object, prop, {
configurable: true,
enumerable: false,
value: value,
writable: true
});
} else {
object[prop] = value;
}
};
}
/**
* Method `properties`.
*
* @private
* @param {Object} object The object on which to define the property.
* @param {Object} map The object of properties.
* @param {Object} [predicates] The object of property predicates.
*/
var properties = function (object, map, predicates) {
var preds = isUndefined(predicates) ? {} : predicates;
var props = $keys(map);
if (hasSymbols && $getOwnPropertySymbols) {
props = props.concat($getOwnPropertySymbols(map));
function forEachString(string, iterator, context) {
for (var i = 0, len = string.length; i < len; i++) {
// no such thing as a sparse string.
iterator.call(context, string.charAt(i), i, string)
}
forEach(props, function (name) {
var predicate = preds[name];
property(
object,
name,
map[name],
isFunction(predicate) && predicate()
);
});
};
}
properties(module.exports, {
/**
* Define multiple non-enumerable properties at once.
* Uses `Object.defineProperty` when available; falls back to standard
* assignment in older engines. Existing properties are not overridden.
* Accepts a map of property names to a predicate that, when true,
* force-overrides.
*
* @function
* @param {Object} object The object on which to define the property.
* @param {Object} map The object of properties.
* @param {Object} [predicates] The object of property predicates.
* @example
* var define = require('define-properties-x');
* define.properties({
* a: 1,
* b: 2
* }, {
* a: function () { return false; },
* b: function () { return true; }
* });
*/
properties: properties,
/**
* Just like `properties` but for defining a single non-enumerable
* property. Useful in environments that do not
* support `Computed property names`. This can be done
* with `properties`, but this method can read a little cleaner.
*
* @function
* @param {Object} object The object on which to define the property.
* @param {string|Symbol} prop The property name.
* @param {*} value The value of the property.
* @param {boolean} [force=false] If `true` then set property regardless.
* @example
* var define = require('define-properties-x');
* var myString = 'something';
* define.property(obj, Symbol.iterator, function () {}, true);
* define.property(obj, myString, function () {}, true);
*/
property: property,
/**
* Boolean indicator as to whether the environments supports descriptors
* or not.
*
* @type boolean
* @example
* var define = require('define-properties-x');
* define.supportsDescriptors; // true or false
*/
supportsDescriptors: supportsDescriptors
});
}());
},{"foreach":3,"has-symbol-support-x":4,"is-function-x":6,"object-keys":10,"validate.io-undefined":14}],3:[function(_dereq_,module,exports){
var hasOwn = Object.prototype.hasOwnProperty;
var toString = Object.prototype.toString;
module.exports = function forEach (obj, fn, ctx) {
if (toString.call(fn) !== '[object Function]') {
throw new TypeError('iterator must be a function');
}
var l = obj.length;
if (l === +l) {
for (var i = 0; i < l; i++) {
fn.call(ctx, obj[i], i, obj);
function forEachObject(object, iterator, context) {
for (var k in object) {
if (hasOwnProperty.call(object, k)) {
iterator.call(context, object[k], k, object)
}
} else {
for (var k in obj) {
if (hasOwn.call(obj, k)) {
fn.call(ctx, obj[k], k, obj);
}
}
}
};
}
},{"is-function":3}],3:[function(_dereq_,module,exports){
module.exports = isFunction
},{}],4:[function(_dereq_,module,exports){
/**
* @file
* <a href="https://travis-ci.org/Xotic750/has-symbol-support-x"
* title="Travis status">
* <img
* src="https://travis-ci.org/Xotic750/has-symbol-support-x.svg?branch=master"
* alt="Travis status" height="18">
* </a>
* <a href="https://david-dm.org/Xotic750/has-symbol-support-x"
* title="Dependency status">
* <img src="https://david-dm.org/Xotic750/has-symbol-support-x.svg"
* alt="Dependency status" height="18"/>
* </a>
* <a
* href="https://david-dm.org/Xotic750/has-symbol-support-x#info=devDependencies"
* title="devDependency status">
* <img src="https://david-dm.org/Xotic750/has-symbol-support-x/dev-status.svg"
* alt="devDependency status" height="18"/>
* </a>
* <a href="https://badge.fury.io/js/has-symbol-support-x" title="npm version">
* <img src="https://badge.fury.io/js/has-symbol-support-x.svg"
* alt="npm version" height="18">
* </a>
*
* Tests if `Symbol` exists and creates the correct type.
*
* Requires ES3 or above.
*
* @version 1.2.0
* @author Xotic750 <Xotic750@gmail.com>
* @copyright Xotic750
* @license {@link <https://opensource.org/licenses/MIT> MIT}
* @module has-symbol-support-x
*/
var toString = Object.prototype.toString
/* eslint strict: 1, symbol-description: 1 */
/* global module */
;(function () { // eslint-disable-line no-extra-semi
'use strict';
/**
* Indicates if `Symbol`exists and creates the correct type.
* `true`, if it exists and creates the correct type, otherwise `false`.
*
* @type boolean
*/
module.exports = typeof Symbol === 'function' && typeof Symbol() === 'symbol';
}());
},{}],5:[function(_dereq_,module,exports){
/**
* @file
* <a href="https://travis-ci.org/Xotic750/has-to-string-tag-x"
* title="Travis status">
* <img
* src="https://travis-ci.org/Xotic750/has-to-string-tag-x.svg?branch=master"
* alt="Travis status" height="18">
* </a>
* <a href="https://david-dm.org/Xotic750/has-to-string-tag-x"
* title="Dependency status">
* <img src="https://david-dm.org/Xotic750/has-to-string-tag-x.svg"
* alt="Dependency status" height="18"/>
* </a>
* <a
* href="https://david-dm.org/Xotic750/has-to-string-tag-x#info=devDependencies"
* title="devDependency status">
* <img src="https://david-dm.org/Xotic750/has-to-string-tag-x/dev-status.svg"
* alt="devDependency status" height="18"/>
* </a>
* <a href="https://badge.fury.io/js/has-to-string-tag-x" title="npm version">
* <img src="https://badge.fury.io/js/has-to-string-tag-x.svg"
* alt="npm version" height="18">
* </a>
*
* Tests if ES6 @@toStringTag is supported.
*
* Requires ES3 or above.
*
* @see {@link http://www.ecma-international.org/ecma-262/6.0/#sec-@@tostringtag|26.3.1 @@toStringTag}
*
* @version 1.2.0
* @author Xotic750 <Xotic750@gmail.com>
* @copyright Xotic750
* @license {@link <https://opensource.org/licenses/MIT> MIT}
* @module has-to-string-tag-x
*/
/* eslint strict: 1 */
/* global module */
;(function () { // eslint-disable-line no-extra-semi
'use strict';
/**
* Indicates if `Symbol.toStringTag`exists and is the correct type.
* `true`, if it exists and is the correct type, otherwise `false`.
*
* @type boolean
*/
module.exports = _dereq_('has-symbol-support-x') && typeof Symbol.toStringTag === 'symbol';
}());
},{"has-symbol-support-x":4}],6:[function(_dereq_,module,exports){
/**
* @file
* <a href="https://travis-ci.org/Xotic750/is-function-x"
* title="Travis status">
* <img
* src="https://travis-ci.org/Xotic750/is-function-x.svg?branch=master"
* alt="Travis status" height="18">
* </a>
* <a href="https://david-dm.org/Xotic750/is-function-x"
* title="Dependency status">
* <img src="https://david-dm.org/Xotic750/is-function-x.svg"
* alt="Dependency status" height="18"/>
* </a>
* <a
* href="https://david-dm.org/Xotic750/is-function-x#info=devDependencies"
* title="devDependency status">
* <img src="https://david-dm.org/Xotic750/is-function-x/dev-status.svg"
* alt="devDependency status" height="18"/>
* </a>
* <a href="https://badge.fury.io/js/is-function-x" title="npm version">
* <img src="https://badge.fury.io/js/is-function-x.svg"
* alt="npm version" height="18">
* </a>
*
* Determine whether a given value is a function object.
*
* @version 1.2.0
* @author Xotic750 <Xotic750@gmail.com>
* @copyright Xotic750
* @license {@link <https://opensource.org/licenses/MIT> MIT}
* @module is-function-x
*/
/* eslint strict: 1 */
/* global module */
;(function () { // eslint-disable-line no-extra-semi
'use strict';
var fToString = Function.prototype.toString;
var toStringTag = _dereq_('to-string-tag-x');
var hasToStringTag = _dereq_('has-to-string-tag-x');
var isPrimitive = _dereq_('is-primitive');
var funcTag = '[object Function]';
var genTag = '[object GeneratorFunction]';
var asyncTag = '[object AsyncFunction]';
/**
* Checks if `value` is classified as a `Function` object.
*
* @private
* @param {*} value The value to check.
* @return {boolean} Returns `true` if `value` is correctly classified,
* else `false`.
*/
var tryFuncToString = function funcToString(value) {
try {
fToString.call(value);
return true;
} catch (ignore) {}
return false;
};
/**
* Checks if `value` is classified as a `Function` object.
*
* @param {*} value The value to check.
* @return {boolean} Returns `true` if `value` is correctly classified,
* else `false`.
* @example
* var isFunction = require('is-function-x');
*
* isFunction(); // false
* isFunction(Number.MIN_VALUE); // false
* isFunction('abc'); // false
* isFunction(true); // false
* isFunction({ name: 'abc' }); // false
* isFunction(function () {}); // true
* isFunction(new Function ()); // true
* isFunction(function* test1() {}); // true
* isFunction(function test2(a, b) {}); // true
* isFunction(class Test {}); // true
* isFunction((x, y) => {return this;}); // true
*/
module.exports = function isFunction(value) {
if (isPrimitive(value)) {
return false;
}
if (hasToStringTag) {
return tryFuncToString(value);
}
var strTag = toStringTag(value);
return strTag === funcTag || strTag === genTag || strTag === asyncTag;
};
}());
},{"has-to-string-tag-x":5,"is-primitive":7,"to-string-tag-x":12}],7:[function(_dereq_,module,exports){
/*!
* is-primitive <https://github.com/jonschlinkert/is-primitive>
*
* Copyright (c) 2014-2015, Jon Schlinkert.
* Licensed under the MIT License.
*/
'use strict';
// see http://jsperf.com/testing-value-is-primitive/7
module.exports = function isPrimitive(value) {
return value == null || (typeof value !== 'function' && typeof value !== 'object');
function isFunction (fn) {
var string = toString.call(fn)
return string === '[object Function]' ||
(typeof fn === 'function' && string !== '[object RegExp]') ||
(typeof window !== 'undefined' &&
// IE8 and below
(fn === window.setTimeout ||
fn === window.alert ||
fn === window.confirm ||
fn === window.prompt))
};
},{}],8:[function(_dereq_,module,exports){
},{}],4:[function(_dereq_,module,exports){
'use strict';

@@ -515,523 +125,264 @@

},{}],9:[function(_dereq_,module,exports){
},{}],5:[function(_dereq_,module,exports){
/**
* lodash 3.0.0 (Custom Build) <https://lodash.com/>
* Build: `lodash modern modularize exports="npm" -o ./`
* Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
* Based on Underscore.js 1.7.0 <http://underscorejs.org/LICENSE>
* Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
* Available under MIT license <https://lodash.com/license>
* @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.0
* @author Xotic750 <Xotic750@gmail.com>
* @copyright Xotic750
* @license {@link <https://opensource.org/licenses/MIT> MIT}
* @module to-string-x
*/
'use strict';
var isSymbol = _dereq_('is-symbol');
/**
* Checks if `value` is `null`.
* The abstract operation ToString converts argument to a value of type String.
*
* @static
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is `null`, else `false`.
* @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');
*
* _.isNull(null);
* // => true
*
* _.isNull(void 0);
* // => false
* $toString(); // 'undefined'
* $toString(null); // 'null'
* $toString('abc'); // 'abc'
* $toString(true); // 'true'
* $toString(Symbol('foo')); // TypeError
* $toString(Symbol.iterator); // TypeError
* $toString(Object(Symbol.iterator)); // TypeError
*/
function isNull(value) {
return value === null;
}
module.exports = function ToString(value) {
if (isSymbol(value)) {
throw new TypeError('Cannot convert a Symbol value to a string');
}
module.exports = isNull;
},{}],10:[function(_dereq_,module,exports){
'use strict';
// modified from https://github.com/es-shims/es5-shim
var has = Object.prototype.hasOwnProperty;
var toStr = Object.prototype.toString;
var slice = Array.prototype.slice;
var isArgs = _dereq_('./isArguments');
var isEnumerable = Object.prototype.propertyIsEnumerable;
var hasDontEnumBug = !isEnumerable.call({ toString: null }, 'toString');
var hasProtoEnumBug = isEnumerable.call(function () {}, 'prototype');
var dontEnums = [
'toString',
'toLocaleString',
'valueOf',
'hasOwnProperty',
'isPrototypeOf',
'propertyIsEnumerable',
'constructor'
];
var equalsConstructorPrototype = function (o) {
var ctor = o.constructor;
return ctor && ctor.prototype === o;
return String(value);
};
var excludedKeys = {
$console: true,
$external: true,
$frame: true,
$frameElement: true,
$frames: true,
$innerHeight: true,
$innerWidth: true,
$outerHeight: true,
$outerWidth: true,
$pageXOffset: true,
$pageYOffset: true,
$parent: true,
$scrollLeft: true,
$scrollTop: true,
$scrollX: true,
$scrollY: true,
$self: true,
$webkitIndexedDB: true,
$webkitStorageInfo: true,
$window: true
};
var hasAutomationEqualityBug = (function () {
/* global window */
if (typeof window === 'undefined') { return false; }
for (var k in window) {
try {
if (!excludedKeys['$' + k] && has.call(window, k) && window[k] !== null && typeof window[k] === 'object') {
try {
equalsConstructorPrototype(window[k]);
} catch (e) {
return true;
}
}
} catch (e) {
return true;
}
}
return false;
}());
var equalsConstructorPrototypeIfNotBuggy = function (o) {
/* global window */
if (typeof window === 'undefined' || !hasAutomationEqualityBug) {
return equalsConstructorPrototype(o);
}
try {
return equalsConstructorPrototype(o);
} catch (e) {
return false;
}
};
var keysShim = function keys(object) {
var isObject = object !== null && typeof object === 'object';
var isFunction = toStr.call(object) === '[object Function]';
var isArguments = isArgs(object);
var isString = isObject && toStr.call(object) === '[object String]';
var theKeys = [];
if (!isObject && !isFunction && !isArguments) {
throw new TypeError('Object.keys called on a non-object');
}
var skipProto = hasProtoEnumBug && isFunction;
if (isString && object.length > 0 && !has.call(object, 0)) {
for (var i = 0; i < object.length; ++i) {
theKeys.push(String(i));
}
}
if (isArguments && object.length > 0) {
for (var j = 0; j < object.length; ++j) {
theKeys.push(String(j));
}
} else {
for (var name in object) {
if (!(skipProto && name === 'prototype') && has.call(object, name)) {
theKeys.push(String(name));
}
}
}
if (hasDontEnumBug) {
var skipConstructor = equalsConstructorPrototypeIfNotBuggy(object);
for (var k = 0; k < dontEnums.length; ++k) {
if (!(skipConstructor && dontEnums[k] === 'constructor') && has.call(object, dontEnums[k])) {
theKeys.push(dontEnums[k]);
}
}
}
return theKeys;
};
keysShim.shim = function shimObjectKeys() {
if (Object.keys) {
var keysWorksWithArguments = (function () {
// Safari 5.0 bug
return (Object.keys(arguments) || '').length === 2;
}(1, 2));
if (!keysWorksWithArguments) {
var originalKeys = Object.keys;
Object.keys = function keys(object) {
if (isArgs(object)) {
return originalKeys(slice.call(object));
} else {
return originalKeys(object);
}
};
}
} else {
Object.keys = keysShim;
}
return Object.keys || keysShim;
};
module.exports = keysShim;
},{"./isArguments":11}],11:[function(_dereq_,module,exports){
'use strict';
var toStr = Object.prototype.toString;
module.exports = function isArguments(value) {
var str = toStr.call(value);
var isArgs = str === '[object Arguments]';
if (!isArgs) {
isArgs = str !== '[object Array]' &&
value !== null &&
typeof value === 'object' &&
typeof value.length === 'number' &&
value.length >= 0 &&
toStr.call(value.callee) === '[object Function]';
}
return isArgs;
};
},{}],12:[function(_dereq_,module,exports){
},{"is-symbol":4}],6:[function(_dereq_,module,exports){
/**
* @file
* <a href="https://travis-ci.org/Xotic750/to-string-tag-x"
* title="Travis status">
* <img src="https://travis-ci.org/Xotic750/to-string-tag-x.svg?branch=master"
* alt="Travis status" height="18">
* </a>
* <a href="https://david-dm.org/Xotic750/to-string-tag-x"
* title="Dependency status">
* <img src="https://david-dm.org/Xotic750/to-string-tag-x.svg"
* alt="Dependency status" height="18"/>
* </a>
* <a href="https://david-dm.org/Xotic750/to-string-tag-x#info=devDependencies"
* title="devDependency status">
* <img src="https://david-dm.org/Xotic750/to-string-tag-x/dev-status.svg"
* alt="devDependency status" height="18"/>
* </a>
* <a href="https://badge.fury.io/js/to-string-tag-x" title="npm version">
* <img src="https://badge.fury.io/js/to-string-tag-x.svg"
* alt="npm version" height="18">
* </a>
*
* Get an object's ES6 @@toStringTag.
*
* Requires ES3 or above.
*
* @see {@link http://www.ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring|19.1.3.6 Object.prototype.toString ( )}
*
* @version 1.2.0
* @file List of ECMAScript5 white space characters.
* @version 2.0.0
* @author Xotic750 <Xotic750@gmail.com>
* @copyright Xotic750
* @license {@link <https://opensource.org/licenses/MIT> MIT}
* @module to-string-tag-x
* @module white-space-x
*/
/* eslint strict: 1 */
'use strict';
/* global module */
var forEach = _dereq_('for-each');
;(function () { // eslint-disable-line no-extra-semi
'use strict';
var isNull = _dereq_('lodash.isnull');
var isUndefined = _dereq_('validate.io-undefined');
var nullTag = '[object Null]';
var undefTag = '[object Undefined]';
var toStr = Object.prototype.toString;
/**
* The `toStringTag` method returns "[object type]", where type is the
* object type.
*
* @param {*} value The object of which to get the object type string.
* @return {string} The object type string.
* @example
* var o = new Object();
*
* toStringTag(o); // returns '[object Object]'
*/
module.exports = function toStringTag(value) {
if (isNull(value)) {
return nullTag;
}
if (isUndefined(value)) {
return undefTag;
}
return toStr.call(value);
};
}());
},{"lodash.isnull":9,"validate.io-undefined":14}],13:[function(_dereq_,module,exports){
/**
* @file
* <a href="https://travis-ci.org/Xotic750/to-string-x"
* title="Travis status">
* <img src="https://travis-ci.org/Xotic750/to-string-x.svg?branch=master"
* alt="Travis status" height="18">
* </a>
* <a href="https://david-dm.org/Xotic750/to-string-x"
* title="Dependency status">
* <img src="https://david-dm.org/Xotic750/to-string-x.svg"
* alt="Dependency status" height="18"/>
* </a>
* <a href="https://david-dm.org/Xotic750/to-string-x#info=devDependencies"
* title="devDependency status">
* <img src="https://david-dm.org/Xotic750/to-string-x/dev-status.svg"
* alt="devDependency status" height="18"/>
* </a>
* <a href="https://badge.fury.io/js/to-string-x" title="npm version">
* <img src="https://badge.fury.io/js/to-string-x.svg"
* alt="npm version" height="18">
* </a>
* An array of the ES5 whitespace char codes, string, and their descriptions.
*
* ES6-compliant shim for ToString.
*
* Requires ES3 or above.
*
* @see {@link http://www.ecma-international.org/ecma-262/6.0/#sec-tostring|7.1.12 ToString ( argument )}
*
* @version 1.2.0
* @author Xotic750 <Xotic750@gmail.com>
* @copyright Xotic750
* @license {@link <https://opensource.org/licenses/MIT> MIT}
* @module to-string-x
* @name list
* @type Array.<Object>
* @example
* var whiteSpace = require('white-space-x');
* whiteSpaces.list.foreach(function (item) {
* console.log(lib.description, item.code, item.string);
* });
*/
var list = [
{
code: 0x0009,
description: 'Tab',
string: '\u0009'
},
{
code: 0x000a,
description: 'Line Feed',
string: '\u000a'
},
{
code: 0x000b,
description: 'Vertical Tab',
string: '\u000b'
},
{
code: 0x000c,
description: 'Form Feed',
string: '\u000c'
},
{
code: 0x000d,
description: 'Carriage Return',
string: '\u000d'
},
{
code: 0x0020,
description: 'Space',
string: '\u0020'
},
/*
{
code: 0x0085,
description: 'Next line - Not ES5 whitespace',
string: '\u0085'
}
*/
{
code: 0x00a0,
description: 'No-break space',
string: '\u00a0'
},
{
code: 0x1680,
description: 'Ogham space mark',
string: '\u1680'
},
{
code: 0x180e,
description: 'Mongolian vowel separator',
string: '\u180e'
},
{
code: 0x2000,
description: 'En quad',
string: '\u2000'
},
{
code: 0x2001,
description: 'Em quad',
string: '\u2001'
},
{
code: 0x2002,
description: 'En space',
string: '\u2002'
},
{
code: 0x2003,
description: 'Em space',
string: '\u2003'
},
{
code: 0x2004,
description: 'Three-per-em space',
string: '\u2004'
},
{
code: 0x2005,
description: 'Four-per-em space',
string: '\u2005'
},
{
code: 0x2006,
description: 'Six-per-em space',
string: '\u2006'
},
{
code: 0x2007,
description: 'Figure space',
string: '\u2007'
},
{
code: 0x2008,
description: 'Punctuation space',
string: '\u2008'
},
{
code: 0x2009,
description: 'Thin space',
string: '\u2009'
},
{
code: 0x200a,
description: 'Hair space',
string: '\u200a'
},
/*
{
code: 0x200b,
description: 'Zero width space - Not ES5 whitespace',
string: '\u200b'
},
*/
{
code: 0x2028,
description: 'Line separator',
string: '\u2028'
},
{
code: 0x2029,
description: 'Paragraph separator',
string: '\u2029'
},
{
code: 0x202f,
description: 'Narrow no-break space',
string: '\u202f'
},
{
code: 0x205f,
description: 'Medium mathematical space',
string: '\u205f'
},
{
code: 0x3000,
description: 'Ideographic space',
string: '\u3000'
},
{
code: 0xfeff,
description: 'Byte Order Mark',
string: '\ufeff'
}
];
/* eslint strict: 1 */
var string = '';
forEach(list, function reducer(item) {
string += item.string;
});
/* global module */
;(function () { // eslint-disable-line no-extra-semi
'use strict';
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.
* @return {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
*/
module.exports = function ToString(value) {
if (isSymbol(value)) {
throw new TypeError('Cannot convert a Symbol value to a string');
}
return String(value);
};
}());
},{"is-symbol":8}],14:[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;
},{}],15:[function(_dereq_,module,exports){
/**
* @file
* <a href="https://travis-ci.org/Xotic750/white-space-x"
* title="Travis status">
* <img src="https://travis-ci.org/Xotic750/white-space-x.svg?branch=master"
* alt="Travis status" height="18">
* </a>
* <a href="https://david-dm.org/Xotic750/white-space-x"
* title="Dependency status">
* <img src="https://david-dm.org/Xotic750/white-space-x.svg"
* alt="Dependency status" height="18"/>
* </a>
* <a href="https://david-dm.org/Xotic750/white-space-x#info=devDependencies"
* title="devDependency status">
* <img src="https://david-dm.org/Xotic750/white-space-x/dev-status.svg"
* alt="devDependency status" height="18"/>
* </a>
* <a href="https://badge.fury.io/js/white-space-x" title="npm version">
* <img src="https://badge.fury.io/js/white-space-x.svg"
* alt="npm version" height="18">
* </a>
* A string of the ES5 whitespace characters.
*
* List of ECMAScript5 white space characters.
*
* @version 1.2.0
* @author Xotic750 <Xotic750@gmail.com>
* @copyright Xotic750
* @license {@link <https://opensource.org/licenses/MIT> MIT}
* @module white-space-x
* @name string
* @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.string + ']+$)');
* re1.test(ws); // true
*/
module.exports = {
list: list,
string: string
};
/* eslint strict: 1, max-len:1 */
/* global module */
;(function () { // eslint-disable-line no-extra-semi
'use strict';
var define = _dereq_('define-properties-x');
var forEach = _dereq_('foreach');
/**
* An array of the whitespace char codes.
*
* @name whiteSpaces
* @type Array.<number>
* @property {number} 0 0x0009 // Tab
* @property {number} 1 0x000a // Line Feed
* @property {number} 2 0x000b // Vertical Tab
* @property {number} 3 0x000c // Form Feed
* @property {number} 4 0x000d // Carriage Return
* @property {number} 5 0x0020 // Space
* @property {number} 6 0x00a0 // No-break space
* @property {number} 7 0x1680 // Ogham space mark
* @property {number} 8 0x180e // Mongolian vowel separator
* @property {number} 9 0x2000 // En quad
* @property {number} 10 0x2001 // Em quad
* @property {number} 11 0x2002 // En space
* @property {number} 12 0x2003 // Em space
* @property {number} 13 0x2004 // Three-per-em space
* @property {number} 14 0x2005 // Four-per-em space
* @property {number} 15 0x2006 // Six-per-em space
* @property {number} 16 0x2007 // Figure space
* @property {number} 17 0x2008 // Punctuation space
* @property {number} 18 0x2009 // Thin space
* @property {number} 19 0x200a // Hair space
* @property {number} 20 0x2028 // Line separator
* @property {number} 21 0x2029 // Paragraph separator
* @property {number} 22 0x202f // Narrow no-break space
* @property {number} 23 0x205f // Medium mathematical space
* @property {number} 24 0x3000 // Ideographic space
* @property {number} 25 0xfeff // Byte Order Mark
* @example
* var lib = require('white-space-x');
* var count = 0x110000;
* var nws = ''; // A string of all the non-whitepaces
* do {
* count -= 1;
* if (lib.whiteSpaces.indexOf(count) < 0) {
* nws = String.fromCodePoint(count) + nws;
* }
* } while (count);
*/
define.property(module.exports, 'whiteSpaces', [
0x0009, // Tab
0x000a, // Line Feed
0x000b, // Vertical Tab
0x000c, // Form Feed
0x000d, // Carriage Return
0x0020, // Space
// 0x0085, // Next line - Not ES5 whitespace
0x00a0, // No-break space
0x1680, // Ogham space mark
0x180e, // Mongolian vowel separator
0x2000, // En quad
0x2001, // Em quad
0x2002, // En space
0x2003, // Em space
0x2004, // Three-per-em space
0x2005, // Four-per-em space
0x2006, // Six-per-em space
0x2007, // Figure space
0x2008, // Punctuation space
0x2009, // Thin space
0x200a, // Hair space
// 0x200b, // Zero width space - Not ES5 whitespace
0x2028, // Line separator
0x2029, // Paragraph separator
0x202f, // Narrow no-break space
0x205f, // Medium mathematical space
0x3000, // Ideographic space
0xfeff // Byte Order Mark
]);
var wsString = '';
forEach(module.exports.whiteSpaces, function (item) {
wsString += String.fromCharCode(item);
});
/**
* A string of the whitespace characters.
*
* @name ws
* @type string
* @default \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
* @example
* var lib = require('white-space-x');
* var ws = '\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 re1 = new RegExp('^[' + lib.ws + ']+$)');
* re1.test(ws); // true
*/
define.property(module.exports, 'ws', wsString);
}());
},{"define-properties-x":2,"foreach":3}]},{},[1])(1)
},{"for-each":2}]},{},[1])(1)
});

@@ -1,2 +0,26 @@

!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.returnExports=t()}}(function(){return function e(t,r,n){function s(i,c){if(!r[i]){if(!t[i]){var u="function"==typeof require&&require;if(!c&&u)return u(i,!0);if(o)return o(i,!0);var f=new Error("Cannot find module '"+i+"'");throw f.code="MODULE_NOT_FOUND",f}var l=r[i]={exports:{}};t[i][0].call(l.exports,function(e){var r=t[i][1][e];return s(r||e)},l,l.exports,e,t,r,n)}return r[i].exports}for(var o="function"==typeof require&&require,i=0;i<n.length;i++)s(n[i]);return s}({1:[function(t,e,r){!function(){"use strict";var r=t("to-string-x"),n=t("white-space-x").ws,o=new RegExp("^["+n+"]+");e.exports=function trimLeft(t){return r(t).replace(o,"")}}()},{"to-string-x":13,"white-space-x":15}],2:[function(t,e,r){!function(){"use strict";var r=t("has-symbol-support-x"),n=t("is-function-x"),o=t("validate.io-undefined"),i=t("foreach"),c=n(Object.keys)?Object.keys:t("object-keys"),u=n(Object.getOwnPropertySymbols)&&Object.getOwnPropertySymbols,s=n(Object.defineProperty)&&Object.defineProperty,f=Boolean(s)&&function(){var t={};try{s(t,"x",{enumerable:!1,value:t});for(var e in t)return!1;return t.x===t}catch(t){return!1}}(),l=function(t,e,r,n){e in t&&!n||(f?s(t,e,{configurable:!0,enumerable:!1,value:r,writable:!0}):t[e]=r)},a=function(t,e,s){var f=o(s)?{}:s,a=c(e);r&&u&&(a=a.concat(u(e))),i(a,function(r){var o=f[r];l(t,r,e[r],n(o)&&o())})};a(e.exports,{properties:a,property:l,supportsDescriptors:f})}()},{foreach:3,"has-symbol-support-x":4,"is-function-x":6,"object-keys":10,"validate.io-undefined":14}],3:[function(t,e,r){var n=Object.prototype.hasOwnProperty,o=Object.prototype.toString;e.exports=function forEach(t,e,r){if("[object Function]"!==o.call(e))throw new TypeError("iterator must be a function");var i=t.length;if(i===+i)for(var c=0;c<i;c++)e.call(r,t[c],c,t);else for(var u in t)n.call(t,u)&&e.call(r,t[u],u,t)}},{}],4:[function(t,e,r){!function(){"use strict";e.exports="function"==typeof Symbol&&"symbol"==typeof Symbol()}()},{}],5:[function(t,e,r){!function(){"use strict";e.exports=t("has-symbol-support-x")&&"symbol"==typeof Symbol.toStringTag}()},{"has-symbol-support-x":4}],6:[function(t,e,r){!function(){"use strict";var r=Function.prototype.toString,n=t("to-string-tag-x"),o=t("has-to-string-tag-x"),i=t("is-primitive"),c=function funcToString(t){try{return r.call(t),!0}catch(t){}return!1};e.exports=function isFunction(t){if(i(t))return!1;if(o)return c(t);var e=n(t);return"[object Function]"===e||"[object GeneratorFunction]"===e||"[object AsyncFunction]"===e}}()},{"has-to-string-tag-x":5,"is-primitive":7,"to-string-tag-x":12}],7:[function(t,e,r){"use strict";e.exports=function isPrimitive(t){return null==t||"function"!=typeof t&&"object"!=typeof t}},{}],8:[function(t,e,r){"use strict";var n=Object.prototype.toString;if("function"==typeof Symbol&&"symbol"==typeof Symbol()){var o=Symbol.prototype.toString,i=/^Symbol\(.*\)$/,c=function isSymbolObject(t){return"symbol"==typeof t.valueOf()&&i.test(o.call(t))};e.exports=function isSymbol(t){if("symbol"==typeof t)return!0;if("[object Symbol]"!==n.call(t))return!1;try{return c(t)}catch(t){return!1}}}else e.exports=function isSymbol(t){return!1}},{}],9:[function(t,e,r){function isNull(t){return null===t}e.exports=isNull},{}],10:[function(t,e,r){"use strict";var n=Object.prototype.hasOwnProperty,o=Object.prototype.toString,i=Array.prototype.slice,c=t("./isArguments"),u=Object.prototype.propertyIsEnumerable,s=!u.call({toString:null},"toString"),f=u.call(function(){},"prototype"),l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],a=function(t){var e=t.constructor;return e&&e.prototype===t},p={$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},y=function(){if("undefined"==typeof window)return!1;for(var t in window)try{if(!p["$"+t]&&n.call(window,t)&&null!==window[t]&&"object"==typeof window[t])try{a(window[t])}catch(t){return!0}}catch(t){return!0}return!1}(),b=function(t){if("undefined"==typeof window||!y)return a(t);try{return a(t)}catch(t){return!1}},d=function keys(t){var e=null!==t&&"object"==typeof t,r="[object Function]"===o.call(t),i=c(t),u=e&&"[object String]"===o.call(t),a=[];if(!e&&!r&&!i)throw new TypeError("Object.keys called on a non-object");var p=f&&r;if(u&&t.length>0&&!n.call(t,0))for(var y=0;y<t.length;++y)a.push(String(y));if(i&&t.length>0)for(var d=0;d<t.length;++d)a.push(String(d));else for(var g in t)p&&"prototype"===g||!n.call(t,g)||a.push(String(g));if(s)for(var h=b(t),m=0;m<l.length;++m)h&&"constructor"===l[m]||!n.call(t,l[m])||a.push(l[m]);return a};d.shim=function shimObjectKeys(){if(Object.keys){if(!function(){return 2===(Object.keys(arguments)||"").length}(1,2)){var t=Object.keys;Object.keys=function keys(e){return t(c(e)?i.call(e):e)}}}else Object.keys=d;return Object.keys||d},e.exports=d},{"./isArguments":11}],11:[function(t,e,r){"use strict";var n=Object.prototype.toString;e.exports=function isArguments(t){var e=n.call(t),r="[object Arguments]"===e;return r||(r="[object Array]"!==e&&null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Function]"===n.call(t.callee)),r}},{}],12:[function(t,e,r){!function(){"use strict";var r=t("lodash.isnull"),n=t("validate.io-undefined"),o=Object.prototype.toString;e.exports=function toStringTag(t){return r(t)?"[object Null]":n(t)?"[object Undefined]":o.call(t)}}()},{"lodash.isnull":9,"validate.io-undefined":14}],13:[function(t,e,r){!function(){"use strict";var r=t("is-symbol");e.exports=function ToString(t){if(r(t))throw new TypeError("Cannot convert a Symbol value to a string");return String(t)}}()},{"is-symbol":8}],14:[function(t,e,r){"use strict";function isUndefined(t){return void 0===t}e.exports=isUndefined},{}],15:[function(t,e,r){!function(){"use strict";var r=t("define-properties-x"),n=t("foreach");r.property(e.exports,"whiteSpaces",[9,10,11,12,13,32,160,5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288,65279]);var o="";n(e.exports.whiteSpaces,function(t){o+=String.fromCharCode(t)}),r.property(e.exports,"ws",o)}()},{"define-properties-x":2,foreach:3}]},{},[1])(1)});
//# sourceMappingURL=lib/trim-left-x.map
!function(f){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=f();else if("function"==typeof define&&define.amd)define([],f);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).returnExports=f()}}(function(){return function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a="function"==typeof require&&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||e)},l,l.exports,e,t,n,r)}return n[o].exports}for(var i="function"==typeof require&&require,o=0;o<r.length;o++)s(r[o]);return s}({1:[function(_dereq_,module,exports){/**
* @file This method removes whitespace from the left end of a string.
* @version 1.3.0
* @author Xotic750 <Xotic750@gmail.com>
* @copyright Xotic750
* @license {@link <https://opensource.org/licenses/MIT> MIT}
* @module trim-left-x
*/
"use strict";var $toString=_dereq_("to-string-x"),reLeft=new RegExp("^["+_dereq_("white-space-x").string+"]+");module.exports=function trimLeft(string){return $toString(string).replace(reLeft,"")}},{"to-string-x":5,"white-space-x":6}],2:[function(_dereq_,module,exports){function forEachArray(array,iterator,context){for(var i=0,len=array.length;i<len;i++)hasOwnProperty.call(array,i)&&iterator.call(context,array[i],i,array)}function forEachString(string,iterator,context){for(var i=0,len=string.length;i<len;i++)iterator.call(context,string.charAt(i),i,string)}function forEachObject(object,iterator,context){for(var k in object)hasOwnProperty.call(object,k)&&iterator.call(context,object[k],k,object)}var isFunction=_dereq_("is-function");module.exports=function forEach(list,iterator,context){if(!isFunction(iterator))throw new TypeError("iterator must be a function");arguments.length<3&&(context=this),"[object Array]"===toString.call(list)?forEachArray(list,iterator,context):"string"==typeof list?forEachString(list,iterator,context):forEachObject(list,iterator,context)};var toString=Object.prototype.toString,hasOwnProperty=Object.prototype.hasOwnProperty},{"is-function":3}],3:[function(_dereq_,module,exports){module.exports=function isFunction(fn){var string=toString.call(fn);return"[object Function]"===string||"function"==typeof fn&&"[object RegExp]"!==string||"undefined"!=typeof window&&(fn===window.setTimeout||fn===window.alert||fn===window.confirm||fn===window.prompt)};var toString=Object.prototype.toString},{}],4:[function(_dereq_,module,exports){"use strict";var toStr=Object.prototype.toString;if("function"==typeof Symbol&&"symbol"==typeof Symbol()){var symToStr=Symbol.prototype.toString,symStringRegex=/^Symbol\(.*\)$/,isSymbolObject=function isSymbolObject(value){return"symbol"==typeof value.valueOf()&&symStringRegex.test(symToStr.call(value))};module.exports=function isSymbol(value){if("symbol"==typeof value)return!0;if("[object Symbol]"!==toStr.call(value))return!1;try{return isSymbolObject(value)}catch(e){return!1}}}else module.exports=function isSymbol(value){return!1}},{}],5:[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.0
* @author Xotic750 <Xotic750@gmail.com>
* @copyright Xotic750
* @license {@link <https://opensource.org/licenses/MIT> MIT}
* @module to-string-x
*/
"use strict";var isSymbol=_dereq_("is-symbol");module.exports=function ToString(value){if(isSymbol(value))throw new TypeError("Cannot convert a Symbol value to a string");return String(value)}},{"is-symbol":4}],6:[function(_dereq_,module,exports){/**
* @file List of ECMAScript5 white space characters.
* @version 2.0.0
* @author Xotic750 <Xotic750@gmail.com>
* @copyright Xotic750
* @license {@link <https://opensource.org/licenses/MIT> MIT}
* @module white-space-x
*/
"use strict";var list=[{code:9,description:"Tab",string:"\t"},{code:10,description:"Line Feed",string:"\n"},{code:11,description:"Vertical Tab",string:"\x0B"},{code:12,description:"Form Feed",string:"\f"},{code:13,description:"Carriage Return",string:"\r"},{code:32,description:"Space",string:" "},{code:160,description:"No-break space",string:"\xa0"},{code:5760,description:"Ogham space mark",string:"\u1680"},{code:6158,description:"Mongolian vowel separator",string:"\u180e"},{code:8192,description:"En quad",string:"\u2000"},{code:8193,description:"Em quad",string:"\u2001"},{code:8194,description:"En space",string:"\u2002"},{code:8195,description:"Em space",string:"\u2003"},{code:8196,description:"Three-per-em space",string:"\u2004"},{code:8197,description:"Four-per-em space",string:"\u2005"},{code:8198,description:"Six-per-em space",string:"\u2006"},{code:8199,description:"Figure space",string:"\u2007"},{code:8200,description:"Punctuation space",string:"\u2008"},{code:8201,description:"Thin space",string:"\u2009"},{code:8202,description:"Hair space",string:"\u200a"},{code:8232,description:"Line separator",string:"\u2028"},{code:8233,description:"Paragraph separator",string:"\u2029"},{code:8239,description:"Narrow no-break space",string:"\u202f"},{code:8287,description:"Medium mathematical space",string:"\u205f"},{code:12288,description:"Ideographic space",string:"\u3000"},{code:65279,description:"Byte Order Mark",string:"\ufeff"}],string="";_dereq_("for-each")(list,function reducer(item){string+=item.string}),module.exports={list:list,string:string}},{"for-each":2}]},{},[1])(1)});
{
"name": "trim-left-x",
"version": "1.2.0",
"version": "1.3.0",
"description": "This method removes whitespace from the left end of a string.",

@@ -32,36 +32,58 @@ "homepage": "https://github.com/Xotic750/trim-left-x",

"dependencies": {
"to-string-x": "^1.2.0",
"white-space-x": "^1.2.0"
"to-string-x": "^1.4.0",
"white-space-x": "^2.0.0"
},
"devDependencies": {
"@ljharb/eslint-config": "^11.0.0",
"browserify": "^14.1.0",
"@xotic750/eslint-config-standard-x": "^2.2.1",
"browserify": "^14.4.0",
"browserify-derequire": "^0.9.4",
"cross-env": "^5.0.1",
"es5-shim": "^4.5.9",
"es6-shim": "^0.35.3",
"es7-shim": "^6.0.0",
"eslint": "^3.18.0",
"eslint-plugin-import": "^2.2.0",
"eslint": "^4.2.0",
"eslint-plugin-compat": "^1.0.4",
"eslint-plugin-css-modules": "^2.7.2",
"eslint-plugin-eslint-comments": "^1.0.2",
"eslint-plugin-jsdoc": "^3.1.1",
"eslint-plugin-json": "^1.2.0",
"eslint-plugin-no-use-extend-native": "^0.3.12",
"husky": "^0.13.4",
"jasmine-node": "^1.14.5",
"jsdoc-to-markdown": "^3.0.0",
"json3": "^3.3.2",
"make-jasmine-spec-runner-html": "^1.1.0",
"make-jasmine-spec-runner-html": "^1.3.0",
"ncp": "^2.0.0",
"nodemon": "^1.11.0",
"nsp": "^2.6.3",
"replace-x": "^1.1.1",
"uglify-js": "^2.8.18"
"parallelshell": "^3.0.1",
"replace-x": "^1.5.0",
"rimraf": "^2.6.1",
"serve": "^6.0.2",
"uglify-js": "^3.0.24"
},
"scripts": {
"build": "npm run build:setver && npm run security && npm run eslint && npm run browserify && npm run uglify && npm run docs && npm run build:jasmine && npm test",
"build:jasmine": "make-jasmine-spec-runner-html",
"build:setver": "PKG_VER=$(node -p -e \"require('./package.json').version\") && replace-x \" @version .*\" \" @version ${PKG_VER}\" index.js",
"build:watch": "nodemon --watch index.js --watch package.json --exec 'npm run build'",
"docs": "jsdoc2md --name-format --example-lang js index.js > README.md",
"eslint": "eslint *.js tests/spec/*.js",
"clean": "rimraf README.md lib/*",
"clean:jasmine": "rimraf tests/index.html tests/run.js",
"clean:all": "npm run clean:jasmine && npm run clean",
"build": "npm run clean && npm run lint && npm run browserify && npm run uglify && npm run docs && npm test && npm run security",
"build:jasmine": "npm run clean:jasmine && make-jasmine-spec-runner-html",
"build:setver": "replace-x \" @version .*\" \" @version $(node -p -e \"require('./package.json').version\")\" index.js",
"build:name": "replace-x \" @module .*\" \" @module $(node -p -e \"require('./package.json').name\")\" index.js",
"build:description": "replace-x \" @file .*\" \" @file $(node -p -e \"require('./package.json').description\")\" index.js",
"build:replace": "npm run build:setver && npm run build:name && npm run build:description",
"production": "npm run clean:all && npm run build:jasmine && npm run build:replace && npm run build",
"start": "parallelshell \"serve\" \"nodemon --watch index.js --exec 'npm run build'\"",
"docs:name": "replace-x \"@{PACKAGE-NAME}\" \"$(node -p -e \"require('./package.json').name\")\" README.md",
"docs:badges": "ncp badges.html README.md && npm run docs:name",
"docs": "npm run docs:badges && jsdoc2md --name-format --example-lang js index.js >> README.md",
"lint": "eslint *.js tests/spec/*.js",
"lint-fix": "npm run lint -- --fix",
"security": "nsp check",
"test": "jasmine-node --matchall tests/spec/",
"test:watch": "nodemon --watch tests/spec/test.js --exec 'npm test'",
"browserify": "browserify -p browserify-derequire -e index.js -o lib/trim-left-x.js -u 'crypto' -s returnExports",
"uglify": "uglifyjs lib/trim-left-x.js -o lib/trim-left-x.min.js --compress --keep-fnames --mangle --beautify ascii_only=true,beautify=false --source-map lib/trim-left-x.map"
"uglify": "uglifyjs lib/trim-left-x.js -o lib/trim-left-x.min.js --config-file .uglifyjsrc.json",
"precommit": "npm run production",
"prepush": "npm run production"
}
}

@@ -1,31 +0,27 @@

<a name="module_trim-left-x"></a>
## trim-left-x
<a href="https://travis-ci.org/Xotic750/trim-left-x"
title="Travis status">
title="Travis status">
<img
src="https://travis-ci.org/Xotic750/trim-left-x.svg?branch=master"
alt="Travis status" height="18">
src="https://travis-ci.org/Xotic750/trim-left-x.svg?branch=master"
alt="Travis status" height="18"/>
</a>
<a href="https://david-dm.org/Xotic750/trim-left-x"
title="Dependency status">
title="Dependency status">
<img src="https://david-dm.org/Xotic750/trim-left-x.svg"
alt="Dependency status" height="18"/>
alt="Dependency status" height="18"/>
</a>
<a
href="https://david-dm.org/Xotic750/trim-left-x#info=devDependencies"
title="devDependency status">
<a href="https://david-dm.org/Xotic750/trim-left-x#info=devDependencies"
title="devDependency status">
<img src="https://david-dm.org/Xotic750/trim-left-x/dev-status.svg"
alt="devDependency status" height="18"/>
alt="devDependency status" height="18"/>
</a>
<a href="https://badge.fury.io/js/trim-left-x" title="npm version">
<img src="https://badge.fury.io/js/trim-left-x.svg"
alt="npm version" height="18">
alt="npm version" height="18"/>
</a>
<a name="module_trim-left-x"></a>
## trim-left-x
This method removes whitespace from the left end of a string.
Requires ES3 or above.
**Version**: 1.2.0
**Version**: 1.3.0
**Author**: Xotic750 <Xotic750@gmail.com>

@@ -37,3 +33,3 @@ **License**: [MIT](&lt;https://opensource.org/licenses/MIT&gt;)

### `module.exports(string)` ⇒ <code>undefined</code> \| <code>string</code> ⏏
This method removes whitespace from the left end of a string
This method removes whitespace from the left end of a string.

@@ -45,3 +41,3 @@ **Kind**: Exported function

| --- | --- | --- |
| string | <code>String</code> | The string to trim the left end whitespace from. |
| string | <code>string</code> | The string to trim the left end whitespace from. |

@@ -48,0 +44,0 @@ **Example**

@@ -1,50 +0,35 @@

/* jslint maxlen:80, es6:true, white:true */
'use strict';
/* jshint bitwise:true, camelcase:true, curly:true, eqeqeq:true, forin:true,
freeze:true, futurehostile:true, latedef:true, newcap:true, nocomma:true,
nonbsp:true, singleGroups:true, strict:true, undef:true, unused:true,
es3:false, esnext:true, plusplus:true, maxparams:1, maxdepth:2,
maxstatements:12, maxcomplexity:4 */
/* eslint strict: 1, max-statements: 1, max-nested-callbacks: 1 */
/* global JSON:true, expect, module, require, describe, it, returnExports */
;(function () { // eslint-disable-line no-extra-semi
'use strict';
var trimLeft;
if (typeof module === 'object' && module.exports) {
require('es5-shim');
require('es5-shim/es5-sham');
if (typeof JSON === 'undefined') {
JSON = {};
var trimLeft;
if (typeof module === 'object' && module.exports) {
require('es5-shim');
require('es5-shim/es5-sham');
if (typeof JSON === 'undefined') {
JSON = {};
}
require('json3').runInContext(null, JSON);
require('es6-shim');
var es7 = require('es7-shim');
Object.keys(es7).forEach(function (key) {
var obj = es7[key];
if (typeof obj.shim === 'function') {
obj.shim();
}
require('json3').runInContext(null, JSON);
require('es6-shim');
var es7 = require('es7-shim');
Object.keys(es7).forEach(function (key) {
var obj = es7[key];
if (typeof obj.shim === 'function') {
obj.shim();
}
});
trimLeft = require('../../index.js');
} else {
trimLeft = returnExports;
}
});
trimLeft = require('../../index.js');
} else {
trimLeft = returnExports;
}
describe('trimLeft', function () {
it('Basic tests', function () {
var rest = 'a \t\n';
expect(trimLeft(' \t\n' + rest)).toBe(rest, 'strips whitespace off the left side');
expect(trimLeft('a')).toBe('a', 'noop when no whitespace');
var allWhitespaceChars = '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
rest = 'a' + allWhitespaceChars;
expect(trimLeft(allWhitespaceChars + rest)).toBe(rest, 'all expected whitespace chars are trimmed');
var zeroWidth = '\u200b';
expect(trimLeft(zeroWidth)).toBe(zeroWidth, 'zero width space does not trim');
});
describe('trimLeft', function () {
it('Basic tests', function () {
var rest = 'a \t\n';
expect(trimLeft(' \t\n' + rest)).toBe(rest, 'strips whitespace off the left side');
expect(trimLeft('a')).toBe('a', 'noop when no whitespace');
var allWhitespaceChars = '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
rest = 'a' + allWhitespaceChars;
expect(trimLeft(allWhitespaceChars + rest)).toBe(rest, 'all expected whitespace chars are trimmed');
var zeroWidth = '\u200b';
expect(trimLeft(zeroWidth)).toBe(zeroWidth, 'zero width space does not trim');
});
}());
});

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc