mirror of
https://github.com/SamEyeBam/animate.git
synced 2025-09-28 06:55:25 +00:00
larry babby and threejs for glsl
This commit is contained in:
21
webGl/my-threejs-test/node_modules/@parcel/markdown-ansi/LICENSE
generated
vendored
Normal file
21
webGl/my-threejs-test/node_modules/@parcel/markdown-ansi/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2017-present Devon Govett
|
||||
|
||||
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.
|
29
webGl/my-threejs-test/node_modules/@parcel/markdown-ansi/lib/markdown-ansi.js
generated
vendored
Normal file
29
webGl/my-threejs-test/node_modules/@parcel/markdown-ansi/lib/markdown-ansi.js
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = markdownParser;
|
||||
function _chalk() {
|
||||
const data = _interopRequireDefault(require("chalk"));
|
||||
_chalk = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
// double char markdown matchers
|
||||
const BOLD_REGEX = /\*{2}([^*]+)\*{2}/g;
|
||||
const UNDERLINE_REGEX = /_{2}([^_]+)_{2}/g;
|
||||
const STRIKETHROUGH_REGEX = /~{2}([^~]+)~{2}/g;
|
||||
|
||||
// single char markdown matchers
|
||||
const ITALIC_REGEX = /(?<!\\)\*(.+)(?<!\\)\*|(?<!\\)_(.+)(?<!\\)_/g;
|
||||
function markdownParser(input) {
|
||||
input = input.replace(BOLD_REGEX, (...args) => _chalk().default.bold(args[1]));
|
||||
input = input.replace(UNDERLINE_REGEX, (...args) => _chalk().default.underline(args[1]));
|
||||
input = input.replace(STRIKETHROUGH_REGEX, (...args) => _chalk().default.strikethrough(args[1]));
|
||||
input = input.replace(ITALIC_REGEX, (...args) => _chalk().default.italic(args[1] || args[2]));
|
||||
input = input.replace(/(?<!\\)\\/g, '');
|
||||
return input;
|
||||
}
|
26
webGl/my-threejs-test/node_modules/@parcel/markdown-ansi/package.json
generated
vendored
Normal file
26
webGl/my-threejs-test/node_modules/@parcel/markdown-ansi/package.json
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"name": "@parcel/markdown-ansi",
|
||||
"version": "2.12.0",
|
||||
"description": "Blazing fast, zero configuration web application bundler",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/parcel"
|
||||
},
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/parcel-bundler/parcel.git"
|
||||
},
|
||||
"main": "lib/markdown-ansi.js",
|
||||
"source": "src/markdown-ansi.js",
|
||||
"engines": {
|
||||
"node": ">= 12.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"chalk": "^4.1.0"
|
||||
},
|
||||
"gitHead": "2059029ee91e5f03a273b0954d3e629d7375f986"
|
||||
}
|
24
webGl/my-threejs-test/node_modules/@parcel/markdown-ansi/src/markdown-ansi.js
generated
vendored
Normal file
24
webGl/my-threejs-test/node_modules/@parcel/markdown-ansi/src/markdown-ansi.js
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
// @flow
|
||||
import chalk from 'chalk';
|
||||
|
||||
// double char markdown matchers
|
||||
const BOLD_REGEX = /\*{2}([^*]+)\*{2}/g;
|
||||
const UNDERLINE_REGEX = /_{2}([^_]+)_{2}/g;
|
||||
const STRIKETHROUGH_REGEX = /~{2}([^~]+)~{2}/g;
|
||||
|
||||
// single char markdown matchers
|
||||
const ITALIC_REGEX = /(?<!\\)\*(.+)(?<!\\)\*|(?<!\\)_(.+)(?<!\\)_/g;
|
||||
|
||||
export default function markdownParser(input: string): string {
|
||||
input = input.replace(BOLD_REGEX, (...args) => chalk.bold(args[1]));
|
||||
input = input.replace(UNDERLINE_REGEX, (...args) => chalk.underline(args[1]));
|
||||
input = input.replace(STRIKETHROUGH_REGEX, (...args) =>
|
||||
chalk.strikethrough(args[1]),
|
||||
);
|
||||
input = input.replace(ITALIC_REGEX, (...args) =>
|
||||
chalk.italic(args[1] || args[2]),
|
||||
);
|
||||
input = input.replace(/(?<!\\)\\/g, '');
|
||||
|
||||
return input;
|
||||
}
|
40
webGl/my-threejs-test/node_modules/@parcel/markdown-ansi/test/markdown-ansi.js
generated
vendored
Normal file
40
webGl/my-threejs-test/node_modules/@parcel/markdown-ansi/test/markdown-ansi.js
generated
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
import assert from 'assert';
|
||||
import chalk from 'chalk';
|
||||
|
||||
import mdAnsi from '../src/markdown-ansi';
|
||||
|
||||
process.env.FORCE_COLOR = 3;
|
||||
|
||||
describe('markdown-ansi', () => {
|
||||
if (!chalk.supportsColor) return;
|
||||
|
||||
it('should support asteriks for bold and italic', () => {
|
||||
let res = mdAnsi('**bold** *italic*');
|
||||
assert.equal(res, '\u001b[1mbold\u001b[22m \u001b[3mitalic\u001b[23m');
|
||||
});
|
||||
|
||||
it('should support underscores for underlined and italic', () => {
|
||||
let res = mdAnsi('__underline__ _italic_');
|
||||
assert.equal(res, '\u001b[4munderline\u001b[24m \u001b[3mitalic\u001b[23m');
|
||||
});
|
||||
|
||||
it('should support combination of bold and underline', () => {
|
||||
let res = mdAnsi('**bold _italic_**');
|
||||
assert.equal(res, '\u001b[1mbold \u001b[3mitalic\u001b[23m\u001b[22m');
|
||||
});
|
||||
|
||||
it('should support strikethrough', () => {
|
||||
let res = mdAnsi('~~strikethrough~~');
|
||||
assert.equal(res, '\u001b[9mstrikethrough\u001b[29m');
|
||||
});
|
||||
|
||||
it('should support escape character', () => {
|
||||
let res = mdAnsi('\\*\\*bold\\*\\* \\\\escape\\\\');
|
||||
assert.equal(res, '**bold** \\escape\\');
|
||||
});
|
||||
|
||||
it('should support italic with escape character', () => {
|
||||
let res = mdAnsi('\\__italic_\\_');
|
||||
assert.equal(res, '_\u001b[3mitalic\u001b[23m_');
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user