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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (276) 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/include/stdlib/complex/float32.h +148 -0
  105. package/node_modules/@stdlib/complex-float32/lib/index.js +40 -0
  106. package/node_modules/@stdlib/complex-float32/lib/main.js +159 -0
  107. package/node_modules/@stdlib/complex-float32/lib/tojson.js +39 -0
  108. package/node_modules/@stdlib/complex-float32/lib/tostring.js +42 -0
  109. package/node_modules/@stdlib/complex-float32/manifest.json +38 -0
  110. package/node_modules/@stdlib/complex-float32/package.json +76 -0
  111. package/node_modules/@stdlib/complex-float32/src/main.c +151 -0
  112. package/node_modules/@stdlib/complex-float64/LICENSE +177 -0
  113. package/node_modules/@stdlib/complex-float64/NOTICE +1 -0
  114. package/node_modules/@stdlib/complex-float64/README.md +699 -0
  115. package/node_modules/@stdlib/complex-float64/SECURITY.md +5 -0
  116. package/node_modules/@stdlib/complex-float64/dist/index.d.ts +3 -0
  117. package/node_modules/@stdlib/complex-float64/dist/index.js +9 -0
  118. package/node_modules/@stdlib/complex-float64/dist/index.js.map +7 -0
  119. package/node_modules/@stdlib/complex-float64/docs/types/index.d.ts +111 -0
  120. package/node_modules/@stdlib/complex-float64/include/stdlib/complex/float64.h +169 -0
  121. package/node_modules/@stdlib/complex-float64/lib/index.js +40 -0
  122. package/node_modules/@stdlib/complex-float64/lib/main.js +158 -0
  123. package/node_modules/@stdlib/complex-float64/lib/tojson.js +39 -0
  124. package/node_modules/@stdlib/complex-float64/lib/tostring.js +42 -0
  125. package/node_modules/@stdlib/complex-float64/manifest.json +40 -0
  126. package/node_modules/@stdlib/complex-float64/package.json +75 -0
  127. package/node_modules/@stdlib/complex-float64/src/main.c +224 -0
  128. package/node_modules/@stdlib/constants-float64-pinf/LICENSE +177 -0
  129. package/node_modules/@stdlib/constants-float64-pinf/NOTICE +1 -0
  130. package/node_modules/@stdlib/constants-float64-pinf/README.md +238 -0
  131. package/node_modules/@stdlib/constants-float64-pinf/SECURITY.md +5 -0
  132. package/node_modules/@stdlib/constants-float64-pinf/dist/index.d.ts +3 -0
  133. package/node_modules/@stdlib/constants-float64-pinf/dist/index.js +3 -0
  134. package/node_modules/@stdlib/constants-float64-pinf/dist/index.js.map +7 -0
  135. package/node_modules/@stdlib/constants-float64-pinf/docs/types/index.d.ts +33 -0
  136. package/node_modules/@stdlib/constants-float64-pinf/include/stdlib/constants/float64/pinf.h +29 -0
  137. package/node_modules/@stdlib/constants-float64-pinf/lib/index.js +56 -0
  138. package/node_modules/@stdlib/constants-float64-pinf/manifest.json +36 -0
  139. package/node_modules/@stdlib/constants-float64-pinf/package.json +71 -0
  140. package/node_modules/@stdlib/error-tools-fmtprodmsg/LICENSE +177 -0
  141. package/node_modules/@stdlib/error-tools-fmtprodmsg/NOTICE +1 -0
  142. package/node_modules/@stdlib/error-tools-fmtprodmsg/README.md +182 -0
  143. package/node_modules/@stdlib/error-tools-fmtprodmsg/SECURITY.md +5 -0
  144. package/node_modules/@stdlib/error-tools-fmtprodmsg/dist/index.d.ts +3 -0
  145. package/node_modules/@stdlib/error-tools-fmtprodmsg/dist/index.js +5 -0
  146. package/node_modules/@stdlib/error-tools-fmtprodmsg/dist/index.js.map +7 -0
  147. package/node_modules/@stdlib/error-tools-fmtprodmsg/docs/types/index.d.ts +39 -0
  148. package/node_modules/@stdlib/error-tools-fmtprodmsg/lib/index.js +40 -0
  149. package/node_modules/@stdlib/error-tools-fmtprodmsg/lib/main.js +48 -0
  150. package/node_modules/@stdlib/error-tools-fmtprodmsg/package.json +70 -0
  151. package/node_modules/@stdlib/number-ctor/LICENSE +177 -0
  152. package/node_modules/@stdlib/number-ctor/NOTICE +1 -0
  153. package/node_modules/@stdlib/number-ctor/README.md +212 -0
  154. package/node_modules/@stdlib/number-ctor/SECURITY.md +5 -0
  155. package/node_modules/@stdlib/number-ctor/dist/index.d.ts +3 -0
  156. package/node_modules/@stdlib/number-ctor/dist/index.js +5 -0
  157. package/node_modules/@stdlib/number-ctor/dist/index.js.map +7 -0
  158. package/node_modules/@stdlib/number-ctor/docs/types/index.d.ts +30 -0
  159. package/node_modules/@stdlib/number-ctor/lib/index.js +40 -0
  160. package/node_modules/@stdlib/number-ctor/lib/main.js +23 -0
  161. package/node_modules/@stdlib/number-ctor/package.json +62 -0
  162. package/node_modules/@stdlib/number-float64-base-to-float32/LICENSE +177 -0
  163. package/node_modules/@stdlib/number-float64-base-to-float32/NOTICE +1 -0
  164. package/node_modules/@stdlib/number-float64-base-to-float32/README.md +191 -0
  165. package/node_modules/@stdlib/number-float64-base-to-float32/SECURITY.md +5 -0
  166. package/node_modules/@stdlib/number-float64-base-to-float32/dist/index.d.ts +3 -0
  167. package/node_modules/@stdlib/number-float64-base-to-float32/dist/index.js +19 -0
  168. package/node_modules/@stdlib/number-float64-base-to-float32/dist/index.js.map +7 -0
  169. package/node_modules/@stdlib/number-float64-base-to-float32/docs/types/index.d.ts +36 -0
  170. package/node_modules/@stdlib/number-float64-base-to-float32/lib/index.js +51 -0
  171. package/node_modules/@stdlib/number-float64-base-to-float32/lib/main.js +28 -0
  172. package/node_modules/@stdlib/number-float64-base-to-float32/lib/polyfill.js +51 -0
  173. package/node_modules/@stdlib/number-float64-base-to-float32/package.json +76 -0
  174. package/node_modules/@stdlib/string-base-format-interpolate/LICENSE +177 -0
  175. package/node_modules/@stdlib/string-base-format-interpolate/NOTICE +1 -0
  176. package/node_modules/@stdlib/string-base-format-interpolate/README.md +219 -0
  177. package/node_modules/@stdlib/string-base-format-interpolate/SECURITY.md +5 -0
  178. package/node_modules/@stdlib/string-base-format-interpolate/dist/index.d.ts +3 -0
  179. package/node_modules/@stdlib/string-base-format-interpolate/dist/index.js +17 -0
  180. package/node_modules/@stdlib/string-base-format-interpolate/dist/index.js.map +7 -0
  181. package/node_modules/@stdlib/string-base-format-interpolate/docs/types/index.d.ts +71 -0
  182. package/node_modules/@stdlib/string-base-format-interpolate/lib/format_double.js +103 -0
  183. package/node_modules/@stdlib/string-base-format-interpolate/lib/format_integer.js +115 -0
  184. package/node_modules/@stdlib/string-base-format-interpolate/lib/index.js +41 -0
  185. package/node_modules/@stdlib/string-base-format-interpolate/lib/is_number.js +46 -0
  186. package/node_modules/@stdlib/string-base-format-interpolate/lib/is_string.js +42 -0
  187. package/node_modules/@stdlib/string-base-format-interpolate/lib/main.js +243 -0
  188. package/node_modules/@stdlib/string-base-format-interpolate/lib/space_pad.js +65 -0
  189. package/node_modules/@stdlib/string-base-format-interpolate/lib/zero_pad.js +84 -0
  190. package/node_modules/@stdlib/string-base-format-interpolate/package.json +71 -0
  191. package/node_modules/@stdlib/string-base-format-tokenize/LICENSE +177 -0
  192. package/node_modules/@stdlib/string-base-format-tokenize/NOTICE +1 -0
  193. package/node_modules/@stdlib/string-base-format-tokenize/README.md +203 -0
  194. package/node_modules/@stdlib/string-base-format-tokenize/SECURITY.md +5 -0
  195. package/node_modules/@stdlib/string-base-format-tokenize/dist/index.d.ts +3 -0
  196. package/node_modules/@stdlib/string-base-format-tokenize/dist/index.js +5 -0
  197. package/node_modules/@stdlib/string-base-format-tokenize/dist/index.js.map +7 -0
  198. package/node_modules/@stdlib/string-base-format-tokenize/docs/types/index.d.ts +68 -0
  199. package/node_modules/@stdlib/string-base-format-tokenize/lib/index.js +41 -0
  200. package/node_modules/@stdlib/string-base-format-tokenize/lib/main.js +95 -0
  201. package/node_modules/@stdlib/string-base-format-tokenize/package.json +69 -0
  202. package/node_modules/@stdlib/string-format/LICENSE +177 -0
  203. package/node_modules/@stdlib/string-format/NOTICE +1 -0
  204. package/node_modules/@stdlib/string-format/README.md +341 -0
  205. package/node_modules/@stdlib/string-format/SECURITY.md +5 -0
  206. package/node_modules/@stdlib/string-format/dist/index.d.ts +3 -0
  207. package/node_modules/@stdlib/string-format/dist/index.js +7 -0
  208. package/node_modules/@stdlib/string-format/dist/index.js.map +7 -0
  209. package/node_modules/@stdlib/string-format/docs/types/index.d.ts +42 -0
  210. package/node_modules/@stdlib/string-format/lib/index.js +43 -0
  211. package/node_modules/@stdlib/string-format/lib/is_string.js +42 -0
  212. package/node_modules/@stdlib/string-format/lib/main.js +64 -0
  213. package/node_modules/@stdlib/string-format/package.json +72 -0
  214. package/node_modules/@stdlib/symbol-ctor/LICENSE +177 -0
  215. package/node_modules/@stdlib/symbol-ctor/NOTICE +1 -0
  216. package/node_modules/@stdlib/symbol-ctor/README.md +234 -0
  217. package/node_modules/@stdlib/symbol-ctor/SECURITY.md +5 -0
  218. package/node_modules/@stdlib/symbol-ctor/dist/index.d.ts +3 -0
  219. package/node_modules/@stdlib/symbol-ctor/dist/index.js +5 -0
  220. package/node_modules/@stdlib/symbol-ctor/dist/index.js.map +7 -0
  221. package/node_modules/@stdlib/symbol-ctor/docs/types/index.d.ts +34 -0
  222. package/node_modules/@stdlib/symbol-ctor/lib/index.js +40 -0
  223. package/node_modules/@stdlib/symbol-ctor/lib/main.js +28 -0
  224. package/node_modules/@stdlib/symbol-ctor/package.json +62 -0
  225. package/node_modules/@stdlib/types/LICENSE +177 -0
  226. package/node_modules/@stdlib/types/NOTICE +1 -0
  227. package/node_modules/@stdlib/types/README.md +212 -0
  228. package/node_modules/@stdlib/types/SECURITY.md +5 -0
  229. package/node_modules/@stdlib/types/index.d.ts +3923 -0
  230. package/node_modules/@stdlib/types/lib/browser.js +28 -0
  231. package/node_modules/@stdlib/types/lib/index.js +39 -0
  232. package/node_modules/@stdlib/types/lib/main.js +40 -0
  233. package/node_modules/@stdlib/types/package.json +67 -0
  234. package/node_modules/@stdlib/types/test.ts +734 -0
  235. package/node_modules/@stdlib/utils-define-nonenumerable-read-only-property/LICENSE +177 -0
  236. package/node_modules/@stdlib/utils-define-nonenumerable-read-only-property/NOTICE +1 -0
  237. package/node_modules/@stdlib/utils-define-nonenumerable-read-only-property/README.md +216 -0
  238. package/node_modules/@stdlib/utils-define-nonenumerable-read-only-property/SECURITY.md +5 -0
  239. package/node_modules/@stdlib/utils-define-nonenumerable-read-only-property/dist/index.d.ts +3 -0
  240. package/node_modules/@stdlib/utils-define-nonenumerable-read-only-property/dist/index.js +31 -0
  241. package/node_modules/@stdlib/utils-define-nonenumerable-read-only-property/dist/index.js.map +7 -0
  242. package/node_modules/@stdlib/utils-define-nonenumerable-read-only-property/dist/main.js +58 -0
  243. package/node_modules/@stdlib/utils-define-nonenumerable-read-only-property/docs/types/index.d.ts +52 -0
  244. package/node_modules/@stdlib/utils-define-nonenumerable-read-only-property/lib/index.js +47 -0
  245. package/node_modules/@stdlib/utils-define-nonenumerable-read-only-property/lib/main.js +58 -0
  246. package/node_modules/@stdlib/utils-define-nonenumerable-read-only-property/package.json +92 -0
  247. package/node_modules/@stdlib/utils-define-property/LICENSE +177 -0
  248. package/node_modules/@stdlib/utils-define-property/NOTICE +1 -0
  249. package/node_modules/@stdlib/utils-define-property/README.md +228 -0
  250. package/node_modules/@stdlib/utils-define-property/SECURITY.md +5 -0
  251. package/node_modules/@stdlib/utils-define-property/dist/index.d.ts +3 -0
  252. package/node_modules/@stdlib/utils-define-property/dist/index.js +36 -0
  253. package/node_modules/@stdlib/utils-define-property/dist/index.js.map +7 -0
  254. package/node_modules/@stdlib/utils-define-property/docs/types/index.d.ts +52 -0
  255. package/node_modules/@stdlib/utils-define-property/lib/builtin.js +61 -0
  256. package/node_modules/@stdlib/utils-define-property/lib/define_property.js +28 -0
  257. package/node_modules/@stdlib/utils-define-property/lib/has_define_property_support.js +51 -0
  258. package/node_modules/@stdlib/utils-define-property/lib/index.js +58 -0
  259. package/node_modules/@stdlib/utils-define-property/lib/polyfill.js +122 -0
  260. package/node_modules/@stdlib/utils-define-property/package.json +74 -0
  261. package/node_modules/@stdlib/utils-native-class/LICENSE +177 -0
  262. package/node_modules/@stdlib/utils-native-class/NOTICE +1 -0
  263. package/node_modules/@stdlib/utils-native-class/README.md +349 -0
  264. package/node_modules/@stdlib/utils-native-class/SECURITY.md +5 -0
  265. package/node_modules/@stdlib/utils-native-class/dist/index.d.ts +3 -0
  266. package/node_modules/@stdlib/utils-native-class/dist/index.js +11 -0
  267. package/node_modules/@stdlib/utils-native-class/dist/index.js.map +7 -0
  268. package/node_modules/@stdlib/utils-native-class/docs/types/index.d.ts +51 -0
  269. package/node_modules/@stdlib/utils-native-class/lib/index.js +61 -0
  270. package/node_modules/@stdlib/utils-native-class/lib/main.js +56 -0
  271. package/node_modules/@stdlib/utils-native-class/lib/polyfill.js +81 -0
  272. package/node_modules/@stdlib/utils-native-class/lib/tostring.js +28 -0
  273. package/node_modules/@stdlib/utils-native-class/lib/tostringtag.js +33 -0
  274. package/node_modules/@stdlib/utils-native-class/package.json +83 -0
  275. package/package.json +72 -4
  276. package/src/main.c +42 -0
@@ -0,0 +1,69 @@
1
+ {
2
+ "name": "@stdlib/string-base-format-tokenize",
3
+ "version": "0.2.4",
4
+ "description": "Tokenize a string into an array of string parts and format identifier objects.",
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/string-base-format-tokenize.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
+ "stdstring",
52
+ "utilities",
53
+ "utility",
54
+ "utils",
55
+ "util",
56
+ "string",
57
+ "str",
58
+ "format",
59
+ "formatting",
60
+ "fmt",
61
+ "tokens",
62
+ "tokenize",
63
+ "token"
64
+ ],
65
+ "funding": {
66
+ "type": "opencollective",
67
+ "url": "https://opencollective.com/stdlib"
68
+ }
69
+ }
@@ -0,0 +1,177 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
@@ -0,0 +1 @@
1
+ Copyright (c) 2016-2026 The Stdlib Authors.
@@ -0,0 +1,341 @@
1
+ <!--
2
+
3
+ @license Apache-2.0
4
+
5
+ Copyright (c) 2022 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
+ # format
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
+ > Insert supplied variable values into a format string.
37
+
38
+ <section class="intro">
39
+
40
+ </section>
41
+
42
+ <!-- /.intro -->
43
+
44
+ <section class="installation">
45
+
46
+ ## Installation
47
+
48
+ ```bash
49
+ npm install @stdlib/string-format
50
+ ```
51
+
52
+ </section>
53
+
54
+ <section class="usage">
55
+
56
+ ## Usage
57
+
58
+ ```javascript
59
+ var format = require( '@stdlib/string-format' );
60
+ ```
61
+
62
+ #### format( str, ...args )
63
+
64
+ Inserts supplied variable values into a format string.
65
+
66
+ ```javascript
67
+ var str = 'Hello, %s! My name is %s.';
68
+ var out = format( str, 'world', 'Bob' );
69
+ // returns 'Hello, world! My name is Bob.'
70
+ ```
71
+
72
+ The format string is a string literal containing zero or more conversion specifications, each of which results in a string value being inserted to the output string. A conversion specification consists of a percent sign (`%`) followed by one or more of the following flags, width, precision, and conversion type characters. It thus takes the following form:
73
+
74
+ ```text
75
+ %[flags][width][.precision]specifier
76
+ ```
77
+
78
+ Arguments following the format string are used to replace the placeholders in the format string. The number of arguments following the format string should be equal to the number of placeholders in the format string.
79
+
80
+ ```javascript
81
+ var str = '%s %s';
82
+ var out = format( str, 'Hello', 'World' );
83
+ // returns 'Hello World'
84
+ ```
85
+
86
+ To supply arguments in a different order than they appear in the format string, positional placeholders as indicated by a `$` character in the format string are used. In this case, the conversion specification takes the form:
87
+
88
+ ```text
89
+ %[pos$][flags][width][.precision]specifier
90
+ ```
91
+
92
+ ```javascript
93
+ var str = '%3$s %2$s %1$s';
94
+ var out = format( str, 'foo', 'bar', 'baz' );
95
+ // returns 'baz bar foo'
96
+ ```
97
+
98
+ The following table summarizes the supported specifiers:
99
+
100
+ | type | description | example |
101
+ | ---- | --------------------------------- | --------- |
102
+ | s | string | beep boop |
103
+ | c | character | a |
104
+ | d, i | signed decimal integer | -12 |
105
+ | u | unsigned decimal integer | 390 |
106
+ | b | unsigned binary integer | 11011011 |
107
+ | o | unsigned octal integer | 510 |
108
+ | x | unsigned hexadecimal (lowercase) | 7b |
109
+ | X | unsigned hexadecimal (uppercase) | 7B |
110
+ | f, F | decimal floating point | 390.24 |
111
+ | e | scientific notation (lowercase) | 3.9e+1 |
112
+ | E | scientific notation (uppercase) | 3.9E+1 |
113
+ | g | shortest representation (`e`/`f`) | 3.9 |
114
+ | G | shortest representation (`E`/`F`) | 3.9 |
115
+
116
+ ```javascript
117
+ var str = '%i written as a binary number is %b.';
118
+ var out = format( str, 9, 9 );
119
+ // returns '9 written as a binary number is 1001.'
120
+
121
+ str = '%i written as an octal number is %o.';
122
+ out = format( str, 17, 17 );
123
+ // returns '17 written as an octal number is 21.'
124
+
125
+ str = '%i written as a hexadecimal number is %x.';
126
+ out = format( str, 255, 255 );
127
+ // returns '255 written as a hexadecimal number is ff.'
128
+
129
+ str = '%i written as a hexadecimal number is %X (uppercase letters).';
130
+ out = format( str, 255, 255 );
131
+ // returns '255 written as a hexadecimal number is FF (uppercase letters).'
132
+
133
+ str = '%i written as a floating point number with default precision is %f!';
134
+ out = format( str, 8, 8 );
135
+ // returns '8 written as a floating point number with default precision is 8.000000!'
136
+
137
+ str = 'Scientific notation: %e';
138
+ out = format( str, 3.14159 );
139
+ // returns 'Scientific notation: 3.141590e+00'
140
+
141
+ str = 'Scientific notation: %E (uppercase).';
142
+ out = format( str, 3.14159 );
143
+ // returns 'Scientific notation: 3.141590E+00 (uppercase).'
144
+
145
+ str = '%g (shortest representation)';
146
+ out = format( str, 3.14159 );
147
+ // returns '3.14159'
148
+ ```
149
+
150
+ A conversion specification may contain zero or more flags, which modify the behavior of the conversion. The following flags are supported:
151
+
152
+ | flag | description |
153
+ | ----- | ------------------------------------------------------------------------------------------ |
154
+ | - | left-justify the output within the given field width by padding with spaces on the right |
155
+ | 0 | left-pad the output with zeros instead of spaces when padding is required |
156
+ | # | use an alternative format for `o` and `x` conversions |
157
+ | + | prefix the output with a plus (+) or minus (-) sign even if the value is a positive number |
158
+ | space | prefix the value with a space character if no sign is written |
159
+
160
+ ```javascript
161
+ var str = 'Always prefix with a sign: %+i';
162
+ var out = format( str, 9 );
163
+ // returns 'Always prefix with a sign: +9'
164
+
165
+ out = format( str, -9 );
166
+ // returns 'Always prefix with a sign: -9'
167
+
168
+ str = 'Only prefix with a sign if negative: %i';
169
+ out = format( str, 6 );
170
+ // returns 'Only prefix with a sign if negative: 6'
171
+
172
+ out = format( str, -6 );
173
+ // returns 'Only prefix with a sign if negative: -6'
174
+
175
+ str = 'Prefix with a sign if negative and a space if positive: % i';
176
+ out = format( str, 3 );
177
+ // returns 'Prefix with a sign if negative and a space if positive: 3'
178
+
179
+ out = format( str, -3 );
180
+ // returns 'Prefix with a sign if negative and a space if positive: -3'
181
+ ```
182
+
183
+ The `width` may be specified as a decimal integer representing the minimum number of characters to be written to the output. If the value to be written is shorter than this number, the result is padded with spaces on the left. The value is not truncated even if the result is larger. Alternatively, the `width` may be specified as an asterisk character (`*`), in which case the argument preceding the conversion specification is used as the minimum field width.
184
+
185
+ ```javascript
186
+ var str = '%5s';
187
+ var out = format( str, 'baz' );
188
+ // returns ' baz'
189
+
190
+ str = '%-5s';
191
+ out = format( str, 'baz' );
192
+ // returns 'baz '
193
+
194
+ str = '%05i';
195
+ out = format( str, 2 );
196
+ // returns '00002'
197
+
198
+ str = '%*i';
199
+ out = format( str, 5, 2 );
200
+ // returns ' 2'
201
+ ```
202
+
203
+ The `precision` may be specified as a decimal integer or as an asterisk character (`*`), in which case the argument preceding the conversion specification is used as the precision value. The behavior of the `precision` differs depending on the conversion type:
204
+
205
+ - For `s` specifiers, the `precision` specifies the maximum number of characters to be written to the output.
206
+ - For floating point specifiers (`f`, `F`, `e`, `E`), the `precision` specifies the number of digits after the decimal point to be written to the output (by default, this is `6`).
207
+ - For `g` and `G` specifiers, the `precision` specifies the maximum number of significant digits to be written to the output.
208
+ - For integer specifiers (`d`, `i`, `u`, `b`, `o`, `x`, `X`), the `precision` specifies the minimum number of digits to be written to the output. If the value to be written is shorter than this number, the result is padded with zeros on the left. The value is not truncated even if the result is longer.
209
+
210
+ Alternatively, the `precision` may be specified as an asterisk character (`*`), in which case the argument preceding the conversion specification is used as the minimum number of digits.
211
+
212
+ ```javascript
213
+ var str = '%5.2s';
214
+ var out = format( str, 'baz' );
215
+ // returns ' ba'
216
+
217
+ str = 'PI: ~%.2f';
218
+ out = format( str, 3.14159 );
219
+ // returns 'PI: ~3.14'
220
+
221
+ str = 'Agent %.3i';
222
+ out = format( str, 7 );
223
+ // returns 'Agent 007'
224
+ ```
225
+
226
+ </section>
227
+
228
+ <!-- /.usage -->
229
+
230
+ <section class="examples">
231
+
232
+ ## Examples
233
+
234
+ <!-- eslint no-undef: "error" -->
235
+
236
+ ```javascript
237
+ var format = require( '@stdlib/string-format' );
238
+
239
+ var out = format( '%s %s!', 'Hello', 'World' );
240
+ // returns 'Hello World!'
241
+
242
+ out = format( 'Pi: ~%.2f', 3.141592653589793 );
243
+ // returns 'Pi: ~3.14'
244
+
245
+ out = format( '%-10s %-10s', 'a', 'b' );
246
+ // returns 'a b '
247
+
248
+ out = format( '%10s %10s', 'a', 'b' );
249
+ // returns ' a b'
250
+
251
+ out = format( '%2$s %1$s %3$s', 'b', 'a', 'c' );
252
+ // returns 'a b c'
253
+ ```
254
+
255
+ </section>
256
+
257
+ <!-- /.examples -->
258
+
259
+ <!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
260
+
261
+ <section class="related">
262
+
263
+ </section>
264
+
265
+ <!-- /.related -->
266
+
267
+ <!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
268
+
269
+
270
+ <section class="main-repo" >
271
+
272
+ * * *
273
+
274
+ ## Notice
275
+
276
+ 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.
277
+
278
+ 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].
279
+
280
+ #### Community
281
+
282
+ [![Chat][chat-image]][chat-url]
283
+
284
+ ---
285
+
286
+ ## License
287
+
288
+ See [LICENSE][stdlib-license].
289
+
290
+
291
+ ## Copyright
292
+
293
+ Copyright &copy; 2016-2026. The Stdlib [Authors][stdlib-authors].
294
+
295
+ </section>
296
+
297
+ <!-- /.stdlib -->
298
+
299
+ <!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
300
+
301
+ <section class="links">
302
+
303
+ [npm-image]: http://img.shields.io/npm/v/@stdlib/string-format.svg
304
+ [npm-url]: https://npmjs.org/package/@stdlib/string-format
305
+
306
+ [test-image]: https://github.com/stdlib-js/string-format/actions/workflows/test.yml/badge.svg?branch=v0.2.3
307
+ [test-url]: https://github.com/stdlib-js/string-format/actions/workflows/test.yml?query=branch:v0.2.3
308
+
309
+ [coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/string-format/main.svg
310
+ [coverage-url]: https://codecov.io/github/stdlib-js/string-format?branch=main
311
+
312
+ <!--
313
+
314
+ [dependencies-image]: https://img.shields.io/david/stdlib-js/string-format.svg
315
+ [dependencies-url]: https://david-dm.org/stdlib-js/string-format/main
316
+
317
+ -->
318
+
319
+ [chat-image]: https://img.shields.io/badge/zulip-join_chat-brightgreen.svg
320
+ [chat-url]: https://stdlib.zulipchat.com
321
+
322
+ [stdlib]: https://github.com/stdlib-js/stdlib
323
+
324
+ [stdlib-authors]: https://github.com/stdlib-js/stdlib/graphs/contributors
325
+
326
+ [umd]: https://github.com/umdjs/umd
327
+ [es-module]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules
328
+
329
+ [deno-url]: https://github.com/stdlib-js/string-format/tree/deno
330
+ [deno-readme]: https://github.com/stdlib-js/string-format/blob/deno/README.md
331
+ [umd-url]: https://github.com/stdlib-js/string-format/tree/umd
332
+ [umd-readme]: https://github.com/stdlib-js/string-format/blob/umd/README.md
333
+ [esm-url]: https://github.com/stdlib-js/string-format/tree/esm
334
+ [esm-readme]: https://github.com/stdlib-js/string-format/blob/esm/README.md
335
+ [branches-url]: https://github.com/stdlib-js/string-format/blob/main/branches.md
336
+
337
+ [stdlib-license]: https://raw.githubusercontent.com/stdlib-js/string-format/main/LICENSE
338
+
339
+ </section>
340
+
341
+ <!-- /.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 format from '../docs/types/index';
3
+ export = format;
@@ -0,0 +1,7 @@
1
+ "use strict";var i=function(e,r){return function(){return r||e((r={exports:{}}).exports,r),r.exports}};var u=i(function(c,n){
2
+ function g(e){return typeof e=="string"}n.exports=g
3
+ });var o=i(function(q,s){
4
+ var p=require('@stdlib/string-base-format-interpolate/dist'),l=require('@stdlib/string-base-format-tokenize/dist'),m=u();function a(e){var r,t;if(!m(e))throw new TypeError(a('1Of3F',e));for(r=[l(e)],t=1;t<arguments.length;t++)r.push(arguments[t]);return p.apply(null,r)}s.exports=a
5
+ });var v=o();module.exports=v;
6
+ /** @license Apache-2.0 */
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../lib/is_string.js", "../lib/main.js", "../lib/index.js"],
4
+ "sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 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* Tests if a value is a string primitive.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a string primitive\n*\n* @example\n* var bool = isString( 'beep' );\n* // returns true\n*\n* @example\n* var bool = isString( new String( 'beep' ) );\n* // returns false\n*/\nfunction isString( value ) {\n\treturn ( typeof value === 'string' ); // NOTE: we inline the `isString.isPrimitive` function from `@stdlib/assert/is-string` in order to avoid circular dependencies.\n}\n\n\n// EXPORTS //\n\nmodule.exports = isString;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 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// MODULES //\n\nvar interpolate = require( '@stdlib/string-base-format-interpolate' );\nvar tokenize = require( '@stdlib/string-base-format-tokenize' );\nvar isString = require( './is_string.js' );\n\n\n// MAIN //\n\n/**\n* Inserts supplied variable values into a format string.\n*\n* @param {string} str - input string\n* @param {Array} ...args - variable values\n* @throws {TypeError} first argument must be a string\n* @throws {Error} invalid flags\n* @returns {string} formatted string\n*\n* @example\n* var str = format( 'Hello %s!', 'world' );\n* // returns 'Hello world!'\n*\n* @example\n* var str = format( 'Pi: ~%.2f', 3.141592653589793 );\n* // returns 'Pi: ~3.14'\n*/\nfunction format( str ) {\n\tvar args;\n\tvar i;\n\n\tif ( !isString( str ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a string. Value: `%s`.', str ) );\n\t}\n\targs = [ tokenize( str ) ];\n\tfor ( i = 1; i < arguments.length; i++ ) {\n\t\targs.push( arguments[ i ] );\n\t}\n\treturn interpolate.apply( null, args );\n}\n\n\n// EXPORTS //\n\nmodule.exports = format;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 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* Insert supplied variable values into a format string.\n*\n* @module @stdlib/string-format\n*\n* @example\n* var format = require( '@stdlib/string-format' );\n*\n* var out = format( '%s %s!', 'Hello', 'World' );\n* // returns 'Hello World!'\n*\n* out = format( 'Pi: ~%.2f', 3.141592653589793 );\n* // returns 'Pi: ~3.14'\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,cAkCA,SAASC,EAAUC,EAAQ,CAC1B,OAAS,OAAOA,GAAU,QAC3B,CAKAF,EAAO,QAAUC,ICzCjB,IAAAE,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAc,QAAS,wCAAyC,EAChEC,EAAW,QAAS,qCAAsC,EAC1DC,EAAW,IAsBf,SAASC,EAAQC,EAAM,CACtB,IAAIC,EACAC,EAEJ,GAAK,CAACJ,EAAUE,CAAI,EACnB,MAAM,IAAI,UAAWD,EAAQ,kEAAmEC,CAAI,CAAE,EAGvG,IADAC,EAAO,CAAEJ,EAAUG,CAAI,CAAE,EACnBE,EAAI,EAAGA,EAAI,UAAU,OAAQA,IAClCD,EAAK,KAAM,UAAWC,CAAE,CAAE,EAE3B,OAAON,EAAY,MAAO,KAAMK,CAAK,CACtC,CAKAN,EAAO,QAAUI,IC1BjB,IAAII,EAAO,IAKX,OAAO,QAAUA",
6
+ "names": ["require_is_string", "__commonJSMin", "exports", "module", "isString", "value", "require_main", "__commonJSMin", "exports", "module", "interpolate", "tokenize", "isString", "format", "str", "args", "i", "main"]
7
+ }
@@ -0,0 +1,42 @@
1
+ /*
2
+ * @license Apache-2.0
3
+ *
4
+ * Copyright (c) 2022 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
+ * Inserts supplied variable values into a format string.
23
+ *
24
+ * @param str - input string
25
+ * @param args - variable values
26
+ * @throws invalid flags
27
+ * @returns formatted string
28
+ *
29
+ * @example
30
+ * var str = format( 'Hello %s!', 'world' );
31
+ * // returns 'Hello world!'
32
+ *
33
+ * @example
34
+ * var str = format( 'Pi: ~%.2f', 3.141592653589793 );
35
+ * // returns 'Pi: ~3.14'
36
+ */
37
+ declare function format( str: string, ...args: Array<any> ): string;
38
+
39
+
40
+ // EXPORTS //
41
+
42
+ export = format;