Sitelet https://github.com/npm/cli/commit/52c9608e7bb1cda396b2cef3fc1b48dbaa2b7de3
Skip to content

Commit 52c9608

Browse files
wraithgarruyadorno
authored andcommitted
deps: pacote@12.0.3
1 parent b28ad38 commit 52c9608

45 files changed

Lines changed: 2785 additions & 75 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎node_modules/negotiator/HISTORY.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
0.6.3 / 2022-01-22
2+
==================
3+
4+
* Revert "Lazy-load modules from main entry point"
5+
16
0.6.2 / 2019-04-29
27
==================
38

‎node_modules/negotiator/index.js‎

Lines changed: 4 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,10 @@
88

99
'use strict';
1010

11-
/**
12-
* Cached loaded submodules.
13-
* @private
14-
*/
15-
16-
var modules = Object.create(null);
11+
var preferredCharsets = require('./lib/charset')
12+
var preferredEncodings = require('./lib/encoding')
13+
var preferredLanguages = require('./lib/language')
14+
var preferredMediaTypes = require('./lib/mediaType')
1715

1816
/**
1917
* Module exports.
@@ -43,7 +41,6 @@ Negotiator.prototype.charset = function charset(available) {
4341
};
4442

4543
Negotiator.prototype.charsets = function charsets(available) {
46-
var preferredCharsets = loadModule('charset').preferredCharsets;
4744
return preferredCharsets(this.request.headers['accept-charset'], available);
4845
};
4946

@@ -53,7 +50,6 @@ Negotiator.prototype.encoding = function encoding(available) {
5350
};
5451

5552
Negotiator.prototype.encodings = function encodings(available) {
56-
var preferredEncodings = loadModule('encoding').preferredEncodings;
5753
return preferredEncodings(this.request.headers['accept-encoding'], available);
5854
};
5955

@@ -63,7 +59,6 @@ Negotiator.prototype.language = function language(available) {
6359
};
6460

6561
Negotiator.prototype.languages = function languages(available) {
66-
var preferredLanguages = loadModule('language').preferredLanguages;
6762
return preferredLanguages(this.request.headers['accept-language'], available);
6863
};
6964

@@ -73,7 +68,6 @@ Negotiator.prototype.mediaType = function mediaType(available) {
7368
};
7469

7570
Negotiator.prototype.mediaTypes = function mediaTypes(available) {
76-
var preferredMediaTypes = loadModule('mediaType').preferredMediaTypes;
7771
return preferredMediaTypes(this.request.headers.accept, available);
7872
};
7973

@@ -86,39 +80,3 @@ Negotiator.prototype.preferredLanguage = Negotiator.prototype.language;
8680
Negotiator.prototype.preferredLanguages = Negotiator.prototype.languages;
8781
Negotiator.prototype.preferredMediaType = Negotiator.prototype.mediaType;
8882
Negotiator.prototype.preferredMediaTypes = Negotiator.prototype.mediaTypes;
89-
90-
/**
91-
* Load the given module.
92-
* @private
93-
*/
94-
95-
function loadModule(moduleName) {
96-
var module = modules[moduleName];
97-
98-
if (module !== undefined) {
99-
return module;
100-
}
101-
102-
// This uses a switch for static require analysis
103-
switch (moduleName) {
104-
case 'charset':
105-
module = require('./lib/charset');
106-
break;
107-
case 'encoding':
108-
module = require('./lib/encoding');
109-
break;
110-
case 'language':
111-
module = require('./lib/language');
112-
break;
113-
case 'mediaType':
114-
module = require('./lib/mediaType');
115-
break;
116-
default:
117-
throw new Error('Cannot find module \'' + moduleName + '\'');
118-
}
119-
120-
// Store to prevent invoking require()
121-
modules[moduleName] = module;
122-
123-
return module;
124-
}

‎node_modules/negotiator/lib/language.js‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ function parseLanguage(str, i) {
5454
var match = simpleLanguageRegExp.exec(str);
5555
if (!match) return null;
5656

57-
var prefix = match[1],
58-
suffix = match[2],
59-
full = prefix;
57+
var prefix = match[1]
58+
var suffix = match[2]
59+
var full = prefix
6060

6161
if (suffix) full += "-" + suffix;
6262

‎node_modules/negotiator/package.json‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "negotiator",
33
"description": "HTTP content negotiation",
4-
"version": "0.6.2",
4+
"version": "0.6.3",
55
"contributors": [
66
"Douglas Christopher Wilson <doug@somethingdoug.com>",
77
"Federico Romero <federico.romero@outboxlabs.com>",
@@ -18,10 +18,10 @@
1818
],
1919
"repository": "jshttp/negotiator",
2020
"devDependencies": {
21-
"eslint": "5.16.0",
22-
"eslint-plugin-markdown": "1.0.0",
23-
"mocha": "6.1.4",
24-
"nyc": "14.0.0"
21+
"eslint": "7.32.0",
22+
"eslint-plugin-markdown": "2.2.1",
23+
"mocha": "9.1.3",
24+
"nyc": "15.1.0"
2525
},
2626
"files": [
2727
"lib/",
@@ -34,9 +34,9 @@
3434
"node": ">= 0.6"
3535
},
3636
"scripts": {
37-
"lint": "eslint --plugin markdown --ext js,md .",
37+
"lint": "eslint .",
3838
"test": "mocha --reporter spec --check-leaks --bail test/",
39-
"test-cov": "nyc --reporter=html --reporter=text npm test",
40-
"test-travis": "nyc --reporter=text npm test"
39+
"test-ci": "nyc --reporter=lcov --reporter=text npm test",
40+
"test-cov": "nyc --reporter=html --reporter=text npm test"
4141
}
4242
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2020 Nathan Rajlich
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/// <reference types="node" />
2+
import { EventEmitter } from 'events';
3+
import { EventNames, EventListenerParameters, AbortSignal } from './types';
4+
export interface OnceOptions {
5+
signal?: AbortSignal;
6+
}
7+
export default function once<Emitter extends EventEmitter, Event extends EventNames<Emitter>>(emitter: Emitter, name: Event, { signal }?: OnceOptions): Promise<EventListenerParameters<Emitter, Event>>;
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
"use strict";
2+
Object.defineProperty(exports, "__esModule", { value: true });
3+
function once(emitter, name, { signal } = {}) {
4+
return new Promise((resolve, reject) => {
5+
function cleanup() {
6+
signal === null || signal === void 0 ? void 0 : signal.removeEventListener('abort', cleanup);
7+
emitter.removeListener(name, onEvent);
8+
emitter.removeListener('error', onError);
9+
}
10+
function onEvent(...args) {
11+
cleanup();
12+
resolve(args);
13+
}
14+
function onError(err) {
15+
cleanup();
16+
reject(err);
17+
}
18+
signal === null || signal === void 0 ? void 0 : signal.addEventListener('abort', cleanup);
19+
emitter.on(name, onEvent);
20+
emitter.on('error', onError);
21+
});
22+
}
23+
exports.default = once;
24+
//# sourceMappingURL=index.js.map
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AAOA,SAAwB,IAAI,CAI3B,OAAgB,EAChB,IAAW,EACX,EAAE,MAAM,KAAkB,EAAE;IAE5B,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACtC,SAAS,OAAO;YACf,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YAC9C,OAAO,CAAC,cAAc,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;YACtC,OAAO,CAAC,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAC1C,CAAC;QACD,SAAS,OAAO,CAAC,GAAG,IAAW;YAC9B,OAAO,EAAE,CAAC;YACV,OAAO,CAAC,IAA+C,CAAC,CAAC;QAC1D,CAAC;QACD,SAAS,OAAO,CAAC,GAAU;YAC1B,OAAO,EAAE,CAAC;YACV,MAAM,CAAC,GAAG,CAAC,CAAC;QACb,CAAC;QACD,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,gBAAgB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAC3C,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAC1B,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC9B,CAAC,CAAC,CAAC;AACJ,CAAC;AA1BD,uBA0BC"}

0 commit comments

Comments
 (0)