@modern-js/utils 1.3.8-canary.0 → 1.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (186) hide show
  1. package/CHANGELOG.md +49 -0
  2. package/compiled/address/index.js +1 -0
  3. package/compiled/address/lib/address.d.ts +28 -0
  4. package/compiled/address/package.json +1 -0
  5. package/compiled/browserslist/index.js +1 -1
  6. package/compiled/dotenv/index.js +1 -0
  7. package/compiled/dotenv/license +23 -0
  8. package/compiled/dotenv/package.json +1 -0
  9. package/compiled/dotenv/types/index.d.ts +59 -0
  10. package/compiled/dotenv-expand/index.d.ts +15 -0
  11. package/compiled/dotenv-expand/index.js +1 -0
  12. package/compiled/dotenv-expand/license +24 -0
  13. package/compiled/dotenv-expand/package.json +1 -0
  14. package/compiled/fast-glob/@nodelib/fs.scandir/out/adapters/fs.d.ts +20 -0
  15. package/compiled/fast-glob/@nodelib/fs.scandir/out/index.d.ts +12 -0
  16. package/compiled/fast-glob/@nodelib/fs.scandir/out/providers/async.d.ts +7 -0
  17. package/compiled/fast-glob/@nodelib/fs.scandir/out/settings.d.ts +20 -0
  18. package/compiled/fast-glob/@nodelib/fs.scandir/out/types/index.d.ts +20 -0
  19. package/compiled/fast-glob/@nodelib/fs.stat/out/adapters/fs.d.ts +13 -0
  20. package/compiled/fast-glob/@nodelib/fs.stat/out/index.d.ts +12 -0
  21. package/compiled/fast-glob/@nodelib/fs.stat/out/providers/async.d.ts +4 -0
  22. package/compiled/fast-glob/@nodelib/fs.stat/out/settings.d.ts +16 -0
  23. package/compiled/fast-glob/@nodelib/fs.stat/out/types/index.d.ts +4 -0
  24. package/compiled/fast-glob/@nodelib/fs.walk/out/index.d.ts +14 -0
  25. package/compiled/fast-glob/@nodelib/fs.walk/out/providers/async.d.ts +12 -0
  26. package/compiled/fast-glob/@nodelib/fs.walk/out/readers/async.d.ts +30 -0
  27. package/compiled/fast-glob/@nodelib/fs.walk/out/readers/reader.d.ts +6 -0
  28. package/compiled/fast-glob/@nodelib/fs.walk/out/settings.d.ts +30 -0
  29. package/compiled/fast-glob/@nodelib/fs.walk/out/types/index.d.ts +8 -0
  30. package/compiled/fast-glob/index.js +37 -0
  31. package/compiled/fast-glob/license +21 -0
  32. package/compiled/fast-glob/out/index.d.ts +27 -0
  33. package/compiled/fast-glob/out/managers/tasks.d.ts +22 -0
  34. package/compiled/fast-glob/out/settings.d.ts +164 -0
  35. package/compiled/fast-glob/out/types/index.d.ts +31 -0
  36. package/compiled/fast-glob/package.json +1 -0
  37. package/compiled/globby/@nodelib/fs.scandir/out/adapters/fs.d.ts +20 -0
  38. package/compiled/globby/@nodelib/fs.scandir/out/index.d.ts +12 -0
  39. package/compiled/globby/@nodelib/fs.scandir/out/providers/async.d.ts +7 -0
  40. package/compiled/globby/@nodelib/fs.scandir/out/settings.d.ts +20 -0
  41. package/compiled/globby/@nodelib/fs.scandir/out/types/index.d.ts +20 -0
  42. package/compiled/globby/@nodelib/fs.stat/out/adapters/fs.d.ts +13 -0
  43. package/compiled/globby/@nodelib/fs.stat/out/index.d.ts +12 -0
  44. package/compiled/globby/@nodelib/fs.stat/out/providers/async.d.ts +4 -0
  45. package/compiled/globby/@nodelib/fs.stat/out/settings.d.ts +16 -0
  46. package/compiled/globby/@nodelib/fs.stat/out/types/index.d.ts +4 -0
  47. package/compiled/globby/@nodelib/fs.walk/out/index.d.ts +14 -0
  48. package/compiled/globby/@nodelib/fs.walk/out/providers/async.d.ts +12 -0
  49. package/compiled/globby/@nodelib/fs.walk/out/readers/async.d.ts +30 -0
  50. package/compiled/globby/@nodelib/fs.walk/out/readers/reader.d.ts +6 -0
  51. package/compiled/globby/@nodelib/fs.walk/out/settings.d.ts +30 -0
  52. package/compiled/globby/@nodelib/fs.walk/out/types/index.d.ts +8 -0
  53. package/compiled/globby/fast-glob/index.d.ts +27 -0
  54. package/compiled/globby/fast-glob/managers/tasks.d.ts +22 -0
  55. package/compiled/globby/fast-glob/settings.d.ts +164 -0
  56. package/compiled/globby/fast-glob/types/index.d.ts +31 -0
  57. package/compiled/globby/index.d.ts +186 -0
  58. package/compiled/globby/index.js +1 -0
  59. package/compiled/globby/license +9 -0
  60. package/compiled/globby/package.json +1 -0
  61. package/compiled/inquirer/index.d.ts +997 -0
  62. package/compiled/inquirer/index.js +9 -0
  63. package/compiled/inquirer/lib/objects/choice.d.ts +65 -0
  64. package/compiled/inquirer/lib/objects/choices.d.ts +206 -0
  65. package/compiled/inquirer/lib/objects/separator.d.ts +37 -0
  66. package/compiled/inquirer/lib/ui/baseUI.d.ts +37 -0
  67. package/compiled/inquirer/lib/ui/bottom-bar.d.ts +65 -0
  68. package/compiled/inquirer/lib/ui/prompt.d.ts +104 -0
  69. package/compiled/inquirer/license +22 -0
  70. package/compiled/inquirer/package.json +1 -0
  71. package/compiled/inquirer/through/index.d.ts +25 -0
  72. package/compiled/json5/index.js +1 -0
  73. package/compiled/json5/lib/index.d.ts +4 -0
  74. package/compiled/json5/lib/parse.d.ts +15 -0
  75. package/compiled/json5/lib/stringify.d.ts +89 -0
  76. package/compiled/json5/package.json +1 -0
  77. package/compiled/mime-types/index.d.ts +14 -0
  78. package/compiled/mime-types/index.js +14 -0
  79. package/compiled/mime-types/license +23 -0
  80. package/compiled/mime-types/package.json +1 -0
  81. package/compiled/minimist/index.d.ts +95 -0
  82. package/compiled/minimist/index.js +1 -0
  83. package/compiled/minimist/license +18 -0
  84. package/compiled/minimist/package.json +1 -0
  85. package/compiled/ora/cli-spinners/index.d.ts +125 -0
  86. package/compiled/ora/index.d.ts +277 -0
  87. package/compiled/ora/index.js +3 -0
  88. package/compiled/ora/license +9 -0
  89. package/compiled/ora/package.json +1 -0
  90. package/compiled/slash/index.d.ts +25 -0
  91. package/compiled/slash/index.js +1 -0
  92. package/compiled/slash/license +9 -0
  93. package/compiled/slash/package.json +1 -0
  94. package/compiled/url-join/index.d.ts +17 -0
  95. package/compiled/url-join/index.js +1 -0
  96. package/compiled/url-join/license +21 -0
  97. package/compiled/url-join/package.json +1 -0
  98. package/dist/analyzeProject.d.ts +1 -0
  99. package/dist/analyzeProject.js +40 -0
  100. package/dist/compiled.d.ts +33 -17
  101. package/dist/compiled.js +57 -21
  102. package/dist/constants.d.ts +1 -1
  103. package/dist/constants.js +1 -1
  104. package/dist/index.d.ts +2 -2
  105. package/dist/index.js +2 -2
  106. package/dist/prettyInstructions.js +3 -3
  107. package/dist/{ssrHelpers.d.ts → ssr.d.ts} +3 -0
  108. package/dist/{ssrHelpers.js → ssr.js} +0 -0
  109. package/dist/storage.js +1 -1
  110. package/package.json +12 -30
  111. package/dist/getCacheIdentifier.d.ts +0 -7
  112. package/dist/getCacheIdentifier.js +0 -24
  113. package/dist/js/modern/monorepo.js +0 -83
  114. package/dist/js/node/monorepo.js +0 -116
  115. package/dist/js/treeshaking/monorepo.js +0 -96
  116. package/dist/pkgUp.d.ts +0 -2
  117. package/dist/pkgUp.js +0 -8
  118. package/dist/types/FileSizeReporter.d.ts +0 -16
  119. package/dist/types/alias.d.ts +0 -21
  120. package/dist/types/applyOptionsChain.d.ts +0 -6
  121. package/dist/types/clearConsole.d.ts +0 -1
  122. package/dist/types/compatRequire.d.ts +0 -8
  123. package/dist/types/compiled.d.ts +0 -17
  124. package/dist/types/constants.d.ts +0 -222
  125. package/dist/types/debug.d.ts +0 -6
  126. package/dist/types/emptyDir.d.ts +0 -1
  127. package/dist/types/ensureAbsolutePath.d.ts +0 -7
  128. package/dist/types/findExists.d.ts +0 -6
  129. package/dist/types/format.d.ts +0 -16
  130. package/dist/types/generateMetaTags.d.ts +0 -16
  131. package/dist/types/getBrowserslist.d.ts +0 -2
  132. package/dist/types/getCacheIdentifier.d.ts +0 -7
  133. package/dist/types/getEntryOptions.d.ts +0 -1
  134. package/dist/types/getPackageManager.d.ts +0 -1
  135. package/dist/types/getPort.d.ts +0 -7
  136. package/dist/types/getServerConfig.d.ts +0 -1
  137. package/dist/types/import.d.ts +0 -5
  138. package/dist/types/index.d.ts +0 -32
  139. package/dist/types/is/index.d.ts +0 -34
  140. package/dist/types/is/node-env.d.ts +0 -4
  141. package/dist/types/is/platform.d.ts +0 -2
  142. package/dist/types/is/type.d.ts +0 -8
  143. package/dist/types/logger.d.ts +0 -63
  144. package/dist/types/monorepo.d.ts +0 -11
  145. package/dist/types/nodeEnv.d.ts +0 -3
  146. package/dist/types/path.d.ts +0 -3
  147. package/dist/types/prettyInstructions.d.ts +0 -6
  148. package/dist/types/printBuildError.d.ts +0 -8
  149. package/dist/types/readTsConfig.d.ts +0 -2
  150. package/dist/types/removeSlash.d.ts +0 -3
  151. package/dist/types/runtimeExports.d.ts +0 -4
  152. package/dist/types/wait.d.ts +0 -2
  153. package/dist/types/watch.d.ts +0 -8
  154. package/modern.config.js +0 -6
  155. package/tests/.eslintrc.js +0 -6
  156. package/tests/__snapshots__/prettyInstructions.test.ts.snap +0 -19
  157. package/tests/applyOptionsChain.test.ts +0 -100
  158. package/tests/compatRequire.test.ts +0 -32
  159. package/tests/debug.test.ts +0 -25
  160. package/tests/ensureAbsolutePath.test.ts +0 -16
  161. package/tests/findExists.test.ts +0 -22
  162. package/tests/fixtures/browserlist/develop/package.json +0 -11
  163. package/tests/fixtures/browserlist/dotfile/.browserslistrc +0 -3
  164. package/tests/fixtures/browserlist/pkg/package.json +0 -7
  165. package/tests/fixtures/compat-require/cjs.js +0 -1
  166. package/tests/fixtures/compat-require/empty.js +0 -1
  167. package/tests/fixtures/compat-require/esm.js +0 -5
  168. package/tests/fixtures/compat-require/foo.js +0 -3
  169. package/tests/fixtures/file-exists/a.ejs +0 -0
  170. package/tests/fixtures/file-exists/a.js/.gitkeep +0 -0
  171. package/tests/fixtures/file-exists/a.mjs +0 -0
  172. package/tests/fixtures/file-exists/a.ts +0 -0
  173. package/tests/format.test.ts +0 -60
  174. package/tests/generateMetaTags.test.ts +0 -19
  175. package/tests/getBrowserslist.test.ts +0 -32
  176. package/tests/getCacheIdentifier.test.ts +0 -37
  177. package/tests/getEntryOptions.test.ts +0 -53
  178. package/tests/index.test.ts +0 -18
  179. package/tests/is.test.ts +0 -27
  180. package/tests/isPlatform.test.ts +0 -19
  181. package/tests/isType.test.ts +0 -85
  182. package/tests/logger.test.ts +0 -53
  183. package/tests/prettyInstructions.test.ts +0 -139
  184. package/tests/removeSlash.test.ts +0 -19
  185. package/tests/tsconfig.json +0 -11
  186. package/tests/wait.ts +0 -38
@@ -0,0 +1,89 @@
1
+ declare type StringifyOptions = {
2
+ /**
3
+ * A function that alters the behavior of the stringification process, or an
4
+ * array of String and Number objects that serve as a allowlist for
5
+ * selecting/filtering the properties of the value object to be included in
6
+ * the JSON5 string. If this value is null or not provided, all properties
7
+ * of the object are included in the resulting JSON5 string.
8
+ */
9
+ replacer?:
10
+ | ((this: any, key: string, value: any) => any)
11
+ | (string | number)[]
12
+ | null
13
+
14
+ /**
15
+ * A String or Number object that's used to insert white space into the
16
+ * output JSON5 string for readability purposes. If this is a Number, it
17
+ * indicates the number of space characters to use as white space; this
18
+ * number is capped at 10 (if it is greater, the value is just 10). Values
19
+ * less than 1 indicate that no space should be used. If this is a String,
20
+ * the string (or the first 10 characters of the string, if it's longer than
21
+ * that) is used as white space. If this parameter is not provided (or is
22
+ * null), no white space is used. If white space is used, trailing commas
23
+ * will be used in objects and arrays.
24
+ */
25
+ space?: string | number | null
26
+
27
+ /**
28
+ * A String representing the quote character to use when serializing
29
+ * strings.
30
+ */
31
+ quote?: string | null
32
+ }
33
+
34
+ /**
35
+ * Converts a JavaScript value to a JSON5 string.
36
+ * @param value The value to convert to a JSON5 string.
37
+ * @param replacer A function that alters the behavior of the stringification
38
+ * process. If this value is null or not provided, all properties of the object
39
+ * are included in the resulting JSON5 string.
40
+ * @param space A String or Number object that's used to insert white space into
41
+ * the output JSON5 string for readability purposes. If this is a Number, it
42
+ * indicates the number of space characters to use as white space; this number
43
+ * is capped at 10 (if it is greater, the value is just 10). Values less than 1
44
+ * indicate that no space should be used. If this is a String, the string (or
45
+ * the first 10 characters of the string, if it's longer than that) is used as
46
+ * white space. If this parameter is not provided (or is null), no white space
47
+ * is used. If white space is used, trailing commas will be used in objects and
48
+ * arrays.
49
+ * @returns The JSON5 string converted from the JavaScript value.
50
+ */
51
+ declare function stringify(
52
+ value: any,
53
+ replacer?: ((this: any, key: string, value: any) => any) | null,
54
+ space?: string | number | null,
55
+ ): string
56
+
57
+ /**
58
+ * Converts a JavaScript value to a JSON5 string.
59
+ * @param value The value to convert to a JSON5 string.
60
+ * @param replacer An array of String and Number objects that serve as a
61
+ * allowlist for selecting/filtering the properties of the value object to be
62
+ * included in the JSON5 string. If this value is null or not provided, all
63
+ * properties of the object are included in the resulting JSON5 string.
64
+ * @param space A String or Number object that's used to insert white space into
65
+ * the output JSON5 string for readability purposes. If this is a Number, it
66
+ * indicates the number of space characters to use as white space; this number
67
+ * is capped at 10 (if it is greater, the value is just 10). Values less than 1
68
+ * indicate that no space should be used. If this is a String, the string (or
69
+ * the first 10 characters of the string, if it's longer than that) is used as
70
+ * white space. If this parameter is not provided (or is null), no white space
71
+ * is used. If white space is used, trailing commas will be used in objects and
72
+ * arrays.
73
+ * @returns The JSON5 string converted from the JavaScript value.
74
+ */
75
+ declare function stringify(
76
+ value: any,
77
+ replacer: (string | number)[],
78
+ space?: string | number | null,
79
+ ): string
80
+
81
+ /**
82
+ * Converts a JavaScript value to a JSON5 string.
83
+ * @param value The value to convert to a JSON5 string.
84
+ * @param options An object specifying options.
85
+ * @returns The JSON5 string converted from the JavaScript value.
86
+ */
87
+ declare function stringify(value: any, options: StringifyOptions): string
88
+
89
+ export = stringify
@@ -0,0 +1 @@
1
+ {"name":"json5","author":"Aseem Kishore <aseem.kishore@gmail.com>","version":"2.2.0","license":"MIT","types":"lib/index.d.ts"}
@@ -0,0 +1,14 @@
1
+ // Type definitions for mime-types 2.1
2
+ // Project: https://github.com/jshttp/mime-types#readme
3
+ // Definitions by: Gyusun Yeom <https://github.com/Perlmint>
4
+ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5
+
6
+ export function lookup(filenameOrExt: string): string | false;
7
+ export function contentType(filenameOrExt: string): string | false;
8
+ export function extension(typeString: string): string | false;
9
+ export function charset(typeString: string): string | false;
10
+ export namespace charsets {
11
+ const lookup: typeof charset;
12
+ }
13
+ export const types: {[key: string]: string};
14
+ export const extensions: {[key: string]: string[]};