projen 0.80.7 → 0.80.9

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 (187) hide show
  1. package/.jsii +41 -41
  2. package/lib/awscdk/auto-discover.js +5 -5
  3. package/lib/awscdk/awscdk-app-java.js +1 -1
  4. package/lib/awscdk/awscdk-app-py.js +1 -1
  5. package/lib/awscdk/awscdk-app-ts.js +1 -1
  6. package/lib/awscdk/awscdk-construct.js +2 -2
  7. package/lib/awscdk/awscdk-deps-java.js +1 -1
  8. package/lib/awscdk/awscdk-deps-js.js +1 -1
  9. package/lib/awscdk/awscdk-deps-py.js +1 -1
  10. package/lib/awscdk/awscdk-deps.js +1 -1
  11. package/lib/awscdk/cdk-config.js +1 -1
  12. package/lib/awscdk/cdk-tasks.js +1 -1
  13. package/lib/awscdk/integration-test.js +1 -1
  14. package/lib/awscdk/lambda-extension.js +1 -1
  15. package/lib/awscdk/lambda-function.js +2 -2
  16. package/lib/build/build-workflow.js +1 -1
  17. package/lib/cdk/auto-discover-base.js +2 -2
  18. package/lib/cdk/construct-lib.js +1 -1
  19. package/lib/cdk/integration-test-base.js +1 -1
  20. package/lib/cdk/jsii-docgen.js +1 -1
  21. package/lib/cdk/jsii-project.js +1 -1
  22. package/lib/cdk8s/auto-discover.js +2 -2
  23. package/lib/cdk8s/cdk8s-app-py.js +1 -1
  24. package/lib/cdk8s/cdk8s-app-ts.js +1 -1
  25. package/lib/cdk8s/cdk8s-construct.js +1 -1
  26. package/lib/cdk8s/cdk8s-deps-py.js +1 -1
  27. package/lib/cdk8s/cdk8s-deps.js +1 -1
  28. package/lib/cdk8s/integration-test.js +1 -1
  29. package/lib/cdktf/cdktf-construct.js +1 -1
  30. package/lib/circleci/circleci.js +1 -1
  31. package/lib/component.js +1 -1
  32. package/lib/dependencies.js +1 -1
  33. package/lib/dev-env.js +1 -1
  34. package/lib/docker-compose/docker-compose-service.js +1 -1
  35. package/lib/docker-compose/docker-compose.js +1 -1
  36. package/lib/file.js +1 -1
  37. package/lib/gitattributes.js +1 -1
  38. package/lib/github/actions-provider.js +1 -1
  39. package/lib/github/auto-approve.js +1 -1
  40. package/lib/github/auto-merge.js +1 -1
  41. package/lib/github/dependabot.js +1 -1
  42. package/lib/github/github-credentials.js +1 -1
  43. package/lib/github/github-project.js +1 -1
  44. package/lib/github/github.js +1 -1
  45. package/lib/github/mergify.js +1 -1
  46. package/lib/github/pr-template.js +1 -1
  47. package/lib/github/pull-request-lint.js +1 -1
  48. package/lib/github/stale.js +1 -1
  49. package/lib/github/task-workflow-job.js +1 -1
  50. package/lib/github/task-workflow.js +1 -1
  51. package/lib/github/workflow-actions.js +1 -1
  52. package/lib/github/workflow-jobs.js +1 -1
  53. package/lib/github/workflow-steps.js +1 -1
  54. package/lib/github/workflows.js +1 -1
  55. package/lib/gitlab/configuration.js +1 -1
  56. package/lib/gitlab/gitlab-configuration.js +1 -1
  57. package/lib/gitlab/nested-configuration.js +1 -1
  58. package/lib/gitpod.js +1 -1
  59. package/lib/ignore-file.js +1 -1
  60. package/lib/ini.js +1 -1
  61. package/lib/java/java-project.js +1 -1
  62. package/lib/java/junit.js +1 -1
  63. package/lib/java/maven-compile.js +1 -1
  64. package/lib/java/maven-packaging.js +1 -1
  65. package/lib/java/maven-sample.js +1 -1
  66. package/lib/java/pom.js +1 -1
  67. package/lib/java/projenrc.js +1 -1
  68. package/lib/javascript/bundler.js +1 -1
  69. package/lib/javascript/eslint.js +1 -1
  70. package/lib/javascript/jest.js +4 -4
  71. package/lib/javascript/license-checker.js +1 -1
  72. package/lib/javascript/node-package.js +1 -1
  73. package/lib/javascript/node-project.js +1 -1
  74. package/lib/javascript/npm-config.js +1 -1
  75. package/lib/javascript/prettier.js +1 -1
  76. package/lib/javascript/projenrc.js +1 -1
  77. package/lib/javascript/typescript-config.js +2 -2
  78. package/lib/javascript/upgrade-dependencies.js +2 -2
  79. package/lib/javascript/yarnrc.js +1 -1
  80. package/lib/json-patch.js +1 -1
  81. package/lib/json.js +1 -1
  82. package/lib/license.js +1 -1
  83. package/lib/logger.js +1 -1
  84. package/lib/makefile.js +1 -1
  85. package/lib/object-file.js +1 -1
  86. package/lib/project-build.js +1 -1
  87. package/lib/project-tree.js +1 -1
  88. package/lib/project.js +1 -1
  89. package/lib/projects.js +1 -1
  90. package/lib/projenrc-json.js +2 -2
  91. package/lib/projenrc.js +1 -1
  92. package/lib/python/pip.js +1 -1
  93. package/lib/python/poetry.d.ts +3 -7
  94. package/lib/python/poetry.js +21 -43
  95. package/lib/python/projenrc.js +1 -1
  96. package/lib/python/pytest-sample.js +1 -1
  97. package/lib/python/pytest.js +1 -1
  98. package/lib/python/python-project.js +1 -1
  99. package/lib/python/python-sample.js +1 -1
  100. package/lib/python/requirements-file.js +1 -1
  101. package/lib/python/setuppy.js +1 -1
  102. package/lib/python/setuptools.js +1 -1
  103. package/lib/python/venv.js +1 -1
  104. package/lib/readme.js +1 -1
  105. package/lib/release/publisher.js +1 -1
  106. package/lib/release/release-trigger.js +1 -1
  107. package/lib/release/release.js +1 -1
  108. package/lib/renovatebot.js +1 -1
  109. package/lib/sample-file.js +2 -2
  110. package/lib/semver.js +1 -1
  111. package/lib/source-code.js +1 -1
  112. package/lib/task-runtime.js +1 -1
  113. package/lib/task.js +1 -1
  114. package/lib/tasks.js +1 -1
  115. package/lib/testing.js +1 -1
  116. package/lib/textfile.js +1 -1
  117. package/lib/toml.js +8 -10
  118. package/lib/typescript/projenrc-ts.js +1 -1
  119. package/lib/typescript/projenrc.js +1 -1
  120. package/lib/typescript/typescript-typedoc.js +1 -1
  121. package/lib/typescript/typescript.js +6 -6
  122. package/lib/version.js +2 -2
  123. package/lib/vscode/devcontainer.js +1 -1
  124. package/lib/vscode/extensions.js +1 -1
  125. package/lib/vscode/launch-config.js +1 -1
  126. package/lib/vscode/settings.js +1 -1
  127. package/lib/vscode/vscode.js +1 -1
  128. package/lib/web/next.js +3 -3
  129. package/lib/web/postcss.js +1 -1
  130. package/lib/web/react.js +4 -4
  131. package/lib/web/tailwind.js +1 -1
  132. package/lib/xmlfile.js +1 -1
  133. package/lib/yaml.js +1 -1
  134. package/node_modules/@iarna/toml/LICENSE +14 -0
  135. package/node_modules/@iarna/toml/README.md +301 -0
  136. package/node_modules/@iarna/toml/index.d.ts +57 -0
  137. package/node_modules/@iarna/toml/lib/create-date.js +23 -0
  138. package/node_modules/@iarna/toml/lib/create-datetime-float.js +24 -0
  139. package/node_modules/@iarna/toml/lib/create-datetime.js +10 -0
  140. package/node_modules/@iarna/toml/lib/create-time.js +22 -0
  141. package/node_modules/@iarna/toml/lib/format-num.js +6 -0
  142. package/node_modules/@iarna/toml/lib/parser-debug.js +60 -0
  143. package/node_modules/@iarna/toml/lib/parser.js +127 -0
  144. package/node_modules/@iarna/toml/lib/toml-parser.js +1379 -0
  145. package/node_modules/@iarna/toml/package.json +82 -0
  146. package/node_modules/@iarna/toml/parse-async.js +30 -0
  147. package/node_modules/@iarna/toml/parse-pretty-error.js +33 -0
  148. package/node_modules/@iarna/toml/parse-stream.js +80 -0
  149. package/node_modules/@iarna/toml/parse-string.js +18 -0
  150. package/node_modules/@iarna/toml/parse.js +5 -0
  151. package/node_modules/@iarna/toml/stringify.js +296 -0
  152. package/node_modules/@iarna/toml/toml.js +3 -0
  153. package/node_modules/yaml/browser/dist/parse/parser.js +4 -1
  154. package/node_modules/yaml/browser/dist/stringify/foldFlowLines.js +19 -10
  155. package/node_modules/yaml/browser/dist/stringify/stringifyCollection.js +5 -12
  156. package/node_modules/yaml/dist/parse/parser.js +4 -1
  157. package/node_modules/yaml/dist/stringify/foldFlowLines.js +19 -10
  158. package/node_modules/yaml/dist/stringify/stringifyCollection.js +5 -12
  159. package/node_modules/yaml/package.json +1 -1
  160. package/package.json +8 -8
  161. package/node_modules/json2toml/CHANGELOG.md +0 -128
  162. package/node_modules/json2toml/LICENSE.txt +0 -18
  163. package/node_modules/json2toml/README.md +0 -52
  164. package/node_modules/json2toml/index.d.ts +0 -13
  165. package/node_modules/json2toml/index.js +0 -160
  166. package/node_modules/json2toml/package.json +0 -62
  167. package/node_modules/lodash.isdate/LICENSE +0 -47
  168. package/node_modules/lodash.isdate/README.md +0 -18
  169. package/node_modules/lodash.isdate/index.js +0 -119
  170. package/node_modules/lodash.isdate/package.json +0 -17
  171. package/node_modules/lodash.isempty/LICENSE +0 -47
  172. package/node_modules/lodash.isempty/README.md +0 -18
  173. package/node_modules/lodash.isempty/index.js +0 -582
  174. package/node_modules/lodash.isempty/package.json +0 -17
  175. package/node_modules/lodash.isplainobject/LICENSE +0 -47
  176. package/node_modules/lodash.isplainobject/README.md +0 -18
  177. package/node_modules/lodash.isplainobject/index.js +0 -139
  178. package/node_modules/lodash.isplainobject/package.json +0 -17
  179. package/node_modules/strftime/Changelog.md +0 -286
  180. package/node_modules/strftime/Makefile +0 -15
  181. package/node_modules/strftime/Readme.md +0 -208
  182. package/node_modules/strftime/bower.json +0 -13
  183. package/node_modules/strftime/component.json +0 -16
  184. package/node_modules/strftime/package.json +0 -53
  185. package/node_modules/strftime/strftime-min.js +0 -21
  186. package/node_modules/strftime/strftime.js +0 -854
  187. package/node_modules/strftime/test.js +0 -271
@@ -1,854 +0,0 @@
1
- //
2
- // strftime
3
- // github.com/samsonjs/strftime
4
- // @_sjs
5
- //
6
- // Copyright 2010 - 2021 Sami Samhuri <sami@samhuri.net>
7
- //
8
- // MIT License
9
- // http://sjs.mit-license.org
10
- //
11
-
12
- ; (function () {
13
-
14
- var Locales = {
15
- de_DE: {
16
- identifier: 'de-DE',
17
- days: ['Sonntag', 'Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag'],
18
- shortDays: ['So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa'],
19
- months: ['Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'],
20
- shortMonths: ['Jan', 'Feb', 'Mär', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez'],
21
- AM: 'AM',
22
- PM: 'PM',
23
- am: 'am',
24
- pm: 'pm',
25
- formats: {
26
- c: '%a %d %b %Y %X %Z',
27
- D: '%d.%m.%Y',
28
- F: '%Y-%m-%d',
29
- R: '%H:%M',
30
- r: '%I:%M:%S %p',
31
- T: '%H:%M:%S',
32
- v: '%e-%b-%Y',
33
- X: '%T',
34
- x: '%D'
35
- }
36
- },
37
-
38
- en_CA: {
39
- identifier: 'en-CA',
40
- days: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
41
- shortDays: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
42
- months: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
43
- shortMonths: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
44
- ordinalSuffixes: [
45
- 'st', 'nd', 'rd', 'th', 'th', 'th', 'th', 'th', 'th', 'th',
46
- 'th', 'th', 'th', 'th', 'th', 'th', 'th', 'th', 'th', 'th',
47
- 'st', 'nd', 'rd', 'th', 'th', 'th', 'th', 'th', 'th', 'th',
48
- 'st'
49
- ],
50
- AM: 'AM',
51
- PM: 'PM',
52
- am: 'am',
53
- pm: 'pm',
54
- formats: {
55
- c: '%a %d %b %Y %X %Z',
56
- D: '%d/%m/%y',
57
- F: '%Y-%m-%d',
58
- R: '%H:%M',
59
- r: '%I:%M:%S %p',
60
- T: '%H:%M:%S',
61
- v: '%e-%b-%Y',
62
- X: '%r',
63
- x: '%D'
64
- }
65
- },
66
-
67
- en_US: {
68
- identifier: 'en-US',
69
- days: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
70
- shortDays: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
71
- months: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
72
- shortMonths: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
73
- ordinalSuffixes: [
74
- 'st', 'nd', 'rd', 'th', 'th', 'th', 'th', 'th', 'th', 'th',
75
- 'th', 'th', 'th', 'th', 'th', 'th', 'th', 'th', 'th', 'th',
76
- 'st', 'nd', 'rd', 'th', 'th', 'th', 'th', 'th', 'th', 'th',
77
- 'st'
78
- ],
79
- AM: 'AM',
80
- PM: 'PM',
81
- am: 'am',
82
- pm: 'pm',
83
- formats: {
84
- c: '%a %d %b %Y %X %Z',
85
- D: '%m/%d/%y',
86
- F: '%Y-%m-%d',
87
- R: '%H:%M',
88
- r: '%I:%M:%S %p',
89
- T: '%H:%M:%S',
90
- v: '%e-%b-%Y',
91
- X: '%r',
92
- x: '%D'
93
- }
94
- },
95
-
96
- es_MX: {
97
- identifier: 'es-MX',
98
- days: ['domingo', 'lunes', 'martes', 'miércoles', 'jueves', 'viernes', 'sábado'],
99
- shortDays: ['dom', 'lun', 'mar', 'mié', 'jue', 'vie', 'sáb'],
100
- months: ['enero', 'febrero', 'marzo', 'abril', 'mayo', 'junio', 'julio', 'agosto', 'septiembre', 'octubre', 'noviembre', 'diciembre'],
101
- shortMonths: ['ene', 'feb', 'mar', 'abr', 'may', 'jun', 'jul', 'ago', 'sep', 'oct', 'nov', 'dic'],
102
- AM: 'AM',
103
- PM: 'PM',
104
- am: 'am',
105
- pm: 'pm',
106
- formats: {
107
- c: '%a %d %b %Y %X %Z',
108
- D: '%d/%m/%Y',
109
- F: '%Y-%m-%d',
110
- R: '%H:%M',
111
- r: '%I:%M:%S %p',
112
- T: '%H:%M:%S',
113
- v: '%e-%b-%Y',
114
- X: '%T',
115
- x: '%D'
116
- }
117
- },
118
-
119
- fr_FR: {
120
- identifier: 'fr-FR',
121
- days: ['dimanche', 'lundi', 'mardi', 'mercredi', 'jeudi', 'vendredi', 'samedi'],
122
- shortDays: ['dim.', 'lun.', 'mar.', 'mer.', 'jeu.', 'ven.', 'sam.'],
123
- months: ['janvier', 'février', 'mars', 'avril', 'mai', 'juin', 'juillet', 'août', 'septembre', 'octobre', 'novembre', 'décembre'],
124
- shortMonths: ['janv.', 'févr.', 'mars', 'avril', 'mai', 'juin', 'juil.', 'août', 'sept.', 'oct.', 'nov.', 'déc.'],
125
- AM: 'AM',
126
- PM: 'PM',
127
- am: 'am',
128
- pm: 'pm',
129
- formats: {
130
- c: '%a %d %b %Y %X %Z',
131
- D: '%d/%m/%Y',
132
- F: '%Y-%m-%d',
133
- R: '%H:%M',
134
- r: '%I:%M:%S %p',
135
- T: '%H:%M:%S',
136
- v: '%e-%b-%Y',
137
- X: '%T',
138
- x: '%D'
139
- }
140
- },
141
-
142
- it_IT: {
143
- identifier: 'it-IT',
144
- days: ['domenica', 'lunedì', 'martedì', 'mercoledì', 'giovedì', 'venerdì', 'sabato'],
145
- shortDays: ['dom', 'lun', 'mar', 'mer', 'gio', 'ven', 'sab'],
146
- months: ['gennaio', 'febbraio', 'marzo', 'aprile', 'maggio', 'giugno', 'luglio', 'agosto', 'settembre', 'ottobre', 'novembre', 'dicembre'],
147
- shortMonths: ['gen', 'feb', 'mar', 'apr', 'mag', 'giu', 'lug', 'ago', 'set', 'ott', 'nov', 'dic'],
148
- AM: 'AM',
149
- PM: 'PM',
150
- am: 'am',
151
- pm: 'pm',
152
- formats: {
153
- c: '%a %d %b %Y %X %Z',
154
- D: '%d/%m/%Y',
155
- F: '%Y-%m-%d',
156
- R: '%H:%M',
157
- r: '%I:%M:%S %p',
158
- T: '%H:%M:%S',
159
- v: '%e-%b-%Y',
160
- X: '%T',
161
- x: '%D'
162
- }
163
- },
164
-
165
- nl_NL: {
166
- identifier: 'nl-NL',
167
- days: ['zondag', 'maandag', 'dinsdag', 'woensdag', 'donderdag', 'vrijdag', 'zaterdag'],
168
- shortDays: ['zo', 'ma', 'di', 'wo', 'do', 'vr', 'za'],
169
- months: ['januari', 'februari', 'maart', 'april', 'mei', 'juni', 'juli', 'augustus', 'september', 'oktober', 'november', 'december'],
170
- shortMonths: ['jan', 'feb', 'mrt', 'apr', 'mei', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'dec'],
171
- AM: 'AM',
172
- PM: 'PM',
173
- am: 'am',
174
- pm: 'pm',
175
- formats: {
176
- c: '%a %d %b %Y %X %Z',
177
- D: '%d-%m-%y',
178
- F: '%Y-%m-%d',
179
- R: '%H:%M',
180
- r: '%I:%M:%S %p',
181
- T: '%H:%M:%S',
182
- v: '%e-%b-%Y',
183
- X: '%T',
184
- x: '%D'
185
- }
186
- },
187
-
188
- pt_BR: {
189
- identifier: 'pt-BR',
190
- days: ['domingo', 'segunda', 'terça', 'quarta', 'quinta', 'sexta', 'sábado'],
191
- shortDays: ['Dom', 'Seg', 'Ter', 'Qua', 'Qui', 'Sex', 'Sáb'],
192
- months: ['janeiro', 'fevereiro', 'março', 'abril', 'maio', 'junho', 'julho', 'agosto', 'setembro', 'outubro', 'novembro', 'dezembro'],
193
- shortMonths: ['Jan', 'Fev', 'Mar', 'Abr', 'Mai', 'Jun', 'Jul', 'Ago', 'Set', 'Out', 'Nov', 'Dez'],
194
- AM: 'AM',
195
- PM: 'PM',
196
- am: 'am',
197
- pm: 'pm',
198
- formats: {
199
- c: '%a %d %b %Y %X %Z',
200
- D: '%d-%m-%Y',
201
- F: '%Y-%m-%d',
202
- R: '%H:%M',
203
- r: '%I:%M:%S %p',
204
- T: '%H:%M:%S',
205
- v: '%e-%b-%Y',
206
- X: '%T',
207
- x: '%D'
208
- }
209
- },
210
-
211
- ru_RU: {
212
- identifier: 'ru-RU',
213
- days: ['Воскресенье', 'Понедельник', 'Вторник', 'Среда', 'Четверг', 'Пятница', 'Суббота'],
214
- shortDays: ['Вс', 'Пн', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб'],
215
- months: ['Январь', 'Февраль', 'Март', 'Апрель', 'Май', 'Июнь', 'Июль', 'Август', 'Сентябрь', 'Октябрь', 'Ноябрь', 'Декабрь'],
216
- shortMonths: ['янв', 'фев', 'мар', 'апр', 'май', 'июн', 'июл', 'авг', 'сен', 'окт', 'ноя', 'дек'],
217
- AM: 'AM',
218
- PM: 'PM',
219
- am: 'am',
220
- pm: 'pm',
221
- formats: {
222
- c: '%a %d %b %Y %X',
223
- D: '%d.%m.%y',
224
- F: '%Y-%m-%d',
225
- R: '%H:%M',
226
- r: '%I:%M:%S %p',
227
- T: '%H:%M:%S',
228
- v: '%e-%b-%Y',
229
- X: '%T',
230
- x: '%D'
231
- }
232
- },
233
-
234
- tr_TR: {
235
- identifier: 'tr-TR',
236
- days: ['Pazar', 'Pazartesi', 'Salı', 'Çarşamba', 'Perşembe', 'Cuma', 'Cumartesi'],
237
- shortDays: ['Paz', 'Pzt', 'Sal', 'Çrş', 'Prş', 'Cum', 'Cts'],
238
- months: ['Ocak', 'Şubat', 'Mart', 'Nisan', 'Mayıs', 'Haziran', 'Temmuz', 'Ağustos', 'Eylül', 'Ekim', 'Kasım', 'Aralık'],
239
- shortMonths: ['Oca', 'Şub', 'Mar', 'Nis', 'May', 'Haz', 'Tem', 'Ağu', 'Eyl', 'Eki', 'Kas', 'Ara'],
240
- AM: 'ÖÖ',
241
- PM: 'ÖS',
242
- am: 'ÖÖ',
243
- pm: 'ÖS',
244
- formats: {
245
- c: '%a %d %b %Y %X %Z',
246
- D: '%d-%m-%Y',
247
- F: '%Y-%m-%d',
248
- R: '%H:%M',
249
- r: '%I:%M:%S %p',
250
- T: '%H:%M:%S',
251
- v: '%e-%b-%Y',
252
- X: '%T',
253
- x: '%D'
254
- }
255
- },
256
-
257
- // By michaeljayt<michaeljayt@gmail.com>
258
- // https://github.com/michaeljayt/strftime/commit/bcb4c12743811d51e568175aa7bff3fd2a77cef3
259
- zh_CN: {
260
- identifier: 'zh-CN',
261
- days: ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'],
262
- shortDays: ['日', '一', '二', '三', '四', '五', '六'],
263
- months: ['一月份', '二月份', '三月份', '四月份', '五月份', '六月份', '七月份', '八月份', '九月份', '十月份', '十一月份', '十二月份'],
264
- shortMonths: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
265
- AM: '上午',
266
- PM: '下午',
267
- am: '上午',
268
- pm: '下午',
269
- formats: {
270
- c: '%a %d %b %Y %X %Z',
271
- D: '%d/%m/%y',
272
- F: '%Y-%m-%d',
273
- R: '%H:%M',
274
- r: '%I:%M:%S %p',
275
- T: '%H:%M:%S',
276
- v: '%e-%b-%Y',
277
- X: '%r',
278
- x: '%D'
279
- }
280
- }
281
- };
282
-
283
- var DefaultLocale = Locales['en_US'],
284
- defaultStrftime = new Strftime(DefaultLocale, 0, false),
285
- isCommonJS = typeof module !== 'undefined',
286
- namespace;
287
-
288
- // CommonJS / Node module
289
- if (isCommonJS) {
290
- namespace = module.exports = defaultStrftime;
291
- }
292
- // Browsers and other environments
293
- else {
294
- // Get the global object. Works in ES3, ES5, and ES5 strict mode.
295
- namespace = (function () { return this || (1, eval)('this'); }());
296
- namespace.strftime = defaultStrftime;
297
- }
298
-
299
- // Polyfill Date.now for old browsers.
300
- if (typeof Date.now !== 'function') {
301
- Date.now = function () {
302
- return +new Date();
303
- };
304
- }
305
-
306
- function Strftime(locale, customTimezoneOffset, useUtcTimezone) {
307
- var _locale = locale || DefaultLocale,
308
- _customTimezoneOffset = customTimezoneOffset || 0,
309
- _useUtcBasedDate = useUtcTimezone || false,
310
-
311
- // we store unix timestamp value here to not create new Date() each iteration (each millisecond)
312
- // Date.now() is 2 times faster than new Date()
313
- // while millisecond precise is enough here
314
- // this could be very helpful when strftime triggered a lot of times one by one
315
- _cachedDateTimestamp = 0,
316
- _cachedDate;
317
-
318
- function _strftime(format, date) {
319
- var timestamp;
320
-
321
- if (!date) {
322
- var currentTimestamp = Date.now();
323
- if (currentTimestamp > _cachedDateTimestamp) {
324
- _cachedDateTimestamp = currentTimestamp;
325
- _cachedDate = new Date(_cachedDateTimestamp);
326
-
327
- timestamp = _cachedDateTimestamp;
328
-
329
- if (_useUtcBasedDate) {
330
- // how to avoid duplication of date instantiation for utc here?
331
- // we tied to getTimezoneOffset of the current date
332
- _cachedDate = new Date(_cachedDateTimestamp + getTimestampToUtcOffsetFor(_cachedDate) + _customTimezoneOffset);
333
- }
334
- }
335
- else {
336
- timestamp = _cachedDateTimestamp;
337
- }
338
- date = _cachedDate;
339
- }
340
- else {
341
- timestamp = date.getTime();
342
-
343
- if (_useUtcBasedDate) {
344
- var utcOffset = getTimestampToUtcOffsetFor(date);
345
- date = new Date(timestamp + utcOffset + _customTimezoneOffset);
346
- // If we've crossed a DST boundary with this calculation we need to
347
- // adjust the new date accordingly or it will be off by an hour in UTC.
348
- if (getTimestampToUtcOffsetFor(date) !== utcOffset) {
349
- var newUTCOffset = getTimestampToUtcOffsetFor(date);
350
- date = new Date(timestamp + newUTCOffset + _customTimezoneOffset);
351
- }
352
- }
353
- }
354
-
355
- return _processFormat(format, date, _locale, timestamp);
356
- }
357
-
358
- function _processFormat(format, date, locale, timestamp) {
359
- var resultString = '',
360
- padding = null,
361
- isInScope = false,
362
- length = format.length,
363
- extendedTZ = false;
364
-
365
- for (var i = 0; i < length; i++) {
366
-
367
- var currentCharCode = format.charCodeAt(i);
368
-
369
- if (isInScope === true) {
370
- // '-'
371
- if (currentCharCode === 45) {
372
- padding = '';
373
- continue;
374
- }
375
- // '_'
376
- else if (currentCharCode === 95) {
377
- padding = ' ';
378
- continue;
379
- }
380
- // '0'
381
- else if (currentCharCode === 48) {
382
- padding = '0';
383
- continue;
384
- }
385
- // ':'
386
- else if (currentCharCode === 58) {
387
- if (extendedTZ) {
388
- warn("[WARNING] detected use of unsupported %:: or %::: modifiers to strftime");
389
- }
390
- extendedTZ = true;
391
- continue;
392
- }
393
-
394
- switch (currentCharCode) {
395
-
396
- // Examples for new Date(0) in GMT
397
-
398
- // '%'
399
- // case '%':
400
- case 37:
401
- resultString += '%';
402
- break;
403
-
404
- // 'Thursday'
405
- // case 'A':
406
- case 65:
407
- resultString += locale.days[date.getDay()];
408
- break;
409
-
410
- // 'January'
411
- // case 'B':
412
- case 66:
413
- resultString += locale.months[date.getMonth()];
414
- break;
415
-
416
- // '19'
417
- // case 'C':
418
- case 67:
419
- resultString += padTill2(Math.floor(date.getFullYear() / 100), padding);
420
- break;
421
-
422
- // '01/01/70'
423
- // case 'D':
424
- case 68:
425
- resultString += _processFormat(locale.formats.D, date, locale, timestamp);
426
- break;
427
-
428
- // '1970-01-01'
429
- // case 'F':
430
- case 70:
431
- resultString += _processFormat(locale.formats.F, date, locale, timestamp);
432
- break;
433
-
434
- // '00'
435
- // case 'H':
436
- case 72:
437
- resultString += padTill2(date.getHours(), padding);
438
- break;
439
-
440
- // '12'
441
- // case 'I':
442
- case 73:
443
- resultString += padTill2(hours12(date.getHours()), padding);
444
- break;
445
-
446
- // '000'
447
- // case 'L':
448
- case 76:
449
- resultString += padTill3(Math.floor(timestamp % 1000));
450
- break;
451
-
452
- // '00'
453
- // case 'M':
454
- case 77:
455
- resultString += padTill2(date.getMinutes(), padding);
456
- break;
457
-
458
- // 'am'
459
- // case 'P':
460
- case 80:
461
- resultString += date.getHours() < 12 ? locale.am : locale.pm;
462
- break;
463
-
464
- // '00:00'
465
- // case 'R':
466
- case 82:
467
- resultString += _processFormat(locale.formats.R, date, locale, timestamp);
468
- break;
469
-
470
- // '00'
471
- // case 'S':
472
- case 83:
473
- resultString += padTill2(date.getSeconds(), padding);
474
- break;
475
-
476
- // '00:00:00'
477
- // case 'T':
478
- case 84:
479
- resultString += _processFormat(locale.formats.T, date, locale, timestamp);
480
- break;
481
-
482
- // '00'
483
- // case 'U':
484
- case 85:
485
- resultString += padTill2(weekNumber(date, 'sunday'), padding);
486
- break;
487
-
488
- // '00'
489
- // case 'W':
490
- case 87:
491
- resultString += padTill2(weekNumber(date, 'monday'), padding);
492
- break;
493
-
494
- // '16:00:00'
495
- // case 'X':
496
- case 88:
497
- resultString += _processFormat(locale.formats.X, date, locale, timestamp);
498
- break;
499
-
500
- // '1970'
501
- // case 'Y':
502
- case 89:
503
- resultString += date.getFullYear();
504
- break;
505
-
506
- // 'GMT'
507
- // case 'Z':
508
- case 90:
509
- if (_useUtcBasedDate && _customTimezoneOffset === 0) {
510
- resultString += "GMT";
511
- }
512
- else {
513
- var tzName = getTimezoneName(date);
514
- resultString += tzName || '';
515
- }
516
- break;
517
-
518
- // 'Thu'
519
- // case 'a':
520
- case 97:
521
- resultString += locale.shortDays[date.getDay()];
522
- break;
523
-
524
- // 'Jan'
525
- // case 'b':
526
- case 98:
527
- resultString += locale.shortMonths[date.getMonth()];
528
- break;
529
-
530
- // ''
531
- // case 'c':
532
- case 99:
533
- resultString += _processFormat(locale.formats.c, date, locale, timestamp);
534
- break;
535
-
536
- // '01'
537
- // case 'd':
538
- case 100:
539
- resultString += padTill2(date.getDate(), padding);
540
- break;
541
-
542
- // ' 1'
543
- // case 'e':
544
- case 101:
545
- resultString += padTill2(date.getDate(), padding == null ? ' ' : padding);
546
- break;
547
-
548
- // 'Jan'
549
- // case 'h':
550
- case 104:
551
- resultString += locale.shortMonths[date.getMonth()];
552
- break;
553
-
554
- // '000'
555
- // case 'j':
556
- case 106:
557
- var y = new Date(date.getFullYear(), 0, 1);
558
- var day = Math.ceil((date.getTime() - y.getTime()) / (1000 * 60 * 60 * 24));
559
- resultString += padTill3(day);
560
- break;
561
-
562
- // ' 0'
563
- // case 'k':
564
- case 107:
565
- resultString += padTill2(date.getHours(), padding == null ? ' ' : padding);
566
- break;
567
-
568
- // '12'
569
- // case 'l':
570
- case 108:
571
- resultString += padTill2(hours12(date.getHours()), padding == null ? ' ' : padding);
572
- break;
573
-
574
- // '01'
575
- // case 'm':
576
- case 109:
577
- resultString += padTill2(date.getMonth() + 1, padding);
578
- break;
579
-
580
- // '\n'
581
- // case 'n':
582
- case 110:
583
- resultString += '\n';
584
- break;
585
-
586
- // '1st'
587
- // case 'o':
588
- case 111:
589
- // Try to use an ordinal suffix from the locale, but fall back to using the old
590
- // function for compatibility with old locales that lack them.
591
- var day = date.getDate();
592
- if (locale.ordinalSuffixes) {
593
- resultString += String(day) + (locale.ordinalSuffixes[day - 1] || ordinal(day));
594
- }
595
- else {
596
- resultString += String(day) + ordinal(day);
597
- }
598
- break;
599
-
600
- // 'AM'
601
- // case 'p':
602
- case 112:
603
- resultString += date.getHours() < 12 ? locale.AM : locale.PM;
604
- break;
605
-
606
- // '12:00:00 AM'
607
- // case 'r':
608
- case 114:
609
- resultString += _processFormat(locale.formats.r, date, locale, timestamp);
610
- break;
611
-
612
- // '0'
613
- // case 's':
614
- case 115:
615
- resultString += Math.floor(timestamp / 1000);
616
- break;
617
-
618
- // '\t'
619
- // case 't':
620
- case 116:
621
- resultString += '\t';
622
- break;
623
-
624
- // '4'
625
- // case 'u':
626
- case 117:
627
- var day = date.getDay();
628
- resultString += day === 0 ? 7 : day;
629
- break; // 1 - 7, Monday is first day of the week
630
-
631
- // ' 1-Jan-1970'
632
- // case 'v':
633
- case 118:
634
- resultString += _processFormat(locale.formats.v, date, locale, timestamp);
635
- break;
636
-
637
- // '4'
638
- // case 'w':
639
- case 119:
640
- resultString += date.getDay();
641
- break; // 0 - 6, Sunday is first day of the week
642
-
643
- // '12/31/69'
644
- // case 'x':
645
- case 120:
646
- resultString += _processFormat(locale.formats.x, date, locale, timestamp);
647
- break;
648
-
649
- // '70'
650
- // case 'y':
651
- case 121:
652
- let year = date.getFullYear() % 100;
653
- resultString += padTill2(year, padding);
654
- break;
655
-
656
- // '+0000'
657
- // case 'z':
658
- case 122:
659
- if (_useUtcBasedDate && _customTimezoneOffset === 0) {
660
- resultString += extendedTZ ? "+00:00" : "+0000";
661
- }
662
- else {
663
- var off;
664
- if (_customTimezoneOffset !== 0) {
665
- off = _customTimezoneOffset / (60 * 1000);
666
- }
667
- else {
668
- off = -date.getTimezoneOffset();
669
- }
670
- var sign = off < 0 ? '-' : '+';
671
- var sep = extendedTZ ? ':' : '';
672
- var hours = Math.floor(Math.abs(off / 60));
673
- var mins = Math.abs(off % 60);
674
- resultString += sign + padTill2(hours) + sep + padTill2(mins);
675
- }
676
- break;
677
-
678
- default:
679
- if (isInScope) {
680
- resultString += '%';
681
- }
682
- resultString += format[i];
683
- break;
684
- }
685
-
686
- padding = null;
687
- isInScope = false;
688
- continue;
689
- }
690
-
691
- // '%'
692
- if (currentCharCode === 37) {
693
- isInScope = true;
694
- continue;
695
- }
696
-
697
- resultString += format[i];
698
- }
699
-
700
- return resultString;
701
- }
702
-
703
- var strftime = _strftime;
704
-
705
- strftime.localize = function (locale) {
706
- return new Strftime(locale || _locale, _customTimezoneOffset, _useUtcBasedDate);
707
- };
708
-
709
- strftime.localizeByIdentifier = function (localeIdentifier) {
710
- var locale = Locales[localeIdentifier];
711
- if (!locale) {
712
- warn('[WARNING] No locale found with identifier "' + localeIdentifier + '".');
713
- return strftime;
714
- }
715
- return strftime.localize(locale);
716
- };
717
-
718
- strftime.timezone = function (timezone) {
719
- var customTimezoneOffset = _customTimezoneOffset;
720
- var useUtcBasedDate = _useUtcBasedDate;
721
-
722
- var timezoneType = typeof timezone;
723
- if (timezoneType === 'number' || timezoneType === 'string') {
724
- useUtcBasedDate = true;
725
-
726
- // ISO 8601 format timezone string, [-+]HHMM
727
- if (timezoneType === 'string') {
728
- var sign = timezone[0] === '-' ? -1 : 1,
729
- hours = parseInt(timezone.slice(1, 3), 10),
730
- minutes = parseInt(timezone.slice(3, 5), 10);
731
-
732
- customTimezoneOffset = sign * ((60 * hours) + minutes) * 60 * 1000;
733
- // in minutes: 420
734
- }
735
- else if (timezoneType === 'number') {
736
- customTimezoneOffset = timezone * 60 * 1000;
737
- }
738
- }
739
-
740
- return new Strftime(_locale, customTimezoneOffset, useUtcBasedDate);
741
- };
742
-
743
- strftime.utc = function () {
744
- return new Strftime(_locale, _customTimezoneOffset, true);
745
- };
746
-
747
- return strftime;
748
- }
749
-
750
- function padTill2(numberToPad, paddingChar) {
751
- if (paddingChar === '' || numberToPad > 9) {
752
- return '' + numberToPad;
753
- }
754
- if (paddingChar == null) {
755
- paddingChar = '0';
756
- }
757
- return paddingChar + numberToPad;
758
- }
759
-
760
- function padTill3(numberToPad) {
761
- if (numberToPad > 99) {
762
- return numberToPad;
763
- }
764
- if (numberToPad > 9) {
765
- return '0' + numberToPad;
766
- }
767
- return '00' + numberToPad;
768
- }
769
-
770
- function hours12(hour) {
771
- if (hour === 0) {
772
- return 12;
773
- }
774
- else if (hour > 12) {
775
- return hour - 12;
776
- }
777
- return hour;
778
- }
779
-
780
- // firstWeekday: 'sunday' or 'monday', default is 'sunday'
781
- //
782
- // Pilfered & ported from Ruby's strftime implementation.
783
- function weekNumber(date, firstWeekday) {
784
- firstWeekday = firstWeekday || 'sunday';
785
-
786
- // This works by shifting the weekday back by one day if we
787
- // are treating Monday as the first day of the week.
788
- var weekday = date.getDay();
789
- if (firstWeekday === 'monday') {
790
- if (weekday === 0) // Sunday
791
- weekday = 6;
792
- else
793
- weekday--;
794
- }
795
-
796
- var firstDayOfYearUtc = Date.UTC(date.getFullYear(), 0, 1),
797
- dateUtc = Date.UTC(date.getFullYear(), date.getMonth(), date.getDate()),
798
- yday = Math.floor((dateUtc - firstDayOfYearUtc) / 86400000),
799
- weekNum = (yday + 7 - weekday) / 7;
800
-
801
- return Math.floor(weekNum);
802
- }
803
-
804
- // Get the ordinal suffix for a number: st, nd, rd, or th
805
- function ordinal(number) {
806
- var i = number % 10;
807
- var ii = number % 100;
808
-
809
- if ((ii >= 11 && ii <= 13) || i === 0 || i >= 4) {
810
- return 'th';
811
- }
812
- switch (i) {
813
- case 1: return 'st';
814
- case 2: return 'nd';
815
- case 3: return 'rd';
816
- }
817
- }
818
-
819
- function getTimestampToUtcOffsetFor(date) {
820
- return (date.getTimezoneOffset() || 0) * 60000;
821
- }
822
-
823
- // Tries to get a short timezone name using Date.toLocaleString, falling back on the platform default
824
- // using Date.toString if necessary.
825
- function getTimezoneName(date, localeIdentifier) {
826
- return getShortTimezoneName(date, localeIdentifier) || getDefaultTimezoneName(date);
827
- }
828
-
829
- // Unfortunately this returns GMT+2 when running with `TZ=Europe/Amsterdam node test.js` so it's not
830
- // perfect.
831
- function getShortTimezoneName(date, localeIdentifier) {
832
- if (localeIdentifier == null) return null;
833
-
834
- var tzString = date
835
- .toLocaleString(localeIdentifier, { timeZoneName: 'short' })
836
- .match(/\s([\w]+)$/);
837
- return tzString && tzString[1];
838
- }
839
-
840
- // This varies by platform so it's not an ideal way to get the time zone name. On most platforms it's
841
- // a short name but in Node v10+ and Chrome 66+ it's a long name now. Prefer getShortTimezoneName(date)
842
- // where possible.
843
- function getDefaultTimezoneName(date) {
844
- var tzString = date.toString().match(/\(([\w\s]+)\)/);
845
- return tzString && tzString[1];
846
- }
847
-
848
- function warn(message) {
849
- if (typeof console !== 'undefined' && typeof console.warn == 'function') {
850
- console.warn(message)
851
- }
852
- }
853
-
854
- }());