Commit bc585f2a authored by Akari Labs's avatar Akari Labs

line endings i guess

parent f3c05910
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
*.lcov
# nyc test coverage
.nyc_output
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# TypeScript v1 declaration files
typings/
# TypeScript cache
*.tsbuildinfo
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
.env
.env.test
# parcel-bundler cache (https://parceljs.org/)
.cache
# next.js build output
.next
# nuxt.js build output
.nuxt
# vuepress build output
.vuepress/dist
# Serverless directories
.serverless/
# FuseBox cache
.fusebox/
# DynamoDB Local files
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
*.lcov
# nyc test coverage
.nyc_output
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# TypeScript v1 declaration files
typings/
# TypeScript cache
*.tsbuildinfo
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
.env
.env.test
# parcel-bundler cache (https://parceljs.org/)
.cache
# next.js build output
.next
# nuxt.js build output
.nuxt
# vuepress build output
.vuepress/dist
# Serverless directories
.serverless/
# FuseBox cache
.fusebox/
# DynamoDB Local files
.dynamodb/
\ No newline at end of file
MIT License
Copyright (c) 2019 astra and caela akari (nocebo and lp0)
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.
MIT License
Copyright (c) 2019 astra and caela akari (nocebo and lp0)
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.
# cascade-webpack
# cascade-webpack
rip apart webpack modules with ease
\ No newline at end of file
function createSymbols(arr) {
const r = {};
arr.forEach(k => r[k] = Symbol(k));
return r;
}
const style = createSymbols(['func', 'array', 'unknown']);
module.exports = {
hookWebpack(pushHook, mod) {
var _webpack, _push;
var _style = style.unknown;
var _insmod_acc = 9000;
// insert a module into webpack
function insmod(mod) {
if (mod === undefined) return;
switch (_style) {
case style.func:
_webpack([++_insmod_acc], [mod], [0]);
break;
case style.array:
_push.apply(_webpack, [[[++_insmod_acc], { cascade: mod }, [['cascade']]]]);
break;
default:
console.warn('cant insmod, unrecognized webpack type');
break;
}
}
Object.defineProperty(window, 'webpackJsonp', {
get: () => _webpack,
set(webpack) {
switch (typeof webpack) {
case 'function':
if (webpack.length === 3 || webpack.length === 2) {
// probably just a relatively normal webpack config
// we naively assume that if there are 2 parameters, it will still be ok
// pleromafe's webpack doesnt take a third parameter, but luckily javascript doesnt give a fuck
_style = style.func;
_webpack = (x, mod, main) => webpack(x, pushHook(mod), main);
}
else {
// god fucking damn it
// okay i have no fucking idea what to do with you
console.warn('cant hook webpack: unrecognized prototype for webpackJsonp');
_webpack = webpack;
return;
}
// hacky but i dont really know how else to go about this
// pleromafe's webpack fails if we insmod before returning from webpackJsonp setter
setTimeout(() => insmod(mod), 10);
break;
case 'object':
if (webpack instanceof Array && webpack.push) {
_style = style.array;
if (webpack.push.hooked || webpack.push === Array.prototype.push) {
_webpack = webpack;
return;
}
_push = webpack.push;
webpack.push = (x, mod, main) => {
if (!mod) {
mod = x[1];
main = x[2];
x = x[0];
}
return _push.apply(webpack, [[x, pushHook(mod), main]]);
}
webpack.push.hooked = true;
_webpack = webpack;
insmod(mod);
}
else return console.warn('cant hook webpack: webpackJsonp is an object, but isnt an array');
break;
default:
console.warn('cant hook webpack: i have no idea what webpackJsonp even is');
_webpack = webpack;
return;
}
}
});
}
function createSymbols(arr) {
const r = {};
arr.forEach(k => r[k] = Symbol(k));
return r;
}
const style = createSymbols(['func', 'array', 'unknown']);
module.exports = {
hookWebpack(pushHook, mod) {
var _webpack, _push;
var _style = style.unknown;
var _insmod_acc = 9000;
// insert a module into webpack
function insmod(mod) {
if (mod === undefined) return;
switch (_style) {
case style.func:
_webpack([++_insmod_acc], [mod], [0]);
break;
case style.array:
_push.apply(_webpack, [[[++_insmod_acc], { cascade: mod }, [['cascade']]]]);
break;
default:
console.warn('cant insmod, unrecognized webpack type');
break;
}
}
Object.defineProperty(window, 'webpackJsonp', {
get: () => _webpack,
set(webpack) {
switch (typeof webpack) {
case 'function':
if (webpack.length === 3 || webpack.length === 2) {
// probably just a relatively normal webpack config
// we naively assume that if there are 2 parameters, it will still be ok
// pleromafe's webpack doesnt take a third parameter, but luckily javascript doesnt give a fuck
_style = style.func;
_webpack = (x, mod, main) => webpack(x, pushHook(mod), main);
}
else {
// god fucking damn it
// okay i have no fucking idea what to do with you
console.warn('cant hook webpack: unrecognized prototype for webpackJsonp');
_webpack = webpack;
return;
}
// hacky but i dont really know how else to go about this
// pleromafe's webpack fails if we insmod before returning from webpackJsonp setter
setTimeout(() => insmod(mod), 10);
break;
case 'object':
if (webpack instanceof Array && webpack.push) {
_style = style.array;
if (webpack.push.hooked || webpack.push === Array.prototype.push) {
_webpack = webpack;
return;
}
_push = webpack.push;
webpack.push = (x, mod, main) => {
if (!mod) {
mod = x[1];
main = x[2];
x = x[0];
}
return _push.apply(webpack, [[x, pushHook(mod), main]]);
}
webpack.push.hooked = true;
_webpack = webpack;
insmod(mod);
}
else return console.warn('cant hook webpack: webpackJsonp is an object, but isnt an array');
break;
default:
console.warn('cant hook webpack: i have no idea what webpackJsonp even is');
_webpack = webpack;
return;
}
}
});
}
};
\ No newline at end of file
/*
cascade.webpack 1.2
Copyright 2019 astra akari (nocebo) and caela akari (lp0)
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.
*/
const abstraction = require('webpack.abstraction');
const moduleInfo = [];
const replacements = [];
const preCtor = [];
const postCtor = [];
function ctorSearchToFunc(cond) {
if (typeof cond === 'function') return cond;
if (typeof cond === 'string') return info => info.ctor.toString().indexOf(cond) !== -1;
if (Array.isArray(cond)) return info => cond.filter(s => info.ctor.toString().indexOf(s) !== -1).length > 0;
if (cond instanceof RegExp) return info => info.ctor.toString().match(cond);
}
function callbackSearchToFunc(cond) {
if (typeof cond === 'function') return cond;
if (typeof cond === 'string') return info => info.module.exports && ((!!info.module.exports[cond]) || (info.module.exports.default && !!info.module.exports.default[cond]));
if (Array.isArray(cond)) return info => info.module.exports && ((cond.filter(s => info.module.exports[s]).length === cond.length) || (info.module.exports.default && cond.filter(s => info.module.exports.default[s]).length === cond.length));
}
const search = {
byCtor(search) {
const searchFunc = ctorSearchToFunc(search);
return moduleInfo.filter(searchFunc);
},
byCallback(search) {
const searchFunc = callbackSearchToFunc(search);
return moduleInfo.filter(searchFunc);
},
moduleInfo: moduleInfo
};
function cascadeModule(_self, _exports, _require) {
search.require = _require;
}
function exportHook(_self, _exports, _require, _ctor) {
const modinfo = {
ctor: _ctor,
module: _self
};
moduleInfo.push(modinfo);
preCtor.filter(c => c.condition(modinfo)).forEach(c => c.callback(modinfo));
modinfo.ctor(_self, _exports, _require);
postCtor.filter(c => c.condition(modinfo)).forEach(c => c.callback(modinfo));
}
function processModule(mod, i) {
if (!mod) return mod;
var ctorstr = mod.toString();
replacements.forEach(set => {
if (typeof set === 'function') set(ctorstr);
else {
if (
typeof set.search === 'function' ? set.search(ctorstr) :
set.search instanceof RegExp ? ctorstr.match(set.search) :
ctorstr.indexOf(set.search) != -1
) {
console.debug(`patching module ${i} (${set.search})`);
if (typeof set.search === 'function' && typeof set.replace !== 'function')
throw 'function search must have function replace';
ctorstr = typeof set.replace === 'function' ?
set.replace(ctorstr) :
ctorstr.replace(set.search, set.replace);
}
}
});
return (s, e, r) => exportHook(s, e, r, eval(`(${ctorstr})`));
}
function pushHook(mod) {
if (Array.isArray(mod)) {
console.debug(`processing ${mod.length} modules (in array)`);
for (var i in mod) mod[i] = processModule(mod[i], i);
}
else if (typeof mod === 'object') {
var keys = Object.keys(mod);
console.debug(`processing ${keys.length} modules (in object)`);
keys.forEach(i => mod[i] = processModule(mod[i], i));
}
/*else if (typeof mod === 'function') {
console.debug(`processing a module (single)`);
mod = processModule(mod);
}*/
else {
console.warn(`weird type passed to push (${typeof mod}); ignoring it`);
console.debug(mod);
}
return mod;
}
function hookWebpack() {
console.debug('hooking webpackJsonp');
abstraction.hookWebpack(pushHook, cascadeModule);
}
module.exports = {
search, hookWebpack,
replacements, preCtor, postCtor,
preload() {
hookWebpack();
},
callbacks: {
cascade(j) {
const defines = j.cascade;
if (defines.replacements) defines.replacements.forEach(replacement =>
replacements.push(replacement)
);
if (defines.preCtor) defines.preCtor.forEach(callback => {
callback.condition = ctorSearchToFunc(callback.condition);
preCtor.push(callback);
});
if (defines.postCtor) defines.postCtor.forEach(callback => {
callback.condition = callbackSearchToFunc(callback.condition);
postCtor.push(callback);
});
}
}
/*
cascade.webpack 1.2
Copyright 2019 astra akari (nocebo) and caela akari (lp0)
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.
*/
const abstraction = require('webpack.abstraction');
const moduleInfo = [];
const replacements = [];
const preCtor = [];
const postCtor = [];
function ctorSearchToFunc(cond) {
if (typeof cond === 'function') return cond;
if (typeof cond === 'string') return info => info.ctor.toString().indexOf(cond) !== -1;
if (Array.isArray(cond)) return info => cond.filter(s => info.ctor.toString().indexOf(s) !== -1).length > 0;
if (cond instanceof RegExp) return info => info.ctor.toString().match(cond);
}
function callbackSearchToFunc(cond) {
if (typeof cond === 'function') return cond;
if (typeof cond === 'string') return info => info.module.exports && ((!!info.module.exports[cond]) || (info.module.exports.default && !!info.module.exports.default[cond]));
if (Array.isArray(cond)) return info => info.module.exports && ((cond.filter(s => info.module.exports[s]).length === cond.length) || (info.module.exports.default && cond.filter(s => info.module.exports.default[s]).length === cond.length));
}
const search = {
byCtor(search) {
const searchFunc = ctorSearchToFunc(search);
return moduleInfo.filter(searchFunc);
},
byCallback(search) {
const searchFunc = callbackSearchToFunc(search);
return moduleInfo.filter(searchFunc);
},
moduleInfo: moduleInfo
};
function cascadeModule(_self, _exports, _require) {
search.require = _require;
}
function exportHook(_self, _exports, _require, _ctor) {
const modinfo = {
ctor: _ctor,
module: _self
};
moduleInfo.push(modinfo);
preCtor.filter(c => c.condition(modinfo)).forEach(c => c.callback(modinfo));
modinfo.ctor(_self, _exports, _require);
postCtor.filter(c => c.condition(modinfo)).forEach(c => c.callback(modinfo));
}
function processModule(mod, i) {
if (!mod) return mod;
var ctorstr = mod.toString();
replacements.forEach(set => {
if (typeof set === 'function') set(ctorstr);
else {
if (
typeof set.search === 'function' ? set.search(ctorstr) :
set.search instanceof RegExp ? ctorstr.match(set.search) :
ctorstr.indexOf(set.search) != -1
) {
console.debug(`patching module ${i} (${set.search})`);
if (typeof set.search === 'function' && typeof set.replace !== 'function')
throw 'function search must have function replace';
ctorstr = typeof set.replace === 'function' ?
set.replace(ctorstr) :
ctorstr.replace(set.search, set.replace);
}
}