How to use the mout.string function in mout

To help you get started, we’ve selected a few mout examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github hw2-archive / upt / src / lib / core / Manager.js View on Github external
.then(function (choice) {
                var pick;

                // Sanitize choice
                choice = choice.trim();
                save = /^!/.test(choice) || /!$/.test(choice);  // Save if prefixed or suffixed with !
                choice = Number(mout.string.trim(choice, '!'));
                pick = picks[choice - 1];

                // Save resolution
                if (save) {
                    this._storeResolution(pick);
                }

                return pick;
            }.bind(this));
};
github roboshoes / grunt-bake / tasks / bake.js View on Github external
var transforms = placeholder.match( transformsRegex ).map( function( str ) {

				// remove whitespace, otherwise transforms and variable key may not be found
				str = mout.string.trim( str );

				// extract name of transform and transform parameters, and clear quotes
				var parts = str.match( paramsRegex ).map( function( str ) {
					return mout.string.trim( str, "'" );
				});

				return {
					name: parts[0],
					params: parts.slice(1)
				};
			});
github bower / bower / lib / renderers / cli.js View on Github external
if (isCompact()) {
        return mout.string.rpad(tag, sizes.tag)[tagColor];
    }

    label = data.origin + '#' + data.endpoint.target;
    length = tag.length + label.length + 1;
    nrSpaces = sizes.tag + sizes.label - length;

    // Ensure at least one space between the label and the tag
    if (nrSpaces < 1) {
        sizes.label = label.length + sizes.sumup;
        nrSpaces = sizes.tag + sizes.label - length;
    }


    return label.green + mout.string.repeat(' ', nrSpaces) + tag[tagColor];
}
github hw2-archive / upt / src / lib / core / resolvers / GitHubResolver.js View on Github external
GitRemoteResolver.call(this, decEndpoint, config, logger);

    // Grab the org/repo
    // /xxxxx/yyyyy.git or :xxxxx/yyyyy.git (.git is optional)
    pair = GitHubResolver.getOrgRepoPair(this._source);
    if (!pair) {
        throw createError('Invalid GitHub URL', 'EINVEND', {
            details: this._source + ' does not seem to be a valid GitHub URL'
        });
    }

    this._org = pair.org;
    this._repo = pair.repo;

    // Ensure trailing for all protocols
    if (!mout.string.endsWith(this._source, '.git')) {
        this._source += '.git';
    }

    // Check if it's public
    this._public = mout.string.startsWith(this._source, 'git://');

    // Use https:// rather than git:// if on a proxy
    if (this._config.proxy || this._config.httpsProxy) {
        this._source = this._source.replace('git://', 'https://');
    }
}
github roboshoes / grunt-shared-config / tasks / shared-config.js View on Github external
function indent( content, indention ) {
			content = content.replace( /\n/g, "\n" + indention );

			while ( mout.string.endsWith( content, options.indention ) ) {
				content = content.substr( 0, content.length - 1 );
			}

			return content;
		}
github EveryBit-com / everybit.js / client-angular / node_modules / bower / lib / core / resolvers / GitResolver.js View on Github external
refs.forEach(function (line) {
            var match = line.match(/^([a-f0-9]{40})\s+refs\/tags\/(\S+)/);

            if (match && !mout.string.endsWith(match[2], '^{}')) {
                tags[match[2]] = match[1];
            }
        });
github roboshoes / grunt-bake / tasks / bake.js View on Github external
content = fragment;

			} else if( !forEachName ) {

				processExtraBake( extraBake, filePath, destFile, values );

				content = linebreak + parse( includeContent, includePath, destFile, values );

			} else {

				content = "";
			}

			if ( assign !== null ) {
				parentValues[ assign ] = mout.string.ltrim( content );

				content = "";
			}

			return content;
		}
github mgnsharon / generator-xd-angular / lib / name-helper.js View on Github external
exports.camelize = function (name) {
  return mout.string.camelCase(name)
}
github irods-contrib / irods-cloud-browser / irods-cloud-frontend / node_modules / bower / lib / util / cli.js View on Github external
mout.object.forOwn(noptOptions, function (value, key) {
        if (options[key]) {
            parsedOptions[mout.string.camelCase(key)] = value;
        }
    });
github mgnsharon / generator-xd-angular / lib / name-helper.js View on Github external
exports.hyphenate = function (name) {
  return mout.string.replace(mout.string.hyphenate(name), ['_'], '-')
}