How to use the mout.lang 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 EveryBit-com / everybit.js / client-angular / node_modules / bower / node_modules / bower-config / lib / util / expand.js View on Github external
mout.object.forOwn(config, function (value, key) {
        // Ignore null values
        if (value == null) {
            return;
        }

        key = mout.string.camelCase(key.replace(/_/g, '-'));
        camelCased[key] = mout.lang.isPlainObject(value) ? camelCase(value) : value;
    });
github aerisweather / aerisjs / node_modules / bower / lib / core / Project.js View on Github external
.spread(function (json, installed, links) {
        var root;
        var jsonCopy = mout.lang.deepClone(json);

        root = {
            name: json.name,
            source: this._config.cwd,
            target: json.version || '*',
            pkgMeta: jsonCopy,
            canonicalDir: this._config.cwd,
            root: true
        };

        mout.object.mixIn(installed, links);

        // Mix direct extraneous as dependencies
        // (dependencies installed without --save/--save-dev)
        jsonCopy.dependencies = jsonCopy.dependencies || {};
        jsonCopy.devDependencies = jsonCopy.devDependencies || {};
github roboshoes / grunt-bake / tasks / bake.js View on Github external
// warning about removed parameter

		if ( options.transformGutter !== undefined ) {
			grunt.log.error( "Parameter `transformGutter` is no longer supported and defaults to `|`. See #71 for details." );
		}

		// normalize basePath

		if ( options.basePath.substr( -1 , 1 ) !== "/" && options.basePath.length > 0 ) {
			options.basePath = options.basePath + "/";
		}

		// normalize content

		if ( mout.lang.isString( options.content ) ) {
			options.content = grunt.file.readJSON( options.content );
		} else if ( mout.lang.isFunction( options.content ) ) {
			options.content = options.content();
		} else {
			options.content = options.content ? options.content : {};
		}

		if ( options.section ) {

			if ( ! options.content[ options.section ] ) {
				grunt.log.error( "content doesn't have section " + options.section );
			}

			options.content = options.content[ options.section ];
		}
github roboshoes / grunt-bake / tasks / bake.js View on Github external
function getArrayValues( string, values ) {

			string = string.split( " " ).join( "" );

			if ( arrayRegex.test( string ) )
				return string.match( arrayRegex )[ 1 ].split( "," );

			else {
				var array = processPlaceholder( string, values );
				if ( ! mout.lang.isArray( array ) ) array = [];

				return array;
			}

		}
github 2fd / jspm-bower-endpoint / lib / adapters / PackageAdapter.js View on Github external
PackageAdapter.parseAuthorProperty = function(authors){

    authors= mout.lang.toArray(authors);

    if(authors.length === 1)
        return resolvePeopleFields(authors[0]);

    return;
};
github 2fd / jspm-bower-endpoint / lib / adapters / PackageAdapter.js View on Github external
PackageAdapter.parseFormatProperty = function(moduleType){

    var contains = mout.array.contains;
    moduleType = mout.lang.toArray(moduleType);

    if(contains(moduleType, 'node') || contains(moduleType, 'cjs'))
        return 'cjs';

    if(contains(moduleType, 'amd'))
        return 'amd';

    if(contains(moduleType, 'globals') || contains(moduleType, 'global'))
        return 'global';

    if(contains(moduleType, 'es6'))
        return 'es6';

    return 'global';

};
github bower / bower / lib / commands / init.js View on Github external
function validConfigValue(val) {
    return (
        mout.lang.isObject(val) ||
        mout.lang.isArray(val) ||
        mout.lang.isString(val) ||
        mout.lang.isBoolean(val) ||
        mout.lang.isNumber(val)
    );
}
github roboshoes / grunt-shared-config / tasks / shared-config.js View on Github external
function resolveNested( data, parentKey ) {
				var name, key;
				for ( key in data ) {
					if ( data.hasOwnProperty( key ) ) {
						name = parentKey ? format( parentKey + "-" + key, options.cssFormat ) : format( key, options.cssFormat );

						if ( mout.lang.isObject( data[ key ] ) ) {

							resolveNested( data[ key ], name );

						} else {

							var value = getStyleSafeValue( data[ key ] );

							content += pattern.replace( "{{key}}", options.namespace + name ).replace( "{{value}}", value );
						}
					}
				}
			}
github EveryBit-com / everybit.js / client-angular / node_modules / bower / lib / commands / init.js View on Github external
mout.object.forOwn(json, function (value, key) {
        if (value == null || mout.lang.isEmpty(value)) {
            delete json[key];
        }
    });