MCPcopy Create free account
hub / github.com/microsoft/SandDance / FormatSpecifier

Function FormatSpecifier

docs/tests/v2/es6/js/sanddance.js:107259–107270  ·  view source on GitHub ↗
(specifier)

Source from the content-addressed store, hash-verified

107257formatSpecifier.prototype = FormatSpecifier.prototype; // instanceof
107258
107259function FormatSpecifier(specifier) {
107260 this.fill = specifier.fill === undefined ? " " : specifier.fill + "";
107261 this.align = specifier.align === undefined ? ">" : specifier.align + "";
107262 this.sign = specifier.sign === undefined ? "-" : specifier.sign + "";
107263 this.symbol = specifier.symbol === undefined ? "" : specifier.symbol + "";
107264 this.zero = !!specifier.zero;
107265 this.width = specifier.width === undefined ? undefined : +specifier.width;
107266 this.comma = !!specifier.comma;
107267 this.precision = specifier.precision === undefined ? undefined : +specifier.precision;
107268 this.trim = !!specifier.trim;
107269 this.type = specifier.type === undefined ? "" : specifier.type + "";
107270}
107271
107272FormatSpecifier.prototype.toString = function () {
107273 return this.fill + this.align + this.sign + this.symbol + (this.zero ? "0" : "") + (this.width === undefined ? "" : Math.max(1, this.width | 0)) + (this.comma ? "," : "") + (this.precision === undefined ? "" : "." + Math.max(0, this.precision | 0)) + (this.trim ? "~" : "") + this.type;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected