step-node-agent 3.26.2 → 3.26.4

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.
@@ -5,6 +5,18 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [v1.13.3](https://github.com/inspect-js/object-inspect/compare/v1.13.2...v1.13.3) - 2024-11-09
9
+
10
+ ### Commits
11
+
12
+ - [actions] split out node 10-20, and 20+ [`44395a8`](https://github.com/inspect-js/object-inspect/commit/44395a8fc1deda6718a5e125e86b9ffcaa1c7580)
13
+ - [Fix] `quoteStyle`: properly escape only the containing quotes [`5137f8f`](https://github.com/inspect-js/object-inspect/commit/5137f8f7bea69a7fc671bb683fd35f244f38fc52)
14
+ - [Refactor] clean up `quoteStyle` code [`450680c`](https://github.com/inspect-js/object-inspect/commit/450680cd50de4e689ee3b8e1d6db3a1bcf3fc18c)
15
+ - [Tests] add `quoteStyle` escaping tests [`e997c59`](https://github.com/inspect-js/object-inspect/commit/e997c595aeaea84fd98ca35d7e1c3b5ab3ae26e0)
16
+ - [Dev Deps] update `auto-changelog`, `es-value-fixtures`, `tape` [`d5a469c`](https://github.com/inspect-js/object-inspect/commit/d5a469c99ec07ccaeafc36ac4b36a93285086d48)
17
+ - [Tests] replace `aud` with `npm audit` [`fb7815f`](https://github.com/inspect-js/object-inspect/commit/fb7815f9b72cae277a04f65bbb0543f85b88be62)
18
+ - [Dev Deps] update `mock-property` [`11c817b`](https://github.com/inspect-js/object-inspect/commit/11c817bf10392aa017755962ba6bc89d731359ee)
19
+
8
20
  ## [v1.13.2](https://github.com/inspect-js/object-inspect/compare/v1.13.1...v1.13.2) - 2024-06-21
9
21
 
10
22
  ### Commits
@@ -69,10 +69,21 @@ var utilInspect = require('./util.inspect');
69
69
  var inspectCustom = utilInspect.custom;
70
70
  var inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null;
71
71
 
72
+ var quotes = {
73
+ __proto__: null,
74
+ 'double': '"',
75
+ single: "'"
76
+ };
77
+ var quoteREs = {
78
+ __proto__: null,
79
+ 'double': /(["\\])/g,
80
+ single: /(['\\])/g
81
+ };
82
+
72
83
  module.exports = function inspect_(obj, options, depth, seen) {
73
84
  var opts = options || {};
74
85
 
75
- if (has(opts, 'quoteStyle') && (opts.quoteStyle !== 'single' && opts.quoteStyle !== 'double')) {
86
+ if (has(opts, 'quoteStyle') && !has(quotes, opts.quoteStyle)) {
76
87
  throw new TypeError('option "quoteStyle" must be "single" or "double"');
77
88
  }
78
89
  if (
@@ -267,7 +278,8 @@ module.exports = function inspect_(obj, options, depth, seen) {
267
278
  };
268
279
 
269
280
  function wrapQuotes(s, defaultStyle, opts) {
270
- var quoteChar = (opts.quoteStyle || defaultStyle) === 'double' ? '"' : "'";
281
+ var style = opts.quoteStyle || defaultStyle;
282
+ var quoteChar = quotes[style];
271
283
  return quoteChar + s + quoteChar;
272
284
  }
273
285
 
@@ -425,8 +437,10 @@ function inspectString(str, opts) {
425
437
  var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : '');
426
438
  return inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer;
427
439
  }
440
+ var quoteRE = quoteREs[opts.quoteStyle || 'single'];
441
+ quoteRE.lastIndex = 0;
428
442
  // eslint-disable-next-line no-control-regex
429
- var s = $replace.call($replace.call(str, /(['\\])/g, '\\$1'), /[\x00-\x1f]/g, lowbyte);
443
+ var s = $replace.call($replace.call(str, quoteRE, '\\$1'), /[\x00-\x1f]/g, lowbyte);
430
444
  return wrapQuotes(s, 'single', opts);
431
445
  }
432
446
 
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "object-inspect",
3
- "version": "1.13.2",
3
+ "version": "1.13.3",
4
4
  "description": "string representations of objects in node and the browser",
5
5
  "main": "index.js",
6
6
  "sideEffects": false,
7
7
  "devDependencies": {
8
8
  "@ljharb/eslint-config": "^21.1.1",
9
9
  "@pkgjs/support": "^0.0.6",
10
- "auto-changelog": "^2.4.0",
10
+ "auto-changelog": "^2.5.0",
11
11
  "core-js": "^2.6.12",
12
12
  "error-cause": "^1.0.8",
13
- "es-value-fixtures": "^1.4.2",
13
+ "es-value-fixtures": "^1.5.0",
14
14
  "eslint": "=8.8.0",
15
15
  "for-each": "^0.3.3",
16
16
  "functions-have-names": "^1.2.3",
@@ -21,13 +21,13 @@
21
21
  "in-publish": "^2.0.1",
22
22
  "jackspeak": "=2.1.1",
23
23
  "make-arrow-function": "^1.2.0",
24
- "mock-property": "^1.0.3",
24
+ "mock-property": "^1.1.0",
25
25
  "npmignore": "^0.3.1",
26
26
  "nyc": "^10.3.2",
27
27
  "safe-publish-latest": "^2.0.0",
28
28
  "safer-buffer": "^2.1.2",
29
29
  "string.prototype.repeat": "^1.0.0",
30
- "tape": "^5.8.1"
30
+ "tape": "^5.9.0"
31
31
  },
32
32
  "scripts": {
33
33
  "prepack": "npmignore --auto --commentLines=autogenerated",
@@ -39,7 +39,7 @@
39
39
  "test": "npm run tests-only && npm run test:corejs",
40
40
  "tests-only": "nyc tape 'test/*.js'",
41
41
  "test:corejs": "nyc tape test-core-js.js 'test/*.js'",
42
- "posttest": "npx aud --production",
42
+ "posttest": "npx npm@'>=10.2' audit --production",
43
43
  "version": "auto-changelog && git add CHANGELOG.md",
44
44
  "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""
45
45
  },
@@ -13,5 +13,14 @@ test('quoteStyle option', function (t) {
13
13
  t['throws'](function () { inspect(null, { quoteStyle: NaN }); }, 'NaN is not a valid value');
14
14
  t['throws'](function () { inspect(null, { quoteStyle: function () {} }); }, 'a function is not a valid value');
15
15
 
16
+ t.equal(inspect('"', { quoteStyle: 'single' }), '\'"\'', 'double quote, quoteStyle: "single"');
17
+ t.equal(inspect('"', { quoteStyle: 'double' }), '"\\""', 'double quote, quoteStyle: "double"');
18
+
19
+ t.equal(inspect('\'', { quoteStyle: 'single' }), '\'\\\'\'', 'single quote, quoteStyle: "single"');
20
+ t.equal(inspect('\'', { quoteStyle: 'double' }), '"\'"', 'single quote, quoteStyle: "double"');
21
+
22
+ t.equal(inspect('`', { quoteStyle: 'single' }), '\'`\'', 'backtick, quoteStyle: "single"');
23
+ t.equal(inspect('`', { quoteStyle: 'double' }), '"`"', 'backtick, quoteStyle: "double"');
24
+
16
25
  t.end();
17
26
  });
@@ -30,25 +30,74 @@ Source: http://publicsuffix.org
30
30
 
31
31
  ## Installation
32
32
 
33
+ This module is available both for Node.js and the browser. See below for more
34
+ details.
35
+
33
36
  ### Node.js
34
37
 
35
38
  ```sh
36
- npm install --save psl
39
+ npm install psl
40
+ ```
41
+
42
+ #### ESM
43
+
44
+ From version `v1.11.0` you can now import `psl` as ESM.
45
+
46
+ ```js
47
+ import psl from 'psl';
48
+ ```
49
+
50
+ #### CommonJS
51
+
52
+ If your project still uses CommonJS on Node.js v12 or later (with support for
53
+ conditional exports), you can continue importing the module like in previous
54
+ versions.
55
+
56
+ ```js
57
+ const psl = require('psl');
58
+ ```
59
+
60
+ ⚠️ If you are using Node.js v10 or older (😰), you can still use the latest
61
+ version of this module, but you will need to import the bundled UMD.
62
+
63
+ ```js
64
+ var psl = require('psl/dist/psl.umd.cjs');
37
65
  ```
38
66
 
39
67
  ### Browser
40
68
 
41
- Download [psl.min.js](https://raw.githubusercontent.com/lupomontero/psl/master/dist/psl.min.js)
69
+ #### Using a bundler
70
+
71
+ If you are using a bundler to build your app, you should be able to `import`
72
+ and/or `require` the module just like in Node.js.
73
+
74
+ #### ESM (using a CDN)
75
+
76
+ In modern browsers you can also import the ESM directly from a `CDN`. For
77
+ example:
78
+
79
+ ```js
80
+ import psl from 'https://unpkg.com/psl@latest/dist/psl.mjs';
81
+ ```
82
+
83
+ #### UMD / CommonJS
84
+
85
+ Finally, you can still download [`dist/psl.umd.cjs`](https://raw.githubusercontent.com/lupomontero/psl/main/dist/psl.umd.cjs)
42
86
  and include it in a script tag.
43
87
 
44
88
  ```html
45
- <script src="psl.min.js"></script>
89
+ <script src="psl.umd.cjs"></script>
46
90
  ```
47
91
 
48
- This script is browserified and wrapped in a [umd](https://github.com/umdjs/umd)
92
+ This script is bundled and wrapped in a [umd](https://github.com/umdjs/umd)
49
93
  wrapper so you should be able to use it standalone or together with a module
50
94
  loader.
51
95
 
96
+ The script is also available on most popular CDNs. For example:
97
+
98
+ * https://cdnjs.cloudflare.com/ajax/libs/psl/latest/psl.min.js
99
+ * https://unpkg.com/psl@latest/dist/psl.min.js
100
+
52
101
  ## API
53
102
 
54
103
  ### `psl.parse(domain)`
@@ -61,27 +110,38 @@ properties:
61
110
  * `domain`: The domain name is the `sld` + `tld`.
62
111
  * `subdomain`: Optional parts left of the domain.
63
112
 
64
- #### Example:
113
+ #### Examples
114
+
115
+ Parse domain without subdomain:
65
116
 
66
117
  ```js
67
- var psl = require('psl');
118
+ import psl from 'psl';
68
119
 
69
- // Parse domain without subdomain
70
- var parsed = psl.parse('google.com');
120
+ const parsed = psl.parse('google.com');
71
121
  console.log(parsed.tld); // 'com'
72
122
  console.log(parsed.sld); // 'google'
73
123
  console.log(parsed.domain); // 'google.com'
74
124
  console.log(parsed.subdomain); // null
125
+ ```
126
+
127
+ Parse domain with subdomain:
75
128
 
76
- // Parse domain with subdomain
77
- var parsed = psl.parse('www.google.com');
129
+ ```js
130
+ import psl from 'psl';
131
+
132
+ const parsed = psl.parse('www.google.com');
78
133
  console.log(parsed.tld); // 'com'
79
134
  console.log(parsed.sld); // 'google'
80
135
  console.log(parsed.domain); // 'google.com'
81
136
  console.log(parsed.subdomain); // 'www'
137
+ ```
82
138
 
83
- // Parse domain with nested subdomains
84
- var parsed = psl.parse('a.b.c.d.foo.com');
139
+ Parse domain with nested subdomains:
140
+
141
+ ```js
142
+ import psl from 'psl';
143
+
144
+ const parsed = psl.parse('a.b.c.d.foo.com');
85
145
  console.log(parsed.tld); // 'com'
86
146
  console.log(parsed.sld); // 'foo'
87
147
  console.log(parsed.domain); // 'foo.com'
@@ -92,10 +152,10 @@ console.log(parsed.subdomain); // 'a.b.c.d'
92
152
 
93
153
  Get domain name, `sld` + `tld`. Returns `null` if not valid.
94
154
 
95
- #### Example:
155
+ #### Examples
96
156
 
97
157
  ```js
98
- var psl = require('psl');
158
+ import psl from 'psl';
99
159
 
100
160
  // null input.
101
161
  psl.get(null); // null
@@ -148,36 +208,33 @@ whether the domain has a valid Public Suffix.
148
208
  #### Example
149
209
 
150
210
  ```js
151
- var psl = require('psl');
211
+ import psl from 'psl';
152
212
 
153
213
  psl.isValid('google.com'); // true
154
214
  psl.isValid('www.google.com'); // true
155
215
  psl.isValid('x.yz'); // false
156
216
  ```
157
217
 
158
-
159
218
  ## Testing and Building
160
219
 
161
- Test are written using [`mocha`](https://mochajs.org/) and can be
162
- run in two different environments: `node` and `phantomjs`.
220
+ There are tests both for Node.js and the browser (using [Playwright](https://playwright.dev)
221
+ and [BrowserStack](https://www.browserstack.com/)).
163
222
 
164
223
  ```sh
165
- # This will run `eslint`, `mocha` and `karma`.
224
+ # Run tests in node.
166
225
  npm test
226
+ # Run tests in browserstack.
227
+ npm run test:browserstack
167
228
 
168
- # Individual test environments
169
- # Run tests in node only.
170
- ./node_modules/.bin/mocha test
171
- # Run tests in phantomjs only.
172
- ./node_modules/.bin/karma start ./karma.conf.js --single-run
229
+ # Update rules from publicsuffix.org
230
+ npm run update-rules
173
231
 
174
- # Build data (parse raw list) and create dist files
232
+ # Build ESM, CJS and UMD and create dist files
175
233
  npm run build
176
234
  ```
177
235
 
178
236
  Feel free to fork if you see possible improvements!
179
237
 
180
-
181
238
  ## Acknowledgements
182
239
 
183
240
  * Mozilla Foundation's [Public Suffix List](https://publicsuffix.org/)
@@ -185,12 +242,11 @@ Feel free to fork if you see possible improvements!
185
242
  test data.
186
243
  * Inspired by [weppos/publicsuffix-ruby](https://github.com/weppos/publicsuffix-ruby)
187
244
 
188
-
189
245
  ## License
190
246
 
191
247
  The MIT License (MIT)
192
248
 
193
- Copyright (c) 2017 Lupo Montero <lupomontero@gmail.com>
249
+ Copyright (c) 2014-2024 Lupo Montero <lupomontero@gmail.com>
194
250
 
195
251
  Permission is hereby granted, free of charge, to any person obtaining a copy
196
252
  of this software and associated documentation files (the "Software"), to deal