update
This commit is contained in:
@@ -0,0 +1,77 @@
|
||||
/* eslint-disable node/no-deprecated-api */
|
||||
|
||||
'use strict'
|
||||
|
||||
var buffer = require('buffer')
|
||||
var Buffer = buffer.Buffer
|
||||
|
||||
var safer = {}
|
||||
|
||||
var key
|
||||
|
||||
for (key in buffer) {
|
||||
if (!buffer.hasOwnProperty(key)) continue
|
||||
if (key === 'SlowBuffer' || key === 'Buffer') continue
|
||||
safer[key] = buffer[key]
|
||||
}
|
||||
|
||||
var Safer = safer.Buffer = {}
|
||||
for (key in Buffer) {
|
||||
if (!Buffer.hasOwnProperty(key)) continue
|
||||
if (key === 'allocUnsafe' || key === 'allocUnsafeSlow') continue
|
||||
Safer[key] = Buffer[key]
|
||||
}
|
||||
|
||||
safer.Buffer.prototype = Buffer.prototype
|
||||
|
||||
if (!Safer.from || Safer.from === Uint8Array.from) {
|
||||
Safer.from = function (value, encodingOrOffset, length) {
|
||||
if (typeof value === 'number') {
|
||||
throw new TypeError('The "value" argument must not be of type number. Received type ' + typeof value)
|
||||
}
|
||||
if (value && typeof value.length === 'undefined') {
|
||||
throw new TypeError('The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type ' + typeof value)
|
||||
}
|
||||
return Buffer(value, encodingOrOffset, length)
|
||||
}
|
||||
}
|
||||
|
||||
if (!Safer.alloc) {
|
||||
Safer.alloc = function (size, fill, encoding) {
|
||||
if (typeof size !== 'number') {
|
||||
throw new TypeError('The "size" argument must be of type number. Received type ' + typeof size)
|
||||
}
|
||||
if (size < 0 || size >= 2 * (1 << 30)) {
|
||||
throw new RangeError('The value "' + size + '" is invalid for option "size"')
|
||||
}
|
||||
var buf = Buffer(size)
|
||||
if (!fill || fill.length === 0) {
|
||||
buf.fill(0)
|
||||
} else if (typeof encoding === 'string') {
|
||||
buf.fill(fill, encoding)
|
||||
} else {
|
||||
buf.fill(fill)
|
||||
}
|
||||
return buf
|
||||
}
|
||||
}
|
||||
|
||||
if (!safer.kStringMaxLength) {
|
||||
try {
|
||||
safer.kStringMaxLength = process.binding('buffer').kStringMaxLength
|
||||
} catch (e) {
|
||||
// we can't determine kStringMaxLength in environments where process.binding
|
||||
// is unsupported, so let's not set it
|
||||
}
|
||||
}
|
||||
|
||||
if (!safer.constants) {
|
||||
safer.constants = {
|
||||
MAX_LENGTH: safer.kMaxLength
|
||||
}
|
||||
if (safer.kStringMaxLength) {
|
||||
safer.constants.MAX_STRING_LENGTH = safer.kStringMaxLength
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = safer
|
||||
@@ -0,0 +1,36 @@
|
||||
|
||||
Configuration
|
||||
--config <file> .......... alternate nodemon.json config file to use
|
||||
--exitcrash .............. exit on crash, allows nodemon to work with other watchers
|
||||
-i, --ignore ............. ignore specific files or directories
|
||||
--no-colors .............. disable color output
|
||||
--signal <signal> ........ use specified kill signal instead of default (ex. SIGTERM)
|
||||
-w, --watch path ......... watch directory "dir" or files. use once for each
|
||||
directory or file to watch
|
||||
--no-update-notifier ..... opt-out of update version check
|
||||
|
||||
Execution
|
||||
-C, --on-change-only ..... execute script on change only, not startup
|
||||
--cwd <dir> .............. change into <dir> before running the script
|
||||
-e, --ext ................ extensions to look for, ie. "js,pug,hbs"
|
||||
-I, --no-stdin ........... nodemon passes stdin directly to child process
|
||||
--spawn .................. force nodemon to use spawn (over fork) [node only]
|
||||
-x, --exec app ........... execute script with "app", ie. -x "python -v"
|
||||
-- <your args> ........... to tell nodemon stop slurping arguments
|
||||
|
||||
Watching
|
||||
-d, --delay n ............ debounce restart for "n" seconds
|
||||
-L, --legacy-watch ....... use polling to watch for changes (typically needed
|
||||
when watching over a network/Docker)
|
||||
-P, --polling-interval ... combined with -L, milliseconds to poll for (default 100)
|
||||
|
||||
Information
|
||||
--dump ................... print full debug configuration
|
||||
-h, --help ............... default help
|
||||
--help <topic> ........... help on a specific feature. Try "--help topics"
|
||||
-q, --quiet .............. minimise nodemon messages to start/stop only
|
||||
-v, --version ............ current nodemon version
|
||||
-V, --verbose ............ show detail on what is causing restarts
|
||||
|
||||
|
||||
> Note that any unrecognised arguments are passed to the executing command.
|
||||
@@ -0,0 +1,62 @@
|
||||
# side-channel-list <sup>[![Version Badge][npm-version-svg]][package-url]</sup>
|
||||
|
||||
[![github actions][actions-image]][actions-url]
|
||||
[![coverage][codecov-image]][codecov-url]
|
||||
[![License][license-image]][license-url]
|
||||
[![Downloads][downloads-image]][downloads-url]
|
||||
|
||||
[![npm badge][npm-badge-png]][package-url]
|
||||
|
||||
Store information about any JS value in a side channel, using a linked list.
|
||||
|
||||
Warning: this implementation will leak memory until you `delete` the `key`.
|
||||
Use [`side-channel`](https://npmjs.com/side-channel) for the best available strategy.
|
||||
|
||||
## Getting started
|
||||
|
||||
```sh
|
||||
npm install --save side-channel-list
|
||||
```
|
||||
|
||||
## Usage/Examples
|
||||
|
||||
```js
|
||||
const assert = require('assert');
|
||||
const getSideChannelList = require('side-channel-list');
|
||||
|
||||
const channel = getSideChannelList();
|
||||
|
||||
const key = {};
|
||||
assert.equal(channel.has(key), false);
|
||||
assert.throws(() => channel.assert(key), TypeError);
|
||||
|
||||
channel.set(key, 42);
|
||||
|
||||
channel.assert(key); // does not throw
|
||||
assert.equal(channel.has(key), true);
|
||||
assert.equal(channel.get(key), 42);
|
||||
|
||||
channel.delete(key);
|
||||
assert.equal(channel.has(key), false);
|
||||
assert.throws(() => channel.assert(key), TypeError);
|
||||
```
|
||||
|
||||
## Tests
|
||||
|
||||
Clone the repo, `npm install`, and run `npm test`
|
||||
|
||||
[package-url]: https://npmjs.org/package/side-channel-list
|
||||
[npm-version-svg]: https://versionbadg.es/ljharb/side-channel-list.svg
|
||||
[deps-svg]: https://david-dm.org/ljharb/side-channel-list.svg
|
||||
[deps-url]: https://david-dm.org/ljharb/side-channel-list
|
||||
[dev-deps-svg]: https://david-dm.org/ljharb/side-channel-list/dev-status.svg
|
||||
[dev-deps-url]: https://david-dm.org/ljharb/side-channel-list#info=devDependencies
|
||||
[npm-badge-png]: https://nodei.co/npm/side-channel-list.png?downloads=true&stars=true
|
||||
[license-image]: https://img.shields.io/npm/l/side-channel-list.svg
|
||||
[license-url]: LICENSE
|
||||
[downloads-image]: https://img.shields.io/npm/dm/side-channel-list.svg
|
||||
[downloads-url]: https://npm-stat.com/charts.html?package=side-channel-list
|
||||
[codecov-image]: https://codecov.io/gh/ljharb/side-channel-list/branch/main/graphs/badge.svg
|
||||
[codecov-url]: https://app.codecov.io/gh/ljharb/side-channel-list/
|
||||
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/side-channel-list
|
||||
[actions-url]: https://github.com/ljharb/side-channel-list/actions
|
||||
@@ -0,0 +1,80 @@
|
||||
/*!
|
||||
* body-parser
|
||||
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/**
|
||||
* @typedef Parsers
|
||||
* @type {function}
|
||||
* @property {function} json
|
||||
* @property {function} raw
|
||||
* @property {function} text
|
||||
* @property {function} urlencoded
|
||||
*/
|
||||
|
||||
/**
|
||||
* Module exports.
|
||||
* @type {Parsers}
|
||||
*/
|
||||
|
||||
exports = module.exports = bodyParser
|
||||
|
||||
/**
|
||||
* JSON parser.
|
||||
* @public
|
||||
*/
|
||||
|
||||
Object.defineProperty(exports, 'json', {
|
||||
configurable: true,
|
||||
enumerable: true,
|
||||
get: () => require('./lib/types/json')
|
||||
})
|
||||
|
||||
/**
|
||||
* Raw parser.
|
||||
* @public
|
||||
*/
|
||||
|
||||
Object.defineProperty(exports, 'raw', {
|
||||
configurable: true,
|
||||
enumerable: true,
|
||||
get: () => require('./lib/types/raw')
|
||||
})
|
||||
|
||||
/**
|
||||
* Text parser.
|
||||
* @public
|
||||
*/
|
||||
|
||||
Object.defineProperty(exports, 'text', {
|
||||
configurable: true,
|
||||
enumerable: true,
|
||||
get: () => require('./lib/types/text')
|
||||
})
|
||||
|
||||
/**
|
||||
* URL-encoded parser.
|
||||
* @public
|
||||
*/
|
||||
|
||||
Object.defineProperty(exports, 'urlencoded', {
|
||||
configurable: true,
|
||||
enumerable: true,
|
||||
get: () => require('./lib/types/urlencoded')
|
||||
})
|
||||
|
||||
/**
|
||||
* Create a middleware to parse json and urlencoded bodies.
|
||||
*
|
||||
* @param {object} [options]
|
||||
* @return {function}
|
||||
* @deprecated
|
||||
* @public
|
||||
*/
|
||||
|
||||
function bodyParser () {
|
||||
throw new Error('The bodyParser() generic has been split into individual middleware to use instead.')
|
||||
}
|
||||
Reference in New Issue
Block a user