How to use the @phensley/cldr-core.leftPad function in @phensley/cldr-core

To help you get started, we’ve selected a few @phensley/cldr-core 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 phensley / cldr-engine / packages / cldr-compiler / src / resource / machine.ts View on Github external
const saveCount = this.encoder.count();
      const saveSize = this.encoder.size();
      this.encode(obj, i);
      const count = this.encoder.count() - saveCount;
      const size = this.encoder.size() - saveSize;
      totalCount += count;
      totalSize += size;
      if (this.verbose) {
        console.warn(`      ${leftPad(i.identifier, 20)}  ` +
          `${leftPad(count, PADDING)} fields   ${leftPad(size, PADDING)} chars`);
      }
    }
    if (this.verbose) {
      console.warn('      --------------------   --------------   --------------');
      console.warn(`      ${leftPad('Total', 20)}  ` +
        `${leftPad(totalCount, PADDING)} fields   ${leftPad(totalSize, PADDING)} chars`);
      console.warn(`      ${leftPad('', 20)}  ${leftPad(this.encoder.distinct(), PADDING)} distinct strings`);
    }
  }
github phensley / cldr-engine / packages / cldr-compiler / src / resource / machine.ts View on Github external
const saveSize = this.encoder.size();
      this.encode(obj, i);
      const count = this.encoder.count() - saveCount;
      const size = this.encoder.size() - saveSize;
      totalCount += count;
      totalSize += size;
      if (this.verbose) {
        console.warn(`      ${leftPad(i.identifier, 20)}  ` +
          `${leftPad(count, PADDING)} fields   ${leftPad(size, PADDING)} chars`);
      }
    }
    if (this.verbose) {
      console.warn('      --------------------   --------------   --------------');
      console.warn(`      ${leftPad('Total', 20)}  ` +
        `${leftPad(totalCount, PADDING)} fields   ${leftPad(totalSize, PADDING)} chars`);
      console.warn(`      ${leftPad('', 20)}  ${leftPad(this.encoder.distinct(), PADDING)} distinct strings`);
    }
  }
github phensley / cldr-engine / packages / cldr-compiler / src / resource / machine.ts View on Github external
private encodeOrigin(obj: any, inst: Origin): void {
    this.origin = inst;

    let totalCount = 0;
    let totalSize = 0;
    for (const i of inst.block) {
      const saveCount = this.encoder.count();
      const saveSize = this.encoder.size();
      this.encode(obj, i);
      const count = this.encoder.count() - saveCount;
      const size = this.encoder.size() - saveSize;
      totalCount += count;
      totalSize += size;
      if (this.verbose) {
        console.warn(`      ${leftPad(i.identifier, 20)}  ` +
          `${leftPad(count, PADDING)} fields   ${leftPad(size, PADDING)} chars`);
      }
    }
    if (this.verbose) {
      console.warn('      --------------------   --------------   --------------');
      console.warn(`      ${leftPad('Total', 20)}  ` +
        `${leftPad(totalCount, PADDING)} fields   ${leftPad(totalSize, PADDING)} chars`);
      console.warn(`      ${leftPad('', 20)}  ${leftPad(this.encoder.distinct(), PADDING)} distinct strings`);
    }
  }
github phensley / cldr-engine / packages / cldr-compiler / src / resource / machine.ts View on Github external
private encodeOrigin(obj: any, inst: Origin): void {
    this.origin = inst;

    let totalCount = 0;
    let totalSize = 0;
    for (const i of inst.block) {
      const saveCount = this.encoder.count();
      const saveSize = this.encoder.size();
      this.encode(obj, i);
      const count = this.encoder.count() - saveCount;
      const size = this.encoder.size() - saveSize;
      totalCount += count;
      totalSize += size;
      if (this.verbose) {
        console.warn(`      ${leftPad(i.identifier, 20)}  ` +
          `${leftPad(count, PADDING)} fields   ${leftPad(size, PADDING)} chars`);
      }
    }
    if (this.verbose) {
      console.warn('      --------------------   --------------   --------------');
      console.warn(`      ${leftPad('Total', 20)}  ` +
        `${leftPad(totalCount, PADDING)} fields   ${leftPad(totalSize, PADDING)} chars`);
      console.warn(`      ${leftPad('', 20)}  ${leftPad(this.encoder.distinct(), PADDING)} distinct strings`);
    }
  }