Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@platform/util.value

Package Overview
Dependencies
Maintainers
1
Versions
145
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@platform/util.value - npm Package Compare versions

Comparing version 0.0.17 to 0.0.18

1

lib/value/value.util.d.ts

@@ -5,1 +5,2 @@ export declare function defaultValue<T>(value: T | undefined, defaultValue?: T): T;

export declare const isStatusOk: (status: number) => boolean;
export declare function plural(count: number, singular: string, plural?: string): string;

@@ -27,1 +27,6 @@ "use strict";

};
function plural(count, singular, plural) {
plural = plural ? plural : singular + "s";
return count === 1 || count === -1 ? singular : plural;
}
exports.plural = plural;

@@ -85,1 +85,30 @@ "use strict";

});
describe('plural', function () {
it('singular', function () { return tslib_1.__awaiter(_this, void 0, void 0, function () {
return tslib_1.__generator(this, function (_a) {
chai_1.expect(_1.value.plural(1, 'item')).to.eql('item');
chai_1.expect(_1.value.plural(-1, 'item')).to.eql('item');
chai_1.expect(_1.value.plural(1, 'item', 'items')).to.eql('item');
chai_1.expect(_1.value.plural(-1, 'item', 'items')).to.eql('item');
return [2];
});
}); });
it('plural', function () { return tslib_1.__awaiter(_this, void 0, void 0, function () {
return tslib_1.__generator(this, function (_a) {
chai_1.expect(_1.value.plural(0, 'item', 'items')).to.eql('items');
chai_1.expect(_1.value.plural(2, 'item', 'items')).to.eql('items');
chai_1.expect(_1.value.plural(-2, 'item', 'items')).to.eql('items');
chai_1.expect(_1.value.plural(999, 'item', 'items')).to.eql('items');
return [2];
});
}); });
it('inferred "s"', function () { return tslib_1.__awaiter(_this, void 0, void 0, function () {
return tslib_1.__generator(this, function (_a) {
chai_1.expect(_1.value.plural(0, 'item')).to.eql('items');
chai_1.expect(_1.value.plural(2, 'item')).to.eql('items');
chai_1.expect(_1.value.plural(-2, 'item')).to.eql('items');
chai_1.expect(_1.value.plural(999, 'item')).to.eql('items');
return [2];
});
}); });
});

10

package.json
{
"name": "@platform/util.value",
"version": "0.0.17",
"version": "0.0.18",
"description": "Helpers for working with, transforming, and formatting values.",

@@ -16,5 +16,5 @@ "main": "lib/index",

"dependencies": {
"@platform/libs": "0.0.3",
"@platform/util.is": "0.0.16",
"@types/semver": "^5.5.0",
"@platform/libs": "0.0.4",
"@platform/util.is": "0.0.17",
"@types/semver": "5.5.0",
"cuid": "2.1.6",

@@ -26,3 +26,3 @@ "dayjs": "1.8.6",

"@platform/test": "0.0.26",
"@platform/ts.cli": "3.3.38",
"@platform/ts.cli": "3.3.39",
"moment": "2.24.0"

@@ -29,0 +29,0 @@ },

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc