Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.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));
};
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)
};
});
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];
}
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://');
}
}
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;
}
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];
}
});
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;
}
exports.camelize = function (name) {
return mout.string.camelCase(name)
}
mout.object.forOwn(noptOptions, function (value, key) {
if (options[key]) {
parsedOptions[mout.string.camelCase(key)] = value;
}
});
exports.hyphenate = function (name) {
return mout.string.replace(mout.string.hyphenate(name), ['_'], '-')
}