Izmjenjena struktura, dodan backand

This commit is contained in:
GotPPay
2017-10-16 11:19:46 +02:00
parent 1ec88afacb
commit 048e32c4aa
37153 changed files with 2975854 additions and 1 deletions

1
web/node_modules/loader-fs-cache/.npmignore generated vendored Normal file
View File

@@ -0,0 +1 @@
node_modules/

22
web/node_modules/loader-fs-cache/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,22 @@
Copyright (c) 2014-2016 Ade Viankakrisna Fadlil <viankakrisna@gmail.com>
MIT License
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.

196
web/node_modules/loader-fs-cache/index.js generated vendored Normal file
View File

@@ -0,0 +1,196 @@
/**
* Filesystem cache
*
* Given a file and a transform function, cache the result into files
* or retrieve the previously cached files if the given file is already known.
*
* @see https://github.com/babel/babel-loader/issues/34
* @see https://github.com/babel/babel-loader/pull/41
* @see https://github.com/babel/babel-loader/blob/master/src/fs-cache.js
*/
var crypto = require("crypto");
var mkdirp = require("mkdirp");
var findCacheDir = require("find-cache-dir");
var fs = require("fs");
var os = require("os");
var path = require("path");
var zlib = require("zlib");
var defaultCacheDirectory = null; // Lazily instantiated when needed
/**
* Read the contents from the compressed file.
*
* @async
* @params {String} filename
* @params {Function} callback
*/
var read = function(filename, callback) {
return fs.readFile(filename, function(err, data) {
if (err) {
return callback(err);
}
return zlib.gunzip(data, function(err, content) {
var result = {};
if (err) {
return callback(err);
}
try {
result = JSON.parse(content);
} catch (e) {
return callback(e);
}
return callback(null, result);
});
});
};
/**
* Write contents into a compressed file.
*
* @async
* @params {String} filename
* @params {String} result
* @params {Function} callback
*/
var write = function(filename, result, callback) {
var content = JSON.stringify(result);
return zlib.gzip(content, function(err, data) {
if (err) {
return callback(err);
}
return fs.writeFile(filename, data, callback);
});
};
/**
* Build the filename for the cached file
*
* @params {String} source File source code
* @params {Object} options Options used
*
* @return {String}
*/
var filename = function(source, identifier, options) {
var hash = crypto.createHash("SHA1");
var contents = JSON.stringify({
source: source,
options: options,
identifier: identifier
});
hash.end(contents);
return hash.read().toString("hex") + ".json.gz";
};
/**
* Handle the cache
*
* @params {String} directory
* @params {Object} params
* @params {Function} callback
*/
var handleCache = function(directory, params, callback) {
var source = params.source;
var options = params.options || {};
var transform = params.transform;
var identifier = params.identifier;
var shouldFallback = typeof params.directory !== "string" &&
directory !== os.tmpdir();
// Make sure the directory exists.
mkdirp(directory, function(err) {
// Fallback to tmpdir if node_modules folder not writable
if (err)
return shouldFallback
? handleCache(os.tmpdir(), params, callback)
: callback(err);
var file = path.join(directory, filename(source, identifier, options));
return read(file, function(err, content) {
var result = {};
// No errors mean that the file was previously cached
// we just need to return it
if (!err) return callback(null, content);
// Otherwise just transform the file
// return it to the user asap and write it in cache
try {
result = transform(source, options);
} catch (error) {
return callback(error);
}
return write(file, result, function(err) {
// Fallback to tmpdir if node_modules folder not writable
if (err)
return shouldFallback
? handleCache(os.tmpdir(), params, callback)
: callback(err);
callback(null, result);
});
});
});
};
/**
* Retrieve file from cache, or create a new one for future reads
*
* @async
* @param {Object} params
* @param {String} params.directory Directory to store cached files
* @param {String} params.identifier Unique identifier to bust cache
* @param {String} params.source Original contents of the file to be cached
* @param {Object} params.options Options to be given to the transform fn
* @param {Function} params.transform Function that will transform the
* original file and whose result will be
* cached
*
* @param {Function<err, result>} callback
*
* @example
*
* cache({
* directory: '.tmp/cache',
* identifier: 'babel-loader-cachefile',
* source: *source code from file*,
* options: {
* experimental: true,
* runtime: true
* },
* transform: function(source, options) {
* var content = *do what you need with the source*
* return content
* }
* }, function(err, result) {
*
* })
*/
module.exports = function createFsCache(name) {
return function(params, callback) {
var directory;
if (typeof params.directory === "string") {
directory = params.directory;
} else {
if (defaultCacheDirectory === null) {
defaultCacheDirectory = findCacheDir({
name: name
}) ||
os.tmpdir();
}
directory = defaultCacheDirectory;
}
handleCache(directory, params, callback);
};
};

42
web/node_modules/loader-fs-cache/package.json generated vendored Normal file
View File

@@ -0,0 +1,42 @@
{
"_from": "loader-fs-cache@^1.0.0",
"_id": "loader-fs-cache@1.0.1",
"_inBundle": false,
"_integrity": "sha1-VuC/CL2XCLJqdltoUJhAyN7J/bw=",
"_location": "/loader-fs-cache",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "loader-fs-cache@^1.0.0",
"name": "loader-fs-cache",
"escapedName": "loader-fs-cache",
"rawSpec": "^1.0.0",
"saveSpec": null,
"fetchSpec": "^1.0.0"
},
"_requiredBy": [
"/eslint-loader"
],
"_resolved": "https://registry.npmjs.org/loader-fs-cache/-/loader-fs-cache-1.0.1.tgz",
"_shasum": "56e0bf08bd9708b26a765b68509840c8dec9fdbc",
"_spec": "loader-fs-cache@^1.0.0",
"_where": "/home/bilal/Saburly/slucajna-televizija/node_modules/eslint-loader",
"author": {
"name": "Ade Viankakrisna Fadlil"
},
"bundleDependencies": false,
"dependencies": {
"find-cache-dir": "^0.1.1",
"mkdirp": "0.5.1"
},
"deprecated": false,
"description": "A published package of https://github.com/babel/babel-loader/blob/master/src/fs-cache.js",
"license": "ISC",
"main": "index.js",
"name": "loader-fs-cache",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"version": "1.0.1"
}