@finbheara/names 0.17.0 → 0.18.0

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.
@@ -1,27 +0,0 @@
1
- import {
2
- isGiven2,
3
- isAmbiguous2,
4
- isPlace2,
5
- isTradename2
6
- } from "./index-0wpvbdgh.js";
7
-
8
- // src/lexicon/place.ts
9
- var JOINING_COMMA = /(?<=[^\s,]),(?=[^\s,])/g;
10
- function splitWords(s) {
11
- return s.replace(JOINING_COMMA, (comma, at) => /\d/.test(s[at - 1]) && /\d/.test(s[at + 1]) ? comma : ", ").split(/\s+/).filter(Boolean);
12
- }
13
- var FIELD_END = /[,-]+$/;
14
- function isPlaceWordFlags(flags) {
15
- return isPlace2(flags) && !isGiven2(flags) && !isAmbiguous2(flags) && !isTradename2(flags);
16
- }
17
- function isPlacePhrase(phrase, getFlags) {
18
- const words = splitWords(phrase).map((w) => w.replace(FIELD_END, "")).filter((w) => w !== "");
19
- if (words.length < 2)
20
- return false;
21
- return words.every((w) => isPlaceWordFlags(getFlags(w) ?? ""));
22
- }
23
-
24
- export { splitWords, FIELD_END, isPlaceWordFlags, isPlacePhrase };
25
-
26
- //# debugId=A9815F8EF12D8D4964756E2164756E21
27
- //# sourceMappingURL=index-tqdbxd92.js.map