Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// @flow
import pluralize from "pluralize";
(pluralize('word'): string);
pluralize('word', 0);
pluralize('word', 0, true);
pluralize.addIrregularRule('word', 'wordz');
// $ExpectError
pluralize();
// $ExpectError
pluralize.nope;
pluralize.addIrregularRule = (single: string, plural: string) => require('pluralize').addIrregularRule(single, plural)
pluralize.addUncountableRule = (word: string | RegExp) => require('pluralize').addUncountableRule(word)
_getSnackbarMessage(skipped, done) {
pluralize.addIrregularRule('its', 'their');
var skipText = skipped
? `${skipped} ${pluralize('devices', skipped)} ${pluralize('have', skipped)} more than one pending authset. Expand ${pluralize(
'this',
skipped
)} ${pluralize('device', skipped)} to individually adjust ${pluralize('their', skipped)} authorization status. `
: '';
var doneText = done ? `${done} ${pluralize('device', done)} ${pluralize('was', done)} updated successfully. ` : '';
this.props.setSnackbar(doneText + skipText);
}
/*
* periodic
* http://github.com/typesettin/periodic
*
* Copyright (c) 2014 Yaw Joseph Etse. All rights reserved.
*/
'use strict';
var querystring = require('querystring'),
numeral = require('numeral'),
pluralize = require('pluralize'),
json2html = require('node-json2html'),
capitalize = require('capitalize'),
moment = require('moment');
pluralize.addIrregularRule('data','datas');
/**
* A module that contains view helpers for ejs views.
* @author Yaw Joseph Etse
* @copyright Copyright (c) 2014 Typesettin. All rights reserved.
* @license MIT
* @module staticViewHelper
*/
module.exports = {
/** ejs view helper
* @exports staticViewHelper/viewhelper
* @memberOf staticViewHelper
*/
viewhelper: {
/** helper function that returns the html for a javascript tag
* @param {object} scripts either a string or an object/array of file paths
* @returns {string} script tag for javascript
render() {
pluralize.addIrregularRule('corpus', 'corpora');
let plural = pluralize(this.props.name, 2);
return (
<div>
<h4>Filter by {this.props.name}</h4>
</div>