-
Notifications
You must be signed in to change notification settings - Fork 0
/
phone-number.core.html
242 lines (242 loc) · 96 KB
/
phone-number.core.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
<!DOCTYPE html PUBLIC ""
"">
<html><head><meta charset="UTF-8" /><title>phone-number.core documentation</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/highlight.css" /><script type="text/javascript" src="js/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script><link rel="stylesheet" type="text/css" href="css/randomseed.css" /></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name">Phone-number</span> <span class="project-version">8.13.6-3</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 "><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Topics</span></h3><ul><li class="depth-1 "><a href="10_introduction.html"><div class="inner"><span>Introduction</span></div></a></li><li class="depth-1 "><a href="30_specs.html"><div class="inner"><span>Specs and checks</span></div></a></li><li class="depth-1 "><a href="40_development.html"><div class="inner"><span>Development</span></div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><a href="phone-number.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>phone-number</span></div></a></li><li class="depth-2 branch"><a href="phone-number.calling-code.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>calling-code</span></div></a></li><li class="depth-2 branch current"><a href="phone-number.core.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>core</span></div></a></li><li class="depth-2 branch"><a href="phone-number.cost.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>cost</span></div></a></li><li class="depth-2 branch"><a href="phone-number.country-code.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>country-code</span></div></a></li><li class="depth-2 branch"><a href="phone-number.db.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>db</span></div></a></li><li class="depth-2 branch"><a href="phone-number.format.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>format</span></div></a></li><li class="depth-2 branch"><a href="phone-number.leniency.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>leniency</span></div></a></li><li class="depth-2 branch"><a href="phone-number.locale.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>locale</span></div></a></li><li class="depth-2 branch"><a href="phone-number.match.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>match</span></div></a></li><li class="depth-2 branch"><a href="phone-number.net-code.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>net-code</span></div></a></li><li class="depth-2 branch"><a href="phone-number.region.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>region</span></div></a></li><li class="depth-2 branch"><a href="phone-number.type.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>type</span></div></a></li><li class="depth-2 branch"><a href="phone-number.tz-format.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>tz-format</span></div></a></li><li class="depth-2"><a href="phone-number.util.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>util</span></div></a></li></ul></div><div class="sidebar secondary"><h3><a href="#top"><span class="inner">Public Vars</span></a></h3><ul><li class="depth-1"><a href="phone-number.core.html#var-*default-dialing-region*"><div class="inner"><span>*default-dialing-region*</span></div></a></li><li class="depth-1"><a href="phone-number.core.html#var-*inferred-namespaces*"><div class="inner"><span>*inferred-namespaces*</span></div></a></li><li class="depth-1"><a href="phone-number.core.html#var-*info-dialing-region-derived*"><div class="inner"><span>*info-dialing-region-derived*</span></div></a></li><li class="depth-1"><a href="phone-number.core.html#var-*info-removed-nils*"><div class="inner"><span>*info-removed-nils*</span></div></a></li><li class="depth-1"><a href="phone-number.core.html#var-all-formats"><div class="inner"><span>all-formats</span></div></a></li><li class="depth-1"><a href="phone-number.core.html#var-allowed-input-characters"><div class="inner"><span>allowed-input-characters</span></div></a></li><li class="depth-1"><a href="phone-number.core.html#var-allowed-removable-characters"><div class="inner"><span>allowed-removable-characters</span></div></a></li><li class="depth-1"><a href="phone-number.core.html#var-calling-code"><div class="inner"><span>calling-code</span></div></a></li><li class="depth-1"><a href="phone-number.core.html#var-calling-code-prefix"><div class="inner"><span>calling-code-prefix</span></div></a></li><li class="depth-1"><a href="phone-number.core.html#var-calling-codes"><div class="inner"><span>calling-codes</span></div></a></li><li class="depth-1"><a href="phone-number.core.html#var-calling-codes-for-region"><div class="inner"><span>calling-codes-for-region</span></div></a></li><li class="depth-1"><a href="phone-number.core.html#var-carrier"><div class="inner"><span>carrier</span></div></a></li><li class="depth-1"><a href="phone-number.core.html#var-costs"><div class="inner"><span>costs</span></div></a></li><li class="depth-1"><a href="phone-number.core.html#var-country-codes"><div class="inner"><span>country-codes</span></div></a></li><li class="depth-1"><a href="phone-number.core.html#var-example"><div class="inner"><span>example</span></div></a></li><li class="depth-1"><a href="phone-number.core.html#var-example-non-geo"><div class="inner"><span>example-non-geo</span></div></a></li><li class="depth-1"><a href="phone-number.core.html#var-find-numbers"><div class="inner"><span>find-numbers</span></div></a></li><li class="depth-1"><a href="phone-number.core.html#var-format"><div class="inner"><span>format</span></div></a></li><li class="depth-1"><a href="phone-number.core.html#var-formats"><div class="inner"><span>formats</span></div></a></li><li class="depth-1"><a href="phone-number.core.html#var-generate"><div class="inner"><span>generate</span></div></a></li><li class="depth-1"><a href="phone-number.core.html#var-geographical.3F"><div class="inner"><span>geographical?</span></div></a></li><li class="depth-1"><a href="phone-number.core.html#var-has-calling-code.3F"><div class="inner"><span>has-calling-code?</span></div></a></li><li class="depth-1"><a href="phone-number.core.html#var-has-known-type.3F"><div class="inner"><span>has-known-type?</span></div></a></li><li class="depth-1"><a href="phone-number.core.html#var-has-location.3F"><div class="inner"><span>has-location?</span></div></a></li><li class="depth-1"><a href="phone-number.core.html#var-has-raw-input.3F"><div class="inner"><span>has-raw-input?</span></div></a></li><li class="depth-1"><a href="phone-number.core.html#var-has-region.3F"><div class="inner"><span>has-region?</span></div></a></li><li class="depth-1"><a href="phone-number.core.html#var-has-time-zone.3F"><div class="inner"><span>has-time-zone?</span></div></a></li><li class="depth-1"><a href="phone-number.core.html#var-impossible.3F"><div class="inner"><span>impossible?</span></div></a></li><li class="depth-1"><a href="phone-number.core.html#var-info"><div class="inner"><span>info</span></div></a></li><li class="depth-1"><a href="phone-number.core.html#var-invalid-example"><div class="inner"><span>invalid-example</span></div></a></li><li class="depth-1"><a href="phone-number.core.html#var-invalid.3F"><div class="inner"><span>invalid?</span></div></a></li><li class="depth-1"><a href="phone-number.core.html#var-is-fixed-line-or-mobile.3F"><div class="inner"><span>is-fixed-line-or-mobile?</span></div></a></li><li class="depth-1"><a href="phone-number.core.html#var-is-fixed-line.3F"><div class="inner"><span>is-fixed-line?</span></div></a></li><li class="depth-1"><a href="phone-number.core.html#var-is-maybe-fixed-line.3F"><div class="inner"><span>is-maybe-fixed-line?</span></div></a></li><li class="depth-1"><a href="phone-number.core.html#var-is-maybe-mobile.3F"><div class="inner"><span>is-maybe-mobile?</span></div></a></li><li class="depth-1"><a href="phone-number.core.html#var-is-maybe-short.3F"><div class="inner"><span>is-maybe-short?</span></div></a></li><li class="depth-1"><a href="phone-number.core.html#var-is-mobile.3F"><div class="inner"><span>is-mobile?</span></div></a></li><li class="depth-1"><a href="phone-number.core.html#var-is-pager.3F"><div class="inner"><span>is-pager?</span></div></a></li><li class="depth-1"><a href="phone-number.core.html#var-is-personal.3F"><div class="inner"><span>is-personal?</span></div></a></li><li class="depth-1"><a href="phone-number.core.html#var-is-premium-rate.3F"><div class="inner"><span>is-premium-rate?</span></div></a></li><li class="depth-1"><a href="phone-number.core.html#var-is-shared-cost.3F"><div class="inner"><span>is-shared-cost?</span></div></a></li><li class="depth-1"><a href="phone-number.core.html#var-is-short.3F"><div class="inner"><span>is-short?</span></div></a></li><li class="depth-1"><a href="phone-number.core.html#var-is-toll-free.3F"><div class="inner"><span>is-toll-free?</span></div></a></li><li class="depth-1"><a href="phone-number.core.html#var-is-uan.3F"><div class="inner"><span>is-uan?</span></div></a></li><li class="depth-1"><a href="phone-number.core.html#var-is-uncertain-fixed-line-or-mobile.3F"><div class="inner"><span>is-uncertain-fixed-line-or-mobile?</span></div></a></li><li class="depth-1"><a href="phone-number.core.html#var-is-unknown.3F"><div class="inner"><span>is-unknown?</span></div></a></li><li class="depth-1"><a href="phone-number.core.html#var-is-voicemail.3F"><div class="inner"><span>is-voicemail?</span></div></a></li><li class="depth-1"><a href="phone-number.core.html#var-is-voip.3F"><div class="inner"><span>is-voip?</span></div></a></li><li class="depth-1"><a href="phone-number.core.html#var-leniencies"><div class="inner"><span>leniencies</span></div></a></li><li class="depth-1"><a href="phone-number.core.html#var-locales"><div class="inner"><span>locales</span></div></a></li><li class="depth-1"><a href="phone-number.core.html#var-location"><div class="inner"><span>location</span></div></a></li><li class="depth-1"><a href="phone-number.core.html#var-match"><div class="inner"><span>match</span></div></a></li><li class="depth-1"><a href="phone-number.core.html#var-match-types"><div class="inner"><span>match-types</span></div></a></li><li class="depth-1"><a href="phone-number.core.html#var-match.3F"><div class="inner"><span>match?</span></div></a></li><li class="depth-1"><a href="phone-number.core.html#var-native.3F"><div class="inner"><span>native?</span></div></a></li><li class="depth-1"><a href="phone-number.core.html#var-net-codes"><div class="inner"><span>net-codes</span></div></a></li><li class="depth-1"><a href="phone-number.core.html#var-none"><div class="inner"><span>none</span></div></a></li><li class="depth-1"><a href="phone-number.core.html#var-numeric"><div class="inner"><span>numeric</span></div></a></li><li class="depth-1"><a href="phone-number.core.html#var-Phoneable"><div class="inner"><span>Phoneable</span></div></a></li><li class="depth-2 branch"><a href="phone-number.core.html#var-number"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>number</span></div></a></li><li class="depth-2 branch"><a href="phone-number.core.html#var-number-noraw"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>number-noraw</span></div></a></li><li class="depth-2 branch"><a href="phone-number.core.html#var-number-optraw"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>number-optraw</span></div></a></li><li class="depth-2 branch"><a href="phone-number.core.html#var-raw-input"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>raw-input</span></div></a></li><li class="depth-2 branch"><a href="phone-number.core.html#var-valid-input.3F"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>valid-input?</span></div></a></li><li class="depth-2"><a href="phone-number.core.html#var-valid.3F"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>valid?</span></div></a></li><li class="depth-1"><a href="phone-number.core.html#var-possible.3F"><div class="inner"><span>possible?</span></div></a></li><li class="depth-1"><a href="phone-number.core.html#var-re-two-digits"><div class="inner"><span>re-two-digits</span></div></a></li><li class="depth-1"><a href="phone-number.core.html#var-region"><div class="inner"><span>region</span></div></a></li><li class="depth-1"><a href="phone-number.core.html#var-region-for-calling-code"><div class="inner"><span>region-for-calling-code</span></div></a></li><li class="depth-1"><a href="phone-number.core.html#var-regions"><div class="inner"><span>regions</span></div></a></li><li class="depth-1"><a href="phone-number.core.html#var-regions-for-calling-code"><div class="inner"><span>regions-for-calling-code</span></div></a></li><li class="depth-1"><a href="phone-number.core.html#var-required-first-input-characters"><div class="inner"><span>required-first-input-characters</span></div></a></li><li class="depth-1"><a href="phone-number.core.html#var-short-carrier-specific.3F"><div class="inner"><span>short-carrier-specific?</span></div></a></li><li class="depth-1"><a href="phone-number.core.html#var-short-cost"><div class="inner"><span>short-cost</span></div></a></li><li class="depth-1"><a href="phone-number.core.html#var-short-emergency.3F"><div class="inner"><span>short-emergency?</span></div></a></li><li class="depth-1"><a href="phone-number.core.html#var-short-info"><div class="inner"><span>short-info</span></div></a></li><li class="depth-1"><a href="phone-number.core.html#var-short-invalid.3F"><div class="inner"><span>short-invalid?</span></div></a></li><li class="depth-1"><a href="phone-number.core.html#var-short-possible.3F"><div class="inner"><span>short-possible?</span></div></a></li><li class="depth-1"><a href="phone-number.core.html#var-short-sms-service.3F"><div class="inner"><span>short-sms-service?</span></div></a></li><li class="depth-1"><a href="phone-number.core.html#var-short-to-emergency.3F"><div class="inner"><span>short-to-emergency?</span></div></a></li><li class="depth-1"><a href="phone-number.core.html#var-short-valid.3F"><div class="inner"><span>short-valid?</span></div></a></li><li class="depth-1"><a href="phone-number.core.html#var-time-zones"><div class="inner"><span>time-zones</span></div></a></li><li class="depth-1"><a href="phone-number.core.html#var-time-zones-all-formats"><div class="inner"><span>time-zones-all-formats</span></div></a></li><li class="depth-1"><a href="phone-number.core.html#var-type"><div class="inner"><span>type</span></div></a></li><li class="depth-1"><a href="phone-number.core.html#var-types"><div class="inner"><span>types</span></div></a></li><li class="depth-1"><a href="phone-number.core.html#var-tz-formats"><div class="inner"><span>tz-formats</span></div></a></li><li class="depth-1"><a href="phone-number.core.html#var-valid-for-region.3F"><div class="inner"><span>valid-for-region?</span></div></a></li><li class="depth-1"><a href="phone-number.core.html#var-when-some-input"><div class="inner"><span>when-some-input</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">phone-number.core</h1><h4 class="added">added in 8.12.4-0</h4><div class="doc"><div class="markdown"><p>Clojure interface to Libphonenumber.</p>
</div></div><div class="public anchor" id="var-*default-dialing-region*"><h3>*default-dialing-region*</h3><h4 class="dynamic">dynamic</h4><h4 class="added">added in 8.12.4-1</h4><div class="usage"></div><div class="doc"><div class="markdown"><p>Sets a default dialing region (from where calls are originating) for functions that explicitly require dialing region code to be present (usually operating on short numbers). Default is nil.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/phone-number/tree/8.13.6-3/src/phone_number/core.clj#L58">view source</a></div></div><div class="public anchor" id="var-*inferred-namespaces*"><h3>*inferred-namespaces*</h3><h4 class="dynamic">dynamic</h4><h4 class="added">added in 8.12.4-0</h4><div class="usage"></div><div class="doc"><div class="markdown"><p>Decides whether keywords which are not fully-qualified should be automatically qualified (by attaching default namespaces) when passed as arguments to functions that operate on phone number types, phone number formats, region codes and time zone formats. Defaults to <code>true</code>.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/phone-number/tree/8.13.6-3/src/phone_number/core.clj#L67">view source</a></div></div><div class="public anchor" id="var-*info-dialing-region-derived*"><h3>*info-dialing-region-derived*</h3><h4 class="dynamic">dynamic</h4><h4 class="added">added in 8.12.4-1</h4><div class="usage"></div><div class="doc"><div class="markdown"><p>Decides whether some of the results of the info function should be calculated using dialing region code derived from the given region code if the dialing region was not passed as an argument nor obtained from the <code>*default-dialing-region*</code> dynamic variable. Default is <code>true</code>.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/phone-number/tree/8.13.6-3/src/phone_number/core.clj#L48">view source</a></div></div><div class="public anchor" id="var-*info-removed-nils*"><h3>*info-removed-nils*</h3><h4 class="dynamic">dynamic</h4><h4 class="added">added in 8.12.4-0</h4><div class="usage"></div><div class="doc"><div class="markdown"><p>Decides whether the results of the info function should contain properties having <code>nil</code> values. They are removed by default due to <code>true</code> value of this switch.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/phone-number/tree/8.13.6-3/src/phone_number/core.clj#L40">view source</a></div></div><div class="public anchor" id="var-all-formats"><h3>all-formats</h3><h4 class="added">added in 8.12.4-0</h4><div class="usage"><code>(all-formats phone-number)</code><code>(all-formats phone-number region-code)</code></div><div class="doc"><div class="markdown"><p>Takes a phone number (expressed as a string, a number, a map or a <code>PhoneNumber</code> object) and returns a map which keys are all possible formats expressed as keywords and values are string representations of the number formatted accordingly.</p>
<p>If the second argument is present then it should be a valid region code (a keyword) to be used when the given phone number does not contain region information.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/phone-number/tree/8.13.6-3/src/phone_number/core.clj#L822">view source</a></div></div><div class="public anchor" id="var-allowed-input-characters"><h3>allowed-input-characters</h3><h4 class="added">added in 8.12.4-1</h4><h4 class="deprecated">deprecated in 8.13.6-2</h4><div class="usage"></div><div class="doc"><div class="markdown"><p>A set of allowed characters in a phone number which is a string (applied to all characters except the first 3 on a string cleaned up from removable characters).</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/phone-number/tree/8.13.6-3/src/phone_number/core.clj#L109">view source</a></div></div><div class="public anchor" id="var-allowed-removable-characters"><h3>allowed-removable-characters</h3><h4 class="added">added in 8.12.4-1</h4><h4 class="deprecated">deprecated in 8.13.6-2</h4><div class="usage"></div><div class="doc"><div class="markdown"><p>A set of removable (like punctuation) characters in a phone number which is a string. Used during input validation.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/phone-number/tree/8.13.6-3/src/phone_number/core.clj#L102">view source</a></div></div><div class="public anchor" id="var-calling-code"><h3>calling-code</h3><h4 class="added">added in 8.12.4-0</h4><div class="usage"><code>(calling-code phone-number)</code><code>(calling-code phone-number region-code)</code></div><div class="doc"><div class="markdown"><p>Takes a phone number (expressed as a string, a number, a map or a <code>PhoneNumber</code> object) and returns its calling code as an integer number.</p>
<p>If the second argument is present then it should be a valid region code (a keyword) to be used when the given phone number does not contain region information.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/phone-number/tree/8.13.6-3/src/phone_number/core.clj#L879">view source</a></div></div><div class="public anchor" id="var-calling-code-prefix"><h3>calling-code-prefix</h3><h4 class="added">added in 8.12.16-1</h4><div class="usage"><code>(calling-code-prefix phone-number)</code><code>(calling-code-prefix phone-number region-code)</code></div><div class="doc"><div class="markdown"><p>Takes a phone number (expressed as a string, a number, a map or a <code>PhoneNumber</code> object) and returns its calling code prefix (including a plus symbol) as a string.</p>
<p>If the second argument is present then it should be a valid region code (a keyword) to be used when the given phone number does not contain region information.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/phone-number/tree/8.13.6-3/src/phone_number/core.clj#L894">view source</a></div></div><div class="public anchor" id="var-calling-codes"><h3>calling-codes</h3><h4 class="added">added in 8.12.4-0</h4><div class="usage"></div><div class="doc"><div class="markdown"><p>A set of all possible country calling codes.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/phone-number/tree/8.13.6-3/src/phone_number/core.clj#L138">view source</a></div></div><div class="public anchor" id="var-calling-codes-for-region"><h3>calling-codes-for-region</h3><h4 class="added">added in 8.12.16-1</h4><div class="usage"><code>(calling-codes-for-region region-code)</code></div><div class="doc"><div class="markdown"><p>Returns a set of all calling codes (integer numbers) associated with the given region code (keyword) which may also be <code>:phone-number.region/world</code> pseudo-region.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/phone-number/tree/8.13.6-3/src/phone_number/core.clj#L1988">view source</a></div></div><div class="public anchor" id="var-carrier"><h3>carrier</h3><h4 class="added">added in 8.12.4-0</h4><div class="usage"><code>(carrier phone-number)</code><code>(carrier phone-number region-code)</code><code>(carrier phone-number locale-specification-FQ)</code><code>(carrier phone-number region-code locale-specification)</code></div><div class="doc"><div class="markdown"><p>Takes a phone number (expressed as a string, a number, a map or a <code>PhoneNumber</code> object) and returns its possible carrier name as a string or <code>nil</code> if the carrier name happens to be empty.</p>
<p>If the second argument is present then it may be a valid region code (a keyword) to be used when the given phone number does not contain region information. It is acceptable to pass <code>nil</code> as a value to tell the function that there is no explicit region information and it should extract it from a number.</p>
<p>If the third argument is present then it should be a string specifying locale information or a <code>java.util.Locale</code> object. It will be used during rendering carrier name. When <code>nil</code> is passed then the default locale settings will be used.</p>
<p>If there are 2 arguments and the second argument is a keyword but IS NOT a <strong>fully-qualified, valid locale specification</strong> (<code>locale-specification-FQ</code> having namespace set to <code>phone-number.locale</code>) then it will be treated as a <strong>region code</strong>. Using namespaced keyword for a locale (or using object other than keyword) is required to avoid ambiguity since simple region codes and locale specs can be expressed using the very same keyword names. Optionally (but a bad habit) you may use simple keyword with locale and variant (e.g. <code>:pl_PL</code>) that will not match any region but match locale object.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/phone-number/tree/8.13.6-3/src/phone_number/core.clj#L1028">view source</a></div></div><div class="public anchor" id="var-costs"><h3>costs</h3><h4 class="added">added in 8.12.4-0</h4><div class="usage"></div><div class="doc"><div class="markdown"><p>A set of all possible phone number cost classes as a set of keywords.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/phone-number/tree/8.13.6-3/src/phone_number/core.clj#L173">view source</a></div></div><div class="public anchor" id="var-country-codes"><h3>country-codes</h3><h4 class="added">added in 8.12.4-0</h4><div class="usage"></div><div class="doc"><div class="markdown"><p>A set of all possible country calling codes.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/phone-number/tree/8.13.6-3/src/phone_number/core.clj#L133">view source</a></div></div><div class="public anchor" id="var-example"><h3>example</h3><h4 class="added">added in 8.12.4-0</h4><div class="usage"><code>(example region-code)</code><code>(example region-code number-type)</code></div><div class="doc"><div class="markdown"><p>For the given region code and optional number type returns an example phone number that is valid (being a <code>PhoneNumber</code> kind of object). This is not a random number generator; it will always generate the same example number for the same arguments.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/phone-number/tree/8.13.6-3/src/phone_number/core.clj#L2214">view source</a></div></div><div class="public anchor" id="var-example-non-geo"><h3>example-non-geo</h3><h4 class="added">added in 8.12.4-0</h4><div class="usage"><code>(example-non-geo calling-code _)</code><code>(example-non-geo calling-code)</code></div><div class="doc"><div class="markdown"><p>For the given network global calling code (given as a positive, natural number) returns the example phone number that is valid (being a <code>PhoneNumber</code> kind of object). This is not a random number generator; it will always generate the same example number for the same arguments.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/phone-number/tree/8.13.6-3/src/phone_number/core.clj#L2199">view source</a></div></div><div class="public anchor" id="var-find-numbers"><h3>find-numbers</h3><h4 class="added">added in 8.12.4-0</h4><div class="usage"><code>(find-numbers text)</code><code>(find-numbers text region-code)</code><code>(find-numbers text leniency)</code><code>(find-numbers text region-code leniency)</code><code>(find-numbers text region-code locale-specification)</code><code>(find-numbers text region-code max-tries)</code><code>(find-numbers text leniency max-tries)</code><code>(find-numbers text leniency locale-specification)</code><code>(find-numbers text region-code leniency max-tries)</code><code>(find-numbers text region-code locale-specification dialing-region)</code><code>(find-numbers text region-code leniency max-tries locale-specification)</code><code>(find-numbers text region-code leniency max-tries dialing-region-FQ)</code><code>(find-numbers text region-code leniency max-tries locale-specification dialing-region)</code></div><div class="doc"><div class="markdown"><p>Searches for phone numbers in the given text. Returns a lazy sequence of maps where each element is a map representing a match and having the following keys:</p>
<ul>
<li><code>:phone-number.match/start</code> - start index of a phone number substring</li>
<li><code>:phone-number.match/end</code> - end index of a phone number substring</li>
<li><code>:phone-number.match/raw-string</code> - phone number substring</li>
<li><code>:phone-number/number</code> - phone number object</li>
<li><code>:phone-number/info</code> - optional info object (lazily evaluated)</li>
</ul>
<p>Phone number object is suitable to be used with majority of functions from the core. It is a mutable Java object so be careful!</p>
<p>Optional but highly recommended <code>region-code</code> argument should be a region code to be used as a hint when looking for numbers without any calling code prefix.</p>
<p>The <code>leniency</code> argument sets the matching leniency level during searching. Possible levels are:</p>
<ul>
<li>
<p><code>:phone-number.leniency/exact</code> – accepts valid phone numbers that are formatted in a standard way (or as a single block)</p>
</li>
<li>
<p><code>:phone-number.leniency/possible</code> – accepts possible phone numbers (including invalid ones)</p>
</li>
<li>
<p><code>:phone-number.leniency/strict</code> –accepts valid phone numbers that are possible for the locale (and its formatting rules)</p>
</li>
<li>
<p><code>:phone-number.leniency/valid</code> – accepts possible AND valid phone numbers (this is default)</p>
</li>
</ul>
<p>If it’s <code>nil</code> then it will be set to a default (<code>:phone-number.leniency/valid</code>).</p>
<p>The <code>max-tries</code> argument tells the searching engine to deliver only certain number of matches. If it’s not given then the maximum value of type <code>Long</code> will be used.</p>
<p>The <code>locale-specification</code> and <code>dialing-region</code> are not used during searching but when the map under <code>:phone-number/info</code> key is generated. They are passed to the <code>info</code> function. Note that setting <code>dialing-region</code> explicitly to <code>nil</code> will disable it from being derived from the detected region (yet it will still default to current value of the <code>phone-number/*default-dialing-region*</code> if it’s set) value. To preserve default behaviour (derivation plus using the default from a dynamic variable) and explicitly pass this argument, use <code>false</code>.</p>
<p>All keyword arguments except <code>locale-specification</code> (which can also be of other type) are namespace inferred if <code>*inferred-namespace*</code> dynamic variable is set in the calling context.</p>
<p>Some arities can have different variants (depending on the given arguments). It’s possible to detect when keywords describing different things are not conflicting. The exception is when we have two final arguments which cannot be easily distinguished without namespacing since they may have overlapping values (like <code>:pl</code> as a dialing region and <code>:pl</code> as a locale specification). To use shortened arity with them and allow function to properly detect what kind of data it’s dealing with, please use <strong>fully-qualified keywords</strong> to describe <strong>a dialing region</strong>. Keyword without a proper namespace will be treated as locale specification on this argument position.</p>
<p>For the sake of efficiency it is possible to entirely disable generation of a map under the <code>:phone-number/info</code> key. To do that just use arity with <code>locale-specification</code> and set the value of this argument to <code>false</code>. For argument values that you wish to be kept as default, use nil.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/phone-number/tree/8.13.6-3/src/phone_number/core.clj#L2016">view source</a></div></div><div class="public anchor" id="var-format"><h3>format</h3><h4 class="added">added in 8.12.4-0</h4><div class="usage"><code>(format phone-number)</code><code>(format phone-number region-code)</code><code>(format phone-number format-specification)</code><code>(format phone-number region-code format-specification)</code></div><div class="doc"><div class="markdown"><p>Takes a phone number (expressed as a string, a number, a map or a <code>PhoneNumber</code> object) and returns it as a formatted string. The last argument should be a format expressed as a keyword (use the all-formats function to list them) or a PhoneNumberType.</p>
<p>If the second argument is present (and there are 3 arguments) then it should be a valid region code (a keyword) to be used when the given phone number does not contain region information.</p>
<p>If there are 2 arguments and the second argument is a valid format specification it will be used without setting the region. If the format specification doesn’t look like a valid format then it will be assumed it is a region code and format will be set to a default.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/phone-number/tree/8.13.6-3/src/phone_number/core.clj#L779">view source</a></div></div><div class="public anchor" id="var-formats"><h3>formats</h3><h4 class="added">added in 8.12.4-0</h4><div class="usage"></div><div class="doc"><div class="markdown"><p>A set of all possible phone number formats as a set of keywords.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/phone-number/tree/8.13.6-3/src/phone_number/core.clj#L143">view source</a></div></div><div class="public anchor" id="var-generate"><h3>generate</h3><h4 class="added">added in 8.12.4-0</h4><div class="usage"><code>(generate)</code><code>(generate region-code)</code><code>(generate region-code number-type)</code><code>(generate region-code number-type predicate)</code><code>(generate region-code number-type predicate retries)</code><code>(generate region-code number-type predicate retries min-digits)</code><code>(generate region-code number-type predicate retries min-digits locale-specification)</code><code>(generate region-code number-type predicate retries min-digits locale-specification random-seed)</code><code>(generate region-code number-type predicate retries min-digits locale-specification random-seed early-shrinking)</code><code>(generate region-code number-type predicate retries min-digits locale-specification random-seed early-shrinking preserve-raw)</code></div><div class="doc"><div class="markdown"><p>Generates random phone number in a form of a map with the following keys:</p>
<ul>
<li><code>:phone-number/number</code> - a <code>PhoneNumber</code> object</li>
<li><code>:phone-number/info</code> - a map with phone number information (evaluated on access)</li>
<li><code>:phone-number.sample/hits</code> - a number of valid hits encountered during sampling</li>
<li><code>:phone-number.sample/digits</code> - a vector with used calling code prefix, template part and random part</li>
<li><code>:phone-number.sample/max-samples</code> - a maximum number of samples declared</li>
<li><code>:phone-number.sample/samples</code> - a number of samples processed before the result was formed</li>
<li><code>:phone-number.sample/random-seed</code> – random seed used to initialize pseudo-random generator</li>
</ul>
<p>It is important to note that the result may be valid or invalid phone number. To get only valid number pass the valid? predicate function as the third argument (described later).</p>
<p>Without any arguments it generates any geographical number of any possible region and type.</p>
<p>When the first argument is present it should be a valid region code and the result will be a number that belongs to that region. It is possible to pass <code>nil</code> as a value (in order to make use of other positional arguments). In such case the region will be picked up randomly.</p>
<p>When the second argument is present it should be a valid number type and the result will be a number that is of that type. It is possible to pass <code>nil</code> as a value (in order to make use of other positional arguments). In such case the type will be picked up randomly.</p>
<p>When the third argument is present it should be a predicate function used by samples generator to look for a number for which the function returns truthy value (not <code>false</code> and not <code>nil</code>). It is possible to pass <code>nil</code> as a value to disable this check.</p>
<p>When the fourth argument is present it should be a maximal number of attempts the internal sampler will perform to get the desired sample. By default it will try to get the sample that meets the criteria (country code, type and a custom predicate) in 1000 attempts but when the supplied predicate makes it too improbable to get the desired result the operation may fail and this number should be increased. It is possible to pass <code>nil</code> as a value. In such case the default will be used. It is also possible to pass <code>false</code> as a value. In such case the sampler will continue indefinitely which poses the risk of freezing the program for complicated or impossible conditions.</p>
<p>It is important to know that even relatively low retry counts will produce valid results in most cases. This is due to randomization strategy the internal sampler uses. It starts by taking an initial, template number returned by the example function. This number is valid but may not fulfill additional criteria. If it fulfills them it is memorized and the next, more fuzzed variant is tried with last digit replaced by a randomly generated one. If such number is also valid it is memorized and the randomization continues until all digits (except the country code plus the static part described later) are randomized. When that happens the result is returned if it fulfills all of the validation criteria or the number of retries reaches the given maximal value. If the final result (after all the trials) is not valid then the memorized number is returned.</p>
<p>The fifth argument, when present, should be a minimal number of digits in regional part of the number that are accepted as a result. If it is not given the default of 3 is assumed.</p>
<p>When the sixth argument is present it should be a valid locale specification or a <code>java.util.Locale</code> object that will be passed to the info function in order to render localized versions of time zone information and geographical locations.</p>
<p>The seventh argument should be a long value that will seed the pseudo-random number generator used to produce digits and to choose region and/or phone number type when not given. It can be used to create a deterministic sequence of samples.</p>
<p>The eight, optional argument enables more aggressive shrinking of randomly generated part. If it is set to a truthy value (not <code>nil</code> and not <code>false</code>) then each sampling step that involves generation of random digits will have 50% chances of producing less digits than required (at least 1 digit remaining). The number of digits is chosen randomly. It is advised to enable shrinking when expecting highly improbable phone numbers, for instance with the impossible? predicate.</p>
<p>The last, optional argument chooses whether raw input should be preserved within the PhoneNumber objects when generating samples. By default it is not preserved.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/phone-number/tree/8.13.6-3/src/phone_number/core.clj#L2315">view source</a></div></div><div class="public anchor" id="var-geographical.3F"><h3>geographical?</h3><h4 class="added">added in 8.12.4-0</h4><div class="usage"><code>(geographical? phone-number)</code><code>(geographical? phone-number region-code)</code></div><div class="doc"><div class="markdown"><p>Takes a phone number (expressed as a string, a number, a map or a <code>PhoneNumber</code> object) and returns <code>true</code> if it is a geographical number as defined by Libphonenumber. Otherwise it returns <code>false</code>. If the second argument is present then it should be a valid region code (a keyword) to be used when the given phone number does not contain region information.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/phone-number/tree/8.13.6-3/src/phone_number/core.clj#L1007">view source</a></div></div><div class="public anchor" id="var-has-calling-code.3F"><h3>has-calling-code?</h3><h4 class="added">added in 8.12.4-0</h4><div class="usage"><code>(has-calling-code? phone-number)</code><code>(has-calling-code? phone-number region-code)</code></div><div class="doc"><div class="markdown"><p>For the given phone number returns <code>true</code> if the calling code is present in it, <code>false</code> otherwise. The region code can be explicit part of a number (as its prefix) or can be inferred by making use of the region-code argument.</p>
<p>This function will always return <code>true</code> if a phone number was successfully parsed.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/phone-number/tree/8.13.6-3/src/phone_number/core.clj#L1923">view source</a></div></div><div class="public anchor" id="var-has-known-type.3F"><h3>has-known-type?</h3><h4 class="added">added in 8.12.4-0</h4><div class="usage"><code>(has-known-type? phone-number)</code><code>(has-known-type? phone-number region-code)</code></div><div class="doc"><div class="markdown"><p>Returns <code>true</code> if the given number is of a known type, <code>false</code> otherwise.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/phone-number/tree/8.13.6-3/src/phone_number/core.clj#L1897">view source</a></div></div><div class="public anchor" id="var-has-location.3F"><h3>has-location?</h3><h4 class="added">added in 8.12.4-0</h4><div class="usage"><code>(has-location? phone-number)</code><code>(has-location? phone-number region-code)</code></div><div class="doc"><div class="markdown"><p>For the given phone number returns <code>true</code> if the approximate geographic location is present in it, <code>false</code> otherwise.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/phone-number/tree/8.13.6-3/src/phone_number/core.clj#L1940">view source</a></div></div><div class="public anchor" id="var-has-raw-input.3F"><h3>has-raw-input?</h3><h4 class="added">added in 8.12.4-1</h4><div class="usage"><code>(has-raw-input? phone-number)</code><code>(has-raw-input? phone-number region-code)</code></div><div class="doc"><div class="markdown"><p>Checks whether raw input string can be obtained from the given phone number.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/phone-number/tree/8.13.6-3/src/phone_number/core.clj#L763">view source</a></div></div><div class="public anchor" id="var-has-region.3F"><h3>has-region?</h3><h4 class="added">added in 8.12.4-0</h4><div class="usage"><code>(has-region? phone-number)</code><code>(has-region? phone-number region-code)</code></div><div class="doc"><div class="markdown"><p>For the given phone number returns <code>true</code> if the region code is present in it, false otherwise. The region code can be explicit part of a number (as its prefix) or can be inferred by making use of the region-code argument.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/phone-number/tree/8.13.6-3/src/phone_number/core.clj#L1911">view source</a></div></div><div class="public anchor" id="var-has-time-zone.3F"><h3>has-time-zone?</h3><h4 class="added">added in 8.12.4-0</h4><div class="usage"><code>(has-time-zone? phone-number)</code><code>(has-time-zone? phone-number region-code)</code></div><div class="doc"><div class="markdown"><p>For the given phone number returns <code>true</code> if any time zone information is present in it, <code>false</code> otherwise.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/phone-number/tree/8.13.6-3/src/phone_number/core.clj#L1951">view source</a></div></div><div class="public anchor" id="var-impossible.3F"><h3>impossible?</h3><h4 class="added">added in 8.12.4-0</h4><div class="usage"><code>(impossible? phone-number)</code><code>(impossible? phone-number region-code)</code></div><div class="doc"><div class="markdown"><p>Returns <code>true</code> if the given phone number (expressed as a string, a number, a map or a <code>PhoneNumber</code> object) is not possible.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/phone-number/tree/8.13.6-3/src/phone_number/core.clj#L746">view source</a></div></div><div class="public anchor" id="var-info"><h3>info</h3><h4 class="added">added in 8.12.4-0</h4><div class="usage"><code>(info phone-number)</code><code>(info phone-number region-code)</code><code>(info phone-number locale-specification-FQ)</code><code>(info phone-number region-code locale-specification)</code><code>(info phone-number region-code dialing-region-FQ)</code><code>(info phone-number region-code locale-specification dialing-region)</code></div><div class="doc"><div class="markdown"><p>Takes a phone number (expressed as a string, a number, a map or a <code>PhoneNumber</code> object) and returns a map containing all possible information about the number with keywords as keys.</p>
<p>Required keys:</p>
<pre><code>:phone-number/calling-code
:phone-number/geographical?
:phone-number/possible?
:phone-number/valid?
:phone-number/type
:phone-number.short/valid?
:phone-number.short/possible?
</code></pre>
<p>Optional keys:</p>
<pre><code>:phone-number/region
:phone-number/location
:phone-number/carrier
:phone-number/dialing-region
:phone-number.dialing-region/derived?
:phone-number.dialing-region/defaulted?
:phone-number.dialing-region/valid-for?
:phone-number.format/e164
:phone-number.format/international
:phone-number.format/national
:phone-number.format/rfc3966
:phone-number.format/raw-input
:phone-number.tz-format/narrow-global
:phone-number.tz-format/full
:phone-number.tz-format/short
:phone-number.tz-format/narrow
:phone-number.tz-format/full-global
:phone-number.tz-format/short-global
:phone-number.tz-format/id
:phone-number.short/carrier-specific?
:phone-number.short/cost
:phone-number.short/emergency?
:phone-number.short/sms-service?
:phone-number.short/to-emergency?
</code></pre>
<p>Keys with <code>nil</code> values assigned will be removed from the map unless the dynamic variable <code>*info-removed-nils*</code> is bound to false.</p>
<p>If the second argument is present then it may be a valid region code (a keyword) to be used when the given phone number does not contain region information. It is acceptable to pass <code>nil</code> as a value to tell the function that there is no explicit region information and it should extract it from a number.</p>
<p>If the second argument is a locale specification (<code>locale-specification-FQ</code>) then it should be a <strong>fully-qualified keyword</strong> using <code>phone-number.locale</code> namespace (or an <strong>object that is not a keyword</strong>) in order to distinguish it from a region code (which is favored as this argument). Optionally (but a bad habit) you may use simple keyword with locale and variant (e.g. <code>:pl_PL</code>) that will not match any region but match locale object.</p>
<p>If the third argument is present then it may be a string specifying locale information or a Locale object. It will be used during rendering strings describing geographic location, carrier data and full time zone information. When <code>nil</code> is passed then default locale settings will be used.</p>
<p>If the third argument is a dialing region code (<code>dialing-region-FQ</code>) then it should be a <strong>fully-qualified keyword</strong> (using <code>phone-number.region</code> namespace) in order to distinguish it from a locale specification (which is favored as this argument).</p>
<p>If there are four arguments then the last one should be a dialing region code intended to be used with short numbers (like 112 etc.). It describes originating region to help validate the possibility of reaching the destination number. When this argument is missing or its value is <code>nil</code> and the dynamic variable <code>*default-dialing-region*</code> is not <code>nil</code> then its value will be used to set the dialing region. If the dynamic variable is also <code>nil</code> (which is the default) then the dynamic variable <code>*info-dialing-region-derived*</code> is checked to be set to truthy value (not <code>nil</code> and not <code>false</code>). If that is <code>true</code> then the dialing region will be derived from a region code of the number.</p>
<p>The <code>:phone-number/valid?</code> key holds the return value of <code>valid?</code> function call without any dialing region applied (even if it is passed as an argument or extracted from a map given as input to the <code>info</code> function). There is also the <code>:phone-number.dialing-region/valid-for?</code> key which holds the validity information taking dialing region (passed, extracted or default) into account.</p>
<p>It is important to realize that certain properties of short numbers can only be successfully calculated if the unprocessed form of a number (a string or a natural number) does not contain country code and so it is delivered as it would be dialed. It is advised to pass a region code as the second argument when short numbers are analysed. It is also advised to submit a dialing region code when more precise analysis is required.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/phone-number/tree/8.13.6-3/src/phone_number/core.clj#L1591">view source</a></div></div><div class="public anchor" id="var-invalid-example"><h3>invalid-example</h3><h4 class="added">added in 8.12.4-0</h4><div class="usage"><code>(invalid-example region-code)</code></div><div class="doc"><div class="markdown"><p>For the given region code returns the example phone number that is invalid (being a <code>PhoneNumber</code> kind of object). This is not a random number generator; it will always generate the same example number for the same arguments.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/phone-number/tree/8.13.6-3/src/phone_number/core.clj#L2187">view source</a></div></div><div class="public anchor" id="var-invalid.3F"><h3>invalid?</h3><h4 class="added">added in 8.12.4-0</h4><div class="usage"><code>(invalid? phone-number)</code><code>(invalid? phone-number region-code)</code></div><div class="doc"><div class="markdown"><p>Returns <code>true</code> if the given phone number (expressed as a string, a number, a map or a <code>PhoneNumber</code> object) is not valid.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/phone-number/tree/8.13.6-3/src/phone_number/core.clj#L719">view source</a></div></div><div class="public anchor" id="var-is-fixed-line-or-mobile.3F"><h3>is-fixed-line-or-mobile?</h3><h4 class="added">added in 8.12.4-0</h4><div class="usage"><code>(is-fixed-line-or-mobile? phone-number)</code><code>(is-fixed-line-or-mobile? phone-number region-code)</code></div><div class="doc"><div class="markdown"><p>Returns <code>true</code> if the given number is a kind of fixed-line number or a mobile number, <code>false</code> otherwise. Returns <code>true</code> also when there is a chance that a number is either mobile or fixed-line but it cannot be certainly decided.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/phone-number/tree/8.13.6-3/src/phone_number/core.clj#L1839">view source</a></div></div><div class="public anchor" id="var-is-fixed-line.3F"><h3>is-fixed-line?</h3><h4 class="added">added in 8.12.4-0</h4><div class="usage"><code>(is-fixed-line? phone-number)</code><code>(is-fixed-line? phone-number region-specification)</code></div><div class="doc"><div class="markdown"><p>Returns true when type is :phone-number.type/fixed-line, false otherwise.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/phone-number/tree/8.13.6-3/src/phone_number/core.clj#L1820">view source</a></div></div><div class="public anchor" id="var-is-maybe-fixed-line.3F"><h3>is-maybe-fixed-line?</h3><h4 class="added">added in 8.12.4-0</h4><div class="usage"><code>(is-maybe-fixed-line? phone-number)</code><code>(is-maybe-fixed-line? phone-number region-code)</code></div><div class="doc"><div class="markdown"><p>Returns <code>true</code> if the given number is a kind of a fixed-line number or a number that belongs to a class where it cannot be fully decided whether it is mobile or fixed-line. Returns <code>false</code> otherwise.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/phone-number/tree/8.13.6-3/src/phone_number/core.clj#L1882">view source</a></div></div><div class="public anchor" id="var-is-maybe-mobile.3F"><h3>is-maybe-mobile?</h3><h4 class="added">added in 8.12.4-0</h4><div class="usage"><code>(is-maybe-mobile? phone-number)</code><code>(is-maybe-mobile? phone-number region-code)</code></div><div class="doc"><div class="markdown"><p>Returns <code>true</code> if the given number is a kind of a mobile number or a number that belongs to a class where it cannot be fully decided whether it is mobile or fixed-line. Returns <code>false</code> otherwise.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/phone-number/tree/8.13.6-3/src/phone_number/core.clj#L1867">view source</a></div></div><div class="public anchor" id="var-is-maybe-short.3F"><h3>is-maybe-short?</h3><h4 class="added">added in 8.12.4-0</h4><div class="usage"></div><div class="doc"><div class="markdown"><p>Same as short-possible?</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/phone-number/tree/8.13.6-3/src/phone_number/core.clj#L1829">view source</a></div></div><div class="public anchor" id="var-is-mobile.3F"><h3>is-mobile?</h3><h4 class="added">added in 8.12.4-0</h4><div class="usage"><code>(is-mobile? phone-number)</code><code>(is-mobile? phone-number region-specification)</code></div><div class="doc"><div class="markdown"><p>Returns true when type is :phone-number.type/mobile, false otherwise.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/phone-number/tree/8.13.6-3/src/phone_number/core.clj#L1820">view source</a></div></div><div class="public anchor" id="var-is-pager.3F"><h3>is-pager?</h3><h4 class="added">added in 8.12.4-0</h4><div class="usage"><code>(is-pager? phone-number)</code><code>(is-pager? phone-number region-specification)</code></div><div class="doc"><div class="markdown"><p>Returns true when type is :phone-number.type/pager, false otherwise.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/phone-number/tree/8.13.6-3/src/phone_number/core.clj#L1820">view source</a></div></div><div class="public anchor" id="var-is-personal.3F"><h3>is-personal?</h3><h4 class="added">added in 8.12.4-0</h4><div class="usage"><code>(is-personal? phone-number)</code><code>(is-personal? phone-number region-specification)</code></div><div class="doc"><div class="markdown"><p>Returns true when type is :phone-number.type/personal, false otherwise.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/phone-number/tree/8.13.6-3/src/phone_number/core.clj#L1820">view source</a></div></div><div class="public anchor" id="var-is-premium-rate.3F"><h3>is-premium-rate?</h3><h4 class="added">added in 8.12.4-0</h4><div class="usage"><code>(is-premium-rate? phone-number)</code><code>(is-premium-rate? phone-number region-specification)</code></div><div class="doc"><div class="markdown"><p>Returns true when type is :phone-number.type/premium-rate, false otherwise.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/phone-number/tree/8.13.6-3/src/phone_number/core.clj#L1820">view source</a></div></div><div class="public anchor" id="var-is-shared-cost.3F"><h3>is-shared-cost?</h3><h4 class="added">added in 8.12.4-0</h4><div class="usage"><code>(is-shared-cost? phone-number)</code><code>(is-shared-cost? phone-number region-specification)</code></div><div class="doc"><div class="markdown"><p>Returns true when type is :phone-number.type/shared-cost, false otherwise.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/phone-number/tree/8.13.6-3/src/phone_number/core.clj#L1820">view source</a></div></div><div class="public anchor" id="var-is-short.3F"><h3>is-short?</h3><h4 class="added">added in 8.12.4-0</h4><div class="usage"></div><div class="doc"><div class="markdown"><p>Same as short-valid?</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/phone-number/tree/8.13.6-3/src/phone_number/core.clj#L1824">view source</a></div></div><div class="public anchor" id="var-is-toll-free.3F"><h3>is-toll-free?</h3><h4 class="added">added in 8.12.4-0</h4><div class="usage"><code>(is-toll-free? phone-number)</code><code>(is-toll-free? phone-number region-specification)</code></div><div class="doc"><div class="markdown"><p>Returns true when type is :phone-number.type/toll-free, false otherwise.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/phone-number/tree/8.13.6-3/src/phone_number/core.clj#L1820">view source</a></div></div><div class="public anchor" id="var-is-uan.3F"><h3>is-uan?</h3><h4 class="added">added in 8.12.4-0</h4><div class="usage"><code>(is-uan? phone-number)</code><code>(is-uan? phone-number region-specification)</code></div><div class="doc"><div class="markdown"><p>Returns true when type is :phone-number.type/uan, false otherwise.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/phone-number/tree/8.13.6-3/src/phone_number/core.clj#L1820">view source</a></div></div><div class="public anchor" id="var-is-uncertain-fixed-line-or-mobile.3F"><h3>is-uncertain-fixed-line-or-mobile?</h3><h4 class="added">added in 8.12.4-0</h4><div class="usage"><code>(is-uncertain-fixed-line-or-mobile? phone-number)</code><code>(is-uncertain-fixed-line-or-mobile? phone-number region-code)</code></div><div class="doc"><div class="markdown"><p>Returns <code>true</code> if the given number belongs to a class of numbers that cannot be certainly decided as being mobile or fixed-line, <code>false</code> otherwise. Please note that it will return <code>false</code> for mobile or fixed-line numbers that are certainly classified as such.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/phone-number/tree/8.13.6-3/src/phone_number/core.clj#L1854">view source</a></div></div><div class="public anchor" id="var-is-unknown.3F"><h3>is-unknown?</h3><h4 class="added">added in 8.12.4-0</h4><div class="usage"><code>(is-unknown? phone-number)</code><code>(is-unknown? phone-number region-specification)</code></div><div class="doc"><div class="markdown"><p>Returns true when type is :phone-number.type/unknown, false otherwise.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/phone-number/tree/8.13.6-3/src/phone_number/core.clj#L1820">view source</a></div></div><div class="public anchor" id="var-is-voicemail.3F"><h3>is-voicemail?</h3><h4 class="added">added in 8.12.4-0</h4><div class="usage"><code>(is-voicemail? phone-number)</code><code>(is-voicemail? phone-number region-specification)</code></div><div class="doc"><div class="markdown"><p>Returns true when type is :phone-number.type/voicemail, false otherwise.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/phone-number/tree/8.13.6-3/src/phone_number/core.clj#L1820">view source</a></div></div><div class="public anchor" id="var-is-voip.3F"><h3>is-voip?</h3><h4 class="added">added in 8.12.4-0</h4><div class="usage"><code>(is-voip? phone-number)</code><code>(is-voip? phone-number region-specification)</code></div><div class="doc"><div class="markdown"><p>Returns true when type is :phone-number.type/voip, false otherwise.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/phone-number/tree/8.13.6-3/src/phone_number/core.clj#L1820">view source</a></div></div><div class="public anchor" id="var-leniencies"><h3>leniencies</h3><h4 class="added">added in 8.12.4-3</h4><div class="usage"></div><div class="doc"><div class="markdown"><p>A set of all possible phone number leniencies as a set of keywords.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/phone-number/tree/8.13.6-3/src/phone_number/core.clj#L148">view source</a></div></div><div class="public anchor" id="var-locales"><h3>locales</h3><h4 class="added">added in 8.12.4-3</h4><div class="usage"></div><div class="doc"><div class="markdown"><p>A set of all possible phone number locales as a set of keywords.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/phone-number/tree/8.13.6-3/src/phone_number/core.clj#L153">view source</a></div></div><div class="public anchor" id="var-location"><h3>location</h3><h4 class="added">added in 8.12.4-0</h4><div class="usage"><code>(location phone-number)</code><code>(location phone-number region-code)</code><code>(location phone-number locale-specification-FQ)</code><code>(location phone-number region-code locale-specification)</code></div><div class="doc"><div class="markdown"><p>Takes a phone number (expressed as a string, a number, a map or a <code>PhoneNumber</code> object) and returns its possible geographic location as a string or <code>nil</code> if the location happens to be empty.</p>
<p>If the second argument is present then it may be a valid region code (a keyword) to be used when the given phone number does not contain region information. It is acceptable to pass <code>nil</code> as a value to tell the function that there is no explicit region information and it should extract it from a number.</p>
<p>If the third argument is present then it should be a string specifying locale information or a <code>java.util.Locale</code> object. It will be used during rendering strings describing geographic location and carrier data. When <code>nil</code> is passed then the default locale settings will be used.</p>
<p>If there are 2 arguments and the second argument is a keyword but IS NOT a <strong>fully-qualified, valid locale specification</strong> (<code>locale-specification-FQ</code> having namespace set to <code>phone-number.locale</code>) then it will be treated as a <strong>region code</strong>. Using namespaced keyword for a locale (or using object other than keyword) is required to avoid ambiguity since simple region codes and locale specs can be expressed using the very same keyword names. Optionally (but a bad habit) you may use simple keyword with locale and variant (e.g. <code>:pl_PL</code>) that will not match any region but match locale object.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/phone-number/tree/8.13.6-3/src/phone_number/core.clj#L956">view source</a></div></div><div class="public anchor" id="var-match"><h3>match</h3><h4 class="added">added in 8.12.4-0</h4><div class="usage"><code>(match phone-number-a region-code-a phone-number-b region-code-b)</code><code>(match phone-number-a region-code-a phone-number-b)</code><code>(match phone-number-a phone-number-b)</code></div><div class="doc"><div class="markdown"><p>Returns matching level of two numbers or <code>nil</code> if there is no match. Optionally each second argument can be a region code (if the given phone number is not a kind of PhoneNumber and is not prefixed by any calling code ).</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/phone-number/tree/8.13.6-3/src/phone_number/core.clj#L1752">view source</a></div></div><div class="public anchor" id="var-match-types"><h3>match-types</h3><h4 class="added">added in 8.12.4-0</h4><div class="usage"></div><div class="doc"><div class="markdown"><p>A set of all possible phone number match types as a set of keywords.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/phone-number/tree/8.13.6-3/src/phone_number/core.clj#L163">view source</a></div></div><div class="public anchor" id="var-match.3F"><h3>match?</h3><h4 class="added">added in 8.12.4-0</h4><div class="usage"><code>(match? phone-number-a region-code-a phone-number-b region-code-b)</code><code>(match? phone-number-a region-code-a phone-number-b)</code><code>(match? phone-number-a phone-number-b)</code></div><div class="doc"><div class="markdown"><p>Returns <code>true</code> if two numbers match, <code>false</code> otherwise. Optionally each second argument can be a region code (if the given phone number is not a kind of PhoneNumber and is not prefixed by any calling code).</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/phone-number/tree/8.13.6-3/src/phone_number/core.clj#L1783">view source</a></div></div><div class="public anchor" id="var-native.3F"><h3>native?</h3><h4 class="added">added in 8.12.4-0</h4><div class="usage"><code>(native? phone-number _)</code><code>(native? phone-number)</code></div><div class="doc"><div class="markdown"><p>Returns <code>true</code> if the given argument is an instance of PhoneNumber class.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/phone-number/tree/8.13.6-3/src/phone_number/core.clj#L711">view source</a></div></div><div class="public anchor" id="var-net-codes"><h3>net-codes</h3><h4 class="added">added in 8.12.4-0</h4><div class="usage"></div><div class="doc"><div class="markdown"><p>A set of all possible global network calling codes.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/phone-number/tree/8.13.6-3/src/phone_number/core.clj#L128">view source</a></div></div><div class="public anchor" id="var-none"><h3>none</h3><h4 class="added">added in 8.12.4-0</h4><div class="usage"></div><div class="doc"><div class="markdown"><p>A set containing values considered to be none, unknown or empty in the domain of processing phone numbers and codes.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/phone-number/tree/8.13.6-3/src/phone_number/core.clj#L81">view source</a></div></div><div class="public anchor" id="var-numeric"><h3>numeric</h3><h4 class="added">added in 8.12.4-1</h4><div class="usage"><code>(numeric phone-number)</code><code>(numeric phone-number region-code)</code></div><div class="doc"><div class="markdown"><p>Takes a phone number (expressed as a string, a number, a map or a <code>PhoneNumber</code> object) and returns its regional part as an integer, positive number of type <code>Long</code>.</p>
<p>If the second argument is present then it should be a valid region code (a keyword) to be used when the given phone number does not contain region information.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/phone-number/tree/8.13.6-3/src/phone_number/core.clj#L933">view source</a></div></div><div class="public anchor" id="var-Phoneable"><h3>Phoneable</h3><h4 class="type">protocol</h4><h4 class="added">added in 8.12.4-0</h4><div class="usage"></div><div class="doc"><div class="markdown"><p>This protocol is used to utilize class-based single dispatch on a phone number abstract.</p>
</div></div><div class="members"><h4>members</h4><div class="inner"><div class="public anchor" id="var-number"><h3>number</h3><h4 class="added">added in 8.12.4-0</h4><div class="usage"><code>(number phone-number)</code><code>(number phone-number region-code)</code></div><div class="doc"><div class="markdown"><p>Takes a phone number represented as a string, a number, a map or a <code>PhoneNumber</code> object and returns parsed <code>PhoneNumber</code> object. Second, optional argument should be a keyword with region code which is helpful if a local number (without region code) was given. If the region code argument is passed and the first argument is already a kind of PhoneNumber then it will be ignored.</p>
<p>It is important to realize that certain properties of so called short numbers (like an emergency numbers) can only be successfully calculated by other functions if the unprocessed form of a number (a string or a natural number) does not contain country code and so it is delivered as it would be dialed. It is advised to pass a region code as the second argument when short numbers are in use.</p>
</div></div></div><div class="public anchor" id="var-number-noraw"><h3>number-noraw</h3><h4 class="added">added in 8.12.4-0</h4><div class="usage"><code>(number-noraw phone-number)</code><code>(number-noraw phone-number region-code)</code></div><div class="doc"><div class="markdown"><p>Like <code>number</code> but does not preserve raw input.</p>
</div></div></div><div class="public anchor" id="var-number-optraw"><h3>number-optraw</h3><h4 class="added">added in 8.12.4-0</h4><div class="usage"><code>(number-optraw phone-number)</code><code>(number-optraw phone-number region-code)</code></div><div class="doc"><div class="markdown"><p>Like <code>number</code> but preserves raw input only if the given object is a <code>PhoneNumber</code> instance. Otherwise it returns an object without raw input preserved.</p>
</div></div></div><div class="public anchor" id="var-raw-input"><h3>raw-input</h3><h4 class="added">added in 8.12.4-0</h4><div class="usage"><code>(raw-input phone-number)</code><code>(raw-input phone-number region-code)</code></div><div class="doc"><div class="markdown"><p>Returns a string used to initialize phone number object with the number function. For strings and numbers it short-circuits on the given argument and ignores any given region code. Returns a string representation. For <code>nil</code> values it returns <code>nil</code>.</p>
</div></div></div><div class="public anchor" id="var-valid-input.3F"><h3>valid-input?</h3><h4 class="added">added in 8.12.4-0</h4><div class="usage"><code>(valid-input? phone-number)</code></div><div class="doc"><div class="markdown"><p>Takes a phone number represented as a string, a number, a map or a <code>PhoneNumber</code> object and returns <code>true</code> if it is a valid input to be parsed (must be not empty and not <code>nil</code> and have some minimal number of digits). Otherwise it returns <code>false</code>.</p>
</div></div></div><div class="public anchor" id="var-valid.3F"><h3>valid?</h3><h4 class="added">added in 8.12.4-0</h4><div class="usage"><code>(valid? phone-number)</code><code>(valid? phone-number region-code)</code><code>(valid? phone-number region-code dialing-region)</code></div><div class="doc"><div class="markdown"><p>Takes a phone number represented as a string, a number, a map or a <code>PhoneNumber</code> object and validates it. Returns <code>true</code> or <code>false</code>.</p>
<p>When 3 arguments are given the last one should be a source region code for which the test is performed. It only makes sense to use it when the calling code for a number is not the same as the dialing code for the region. If that argument is nil then a value stored in the dynamic variable <code>*default-dialing-region*</code> will be used. If this value is also <code>nil</code> then the function will fall back to checking a number without any dialing region.</p>
<p>One special case is when validating an info map (the result of calling <code>info</code> function). When there will not be dialing region given (or its value will be <code>nil</code>) then this function will try to obtain the source region information from an entry stored under the key <code>:phone-number/dialing-region</code> (or possibly <code>:dialing-region</code> when namespace inference is enabled). It will fetch it only when the key <code>:phone-number.dialing-region/derived?</code> is not holding a truthy value. When this fail then it will default to <code>*default-dialing-region*</code>.</p>
<p>This function will NOT make use of <code>*info-dialing-region-derived*</code>, hence the prefix <code>info-</code> (this variable is to control only the <code>info</code> function). If you need a dialing region code to be derived from the region code of a number, please parse a number and supply the result of the <code>region</code> function to <code>valid?</code> as its last argument.</p>
</div></div></div></div></div><div class="src-link"><a href="https://github.com/randomseed-io/phone-number/tree/8.13.6-3/src/phone_number/core.clj#L182">view source</a></div></div><div class="public anchor" id="var-possible.3F"><h3>possible?</h3><h4 class="added">added in 8.12.4-0</h4><div class="usage"><code>(possible? phone-number)</code><code>(possible? phone-number region-code)</code></div><div class="doc"><div class="markdown"><p>Takes a phone number (expressed as a string, a number, a map or a <code>PhoneNumber</code> object) and returns <code>true</code> if it is a possible number as defined by Libphonenumber. Otherwise it returns <code>false</code>.</p>
<p>If the second argument is present then it should be a valid region code (a keyword) to be used when the given phone number does not contain region information.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/phone-number/tree/8.13.6-3/src/phone_number/core.clj#L728">view source</a></div></div><div class="public anchor" id="var-re-two-digits"><h3>re-two-digits</h3><h4 class="added">added in 8.13.6-2</h4><div class="usage"></div><div class="doc"><div class="markdown"><p>Regular expression pattern matching at least 2 digits in a string.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/phone-number/tree/8.13.6-3/src/phone_number/core.clj#L118">view source</a></div></div><div class="public anchor" id="var-region"><h3>region</h3><h4 class="added">added in 8.12.4-0</h4><div class="usage"><code>(region phone-number)</code><code>(region phone-number region-code)</code></div><div class="doc"><div class="markdown"><p>Takes a phone number (expressed as a string, a number, a map or a <code>PhoneNumber</code> object) and returns its region code as a string or <code>nil</code> if the number is not regional or not given.</p>
<p>If the second argument is present then it should be a valid region code (a keyword) to be used when the given phone number does not contain region information.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/phone-number/tree/8.13.6-3/src/phone_number/core.clj#L910">view source</a></div></div><div class="public anchor" id="var-region-for-calling-code"><h3>region-for-calling-code</h3><h4 class="added">added in 8.12.16-1</h4><div class="usage"><code>(region-for-calling-code calling-code)</code></div><div class="doc"><div class="markdown"><p>Returns a primary region code (keyword) assigned to the given calling code (integer number). Please be aware that for non-geographical calling codes (like global network calling codes) it will return a set containing <code>:phone-number.region/:world</code> which cannot be later used as a valid region argument in most of the functions.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/phone-number/tree/8.13.6-3/src/phone_number/core.clj#L1977">view source</a></div></div><div class="public anchor" id="var-regions"><h3>regions</h3><h4 class="added">added in 8.12.4-0</h4><div class="usage"></div><div class="doc"><div class="markdown"><p>A set of all possible phone number region codes.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/phone-number/tree/8.13.6-3/src/phone_number/core.clj#L123">view source</a></div></div><div class="public anchor" id="var-regions-for-calling-code"><h3>regions-for-calling-code</h3><h4 class="added">added in 8.12.16-1</h4><div class="usage"><code>(regions-for-calling-code calling-code)</code></div><div class="doc"><div class="markdown"><p>Returns a set of region codes (keywords) assigned to the given calling code (integer number). Please be aware that for non-geographical calling codes (like global network calling codes) it will return a set containing <code>:phone-number.region/:world</code> which cannot be later used as a valid region argument in most of the functions.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/phone-number/tree/8.13.6-3/src/phone_number/core.clj#L1966">view source</a></div></div><div class="public anchor" id="var-required-first-input-characters"><h3>required-first-input-characters</h3><h4 class="added">added in 8.12.4-1</h4><div class="usage"></div><div class="doc"><div class="markdown"><p>A set of required first characters in a phone number which is a string. Used internally in spec testing.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/phone-number/tree/8.13.6-3/src/phone_number/core.clj#L96">view source</a></div></div><div class="public anchor" id="var-short-carrier-specific.3F"><h3>short-carrier-specific?</h3><h4 class="added">added in 8.12.4-0</h4><div class="usage"><code>(short-carrier-specific? phone-number)</code><code>(short-carrier-specific? phone-number region-code)</code><code>(short-carrier-specific? phone-number region-code dialing-region)</code></div><div class="doc"><div class="markdown"><p>Takes a short phone number (expressed as a string, a number, a map or a <code>PhoneNumber</code> object), optional region code (or nil) and optional dialing region code. Returns <code>true</code> if it is a carrier-specific number.</p>
<p>If the <code>default-dialing-region*</code> dynamic variable is set then it will be used as a default dialing region if it is not passed as an argument.</p>
<p>It is important to realize that certain properties of short numbers can only be successfully calculated if the unprocessed form of a number (a string or a natural number) does not contain country code and so it is delivered as it would be dialed. It is advised to pass a region code as the second argument when short numbers are tested.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/phone-number/tree/8.13.6-3/src/phone_number/core.clj#L1390">view source</a></div></div><div class="public anchor" id="var-short-cost"><h3>short-cost</h3><h4 class="added">added in 8.12.4-0</h4><div class="usage"><code>(short-cost phone-number)</code><code>(short-cost phone-number region-code)</code><code>(short-cost phone-number region-code dialing-region)</code></div><div class="doc"><div class="markdown"><p>Takes a short (like an emergency) phone number (expressed as a string, a number, a map or a <code>PhoneNumber</code> object) and returns the expected cost class of that number as a keyword.</p>
<p>The second, optional argument should be a valid region code (a keyword) to be used when the given phone number does not contain region information. It is acceptable to pass <code>nil</code> as a value to tell the function that there is no explicit region information and it should extract it from a number.</p>
<p>If the <code>default-dialing-region*</code> dynamic variable is set then it will be used as a default dialing region if it is not passed as an argument.</p>
<p>If the third argument is present then it should be a valid region code for the origination of a possible call. That hint will be used to restrict the check according to rules. For example 112 may be valid in multiple regions but if one calls it from some particular region it might not be reachable. When this argument is missing or its value is <code>nil</code> and the dynamic variable <code>*default-dialing-region*</code> is not <code>nil</code> then its value will be used to set the dialing region. If this argument is missing or is <code>nil</code> and there is no default the binary variant of this function is called (without a source region).</p>
<p>It is important to realize that certain properties of short numbers can only be successfully calculated if the unprocessed form of a number (a string or a natural number) does not contain country code and so it is delivered as it would be dialed. It is advised to pass a region code as the second argument when short numbers are tested. It is also advised to submit a dialing region code when more precise checking should be performed.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/phone-number/tree/8.13.6-3/src/phone_number/core.clj#L1289">view source</a></div></div><div class="public anchor" id="var-short-emergency.3F"><h3>short-emergency?</h3><h4 class="added">added in 8.12.4-0</h4><div class="usage"><code>(short-emergency? phone-number)</code><code>(short-emergency? phone-number region-code)</code></div><div class="doc"><div class="markdown"><p>Takes a short (like an emergency) phone number (expressed as a string!) and returns <code>true</code> if it is exactly the emergency number. The second argument should be a valid region code (a keyword).</p>
<p>It is important to realize that certain properties of short numbers can only be successfully calculated if the unprocessed form of a number (a string or a natural number) does not contain country code and so it is delivered as it would be dialed. It is advised to pass a region code as the second argument when short numbers are tested.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/phone-number/tree/8.13.6-3/src/phone_number/core.clj#L1338">view source</a></div></div><div class="public anchor" id="var-short-info"><h3>short-info</h3><h4 class="added">added in 8.12.4-0</h4><div class="usage"><code>(short-info phone-number)</code><code>(short-info phone-number region-code)</code><code>(short-info phone-number region-code dialing-region)</code></div><div class="doc"><div class="markdown"><p>Takes a short (like an emergency) phone number (expressed as a string, a number, a map or a <code>PhoneNumber</code> object) and returns a map containing all possible information about the number with keywords as keys.</p>
<p>Required keys:</p>
<pre><code> :phone-number.short/valid?
:phone-number.short/possible?
</code></pre>
<p>Optional keys:</p>
<pre><code> :phone-number.short/carrier-specific?
:phone-number.short/cost
:phone-number.short/emergency?
:phone-number.short/sms-service?
:phone-number.short/to-emergency?
:phone-number/dialing-region
:phone-number.dialing-region/derived?
:phone-number.dialing-region/defaulted?
</code></pre>
<p>If the second argument is present then it should be a valid region code (a keyword) to be used when the given phone number does not contain region information. It is acceptable to pass <code>nil</code> as a value to tell the function that there is no explicit region information and it should extract it from a number.</p>
<p>If the third argument is present then it should be a valid region code for the origination of a possible call. That hint will be used to restrict the check according to rules. For example 112 may be valid in multiple regions but if one calls it from some particular region it might not be reachable. When this argument is missing or its value is <code>nil</code> and the dynamic variable <code>*default-dialing-region*</code> is not <code>nil</code> then its value will be used to set the dialing region. If the dynamic variable is also <code>nil</code> (which is the default) then the dynamic variable <code>*info-dialing-region-derived*</code> is checked to be set to truthy value (not <code>nil</code> and not <code>false</code>). If that is <code>true</code> then the dialing region will be derived from a region code of the number.</p>
<p>It is important to realize that certain properties of short numbers can only be successfully calculated if the unprocessed form of a number (a string or a natural number) does not contain country code and so it is delivered as it would be dialed. It is advised to pass a region code as the second argument when short numbers are tested. It is also advised to submit a dialing region code when more precise checking is required.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/phone-number/tree/8.13.6-3/src/phone_number/core.clj#L1537">view source</a></div></div><div class="public anchor" id="var-short-invalid.3F"><h3>short-invalid?</h3><h4 class="added">added in 8.12.4-0</h4><div class="usage"></div><div class="doc"><div class="markdown"><p>Logical negation of short-valid?</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/phone-number/tree/8.13.6-3/src/phone_number/core.clj#L1834">view source</a></div></div><div class="public anchor" id="var-short-possible.3F"><h3>short-possible?</h3><h4 class="added">added in 8.12.4-0</h4><div class="usage"><code>(short-possible? phone-number)</code><code>(short-possible? phone-number region-code)</code><code>(short-possible? phone-number region-code dialing-region)</code></div><div class="doc"><div class="markdown"><p>Takes a phone number (expressed as a string, a number, a map or a <code>PhoneNumber</code> object) and returns <code>true</code> if it is a possible short number (like emergency etc.) as defined by Libphonenumber. Otherwise it returns <code>false</code>. If the second argument is present then it should be a valid region code (a keyword) to be used when the given phone number does not contain region information.</p>
<p>If the <code>default-dialing-region*</code> dynamic variable is set then it will be used as a default dialing region if it is not passed as an argument.</p>
<p>In its ternary form this function takes an additional argument (dialing-region) that should be a valid region code for the origination of a possible call. That hint will be used to restrict the check according to rules. For example 112 may be valid in multiple regions but if one calls it from some particular region it might not be reachable. When this argument is missing or its value is <code>nil</code> and the dynamic variable <code>*default-dialing-region*</code> is not <code>nil</code> then its value will be used to set the dialing region. If this argument is missing or is <code>nil</code> and there is no default the binary variant of this function is called (without a source region).</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/phone-number/tree/8.13.6-3/src/phone_number/core.clj#L1211">view source</a></div></div><div class="public anchor" id="var-short-sms-service.3F"><h3>short-sms-service?</h3><h4 class="added">added in 8.12.4-0</h4><div class="usage"><code>(short-sms-service? phone-number)</code><code>(short-sms-service? phone-number region-code)</code><code>(short-sms-service? phone-number region-code dialing-region)</code></div><div class="doc"><div class="markdown"><p>Takes a short phone number (expressed as a string, a number, a map or a <code>PhoneNumber</code> object), optional region code (or nil) and a dialing region code (uses <code>*default-dialing-region*</code> if not given). Returns <code>true</code> if SMS is supported, <code>false</code> otherwise.</p>
<p>If the <code>default-dialing-region*</code> dynamic variable is set then it will be used as a default dialing region if it is not passed as an argument.</p>
<p>It is important to realize that certain properties of short numbers can only be successfully calculated if the unprocessed form of a number (a string or a natural number) does not contain country code and so it is delivered as it would be dialed. It is advised to pass a region code as the second argument when short numbers are tested.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/phone-number/tree/8.13.6-3/src/phone_number/core.clj#L1423">view source</a></div></div><div class="public anchor" id="var-short-to-emergency.3F"><h3>short-to-emergency?</h3><h4 class="added">added in 8.12.4-0</h4><div class="usage"><code>(short-to-emergency? phone-number)</code><code>(short-to-emergency? phone-number region-code)</code></div><div class="doc"><div class="markdown"><p>Takes a short (like an emergency) phone number (expressed as a string!) and returns <code>true</code> if it can be used to connect to emergency services. The second argument should be a valid region code (a keyword).</p>
<p>It is important to realize that certain properties of short numbers can only be successfully calculated if the unprocessed form of a number (a string or a natural number) does not contain country code and so it is delivered as it would be dialed. It is advised to pass a region code as the second argument when short numbers are tested.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/phone-number/tree/8.13.6-3/src/phone_number/core.clj#L1364">view source</a></div></div><div class="public anchor" id="var-short-valid.3F"><h3>short-valid?</h3><h4 class="added">added in 8.12.4-0</h4><div class="usage"><code>(short-valid? phone-number)</code><code>(short-valid? phone-number region-code)</code><code>(short-valid? phone-number region-code dialing-region)</code></div><div class="doc"><div class="markdown"><p>Takes a phone number (expressed as a string, a number, a map or a <code>PhoneNumber</code> object) and returns <code>true</code> if it is a valid short number (like emergency etc.) as defined by Libphonenumber. Otherwise it returns <code>false</code>. If the second argument is present then it should be a valid region code (a keyword) to be used when the given phone number does not contain region information.</p>
<p>If the <code>default-dialing-region*</code> dynamic variable is set then it will be used as a default dialing region if it is not passed as an argument.</p>
<p>In its ternary form this function takes an additional argument (dialing-region) that should be a valid region code for the origination of a possible call. That hint will be used to restrict the check according to rules. For example 112 may be valid in multiple regions but if one calls it from some particular region it might not be reachable. When this argument is missing or its value is <code>nil</code> and the dynamic variable <code>*default-dialing-region*</code> is not <code>nil</code> then its value will be used to set the dialing region. If this argument is missing or is <code>nil</code> and there is no default the binary variant of this function is called (without a source region).</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/phone-number/tree/8.13.6-3/src/phone_number/core.clj#L1250">view source</a></div></div><div class="public anchor" id="var-time-zones"><h3>time-zones</h3><h4 class="added">added in 8.12.4-0</h4><div class="usage"><code>(time-zones phone-number)</code><code>(time-zones phone-number region-code)</code><code>(time-zones phone-number format-specification)</code><code>(time-zones phone-number region-code format-specification)</code><code>(time-zones phone-number region-code locale-specification)</code><code>(time-zones phone-number region-code locale-specification format-specification)</code></div><div class="doc"><div class="markdown"><p>Takes a phone number (expressed as a string, a number, a map or a <code>PhoneNumber</code> object) and returns all possible time zones which relate to its geographical location as a lazy sequence of strings (representing zone identifiers in English). Returns <code>nil</code> if the list would be empty.</p>
<p>If the second argument is present then it may be a valid region code (a keyword) to be used when the given phone number does not contain region information. It is acceptable to pass <code>nil</code> as a value to tell the function that there is no explicit region information and it should extract it from a number. It may also be a format specifier (also a keyword).</p>
<p>The third argument may be a format specification or a locale specification (both as keywords).</p>
<p>If there are 4 arguments then the format specification should be the last and locale specification should be last but one.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/phone-number/tree/8.13.6-3/src/phone_number/core.clj#L1095">view source</a></div></div><div class="public anchor" id="var-time-zones-all-formats"><h3>time-zones-all-formats</h3><h4 class="added">added in 8.12.4-0</h4><div class="usage"><code>(time-zones-all-formats phone-number)</code><code>(time-zones-all-formats phone-number region-code)</code><code>(time-zones-all-formats phone-number locale-specification-FQ)</code><code>(time-zones-all-formats phone-number region-code locale-specification)</code></div><div class="doc"><div class="markdown"><p>Takes a phone number (expressed as a string, a number, a map or a <code>PhoneNumber</code> object) and returns a map which keys are all possible time zone formats expressed as keywords and values are sequences of the number’s time zones formatted accordingly. If the given number is nil, invalid or time zone information is unavailable for it this function returns <code>nil</code>.</p>
<p>If the second argument is present then it may be a valid region code (a keyword) to be used when the given phone number does not contain region information. It is possible to pass a <code>nil</code> value as this argument to ignore extra processing when region can be inferred from the number.</p>
<p>If there are 2 arguments and the second argument is a keyword but IS NOT a <strong>fully-qualified, valid locale specification</strong> (<code>locale-specification-FQ</code> having namespace set to <code>phone-number.locale</code>) then it will be treated as a <strong>region code</strong>. Using namespaced keyword for a locale (or using object other than keyword) is required to avoid ambiguity since simple region codes and locale specs can be expressed using the very same keyword names. Optionally (but a bad habit) you may use simple keyword with locale and variant (e.g. <code>:pl_PL</code>) that will not match any region but match locale object.</p>
<p>The third argument should be a Locale object or a string describing locale settings to be used when rendering locale-dependent time zone information. When there is no third argument or it is <code>nil</code> then default locale settings will be used.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/phone-number/tree/8.13.6-3/src/phone_number/core.clj#L1156">view source</a></div></div><div class="public anchor" id="var-type"><h3>type</h3><h4 class="added">added in 8.12.4-0</h4><div class="usage"><code>(type phone-number)</code><code>(type phone-number region-code)</code></div><div class="doc"><div class="markdown"><p>Takes a phone number (expressed as a string, a number, a map or a <code>PhoneNumber</code> object) and returns its type as a keyword. For unknown types and number without types it returns <code>:phone-number.type/unknown</code>.</p>
<p>If the second argument is present then it should be a valid region code (a keyword) to be used when the given phone number does not contain region information.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/phone-number/tree/8.13.6-3/src/phone_number/core.clj#L856">view source</a></div></div><div class="public anchor" id="var-types"><h3>types</h3><h4 class="added">added in 8.12.4-0</h4><div class="usage"></div><div class="doc"><div class="markdown"><p>A set of all possible phone number types as a set of keywords.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/phone-number/tree/8.13.6-3/src/phone_number/core.clj#L158">view source</a></div></div><div class="public anchor" id="var-tz-formats"><h3>tz-formats</h3><h4 class="added">added in 8.12.4-0</h4><div class="usage"></div><div class="doc"><div class="markdown"><p>A set of all possible time zone formats as a set of keywords.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/phone-number/tree/8.13.6-3/src/phone_number/core.clj#L168">view source</a></div></div><div class="public anchor" id="var-valid-for-region.3F"><h3>valid-for-region?</h3><h4 class="added">added in 8.12.4-0</h4><h4 class="deprecated">deprecated in 8.12.4-1</h4><div class="usage"><code>(valid-for-region? phone-number region-code dialing-region)</code></div><div class="doc"><div class="markdown"><p>DEPRECATED: Please use ternary version of the <code>valid?</code> function.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/phone-number/tree/8.13.6-3/src/phone_number/core.clj#L755">view source</a></div></div><div class="public anchor" id="var-when-some-input"><h3>when-some-input</h3><h4 class="type">macro</h4><div class="usage"><code>(when-some-input phone-num & body)</code></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/phone-number/tree/8.13.6-3/src/phone_number/core.clj#L694">view source</a></div></div></div></body></html>