Commit b41e2720 authored by Christopher Fullarton's avatar Christopher Fullarton

Removes unused files

parent 46e6d570
import { IProjectMetaData } from '../interfaces/IProjectMetaData';
import { i18nFileBaseLocation, projectAppLocation, projectBaseLocation, projectGitLocation } from '../statistics';
export function getProjectMetadata(project: string): IProjectMetaData {
return {
i18nFileBaseLocation: i18nFileBaseLocation[project],
projectBaseLocation: projectBaseLocation[project],
projectAppLocation: projectAppLocation[project],
projectGitLocation: projectGitLocation[project],
projectCache: project,
};
}
/*
* @source https://github.com/benjamingr/RegExp.escape
*/
// tslint:disable-next-line
interface RegExpConstructor {
escape(string): string;
}
// this is a direct translation to code of the spec
if (!RegExp.escape) {
RegExp.escape = (S) => {
// 1. let str be ToString(S).
// 2. ReturnIfAbrupt(str).
const str = String(S);
// 3. Let cpList be a List containing in order the code
// points as defined in 6.1.4 of str, starting at the first element of str.
const cpList = Array.from(str[Symbol.iterator]());
// 4. let cuList be a new List
const cuList = [];
// 5. For each code point c in cpList in List order, do:
for (const c of cpList) {
// i. If c is a SyntaxCharacter then do:
if ('^$\\.*+?()[]{}|'.indexOf(c) !== -1) {
// a. Append "\" to cuList.
cuList.push('\\');
}
// Append c to cpList.
cuList.push(c);
}
// 6. Let L be a String whose elements are, in order, the elements of cuList.
// noinspection UnnecessaryLocalVariableJS
const L = cuList.join('');
// 7. Return L.
return L;
};
}
export const resolvePath = (object, path, defaultValue) => path
.split('.')
.reduce((o, p) => o ? o[p] : defaultValue, object);
export const setPath = (object, path, value) => path
.split('.')
.reduce((o, p) => o[p] = path.split('.').pop() === p ? value : o[p] || {}, object);
export function sortDescending(a, b): number {
return a === b ? 0 : b - a;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment