terser 1.1.13 → 1.1.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +96 -2
- data/CHANGELOG.md +8 -0
- data/Gemfile +3 -3
- data/README.md +1 -0
- data/lib/terser/compressor.rb +1 -1
- data/lib/terser/version.rb +1 -1
- data/lib/terser.js +1 -1
- data/lib/terser.rb +6 -5
- data/terser.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e669fb4af1f437e4bcf6adf48ee2223039a942e757994c37a22c7418515807be
|
4
|
+
data.tar.gz: 7bba4cb3490018df58e45e7f50c1ec0ab4fb4b6ab3c35d188b1bfed04a45c678
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b323d67dc5cfb560ffd2d191443b042afb04a372d4f22971d3fa260ecbebecad642338a68598f7f13f951815330d86446d3bd90151abaaf073f75222c4ac904d
|
7
|
+
data.tar.gz: d82c6b0a3920ed823f2578ca99b89b07f577149d339962f061d2d891de4cac5272b89d9572047e80784da599d6413911c577800b8f300ae85bed2100b91d79c4
|
data/.rubocop.yml
CHANGED
@@ -174,8 +174,6 @@ Lint/EmptyClass:
|
|
174
174
|
Enabled: true
|
175
175
|
Style/NilLambda:
|
176
176
|
Enabled: true
|
177
|
-
Gemspec/DateAssignment: # (new in 1.10)
|
178
|
-
Enabled: true
|
179
177
|
Layout/LineEndStringConcatenationIndentation: # (new in 1.18)
|
180
178
|
Enabled: true
|
181
179
|
Layout/SpaceBeforeBrackets: # (new in 1.7)
|
@@ -220,6 +218,98 @@ Style/RedundantArgument: # (new in 1.4)
|
|
220
218
|
Enabled: true
|
221
219
|
Style/StringChars: # (new in 1.12)
|
222
220
|
Enabled: true
|
221
|
+
Gemspec/DeprecatedAttributeAssignment: # new in 1.30
|
222
|
+
Enabled: true
|
223
|
+
Gemspec/DevelopmentDependencies: # new in 1.44
|
224
|
+
Enabled: true
|
225
|
+
Gemspec/RequireMFA: # new in 1.23
|
226
|
+
Enabled: true
|
227
|
+
Layout/LineContinuationLeadingSpace: # new in 1.31
|
228
|
+
Enabled: true
|
229
|
+
Layout/LineContinuationSpacing: # new in 1.31
|
230
|
+
Enabled: true
|
231
|
+
Lint/AmbiguousOperatorPrecedence: # new in 1.21
|
232
|
+
Enabled: true
|
233
|
+
Lint/AmbiguousRange: # new in 1.19
|
234
|
+
Enabled: true
|
235
|
+
Lint/ConstantOverwrittenInRescue: # new in 1.31
|
236
|
+
Enabled: true
|
237
|
+
Lint/DuplicateMagicComment: # new in 1.37
|
238
|
+
Enabled: true
|
239
|
+
Lint/IncompatibleIoSelectWithFiberScheduler: # new in 1.21
|
240
|
+
Enabled: true
|
241
|
+
Lint/NonAtomicFileOperation: # new in 1.31
|
242
|
+
Enabled: true
|
243
|
+
Lint/RefinementImportMethods: # new in 1.27
|
244
|
+
Enabled: true
|
245
|
+
Lint/RequireRangeParentheses: # new in 1.32
|
246
|
+
Enabled: true
|
247
|
+
Lint/RequireRelativeSelfPath: # new in 1.22
|
248
|
+
Enabled: true
|
249
|
+
Lint/UselessRescue: # new in 1.43
|
250
|
+
Enabled: true
|
251
|
+
Lint/UselessRuby2Keywords: # new in 1.23
|
252
|
+
Enabled: true
|
253
|
+
Naming/BlockForwarding: # new in 1.24
|
254
|
+
Enabled: true
|
255
|
+
Security/CompoundHash: # new in 1.28
|
256
|
+
Enabled: true
|
257
|
+
Security/IoMethods: # new in 1.22
|
258
|
+
Enabled: true
|
259
|
+
Style/ArrayIntersect: # new in 1.40
|
260
|
+
Enabled: true
|
261
|
+
Style/ComparableClamp: # new in 1.44
|
262
|
+
Enabled: true
|
263
|
+
Style/ConcatArrayLiterals: # new in 1.41
|
264
|
+
Enabled: true
|
265
|
+
Style/EmptyHeredoc: # new in 1.32
|
266
|
+
Enabled: true
|
267
|
+
Style/EnvHome: # new in 1.29
|
268
|
+
Enabled: true
|
269
|
+
Style/FetchEnvVar: # new in 1.28
|
270
|
+
Enabled: true
|
271
|
+
Style/FileRead: # new in 1.24
|
272
|
+
Enabled: true
|
273
|
+
Style/FileWrite: # new in 1.24
|
274
|
+
Enabled: true
|
275
|
+
Style/MagicCommentFormat: # new in 1.35
|
276
|
+
Enabled: true
|
277
|
+
Style/MapCompactWithConditionalBlock: # new in 1.30
|
278
|
+
Enabled: true
|
279
|
+
Style/MapToHash: # new in 1.24
|
280
|
+
Enabled: true
|
281
|
+
Style/MapToSet: # new in 1.42
|
282
|
+
Enabled: true
|
283
|
+
Style/MinMaxComparison: # new in 1.42
|
284
|
+
Enabled: true
|
285
|
+
Style/NestedFileDirname: # new in 1.26
|
286
|
+
Enabled: true
|
287
|
+
Style/NumberedParameters: # new in 1.22
|
288
|
+
Enabled: true
|
289
|
+
Style/NumberedParametersLimit: # new in 1.22
|
290
|
+
Enabled: true
|
291
|
+
Style/ObjectThen: # new in 1.28
|
292
|
+
Enabled: true
|
293
|
+
Style/OpenStructUse: # new in 1.23
|
294
|
+
Enabled: true
|
295
|
+
Style/OperatorMethodCall: # new in 1.37
|
296
|
+
Enabled: true
|
297
|
+
Style/RedundantConstantBase: # new in 1.40
|
298
|
+
Enabled: true
|
299
|
+
Style/RedundantDoubleSplatHashBraces: # new in 1.41
|
300
|
+
Enabled: true
|
301
|
+
Style/RedundantEach: # new in 1.38
|
302
|
+
Enabled: true
|
303
|
+
Style/RedundantHeredocDelimiterQuotes: # new in 1.45
|
304
|
+
Enabled: true
|
305
|
+
Style/RedundantInitialize: # new in 1.27
|
306
|
+
Enabled: true
|
307
|
+
Style/RedundantSelfAssignmentBranch: # new in 1.19
|
308
|
+
Enabled: true
|
309
|
+
Style/RedundantStringEscape: # new in 1.37
|
310
|
+
Enabled: true
|
311
|
+
Style/SelectByRegexp: # new in 1.22
|
312
|
+
Enabled: true
|
223
313
|
|
224
314
|
Performance/AncestorsInclude:
|
225
315
|
Enabled: true
|
@@ -255,3 +345,7 @@ Performance/RedundantEqualityComparisonBlock: # (new in 1.10)
|
|
255
345
|
Enabled: true
|
256
346
|
Performance/RedundantSplitRegexpArgument: # (new in 1.10)
|
257
347
|
Enabled: true
|
348
|
+
Performance/ConcurrentMonotonicTime: # new in 1.12
|
349
|
+
Enabled: true
|
350
|
+
Performance/StringIdentifierArgument: # new in 1.13
|
351
|
+
Enabled: true
|
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,12 @@
|
|
1
1
|
## Unreleased
|
2
|
+
## 1.1.15 (09 May 2023)
|
3
|
+
- update TerserJS to [5.17.3]
|
4
|
+
- add lhs_constants (default is true)
|
5
|
+
|
6
|
+
## 1.1.14 (24 February 2023)
|
7
|
+
- update TerserJS to [5.16.5]
|
8
|
+
- update Rubocop
|
9
|
+
|
2
10
|
## 1.1.13 (03 December 2022)
|
3
11
|
- update TerserJS to [5.16.1]
|
4
12
|
|
data/Gemfile
CHANGED
@@ -4,9 +4,9 @@ source "https://rubygems.org"
|
|
4
4
|
|
5
5
|
gemspec
|
6
6
|
|
7
|
-
unless RUBY_VERSION < '2.
|
7
|
+
unless RUBY_VERSION < '2.6'
|
8
8
|
group :development do
|
9
|
-
gem 'rubocop', '~> 1.
|
10
|
-
gem 'rubocop-performance', '~> 1.
|
9
|
+
gem 'rubocop', '~> 1.46.0'
|
10
|
+
gem 'rubocop-performance', '~> 1.16.0', :require => false
|
11
11
|
end
|
12
12
|
end
|
data/README.md
CHANGED
@@ -130,6 +130,7 @@ Available options and their defaults are
|
|
130
130
|
:keep_fnames => false, # Do not drop names in function definitions
|
131
131
|
:passes => 1, # Number of times to run compress. Raising the number of passes will increase compress time, but can produce slightly smaller code.
|
132
132
|
:keep_infinity => false, # Prevent compression of Infinity to 1/0
|
133
|
+
:lhs_constants => true, # Moves constant values to the left-hand side of binary nodes. `foo == 42 → 42 == foo`
|
133
134
|
:side_effects => true, # Pass false to disable potentially dropping functions marked as "pure" using pure comment annotation. See UglifyJS documentation for details.
|
134
135
|
:switches => true, # de-duplicate and remove unreachable switch branches
|
135
136
|
}, # Apply transformations to code, set to false to skip
|
data/lib/terser/compressor.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'sprockets/digest_utils'
|
4
|
-
require 'sprockets/source_map_utils' if Gem::Version.new(
|
4
|
+
require 'sprockets/source_map_utils' if Gem::Version.new(Sprockets::VERSION) >= Gem::Version.new('4.x')
|
5
5
|
|
6
6
|
class Terser
|
7
7
|
# A wrapper for Sprockets
|
data/lib/terser/version.rb
CHANGED