mirror of
https://github.com/xfarrow/blink
synced 2025-06-27 09:03:02 +02:00
Change endpoint from persons to people
This commit is contained in:
12
backend/apis/nodejs/node_modules/rechoir/CHANGELOG.md
generated
vendored
Normal file
12
backend/apis/nodejs/node_modules/rechoir/CHANGELOG.md
generated
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
# Changelog
|
||||
|
||||
## [0.8.0](https://www.github.com/gulpjs/rechoir/compare/v0.7.1...v0.8.0) (2021-07-24)
|
||||
|
||||
|
||||
### ⚠ BREAKING CHANGES
|
||||
|
||||
* Normalize repository, dropping node <10.13 support (#40)
|
||||
|
||||
### Miscellaneous Chores
|
||||
|
||||
* Normalize repository, dropping node <10.13 support ([#40](https://www.github.com/gulpjs/rechoir/issues/40)) ([00f5968](https://www.github.com/gulpjs/rechoir/commit/00f59689d0eb9668d939a85e06428a0906587a6f))
|
21
backend/apis/nodejs/node_modules/rechoir/LICENSE
generated
vendored
Normal file
21
backend/apis/nodejs/node_modules/rechoir/LICENSE
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014-2019, 2021 Tyler Kellen <tyler@sleekcode.net>, Blaine Bublitz <blaine.bublitz@gmail.com>, and Eric Schoffstall <yo@contra.io>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
73
backend/apis/nodejs/node_modules/rechoir/README.md
generated
vendored
Normal file
73
backend/apis/nodejs/node_modules/rechoir/README.md
generated
vendored
Normal file
@ -0,0 +1,73 @@
|
||||
<p align="center">
|
||||
<a href="http://gulpjs.com">
|
||||
<img height="257" width="114" src="https://raw.githubusercontent.com/gulpjs/artwork/master/gulp-2x.png">
|
||||
</a>
|
||||
</p>
|
||||
|
||||
# rechoir
|
||||
|
||||
[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][ci-image]][ci-url] [![Coveralls Status][coveralls-image]][coveralls-url]
|
||||
|
||||
Prepare a node environment to require files with different extensions.
|
||||
|
||||
## What is it?
|
||||
|
||||
This module, in conjunction with [interpret]-like objects, can register any filetype the npm ecosystem has a module loader for. This library is a dependency of [liftoff].
|
||||
|
||||
**Note:** While `rechoir` will automatically load and register transpilers like `coffee-script`, you must provide a local installation. The transpilers are **not** bundled with this module.
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const config = require('interpret').extensions;
|
||||
const rechoir = require('rechoir');
|
||||
rechoir.prepare(config, './test/fixtures/test.coffee');
|
||||
rechoir.prepare(config, './test/fixtures/test.csv');
|
||||
rechoir.prepare(config, './test/fixtures/test.toml');
|
||||
|
||||
console.log(require('./test/fixtures/test.coffee'));
|
||||
console.log(require('./test/fixtures/test.csv'));
|
||||
console.log(require('./test/fixtures/test.toml'));
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### `prepare(config, filepath, [cwd], [noThrow])`
|
||||
|
||||
Look for a module loader associated with the provided file and attempt require it. If necessary, run any setup required to inject it into [require.extensions].
|
||||
|
||||
`config` An [interpret]-like configuration object.
|
||||
|
||||
`filepath` A file whose type you'd like to register a module loader for.
|
||||
|
||||
`cwd` An optional path to start searching for the module required to load the requested file. Defaults to the directory of `filepath`.
|
||||
|
||||
`noThrow` An optional boolean indicating if the method should avoid throwing.
|
||||
|
||||
If calling this method is successful (e.g. it doesn't throw), you can now require files of the type you requested natively.
|
||||
|
||||
An error with a `failures` property will be thrown if the module loader(s) configured for a given extension cannot be registered.
|
||||
|
||||
If a loader is already registered, this will simply return `true`.
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
||||
|
||||
<!-- prettier-ignore-start -->
|
||||
[downloads-image]: https://img.shields.io/npm/dm/rechoir.svg?style=flat-square
|
||||
[npm-url]: https://www.npmjs.com/package/rechoir
|
||||
[npm-image]: https://img.shields.io/npm/v/rechoir.svg?style=flat-square
|
||||
|
||||
[ci-url]: https://github.com/gulpjs/rechoir/actions?query=workflow:dev
|
||||
[ci-image]: https://img.shields.io/github/workflow/status/gulpjs/rechoir/dev?style=flat-square
|
||||
|
||||
[coveralls-url]: https://coveralls.io/r/gulpjs/rechoir
|
||||
[coveralls-image]: https://img.shields.io/coveralls/gulpjs/rechoir/master.svg
|
||||
<!-- prettier-ignore-end -->
|
||||
|
||||
<!-- prettier-ignore-start -->
|
||||
[interpret]: https://github.com/gulpjs/interpret
|
||||
[require.extensions]: https://nodejs.org/api/modules.html#modules_require_extensions
|
||||
[liftoff]: https://github.com/js-cli/js-liftoff
|
||||
<!-- prettier-ignore-end -->
|
69
backend/apis/nodejs/node_modules/rechoir/index.js
generated
vendored
Normal file
69
backend/apis/nodejs/node_modules/rechoir/index.js
generated
vendored
Normal file
@ -0,0 +1,69 @@
|
||||
var path = require('path');
|
||||
|
||||
var extension = require('./lib/extension');
|
||||
var normalize = require('./lib/normalize');
|
||||
var register = require('./lib/register');
|
||||
|
||||
exports.prepare = function (extensions, filepath, cwd, nothrow) {
|
||||
var config, usedExtension, err, option, attempt, error;
|
||||
var attempts = [];
|
||||
var onlyErrors = true;
|
||||
var exts = extension(filepath);
|
||||
|
||||
if (exts) {
|
||||
exts.some(function (ext) {
|
||||
usedExtension = ext;
|
||||
config = normalize(extensions[ext]);
|
||||
return !!config;
|
||||
});
|
||||
}
|
||||
|
||||
if (Object.keys(require.extensions).indexOf(usedExtension) !== -1) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!config) {
|
||||
if (nothrow) {
|
||||
return;
|
||||
}
|
||||
|
||||
throw new Error('No module loader found for "' + usedExtension + '".');
|
||||
}
|
||||
|
||||
if (!cwd) {
|
||||
cwd = path.dirname(path.resolve(filepath));
|
||||
}
|
||||
if (!Array.isArray(config)) {
|
||||
config = [config];
|
||||
}
|
||||
|
||||
for (var i in config) {
|
||||
option = config[i];
|
||||
attempt = register(cwd, option.module, option.register);
|
||||
error = attempt instanceof Error ? attempt : null;
|
||||
if (error) {
|
||||
attempt = null;
|
||||
}
|
||||
attempts.push({
|
||||
moduleName: option.module,
|
||||
module: attempt,
|
||||
error: error,
|
||||
});
|
||||
if (!error) {
|
||||
onlyErrors = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (onlyErrors) {
|
||||
err = new Error(
|
||||
'Unable to use specified module loaders for "' + usedExtension + '".'
|
||||
);
|
||||
err.failures = attempts;
|
||||
if (nothrow) {
|
||||
return err;
|
||||
}
|
||||
|
||||
throw err;
|
||||
}
|
||||
return attempts;
|
||||
};
|
44
backend/apis/nodejs/node_modules/rechoir/lib/extension.js
generated
vendored
Normal file
44
backend/apis/nodejs/node_modules/rechoir/lib/extension.js
generated
vendored
Normal file
@ -0,0 +1,44 @@
|
||||
'use strict';
|
||||
|
||||
var path = require('path');
|
||||
|
||||
function getLongExtension(basename) {
|
||||
if (basename[basename.length - 1] === '.') {
|
||||
return null;
|
||||
}
|
||||
|
||||
var startIndex = basename[0] === '.' ? 1 : 0;
|
||||
|
||||
var dotIndex = basename.indexOf('.', startIndex);
|
||||
if (dotIndex <= startIndex) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return basename.slice(dotIndex);
|
||||
}
|
||||
|
||||
function getPossibleExtensions(longExtension) {
|
||||
var arr = [longExtension];
|
||||
var len = longExtension.length;
|
||||
var startIndex = 1;
|
||||
|
||||
while (startIndex < len) {
|
||||
var dotIndex = longExtension.indexOf('.', startIndex);
|
||||
if (dotIndex < 0) {
|
||||
break;
|
||||
}
|
||||
arr.push(longExtension.slice(dotIndex));
|
||||
startIndex = dotIndex + 1;
|
||||
}
|
||||
|
||||
return arr;
|
||||
}
|
||||
|
||||
module.exports = function (input) {
|
||||
var basename = path.basename(input);
|
||||
var longExtension = getLongExtension(basename);
|
||||
if (!longExtension) {
|
||||
return;
|
||||
}
|
||||
return getPossibleExtensions(longExtension);
|
||||
};
|
13
backend/apis/nodejs/node_modules/rechoir/lib/normalize.js
generated
vendored
Normal file
13
backend/apis/nodejs/node_modules/rechoir/lib/normalize.js
generated
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
function normalizer(config) {
|
||||
if (typeof config === 'string') {
|
||||
return { module: config };
|
||||
}
|
||||
return config;
|
||||
}
|
||||
|
||||
module.exports = function (config) {
|
||||
if (Array.isArray(config)) {
|
||||
return config.map(normalizer);
|
||||
}
|
||||
return normalizer(config);
|
||||
};
|
15
backend/apis/nodejs/node_modules/rechoir/lib/register.js
generated
vendored
Normal file
15
backend/apis/nodejs/node_modules/rechoir/lib/register.js
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
var resolve = require('resolve');
|
||||
|
||||
module.exports = function (cwd, moduleName, register) {
|
||||
var result;
|
||||
try {
|
||||
var modulePath = resolve.sync(moduleName, { basedir: cwd });
|
||||
result = require(modulePath);
|
||||
if (typeof register === 'function') {
|
||||
register(result);
|
||||
}
|
||||
} catch (e) {
|
||||
result = e;
|
||||
}
|
||||
return result;
|
||||
};
|
52
backend/apis/nodejs/node_modules/rechoir/package.json
generated
vendored
Normal file
52
backend/apis/nodejs/node_modules/rechoir/package.json
generated
vendored
Normal file
@ -0,0 +1,52 @@
|
||||
{
|
||||
"name": "rechoir",
|
||||
"version": "0.8.0",
|
||||
"description": "Prepare a node environment to require files with different extensions.",
|
||||
"author": "Gulp Team <team@gulpjs.com> (http://gulpjs.com/)",
|
||||
"contributors": [
|
||||
"Blaine Bublitz <blaine.bublitz@gmail.com>",
|
||||
"Tyler Kellen <tyler@sleekcode.net> (http://goingslowly.com/)"
|
||||
],
|
||||
"repository": "gulpjs/rechoir",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 10.13.0"
|
||||
},
|
||||
"main": "index.js",
|
||||
"files": [
|
||||
"LICENSE",
|
||||
"index.js",
|
||||
"lib/"
|
||||
],
|
||||
"scripts": {
|
||||
"lint": "eslint .",
|
||||
"pretest": "rm -rf tmp/ && npm run lint",
|
||||
"test": "nyc mocha --async-only"
|
||||
},
|
||||
"dependencies": {
|
||||
"resolve": "^1.20.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"eslint": "^7.21.0",
|
||||
"eslint-config-gulp": "^5.0.1",
|
||||
"expect": "^27.0.0",
|
||||
"mocha": "^8.3.0",
|
||||
"nyc": "^15.1.0"
|
||||
},
|
||||
"nyc": {
|
||||
"reporter": [
|
||||
"lcov",
|
||||
"text-summary"
|
||||
]
|
||||
},
|
||||
"prettier": {
|
||||
"singleQuote": true
|
||||
},
|
||||
"keywords": [
|
||||
"require",
|
||||
"loader",
|
||||
"extension",
|
||||
"extensions",
|
||||
"prepare"
|
||||
]
|
||||
}
|
Reference in New Issue
Block a user