How to use format - 10 common examples

To help you get started, we’ve selected a few format 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 zeebe-io / zeebe-modeler / client / lib / base / logger.js View on Github external
// fail-safe
  try {
    var ref = args[0];

    if (REF_PATTERN.test(ref)) {
      ref = ref.replace(REF_PATTERN, '');

      args.shift();
    } else {
      ref = null;
    }

    var entry = {
      category: category,
      ref: ref,
      message: format.apply(null, args)
    };

    this.entries.push(entry);
  } catch (e) {
    console.error(e);
  }
};
github codesandbox / codesandbox-client / standalone-packages / vscode-extensions / out / extensions / jpoissonnier.vscode-styled-components-0.0.26 / node_modules / vscode-emmet-helper / out / emmetHelper.js View on Github external
let filtersFromProfile = (profile && profile['filters']) ? profile['filters'].split(',') : [];
    filtersFromProfile = filtersFromProfile.map(filterFromProfile => filterFromProfile.trim());
    // Update profile based on preferences
    if (emmetConfig['preferences']['format.noIndentTags']) {
        if (Array.isArray(emmetConfig['preferences']['format.noIndentTags'])) {
            profile['formatSkip'] = emmetConfig['preferences']['format.noIndentTags'];
        }
        else if (typeof emmetConfig['preferences']['format.noIndentTags'] === 'string') {
            profile['formatSkip'] = emmetConfig['preferences']['format.noIndentTags'].split(',');
        }
    }
    if (emmetConfig['preferences']['format.forceIndentationForTags']) {
        if (Array.isArray(emmetConfig['preferences']['format.forceIndentationForTags'])) {
            profile['formatForce'] = emmetConfig['preferences']['format.forceIndentationForTags'];
        }
        else if (typeof emmetConfig['preferences']['format.forceIndentationForTags'] === 'string') {
            profile['formatForce'] = emmetConfig['preferences']['format.forceIndentationForTags'].split(',');
        }
    }
    if (emmetConfig['preferences']['profile.allowCompactBoolean'] && typeof emmetConfig['preferences']['profile.allowCompactBoolean'] === 'boolean') {
        profile['compactBooleanAttributes'] = emmetConfig['preferences']['profile.allowCompactBoolean'];
    }
    // Fetch Add Ons
    let addons = {};
    if (filter && filter.split(',').find(x => x.trim() === 'bem') || filtersFromProfile.indexOf('bem') > -1) {
        addons['bem'] = { element: '__' };
        if (emmetConfig['preferences']['bem.elementSeparator']) {
            addons['bem']['element'] = emmetConfig['preferences']['bem.elementSeparator'];
        }
        if (emmetConfig['preferences']['bem.modifierSeparator']) {
            addons['bem']['modifier'] = emmetConfig['preferences']['bem.modifierSeparator'];
        }
github microsoft / vscode-emmet-helper / src / emmetHelper.ts View on Github external
// Fetch Profile
	let profile = getProfile(syntax, emmetConfig['syntaxProfiles']);
	let filtersFromProfile: string[] = (profile && profile['filters']) ? profile['filters'].split(',') : [];
	filtersFromProfile = filtersFromProfile.map(filterFromProfile => filterFromProfile.trim());

	// Update profile based on preferences
	if (emmetConfig['preferences']['format.noIndentTags']) {
		if (Array.isArray(emmetConfig['preferences']['format.noIndentTags'])) {
			profile['formatSkip'] = emmetConfig['preferences']['format.noIndentTags'];
		} else if (typeof emmetConfig['preferences']['format.noIndentTags'] === 'string') {
			profile['formatSkip'] = emmetConfig['preferences']['format.noIndentTags'].split(',');
		}

	}
	if (emmetConfig['preferences']['format.forceIndentationForTags']) {
		if (Array.isArray(emmetConfig['preferences']['format.forceIndentationForTags'])) {
			profile['formatForce'] = emmetConfig['preferences']['format.forceIndentationForTags'];
		} else if (typeof emmetConfig['preferences']['format.forceIndentationForTags'] === 'string') {
			profile['formatForce'] = emmetConfig['preferences']['format.forceIndentationForTags'].split(',');
		}
	}
	if (emmetConfig['preferences']['profile.allowCompactBoolean'] && typeof emmetConfig['preferences']['profile.allowCompactBoolean'] === 'boolean') {
		profile['compactBooleanAttributes'] = emmetConfig['preferences']['profile.allowCompactBoolean'];
	}

	// Fetch Add Ons
	let addons = {};
	if (filter && filter.split(',').find(x => x.trim() === 'bem') || filtersFromProfile.indexOf('bem') > -1) {
		addons['bem'] = { element: '__' };
		if (emmetConfig['preferences']['bem.elementSeparator']) {
			addons['bem']['element'] = emmetConfig['preferences']['bem.elementSeparator'];
github codesandbox / codesandbox-client / standalone-packages / vscode-extensions / out / extensions / jpoissonnier.vscode-styled-components-0.0.26 / node_modules / vscode-emmet-helper / out / emmetHelper.js View on Github external
// Fetch Profile
    let profile = getProfile(syntax, emmetConfig['syntaxProfiles']);
    let filtersFromProfile = (profile && profile['filters']) ? profile['filters'].split(',') : [];
    filtersFromProfile = filtersFromProfile.map(filterFromProfile => filterFromProfile.trim());
    // Update profile based on preferences
    if (emmetConfig['preferences']['format.noIndentTags']) {
        if (Array.isArray(emmetConfig['preferences']['format.noIndentTags'])) {
            profile['formatSkip'] = emmetConfig['preferences']['format.noIndentTags'];
        }
        else if (typeof emmetConfig['preferences']['format.noIndentTags'] === 'string') {
            profile['formatSkip'] = emmetConfig['preferences']['format.noIndentTags'].split(',');
        }
    }
    if (emmetConfig['preferences']['format.forceIndentationForTags']) {
        if (Array.isArray(emmetConfig['preferences']['format.forceIndentationForTags'])) {
            profile['formatForce'] = emmetConfig['preferences']['format.forceIndentationForTags'];
        }
        else if (typeof emmetConfig['preferences']['format.forceIndentationForTags'] === 'string') {
            profile['formatForce'] = emmetConfig['preferences']['format.forceIndentationForTags'].split(',');
        }
    }
    if (emmetConfig['preferences']['profile.allowCompactBoolean'] && typeof emmetConfig['preferences']['profile.allowCompactBoolean'] === 'boolean') {
        profile['compactBooleanAttributes'] = emmetConfig['preferences']['profile.allowCompactBoolean'];
    }
    // Fetch Add Ons
    let addons = {};
    if (filter && filter.split(',').find(x => x.trim() === 'bem') || filtersFromProfile.indexOf('bem') > -1) {
        addons['bem'] = { element: '__' };
        if (emmetConfig['preferences']['bem.elementSeparator']) {
            addons['bem']['element'] = emmetConfig['preferences']['bem.elementSeparator'];
        }
        if (emmetConfig['preferences']['bem.modifierSeparator']) {
github codesandbox / codesandbox-client / standalone-packages / vscode-extensions / out / extensions / jpoissonnier.vscode-styled-components-0.0.26 / node_modules / vscode-emmet-helper / out / emmetHelper.js View on Github external
filtersFromProfile = filtersFromProfile.map(filterFromProfile => filterFromProfile.trim());
    // Update profile based on preferences
    if (emmetConfig['preferences']['format.noIndentTags']) {
        if (Array.isArray(emmetConfig['preferences']['format.noIndentTags'])) {
            profile['formatSkip'] = emmetConfig['preferences']['format.noIndentTags'];
        }
        else if (typeof emmetConfig['preferences']['format.noIndentTags'] === 'string') {
            profile['formatSkip'] = emmetConfig['preferences']['format.noIndentTags'].split(',');
        }
    }
    if (emmetConfig['preferences']['format.forceIndentationForTags']) {
        if (Array.isArray(emmetConfig['preferences']['format.forceIndentationForTags'])) {
            profile['formatForce'] = emmetConfig['preferences']['format.forceIndentationForTags'];
        }
        else if (typeof emmetConfig['preferences']['format.forceIndentationForTags'] === 'string') {
            profile['formatForce'] = emmetConfig['preferences']['format.forceIndentationForTags'].split(',');
        }
    }
    if (emmetConfig['preferences']['profile.allowCompactBoolean'] && typeof emmetConfig['preferences']['profile.allowCompactBoolean'] === 'boolean') {
        profile['compactBooleanAttributes'] = emmetConfig['preferences']['profile.allowCompactBoolean'];
    }
    // Fetch Add Ons
    let addons = {};
    if (filter && filter.split(',').find(x => x.trim() === 'bem') || filtersFromProfile.indexOf('bem') > -1) {
        addons['bem'] = { element: '__' };
        if (emmetConfig['preferences']['bem.elementSeparator']) {
            addons['bem']['element'] = emmetConfig['preferences']['bem.elementSeparator'];
        }
        if (emmetConfig['preferences']['bem.modifierSeparator']) {
            addons['bem']['modifier'] = emmetConfig['preferences']['bem.modifierSeparator'];
        }
    }
github microsoft / vscode-emmet-helper / src / emmetHelper.ts View on Github external
let filtersFromProfile: string[] = (profile && profile['filters']) ? profile['filters'].split(',') : [];
	filtersFromProfile = filtersFromProfile.map(filterFromProfile => filterFromProfile.trim());

	// Update profile based on preferences
	if (emmetConfig['preferences']['format.noIndentTags']) {
		if (Array.isArray(emmetConfig['preferences']['format.noIndentTags'])) {
			profile['formatSkip'] = emmetConfig['preferences']['format.noIndentTags'];
		} else if (typeof emmetConfig['preferences']['format.noIndentTags'] === 'string') {
			profile['formatSkip'] = emmetConfig['preferences']['format.noIndentTags'].split(',');
		}

	}
	if (emmetConfig['preferences']['format.forceIndentationForTags']) {
		if (Array.isArray(emmetConfig['preferences']['format.forceIndentationForTags'])) {
			profile['formatForce'] = emmetConfig['preferences']['format.forceIndentationForTags'];
		} else if (typeof emmetConfig['preferences']['format.forceIndentationForTags'] === 'string') {
			profile['formatForce'] = emmetConfig['preferences']['format.forceIndentationForTags'].split(',');
		}
	}
	if (emmetConfig['preferences']['profile.allowCompactBoolean'] && typeof emmetConfig['preferences']['profile.allowCompactBoolean'] === 'boolean') {
		profile['compactBooleanAttributes'] = emmetConfig['preferences']['profile.allowCompactBoolean'];
	}

	// Fetch Add Ons
	let addons = {};
	if (filter && filter.split(',').find(x => x.trim() === 'bem') || filtersFromProfile.indexOf('bem') > -1) {
		addons['bem'] = { element: '__' };
		if (emmetConfig['preferences']['bem.elementSeparator']) {
			addons['bem']['element'] = emmetConfig['preferences']['bem.elementSeparator'];
		}
		if (emmetConfig['preferences']['bem.modifierSeparator']) {
			addons['bem']['modifier'] = emmetConfig['preferences']['bem.modifierSeparator'];
github microsoft / vscode-emmet-helper / src / emmetHelper.ts View on Github external
// Fetch Profile
	let profile = getProfile(syntax, emmetConfig['syntaxProfiles']);
	let filtersFromProfile: string[] = (profile && profile['filters']) ? profile['filters'].split(',') : [];
	filtersFromProfile = filtersFromProfile.map(filterFromProfile => filterFromProfile.trim());

	// Update profile based on preferences
	if (emmetConfig['preferences']['format.noIndentTags']) {
		if (Array.isArray(emmetConfig['preferences']['format.noIndentTags'])) {
			profile['formatSkip'] = emmetConfig['preferences']['format.noIndentTags'];
		} else if (typeof emmetConfig['preferences']['format.noIndentTags'] === 'string') {
			profile['formatSkip'] = emmetConfig['preferences']['format.noIndentTags'].split(',');
		}

	}
	if (emmetConfig['preferences']['format.forceIndentationForTags']) {
		if (Array.isArray(emmetConfig['preferences']['format.forceIndentationForTags'])) {
			profile['formatForce'] = emmetConfig['preferences']['format.forceIndentationForTags'];
		} else if (typeof emmetConfig['preferences']['format.forceIndentationForTags'] === 'string') {
			profile['formatForce'] = emmetConfig['preferences']['format.forceIndentationForTags'].split(',');
		}
	}
	if (emmetConfig['preferences']['profile.allowCompactBoolean'] && typeof emmetConfig['preferences']['profile.allowCompactBoolean'] === 'boolean') {
		profile['compactBooleanAttributes'] = emmetConfig['preferences']['profile.allowCompactBoolean'];
	}

	// Fetch Add Ons
	let addons = {};
	if (filter && filter.split(',').find(x => x.trim() === 'bem') || filtersFromProfile.indexOf('bem') > -1) {
		addons['bem'] = { element: '__' };
		if (emmetConfig['preferences']['bem.elementSeparator']) {
			addons['bem']['element'] = emmetConfig['preferences']['bem.elementSeparator'];
		}
github codesandbox / codesandbox-client / standalone-packages / vscode-extensions / out / extensions / jpoissonnier.vscode-styled-components-0.0.26 / node_modules / vscode-emmet-helper / out / emmetHelper.js View on Github external
}
    // Fetch Profile
    let profile = getProfile(syntax, emmetConfig['syntaxProfiles']);
    let filtersFromProfile = (profile && profile['filters']) ? profile['filters'].split(',') : [];
    filtersFromProfile = filtersFromProfile.map(filterFromProfile => filterFromProfile.trim());
    // Update profile based on preferences
    if (emmetConfig['preferences']['format.noIndentTags']) {
        if (Array.isArray(emmetConfig['preferences']['format.noIndentTags'])) {
            profile['formatSkip'] = emmetConfig['preferences']['format.noIndentTags'];
        }
        else if (typeof emmetConfig['preferences']['format.noIndentTags'] === 'string') {
            profile['formatSkip'] = emmetConfig['preferences']['format.noIndentTags'].split(',');
        }
    }
    if (emmetConfig['preferences']['format.forceIndentationForTags']) {
        if (Array.isArray(emmetConfig['preferences']['format.forceIndentationForTags'])) {
            profile['formatForce'] = emmetConfig['preferences']['format.forceIndentationForTags'];
        }
        else if (typeof emmetConfig['preferences']['format.forceIndentationForTags'] === 'string') {
            profile['formatForce'] = emmetConfig['preferences']['format.forceIndentationForTags'].split(',');
        }
    }
    if (emmetConfig['preferences']['profile.allowCompactBoolean'] && typeof emmetConfig['preferences']['profile.allowCompactBoolean'] === 'boolean') {
        profile['compactBooleanAttributes'] = emmetConfig['preferences']['profile.allowCompactBoolean'];
    }
    // Fetch Add Ons
    let addons = {};
    if (filter && filter.split(',').find(x => x.trim() === 'bem') || filtersFromProfile.indexOf('bem') > -1) {
        addons['bem'] = { element: '__' };
        if (emmetConfig['preferences']['bem.elementSeparator']) {
            addons['bem']['element'] = emmetConfig['preferences']['bem.elementSeparator'];
        }
github microsoft / vscode-emmet-helper / src / emmetHelper.ts View on Github external
filtersFromProfile = filtersFromProfile.map(filterFromProfile => filterFromProfile.trim());

	// Update profile based on preferences
	if (emmetConfig['preferences']['format.noIndentTags']) {
		if (Array.isArray(emmetConfig['preferences']['format.noIndentTags'])) {
			profile['formatSkip'] = emmetConfig['preferences']['format.noIndentTags'];
		} else if (typeof emmetConfig['preferences']['format.noIndentTags'] === 'string') {
			profile['formatSkip'] = emmetConfig['preferences']['format.noIndentTags'].split(',');
		}

	}
	if (emmetConfig['preferences']['format.forceIndentationForTags']) {
		if (Array.isArray(emmetConfig['preferences']['format.forceIndentationForTags'])) {
			profile['formatForce'] = emmetConfig['preferences']['format.forceIndentationForTags'];
		} else if (typeof emmetConfig['preferences']['format.forceIndentationForTags'] === 'string') {
			profile['formatForce'] = emmetConfig['preferences']['format.forceIndentationForTags'].split(',');
		}
	}
	if (emmetConfig['preferences']['profile.allowCompactBoolean'] && typeof emmetConfig['preferences']['profile.allowCompactBoolean'] === 'boolean') {
		profile['compactBooleanAttributes'] = emmetConfig['preferences']['profile.allowCompactBoolean'];
	}

	// Fetch Add Ons
	let addons = {};
	if (filter && filter.split(',').find(x => x.trim() === 'bem') || filtersFromProfile.indexOf('bem') > -1) {
		addons['bem'] = { element: '__' };
		if (emmetConfig['preferences']['bem.elementSeparator']) {
			addons['bem']['element'] = emmetConfig['preferences']['bem.elementSeparator'];
		}
		if (emmetConfig['preferences']['bem.modifierSeparator']) {
			addons['bem']['modifier'] = emmetConfig['preferences']['bem.modifierSeparator'];
		}
github microsoft / vscode-emmet-helper / src / emmetHelper.ts View on Github external
let baseSyntax = isStyleSheet(syntax) ? 'css' : 'html';
	if (!customSnippetRegistry[syntax] && customSnippetRegistry[baseSyntax]) {
		customSnippetRegistry[syntax] = customSnippetRegistry[baseSyntax];
	}

	// Fetch Profile
	let profile = getProfile(syntax, emmetConfig['syntaxProfiles']);
	let filtersFromProfile: string[] = (profile && profile['filters']) ? profile['filters'].split(',') : [];
	filtersFromProfile = filtersFromProfile.map(filterFromProfile => filterFromProfile.trim());

	// Update profile based on preferences
	if (emmetConfig['preferences']['format.noIndentTags']) {
		if (Array.isArray(emmetConfig['preferences']['format.noIndentTags'])) {
			profile['formatSkip'] = emmetConfig['preferences']['format.noIndentTags'];
		} else if (typeof emmetConfig['preferences']['format.noIndentTags'] === 'string') {
			profile['formatSkip'] = emmetConfig['preferences']['format.noIndentTags'].split(',');
		}

	}
	if (emmetConfig['preferences']['format.forceIndentationForTags']) {
		if (Array.isArray(emmetConfig['preferences']['format.forceIndentationForTags'])) {
			profile['formatForce'] = emmetConfig['preferences']['format.forceIndentationForTags'];
		} else if (typeof emmetConfig['preferences']['format.forceIndentationForTags'] === 'string') {
			profile['formatForce'] = emmetConfig['preferences']['format.forceIndentationForTags'].split(',');
		}
	}
	if (emmetConfig['preferences']['profile.allowCompactBoolean'] && typeof emmetConfig['preferences']['profile.allowCompactBoolean'] === 'boolean') {
		profile['compactBooleanAttributes'] = emmetConfig['preferences']['profile.allowCompactBoolean'];
	}

	// Fetch Add Ons
	let addons = {};