How to use the pluralize function in pluralize

To help you get started, we’ve selected a few pluralize 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 OpenNeuroOrg / openneuro / app / src / scripts / upload / upload.validation-results.issues.jsx View on Github external
) : null
      })

      if (issue.additionalFileCount > 0) {
        subErrors.push(
          <div>
            <span>
              and {issue.additionalFileCount} more{' '}
              {pluralize('files', issue.additionalFileCount)}
            </span>
          </div>,
        )
      }

      // issue panel
      return (
        
          {subErrors}
        
      )
    })
github zeit / now / packages / now-cli / src / commands / list.js View on Github external
if (argv['--all']) {
    await Promise.all(
      deployments.map(async ({ uid, instanceCount }, i) => {
        deployments[i].instances =
          instanceCount > 0 ? await now.listInstances(uid) : [];
      })
    );
  }

  if (host) {
    deployments = deployments.filter(deployment => deployment.url === host);
  }

  stopSpinner();
  log(
    `Fetched ${plural(
      'deployment',
      deployments.length,
      true
    )} under ${chalk.bold(contextName)} ${elapsed(Date.now() - start)}`
  );

  // we don't output the table headers if we have no deployments
  if (!deployments.length) {
    return 0;
  }

  // information to help the user find other deployments or instances
  if (app == null) {
    log(
      `To list more deployments for a project run ${cmd('now ls [project]')}`
    );
github plotly / falcon / app / components / Settings / scheduler / scheduler.jsx View on Github external
fontSize: 12,
                                    opacity: 0.5
                                }}
                            &gt;
                                <div>{run.errorMessage}</div>
                            
                        )}
                    {run &amp;&amp;
                        run.duration &amp;&amp; (
                            <em style="{{">
                                {`${pluralize('row', run.rowCount, true)} in ${ms(run.duration * 1000, {
                                    long: true
                                })}`}
                            </em>
                        )}
                
            
        );
    }
}
github ArkEcosystem / core / packages / core-p2p / src / socket-server / versions / peer.ts View on Github external
const fromForger: boolean = isWhitelisted(app.resolveOptions("p2p").remoteAccess, req.headers.remoteAddress);

    if (!fromForger) {
        if (blockchain.pingBlock(block)) {
            return;
        }

        const lastDownloadedBlock: Interfaces.IBlockData = blockchain.getLastDownloadedBlock();

        if (!isBlockChained(lastDownloadedBlock, block)) {
            throw new UnchainedBlockError(lastDownloadedBlock.height, block.height);
        }
    }

    app.resolvePlugin("logger").info(
        `Received new block at height ${block.height.toLocaleString()} with ${pluralize(
            "transaction",
            block.numberOfTransactions,
            true,
        )} from ${mapAddr(req.headers.remoteAddress)}`,
    );

    blockchain.handleIncomingBlock(block, fromForger);
};
github prisma / photonjs / packages / photon / src / runtime / externalToInternalDmmf.ts View on Github external
return mappings.map((mapping: any) => ({
    model: mapping.model,
    plural: pluralize(lowerCase(mapping.model)),
    findOne: mapping.findSingle || mapping.findOne,
    findMany: mapping.findMany,
    create: mapping.createOne || mapping.createSingle || mapping.create,
    delete: mapping.deleteOne || mapping.deleteSingle || mapping.delete,
    update: mapping.updateOne || mapping.updateSingle || mapping.update,
    deleteMany: mapping.deleteMany,
    updateMany: mapping.updateMany,
    upsert: mapping.upsertOne || mapping.upsertSingle || mapping.upsert,
    aggregate: mapping.aggregate,
  }))
}
github ArkEcosystem / core / packages / core-transaction-pool / src / processor.ts View on Github external
private printStats(): void {
        const stats: string = ["accept", "broadcast", "excess", "invalid"]
            .map(prop =&gt; `${prop}: ${this[prop] instanceof Array ? this[prop].length : this[prop].size}`)
            .join(" ");

        app.resolvePlugin("logger").info(
            `Received ${pluralize("transaction", this.transactions.length, true)} (${stats}).`,
        );
    }
}
github ArkEcosystem / core / packages / core-forger / src / manager.ts View on Github external
public async getTransactionsForForging(): Promise {
        const response: P2P.IForgingTransactions = await this.client.getTransactions();

        if (isEmpty(response)) {
            this.logger.error("Could not get unconfirmed transactions from transaction pool.");

            return [];
        }

        const transactions: Interfaces.ITransactionData[] = response.transactions.map(
            (hex: string) =&gt; Transactions.TransactionFactory.fromBytesUnsafe(Buffer.from(hex, "hex")).data,
        );

        this.logger.debug(
            `Received ${pluralize("transaction", transactions.length, true)} from the pool containing ${
                response.poolSize
            }`,
        );

        return transactions;
    }
github veritone / veritone-sdk / packages / veritone-react-common / src / components / Scheduler / TimePeriodSelector.js View on Github external
<menuitem value="hour">{pluralize('Hours', Number(number))}</menuitem>
          <menuitem value="day">{pluralize('Days', Number(number))}</menuitem>
          <menuitem value="week">{pluralize('Weeks', Number(number))}</menuitem>
        
      
    
  
);
github dpeek / dgraphql / src / schema.js View on Github external
Object.keys(typeMap).forEach(name => {
    if (name.indexOf('_') > -1 || name === 'Query') return
    let type = typeMap[name]
    if (!(type instanceof GraphQLObjectType)) return

    type = transformType(client, type, mutations)
    type._interfaces.push(node.nodeInterface)

    let singular = lowerCamelCase(name)
    queries[singular] = getQueryField(client, type)
    queries[pluralize(singular)] = getConnectionField(client, type, true)

    Object.assign(mutations, getTypeMutations(client, type))

    queries['node'] = node.nodeField
  })
  return new GraphQLSchema({
github remotebase / remotebase-mantra / server / modules / notification / factories / email.js View on Github external
let data = {
    digest,
    logoUrl: Meteor.absoluteUrl('images/logo.png')
  };

  let source = Assets.getText('email/notification.html');
  let template = Handlebars.compile(source);
  let html = template(data);
  let inlinedHtml = juice(html);

  return {
    html: inlinedHtml,
    text: htmlToText.fromString(inlinedHtml, {
      tables: [ '.body-wrap', '.footer-wrap' ]
    }),
    subject: `RemoteBase | ${pluralize('alert', digest.length, true)}`
  };
}