@ohos-ports/stdlib-complex-real 0.0.0-stage → 0.2.1-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (271) hide show
  1. package/LICENSE +177 -0
  2. package/NOTICE +1 -0
  3. package/README.md +320 -2
  4. package/SECURITY.md +5 -0
  5. package/dist/index.d.ts +3 -0
  6. package/dist/index.js +5 -0
  7. package/dist/index.js.map +7 -0
  8. package/docs/types/index.d.ts +44 -0
  9. package/include/stdlib/complex/real.h +40 -0
  10. package/lib/index.js +43 -0
  11. package/lib/main.js +42 -0
  12. package/manifest.json +40 -0
  13. package/node_modules/@stdlib/array-float32/LICENSE +177 -0
  14. package/node_modules/@stdlib/array-float32/NOTICE +1 -0
  15. package/node_modules/@stdlib/array-float32/README.md +1577 -0
  16. package/node_modules/@stdlib/array-float32/SECURITY.md +5 -0
  17. package/node_modules/@stdlib/array-float32/dist/index.d.ts +3 -0
  18. package/node_modules/@stdlib/array-float32/dist/index.js +19 -0
  19. package/node_modules/@stdlib/array-float32/dist/index.js.map +7 -0
  20. package/node_modules/@stdlib/array-float32/docs/types/index.d.ts +26 -0
  21. package/node_modules/@stdlib/array-float32/lib/index.js +52 -0
  22. package/node_modules/@stdlib/array-float32/lib/main.js +28 -0
  23. package/node_modules/@stdlib/array-float32/lib/polyfill.js +37 -0
  24. package/node_modules/@stdlib/array-float32/package.json +72 -0
  25. package/node_modules/@stdlib/assert-has-float32array-support/LICENSE +177 -0
  26. package/node_modules/@stdlib/assert-has-float32array-support/NOTICE +1 -0
  27. package/node_modules/@stdlib/assert-has-float32array-support/README.md +187 -0
  28. package/node_modules/@stdlib/assert-has-float32array-support/SECURITY.md +5 -0
  29. package/node_modules/@stdlib/assert-has-float32array-support/dist/index.d.ts +3 -0
  30. package/node_modules/@stdlib/assert-has-float32array-support/dist/index.js +7 -0
  31. package/node_modules/@stdlib/assert-has-float32array-support/dist/index.js.map +7 -0
  32. package/node_modules/@stdlib/assert-has-float32array-support/docs/types/index.d.ts +35 -0
  33. package/node_modules/@stdlib/assert-has-float32array-support/lib/float32array.js +28 -0
  34. package/node_modules/@stdlib/assert-has-float32array-support/lib/index.js +40 -0
  35. package/node_modules/@stdlib/assert-has-float32array-support/lib/main.js +65 -0
  36. package/node_modules/@stdlib/assert-has-float32array-support/package.json +77 -0
  37. package/node_modules/@stdlib/assert-has-own-property/LICENSE +177 -0
  38. package/node_modules/@stdlib/assert-has-own-property/NOTICE +1 -0
  39. package/node_modules/@stdlib/assert-has-own-property/README.md +263 -0
  40. package/node_modules/@stdlib/assert-has-own-property/SECURITY.md +5 -0
  41. package/node_modules/@stdlib/assert-has-own-property/dist/index.d.ts +3 -0
  42. package/node_modules/@stdlib/assert-has-own-property/dist/index.js +5 -0
  43. package/node_modules/@stdlib/assert-has-own-property/dist/index.js.map +7 -0
  44. package/node_modules/@stdlib/assert-has-own-property/docs/types/index.d.ts +49 -0
  45. package/node_modules/@stdlib/assert-has-own-property/lib/index.js +47 -0
  46. package/node_modules/@stdlib/assert-has-own-property/lib/main.js +64 -0
  47. package/node_modules/@stdlib/assert-has-own-property/package.json +73 -0
  48. package/node_modules/@stdlib/assert-has-symbol-support/LICENSE +177 -0
  49. package/node_modules/@stdlib/assert-has-symbol-support/NOTICE +1 -0
  50. package/node_modules/@stdlib/assert-has-symbol-support/README.md +193 -0
  51. package/node_modules/@stdlib/assert-has-symbol-support/SECURITY.md +5 -0
  52. package/node_modules/@stdlib/assert-has-symbol-support/dist/index.d.ts +3 -0
  53. package/node_modules/@stdlib/assert-has-symbol-support/dist/index.js +5 -0
  54. package/node_modules/@stdlib/assert-has-symbol-support/dist/index.js.map +7 -0
  55. package/node_modules/@stdlib/assert-has-symbol-support/docs/types/index.d.ts +35 -0
  56. package/node_modules/@stdlib/assert-has-symbol-support/lib/index.js +40 -0
  57. package/node_modules/@stdlib/assert-has-symbol-support/lib/main.js +42 -0
  58. package/node_modules/@stdlib/assert-has-symbol-support/package.json +72 -0
  59. package/node_modules/@stdlib/assert-has-tostringtag-support/LICENSE +177 -0
  60. package/node_modules/@stdlib/assert-has-tostringtag-support/NOTICE +1 -0
  61. package/node_modules/@stdlib/assert-has-tostringtag-support/README.md +187 -0
  62. package/node_modules/@stdlib/assert-has-tostringtag-support/SECURITY.md +5 -0
  63. package/node_modules/@stdlib/assert-has-tostringtag-support/dist/index.d.ts +3 -0
  64. package/node_modules/@stdlib/assert-has-tostringtag-support/dist/index.js +5 -0
  65. package/node_modules/@stdlib/assert-has-tostringtag-support/dist/index.js.map +7 -0
  66. package/node_modules/@stdlib/assert-has-tostringtag-support/docs/types/index.d.ts +35 -0
  67. package/node_modules/@stdlib/assert-has-tostringtag-support/lib/index.js +40 -0
  68. package/node_modules/@stdlib/assert-has-tostringtag-support/lib/main.js +49 -0
  69. package/node_modules/@stdlib/assert-has-tostringtag-support/package.json +78 -0
  70. package/node_modules/@stdlib/assert-is-float32array/LICENSE +177 -0
  71. package/node_modules/@stdlib/assert-is-float32array/NOTICE +1 -0
  72. package/node_modules/@stdlib/assert-is-float32array/README.md +229 -0
  73. package/node_modules/@stdlib/assert-is-float32array/SECURITY.md +5 -0
  74. package/node_modules/@stdlib/assert-is-float32array/dist/index.d.ts +3 -0
  75. package/node_modules/@stdlib/assert-is-float32array/dist/index.js +5 -0
  76. package/node_modules/@stdlib/assert-is-float32array/dist/index.js.map +7 -0
  77. package/node_modules/@stdlib/assert-is-float32array/docs/types/index.d.ts +42 -0
  78. package/node_modules/@stdlib/assert-is-float32array/lib/index.js +44 -0
  79. package/node_modules/@stdlib/assert-is-float32array/lib/main.js +59 -0
  80. package/node_modules/@stdlib/assert-is-float32array/package.json +81 -0
  81. package/node_modules/@stdlib/assert-is-number/LICENSE +177 -0
  82. package/node_modules/@stdlib/assert-is-number/NOTICE +1 -0
  83. package/node_modules/@stdlib/assert-is-number/README.md +231 -0
  84. package/node_modules/@stdlib/assert-is-number/SECURITY.md +5 -0
  85. package/node_modules/@stdlib/assert-is-number/dist/index.d.ts +3 -0
  86. package/node_modules/@stdlib/assert-is-number/dist/index.js +13 -0
  87. package/node_modules/@stdlib/assert-is-number/dist/index.js.map +7 -0
  88. package/node_modules/@stdlib/assert-is-number/docs/types/index.d.ts +121 -0
  89. package/node_modules/@stdlib/assert-is-number/lib/index.js +79 -0
  90. package/node_modules/@stdlib/assert-is-number/lib/main.js +58 -0
  91. package/node_modules/@stdlib/assert-is-number/lib/object.js +66 -0
  92. package/node_modules/@stdlib/assert-is-number/lib/primitive.js +46 -0
  93. package/node_modules/@stdlib/assert-is-number/lib/tostring.js +34 -0
  94. package/node_modules/@stdlib/assert-is-number/lib/try2serialize.js +47 -0
  95. package/node_modules/@stdlib/assert-is-number/package.json +80 -0
  96. package/node_modules/@stdlib/complex-float32/LICENSE +177 -0
  97. package/node_modules/@stdlib/complex-float32/NOTICE +1 -0
  98. package/node_modules/@stdlib/complex-float32/README.md +629 -0
  99. package/node_modules/@stdlib/complex-float32/SECURITY.md +5 -0
  100. package/node_modules/@stdlib/complex-float32/dist/index.d.ts +3 -0
  101. package/node_modules/@stdlib/complex-float32/dist/index.js +9 -0
  102. package/node_modules/@stdlib/complex-float32/dist/index.js.map +7 -0
  103. package/node_modules/@stdlib/complex-float32/docs/types/index.d.ts +111 -0
  104. package/node_modules/@stdlib/complex-float32/lib/index.js +40 -0
  105. package/node_modules/@stdlib/complex-float32/lib/main.js +159 -0
  106. package/node_modules/@stdlib/complex-float32/lib/tojson.js +39 -0
  107. package/node_modules/@stdlib/complex-float32/lib/tostring.js +42 -0
  108. package/node_modules/@stdlib/complex-float32/manifest.json +38 -0
  109. package/node_modules/@stdlib/complex-float32/package.json +76 -0
  110. package/node_modules/@stdlib/complex-float64/LICENSE +177 -0
  111. package/node_modules/@stdlib/complex-float64/NOTICE +1 -0
  112. package/node_modules/@stdlib/complex-float64/README.md +699 -0
  113. package/node_modules/@stdlib/complex-float64/SECURITY.md +5 -0
  114. package/node_modules/@stdlib/complex-float64/dist/index.d.ts +3 -0
  115. package/node_modules/@stdlib/complex-float64/dist/index.js +9 -0
  116. package/node_modules/@stdlib/complex-float64/dist/index.js.map +7 -0
  117. package/node_modules/@stdlib/complex-float64/docs/types/index.d.ts +111 -0
  118. package/node_modules/@stdlib/complex-float64/lib/index.js +40 -0
  119. package/node_modules/@stdlib/complex-float64/lib/main.js +158 -0
  120. package/node_modules/@stdlib/complex-float64/lib/tojson.js +39 -0
  121. package/node_modules/@stdlib/complex-float64/lib/tostring.js +42 -0
  122. package/node_modules/@stdlib/complex-float64/manifest.json +40 -0
  123. package/node_modules/@stdlib/complex-float64/package.json +75 -0
  124. package/node_modules/@stdlib/constants-float64-pinf/LICENSE +177 -0
  125. package/node_modules/@stdlib/constants-float64-pinf/NOTICE +1 -0
  126. package/node_modules/@stdlib/constants-float64-pinf/README.md +238 -0
  127. package/node_modules/@stdlib/constants-float64-pinf/SECURITY.md +5 -0
  128. package/node_modules/@stdlib/constants-float64-pinf/dist/index.d.ts +3 -0
  129. package/node_modules/@stdlib/constants-float64-pinf/dist/index.js +3 -0
  130. package/node_modules/@stdlib/constants-float64-pinf/dist/index.js.map +7 -0
  131. package/node_modules/@stdlib/constants-float64-pinf/docs/types/index.d.ts +33 -0
  132. package/node_modules/@stdlib/constants-float64-pinf/lib/index.js +56 -0
  133. package/node_modules/@stdlib/constants-float64-pinf/manifest.json +36 -0
  134. package/node_modules/@stdlib/constants-float64-pinf/package.json +71 -0
  135. package/node_modules/@stdlib/error-tools-fmtprodmsg/LICENSE +177 -0
  136. package/node_modules/@stdlib/error-tools-fmtprodmsg/NOTICE +1 -0
  137. package/node_modules/@stdlib/error-tools-fmtprodmsg/README.md +182 -0
  138. package/node_modules/@stdlib/error-tools-fmtprodmsg/SECURITY.md +5 -0
  139. package/node_modules/@stdlib/error-tools-fmtprodmsg/dist/index.d.ts +3 -0
  140. package/node_modules/@stdlib/error-tools-fmtprodmsg/dist/index.js +5 -0
  141. package/node_modules/@stdlib/error-tools-fmtprodmsg/dist/index.js.map +7 -0
  142. package/node_modules/@stdlib/error-tools-fmtprodmsg/docs/types/index.d.ts +39 -0
  143. package/node_modules/@stdlib/error-tools-fmtprodmsg/lib/index.js +40 -0
  144. package/node_modules/@stdlib/error-tools-fmtprodmsg/lib/main.js +48 -0
  145. package/node_modules/@stdlib/error-tools-fmtprodmsg/package.json +70 -0
  146. package/node_modules/@stdlib/number-ctor/LICENSE +177 -0
  147. package/node_modules/@stdlib/number-ctor/NOTICE +1 -0
  148. package/node_modules/@stdlib/number-ctor/README.md +212 -0
  149. package/node_modules/@stdlib/number-ctor/SECURITY.md +5 -0
  150. package/node_modules/@stdlib/number-ctor/dist/index.d.ts +3 -0
  151. package/node_modules/@stdlib/number-ctor/dist/index.js +5 -0
  152. package/node_modules/@stdlib/number-ctor/dist/index.js.map +7 -0
  153. package/node_modules/@stdlib/number-ctor/docs/types/index.d.ts +30 -0
  154. package/node_modules/@stdlib/number-ctor/lib/index.js +40 -0
  155. package/node_modules/@stdlib/number-ctor/lib/main.js +23 -0
  156. package/node_modules/@stdlib/number-ctor/package.json +62 -0
  157. package/node_modules/@stdlib/number-float64-base-to-float32/LICENSE +177 -0
  158. package/node_modules/@stdlib/number-float64-base-to-float32/NOTICE +1 -0
  159. package/node_modules/@stdlib/number-float64-base-to-float32/README.md +191 -0
  160. package/node_modules/@stdlib/number-float64-base-to-float32/SECURITY.md +5 -0
  161. package/node_modules/@stdlib/number-float64-base-to-float32/dist/index.d.ts +3 -0
  162. package/node_modules/@stdlib/number-float64-base-to-float32/dist/index.js +19 -0
  163. package/node_modules/@stdlib/number-float64-base-to-float32/dist/index.js.map +7 -0
  164. package/node_modules/@stdlib/number-float64-base-to-float32/docs/types/index.d.ts +36 -0
  165. package/node_modules/@stdlib/number-float64-base-to-float32/lib/index.js +51 -0
  166. package/node_modules/@stdlib/number-float64-base-to-float32/lib/main.js +28 -0
  167. package/node_modules/@stdlib/number-float64-base-to-float32/lib/polyfill.js +51 -0
  168. package/node_modules/@stdlib/number-float64-base-to-float32/package.json +76 -0
  169. package/node_modules/@stdlib/string-base-format-interpolate/LICENSE +177 -0
  170. package/node_modules/@stdlib/string-base-format-interpolate/NOTICE +1 -0
  171. package/node_modules/@stdlib/string-base-format-interpolate/README.md +219 -0
  172. package/node_modules/@stdlib/string-base-format-interpolate/SECURITY.md +5 -0
  173. package/node_modules/@stdlib/string-base-format-interpolate/dist/index.d.ts +3 -0
  174. package/node_modules/@stdlib/string-base-format-interpolate/dist/index.js +17 -0
  175. package/node_modules/@stdlib/string-base-format-interpolate/dist/index.js.map +7 -0
  176. package/node_modules/@stdlib/string-base-format-interpolate/docs/types/index.d.ts +71 -0
  177. package/node_modules/@stdlib/string-base-format-interpolate/lib/format_double.js +103 -0
  178. package/node_modules/@stdlib/string-base-format-interpolate/lib/format_integer.js +115 -0
  179. package/node_modules/@stdlib/string-base-format-interpolate/lib/index.js +41 -0
  180. package/node_modules/@stdlib/string-base-format-interpolate/lib/is_number.js +46 -0
  181. package/node_modules/@stdlib/string-base-format-interpolate/lib/is_string.js +42 -0
  182. package/node_modules/@stdlib/string-base-format-interpolate/lib/main.js +243 -0
  183. package/node_modules/@stdlib/string-base-format-interpolate/lib/space_pad.js +65 -0
  184. package/node_modules/@stdlib/string-base-format-interpolate/lib/zero_pad.js +84 -0
  185. package/node_modules/@stdlib/string-base-format-interpolate/package.json +71 -0
  186. package/node_modules/@stdlib/string-base-format-tokenize/LICENSE +177 -0
  187. package/node_modules/@stdlib/string-base-format-tokenize/NOTICE +1 -0
  188. package/node_modules/@stdlib/string-base-format-tokenize/README.md +203 -0
  189. package/node_modules/@stdlib/string-base-format-tokenize/SECURITY.md +5 -0
  190. package/node_modules/@stdlib/string-base-format-tokenize/dist/index.d.ts +3 -0
  191. package/node_modules/@stdlib/string-base-format-tokenize/dist/index.js +5 -0
  192. package/node_modules/@stdlib/string-base-format-tokenize/dist/index.js.map +7 -0
  193. package/node_modules/@stdlib/string-base-format-tokenize/docs/types/index.d.ts +68 -0
  194. package/node_modules/@stdlib/string-base-format-tokenize/lib/index.js +41 -0
  195. package/node_modules/@stdlib/string-base-format-tokenize/lib/main.js +95 -0
  196. package/node_modules/@stdlib/string-base-format-tokenize/package.json +69 -0
  197. package/node_modules/@stdlib/string-format/LICENSE +177 -0
  198. package/node_modules/@stdlib/string-format/NOTICE +1 -0
  199. package/node_modules/@stdlib/string-format/README.md +341 -0
  200. package/node_modules/@stdlib/string-format/SECURITY.md +5 -0
  201. package/node_modules/@stdlib/string-format/dist/index.d.ts +3 -0
  202. package/node_modules/@stdlib/string-format/dist/index.js +7 -0
  203. package/node_modules/@stdlib/string-format/dist/index.js.map +7 -0
  204. package/node_modules/@stdlib/string-format/docs/types/index.d.ts +42 -0
  205. package/node_modules/@stdlib/string-format/lib/index.js +43 -0
  206. package/node_modules/@stdlib/string-format/lib/is_string.js +42 -0
  207. package/node_modules/@stdlib/string-format/lib/main.js +64 -0
  208. package/node_modules/@stdlib/string-format/package.json +72 -0
  209. package/node_modules/@stdlib/symbol-ctor/LICENSE +177 -0
  210. package/node_modules/@stdlib/symbol-ctor/NOTICE +1 -0
  211. package/node_modules/@stdlib/symbol-ctor/README.md +234 -0
  212. package/node_modules/@stdlib/symbol-ctor/SECURITY.md +5 -0
  213. package/node_modules/@stdlib/symbol-ctor/dist/index.d.ts +3 -0
  214. package/node_modules/@stdlib/symbol-ctor/dist/index.js +5 -0
  215. package/node_modules/@stdlib/symbol-ctor/dist/index.js.map +7 -0
  216. package/node_modules/@stdlib/symbol-ctor/docs/types/index.d.ts +34 -0
  217. package/node_modules/@stdlib/symbol-ctor/lib/index.js +40 -0
  218. package/node_modules/@stdlib/symbol-ctor/lib/main.js +28 -0
  219. package/node_modules/@stdlib/symbol-ctor/package.json +62 -0
  220. package/node_modules/@stdlib/types/LICENSE +177 -0
  221. package/node_modules/@stdlib/types/NOTICE +1 -0
  222. package/node_modules/@stdlib/types/README.md +212 -0
  223. package/node_modules/@stdlib/types/SECURITY.md +5 -0
  224. package/node_modules/@stdlib/types/index.d.ts +3923 -0
  225. package/node_modules/@stdlib/types/lib/browser.js +28 -0
  226. package/node_modules/@stdlib/types/lib/index.js +39 -0
  227. package/node_modules/@stdlib/types/lib/main.js +40 -0
  228. package/node_modules/@stdlib/types/package.json +67 -0
  229. package/node_modules/@stdlib/types/test.ts +734 -0
  230. package/node_modules/@stdlib/utils-define-nonenumerable-read-only-property/LICENSE +177 -0
  231. package/node_modules/@stdlib/utils-define-nonenumerable-read-only-property/NOTICE +1 -0
  232. package/node_modules/@stdlib/utils-define-nonenumerable-read-only-property/README.md +216 -0
  233. package/node_modules/@stdlib/utils-define-nonenumerable-read-only-property/SECURITY.md +5 -0
  234. package/node_modules/@stdlib/utils-define-nonenumerable-read-only-property/dist/index.d.ts +3 -0
  235. package/node_modules/@stdlib/utils-define-nonenumerable-read-only-property/dist/index.js +31 -0
  236. package/node_modules/@stdlib/utils-define-nonenumerable-read-only-property/dist/index.js.map +7 -0
  237. package/node_modules/@stdlib/utils-define-nonenumerable-read-only-property/dist/main.js +58 -0
  238. package/node_modules/@stdlib/utils-define-nonenumerable-read-only-property/docs/types/index.d.ts +52 -0
  239. package/node_modules/@stdlib/utils-define-nonenumerable-read-only-property/lib/index.js +47 -0
  240. package/node_modules/@stdlib/utils-define-nonenumerable-read-only-property/lib/main.js +58 -0
  241. package/node_modules/@stdlib/utils-define-nonenumerable-read-only-property/package.json +92 -0
  242. package/node_modules/@stdlib/utils-define-property/LICENSE +177 -0
  243. package/node_modules/@stdlib/utils-define-property/NOTICE +1 -0
  244. package/node_modules/@stdlib/utils-define-property/README.md +228 -0
  245. package/node_modules/@stdlib/utils-define-property/SECURITY.md +5 -0
  246. package/node_modules/@stdlib/utils-define-property/dist/index.d.ts +3 -0
  247. package/node_modules/@stdlib/utils-define-property/dist/index.js +36 -0
  248. package/node_modules/@stdlib/utils-define-property/dist/index.js.map +7 -0
  249. package/node_modules/@stdlib/utils-define-property/docs/types/index.d.ts +52 -0
  250. package/node_modules/@stdlib/utils-define-property/lib/builtin.js +61 -0
  251. package/node_modules/@stdlib/utils-define-property/lib/define_property.js +28 -0
  252. package/node_modules/@stdlib/utils-define-property/lib/has_define_property_support.js +51 -0
  253. package/node_modules/@stdlib/utils-define-property/lib/index.js +58 -0
  254. package/node_modules/@stdlib/utils-define-property/lib/polyfill.js +122 -0
  255. package/node_modules/@stdlib/utils-define-property/package.json +74 -0
  256. package/node_modules/@stdlib/utils-native-class/LICENSE +177 -0
  257. package/node_modules/@stdlib/utils-native-class/NOTICE +1 -0
  258. package/node_modules/@stdlib/utils-native-class/README.md +349 -0
  259. package/node_modules/@stdlib/utils-native-class/SECURITY.md +5 -0
  260. package/node_modules/@stdlib/utils-native-class/dist/index.d.ts +3 -0
  261. package/node_modules/@stdlib/utils-native-class/dist/index.js +11 -0
  262. package/node_modules/@stdlib/utils-native-class/dist/index.js.map +7 -0
  263. package/node_modules/@stdlib/utils-native-class/docs/types/index.d.ts +51 -0
  264. package/node_modules/@stdlib/utils-native-class/lib/index.js +61 -0
  265. package/node_modules/@stdlib/utils-native-class/lib/main.js +56 -0
  266. package/node_modules/@stdlib/utils-native-class/lib/polyfill.js +81 -0
  267. package/node_modules/@stdlib/utils-native-class/lib/tostring.js +28 -0
  268. package/node_modules/@stdlib/utils-native-class/lib/tostringtag.js +33 -0
  269. package/node_modules/@stdlib/utils-native-class/package.json +83 -0
  270. package/package.json +71 -3
  271. package/src/main.c +42 -0
@@ -0,0 +1,263 @@
1
+ <!--
2
+
3
+ @license Apache-2.0
4
+
5
+ Copyright (c) 2018 The Stdlib Authors.
6
+
7
+ Licensed under the Apache License, Version 2.0 (the "License");
8
+ you may not use this file except in compliance with the License.
9
+ You may obtain a copy of the License at
10
+
11
+ http://www.apache.org/licenses/LICENSE-2.0
12
+
13
+ Unless required by applicable law or agreed to in writing, software
14
+ distributed under the License is distributed on an "AS IS" BASIS,
15
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ See the License for the specific language governing permissions and
17
+ limitations under the License.
18
+
19
+ -->
20
+
21
+
22
+ <details>
23
+ <summary>
24
+ About stdlib...
25
+ </summary>
26
+ <p>We believe in a future in which the web is a preferred environment for numerical computation. To help realize this future, we've built stdlib. stdlib is a standard library, with an emphasis on numerical and scientific computation, written in JavaScript (and C) for execution in browsers and in Node.js.</p>
27
+ <p>The library is fully decomposable, being architected in such a way that you can swap out and mix and match APIs and functionality to cater to your exact preferences and use cases.</p>
28
+ <p>When you use stdlib, you can be absolutely certain that you are using the most thorough, rigorous, well-written, studied, documented, tested, measured, and high-quality code out there.</p>
29
+ <p>To join us in bringing numerical computing to the web, get started by checking us out on <a href="https://github.com/stdlib-js/stdlib">GitHub</a>, and please consider <a href="https://opencollective.com/stdlib">financially supporting stdlib</a>. We greatly appreciate your continued support!</p>
30
+ </details>
31
+
32
+ # hasOwnProp
33
+
34
+ [![NPM version][npm-image]][npm-url] [![Build Status][test-image]][test-url] [![Coverage Status][coverage-image]][coverage-url] <!-- [![dependencies][dependencies-image]][dependencies-url] -->
35
+
36
+ > Test if an object has a specified property.
37
+
38
+ <section class="installation">
39
+
40
+ ## Installation
41
+
42
+ ```bash
43
+ npm install @stdlib/assert-has-own-property
44
+ ```
45
+
46
+ </section>
47
+
48
+ <section class="usage">
49
+
50
+ ## Usage
51
+
52
+ <!-- stdlib/no-redeclare -->
53
+
54
+ ```javascript
55
+ var hasOwnProp = require( '@stdlib/assert-has-own-property' );
56
+ ```
57
+
58
+ #### hasOwnProp( value, property )
59
+
60
+ Returns a boolean indicating if a `value` has a specified `property`.
61
+
62
+ <!-- stdlib/no-redeclare -->
63
+
64
+ ```javascript
65
+ var value = {
66
+ 'beep': 'boop'
67
+ };
68
+
69
+ var bool = hasOwnProp( value, 'beep' );
70
+ // returns true
71
+
72
+ bool = hasOwnProp( value, 'bap' );
73
+ // returns false
74
+ ```
75
+
76
+ </section>
77
+
78
+ <!-- /.usage -->
79
+
80
+ <section class="notes">
81
+
82
+ ## Notes
83
+
84
+ - In contrast to the native [Object.prototype.hasOwnProperty][mdn-object-has-own-property], this function does **not** throw when provided `null` or `undefined`. Instead, the function returns `false`.
85
+
86
+ <!-- stdlib/no-redeclare -->
87
+
88
+ ```javascript
89
+ var bool = hasOwnProp( null, 'a' );
90
+ // returns false
91
+
92
+ bool = hasOwnProp( void 0, 'a' );
93
+ // returns false
94
+ ```
95
+
96
+ - Value arguments other than `null` or `undefined` are coerced to objects.
97
+
98
+ <!-- stdlib/no-redeclare -->
99
+
100
+ ```javascript
101
+ var bool = hasOwnProp( 'beep', 'length' );
102
+ // returns true
103
+ ```
104
+
105
+ - Property arguments are coerced to strings.
106
+
107
+ <!-- stdlib/no-redeclare -->
108
+
109
+ ```javascript
110
+ var value = {
111
+ 'null': false
112
+ };
113
+ var bool = hasOwnProp( value, null );
114
+ // returns true
115
+
116
+ value = {
117
+ '[object Object]': false
118
+ };
119
+ bool = hasOwnProp( value, {} );
120
+ // returns true
121
+ ```
122
+
123
+ </section>
124
+
125
+ <!-- /.notes -->
126
+
127
+ <section class="examples">
128
+
129
+ ## Examples
130
+
131
+ <!-- eslint-disable object-curly-newline, stdlib/no-redeclare, stdlib/eol-open-bracket-spacing -->
132
+
133
+ <!-- eslint no-undef: "error" -->
134
+
135
+ ```javascript
136
+ var hasOwnProp = require( '@stdlib/assert-has-own-property' );
137
+
138
+ var bool = hasOwnProp( { 'a': 'b' }, 'a' );
139
+ // returns true
140
+
141
+ bool = hasOwnProp( { 'a': 'b' }, 'c' );
142
+ // returns false
143
+
144
+ bool = hasOwnProp( { 'a': 'b' }, null );
145
+ // returns false
146
+
147
+ bool = hasOwnProp( {}, 'hasOwnProp' );
148
+ // returns false
149
+
150
+ bool = hasOwnProp( null, 'a' );
151
+ // returns false
152
+
153
+ bool = hasOwnProp( void 0, 'a' );
154
+ // returns false
155
+
156
+ bool = hasOwnProp( { 'null': false }, null );
157
+ // returns true
158
+
159
+ bool = hasOwnProp( { '[object Object]': false }, {} );
160
+ // returns true
161
+ ```
162
+
163
+ </section>
164
+
165
+ <!-- /.examples -->
166
+
167
+ <!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
168
+
169
+ <section class="related">
170
+
171
+ * * *
172
+
173
+ ## See Also
174
+
175
+ - <span class="package-name">[`@stdlib/assert-has-property`][@stdlib/assert/has-property]</span><span class="delimiter">: </span><span class="description">test if an object has a specified property, either own or inherited.</span>
176
+
177
+ </section>
178
+
179
+ <!-- /.related -->
180
+
181
+ <!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
182
+
183
+
184
+ <section class="main-repo" >
185
+
186
+ * * *
187
+
188
+ ## Notice
189
+
190
+ This package is part of [stdlib][stdlib], a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more.
191
+
192
+ For more information on the project, filing bug reports and feature requests, and guidance on how to develop [stdlib][stdlib], see the main project [repository][stdlib].
193
+
194
+ #### Community
195
+
196
+ [![Chat][chat-image]][chat-url]
197
+
198
+ ---
199
+
200
+ ## License
201
+
202
+ See [LICENSE][stdlib-license].
203
+
204
+
205
+ ## Copyright
206
+
207
+ Copyright &copy; 2016-2026. The Stdlib [Authors][stdlib-authors].
208
+
209
+ </section>
210
+
211
+ <!-- /.stdlib -->
212
+
213
+ <!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
214
+
215
+ <section class="links">
216
+
217
+ [npm-image]: http://img.shields.io/npm/v/@stdlib/assert-has-own-property.svg
218
+ [npm-url]: https://npmjs.org/package/@stdlib/assert-has-own-property
219
+
220
+ [test-image]: https://github.com/stdlib-js/assert-has-own-property/actions/workflows/test.yml/badge.svg?branch=v0.2.3
221
+ [test-url]: https://github.com/stdlib-js/assert-has-own-property/actions/workflows/test.yml?query=branch:v0.2.3
222
+
223
+ [coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/assert-has-own-property/main.svg
224
+ [coverage-url]: https://codecov.io/github/stdlib-js/assert-has-own-property?branch=main
225
+
226
+ <!--
227
+
228
+ [dependencies-image]: https://img.shields.io/david/stdlib-js/assert-has-own-property.svg
229
+ [dependencies-url]: https://david-dm.org/stdlib-js/assert-has-own-property/main
230
+
231
+ -->
232
+
233
+ [chat-image]: https://img.shields.io/badge/zulip-join_chat-brightgreen.svg
234
+ [chat-url]: https://stdlib.zulipchat.com
235
+
236
+ [stdlib]: https://github.com/stdlib-js/stdlib
237
+
238
+ [stdlib-authors]: https://github.com/stdlib-js/stdlib/graphs/contributors
239
+
240
+ [umd]: https://github.com/umdjs/umd
241
+ [es-module]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules
242
+
243
+ [deno-url]: https://github.com/stdlib-js/assert-has-own-property/tree/deno
244
+ [deno-readme]: https://github.com/stdlib-js/assert-has-own-property/blob/deno/README.md
245
+ [umd-url]: https://github.com/stdlib-js/assert-has-own-property/tree/umd
246
+ [umd-readme]: https://github.com/stdlib-js/assert-has-own-property/blob/umd/README.md
247
+ [esm-url]: https://github.com/stdlib-js/assert-has-own-property/tree/esm
248
+ [esm-readme]: https://github.com/stdlib-js/assert-has-own-property/blob/esm/README.md
249
+ [branches-url]: https://github.com/stdlib-js/assert-has-own-property/blob/main/branches.md
250
+
251
+ [stdlib-license]: https://raw.githubusercontent.com/stdlib-js/assert-has-own-property/main/LICENSE
252
+
253
+ [mdn-object-has-own-property]: https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty
254
+
255
+ <!-- <related-links> -->
256
+
257
+ [@stdlib/assert/has-property]: https://www.npmjs.com/package/@stdlib/assert-has-property
258
+
259
+ <!-- </related-links> -->
260
+
261
+ </section>
262
+
263
+ <!-- /.links -->
@@ -0,0 +1,5 @@
1
+ # Security
2
+
3
+ > Policy for reporting security vulnerabilities.
4
+
5
+ See the security policy [in the main project repository](https://github.com/stdlib-js/stdlib/security).
@@ -0,0 +1,3 @@
1
+ /// <reference path="../docs/types/index.d.ts" />
2
+ import hasOwnProp from '../docs/types/index';
3
+ export = hasOwnProp;
@@ -0,0 +1,5 @@
1
+ "use strict";var n=function(t,r){return function(){return r||t((r={exports:{}}).exports,r),r.exports}};var s=n(function(c,e){
2
+ var o=Object.prototype.hasOwnProperty;function i(t,r){return t==null?!1:o.call(t,r)}e.exports=i
3
+ });var a=s();module.exports=a;
4
+ /** @license Apache-2.0 */
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../lib/main.js", "../lib/index.js"],
4
+ "sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// FUNCTIONS //\n\nvar has = Object.prototype.hasOwnProperty;\n\n\n// MAIN //\n\n/**\n* Tests if an object has a specified property.\n*\n* @param {*} value - value to test\n* @param {*} property - property to test\n* @returns {boolean} boolean indicating if an object has a specified property\n*\n* @example\n* var beep = {\n* 'boop': true\n* };\n*\n* var bool = hasOwnProp( beep, 'boop' );\n* // returns true\n*\n* @example\n* var beep = {\n* 'boop': true\n* };\n*\n* var bool = hasOwnProp( beep, 'bap' );\n* // returns false\n*/\nfunction hasOwnProp( value, property ) {\n\tif (\n\t\tvalue === void 0 ||\n\t\tvalue === null\n\t) {\n\t\treturn false;\n\t}\n\treturn has.call( value, property );\n}\n\n\n// EXPORTS //\n\nmodule.exports = hasOwnProp;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test whether an object has a specified property.\n*\n* @module @stdlib/assert-has-own-property\n*\n* @example\n* var hasOwnProp = require( '@stdlib/assert-has-own-property' );\n*\n* var beep = {\n* 'boop': true\n* };\n*\n* var bool = hasOwnProp( beep, 'boop' );\n* // returns true\n*\n* bool = hasOwnProp( beep, 'bop' );\n* // returns false\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"],
5
+ "mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAM,OAAO,UAAU,eA4B3B,SAASC,EAAYC,EAAOC,EAAW,CACtC,OAECD,GAAU,KAEH,GAEDF,EAAI,KAAME,EAAOC,CAAS,CAClC,CAKAJ,EAAO,QAAUE,ICtBjB,IAAIG,EAAO,IAKX,OAAO,QAAUA",
6
+ "names": ["require_main", "__commonJSMin", "exports", "module", "has", "hasOwnProp", "value", "property", "main"]
7
+ }
@@ -0,0 +1,49 @@
1
+ /*
2
+ * @license Apache-2.0
3
+ *
4
+ * Copyright (c) 2019 The Stdlib Authors.
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this file except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ */
18
+
19
+ // TypeScript Version: 4.1
20
+
21
+ /**
22
+ * Tests if an object has a specified property.
23
+ *
24
+ * @param value - value to test
25
+ * @param property - property to test
26
+ * @returns boolean indicating if an object has a specified property
27
+ *
28
+ * @example
29
+ * var beep = {
30
+ * 'boop': true
31
+ * };
32
+ *
33
+ * var bool = hasOwnProp( beep, 'boop' );
34
+ * // returns true
35
+ *
36
+ * @example
37
+ * var beep = {
38
+ * 'boop': true
39
+ * };
40
+ *
41
+ * var bool = hasOwnProp( beep, 'bap' );
42
+ * // returns false
43
+ */
44
+ declare function hasOwnProp( value: any, property: any ): boolean;
45
+
46
+
47
+ // EXPORTS //
48
+
49
+ export = hasOwnProp;
@@ -0,0 +1,47 @@
1
+ /**
2
+ * @license Apache-2.0
3
+ *
4
+ * Copyright (c) 2018 The Stdlib Authors.
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this file except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ */
18
+
19
+ 'use strict';
20
+
21
+ /**
22
+ * Test whether an object has a specified property.
23
+ *
24
+ * @module @stdlib/assert-has-own-property
25
+ *
26
+ * @example
27
+ * var hasOwnProp = require( '@stdlib/assert-has-own-property' );
28
+ *
29
+ * var beep = {
30
+ * 'boop': true
31
+ * };
32
+ *
33
+ * var bool = hasOwnProp( beep, 'boop' );
34
+ * // returns true
35
+ *
36
+ * bool = hasOwnProp( beep, 'bop' );
37
+ * // returns false
38
+ */
39
+
40
+ // MODULES //
41
+
42
+ var main = require( './main.js' );
43
+
44
+
45
+ // EXPORTS //
46
+
47
+ module.exports = main;
@@ -0,0 +1,64 @@
1
+ /**
2
+ * @license Apache-2.0
3
+ *
4
+ * Copyright (c) 2018 The Stdlib Authors.
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this file except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ */
18
+
19
+ 'use strict';
20
+
21
+ // FUNCTIONS //
22
+
23
+ var has = Object.prototype.hasOwnProperty;
24
+
25
+
26
+ // MAIN //
27
+
28
+ /**
29
+ * Tests if an object has a specified property.
30
+ *
31
+ * @param {*} value - value to test
32
+ * @param {*} property - property to test
33
+ * @returns {boolean} boolean indicating if an object has a specified property
34
+ *
35
+ * @example
36
+ * var beep = {
37
+ * 'boop': true
38
+ * };
39
+ *
40
+ * var bool = hasOwnProp( beep, 'boop' );
41
+ * // returns true
42
+ *
43
+ * @example
44
+ * var beep = {
45
+ * 'boop': true
46
+ * };
47
+ *
48
+ * var bool = hasOwnProp( beep, 'bap' );
49
+ * // returns false
50
+ */
51
+ function hasOwnProp( value, property ) {
52
+ if (
53
+ value === void 0 ||
54
+ value === null
55
+ ) {
56
+ return false;
57
+ }
58
+ return has.call( value, property );
59
+ }
60
+
61
+
62
+ // EXPORTS //
63
+
64
+ module.exports = hasOwnProp;
@@ -0,0 +1,73 @@
1
+ {
2
+ "name": "@stdlib/assert-has-own-property",
3
+ "version": "0.2.3",
4
+ "description": "Test if an object has a specified property.",
5
+ "license": "Apache-2.0",
6
+ "author": {
7
+ "name": "The Stdlib Authors",
8
+ "url": "https://github.com/stdlib-js/stdlib/graphs/contributors"
9
+ },
10
+ "contributors": [
11
+ {
12
+ "name": "The Stdlib Authors",
13
+ "url": "https://github.com/stdlib-js/stdlib/graphs/contributors"
14
+ }
15
+ ],
16
+ "main": "./lib",
17
+ "directories": {
18
+ "doc": "./docs",
19
+ "lib": "./lib",
20
+ "dist": "./dist"
21
+ },
22
+ "types": "./docs/types",
23
+ "scripts": {},
24
+ "homepage": "https://stdlib.io",
25
+ "repository": {
26
+ "type": "git",
27
+ "url": "git://github.com/stdlib-js/assert-has-own-property.git"
28
+ },
29
+ "bugs": {
30
+ "url": "https://github.com/stdlib-js/stdlib/issues"
31
+ },
32
+ "dependencies": {},
33
+ "devDependencies": {},
34
+ "engines": {
35
+ "node": ">=0.10.0",
36
+ "npm": ">2.7.0"
37
+ },
38
+ "os": [
39
+ "aix",
40
+ "darwin",
41
+ "freebsd",
42
+ "linux",
43
+ "macos",
44
+ "openbsd",
45
+ "sunos",
46
+ "win32",
47
+ "windows"
48
+ ],
49
+ "keywords": [
50
+ "stdlib",
51
+ "stdassert",
52
+ "assertion",
53
+ "assert",
54
+ "utilities",
55
+ "utility",
56
+ "utils",
57
+ "util",
58
+ "object",
59
+ "obj",
60
+ "has",
61
+ "hasown",
62
+ "hasownproperty",
63
+ "property",
64
+ "prop",
65
+ "test",
66
+ "check",
67
+ "validate"
68
+ ],
69
+ "funding": {
70
+ "type": "opencollective",
71
+ "url": "https://opencollective.com/stdlib"
72
+ }
73
+ }