mirror of
https://gitlab.com/octtspacc/staticoso
synced 2025-06-05 22:09:23 +02:00
Transition to monorepo on a new Dev branch
This commit is contained in:
19
App/Source/node_modules/pug-load/HISTORY.md
generated
vendored
Normal file
19
App/Source/node_modules/pug-load/HISTORY.md
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
2.0.3 / 2016-08-24
|
||||
==================
|
||||
|
||||
* Do not pollute the user's `options` object
|
||||
|
||||
2.0.2 / 2016-08-23
|
||||
==================
|
||||
|
||||
* Only publish the module itself
|
||||
|
||||
2.0.1 / 2016-08-23
|
||||
==================
|
||||
|
||||
* Update to pug-walk@^1.0.0
|
||||
|
||||
2.0.0 / 2016-05-14
|
||||
==================
|
||||
|
||||
* Make filename part of the options - updates to the 2.x.y APIs for lexer and parser
|
19
App/Source/node_modules/pug-load/LICENSE
generated
vendored
Normal file
19
App/Source/node_modules/pug-load/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.
|
101
App/Source/node_modules/pug-load/index.js
generated
vendored
Normal file
101
App/Source/node_modules/pug-load/index.js
generated
vendored
Normal file
@ -0,0 +1,101 @@
|
||||
'use strict';
|
||||
|
||||
var fs = require('fs');
|
||||
var path = require('path');
|
||||
var walk = require('pug-walk');
|
||||
var assign = require('object-assign');
|
||||
|
||||
module.exports = load;
|
||||
function load(ast, options) {
|
||||
options = getOptions(options);
|
||||
// clone the ast
|
||||
ast = JSON.parse(JSON.stringify(ast));
|
||||
return walk(ast, function (node) {
|
||||
if (node.str === undefined) {
|
||||
if (node.type === 'Include' || node.type === 'RawInclude' || node.type === 'Extends') {
|
||||
var file = node.file;
|
||||
if (file.type !== 'FileReference') {
|
||||
throw new Error('Expected file.type to be "FileReference"');
|
||||
}
|
||||
var path, str;
|
||||
try {
|
||||
path = options.resolve(file.path, file.filename, options);
|
||||
file.fullPath = path;
|
||||
str = options.read(path, options);
|
||||
} catch (ex) {
|
||||
ex.message += '\n at ' + node.filename + ' line ' + node.line;
|
||||
throw ex;
|
||||
}
|
||||
file.str = str;
|
||||
if (node.type === 'Extends' || node.type === 'Include') {
|
||||
file.ast = load.string(str, assign({}, options, {
|
||||
filename: path
|
||||
}));
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
load.string = function loadString(src, options) {
|
||||
options = assign(getOptions(options), {
|
||||
src: src
|
||||
});
|
||||
var tokens = options.lex(src, options);
|
||||
var ast = options.parse(tokens, options);
|
||||
return load(ast, options);
|
||||
};
|
||||
load.file = function loadFile(filename, options) {
|
||||
options = assign(getOptions(options), {
|
||||
filename: filename
|
||||
});
|
||||
var str = options.read(filename);
|
||||
return load.string(str, options);
|
||||
};
|
||||
|
||||
load.resolve = function resolve(filename, source, options) {
|
||||
filename = filename.trim();
|
||||
if (filename[0] !== '/' && !source)
|
||||
throw new Error('the "filename" option is required to use includes and extends with "relative" paths');
|
||||
|
||||
if (filename[0] === '/' && !options.basedir)
|
||||
throw new Error('the "basedir" option is required to use includes and extends with "absolute" paths');
|
||||
|
||||
filename = path.join(filename[0] === '/' ? options.basedir : path.dirname(source.trim()), filename);
|
||||
|
||||
return filename;
|
||||
};
|
||||
load.read = function read(filename, options) {
|
||||
return fs.readFileSync(filename, 'utf8');
|
||||
};
|
||||
|
||||
load.validateOptions = function validateOptions(options) {
|
||||
/* istanbul ignore if */
|
||||
if (typeof options !== 'object') {
|
||||
throw new TypeError('options must be an object');
|
||||
}
|
||||
/* istanbul ignore if */
|
||||
if (typeof options.lex !== 'function') {
|
||||
throw new TypeError('options.lex must be a function');
|
||||
}
|
||||
/* istanbul ignore if */
|
||||
if (typeof options.parse !== 'function') {
|
||||
throw new TypeError('options.parse must be a function');
|
||||
}
|
||||
/* istanbul ignore if */
|
||||
if (options.resolve && typeof options.resolve !== 'function') {
|
||||
throw new TypeError('options.resolve must be a function');
|
||||
}
|
||||
/* istanbul ignore if */
|
||||
if (options.read && typeof options.read !== 'function') {
|
||||
throw new TypeError('options.read must be a function');
|
||||
}
|
||||
};
|
||||
|
||||
function getOptions(options) {
|
||||
load.validateOptions(options);
|
||||
return assign({
|
||||
resolve: load.resolve,
|
||||
read: load.read
|
||||
}, options);
|
||||
}
|
26
App/Source/node_modules/pug-load/package.json
generated
vendored
Normal file
26
App/Source/node_modules/pug-load/package.json
generated
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
{
|
||||
"name": "pug-load",
|
||||
"version": "2.0.12",
|
||||
"description": "The Pug loader is responsible for loading the depenendencies of a given Pug file.",
|
||||
"keywords": [
|
||||
"pug"
|
||||
],
|
||||
"dependencies": {
|
||||
"object-assign": "^4.1.0",
|
||||
"pug-walk": "^1.1.8"
|
||||
},
|
||||
"devDependencies": {
|
||||
"pug-lexer": "^4.1.0",
|
||||
"pug-parser": "^5.0.1"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/pugjs/pug/tree/master/packages/pug-load"
|
||||
},
|
||||
"author": "ForbesLindesay",
|
||||
"license": "MIT",
|
||||
"gitHead": "1bdf628a70fda7a0d840c52f3abce54b1c6b0130"
|
||||
}
|
Reference in New Issue
Block a user