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

26
web/node_modules/eslint-module-utils/CHANGELOG.md generated vendored Normal file
View File

@@ -0,0 +1,26 @@
# Change Log
All notable changes to this module will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).
This change log adheres to standards from [Keep a CHANGELOG](http://keepachangelog.com).
## Unreleased
## v2.1.1 - 2017-06-22
Re-releasing v2.1.0 after vetting (again) and unable to reproduce issue.
## v2.1.0 - 2017-06-02 [YANKED]
Yanked due to critical issue with cache key resulting from #839.
### Added
- `parse` now additionally passes `filePath` to `parser` in `parserOptions` like `eslint` core does
## v2.0.0 - 2016-11-07
### Changed
- `unambiguous` no longer exposes fast test regex
### Fixed
- `unambiguous.test()` regex is now properly in multiline mode

47
web/node_modules/eslint-module-utils/ModuleCache.js generated vendored Normal file
View File

@@ -0,0 +1,47 @@
"use strict"
exports.__esModule = true
const log = require('debug')('eslint-module-utils:ModuleCache')
class ModuleCache {
constructor(map) {
this.map = map || new Map()
}
/**
* returns value for returning inline
* @param {[type]} cacheKey [description]
* @param {[type]} result [description]
*/
set(cacheKey, result) {
this.map.set(cacheKey, { result, lastSeen: Date.now() })
log('setting entry for', cacheKey)
return result
}
get(cacheKey, settings) {
if (this.map.has(cacheKey)) {
const f = this.map.get(cacheKey)
// check fresness
if (Date.now() - f.lastSeen < (settings.lifetime * 1000)) return f.result
} else log('cache miss for', cacheKey)
// cache miss
return undefined
}
}
ModuleCache.getSettings = function (settings) {
const cacheSettings = Object.assign({
lifetime: 30, // seconds
}, settings['import/cache'])
// parse infinity
if (cacheSettings.lifetime === '∞' || cacheSettings.lifetime === 'Infinity') {
cacheSettings.lifetime = Infinity
}
return cacheSettings
}
exports.default = ModuleCache

14
web/node_modules/eslint-module-utils/declaredScope.js generated vendored Normal file
View File

@@ -0,0 +1,14 @@
"use strict"
exports.__esModule = true
exports.default = function declaredScope(context, name) {
let references = context.getScope().references
, i
for (i = 0; i < references.length; i++) {
if (references[i].identifier.name === name) {
break
}
}
if (!references[i]) return undefined
return references[i].resolved.scope.type
}

59
web/node_modules/eslint-module-utils/hash.js generated vendored Normal file
View File

@@ -0,0 +1,59 @@
/**
* utilities for hashing config objects.
* basically iteratively updates hash with a JSON-like format
*/
"use strict"
exports.__esModule = true
const createHash = require('crypto').createHash
const stringify = JSON.stringify
function hashify(value, hash) {
if (!hash) hash = createHash('sha256')
if (value instanceof Array) {
hashArray(value, hash)
} else if (value instanceof Object) {
hashObject(value, hash)
} else {
hash.update(stringify(value) || 'undefined')
}
return hash
}
exports.default = hashify
function hashArray(array, hash) {
if (!hash) hash = createHash('sha256')
hash.update('[')
for (let i = 0; i < array.length; i++) {
hashify(array[i], hash)
hash.update(',')
}
hash.update(']')
return hash
}
hashify.array = hashArray
exports.hashArray = hashArray
function hashObject(object, hash) {
if (!hash) hash = createHash('sha256')
hash.update("{")
Object.keys(object).sort().forEach(key => {
hash.update(stringify(key))
hash.update(':')
hashify(object[key], hash)
hash.update(",")
})
hash.update('}')
return hash
}
hashify.object = hashObject
exports.hashObject = hashObject

56
web/node_modules/eslint-module-utils/ignore.js generated vendored Normal file
View File

@@ -0,0 +1,56 @@
"use strict"
exports.__esModule = true
const extname = require('path').extname
const log = require('debug')('eslint-plugin-import:utils:ignore')
// one-shot memoized
let cachedSet, lastSettings
function validExtensions(context) {
if (cachedSet && context.settings === lastSettings) {
return cachedSet
}
lastSettings = context.settings
cachedSet = makeValidExtensionSet(context.settings)
return cachedSet
}
function makeValidExtensionSet(settings) {
// start with explicit JS-parsed extensions
const exts = new Set(settings['import/extensions'] || [ '.js' ])
// all alternate parser extensions are also valid
if ('import/parsers' in settings) {
for (let parser in settings['import/parsers']) {
settings['import/parsers'][parser]
.forEach(ext => exts.add(ext))
}
}
return exts
}
exports.default = function ignore(path, context) {
// check extension whitelist first (cheap)
if (!hasValidExtension(path, context)) return true
if (!('import/ignore' in context.settings)) return false
const ignoreStrings = context.settings['import/ignore']
for (let i = 0; i < ignoreStrings.length; i++) {
const regex = new RegExp(ignoreStrings[i])
if (regex.test(path)) {
log(`ignoring ${path}, matched pattern /${ignoreStrings[i]}/`)
return true
}
}
return false
}
function hasValidExtension(path, context) {
return validExtensions(context).has(extname(path))
}
exports.hasValidExtension = hasValidExtension

30
web/node_modules/eslint-module-utils/module-require.js generated vendored Normal file
View File

@@ -0,0 +1,30 @@
"use strict"
exports.__esModule = true
const Module = require('module')
const path = require('path')
// borrowed from babel-eslint
function createModule(filename) {
const mod = new Module(filename)
mod.filename = filename
mod.paths = Module._nodeModulePaths(path.dirname(filename))
return mod
}
exports.default = function moduleRequire(p) {
try {
// attempt to get espree relative to eslint
const eslintPath = require.resolve('eslint')
const eslintModule = createModule(eslintPath)
return require(Module._resolveFilename(p, eslintModule))
} catch(err) { /* ignore */ }
try {
// try relative to entry point
return require.main.require(p)
} catch(err) { /* ignore */ }
// finally, try from here
return require(p)
}

129
web/node_modules/eslint-module-utils/moduleVisitor.js generated vendored Normal file
View File

@@ -0,0 +1,129 @@
"use strict"
exports.__esModule = true
/**
* Returns an object of node visitors that will call
* 'visitor' with every discovered module path.
*
* todo: correct function prototype for visitor
* @param {Function(String)} visitor [description]
* @param {[type]} options [description]
* @return {object}
*/
exports.default = function visitModules(visitor, options) {
// if esmodule is not explicitly disabled, it is assumed to be enabled
options = Object.assign({ esmodule: true }, options)
let ignoreRegExps = []
if (options.ignore != null) {
ignoreRegExps = options.ignore.map(p => new RegExp(p))
}
function checkSourceValue(source) {
if (source == null) return //?
// handle ignore
if (ignoreRegExps.some(re => re.test(source.value))) return
// fire visitor
visitor(source)
}
// for import-y declarations
function checkSource(node) {
checkSourceValue(node.source)
}
// for CommonJS `require` calls
// adapted from @mctep: http://git.io/v4rAu
function checkCommon(call) {
if (call.callee.type !== 'Identifier') return
if (call.callee.name !== 'require') return
if (call.arguments.length !== 1) return
const modulePath = call.arguments[0]
if (modulePath.type !== 'Literal') return
if (typeof modulePath.value !== 'string') return
checkSourceValue(modulePath)
}
function checkAMD(call) {
if (call.callee.type !== 'Identifier') return
if (call.callee.name !== 'require' &&
call.callee.name !== 'define') return
if (call.arguments.length !== 2) return
const modules = call.arguments[0]
if (modules.type !== 'ArrayExpression') return
for (let element of modules.elements) {
if (element.type !== 'Literal') continue
if (typeof element.value !== 'string') continue
if (element.value === 'require' ||
element.value === 'exports') continue // magic modules: http://git.io/vByan
checkSourceValue(element)
}
}
const visitors = {}
if (options.esmodule) {
Object.assign(visitors, {
'ImportDeclaration': checkSource,
'ExportNamedDeclaration': checkSource,
'ExportAllDeclaration': checkSource,
})
}
if (options.commonjs || options.amd) {
visitors['CallExpression'] = function (call) {
if (options.commonjs) checkCommon(call)
if (options.amd) checkAMD(call)
}
}
return visitors
}
/**
* make an options schema for the module visitor, optionally
* adding extra fields.
* @param {[type]} additionalProperties [description]
* @return {[type]} [description]
*/
function makeOptionsSchema(additionalProperties) {
const base = {
'type': 'object',
'properties': {
'commonjs': { 'type': 'boolean' },
'amd': { 'type': 'boolean' },
'esmodule': { 'type': 'boolean' },
'ignore': {
'type': 'array',
'minItems': 1,
'items': { 'type': 'string' },
'uniqueItems': true,
},
},
'additionalProperties': false,
}
if (additionalProperties){
for (let key in additionalProperties) {
base.properties[key] = additionalProperties[key]
}
}
return base
}
exports.makeOptionsSchema = makeOptionsSchema
/**
* json schema object for options parameter. can be used to build
* rule options schema object.
* @type {Object}
*/
exports.optionsSchema = makeOptionsSchema()

59
web/node_modules/eslint-module-utils/package.json generated vendored Normal file
View File

@@ -0,0 +1,59 @@
{
"_from": "eslint-module-utils@^2.0.0",
"_id": "eslint-module-utils@2.1.1",
"_inBundle": false,
"_integrity": "sha512-jDI/X5l/6D1rRD/3T43q8Qgbls2nq5km5KSqiwlyUbGo5+04fXhMKdCPhjwbqAa6HXWaMxj8Q4hQDIh7IadJQw==",
"_location": "/eslint-module-utils",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "eslint-module-utils@^2.0.0",
"name": "eslint-module-utils",
"escapedName": "eslint-module-utils",
"rawSpec": "^2.0.0",
"saveSpec": null,
"fetchSpec": "^2.0.0"
},
"_requiredBy": [
"/eslint-plugin-import"
],
"_resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.1.1.tgz",
"_shasum": "abaec824177613b8a95b299639e1b6facf473449",
"_spec": "eslint-module-utils@^2.0.0",
"_where": "/home/bilal/Saburly/slucajna-televizija/node_modules/eslint-plugin-import",
"author": {
"name": "Ben Mosher",
"email": "me@benmosher.com"
},
"bugs": {
"url": "https://github.com/benmosher/eslint-plugin-import/issues"
},
"bundleDependencies": false,
"dependencies": {
"debug": "^2.6.8",
"pkg-dir": "^1.0.0"
},
"deprecated": false,
"description": "Core utilities to support eslint-plugin-import and other module-related plugins.",
"engines": {
"node": ">=4"
},
"homepage": "https://github.com/benmosher/eslint-plugin-import#readme",
"keywords": [
"eslint-plugin-import",
"eslint",
"modules",
"esmodules"
],
"license": "MIT",
"name": "eslint-module-utils",
"repository": {
"type": "git",
"url": "git+https://github.com/benmosher/eslint-plugin-import.git"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"version": "2.1.1"
}

49
web/node_modules/eslint-module-utils/parse.js generated vendored Normal file
View File

@@ -0,0 +1,49 @@
"use strict"
exports.__esModule = true
const moduleRequire = require('./module-require').default
const extname = require('path').extname
const log = require('debug')('eslint-plugin-import:parse')
exports.default = function parse(path, content, context) {
if (context == null) throw new Error('need context to parse properly')
let parserOptions = context.parserOptions
const parserPath = getParserPath(path, context)
if (!parserPath) throw new Error('parserPath is required!')
// hack: espree blows up with frozen options
parserOptions = Object.assign({}, parserOptions)
parserOptions.ecmaFeatures = Object.assign({}, parserOptions.ecmaFeatures)
// always attach comments
parserOptions.attachComment = true
// provide the `filePath` like eslint itself does, in `parserOptions`
// https://github.com/eslint/eslint/blob/3ec436ee/lib/linter.js#L637
parserOptions.filePath = path
// require the parser relative to the main module (i.e., ESLint)
const parser = moduleRequire(parserPath)
return parser.parse(content, parserOptions)
}
function getParserPath(path, context) {
const parsers = context.settings['import/parsers']
if (parsers != null) {
const extension = extname(path)
for (let parserPath in parsers) {
if (parsers[parserPath].indexOf(extension) > -1) {
// use this alternate parser
log('using alt parser:', parserPath)
return parserPath
}
}
}
// default to use ESLint parser
return context.parserPath
}

187
web/node_modules/eslint-module-utils/resolve.js generated vendored Normal file
View File

@@ -0,0 +1,187 @@
"use strict"
exports.__esModule = true
const pkgDir = require('pkg-dir')
const fs = require('fs')
const path = require('path')
const hashObject = require('./hash').hashObject
, ModuleCache = require('./ModuleCache').default
const CASE_SENSITIVE_FS = !fs.existsSync(path.join(__dirname, 'reSOLVE.js'))
exports.CASE_SENSITIVE_FS = CASE_SENSITIVE_FS
const fileExistsCache = new ModuleCache()
// http://stackoverflow.com/a/27382838
exports.fileExistsWithCaseSync = function fileExistsWithCaseSync(filepath, cacheSettings) {
// don't care if the FS is case-sensitive
if (CASE_SENSITIVE_FS) return true
// null means it resolved to a builtin
if (filepath === null) return true
const parsedPath = path.parse(filepath)
, dir = parsedPath.dir
let result = fileExistsCache.get(filepath, cacheSettings)
if (result != null) return result
// base case
if (dir === '' || parsedPath.root === filepath) {
result = true
} else {
const filenames = fs.readdirSync(dir)
if (filenames.indexOf(parsedPath.base) === -1) {
result = false
} else {
result = fileExistsWithCaseSync(dir, cacheSettings)
}
}
fileExistsCache.set(filepath, result)
return result
}
function relative(modulePath, sourceFile, settings) {
return fullResolve(modulePath, sourceFile, settings).path
}
function fullResolve(modulePath, sourceFile, settings) {
// check if this is a bonus core module
const coreSet = new Set(settings['import/core-modules'])
if (coreSet != null && coreSet.has(modulePath)) return { found: true, path: null }
const sourceDir = path.dirname(sourceFile)
, cacheKey = sourceDir + hashObject(settings).digest('hex') + modulePath
const cacheSettings = ModuleCache.getSettings(settings)
const cachedPath = fileExistsCache.get(cacheKey, cacheSettings)
if (cachedPath !== undefined) return { found: true, path: cachedPath }
function cache(resolvedPath) {
fileExistsCache.set(cacheKey, resolvedPath)
}
function withResolver(resolver, config) {
function v1() {
try {
const resolved = resolver.resolveImport(modulePath, sourceFile, config)
if (resolved === undefined) return { found: false }
return { found: true, path: resolved }
} catch (err) {
return { found: false }
}
}
function v2() {
return resolver.resolve(modulePath, sourceFile, config)
}
switch (resolver.interfaceVersion) {
case 2:
return v2()
default:
case 1:
return v1()
}
}
const configResolvers = (settings['import/resolver']
|| { 'node': settings['import/resolve'] }) // backward compatibility
const resolvers = resolverReducer(configResolvers, new Map())
for (let pair of resolvers) {
let name = pair[0]
, config = pair[1]
const resolver = requireResolver(name, sourceFile)
, resolved = withResolver(resolver, config)
if (!resolved.found) continue
// else, counts
cache(resolved.path)
return resolved
}
// failed
// cache(undefined)
return { found: false }
}
exports.relative = relative
function resolverReducer(resolvers, map) {
if (resolvers instanceof Array) {
resolvers.forEach(r => resolverReducer(r, map))
return map
}
if (typeof resolvers === 'string') {
map.set(resolvers, null)
return map
}
if (typeof resolvers === 'object') {
for (let key in resolvers) {
map.set(key, resolvers[key])
}
return map
}
throw new Error('invalid resolver config')
}
function requireResolver(name, sourceFile) {
// Try to resolve package with conventional name
try {
return require(`eslint-import-resolver-${name}`)
} catch (err) { /* continue */ }
// Try to resolve package with custom name (@myorg/resolver-name)
try {
return require(name)
} catch (err) { /* continue */ }
// Try to resolve package with path, relative to closest package.json
// or current working directory
try {
const baseDir = pkgDir.sync(sourceFile) || process.cwd()
// absolute paths ignore base, so this covers both
return require(path.resolve(baseDir, name))
} catch (err) { /* continue */ }
// all else failed
throw new Error(`unable to load resolver "${name}".`)
}
const erroredContexts = new Set()
/**
* Given
* @param {string} p - module path
* @param {object} context - ESLint context
* @return {string} - the full module filesystem path;
* null if package is core;
* undefined if not found
*/
function resolve(p, context) {
try {
return relative( p
, context.getFilename()
, context.settings
)
} catch (err) {
if (!erroredContexts.has(context)) {
context.report({
message: `Resolve error: ${err.message}`,
loc: { line: 1, column: 0 },
})
erroredContexts.add(context)
}
}
}
resolve.relative = relative
exports.default = resolve

30
web/node_modules/eslint-module-utils/unambiguous.js generated vendored Normal file
View File

@@ -0,0 +1,30 @@
'use strict'
exports.__esModule = true
const pattern = /(^|;)\s*(export|import)((\s+\w)|(\s*[{*]))/m
/**
* detect possible imports/exports without a full parse.
*
* A negative test means that a file is definitely _not_ a module.
* A positive test means it _could_ be.
*
* Not perfect, just a fast way to disqualify large non-ES6 modules and
* avoid a parse.
* @type {RegExp}
*/
exports.test = function isMaybeUnambiguousModule(content) {
return pattern.test(content)
}
// future-/Babel-proof at the expense of being a little loose
const unambiguousNodeType = /^(Exp|Imp)ort.*Declaration$/
/**
* Given an AST, return true if the AST unambiguously represents a module.
* @param {Program node} ast
* @return {Boolean}
*/
exports.isModule = function isUnambiguousModule(ast) {
return ast.body.some(node => unambiguousNodeType.test(node.type))
}