Deployed the page to Github Pages.
This commit is contained in:
parent
1d79754e93
commit
2c89899458
62797 changed files with 6551425 additions and 15279 deletions
8
node_modules/filenamify/filenamify-path.d.ts
generated
vendored
Normal file
8
node_modules/filenamify/filenamify-path.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,8 @@
|
|||
import filenamify = require('./filenamify');
|
||||
|
||||
/**
|
||||
Convert the filename in a path a valid filename and return the augmented path.
|
||||
*/
|
||||
declare const filenamifyPath: (path: string, options?: filenamify.Options) => string;
|
||||
|
||||
export = filenamifyPath;
|
10
node_modules/filenamify/filenamify-path.js
generated
vendored
Normal file
10
node_modules/filenamify/filenamify-path.js
generated
vendored
Normal file
|
@ -0,0 +1,10 @@
|
|||
'use strict';
|
||||
const path = require('path');
|
||||
const filenamify = require('./filenamify');
|
||||
|
||||
const filenamifyPath = (filePath, options) => {
|
||||
filePath = path.resolve(filePath);
|
||||
return path.join(path.dirname(filePath), filenamify(path.basename(filePath), options));
|
||||
};
|
||||
|
||||
module.exports = filenamifyPath;
|
39
node_modules/filenamify/filenamify.d.ts
generated
vendored
Normal file
39
node_modules/filenamify/filenamify.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,39 @@
|
|||
declare namespace filenamify {
|
||||
interface Options {
|
||||
/**
|
||||
String to use as replacement for reserved filename characters.
|
||||
|
||||
Cannot contain: `<` `>` `:` `"` `/` `\` `|` `?` `*`
|
||||
|
||||
@default '!'
|
||||
*/
|
||||
readonly replacement?: string;
|
||||
|
||||
/**
|
||||
Truncate the filename to the given length.
|
||||
|
||||
Systems generally allow up to 255 characters, but we default to 100 for usability reasons.
|
||||
|
||||
@default 100
|
||||
*/
|
||||
readonly maxLength?: number;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Convert a string to a valid filename.
|
||||
|
||||
@example
|
||||
```
|
||||
import filenamify = require('filenamify');
|
||||
|
||||
filenamify('<foo/bar>');
|
||||
//=> 'foo!bar'
|
||||
|
||||
filenamify('foo:"bar"', {replacement: '🐴'});
|
||||
//=> 'foo🐴bar'
|
||||
```
|
||||
*/
|
||||
declare const filenamify: (string: string, options?: filenamify.Options) => string;
|
||||
|
||||
export = filenamify;
|
40
node_modules/filenamify/filenamify.js
generated
vendored
Normal file
40
node_modules/filenamify/filenamify.js
generated
vendored
Normal file
|
@ -0,0 +1,40 @@
|
|||
'use strict';
|
||||
const trimRepeated = require('trim-repeated');
|
||||
const filenameReservedRegex = require('filename-reserved-regex');
|
||||
const stripOuter = require('strip-outer');
|
||||
|
||||
// Doesn't make sense to have longer filenames
|
||||
const MAX_FILENAME_LENGTH = 100;
|
||||
|
||||
const reControlChars = /[\u0000-\u001f\u0080-\u009f]/g; // eslint-disable-line no-control-regex
|
||||
const reRelativePath = /^\.+/;
|
||||
const reTrailingPeriods = /\.+$/;
|
||||
|
||||
const filenamify = (string, options = {}) => {
|
||||
if (typeof string !== 'string') {
|
||||
throw new TypeError('Expected a string');
|
||||
}
|
||||
|
||||
const replacement = options.replacement === undefined ? '!' : options.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);
|
||||
string = string.replace(reTrailingPeriods, '');
|
||||
|
||||
if (replacement.length > 0) {
|
||||
string = trimRepeated(string, replacement);
|
||||
string = string.length > 1 ? stripOuter(string, replacement) : string;
|
||||
}
|
||||
|
||||
string = filenameReservedRegex.windowsNames().test(string) ? string + replacement : string;
|
||||
string = string.slice(0, typeof options.maxLength === 'number' ? options.maxLength : MAX_FILENAME_LENGTH);
|
||||
|
||||
return string;
|
||||
};
|
||||
|
||||
module.exports = filenamify;
|
24
node_modules/filenamify/index.d.ts
generated
vendored
Normal file
24
node_modules/filenamify/index.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,24 @@
|
|||
import filenamify = require('./filenamify');
|
||||
import filenamifyPath = require('./filenamify-path');
|
||||
|
||||
declare const filenamifyCombined: {
|
||||
/**
|
||||
Convert a string to a valid filename.
|
||||
|
||||
@example
|
||||
```
|
||||
import filenamify = require('filenamify');
|
||||
|
||||
filenamify('<foo/bar>');
|
||||
//=> 'foo!bar'
|
||||
|
||||
filenamify('foo:"bar"', {replacement: '🐴'});
|
||||
//=> 'foo🐴bar'
|
||||
```
|
||||
*/
|
||||
(string: string, options?: filenamify.Options): string;
|
||||
|
||||
path: typeof filenamifyPath;
|
||||
};
|
||||
|
||||
export = filenamifyCombined;
|
8
node_modules/filenamify/index.js
generated
vendored
Normal file
8
node_modules/filenamify/index.js
generated
vendored
Normal file
|
@ -0,0 +1,8 @@
|
|||
'use strict';
|
||||
const filenamify = require('./filenamify');
|
||||
const filenamifyPath = require('./filenamify-path');
|
||||
|
||||
const filenamifyCombined = filenamify;
|
||||
filenamifyCombined.path = filenamifyPath;
|
||||
|
||||
module.exports = filenamify;
|
9
node_modules/filenamify/license
generated
vendored
Normal file
9
node_modules/filenamify/license
generated
vendored
Normal file
|
@ -0,0 +1,9 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://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:
|
||||
|
||||
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.
|
54
node_modules/filenamify/package.json
generated
vendored
Normal file
54
node_modules/filenamify/package.json
generated
vendored
Normal file
|
@ -0,0 +1,54 @@
|
|||
{
|
||||
"name": "filenamify",
|
||||
"version": "4.3.0",
|
||||
"description": "Convert a string to a valid safe filename",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/filenamify",
|
||||
"funding": "https://github.com/sponsors/sindresorhus",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "https://sindresorhus.com"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava && tsd"
|
||||
},
|
||||
"files": [
|
||||
"filenamify-path.d.ts",
|
||||
"filenamify-path.js",
|
||||
"filenamify.d.ts",
|
||||
"filenamify.js",
|
||||
"index.d.ts",
|
||||
"index.js"
|
||||
],
|
||||
"exports": {
|
||||
".": "./index.js",
|
||||
"./browser": "./filenamify.js"
|
||||
},
|
||||
"keywords": [
|
||||
"filename",
|
||||
"safe",
|
||||
"sanitize",
|
||||
"file",
|
||||
"name",
|
||||
"string",
|
||||
"path",
|
||||
"filepath",
|
||||
"convert",
|
||||
"valid",
|
||||
"dirname"
|
||||
],
|
||||
"dependencies": {
|
||||
"filename-reserved-regex": "^2.0.0",
|
||||
"strip-outer": "^1.0.1",
|
||||
"trim-repeated": "^1.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"ava": "^1.4.1",
|
||||
"tsd": "^0.7.1",
|
||||
"xo": "^0.24.0"
|
||||
}
|
||||
}
|
74
node_modules/filenamify/readme.md
generated
vendored
Normal file
74
node_modules/filenamify/readme.md
generated
vendored
Normal file
|
@ -0,0 +1,74 @@
|
|||
# filenamify
|
||||
|
||||
> Convert a string to a valid safe filename
|
||||
|
||||
On Unix-like systems, `/` is reserved. On Windows, [`<>:"/\|?*`](http://msdn.microsoft.com/en-us/library/aa365247%28VS.85%29#naming_conventions) along with trailing periods are reserved.
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install filenamify
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const filenamify = require('filenamify');
|
||||
|
||||
filenamify('<foo/bar>');
|
||||
//=> 'foo!bar'
|
||||
|
||||
filenamify('foo:"bar"', {replacement: '🐴'});
|
||||
//=> 'foo🐴bar'
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### filenamify(string, options?)
|
||||
|
||||
Convert a string to a valid filename.
|
||||
|
||||
### filenamify.path(path, options?)
|
||||
|
||||
Convert the filename in a path a valid filename and return the augmented path.
|
||||
|
||||
#### options
|
||||
|
||||
Type: `object`
|
||||
|
||||
##### replacement
|
||||
|
||||
Type: `string`\
|
||||
Default: `'!'`
|
||||
|
||||
String to use as replacement for reserved filename characters.
|
||||
|
||||
Cannot contain: `<` `>` `:` `"` `/` `\` `|` `?` `*`
|
||||
|
||||
##### maxLength
|
||||
|
||||
Type: `number`\
|
||||
Default: `100`
|
||||
|
||||
Truncate the filename to the given length.
|
||||
|
||||
Systems generally allow up to 255 characters, but we default to 100 for usability reasons.
|
||||
|
||||
## Browser-only import
|
||||
|
||||
You can also import `filenamify/browser`, which only imports `filenamify` and not `filenamify.path`, which relies on `path` being available or polyfilled. Importing `filenamify` this way is therefore useful when it is shipped using `webpack` or similar tools, and if `filenamify.path` is not needed.
|
||||
|
||||
```js
|
||||
const filenamify = require('filenamify/browser');
|
||||
|
||||
filenamify('<foo/bar>');
|
||||
//=> 'foo!bar'
|
||||
```
|
||||
|
||||
## Related
|
||||
|
||||
- [filenamify-cli](https://github.com/sindresorhus/filenamify-cli) - CLI for this module
|
||||
- [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
|
Loading…
Add table
Add a link
Reference in a new issue