@fc3/grammar 0.1.3 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/precompile +18 -2
- package/bin/remap-paths +54 -2
- package/dist/.last-compile-time +1 -1
- package/dist/.last-publish-time +1 -1
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.js +5 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/noun-inflector.js +6 -4
- package/dist/src/noun-inflector.js.map +1 -1
- package/dist/src/utility/get-name-for-number.d.ts +2 -0
- package/dist/src/utility/get-name-for-number.js +146 -0
- package/dist/src/utility/get-name-for-number.js.map +1 -0
- package/dist/src/utility/get-ordinal-name-for-number.d.ts +2 -0
- package/dist/src/utility/get-ordinal-name-for-number.js +69 -0
- package/dist/src/utility/get-ordinal-name-for-number.js.map +1 -0
- package/dist/src/verb-inflector.d.ts +4 -0
- package/dist/src/verb-inflector.js +59 -38
- package/dist/src/verb-inflector.js.map +1 -1
- package/dist/test/unit/get-name-for-number.d.ts +1 -0
- package/dist/test/unit/get-name-for-number.js +33 -0
- package/dist/test/unit/get-name-for-number.js.map +1 -0
- package/dist/test/unit/get-ordinal-name-for-number.d.ts +1 -0
- package/dist/test/unit/get-ordinal-name-for-number.js +29 -0
- package/dist/test/unit/get-ordinal-name-for-number.js.map +1 -0
- package/dist/test/unit/index.js +5 -53
- package/dist/test/unit/index.js.map +1 -1
- package/dist/test/unit/noun-inflector.d.ts +1 -0
- package/dist/test/unit/noun-inflector.js +72 -0
- package/dist/test/unit/noun-inflector.js.map +1 -0
- package/dist/test/unit/utility/get-words-from-identifier.d.ts +1 -0
- package/dist/test/unit/utility/get-words-from-identifier.js +26 -0
- package/dist/test/unit/utility/get-words-from-identifier.js.map +1 -0
- package/dist/test/unit/utility/pluralize.d.ts +1 -0
- package/dist/test/unit/utility/pluralize.js +35 -0
- package/dist/test/unit/utility/pluralize.js.map +1 -0
- package/dist/test/unit/utility/singularize-or-pluralize.d.ts +1 -0
- package/dist/test/unit/utility/singularize-or-pluralize.js +22 -0
- package/dist/test/unit/utility/singularize-or-pluralize.js.map +1 -0
- package/dist/test/unit/utility/singularize.d.ts +1 -0
- package/dist/test/unit/utility/singularize.js +27 -0
- package/dist/test/unit/utility/singularize.js.map +1 -0
- package/dist/test/unit/verb-inflector.d.ts +1 -0
- package/dist/test/unit/verb-inflector.js +179 -0
- package/dist/test/unit/verb-inflector.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verb-inflector.js","sourceRoot":"","sources":["../../src/verb-inflector.ts"],"names":[],"mappings":";;;;;AAAA,wCAAuC;AAEvC,oEAA2C;AAE3C,MAAM,aAAa;IAMlB,YAAmB,KAAa;QAC/B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QAEnB,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAEjC,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE,CAAC;YAClB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YAEjC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;QAC/B,CAAC;aAAM,CAAC;YACP,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;QAClB,CAAC;QAED,IAAI,CAAC,SAAS,GAAG,KAAK,KAAK,KAAK,CAAC,WAAW,EAAE,CAAC;QAC/C,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC;IACjC,CAAC;IAEM,mBAAmB;QACzB,IAAI,IAAI,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;YAC3B,OAAO,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;QAClC,CAAC;QAED,IAAI,IAAI,CAAC,IAAI,KAAK,IAAI,EAAE,CAAC;YACxB,O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G,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;QAC5D,MAAM,WAAW,GAAG,SAAS,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QAE9C,OAAO,GAAG,WAAW,GAAG,MAAM,EAAE,CAAC;IAClC,CAAC;IAEO,mBAAmB;QAC1B,OAAO,IAAI,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACrC,CAAC;IAEO,0BAA0B;QACjC,OAAO,+BAA+B,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACxD,CAAC;IAEO,cAAc;QACrB,MAAM,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QAE5C,OAAO,GAAG,IAAI,CAAC,IAAI,GAAG,eAAe,EAAE,CAAC;IACzC,CAAC;IAEO,QAAQ,CAAC,KAAa;QAC7B,KAAK,IAAI,IAAI,CAAC,MAAM,CAAC;QAErB,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACpB,OAAO,IAAA,mBAAU,EAAC,KAAK,CAAC,CAAC;QAC1B,CAAC;aAAM,CAAC;YACP,OAAO,KAAK,CAAC,WAAW,EAAE,CAAC;QAC5B,CAAC;IACF,CAAC;CACD;AAED,kBAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const node_test_1 = require("node:test");
|
|
7
|
+
const node_assert_1 = require("node:assert");
|
|
8
|
+
const get_name_for_number_1 = __importDefault(require("./../../src/utility/get-name-for-number.js"));
|
|
9
|
+
(0, node_test_1.describe)('getNameForNumber()', () => {
|
|
10
|
+
const expectations = [
|
|
11
|
+
[0, 'zero'],
|
|
12
|
+
[7, 'seven'],
|
|
13
|
+
[10, 'ten'],
|
|
14
|
+
[13, 'thirteen'],
|
|
15
|
+
[20, 'twenty'],
|
|
16
|
+
[42, 'forty-two'],
|
|
17
|
+
[100, 'one-hundred'],
|
|
18
|
+
[119, 'one-hundred-nineteen'],
|
|
19
|
+
[999, 'nine-hundred-ninety-nine'],
|
|
20
|
+
[1000, 'one-thousand'],
|
|
21
|
+
[1001, 'one-thousand-one'],
|
|
22
|
+
[2500000, 'two-million-five-hundred-thousand']
|
|
23
|
+
];
|
|
24
|
+
expectations.forEach(([value, expected]) => {
|
|
25
|
+
(0, node_test_1.it)(`names ${value} as "${expected}"`, () => {
|
|
26
|
+
(0, node_assert_1.strictEqual)((0, get_name_for_number_1.default)(value), expected);
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
(0, node_test_1.it)('rejects numbers beyond the quadrillions', () => {
|
|
30
|
+
(0, node_assert_1.throws)(() => (0, get_name_for_number_1.default)(1e18));
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
//# sourceMappingURL=get-name-for-number.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-name-for-number.js","sourceRoot":"","sources":["../../../test/unit/get-name-for-number.ts"],"names":[],"mappings":";;;;;AAAA,yCAAuC;AACvC,6CAAgD;AAEhD,sFAA2D;AAE3D,IAAA,oBAAQ,EAAC,oBAAoB,EAAE,GAAG,EAAE;IACnC,MAAM,YAAY,GAAuB;QACxC,CAAC,CAAC,EAAE,MAAM,CAAC;QACX,CAAC,CAAC,EAAE,OAAO,CAAC;QACZ,CAAC,EAAE,EAAE,KAAK,CAAC;QACX,CAAC,EAAE,EAAE,UAAU,CAAC;QAChB,CAAC,EAAE,EAAE,QAAQ,CAAC;QACd,CAAC,EAAE,EAAE,WAAW,CAAC;QACjB,CAAC,GAAG,EAAE,aAAa,CAAC;QACpB,CAAC,GAAG,EAAE,sBAAsB,CAAC;QAC7B,CAAC,GAAG,EAAE,0BAA0B,CAAC;QACjC,CAAC,IAAI,EAAE,cAAc,CAAC;QACtB,CAAC,IAAI,EAAE,kBAAkB,CAAC;QAC1B,CAAC,OAAO,EAAE,mCAAmC,CAAC;KAC9C,CAAC;IAEF,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,EAAE,QAAQ,CAAC,EAAE,EAAE;QAC1C,IAAA,cAAE,EAAC,SAAS,KAAK,QAAQ,QAAQ,GAAG,EAAE,GAAG,EAAE;YAC1C,IAAA,yBAAW,EAAC,IAAA,6BAAgB,EAAC,KAAK,CAAC,EAAE,QAAQ,CAAC,CAAC;QAChD,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,IAAA,cAAE,EAAC,yCAAyC,EAAE,GAAG,EAAE;QAClD,IAAA,oBAAM,EAAC,GAAG,EAAE,CAAC,IAAA,6BAAgB,EAAC,IAAI,CAAC,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const node_assert_1 = require("node:assert");
|
|
7
|
+
const node_test_1 = require("node:test");
|
|
8
|
+
const get_ordinal_name_for_number_1 = __importDefault(require("./../../src/utility/get-ordinal-name-for-number.js"));
|
|
9
|
+
(0, node_test_1.describe)('getOrdinalNameForNumber()', () => {
|
|
10
|
+
const expectations = [
|
|
11
|
+
[0, 'zeroeth'],
|
|
12
|
+
[1, 'first'],
|
|
13
|
+
[2, 'second'],
|
|
14
|
+
[3, 'third'],
|
|
15
|
+
[12, 'twelfth'],
|
|
16
|
+
[15, 'fifteenth'],
|
|
17
|
+
[20, 'twentieth'],
|
|
18
|
+
[21, 'twenty-first'],
|
|
19
|
+
[100, 'one-hundredth'],
|
|
20
|
+
[1000, 'one-thousandth'],
|
|
21
|
+
[3000000, 'three-millionth']
|
|
22
|
+
];
|
|
23
|
+
expectations.forEach(([value, expected]) => {
|
|
24
|
+
(0, node_test_1.it)(`names ${value} as "${expected}"`, () => {
|
|
25
|
+
(0, node_assert_1.strictEqual)((0, get_ordinal_name_for_number_1.default)(value), expected);
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
//# sourceMappingURL=get-ordinal-name-for-number.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-ordinal-name-for-number.js","sourceRoot":"","sources":["../../../test/unit/get-ordinal-name-for-number.ts"],"names":[],"mappings":";;;;;AAAA,6CAAwC;AACxC,yCAAuC;AAEvC,sGAA0E;AAE1E,IAAA,oBAAQ,EAAC,2BAA2B,EAAE,GAAG,EAAE;IAC1C,MAAM,YAAY,GAAuB;QACxC,CAAC,CAAC,EAAE,SAAS,CAAC;QACd,CAAC,CAAC,EAAE,OAAO,CAAC;QACZ,CAAC,CAAC,EAAE,QAAQ,CAAC;QACb,CAAC,CAAC,EAAE,OAAO,CAAC;QACZ,CAAC,EAAE,EAAE,SAAS,CAAC;QACf,CAAC,EAAE,EAAE,WAAW,CAAC;QACjB,CAAC,EAAE,EAAE,WAAW,CAAC;QACjB,CAAC,EAAE,EAAE,cAAc,CAAC;QACpB,CAAC,GAAG,EAAE,eAAe,CAAC;QACtB,CAAC,IAAI,EAAE,gBAAgB,CAAC;QACxB,CAAC,OAAO,EAAE,iBAAiB,CAAC;KAC5B,CAAC;IAEF,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,EAAE,QAAQ,CAAC,EAAE,EAAE;QAC1C,IAAA,cAAE,EAAC,SAAS,KAAK,QAAQ,QAAQ,GAAG,EAAE,GAAG,EAAE;YAC1C,IAAA,yBAAW,EAAC,IAAA,qCAAuB,EAAC,KAAK,CAAC,EAAE,QAAQ,CAAC,CAAC;QACvD,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
package/dist/test/unit/index.js
CHANGED
|
@@ -2,59 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const node_assert_1 = require("node:assert");
|
|
4
4
|
const node_test_1 = require("node:test");
|
|
5
|
-
|
|
6
|
-
(0, node_test_1.
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
(0, node_assert_1.strictEqual)(
|
|
10
|
-
});
|
|
11
|
-
(0, node_test_1.it)('returns the expected form for a noun ending in -ies', () => {
|
|
12
|
-
const result = (0, index_1.singularize)('parties');
|
|
13
|
-
(0, node_assert_1.strictEqual)(result, 'party');
|
|
14
|
-
});
|
|
15
|
-
(0, node_test_1.it)('returns the expected form for a noun ending in -i', () => {
|
|
16
|
-
const result = (0, index_1.singularize)('octopi');
|
|
17
|
-
(0, node_assert_1.strictEqual)(result, 'octopus');
|
|
18
|
-
});
|
|
19
|
-
(0, node_test_1.it)('returns the expected form for a noun that is explicitly mapped', () => {
|
|
20
|
-
const result = (0, index_1.singularize)('loot');
|
|
21
|
-
(0, node_assert_1.strictEqual)(result, 'loot');
|
|
22
|
-
});
|
|
23
|
-
});
|
|
24
|
-
(0, node_test_1.describe)('pluralize()', () => {
|
|
25
|
-
(0, node_test_1.it)('returns the expected form for a generic noun', () => {
|
|
26
|
-
const result = (0, index_1.pluralize)('preference');
|
|
27
|
-
(0, node_assert_1.strictEqual)(result, 'preferences');
|
|
28
|
-
});
|
|
29
|
-
(0, node_test_1.it)('returns the expected form for a noun ending in -y', () => {
|
|
30
|
-
const result = (0, index_1.pluralize)('party');
|
|
31
|
-
(0, node_assert_1.strictEqual)(result, 'parties');
|
|
32
|
-
});
|
|
33
|
-
(0, node_test_1.it)('returns the expected form for a noun ending in -us', () => {
|
|
34
|
-
const result = (0, index_1.pluralize)('octopus');
|
|
35
|
-
(0, node_assert_1.strictEqual)(result, 'octopi');
|
|
36
|
-
});
|
|
37
|
-
(0, node_test_1.it)('returns the expected form for a noun ending in -ch', () => {
|
|
38
|
-
const result = (0, index_1.pluralize)('church');
|
|
39
|
-
(0, node_assert_1.strictEqual)(result, 'churches');
|
|
40
|
-
});
|
|
41
|
-
(0, node_test_1.it)('returns the expected form for a noun ending in -ss', () => {
|
|
42
|
-
const result = (0, index_1.pluralize)('mass');
|
|
43
|
-
(0, node_assert_1.strictEqual)(result, 'masses');
|
|
44
|
-
});
|
|
45
|
-
(0, node_test_1.it)('returns the expected form for a noun that is explicitly mapped', () => {
|
|
46
|
-
const result = (0, index_1.pluralize)('loot');
|
|
47
|
-
(0, node_assert_1.strictEqual)(result, 'loot');
|
|
48
|
-
});
|
|
49
|
-
});
|
|
50
|
-
(0, node_test_1.describe)('singularizeOrPluralize()', () => {
|
|
51
|
-
(0, node_test_1.it)('returns the expected form for a single instance', () => {
|
|
52
|
-
const result = (0, index_1.singularizeOrPluralize)(1, 'account');
|
|
53
|
-
(0, node_assert_1.strictEqual)(result, '1 account');
|
|
54
|
-
});
|
|
55
|
-
(0, node_test_1.it)('returns the expected form for multiple instances', () => {
|
|
56
|
-
const result = (0, index_1.singularizeOrPluralize)(2, 'account');
|
|
57
|
-
(0, node_assert_1.strictEqual)(result, '2 accounts');
|
|
5
|
+
(0, node_test_1.describe)('package.json', () => {
|
|
6
|
+
(0, node_test_1.it)('contains expected package name', () => {
|
|
7
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
8
|
+
const manifest = require('../../../package.json');
|
|
9
|
+
(0, node_assert_1.strictEqual)(manifest.name, '@fc3/grammar');
|
|
58
10
|
});
|
|
59
11
|
});
|
|
60
12
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../test/unit/index.ts"],"names":[],"mappings":";;AAAA,6CAAwC;AACxC,yCAAuC;AAEvC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../test/unit/index.ts"],"names":[],"mappings":";;AAAA,6CAAwC;AACxC,yCAAuC;AAEvC,IAAA,oBAAQ,EAAC,cAAc,EAAE,GAAG,EAAE;IAC7B,IAAA,cAAE,EAAC,gCAAgC,EAAE,GAAG,EAAE;QACzC,iEAAiE;QACjE,MAAM,QAAQ,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAC;QAElD,IAAA,yBAAW,EAAC,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;IAC5C,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const node_assert_1 = require("node:assert");
|
|
7
|
+
const node_test_1 = require("node:test");
|
|
8
|
+
const noun_inflector_1 = __importDefault(require("./../../src/noun-inflector.js"));
|
|
9
|
+
(0, node_test_1.describe)('NounInflector', () => {
|
|
10
|
+
const inflector = new noun_inflector_1.default();
|
|
11
|
+
(0, node_test_1.describe)('.pluralize()', () => {
|
|
12
|
+
const expectations = [
|
|
13
|
+
['apple', 'apples'],
|
|
14
|
+
['party', 'parties'],
|
|
15
|
+
['day', 'days'],
|
|
16
|
+
['church', 'churches'],
|
|
17
|
+
['class', 'classes'],
|
|
18
|
+
['box', 'boxes'],
|
|
19
|
+
['dish', 'dishes'],
|
|
20
|
+
['buzz', 'buzzes'],
|
|
21
|
+
['octopus', 'octopi'],
|
|
22
|
+
['life', 'lives'],
|
|
23
|
+
['loot', 'loot']
|
|
24
|
+
];
|
|
25
|
+
expectations.forEach(([singular, plural]) => {
|
|
26
|
+
(0, node_test_1.it)(`pluralizes ${singular} as ${plural}`, () => {
|
|
27
|
+
(0, node_assert_1.strictEqual)(inflector.pluralize(singular), plural);
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
(0, node_test_1.describe)('.singularize()', () => {
|
|
32
|
+
const expectations = [
|
|
33
|
+
['apples', 'apple'],
|
|
34
|
+
['parties', 'party'],
|
|
35
|
+
['octopi', 'octopus'],
|
|
36
|
+
['churches', 'church'],
|
|
37
|
+
['classes', 'class'],
|
|
38
|
+
['boxes', 'box'],
|
|
39
|
+
['preferences', 'preference'],
|
|
40
|
+
['loot', 'loot'],
|
|
41
|
+
['sheep', 'sheep']
|
|
42
|
+
];
|
|
43
|
+
expectations.forEach(([plural, singular]) => {
|
|
44
|
+
(0, node_test_1.it)(`singularizes ${plural} as ${singular}`, () => {
|
|
45
|
+
(0, node_assert_1.strictEqual)(inflector.singularize(plural), singular);
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
(0, node_test_1.describe)('.singularizeOrPluralize()', () => {
|
|
50
|
+
(0, node_test_1.it)('keeps the singular for exactly one', () => {
|
|
51
|
+
(0, node_assert_1.strictEqual)(inflector.singularizeOrPluralize(1, 'cat'), '1 cat');
|
|
52
|
+
});
|
|
53
|
+
(0, node_test_1.it)('pluralizes any other amount, including fractions', () => {
|
|
54
|
+
(0, node_assert_1.strictEqual)(inflector.singularizeOrPluralize(0, 'cat'), '0 cats');
|
|
55
|
+
(0, node_assert_1.strictEqual)(inflector.singularizeOrPluralize(2.5, 'cat'), '2.5 cats');
|
|
56
|
+
});
|
|
57
|
+
(0, node_test_1.it)('parses a numeric string amount', () => {
|
|
58
|
+
(0, node_assert_1.strictEqual)(inflector.singularizeOrPluralize('1', 'cat'), '1 cat');
|
|
59
|
+
(0, node_assert_1.strictEqual)(inflector.singularizeOrPluralize('3', 'cat'), '3 cats');
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
(0, node_test_1.describe)('.prependArticle()', () => {
|
|
63
|
+
(0, node_test_1.it)('uses "an" before a vowel', () => {
|
|
64
|
+
(0, node_assert_1.strictEqual)(inflector.prependArticle('apple'), 'an apple');
|
|
65
|
+
(0, node_assert_1.strictEqual)(inflector.prependArticle('Octopus'), 'an Octopus');
|
|
66
|
+
});
|
|
67
|
+
(0, node_test_1.it)('uses "a" before a consonant', () => {
|
|
68
|
+
(0, node_assert_1.strictEqual)(inflector.prependArticle('cat'), 'a cat');
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
//# sourceMappingURL=noun-inflector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"noun-inflector.js","sourceRoot":"","sources":["../../../test/unit/noun-inflector.ts"],"names":[],"mappings":";;;;;AAAA,6CAAwC;AACxC,yCAAuC;AAEvC,oEAA2C;AAE3C,IAAA,oBAAQ,EAAC,eAAe,EAAE,GAAG,EAAE;IAC9B,MAAM,SAAS,GAAG,IAAI,wBAAa,EAAE,CAAC;IAEtC,IAAA,oBAAQ,EAAC,cAAc,EAAE,GAAG,EAAE;QAC7B,MAAM,YAAY,GAAuB;YACxC,CAAC,OAAO,EAAE,QAAQ,CAAC;YACnB,CAAC,OAAO,EAAE,SAAS,CAAC;YACpB,CAAC,KAAK,EAAE,MAAM,CAAC;YACf,CAAC,QAAQ,EAAE,UAAU,CAAC;YACtB,CAAC,OAAO,EAAE,SAAS,CAAC;YACpB,CAAC,KAAK,EAAE,OAAO,CAAC;YAChB,CAAC,MAAM,EAAE,QAAQ,CAAC;YAClB,CAAC,MAAM,EAAE,QAAQ,CAAC;YAClB,CAAC,SAAS,EAAE,QAAQ,CAAC;YACrB,CAAC,MAAM,EAAE,OAAO,CAAC;YACjB,CAAC,MAAM,EAAE,MAAM,CAAC;SAChB,CAAC;QAEF,YAAY,CAAC,OA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Default) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const node_test_1 = require("node:test");
|
|
7
|
+
const node_assert_1 = require("node:assert");
|
|
8
|
+
const get_words_from_identifier_1 = __importDefault(require("./../../../src/utility/get-words-from-identifier.js"));
|
|
9
|
+
(0, node_test_1.describe)('getWordsFromIdentifier()', () => {
|
|
10
|
+
(0, node_test_1.it)('splits camel case at each lowercase to uppercase boundary', () => {
|
|
11
|
+
const words = (0, get_words_from_identifier_1.default)('camelCaseName');
|
|
12
|
+
(0, node_assert_1.deepStrictEqual)(words, ['camel', 'Case', 'Name']);
|
|
13
|
+
});
|
|
14
|
+
(0, node_test_1.it)('splits snake case at underscores', () => {
|
|
15
|
+
const words = (0, get_words_from_identifier_1.default)('snake_case_name');
|
|
16
|
+
(0, node_assert_1.deepStrictEqual)(words, ['snake', 'case', 'name']);
|
|
17
|
+
});
|
|
18
|
+
(0, node_test_1.it)('keeps a run of capitals together', () => {
|
|
19
|
+
const words = (0, get_words_from_identifier_1.default)('loadHTTPServer');
|
|
20
|
+
(0, node_assert_1.deepStrictEqual)(words, ['load', 'HTTPServer']);
|
|
21
|
+
});
|
|
22
|
+
(0, node_test_1.it)('returns a single word unchanged', () => {
|
|
23
|
+
(0, node_assert_1.deepStrictEqual)((0, get_words_from_identifier_1.default)('word'), ['word']);
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
//# sourceMappingURL=get-words-from-identifier.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-words-from-identifier.js","sourceRoot":"","sources":["../../../../test/unit/utility/get-words-from-identifier.ts"],"names":[],"mappings":";;;;;AAAA,yCAAuC;AACvC,6CAA4C;AAE5C,kGAAuE;AAEvE,IAAA,oBAAQ,EAAC,0BAA0B,EAAE,GAAG,EAAE;IACzC,IAAA,cAAE,EAAC,2DAA2D,EAAE,GAAG,EAAE;QACpE,MAAM,KAAK,GAAG,IAAA,mCAAsB,EAAC,eAAe,CAAC,CAAC;QAEtD,IAAA,6BAAe,EAAC,KAAK,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACnD,CAAC,CAAC,CAAC;IAEH,IAAA,cAAE,EAAC,kCAAkC,EAAE,GAAG,EAAE;QAC3C,MAAM,KAAK,GAAG,IAAA,mCAAsB,EAAC,iBAAiB,CAAC,CAAC;QAExD,IAAA,6BAAe,EAAC,KAAK,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACnD,CAAC,CAAC,CAAC;IAEH,IAAA,cAAE,EAAC,kCAAkC,EAAE,GAAG,EAAE;QAC3C,MAAM,KAAK,GAAG,IAAA,mCAAsB,EAAC,gBAAgB,CAAC,CAAC;QAEvD,IAAA,6BAAe,EAAC,KAAK,EAAE,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC;IAChD,CAAC,CAAC,CAAC;IAEH,IAAA,cAAE,EAAC,iCAAiC,EAAE,GAAG,EAAE;QAC1C,IAAA,6BAAe,EAAC,IAAA,mCAAsB,EAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAC3D,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const node_assert_1 = require("node:assert");
|
|
7
|
+
const node_test_1 = require("node:test");
|
|
8
|
+
const pluralize_1 = __importDefault(require("./../../../src/utility/pluralize.js"));
|
|
9
|
+
(0, node_test_1.describe)('pluralize()', () => {
|
|
10
|
+
(0, node_test_1.it)('returns the expected form for a generic noun', () => {
|
|
11
|
+
const result = (0, pluralize_1.default)('preference');
|
|
12
|
+
(0, node_assert_1.strictEqual)(result, 'preferences');
|
|
13
|
+
});
|
|
14
|
+
(0, node_test_1.it)('returns the expected form for a noun ending in -y', () => {
|
|
15
|
+
const result = (0, pluralize_1.default)('party');
|
|
16
|
+
(0, node_assert_1.strictEqual)(result, 'parties');
|
|
17
|
+
});
|
|
18
|
+
(0, node_test_1.it)('returns the expected form for a noun ending in -us', () => {
|
|
19
|
+
const result = (0, pluralize_1.default)('octopus');
|
|
20
|
+
(0, node_assert_1.strictEqual)(result, 'octopi');
|
|
21
|
+
});
|
|
22
|
+
(0, node_test_1.it)('returns the expected form for a noun ending in -ch', () => {
|
|
23
|
+
const result = (0, pluralize_1.default)('church');
|
|
24
|
+
(0, node_assert_1.strictEqual)(result, 'churches');
|
|
25
|
+
});
|
|
26
|
+
(0, node_test_1.it)('returns the expected form for a noun ending in -ss', () => {
|
|
27
|
+
const result = (0, pluralize_1.default)('mass');
|
|
28
|
+
(0, node_assert_1.strictEqual)(result, 'masses');
|
|
29
|
+
});
|
|
30
|
+
(0, node_test_1.it)('returns the expected form for a noun that is explicitly mapped', () => {
|
|
31
|
+
const result = (0, pluralize_1.default)('loot');
|
|
32
|
+
(0, node_assert_1.strictEqual)(result, 'loot');
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
//# sourceMappingURL=pluralize.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pluralize.js","sourceRoot":"","sources":["../../../../test/unit/utility/pluralize.ts"],"names":[],"mappings":";;;;;AAAA,6CAAwC;AACxC,yCAAuC;AAEvC,kEAA0C;AAE1C,IAAA,oBAAQ,EAAC,aAAa,EAAE,GAAG,EAAE;IAC5B,IAAA,cAAE,EAAC,8CAA8C,EAAE,GAAG,EAAE;QACvD,MAAM,MAAM,GAAG,IAAA,mBAAS,EAAC,YAAY,CAA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(mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const node_assert_1 = require("node:assert");
|
|
7
|
+
const node_test_1 = require("node:test");
|
|
8
|
+
const singularize_or_pluralize_1 = __importDefault(require("./../../../src/utility/singularize-or-pluralize.js"));
|
|
9
|
+
(0, node_test_1.describe)('singularizeOrPluralize()', () => {
|
|
10
|
+
(0, node_test_1.it)('returns the expected form for a single instance', () => {
|
|
11
|
+
const result = (0, singularize_or_pluralize_1.default)(1, 'account');
|
|
12
|
+
(0, node_assert_1.strictEqual)(result, '1 account');
|
|
13
|
+
});
|
|
14
|
+
(0, node_test_1.it)('returns the expected form for multiple instances', () => {
|
|
15
|
+
const result = (0, singularize_or_pluralize_1.default)(2, 'account');
|
|
16
|
+
(0, node_assert_1.strictEqual)(result, '2 accounts');
|
|
17
|
+
});
|
|
18
|
+
(0, node_test_1.it)('pluralizes zero', () => {
|
|
19
|
+
(0, node_assert_1.strictEqual)((0, singularize_or_pluralize_1.default)(0, 'account'), '0 accounts');
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
//# sourceMappingURL=singularize-or-pluralize.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"singularize-or-pluralize.js","sourceRoot":"","sources":["../../../../test/unit/utility/singularize-or-pluralize.ts"],"names":[],"mappings":";;;;;AAAA,6CAAwC;AACxC,yCAAuC;AAEvC,gGAAsE;AAEtE,IAAA,oBAAQ,EAAC,0BAA0B,EAAE,GAAG,EAAE;IACzC,IAAA,cAAE,EAAC,iDAAiD,EAAE,GAAG,EAAE;QAC1D,MAAM,MAAM,GAAG,IAAA,kCAAsB,EAAC,CAAC,EAAE,SAAS,CAAC,CAAC;QAEpD,IAAA,yBAAW,EAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IAClC,CAAC,CAAC,CAAC;IAEH,IAAA,cAAE,EAAC,kDAAkD,EAAE,GAAG,EAAE;QAC3D,MAAM,MAAM,GAAG,IAAA,kCAAsB,EAAC,CAAC,EAAE,SAAS,CAAC,CAAC;QAEpD,IAAA,yBAAW,EAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IACnC,CAAC,CAAC,CAAC;IAEH,IAAA,cAAE,EAAC,iBAAiB,EAAE,GAAG,EAAE;QAC1B,IAAA,yBAAW,EAAC,IAAA,kCAAsB,EAAC,CAAC,EAAE,SAAS,CAAC,EAAE,YAAY,CAAC,CAAC;IACjE,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const node_assert_1 = require("node:assert");
|
|
7
|
+
const node_test_1 = require("node:test");
|
|
8
|
+
const singularize_1 = __importDefault(require("./../../../src/utility/singularize.js"));
|
|
9
|
+
(0, node_test_1.describe)('singularize()', () => {
|
|
10
|
+
(0, node_test_1.it)('returns the expected form for a generic noun', () => {
|
|
11
|
+
const result = (0, singularize_1.default)('preferences');
|
|
12
|
+
(0, node_assert_1.strictEqual)(result, 'preference');
|
|
13
|
+
});
|
|
14
|
+
(0, node_test_1.it)('returns the expected form for a noun ending in -ies', () => {
|
|
15
|
+
const result = (0, singularize_1.default)('parties');
|
|
16
|
+
(0, node_assert_1.strictEqual)(result, 'party');
|
|
17
|
+
});
|
|
18
|
+
(0, node_test_1.it)('returns the expected form for a noun ending in -i', () => {
|
|
19
|
+
const result = (0, singularize_1.default)('octopi');
|
|
20
|
+
(0, node_assert_1.strictEqual)(result, 'octopus');
|
|
21
|
+
});
|
|
22
|
+
(0, node_test_1.it)('returns the expected form for a noun that is explicitly mapped', () => {
|
|
23
|
+
const result = (0, singularize_1.default)('loot');
|
|
24
|
+
(0, node_assert_1.strictEqual)(result, 'loot');
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
//# sourceMappingURL=singularize.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"singularize.js","sourceRoot":"","sources":["../../../../test/unit/utility/singularize.ts"],"names":[],"mappings":";;;;;AAAA,6CAAwC;AACxC,yCAAuC;AAEvC,sEAA8C;AAE9C,IAAA,oBAAQ,EAAC,eAAe,EAAE,GAAG,EAAE;IAC9B,IAAA,cAAE,EAAC,8CAA8C,EAAE,GAAG,EAAE;QACvD,MAAM,MAAM,GAAG,IAAA,qBAAW,EAAC,aAAa,CAAC,CAAC;QAE1C,IAAA,yBAAW,EAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IACnC,CAAC,CAAC,CAAC;IAEH,IAAA,cAAE,EAAC,qDAAqD,EAAE,GAAG,EAAE;QAC9D,MAAM,MAAM,GAAG,IAAA,qBAAW,EAAC,SAAS,CAAC,CAAC;QAEtC,IAAA,yBAAW,EAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B,CAAC,CAAC,CAAC;IAEH,IAAA,cAAE,EAAC,mDAAmD,EAAE,GAAG,EAAE;QAC5D,MAAM,MAAM,GAAG,IAAA,qBAAW,EAAC,QAAQ,CAAC,CAAC;QAErC,IAAA,yBAAW,EAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IAChC,CAAC,CAAC,CAAC;IAEH,IAAA,cAAE,EAAC,gEAAgE,EAAE,GAAG,EAAE;QACzE,MAAM,MAAM,GAAG,IAAA,qBAAW,EAAC,MAAM,CAAC,CAAC;QAEnC,IAAA,yBAAW,EAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const node_assert_1 = require("node:assert");
|
|
7
|
+
const node_test_1 = require("node:test");
|
|
8
|
+
const verb_inflector_1 = __importDefault(require("./../../src/verb-inflector.js"));
|
|
9
|
+
function inflect(verb) {
|
|
10
|
+
return new verb_inflector_1.default(verb);
|
|
11
|
+
}
|
|
12
|
+
(0, node_test_1.describe)('VerbInflector', () => {
|
|
13
|
+
(0, node_test_1.describe)('.toPresentParticiple()', () => {
|
|
14
|
+
const expectations = [
|
|
15
|
+
['walk', 'walking'],
|
|
16
|
+
['stop', 'stopping'],
|
|
17
|
+
['log', 'logging'],
|
|
18
|
+
['free', 'freeing'],
|
|
19
|
+
['wave', 'waving'],
|
|
20
|
+
['run', 'running'],
|
|
21
|
+
['pet', 'petting'],
|
|
22
|
+
['be', 'being'],
|
|
23
|
+
['group', 'grouping']
|
|
24
|
+
];
|
|
25
|
+
expectations.forEach(([verb, participle]) => {
|
|
26
|
+
(0, node_test_1.it)(`turns ${verb} into ${participle}`, () => {
|
|
27
|
+
(0, node_assert_1.strictEqual)(inflect(verb).toPresentParticiple(), participle);
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
(0, node_test_1.describe)('.toPastTense()', () => {
|
|
32
|
+
const expectations = [
|
|
33
|
+
['walk', 'walked'],
|
|
34
|
+
['stop', 'stopped'],
|
|
35
|
+
['pet', 'petted'],
|
|
36
|
+
['group', 'grouped'],
|
|
37
|
+
['make', 'made'],
|
|
38
|
+
['bear', 'bore'],
|
|
39
|
+
['log', 'logged'],
|
|
40
|
+
['wave', 'waved'],
|
|
41
|
+
['destroy', 'destroyed'],
|
|
42
|
+
['party', 'partied'],
|
|
43
|
+
['be', 'was'],
|
|
44
|
+
['draw', 'drew'],
|
|
45
|
+
['find', 'found'],
|
|
46
|
+
['get', 'got'],
|
|
47
|
+
['run', 'ran'],
|
|
48
|
+
['read', 'read'],
|
|
49
|
+
['write', 'wrote'],
|
|
50
|
+
['choose', 'chose'],
|
|
51
|
+
['build', 'built']
|
|
52
|
+
];
|
|
53
|
+
expectations.forEach(([verb, past]) => {
|
|
54
|
+
(0, node_test_1.it)(`turns ${verb} into ${past}`, () => {
|
|
55
|
+
(0, node_assert_1.strictEqual)(inflect(verb).toPastTense(), past);
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
(0, node_test_1.describe)('.toPastParticiple()', () => {
|
|
60
|
+
(0, node_test_1.it)('uses the irregular participle for choose', () => {
|
|
61
|
+
(0, node_assert_1.strictEqual)(inflect('choose').toPastParticiple(), 'chosen');
|
|
62
|
+
});
|
|
63
|
+
(0, node_test_1.it)('falls back to the past tense', () => {
|
|
64
|
+
(0, node_assert_1.strictEqual)(inflect('walk').toPastParticiple(), 'walked');
|
|
65
|
+
});
|
|
66
|
+
const irregulars = [
|
|
67
|
+
['be', 'been'],
|
|
68
|
+
['run', 'run'],
|
|
69
|
+
['write', 'written'],
|
|
70
|
+
['make', 'made'],
|
|
71
|
+
['draw', 'drawn']
|
|
72
|
+
];
|
|
73
|
+
irregulars.forEach(([verb, participle]) => {
|
|
74
|
+
(0, node_test_1.it)(`uses the irregular participle ${participle} for ${verb}`, () => {
|
|
75
|
+
(0, node_assert_1.strictEqual)(inflect(verb).toPastParticiple(), participle);
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
(0, node_test_1.describe)('simple tenses', () => {
|
|
80
|
+
(0, node_test_1.it)('builds the infinitive', () => {
|
|
81
|
+
(0, node_assert_1.strictEqual)(inflect('walk').toInfinitive(), 'to walk');
|
|
82
|
+
});
|
|
83
|
+
(0, node_test_1.it)('builds the present tense', () => {
|
|
84
|
+
(0, node_assert_1.strictEqual)(inflect('walk').toPresentTense(), 'walk');
|
|
85
|
+
(0, node_assert_1.strictEqual)(inflect('be').toPresentTense(), 'is');
|
|
86
|
+
});
|
|
87
|
+
(0, node_test_1.it)('builds the future tense', () => {
|
|
88
|
+
(0, node_assert_1.strictEqual)(inflect('walk').toFutureTense(), 'will walk');
|
|
89
|
+
});
|
|
90
|
+
(0, node_test_1.it)('builds the imperfect tense of a single word verb', () => {
|
|
91
|
+
(0, node_assert_1.strictEqual)(inflect('walk').toImperfectTense(), 'was walking');
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
(0, node_test_1.describe)('.toSingularNoun()', () => {
|
|
95
|
+
const expectations = [
|
|
96
|
+
['die', 'death'],
|
|
97
|
+
['choose', 'choice'],
|
|
98
|
+
['describe', 'description'],
|
|
99
|
+
['create', 'creation'],
|
|
100
|
+
['write', 'writing'],
|
|
101
|
+
['walk', 'walking']
|
|
102
|
+
];
|
|
103
|
+
expectations.forEach(([verb, noun]) => {
|
|
104
|
+
(0, node_test_1.it)(`turns ${verb} into ${noun}`, () => {
|
|
105
|
+
(0, node_assert_1.strictEqual)(inflect(verb).toSingularNoun(), noun);
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
(0, node_test_1.it)('uses the object of make as the noun', () => {
|
|
109
|
+
(0, node_assert_1.strictEqual)(inflect('make music').toSingularNoun(), 'music');
|
|
110
|
+
(0, node_assert_1.strictEqual)(inflect('make pottery').toSingularNoun(), 'pottery');
|
|
111
|
+
});
|
|
112
|
+
(0, node_test_1.it)('uses fruit as the noun of bear fruit', () => {
|
|
113
|
+
(0, node_assert_1.strictEqual)(inflect('bear fruit').toSingularNoun(), 'fruit');
|
|
114
|
+
});
|
|
115
|
+
});
|
|
116
|
+
(0, node_test_1.describe)('.toPluralNoun()', () => {
|
|
117
|
+
(0, node_test_1.it)('pluralizes the singular noun of a single word verb', () => {
|
|
118
|
+
(0, node_assert_1.strictEqual)(inflect('choose').toPluralNoun(), 'choices');
|
|
119
|
+
(0, node_assert_1.strictEqual)(inflect('create').toPluralNoun(), 'creations');
|
|
120
|
+
});
|
|
121
|
+
});
|
|
122
|
+
(0, node_test_1.describe)('actors', () => {
|
|
123
|
+
const expectations = [
|
|
124
|
+
['walk', 'walker'],
|
|
125
|
+
['create', 'creator'],
|
|
126
|
+
['act', 'actor'],
|
|
127
|
+
['run', 'runner'],
|
|
128
|
+
['stop', 'stopper'],
|
|
129
|
+
['wave', 'waver'],
|
|
130
|
+
['be', 'being']
|
|
131
|
+
];
|
|
132
|
+
expectations.forEach(([verb, actor]) => {
|
|
133
|
+
(0, node_test_1.it)(`turns ${verb} into ${actor}`, () => {
|
|
134
|
+
(0, node_assert_1.strictEqual)(inflect(verb).toSingularActor(), actor);
|
|
135
|
+
});
|
|
136
|
+
});
|
|
137
|
+
(0, node_test_1.it)('pluralizes the actor of a single word verb', () => {
|
|
138
|
+
(0, node_assert_1.strictEqual)(inflect('create').toPluralActor(), 'creators');
|
|
139
|
+
});
|
|
140
|
+
});
|
|
141
|
+
(0, node_test_1.describe)('multi word verbs', () => {
|
|
142
|
+
(0, node_test_1.it)('inflects only the first word and keeps the rest', () => {
|
|
143
|
+
const inflector = inflect('write a letter');
|
|
144
|
+
(0, node_assert_1.strictEqual)(inflector.toPresentParticiple(), 'writing a letter');
|
|
145
|
+
(0, node_assert_1.strictEqual)(inflector.toPastTense(), 'wrote a letter');
|
|
146
|
+
(0, node_assert_1.strictEqual)(inflector.toFutureTense(), 'will write a letter');
|
|
147
|
+
});
|
|
148
|
+
(0, node_test_1.it)('keeps the rest of the phrase exactly once in compound forms', () => {
|
|
149
|
+
const inflector = inflect('write a letter');
|
|
150
|
+
(0, node_assert_1.strictEqual)(inflector.toImperfectTense(), 'was writing a letter');
|
|
151
|
+
(0, node_assert_1.strictEqual)(inflector.toSingularNoun(), 'writing a letter');
|
|
152
|
+
(0, node_assert_1.strictEqual)(inflector.toPluralNoun(), 'writings a letter');
|
|
153
|
+
(0, node_assert_1.strictEqual)(inflector.toPluralActor(), 'writers a letter');
|
|
154
|
+
});
|
|
155
|
+
(0, node_test_1.it)('pluralizes nouns taken from the object of the phrase', () => {
|
|
156
|
+
(0, node_assert_1.strictEqual)(inflect('make noise').toPluralNoun(), 'noises');
|
|
157
|
+
(0, node_assert_1.strictEqual)(inflect('bear fruit').toPluralNoun(), 'fruits');
|
|
158
|
+
(0, node_assert_1.strictEqual)(inflect('make noise').toPluralActor(), 'makers noise');
|
|
159
|
+
});
|
|
160
|
+
});
|
|
161
|
+
(0, node_test_1.describe)('capitalization', () => {
|
|
162
|
+
(0, node_test_1.it)('capitalizes the result when the verb was capitalized', () => {
|
|
163
|
+
const inflector = inflect('Destroy');
|
|
164
|
+
(0, node_assert_1.strictEqual)(inflector.toPresentParticiple(), 'Destroying');
|
|
165
|
+
(0, node_assert_1.strictEqual)(inflector.toPastTense(), 'Destroyed');
|
|
166
|
+
(0, node_assert_1.strictEqual)(inflector.toInfinitive(), 'To destroy');
|
|
167
|
+
});
|
|
168
|
+
});
|
|
169
|
+
(0, node_test_1.describe)('.toAdjective()', () => {
|
|
170
|
+
(0, node_test_1.it)('drops the leading "be" from a be phrase', () => {
|
|
171
|
+
(0, node_assert_1.strictEqual)(inflect('be quiet').toAdjective(), 'quiet');
|
|
172
|
+
});
|
|
173
|
+
(0, node_test_1.it)('uses the past participle otherwise', () => {
|
|
174
|
+
(0, node_assert_1.strictEqual)(inflect('destroy').toAdjective(), 'destroyed');
|
|
175
|
+
(0, node_assert_1.strictEqual)(inflect('write').toAdjective(), 'written');
|
|
176
|
+
});
|
|
177
|
+
});
|
|
178
|
+
});
|
|
179
|
+
//# sourceMappingURL=verb-inflector.js.map
|