index.d.ts 54 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478
  1. export const version: string;
  2. /**
  3. * Tests if is is running under a browser.
  4. * @return {boolean} true if the environment has process, process.version and process.versions.
  5. */
  6. export function browser(): boolean;
  7. /**
  8. * Test if 'value' is defined.
  9. * Alias: def
  10. * @param {unknown} value The value to test.
  11. * @return {boolean} true if 'value' is defined, false otherwise.
  12. */
  13. export function defined(value: unknown): boolean;
  14. /**
  15. * Test if 'value' is defined.
  16. * Alias: def
  17. * @param {unknown} value The value to test.
  18. * @return {boolean} true if 'value' is defined, false otherwise.
  19. */
  20. export function def(value: unknown): boolean;
  21. /**
  22. * Tests if is is running under node.js
  23. * @return {boolean} true if the environment has process, process.version and process.versions.
  24. */
  25. export function nodejs(): boolean;
  26. /**
  27. * Tests if is is running under node.js
  28. * @return {boolean} true if the environment has process, process.version and process.versions.
  29. */
  30. export function node(): boolean;
  31. /**
  32. * Test if 'value' is undefined.
  33. * Aliases: undef, udef
  34. * @param {unknown} value value to test.
  35. * @return {boolean} true if 'value' is undefined, false otherwise.
  36. */
  37. export function undefined(value: unknown): boolean;
  38. /**
  39. * Test if 'value' is undefined.
  40. * Aliases: undef, udef
  41. * @param {unknown} value value to test.
  42. * @return {boolean} true if 'value' is undefined, false otherwise.
  43. */
  44. export function udef(value: unknown): boolean;
  45. /**
  46. * Test if 'value' is undefined.
  47. * Aliases: undef, udef
  48. * @param {unknown} value value to test.
  49. * @return {boolean} true if 'value' is undefined, false otherwise.
  50. */
  51. export function undef(value: unknown): boolean;
  52. /**
  53. * Test if 'value' is an array.
  54. * Alias: ary, arry
  55. * @param {unknown} value value to test.
  56. * @return {boolean} true if 'value' is an array, false otherwise.
  57. */
  58. export function array(value: unknown): boolean;
  59. /**
  60. * Test if 'value' is an array.
  61. * Alias: ary, arry
  62. * @param {unknown} value value to test.
  63. * @return {boolean} true if 'value' is an array, false otherwise.
  64. */
  65. export function arr(value: unknown): boolean;
  66. /**
  67. * Test if 'value' is an array.
  68. * Alias: ary, arry
  69. * @param {unknown} value value to test.
  70. * @return {boolean} true if 'value' is an array, false otherwise.
  71. */
  72. export function ary(value: unknown): boolean;
  73. /**
  74. * Test if 'value' is an array.
  75. * Alias: ary, arry
  76. * @param {unknown} value value to test.
  77. * @return {boolean} true if 'value' is an array, false otherwise.
  78. */
  79. export function arry(value: unknown): boolean;
  80. /**
  81. * Test if 'value' is an arraylike object (i.e. it has a length property with a valid value)
  82. * Aliases: arraylike, arryLike, aryLike
  83. * @param {unknown} value value to test.
  84. * @return {boolean} true if 'value' is an arguments object, false otherwise.
  85. */
  86. export function arrayLike(value: unknown): boolean;
  87. /**
  88. * Test if 'value' is an arraylike object (i.e. it has a length property with a valid value)
  89. * Aliases: arraylike, arryLike, aryLike
  90. * @param {unknown} value value to test.
  91. * @return {boolean} true if 'value' is an arguments object, false otherwise.
  92. */
  93. export function arrLike(value: unknown): boolean;
  94. /**
  95. * Test if 'value' is an arraylike object (i.e. it has a length property with a valid value)
  96. * Aliases: arraylike, arryLike, aryLike
  97. * @param {unknown} value value to test.
  98. * @return {boolean} true if 'value' is an arguments object, false otherwise.
  99. */
  100. export function arryLike(value: unknown): boolean;
  101. /**
  102. * Test if 'value' is an arraylike object (i.e. it has a length property with a valid value)
  103. * Aliases: arraylike, arryLike, aryLike
  104. * @param {unknown} value value to test.
  105. * @return {boolean} true if 'value' is an arguments object, false otherwise.
  106. */
  107. export function aryLike(value: unknown): boolean;
  108. /**
  109. * Test if 'value' is an arraylike object (i.e. it has a length property with a valid value)
  110. * Aliases: arraylike, arryLike, aryLike
  111. * @param {unknown} value value to test.
  112. * @return {boolean} true if 'value' is an arguments object, false otherwise.
  113. */
  114. export function arraylike(value: unknown): boolean;
  115. /**
  116. * Test if 'value' is an arguments object.
  117. * Alias: args
  118. * @param {unknown} value value to test
  119. * @return {boolean} true if 'value' is an arguments object, false otherwise
  120. */
  121. declare function _arguments(value: unknown): boolean;
  122. /**
  123. * Test if 'value' is an arguments object.
  124. * Alias: args
  125. * @param {unknown} value value to test
  126. * @return {boolean} true if 'value' is an arguments object, false otherwise
  127. */
  128. export function args(value: unknown): boolean;
  129. /**
  130. * Test if 'value' is a boolean.
  131. * Alias: bool
  132. * @param {unknown} value value to test.
  133. * @return {boolean} true if 'value' is a boolean, false otherwise.
  134. */
  135. export function boolean(value: unknown): boolean;
  136. /**
  137. * Test if 'value' is a boolean.
  138. * Alias: bool
  139. * @param {unknown} value value to test.
  140. * @return {boolean} true if 'value' is a boolean, false otherwise.
  141. */
  142. export function bool(value: unknown): boolean;
  143. /**
  144. * Test if 'value' is an instance of Buffer.
  145. * Aliases: instOf, instanceof
  146. * @param {unknown} value value to test.
  147. * @return {boolean} true if 'value' is an instance of 'constructor'.
  148. */
  149. export function buffer(value: unknown): boolean;
  150. /**
  151. * Test if 'value' is an instance of Buffer.
  152. * Aliases: instOf, instanceof
  153. * @param {unknown} value value to test.
  154. * @return {boolean} true if 'value' is an instance of 'constructor'.
  155. */
  156. export function buff(value: unknown): boolean;
  157. /**
  158. * Test if 'value' is an instance of Buffer.
  159. * Aliases: instOf, instanceof
  160. * @param {unknown} value value to test.
  161. * @return {boolean} true if 'value' is an instance of 'constructor'.
  162. */
  163. export function buf(value: unknown): boolean;
  164. /**
  165. * Test if 'value' is a date.
  166. * @param {unknown} value value to test.
  167. * @return {boolean} true if 'value' is a date, false otherwise.
  168. */
  169. export function date(value: unknown): boolean;
  170. /**
  171. * Test if 'value' is an error object.
  172. * Alias: err
  173. * @param value value to test.
  174. * @return {boolean} true if 'value' is an error object, false otherwise.
  175. */
  176. export function error(value: unknown): boolean;
  177. /**
  178. * Test if 'value' is an error object.
  179. * Alias: err
  180. * @param value value to test.
  181. * @return {boolean} true if 'value' is an error object, false otherwise.
  182. */
  183. export function err(value: unknown): boolean;
  184. /**
  185. * Test if 'value' is false.
  186. * @param {unknown} value value to test.
  187. * @return {boolean} true if 'value' is false, false otherwise
  188. */
  189. declare function _false(value: unknown): boolean;
  190. /**
  191. * Test if 'value' is a function or async function.
  192. * Alias: func
  193. * @param {unknown} value value to test.
  194. * @return {boolean} true if 'value' is a function, false otherwise.
  195. */
  196. declare function _function(value: unknown): boolean;
  197. /**
  198. * Test if 'value' is a function or async function.
  199. * Alias: func
  200. * @param {unknown} value value to test.
  201. * @return {boolean} true if 'value' is a function, false otherwise.
  202. */
  203. export function fun(value: unknown): boolean;
  204. /**
  205. * Test if 'value' is a function or async function.
  206. * Alias: func
  207. * @param {unknown} value value to test.
  208. * @return {boolean} true if 'value' is a function, false otherwise.
  209. */
  210. export function func(value: unknown): boolean;
  211. /**
  212. * Test if 'value' is an async function using `async () => {}` or `async function () {}`.
  213. * Alias: func
  214. * @param {unknown} value value to test.
  215. * @return {boolean} true if 'value' is a function, false otherwise.
  216. */
  217. export function asyncFunction(value: unknown): boolean;
  218. /**
  219. * Test if 'value' is an async function using `async () => {}` or `async function () {}`.
  220. * Alias: func
  221. * @param {unknown} value value to test.
  222. * @return {boolean} true if 'value' is a function, false otherwise.
  223. */
  224. export function asyncFun(value: unknown): boolean;
  225. /**
  226. * Test if 'value' is an async function using `async () => {}` or `async function () {}`.
  227. * Alias: func
  228. * @param {unknown} value value to test.
  229. * @return {boolean} true if 'value' is a function, false otherwise.
  230. */
  231. export function asyncFunc(value: unknown): boolean;
  232. /**
  233. * Test if 'value' is a synchronous function.
  234. * Alias: syncFunc
  235. * @param {unknown} value value to test.
  236. * @return {boolean} true if 'value' is a function, false otherwise.
  237. */
  238. export function syncFunction(value: unknown): boolean;
  239. /**
  240. * Test if 'value' is a synchronous function.
  241. * Alias: syncFunc
  242. * @param {unknown} value value to test.
  243. * @return {boolean} true if 'value' is a function, false otherwise.
  244. */
  245. export function syncFun(value: unknown): boolean;
  246. /**
  247. * Test if 'value' is a synchronous function.
  248. * Alias: syncFunc
  249. * @param {unknown} value value to test.
  250. * @return {boolean} true if 'value' is a function, false otherwise.
  251. */
  252. export function syncFunc(value: unknown): boolean;
  253. /**
  254. * Test if 'value' is null.
  255. * @param {unknown} value to test.
  256. * @return {boolean} true if 'value' is null, false otherwise.
  257. */
  258. declare function _null(value: unknown): boolean;
  259. /**
  260. * Test is 'value' is either null or undefined.
  261. * Alias: nullOrUndef
  262. * @param {unknown} value value to test.
  263. * @return {boolean} True if value is null or undefined, false otherwise.
  264. */
  265. export function nullOrUndefined(value: unknown): boolean;
  266. /**
  267. * Test is 'value' is either null or undefined.
  268. * Alias: nullOrUndef
  269. * @param {unknown} value value to test.
  270. * @return {boolean} True if value is null or undefined, false otherwise.
  271. */
  272. export function nullOrUndef(value: unknown): boolean;
  273. /**
  274. * Test if 'value' is a number.
  275. * Alias: num
  276. * @param {unknown} value to test.
  277. * @return {boolean} true if 'value' is a number, false otherwise.
  278. */
  279. export function number(value: unknown): boolean;
  280. /**
  281. * Test if 'value' is a number.
  282. * Alias: num
  283. * @param {unknown} value to test.
  284. * @return {boolean} true if 'value' is a number, false otherwise.
  285. */
  286. export function num(value: unknown): boolean;
  287. /**
  288. * Test if 'value' is an object. Note: Arrays, RegExps, Date, Error, etc all return false.
  289. * Alias: obj
  290. * @param {unknown} value to test.
  291. * @return {boolean} true if 'value' is an object, false otherwise.
  292. */
  293. export function object(value: unknown): boolean;
  294. /**
  295. * Test if 'value' is an object. Note: Arrays, RegExps, Date, Error, etc all return false.
  296. * Alias: obj
  297. * @param {unknown} value to test.
  298. * @return {boolean} true if 'value' is an object, false otherwise.
  299. */
  300. export function obj(value: unknown): boolean;
  301. /**
  302. * Test if 'value' is a regular expression.
  303. * Alias: regexp
  304. * @param {unknown} value to test.
  305. * @return {boolean} true if 'value' is a regexp, false otherwise.
  306. */
  307. export function regExp(value: unknown): boolean;
  308. /**
  309. * Test if 'value' is a regular expression.
  310. * Alias: regexp
  311. * @param {unknown} value to test.
  312. * @return {boolean} true if 'value' is a regexp, false otherwise.
  313. */
  314. export function re(value: unknown): boolean;
  315. /**
  316. * Test if 'value' is a regular expression.
  317. * Alias: regexp
  318. * @param {unknown} value to test.
  319. * @return {boolean} true if 'value' is a regexp, false otherwise.
  320. */
  321. export function regexp(value: unknown): boolean;
  322. /**
  323. * Test if 'value' is a string.
  324. * Alias: str
  325. * @param {unknown} value to test.
  326. * @return {boolean} true if 'value' is a string, false otherwise.
  327. */
  328. export function string(value: unknown): boolean;
  329. /**
  330. * Test if 'value' is a string.
  331. * Alias: str
  332. * @param {unknown} value to test.
  333. * @return {boolean} true if 'value' is a string, false otherwise.
  334. */
  335. export function str(value: unknown): boolean;
  336. /**
  337. * Test if 'value' is true.
  338. * @param {unknown} value to test.
  339. * @return {boolean} true if 'value' is true, false otherwise.
  340. */
  341. declare function _true(value: unknown): boolean;
  342. export function uuid(value: unknown): boolean;
  343. /**
  344. * Test if 'value' is equal to 'other'. Works for objects and arrays and will do deep comparisions,
  345. * using recursion.
  346. * Alias: eq
  347. * @param {unknown} value value.
  348. * @param {unknown} other value to compare with.
  349. * @return {boolean} true if 'value' is equal to 'other', false otherwise
  350. */
  351. export function equal(value: unknown, other: unknown): boolean;
  352. /**
  353. * Test if 'value' is equal to 'other'. Works for objects and arrays and will do deep comparisions,
  354. * using recursion.
  355. * Alias: eq
  356. * @param {unknown} value value.
  357. * @param {unknown} other value to compare with.
  358. * @return {boolean} true if 'value' is equal to 'other', false otherwise
  359. */
  360. export function objEquals(value: unknown, other: unknown): boolean;
  361. /**
  362. * Test if 'value' is equal to 'other'. Works for objects and arrays and will do deep comparisions,
  363. * using recursion.
  364. * Alias: eq
  365. * @param {unknown} value value.
  366. * @param {unknown} other value to compare with.
  367. * @return {boolean} true if 'value' is equal to 'other', false otherwise
  368. */
  369. export function eq(value: unknown, other: unknown): boolean;
  370. /**
  371. * Test if 'key' in host is an object. To be hosted means host[value] is an object.
  372. * @param {unknown} value The value to test.
  373. * @param {unknown} host Host that may contain value.
  374. * @return {boolean} true if 'value' is hosted by 'host', false otherwise.
  375. */
  376. export function hosted(value: unknown, host: unknown): boolean;
  377. /**
  378. * Test if 'value' is an instance of 'constructor'.
  379. * Aliases: instOf, instanceof
  380. * @param {unknown} value value to test.
  381. * @return {boolean} true if 'value' is an instance of 'constructor'.
  382. */
  383. export function instanceOf(value: unknown, constructor: unknown): boolean;
  384. export const instOf:
  385. | ((value: unknown, constructor: unknown) => boolean)
  386. | ((objInst: object, objType: object) => boolean);
  387. /**
  388. * Test if 'value' is an instance of 'constructor'.
  389. * Aliases: instOf, instanceof
  390. * @param {unknown} value value to test.
  391. * @return {boolean} true if 'value' is an instance of 'constructor'.
  392. */
  393. declare function _instanceof(value: unknown, constructor: unknown): boolean;
  394. /**
  395. * Test if 'value' is an instance type objType.
  396. * Aliases: objInstOf, objectinstanceof, instOf, instanceOf
  397. * @param {object} objInst an object to testfor type.
  398. * @param {object} objType an object type to compare.
  399. * @return {boolean} true if 'value' is an object, false otherwise.
  400. */
  401. export function objectInstanceOf(objInst: object, objType: object): boolean;
  402. /**
  403. * Test if 'value' is an instance type objType.
  404. * Aliases: objInstOf, objectinstanceof, instOf, instanceOf
  405. * @param {object} objInst an object to testfor type.
  406. * @param {object} objType an object type to compare.
  407. * @return {boolean} true if 'value' is an object, false otherwise.
  408. */
  409. export function objInstOf(objInst: object, objType: object): boolean;
  410. /**
  411. * Test if 'value' is a type of 'type'.
  412. * Alias: a
  413. * @param value value to test.
  414. * @param {string} type The name of the type.
  415. * @return {boolean} true if 'value' is an arguments object, false otherwise.
  416. */
  417. export function type(value: unknown, type: string): boolean;
  418. /**
  419. * Test if 'value' is a type of 'type'.
  420. * Alias: a
  421. * @param value value to test.
  422. * @param {string} type The name of the type.
  423. * @return {boolean} true if 'value' is an arguments object, false otherwise.
  424. */
  425. export function a(value: unknown, type: string): boolean;
  426. /**
  427. * Test if 'value' is empty. To be empty means to be an array, object or string with nothing contained.
  428. * @param {unknown} value value to test.
  429. * @return {boolean} true if 'value' is empty, false otherwise.
  430. */
  431. export function empty(value: unknown): boolean;
  432. /**
  433. * Test if 'value' is an arguments object that is empty.
  434. * Alias: args
  435. * @param {unknown} value value to test
  436. * @return {boolean} true if 'value' is an arguments object with no args, false otherwise
  437. */
  438. export function emptyArguments(value: unknown): boolean;
  439. /**
  440. * Test if 'value' is an arguments object that is empty.
  441. * Alias: args
  442. * @param {unknown} value value to test
  443. * @return {boolean} true if 'value' is an arguments object with no args, false otherwise
  444. */
  445. export function noArgs(value: unknown): boolean;
  446. /**
  447. * Test if 'value' is an arguments object that is empty.
  448. * Alias: args
  449. * @param {unknown} value value to test
  450. * @return {boolean} true if 'value' is an arguments object with no args, false otherwise
  451. */
  452. export function emptyArgs(value: unknown): boolean;
  453. /**
  454. * Test if 'value' is an array containing no entries.
  455. * Aliases: emptyArry, emptyAry
  456. * @param {unknown} value The value to test.
  457. * @return {boolean} true if 'value' is an array with no elemnets.
  458. */
  459. export function emptyArray(value: unknown): boolean;
  460. /**
  461. * Test if 'value' is an array containing no entries.
  462. * Aliases: emptyArry, emptyAry
  463. * @param {unknown} value The value to test.
  464. * @return {boolean} true if 'value' is an array with no elemnets.
  465. */
  466. export function emptyArry(value: unknown): boolean;
  467. /**
  468. * Test if 'value' is an array containing no entries.
  469. * Aliases: emptyArry, emptyAry
  470. * @param {unknown} value The value to test.
  471. * @return {boolean} true if 'value' is an array with no elemnets.
  472. */
  473. export function emptyAry(value: unknown): boolean;
  474. /**
  475. * Test if 'value' is an empty array(like) object.
  476. * Aliases: arguents.empty, args.empty, ary.empty, arry.empty
  477. * @param {unknown} value value to test.
  478. * @return {boolean} true if 'value' is an empty array(like), false otherwise.
  479. */
  480. export function emptyArrayLike(value: unknown): boolean;
  481. /**
  482. * Test if 'value' is an empty array(like) object.
  483. * Aliases: arguents.empty, args.empty, ary.empty, arry.empty
  484. * @param {unknown} value value to test.
  485. * @return {boolean} true if 'value' is an empty array(like), false otherwise.
  486. */
  487. export function emptyArrLike(value: unknown): boolean;
  488. /**
  489. * Test if 'value' is an empty string.
  490. * Alias: emptyStr
  491. * @param {unknown} value to test.
  492. * @return {boolean} true if 'value' is am empty string, false otherwise.
  493. */
  494. export function emptyString(value: unknown): boolean;
  495. /**
  496. * Test if 'value' is an empty string.
  497. * Alias: emptyStr
  498. * @param {unknown} value to test.
  499. * @return {boolean} true if 'value' is am empty string, false otherwise.
  500. */
  501. export function emptyStr(value: unknown): boolean;
  502. /**
  503. * Test if 'value' is an array containing at least 1 entry.
  504. * Aliases: nonEmptyArry, nonEmptyAry
  505. * @param {unknown} value The value to test.
  506. * @return {boolean} true if 'value' is an array with at least 1 value, false otherwise.
  507. */
  508. export function nonEmptyArray(value: unknown): boolean;
  509. /**
  510. * Test if 'value' is an array containing at least 1 entry.
  511. * Aliases: nonEmptyArry, nonEmptyAry
  512. * @param {unknown} value The value to test.
  513. * @return {boolean} true if 'value' is an array with at least 1 value, false otherwise.
  514. */
  515. export function nonEmptyArr(value: unknown): boolean;
  516. /**
  517. * Test if 'value' is an array containing at least 1 entry.
  518. * Aliases: nonEmptyArry, nonEmptyAry
  519. * @param {unknown} value The value to test.
  520. * @return {boolean} true if 'value' is an array with at least 1 value, false otherwise.
  521. */
  522. export function nonEmptyArry(value: unknown): boolean;
  523. /**
  524. * Test if 'value' is an array containing at least 1 entry.
  525. * Aliases: nonEmptyArry, nonEmptyAry
  526. * @param {unknown} value The value to test.
  527. * @return {boolean} true if 'value' is an array with at least 1 value, false otherwise.
  528. */
  529. export function nonEmptyAry(value: unknown): boolean;
  530. /**
  531. * Test if 'value' is an object with properties. Note: Arrays are objects.
  532. * Alias: nonEmptyObj
  533. * @param {unknown} value to test.
  534. * @return {boolean} true if 'value' is an object, false otherwise.
  535. */
  536. export function nonEmptyObject(value: unknown): boolean;
  537. /**
  538. * Test if 'value' is an object with properties. Note: Arrays are objects.
  539. * Alias: nonEmptyObj
  540. * @param {unknown} value to test.
  541. * @return {boolean} true if 'value' is an object, false otherwise.
  542. */
  543. export function nonEmptyObj(value: unknown): boolean;
  544. /**
  545. * Test if 'value' is an object with no properties. Note: Arrays are objects.
  546. * Alias: nonEmptyObj
  547. * @param {unknown} value to test.
  548. * @return {boolean} true if 'value' is an object, false otherwise.
  549. */
  550. export function emptyObject(value: unknown): boolean;
  551. /**
  552. * Test if 'value' is an object with no properties. Note: Arrays are objects.
  553. * Alias: nonEmptyObj
  554. * @param {unknown} value to test.
  555. * @return {boolean} true if 'value' is an object, false otherwise.
  556. */
  557. export function emptyObj(value: unknown): boolean;
  558. /**
  559. * Test if 'value' is a non-empty string.
  560. * Alias: nonEmptyStr
  561. * @param {unknown} value to test.
  562. * @return {boolean} true if 'value' is a non-empty string, false otherwise.
  563. */
  564. export function nonEmptyString(value: unknown): boolean;
  565. /**
  566. * Test if 'value' is a non-empty string.
  567. * Alias: nonEmptyStr
  568. * @param {unknown} value to test.
  569. * @return {boolean} true if 'value' is a non-empty string, false otherwise.
  570. */
  571. export function nonEmptyStr(value: unknown): boolean;
  572. /**
  573. * Test if 'value' is an even number.
  574. * @param {Number} value to test.
  575. * @return {boolean} true if 'value' is an even number, false otherwise.
  576. */
  577. export function even(value: number): boolean;
  578. /**
  579. * Test if 'value' is a decimal number.
  580. * Aliases: decimalNumber, decNum
  581. * @param {unknown} value value to test.
  582. * @return {boolean} true if 'value' is a decimal number, false otherwise.
  583. */
  584. export function decimal(value: unknown): boolean;
  585. /**
  586. * Test if 'value' is a decimal number.
  587. * Aliases: decimalNumber, decNum
  588. * @param {unknown} value value to test.
  589. * @return {boolean} true if 'value' is a decimal number, false otherwise.
  590. */
  591. export function dec(value: unknown): boolean;
  592. /**
  593. * Test if 'value' is a decimal number.
  594. * Aliases: decimalNumber, decNum
  595. * @param {unknown} value value to test.
  596. * @return {boolean} true if 'value' is a decimal number, false otherwise.
  597. */
  598. export function decNum(value: unknown): boolean;
  599. /**
  600. * Test if 'value' is an integer.
  601. * Alias: integer
  602. * @param {unknown} value to test.
  603. * @return {boolean} true if 'value' is an integer, false otherwise.
  604. */
  605. export function integer(value: unknown): boolean;
  606. /**
  607. * Test if 'value' is an integer.
  608. * Alias: integer
  609. * @param {unknown} value to test.
  610. * @return {boolean} true if 'value' is an integer, false otherwise.
  611. */
  612. export function int(value: unknown): boolean;
  613. /**
  614. * is.nan
  615. * Test if `value` is not a number.
  616. *
  617. * @param {unknown} value value to test
  618. * @return {boolean} true if `value` is not a number, false otherwise
  619. * @api public
  620. */
  621. export function notANumber(value: unknown): boolean;
  622. /**
  623. * is.nan
  624. * Test if `value` is not a number.
  625. *
  626. * @param {unknown} value value to test
  627. * @return {boolean} true if `value` is not a number, false otherwise
  628. * @api public
  629. */
  630. export function nan(value: unknown): boolean;
  631. /**
  632. * is.nan
  633. * Test if `value` is not a number.
  634. *
  635. * @param {unknown} value value to test
  636. * @return {boolean} true if `value` is not a number, false otherwise
  637. * @api public
  638. */
  639. export function notANum(value: unknown): boolean;
  640. /**
  641. * Test if 'value' is an odd number.
  642. * @param {Number} value to test.
  643. * @return {boolean} true if 'value' is an odd number, false otherwise.
  644. */
  645. export function odd(value: number): boolean;
  646. /**
  647. * Test if 'value' is an odd number.
  648. * @param {Number} value to test.
  649. * @return {boolean} true if 'value' is an odd number, false otherwise.
  650. */
  651. export function oddNumber(value: number): boolean;
  652. /**
  653. * Test if 'value' is an odd number.
  654. * @param {Number} value to test.
  655. * @return {boolean} true if 'value' is an odd number, false otherwise.
  656. */
  657. export function oddNum(value: number): boolean;
  658. /**
  659. * Test if 'value' is a positive number.
  660. * Alias: positiveNum, posNum
  661. * @param {unknown} value to test.
  662. * @return {boolean} true if 'value' is a number, false otherwise.
  663. */
  664. export function positiveNumber(value: unknown): boolean;
  665. /**
  666. * Test if 'value' is a positive number.
  667. * Alias: positiveNum, posNum
  668. * @param {unknown} value to test.
  669. * @return {boolean} true if 'value' is a number, false otherwise.
  670. */
  671. export function pos(value: unknown): boolean;
  672. /**
  673. * Test if 'value' is a positive number.
  674. * Alias: positiveNum, posNum
  675. * @param {unknown} value to test.
  676. * @return {boolean} true if 'value' is a number, false otherwise.
  677. */
  678. export function positive(value: unknown): boolean;
  679. /**
  680. * Test if 'value' is a positive number.
  681. * Alias: positiveNum, posNum
  682. * @param {unknown} value to test.
  683. * @return {boolean} true if 'value' is a number, false otherwise.
  684. */
  685. export function posNum(value: unknown): boolean;
  686. /**
  687. * Test if 'value' is a positive number.
  688. * Alias: positiveNum, posNum
  689. * @param {unknown} value to test.
  690. * @return {boolean} true if 'value' is a number, false otherwise.
  691. */
  692. export function positiveNum(value: unknown): boolean;
  693. /**
  694. * Test if 'value' is a negative number.
  695. * Aliases: negNum, negativeNum
  696. * @param {unknown} value to test.
  697. * @return {boolean} true if 'value' is a number, false otherwise.
  698. */
  699. export function negativeNumber(value: unknown): boolean;
  700. /**
  701. * Test if 'value' is a negative number.
  702. * Aliases: negNum, negativeNum
  703. * @param {unknown} value to test.
  704. * @return {boolean} true if 'value' is a number, false otherwise.
  705. */
  706. export function neg(value: unknown): boolean;
  707. /**
  708. * Test if 'value' is a negative number.
  709. * Aliases: negNum, negativeNum
  710. * @param {unknown} value to test.
  711. * @return {boolean} true if 'value' is a number, false otherwise.
  712. */
  713. export function negNum(value: unknown): boolean;
  714. /**
  715. * Test if 'value' is a negative number.
  716. * Aliases: negNum, negativeNum
  717. * @param {unknown} value to test.
  718. * @return {boolean} true if 'value' is a number, false otherwise.
  719. */
  720. export function negativeNum(value: unknown): boolean;
  721. /**
  722. * Test if 'value' is a negative integer.
  723. * Aliases: negInt, negativeInteger
  724. * @param {unknown} value to test.
  725. * @return {boolean} true if 'value' is a negative integer, false otherwise.
  726. */
  727. export function negativeInteger(value: unknown): boolean;
  728. /**
  729. * Test if 'value' is a negative integer.
  730. * Aliases: negInt, negativeInteger
  731. * @param {unknown} value to test.
  732. * @return {boolean} true if 'value' is a negative integer, false otherwise.
  733. */
  734. export function negativeInt(value: unknown): boolean;
  735. /**
  736. * Test if 'value' is a negative integer.
  737. * Aliases: negInt, negativeInteger
  738. * @param {unknown} value to test.
  739. * @return {boolean} true if 'value' is a negative integer, false otherwise.
  740. */
  741. export function negInt(value: unknown): boolean;
  742. /**
  743. * Test if 'value' is a positive integer.
  744. * Alias: posInt
  745. * @param {unknown} value to test.
  746. * @return {boolean} true if 'value' is a positive integer, false otherwise.
  747. */
  748. export function positiveInteger(value: unknown): boolean;
  749. /**
  750. * Test if 'value' is a positive integer.
  751. * Alias: posInt
  752. * @param {unknown} value to test.
  753. * @return {boolean} true if 'value' is a positive integer, false otherwise.
  754. */
  755. export function posInt(value: unknown): boolean;
  756. /**
  757. * Test if 'value' is a positive integer.
  758. * Alias: posInt
  759. * @param {unknown} value to test.
  760. * @return {boolean} true if 'value' is a positive integer, false otherwise.
  761. */
  762. export function positiveInt(value: unknown): boolean;
  763. /**
  764. * Test if 'value' is divisible by 'n'.
  765. * Alias: divisBy
  766. * @param {Number} value value to test.
  767. * @param {Number} n dividend.
  768. * @return {boolean} true if 'value' is divisible by 'n', false otherwise.
  769. */
  770. export function divisibleBy(value: number, n: number): boolean;
  771. /**
  772. * Test if 'value' is divisible by 'n'.
  773. * Alias: divisBy
  774. * @param {Number} value value to test.
  775. * @param {Number} n dividend.
  776. * @return {boolean} true if 'value' is divisible by 'n', false otherwise.
  777. */
  778. export function divBy(value: number, n: number): boolean;
  779. /**
  780. * Test if 'value' is divisible by 'n'.
  781. * Alias: divisBy
  782. * @param {Number} value value to test.
  783. * @param {Number} n dividend.
  784. * @return {boolean} true if 'value' is divisible by 'n', false otherwise.
  785. */
  786. export function divisBy(value: number, n: number): boolean;
  787. /**
  788. * Test if 'value' is greater than or equal to 'other'.
  789. * Aliases: greaterOrEq, greaterOrEqual
  790. * @param {Number} value value to test.
  791. * @param {Number} other value to compare with.
  792. * @return {boolean} true, if value is greater than or equal to other, false otherwise.
  793. */
  794. export function greaterOrEqualTo(value: number, other: number): boolean;
  795. /**
  796. * Test if 'value' is greater than or equal to 'other'.
  797. * Aliases: greaterOrEq, greaterOrEqual
  798. * @param {Number} value value to test.
  799. * @param {Number} other value to compare with.
  800. * @return {boolean} true, if value is greater than or equal to other, false otherwise.
  801. */
  802. export function greaterOrEqual(value: number, other: number): boolean;
  803. /**
  804. * Test if 'value' is greater than or equal to 'other'.
  805. * Aliases: greaterOrEq, greaterOrEqual
  806. * @param {Number} value value to test.
  807. * @param {Number} other value to compare with.
  808. * @return {boolean} true, if value is greater than or equal to other, false otherwise.
  809. */
  810. export function ge(value: number, other: number): boolean;
  811. /**
  812. * Test if 'value' is greater than 'other'.
  813. * Aliases: greaterThan
  814. * @param {Number} value value to test.
  815. * @param {Number} other value to compare with.
  816. * @return {boolean} true, if value is greater than other, false otherwise.
  817. */
  818. export function greaterThan(value: number, other: number): boolean;
  819. /**
  820. * Test if 'value' is greater than 'other'.
  821. * Aliases: greaterThan
  822. * @param {Number} value value to test.
  823. * @param {Number} other value to compare with.
  824. * @return {boolean} true, if value is greater than other, false otherwise.
  825. */
  826. export function gt(value: number, other: number): boolean;
  827. /**
  828. * Test if 'value' is less than or equal to 'other'.
  829. * Alias: lessThanOrEq, lessThanOrEqual
  830. * @param {Number} value value to test
  831. * @param {Number} other value to compare with
  832. * @return {boolean} true, if 'value' is less than or equal to 'other', false otherwise.
  833. */
  834. export function lessThanOrEqualTo(value: number, other: number): boolean;
  835. /**
  836. * Test if 'value' is less than or equal to 'other'.
  837. * Alias: lessThanOrEq, lessThanOrEqual
  838. * @param {Number} value value to test
  839. * @param {Number} other value to compare with
  840. * @return {boolean} true, if 'value' is less than or equal to 'other', false otherwise.
  841. */
  842. export function lessThanOrEq(value: number, other: number): boolean;
  843. /**
  844. * Test if 'value' is less than or equal to 'other'.
  845. * Alias: lessThanOrEq, lessThanOrEqual
  846. * @param {Number} value value to test
  847. * @param {Number} other value to compare with
  848. * @return {boolean} true, if 'value' is less than or equal to 'other', false otherwise.
  849. */
  850. export function lessThanOrEqual(value: number, other: number): boolean;
  851. /**
  852. * Test if 'value' is less than or equal to 'other'.
  853. * Alias: lessThanOrEq, lessThanOrEqual
  854. * @param {Number} value value to test
  855. * @param {Number} other value to compare with
  856. * @return {boolean} true, if 'value' is less than or equal to 'other', false otherwise.
  857. */
  858. export function le(value: number, other: number): boolean;
  859. /**
  860. * Test if 'value' is less than 'other'.
  861. * Alias: lessThan
  862. * @param {Number} value value to test
  863. * @param {Number} other value to compare with
  864. * @return {boolean} true, if 'value' is less than 'other', false otherwise.
  865. */
  866. export function lessThan(value: number, other: number): boolean;
  867. /**
  868. * Test if 'value' is less than 'other'.
  869. * Alias: lessThan
  870. * @param {Number} value value to test
  871. * @param {Number} other value to compare with
  872. * @return {boolean} true, if 'value' is less than 'other', false otherwise.
  873. */
  874. export function lt(value: number, other: number): boolean;
  875. /**
  876. * Test if 'value' is greater than 'others' values.
  877. * Alias: max
  878. * @param {Number} value value to test.
  879. * @param {Array} others values to compare with.
  880. * @return {boolean} true if 'value' is greater than 'others' values.
  881. */
  882. export function maximum(value: number, others: unknown[]): boolean;
  883. /**
  884. * Test if 'value' is greater than 'others' values.
  885. * Alias: max
  886. * @param {Number} value value to test.
  887. * @param {Array} others values to compare with.
  888. * @return {boolean} true if 'value' is greater than 'others' values.
  889. */
  890. export function max(value: number, others: unknown[]): boolean;
  891. /**
  892. * Test if 'value' is less than 'others' values.
  893. * Alias: min
  894. * @param {Number} value value to test.
  895. * @param {Array} others values to compare with.
  896. * @return {boolean} true if 'value' is less than 'others' values.
  897. */
  898. export function minimum(value: number, others: unknown[]): boolean;
  899. /**
  900. * Test if 'value' is less than 'others' values.
  901. * Alias: min
  902. * @param {Number} value value to test.
  903. * @param {Array} others values to compare with.
  904. * @return {boolean} true if 'value' is less than 'others' values.
  905. */
  906. export function min(value: number, others: unknown[]): boolean;
  907. /**
  908. * Test if 'value' is within 'start' and 'finish'.
  909. * Alias: withIn
  910. * @param {Number} value value to test.
  911. * @param {Number} start lower bound.
  912. * @param {Number} finish upper bound.
  913. * @return {boolean} true if 'value' is is within 'start' and 'finish', false otherwise.
  914. */
  915. export function within(value: number, start: number, finish: number): boolean;
  916. /**
  917. * Test if 'value' is within 'start' and 'finish'.
  918. * Alias: withIn
  919. * @param {Number} value value to test.
  920. * @param {Number} start lower bound.
  921. * @param {Number} finish upper bound.
  922. * @return {boolean} true if 'value' is is within 'start' and 'finish', false otherwise.
  923. */
  924. export function withIn(value: number, start: number, finish: number): boolean;
  925. /**
  926. * Test if 'value' is within 'precision' decimal places from 'comparitor'.
  927. * Alias: closish, near.
  928. * @param {Number} value value to test
  929. * @param {Number} comparitor value to test 'value' against
  930. * @param {Number} precision number of decimals to compare floating points, defaults to 2
  931. * @return {boolean} true if 'value' is within 'precision' decimal places from 'comparitor', false otherwise.
  932. */
  933. export function prettyClose(
  934. value: number,
  935. comparitor: number,
  936. precision: number
  937. ): boolean;
  938. /**
  939. * Test if 'value' is within 'precision' decimal places from 'comparitor'.
  940. * Alias: closish, near.
  941. * @param {Number} value value to test
  942. * @param {Number} comparitor value to test 'value' against
  943. * @param {Number} precision number of decimals to compare floating points, defaults to 2
  944. * @return {boolean} true if 'value' is within 'precision' decimal places from 'comparitor', false otherwise.
  945. */
  946. export function closish(
  947. value: number,
  948. comparitor: number,
  949. precision: number
  950. ): boolean;
  951. /**
  952. * Test if 'value' is within 'precision' decimal places from 'comparitor'.
  953. * Alias: closish, near.
  954. * @param {Number} value value to test
  955. * @param {Number} comparitor value to test 'value' against
  956. * @param {Number} precision number of decimals to compare floating points, defaults to 2
  957. * @return {boolean} true if 'value' is within 'precision' decimal places from 'comparitor', false otherwise.
  958. */
  959. export function near(
  960. value: number,
  961. comparitor: number,
  962. precision: number
  963. ): boolean;
  964. /**
  965. * Test if a value is a valid DNS address. eg www.stdarg.com is true while
  966. * 127.0.0.1 is false.
  967. * @param {unknown} value to test if a DNS address.
  968. * @return {boolean} true if a DNS address, false otherwise.
  969. * DNS Address is made up of labels separated by '.'
  970. * Each label must be between 1 and 63 characters long
  971. * The entire hostname (including the delimiting dots) has a maximum of 255 characters.
  972. * Hostname may not contain other characters, such as the underscore character (_)
  973. * other DNS names may contain the underscore.
  974. */
  975. export function dnsAddress(value: unknown): boolean;
  976. /**
  977. * Test if a value is a valid DNS address. eg www.stdarg.com is true while
  978. * 127.0.0.1 is false.
  979. * @param {unknown} value to test if a DNS address.
  980. * @return {boolean} true if a DNS address, false otherwise.
  981. * DNS Address is made up of labels separated by '.'
  982. * Each label must be between 1 and 63 characters long
  983. * The entire hostname (including the delimiting dots) has a maximum of 255 characters.
  984. * Hostname may not contain other characters, such as the underscore character (_)
  985. * other DNS names may contain the underscore.
  986. */
  987. export function dnsAddr(value: unknown): boolean;
  988. /**
  989. * Test if a value is a valid DNS address. eg www.stdarg.com is true while
  990. * 127.0.0.1 is false.
  991. * @param {unknown} value to test if a DNS address.
  992. * @return {boolean} true if a DNS address, false otherwise.
  993. * DNS Address is made up of labels separated by '.'
  994. * Each label must be between 1 and 63 characters long
  995. * The entire hostname (including the delimiting dots) has a maximum of 255 characters.
  996. * Hostname may not contain other characters, such as the underscore character (_)
  997. * other DNS names may contain the underscore.
  998. */
  999. export function dns(value: unknown): boolean;
  1000. /**
  1001. * Test if value is a valid email address.
  1002. * @param {unknown} value to test if an email address.
  1003. * @return {boolean} true if an email address, false otherwise.
  1004. */
  1005. export function emailAddress(value: unknown): boolean;
  1006. /**
  1007. * Test if value is a valid email address.
  1008. * @param {unknown} value to test if an email address.
  1009. * @return {boolean} true if an email address, false otherwise.
  1010. */
  1011. export function email(value: unknown): boolean;
  1012. /**
  1013. * Test if value is a valid email address.
  1014. * @param {unknown} value to test if an email address.
  1015. * @return {boolean} true if an email address, false otherwise.
  1016. */
  1017. export function emailAddr(value: unknown): boolean;
  1018. /**
  1019. * Test if a value is either an IPv4 numeric IP address.
  1020. * The rules are:
  1021. * must be a string
  1022. * length must be 15 characters or less
  1023. * There must be four octets separated by a '.'
  1024. * No octet can be less than 0 or greater than 255.
  1025. * @param {unknown} value to test if an ip address.
  1026. * @return {boolean} true if an ip address, false otherwise.
  1027. */
  1028. export function ipv4Address(value: unknown): boolean;
  1029. /**
  1030. * Test if a value is either an IPv4 numeric IP address.
  1031. * The rules are:
  1032. * must be a string
  1033. * length must be 15 characters or less
  1034. * There must be four octets separated by a '.'
  1035. * No octet can be less than 0 or greater than 255.
  1036. * @param {unknown} value to test if an ip address.
  1037. * @return {boolean} true if an ip address, false otherwise.
  1038. */
  1039. export function ipv4(value: unknown): boolean;
  1040. /**
  1041. * Test if a value is either an IPv4 numeric IP address.
  1042. * The rules are:
  1043. * must be a string
  1044. * length must be 15 characters or less
  1045. * There must be four octets separated by a '.'
  1046. * No octet can be less than 0 or greater than 255.
  1047. * @param {unknown} value to test if an ip address.
  1048. * @return {boolean} true if an ip address, false otherwise.
  1049. */
  1050. export function ipv4Addr(value: unknown): boolean;
  1051. /**
  1052. * Test if a value is either an IPv6 numeric IP address.
  1053. * @param {unknown} value to test if an ip address.
  1054. * @return {boolean} true if an ip address, false otherwise.
  1055. */
  1056. export function ipv6Address(value: unknown): boolean;
  1057. /**
  1058. * Test if a value is either an IPv6 numeric IP address.
  1059. * @param {unknown} value to test if an ip address.
  1060. * @return {boolean} true if an ip address, false otherwise.
  1061. */
  1062. export function ipv6(value: unknown): boolean;
  1063. /**
  1064. * Test if a value is either an IPv6 numeric IP address.
  1065. * @param {unknown} value to test if an ip address.
  1066. * @return {boolean} true if an ip address, false otherwise.
  1067. */
  1068. export function ipv6Addr(value: unknown): boolean;
  1069. /**
  1070. * Test if a value is either an IPv4 or IPv6 numeric IP address.
  1071. * @param {unknown} value to test if an ip address.
  1072. * @return {boolean} true if an ip address, false otherwise.
  1073. */
  1074. export function ipAddress(value: unknown): boolean;
  1075. /**
  1076. * Test if a value is either an IPv4 or IPv6 numeric IP address.
  1077. * @param {unknown} value to test if an ip address.
  1078. * @return {boolean} true if an ip address, false otherwise.
  1079. */
  1080. export function ip(value: unknown): boolean;
  1081. /**
  1082. * Test if a value is either an IPv4 or IPv6 numeric IP address.
  1083. * @param {unknown} value to test if an ip address.
  1084. * @return {boolean} true if an ip address, false otherwise.
  1085. */
  1086. export function ipAddr(value: unknown): boolean;
  1087. /**
  1088. * Test is a value is a valid ipv4, ipv6 or DNS name.
  1089. * Aliases: host, hostAddr, hostAddress.
  1090. * @param {unknown} value to test if a host address.
  1091. * @return {boolean} true if a host address, false otherwise.
  1092. */
  1093. export function hostAddress(value: unknown): boolean;
  1094. /**
  1095. * Test is a value is a valid ipv4, ipv6 or DNS name.
  1096. * Aliases: host, hostAddr, hostAddress.
  1097. * @param {unknown} value to test if a host address.
  1098. * @return {boolean} true if a host address, false otherwise.
  1099. */
  1100. export function host(value: unknown): boolean;
  1101. /**
  1102. * Test is a value is a valid ipv4, ipv6 or DNS name.
  1103. * Aliases: host, hostAddr, hostAddress.
  1104. * @param {unknown} value to test if a host address.
  1105. * @return {boolean} true if a host address, false otherwise.
  1106. */
  1107. export function hostIp(value: unknown): boolean;
  1108. /**
  1109. * Test is a value is a valid ipv4, ipv6 or DNS name.
  1110. * Aliases: host, hostAddr, hostAddress.
  1111. * @param {unknown} value to test if a host address.
  1112. * @return {boolean} true if a host address, false otherwise.
  1113. */
  1114. export function hostAddr(value: unknown): boolean;
  1115. /**
  1116. * Test if a number is a valid TCP port
  1117. * @param {unknown} value to test if its a valid TCP port
  1118. */
  1119. export function port(value: unknown): boolean;
  1120. /**
  1121. * Test if a number is a valid TCP port in the range 0-1023.
  1122. * Alias: is.sysPort.
  1123. * @param {unknown} value to test if its a valid TCP port
  1124. */
  1125. export function systemPort(value: unknown): boolean;
  1126. /**
  1127. * Test if a number is a valid TCP port in the range 0-1023.
  1128. * Alias: is.sysPort.
  1129. * @param {unknown} value to test if its a valid TCP port
  1130. */
  1131. export function sysPort(value: unknown): boolean;
  1132. /**
  1133. * Test if a number is a valid TCP port in the range 1024-65535.
  1134. * @param {unknown} value to test if its a valid TCP port
  1135. */
  1136. export function userPort(value: unknown): boolean;
  1137. /**
  1138. * Test if a string is a credit card.
  1139. * From http://en.wikipedia.org/wiki/Luhn_algorithm
  1140. * @param {string} value to test if a credit card.
  1141. * @return true if the string is the correct format, false otherwise
  1142. */
  1143. export function creditCardNumber(str: string): boolean;
  1144. /**
  1145. * Test if a string is a credit card.
  1146. * From http://en.wikipedia.org/wiki/Luhn_algorithm
  1147. * @param {string} value to test if a credit card.
  1148. * @return true if the string is the correct format, false otherwise
  1149. */
  1150. export function creditCard(str: string): boolean;
  1151. /**
  1152. * Test if a string is a credit card.
  1153. * From http://en.wikipedia.org/wiki/Luhn_algorithm
  1154. * @param {string} value to test if a credit card.
  1155. * @return true if the string is the correct format, false otherwise
  1156. */
  1157. export function creditCardNum(str: string): boolean;
  1158. /**
  1159. * Test if card number is an American Express card.
  1160. * @param {string} the credit card number string to test.
  1161. * @return true if the string is the correct format, false otherwise
  1162. */
  1163. export function americanExpressCardNumber(str: string): boolean;
  1164. /**
  1165. * Test if card number is an American Express card.
  1166. * @param {string} the credit card number string to test.
  1167. * @return true if the string is the correct format, false otherwise
  1168. */
  1169. export function amexCard(str: string): boolean;
  1170. /**
  1171. * Test if card number is an American Express card.
  1172. * @param {string} the credit card number string to test.
  1173. * @return true if the string is the correct format, false otherwise
  1174. */
  1175. export function amexCardNum(str: string): boolean;
  1176. /**
  1177. * Test if card number is a China UnionPay card.
  1178. * @param {string} the credit card number string to test.
  1179. * @return true if the string is the correct format, false otherwise
  1180. */
  1181. export function chinaUnionPayCardNumber(str: string): boolean;
  1182. /**
  1183. * Test if card number is a China UnionPay card.
  1184. * @param {string} the credit card number string to test.
  1185. * @return true if the string is the correct format, false otherwise
  1186. */
  1187. export function chinaUnion(str: string): boolean;
  1188. /**
  1189. * Test if card number is a China UnionPay card.
  1190. * @param {string} the credit card number string to test.
  1191. * @return true if the string is the correct format, false otherwise
  1192. */
  1193. export function chinaUnionPayCard(str: string): boolean;
  1194. /**
  1195. * Test if card number is a Diner's Club Carte Blance card.
  1196. * @param {string} the credit card number string to test.
  1197. * @return true if the string is the correct format, false otherwise
  1198. */
  1199. export function dinersClubCarteBlancheCardNumber(str: string): boolean;
  1200. /**
  1201. * Test if card number is a Diner's Club Carte Blance card.
  1202. * @param {string} the credit card number string to test.
  1203. * @return true if the string is the correct format, false otherwise
  1204. */
  1205. export function dinersClubCB(str: string): boolean;
  1206. /**
  1207. * Test if card number is a Diner's Club Carte Blance card.
  1208. * @param {string} the credit card number string to test.
  1209. * @return true if the string is the correct format, false otherwise
  1210. */
  1211. export function dinersClubCarteBlancheCard(str: string): boolean;
  1212. /**
  1213. * Test if card number is a Diner's Club International card.
  1214. * @param {string} the credit card number string to test.
  1215. * @return true if the string is the correct format, false otherwise
  1216. */
  1217. export function dinersClubInternationalCardNumber(str: string): boolean;
  1218. /**
  1219. * Test if card number is a Diner's Club International card.
  1220. * @param {string} the credit card number string to test.
  1221. * @return true if the string is the correct format, false otherwise
  1222. */
  1223. export function dinersClubInt(str: string): boolean;
  1224. /**
  1225. * Test if card number is a Diner's Club International card.
  1226. * @param {string} the credit card number string to test.
  1227. * @return true if the string is the correct format, false otherwise
  1228. */
  1229. export function dinersClubInternationalCard(str: string): boolean;
  1230. /**
  1231. * Test if card number is a Diner's Club USA & CA card.
  1232. * @param {string} the credit card number string to test.
  1233. * @return true if the string is the correct format, false otherwise
  1234. */
  1235. export function dinersClubUSACanadaCardNumber(str: string): boolean;
  1236. /**
  1237. * Test if card number is a Diner's Club USA & CA card.
  1238. * @param {string} the credit card number string to test.
  1239. * @return true if the string is the correct format, false otherwise
  1240. */
  1241. export function dinersClub(str: string): boolean;
  1242. /**
  1243. * Test if card number is a Diner's Club USA & CA card.
  1244. * @param {string} the credit card number string to test.
  1245. * @return true if the string is the correct format, false otherwise
  1246. */
  1247. export function dinersClubUSACanCard(str: string): boolean;
  1248. /**
  1249. * Test if card number is a Diner's Club USA/CA card.
  1250. * @param {string} the credit card number string to test.
  1251. * @return true if the string is the correct format, false otherwise
  1252. */
  1253. export function discoverCardNumber(str: string): boolean;
  1254. /**
  1255. * Test if card number is a Diner's Club USA/CA card.
  1256. * @param {string} the credit card number string to test.
  1257. * @return true if the string is the correct format, false otherwise
  1258. */
  1259. export function discover(str: string): boolean;
  1260. /**
  1261. * Test if card number is a Diner's Club USA/CA card.
  1262. * @param {string} the credit card number string to test.
  1263. * @return true if the string is the correct format, false otherwise
  1264. */
  1265. export function discoverCard(str: string): boolean;
  1266. /**
  1267. * Test if card number is an InstaPayment card number
  1268. * @param {string} the credit card number string to test.
  1269. * @return true if the string is the correct format, false otherwise
  1270. */
  1271. export function instaPaymentCardNumber(str: string): boolean;
  1272. /**
  1273. * Test if card number is an InstaPayment card number
  1274. * @param {string} the credit card number string to test.
  1275. * @return true if the string is the correct format, false otherwise
  1276. */
  1277. export function instaPayment(str: string): boolean;
  1278. /**
  1279. * Test if card number is a JCB card number
  1280. * @param {string} the credit card number string to test.
  1281. * @return true if the string is the correct format, false otherwise
  1282. */
  1283. export function jcbCardNumber(str: string): boolean;
  1284. /**
  1285. * Test if card number is a JCB card number
  1286. * @param {string} the credit card number string to test.
  1287. * @return true if the string is the correct format, false otherwise
  1288. */
  1289. export function jcb(str: string): boolean;
  1290. /**
  1291. * Test if card number is a JCB card number
  1292. * @param {string} the credit card number string to test.
  1293. * @return true if the string is the correct format, false otherwise
  1294. */
  1295. export function jcbCard(str: string): boolean;
  1296. /**
  1297. * Test if card number is a Laser card number
  1298. * @param {string} the credit card number string to test.
  1299. * @return true if the string is the correct format, false otherwise
  1300. */
  1301. export function laserCardNumber(str: string): boolean;
  1302. /**
  1303. * Test if card number is a Laser card number
  1304. * @param {string} the credit card number string to test.
  1305. * @return true if the string is the correct format, false otherwise
  1306. */
  1307. export function laser(str: string): boolean;
  1308. /**
  1309. * Test if card number is a Laser card number
  1310. * @param {string} the credit card number string to test.
  1311. * @return true if the string is the correct format, false otherwise
  1312. */
  1313. export function laserCard(str: string): boolean;
  1314. /**
  1315. * Test if card number is a Maestro card number
  1316. * @param {string} the credit card number string to test.
  1317. * @return true if the string is the correct format, false otherwise
  1318. */
  1319. export function maestroCardNumber(str: string): boolean;
  1320. /**
  1321. * Test if card number is a Maestro card number
  1322. * @param {string} the credit card number string to test.
  1323. * @return true if the string is the correct format, false otherwise
  1324. */
  1325. export function maestro(str: string): boolean;
  1326. /**
  1327. * Test if card number is a Maestro card number
  1328. * @param {string} the credit card number string to test.
  1329. * @return true if the string is the correct format, false otherwise
  1330. */
  1331. export function maestroCard(str: string): boolean;
  1332. /**
  1333. * Test if card number is a Dankort card number
  1334. * @param {string} the credit card number string to test.
  1335. * @return true if the string is the correct format, false otherwise
  1336. */
  1337. export function dankortCardNumber(str: string): boolean;
  1338. /**
  1339. * Test if card number is a Dankort card number
  1340. * @param {string} the credit card number string to test.
  1341. * @return true if the string is the correct format, false otherwise
  1342. */
  1343. export function dankort(str: string): boolean;
  1344. /**
  1345. * Test if card number is a Dankort card number
  1346. * @param {string} the credit card number string to test.
  1347. * @return true if the string is the correct format, false otherwise
  1348. */
  1349. export function dankortCard(str: string): boolean;
  1350. /**
  1351. * Test if card number is a MasterCard card number
  1352. * @param {string} the credit card number string to test.
  1353. * @return true if the string is the correct format, false otherwise
  1354. */
  1355. export function masterCardCardNumber(str: string): boolean;
  1356. /**
  1357. * Test if card number is a MasterCard card number
  1358. * @param {string} the credit card number string to test.
  1359. * @return true if the string is the correct format, false otherwise
  1360. */
  1361. export function masterCard(str: string): boolean;
  1362. /**
  1363. * Test if card number is a MasterCard card number
  1364. * @param {string} the credit card number string to test.
  1365. * @return true if the string is the correct format, false otherwise
  1366. */
  1367. export function masterCardCard(str: string): boolean;
  1368. /**
  1369. * Test if card number is a Visa card number
  1370. * @param {string} the credit card number string to test.
  1371. * @return true if the string is the correct format, false otherwise
  1372. */
  1373. export function visaCardNumber(str: string): boolean;
  1374. /**
  1375. * Test if card number is a Visa card number
  1376. * @param {string} the credit card number string to test.
  1377. * @return true if the string is the correct format, false otherwise
  1378. */
  1379. export function visa(str: string): boolean;
  1380. /**
  1381. * Test if card number is a Visa card number
  1382. * @param {string} the credit card number string to test.
  1383. * @return true if the string is the correct format, false otherwise
  1384. */
  1385. export function visaCard(str: string): boolean;
  1386. /**
  1387. * Test if card number is a Visa card number
  1388. * @param {string} the credit card number string to test.
  1389. * @return true if the string is the correct format, false otherwise
  1390. */
  1391. export function visaElectronCardNumber(str: string): boolean;
  1392. /**
  1393. * Test if card number is a Visa card number
  1394. * @param {string} the credit card number string to test.
  1395. * @return true if the string is the correct format, false otherwise
  1396. */
  1397. export function visaElectron(str: string): boolean;
  1398. /**
  1399. * Test if card number is a Visa card number
  1400. * @param {string} the credit card number string to test.
  1401. * @return true if the string is the correct format, false otherwise
  1402. */
  1403. export function visaElectronCard(str: string): boolean;
  1404. export function mongoId(id: unknown): boolean;
  1405. export function objectId(id: unknown): boolean;
  1406. export function objId(id: unknown): boolean;
  1407. export function matching(val: unknown, ...args: unknown[]): boolean;
  1408. export function match(val: unknown, ...args: unknown[]): boolean;
  1409. export function inArgs(val: unknown, ...args: unknown[]): boolean;
  1410. /**********************************
  1411. ***Definitely a work in progress***
  1412. **********************************/
  1413. /**
  1414. * Test if a string contains a US street address
  1415. * @param {string} the string to search
  1416. * @return true if an address is present, false otherwise
  1417. */
  1418. export function streetAddress(str: string): boolean;
  1419. /**********************************
  1420. ***Definitely a work in progress***
  1421. **********************************/
  1422. /**
  1423. * Test if a string contains a US street address
  1424. * @param {string} the string to search
  1425. * @return true if an address is present, false otherwise
  1426. */
  1427. export function street(str: string): boolean;
  1428. /**********************************
  1429. ***Definitely a work in progress***
  1430. **********************************/
  1431. /**
  1432. * Test if a string contains a US street address
  1433. * @param {string} the string to search
  1434. * @return true if an address is present, false otherwise
  1435. */
  1436. export function address(str: string): boolean;
  1437. /**
  1438. * Test if a string resembles a US Zip code,
  1439. * no regular expression will be perfect for this,
  1440. * as there are many numbers that aren't valid zip codes
  1441. * @param {string || Number} the string or number literal to test
  1442. * @return true if zipcode like, false otherwise
  1443. */
  1444. export function zipCode(str: string): boolean;
  1445. /**
  1446. * Test if a string resembles a US Zip code,
  1447. * no regular expression will be perfect for this,
  1448. * as there are many numbers that aren't valid zip codes
  1449. * @param {string || Number} the string or number literal to test
  1450. * @return true if zipcode like, false otherwise
  1451. */
  1452. export function zip(str: string): boolean;
  1453. /**
  1454. * Test if a string contains a US phone number
  1455. * @param {string} the string to search
  1456. * @return true if str contains a phone number, false otherwise.
  1457. */
  1458. export function phoneNumber(str: string): boolean;
  1459. /**
  1460. * Test if a string contains a US phone number
  1461. * @param {string} the string to search
  1462. * @return true if str contains a phone number, false otherwise.
  1463. */
  1464. export function phone(str: string): boolean;
  1465. export function url(val: unknown): unknown;
  1466. export function uri(val: unknown): unknown;
  1467. export function enumerator(val: unknown, ary: unknown): boolean;
  1468. declare function _enum(val: unknown, ary: unknown): boolean;
  1469. export function inArray(val: unknown, ary: unknown): boolean;
  1470. export {
  1471. _false as false,
  1472. _function as function,
  1473. _null as null,
  1474. _true as true,
  1475. _instanceof as instanceof,
  1476. _enum as enum,
  1477. _arguments as arguments,
  1478. };