mirror of
https://github.com/abrendan/MicDropMessages.git
synced 2025-08-25 05:52:02 +02:00
Initial commit
This commit is contained in:
19
node_modules/pug-error/LICENSE
generated
vendored
Normal file
19
node_modules/pug-error/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
Copyright (c) 2015 Forbes Lindesay
|
||||
|
||||
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.
|
55
node_modules/pug-error/README.md
generated
vendored
Normal file
55
node_modules/pug-error/README.md
generated
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
# pug-error
|
||||
|
||||
Standard error objects for pug. This module is intended for use by the lexer, parser, loader, linker, code-generator and any plugins.
|
||||
|
||||
[](https://travis-ci.org/pugjs/pug-error)
|
||||
[](https://david-dm.org/pugjs/pug?path=packages/pug-error)
|
||||
[](https://www.npmjs.org/package/pug-error)
|
||||
|
||||
## Installation
|
||||
|
||||
npm install pug-error
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
var error = require('pug-error');
|
||||
```
|
||||
|
||||
### `error(code, message, options)`
|
||||
|
||||
Create a Pug error object.
|
||||
|
||||
`code` is a required unique code for the error type that can be used to pinpoint a certain error.
|
||||
|
||||
`message` is a human-readable explanation of the error.
|
||||
|
||||
`options` can contain any of the following properties:
|
||||
|
||||
- `filename`: the name of the file causing the error
|
||||
- `line`: the offending line
|
||||
- `column`: the offending column
|
||||
- `src`: the Pug source, if available, for pretty-printing the error context
|
||||
|
||||
The resulting error object is a simple Error object with additional properties given in the arguments.
|
||||
|
||||
**Caveat:** the `message` argument is stored in `err.msg`, not `err.message`, which is occupied with a better-formatted message.
|
||||
|
||||
```js
|
||||
var error = require('pug-error');
|
||||
|
||||
var err = error('MY_CODE', 'My message', {line: 3, filename: 'myfile', src: 'foo\nbar\nbaz\nbash\nbing'});
|
||||
// { code: 'PUG:MY_CODE',
|
||||
// msg: 'My message',
|
||||
// line: 3,
|
||||
// column: undefined,
|
||||
// filename: 'myfile',
|
||||
// src: 'foo\nbar\nbaz\nbash\nbing',
|
||||
// message: 'myfile:3\n 1| foo\n 2| bar\n > 3| baz\n 4| bash\n 5| bing\n\nMy message' }
|
||||
|
||||
throw err;
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
49
node_modules/pug-error/index.js
generated
vendored
Normal file
49
node_modules/pug-error/index.js
generated
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = makeError;
|
||||
function makeError(code, message, options) {
|
||||
var line = options.line;
|
||||
var column = options.column;
|
||||
var filename = options.filename;
|
||||
var src = options.src;
|
||||
var fullMessage;
|
||||
var location = line + (column ? ':' + column : '');
|
||||
if (src && line >= 1 && line <= src.split('\n').length) {
|
||||
var lines = src.split('\n');
|
||||
var start = Math.max(line - 3, 0);
|
||||
var end = Math.min(lines.length, line + 3);
|
||||
// Error context
|
||||
var context = lines.slice(start, end).map(function(text, i){
|
||||
var curr = i + start + 1;
|
||||
var preamble = (curr == line ? ' > ' : ' ')
|
||||
+ curr
|
||||
+ '| ';
|
||||
var out = preamble + text;
|
||||
if (curr === line && column > 0) {
|
||||
out += '\n';
|
||||
out += Array(preamble.length + column).join('-') + '^';
|
||||
}
|
||||
return out;
|
||||
}).join('\n');
|
||||
fullMessage = (filename || 'Pug') + ':' + location + '\n' + context + '\n\n' + message;
|
||||
} else {
|
||||
fullMessage = (filename || 'Pug') + ':' + location + '\n\n' + message;
|
||||
}
|
||||
var err = new Error(fullMessage);
|
||||
err.code = 'PUG:' + code;
|
||||
err.msg = message;
|
||||
err.line = line;
|
||||
err.column = column;
|
||||
err.filename = filename;
|
||||
err.src = src;
|
||||
err.toJSON = function () {
|
||||
return {
|
||||
code: this.code,
|
||||
msg: this.msg,
|
||||
line: this.line,
|
||||
column: this.column,
|
||||
filename: this.filename
|
||||
};
|
||||
};
|
||||
return err;
|
||||
}
|
50
node_modules/pug-error/package.json
generated
vendored
Normal file
50
node_modules/pug-error/package.json
generated
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
{
|
||||
"_from": "pug-error@^1.3.3",
|
||||
"_id": "pug-error@1.3.3",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-qE3YhESP2mRAWMFJgKdtT5D7ckThRScXRwkfo+Erqga7dyJdY3ZquspprMCj/9sJ2ijm5hXFWQE/A3l4poMWiQ==",
|
||||
"_location": "/pug-error",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "pug-error@^1.3.3",
|
||||
"name": "pug-error",
|
||||
"escapedName": "pug-error",
|
||||
"rawSpec": "^1.3.3",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^1.3.3"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/pug-code-gen",
|
||||
"/pug-filters",
|
||||
"/pug-lexer",
|
||||
"/pug-linker",
|
||||
"/pug-parser",
|
||||
"/pug-strip-comments"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/pug-error/-/pug-error-1.3.3.tgz",
|
||||
"_shasum": "f342fb008752d58034c185de03602dd9ffe15fa6",
|
||||
"_spec": "pug-error@^1.3.3",
|
||||
"_where": "/home/runner/Socketio-Chat-Template/node_modules/pug-code-gen",
|
||||
"author": {
|
||||
"name": "Forbes Lindesay"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"deprecated": false,
|
||||
"description": "Standard error objects for pug",
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"gitHead": "1bdf628a70fda7a0d840c52f3abce54b1c6b0130",
|
||||
"keywords": [
|
||||
"pug"
|
||||
],
|
||||
"license": "MIT",
|
||||
"name": "pug-error",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/pugjs/pug/tree/master/packages/pug-error"
|
||||
},
|
||||
"version": "1.3.3"
|
||||
}
|
Reference in New Issue
Block a user