Galerie und tage
This commit is contained in:
45
node_modules/filenamify/index.js
generated
vendored
45
node_modules/filenamify/index.js
generated
vendored
@@ -1,46 +1,43 @@
|
||||
'use strict';
|
||||
const path = require('path');
|
||||
const trimRepeated = require('trim-repeated');
|
||||
const filenameReservedRegex = require('filename-reserved-regex');
|
||||
const stripOuter = require('strip-outer');
|
||||
var path = require('path');
|
||||
var trimRepeated = require('trim-repeated');
|
||||
var filenameReservedRegex = require('filename-reserved-regex');
|
||||
var stripOuter = require('strip-outer');
|
||||
|
||||
// Doesn't make sense to have longer filenames
|
||||
const MAX_FILENAME_LENGTH = 100;
|
||||
// doesn't make sense to have longer filenames
|
||||
var MAX_FILENAME_LENGTH = 100;
|
||||
|
||||
const reControlChars = /[\u0000-\u001f\u0080-\u009f]/g; // eslint-disable-line no-control-regex
|
||||
const reRelativePath = /^\.+/;
|
||||
var reControlChars = /[\x00-\x1f\x80-\x9f]/g;
|
||||
var reRelativePath = /^\.+/;
|
||||
|
||||
const fn = (string, options) => {
|
||||
if (typeof string !== 'string') {
|
||||
var fn = module.exports = function (str, opts) {
|
||||
if (typeof str !== 'string') {
|
||||
throw new TypeError('Expected a string');
|
||||
}
|
||||
|
||||
options = options || {};
|
||||
opts = opts || {};
|
||||
|
||||
const replacement = options.replacement === undefined ? '!' : options.replacement;
|
||||
var replacement = opts.replacement || '!';
|
||||
|
||||
if (filenameReservedRegex().test(replacement) && reControlChars.test(replacement)) {
|
||||
throw new Error('Replacement string cannot contain reserved filename characters');
|
||||
}
|
||||
|
||||
string = string.replace(filenameReservedRegex(), replacement);
|
||||
string = string.replace(reControlChars, replacement);
|
||||
string = string.replace(reRelativePath, replacement);
|
||||
str = str.replace(filenameReservedRegex(), replacement);
|
||||
str = str.replace(reControlChars, replacement);
|
||||
str = str.replace(reRelativePath, replacement);
|
||||
|
||||
if (replacement.length > 0) {
|
||||
string = trimRepeated(string, replacement);
|
||||
string = string.length > 1 ? stripOuter(string, replacement) : string;
|
||||
str = trimRepeated(str, replacement);
|
||||
str = str.length > 1 ? stripOuter(str, replacement) : str;
|
||||
}
|
||||
|
||||
string = filenameReservedRegex.windowsNames().test(string) ? string + replacement : string;
|
||||
string = string.slice(0, MAX_FILENAME_LENGTH);
|
||||
str = str.slice(0, MAX_FILENAME_LENGTH);
|
||||
|
||||
return string;
|
||||
return str;
|
||||
};
|
||||
|
||||
fn.path = (pth, options) => {
|
||||
fn.path = function (pth, opts) {
|
||||
pth = path.resolve(pth);
|
||||
return path.join(path.dirname(pth), fn(path.basename(pth), options));
|
||||
return path.join(path.dirname(pth), fn(path.basename(pth), opts));
|
||||
};
|
||||
|
||||
module.exports = fn;
|
||||
|
||||
20
node_modules/filenamify/license
generated
vendored
20
node_modules/filenamify/license
generated
vendored
@@ -1,9 +1,21 @@
|
||||
MIT License
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
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:
|
||||
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 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.
|
||||
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.
|
||||
|
||||
67
node_modules/filenamify/package.json
generated
vendored
67
node_modules/filenamify/package.json
generated
vendored
@@ -1,55 +1,23 @@
|
||||
{
|
||||
"_from": "filenamify@^2.0.0",
|
||||
"_id": "filenamify@2.1.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-ICw7NTT6RsDp2rnYKVd8Fu4cr6ITzGy3+u4vUujPkabyaz+03F24NWEX7fs5fp+kBonlaqPH8fAO2NM+SXt/JA==",
|
||||
"_location": "/filenamify",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "filenamify@^2.0.0",
|
||||
"name": "filenamify",
|
||||
"escapedName": "filenamify",
|
||||
"rawSpec": "^2.0.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^2.0.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/bin-wrapper/download",
|
||||
"/download"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/filenamify/-/filenamify-2.1.0.tgz",
|
||||
"_shasum": "88faf495fb1b47abfd612300002a16228c677ee9",
|
||||
"_spec": "filenamify@^2.0.0",
|
||||
"_where": "/var/www/html/jason/WeihnachtenMelly/node_modules/download",
|
||||
"name": "filenamify",
|
||||
"version": "1.2.1",
|
||||
"description": "Convert a string to a valid safe filename",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/filenamify",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/sindresorhus/filenamify/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"filename-reserved-regex": "^2.0.0",
|
||||
"strip-outer": "^1.0.0",
|
||||
"trim-repeated": "^1.0.0"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "Convert a string to a valid safe filename",
|
||||
"devDependencies": {
|
||||
"ava": "*",
|
||||
"xo": "*"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"homepage": "https://github.com/sindresorhus/filenamify#readme",
|
||||
"keywords": [
|
||||
"filename",
|
||||
"safe",
|
||||
@@ -63,14 +31,13 @@
|
||||
"valid",
|
||||
"dirname"
|
||||
],
|
||||
"license": "MIT",
|
||||
"name": "filenamify",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/sindresorhus/filenamify.git"
|
||||
"dependencies": {
|
||||
"filename-reserved-regex": "^1.0.0",
|
||||
"strip-outer": "^1.0.0",
|
||||
"trim-repeated": "^1.0.0"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava"
|
||||
},
|
||||
"version": "2.1.0"
|
||||
"devDependencies": {
|
||||
"ava": "*",
|
||||
"xo": "*"
|
||||
}
|
||||
}
|
||||
|
||||
4
node_modules/filenamify/readme.md
generated
vendored
4
node_modules/filenamify/readme.md
generated
vendored
@@ -8,7 +8,7 @@ On Unix-like systems `/` is reserved and [`<>:"/\|?*`](http://msdn.microsoft.com
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install filenamify
|
||||
$ npm install --save filenamify
|
||||
```
|
||||
|
||||
|
||||
@@ -55,8 +55,6 @@ Cannot contain: `<` `>` `:` `"` `/` `\` `|` `?` `*`
|
||||
|
||||
- [filenamify-url](https://github.com/sindresorhus/filenamify-url) - Convert a URL to a valid filename
|
||||
- [valid-filename](https://github.com/sindresorhus/valid-filename) - Check if a string is a valid filename
|
||||
- [unused-filename](https://github.com/sindresorhus/unused-filename) - Get a unused filename by appending a number if it exists
|
||||
- [slugify](https://github.com/sindresorhus/slugify) - Slugify a string
|
||||
|
||||
|
||||
## License
|
||||
|
||||
Reference in New Issue
Block a user