diff --git a/dist/browser/eta.dev.js.map b/dist/browser/eta.dev.js.map index 83d784b..5ce537d 100644 --- a/dist/browser/eta.dev.js.map +++ b/dist/browser/eta.dev.js.map @@ -1 +1 @@ -{"version":3,"file":"eta.dev.js","sources":["../../src/err.ts","../../src/utils.ts","../../src/parse.ts","../../src/compile-string.ts","../../src/storage.ts","../../src/containers.ts","../../src/config.ts","../../src/compile.ts","../../src/render.ts"],"sourcesContent":["function setPrototypeOf (obj: any, proto: any) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(obj, proto)\n } else {\n obj.__proto__ = proto\n }\n}\n\nexport default function EtaErr (message: string): Error {\n var err = new Error(message)\n setPrototypeOf(err, EtaErr.prototype)\n return err\n}\n\nEtaErr.prototype = Object.create(Error.prototype, {\n name: { value: 'Eta Error', enumerable: false }\n})\n\n// TODO: Class transpilation adds a lot to the bundle size\n\nexport function ParseErr (message: string, str: string, indx: number) {\n var whitespace = str.slice(0, indx).split(/\\n/)\n\n var lineNo = whitespace.length\n var colNo = whitespace[lineNo - 1].length + 1\n message +=\n ' at line ' +\n lineNo +\n ' col ' +\n colNo +\n ':\\n\\n' +\n ' ' +\n str.split(/\\n/)[lineNo - 1] +\n '\\n' +\n ' ' +\n Array(colNo).join(' ') +\n '^'\n throw EtaErr(message)\n}\n","// TODO: allow '-' to trim up until newline. Use [^\\S\\n\\r] instead of \\s\n// TODO: only include trimLeft polyfill if not in ES6\n\n/* TYPES */\n\nimport { EtaConfig } from './config'\n\ninterface EscapeMap {\n '&': '&'\n '<': '<'\n '\"': '"'\n \"'\": '''\n [index: string]: string\n}\n\n/* END TYPES */\n\nexport var promiseImpl = new Function('return this;')().Promise\n\nexport function hasOwnProp (obj: object, prop: string) {\n return Object.prototype.hasOwnProperty.call(obj, prop)\n}\n\nexport function copyProps (toObj: T, fromObj: T, notConfig?: boolean) {\n for (var key in fromObj) {\n if (hasOwnProp((fromObj as unknown) as object, key)) {\n toObj[key] = fromObj[key]\n }\n }\n return toObj\n}\n\nfunction trimWS (\n str: string,\n env: EtaConfig,\n wsLeft: string | false,\n wsRight?: string | false\n): string {\n var leftTrim\n var rightTrim\n\n if (typeof env.autoTrim === 'string') {\n leftTrim = rightTrim = env.autoTrim\n } else if (Array.isArray(env.autoTrim)) {\n // kinda confusing\n // but _}} will trim the left side of the following string\n leftTrim = env.autoTrim[1]\n rightTrim = env.autoTrim[0]\n }\n\n if (wsLeft || wsLeft === false) {\n leftTrim = wsLeft\n }\n\n if (wsRight || wsRight === false) {\n rightTrim = wsRight\n }\n\n if (leftTrim === 'slurp' && rightTrim === 'slurp') {\n return str.trim()\n }\n\n if (leftTrim === '_' || leftTrim === 'slurp') {\n // console.log('trimming left' + leftTrim)\n // full slurp\n if (String.prototype.trimLeft) {\n str = str.trimLeft()\n } else {\n str = str.replace(/^[\\s\\uFEFF\\xA0]+/, '')\n }\n } else if (leftTrim === '-' || leftTrim === 'nl') {\n // console.log('trimming left nl' + leftTrim)\n // nl trim\n str = str.replace(/^(?:\\n|\\r|\\r\\n)/, '')\n }\n\n if (rightTrim === '_' || rightTrim === 'slurp') {\n // console.log('trimming right' + rightTrim)\n // full slurp\n if (String.prototype.trimRight) {\n str = str.trimRight()\n } else {\n str = str.replace(/[\\s\\uFEFF\\xA0]+$/, '')\n }\n } else if (rightTrim === '-' || rightTrim === 'nl') {\n // console.log('trimming right nl' + rightTrim)\n // nl trim\n str = str.replace(/(?:\\n|\\r|\\r\\n)$/, '') // TODO: make sure this gets \\r\\n\n }\n\n return str\n}\n\nvar escMap: EscapeMap = {\n '&': '&',\n '<': '<',\n '\"': '"',\n \"'\": '''\n}\n\nfunction replaceChar (s: string): string {\n return escMap[s]\n}\n\nfunction XMLEscape (str: any) {\n // To deal with XSS. Based on Escape implementations of Mustache.JS and Marko, then customized.\n var newStr = String(str)\n if (/[&<\"']/.test(newStr)) {\n return newStr.replace(/[&<\"']/g, replaceChar)\n } else {\n return newStr\n }\n}\n\nexport { trimWS, XMLEscape }\n","import EtaErr, { ParseErr } from './err'\nimport { trimWS } from './utils'\n\n/* TYPES */\n\nimport { EtaConfig } from './config'\n\nexport type TagType = 'r' | 'e' | 'i' | ''\n\nexport interface TemplateObject {\n t: TagType\n val: string\n}\n\nexport type AstObject = string | TemplateObject\n\n/* END TYPES */\n\nexport default function parse(str: string, env: EtaConfig): Array {\n var buffer: Array = []\n var trimLeftOfNextStr: string | false = false\n var lastIndex = 0\n\n function pushString(strng: string, shouldTrimRightOfString?: string | false) {\n if (strng) {\n // if string is truthy it must be of type 'string'\n // replace \\ with \\\\, ' with \\'\n var stringToPush = strng.replace(/\\\\|'/g, '\\\\$&')\n\n // TODO: benchmark replace( /(\\\\|')/g, '\\\\$1')\n stringToPush = trimWS(\n stringToPush,\n env,\n trimLeftOfNextStr, // this will only be false on the first str, the next ones will be null or undefined\n shouldTrimRightOfString\n )\n\n stringToPush = stringToPush.replace(/\\n/g, '\\\\n').replace(/\\r/g, '\\\\r')\n\n if (stringToPush) {\n buffer.push(stringToPush)\n }\n }\n }\n\n var prefixes = (env.parse.exec + env.parse.interpolate + env.parse.raw).split('').join('|')\n\n var parseOpenReg = new RegExp('([^]*?)' + env.tags[0] + '(-|_)?\\\\s*(' + prefixes + ')?', 'g')\n var parseCloseReg = new RegExp(\n '\\\\s*((?:[^]*?(?:\\'(?:\\\\\\\\[\\\\s\\\\w\"\\'\\\\\\\\`]|[^\\\\n\\\\r\\'\\\\\\\\])*?\\'|`(?:\\\\\\\\[\\\\s\\\\w\"\\'\\\\\\\\`]|[^\\\\\\\\`])*?`|\"(?:\\\\\\\\[\\\\s\\\\w\"\\'\\\\\\\\`]|[^\\\\n\\\\r\"\\\\\\\\])*?\"|\\\\/\\\\*[^]*?\\\\*\\\\/)?)*?)\\\\s*(-|_)?' +\n env.tags[1],\n 'g'\n )\n // TODO: benchmark having the \\s* on either side vs using str.trim()\n\n var m\n\n while ((m = parseOpenReg.exec(str)) !== null) {\n lastIndex = m[0].length + m.index\n\n var precedingString = m[1]\n var wsLeft = m[2]\n var prefix = m[3] || '' // by default either ~, =, or empty\n\n pushString(precedingString, wsLeft)\n\n parseCloseReg.lastIndex = lastIndex\n var closeTag = parseCloseReg.exec(str)\n if (closeTag) {\n var content = closeTag[1]\n trimLeftOfNextStr = closeTag[2]\n parseOpenReg.lastIndex = lastIndex = parseCloseReg.lastIndex\n\n var currentType: TagType = ''\n if (prefix === env.parse.exec) {\n currentType = 'e'\n } else if (prefix === env.parse.raw) {\n currentType = 'r'\n } else if (prefix === env.parse.interpolate) {\n currentType = 'i'\n }\n\n buffer.push({ t: currentType, val: content })\n } else {\n ParseErr('unclosed tag', str, lastIndex)\n }\n }\n\n pushString(str.slice(lastIndex, str.length), false)\n\n if (env.plugins) {\n for (var i = 0; i < env.plugins.length; i++) {\n var plugin = env.plugins[i]\n if (plugin.processAST) {\n buffer = plugin.processAST(buffer, env)\n }\n }\n }\n\n return buffer\n}\n","import Parse from './parse'\n\n/* TYPES */\n\nimport { EtaConfig } from './config'\nimport { AstObject } from './parse'\n\n/* END TYPES */\n\nexport default function compileToString (str: string, env: EtaConfig) {\n var buffer: Array = Parse(str, env)\n\n var res =\n \"var tR='';\" +\n (env.useWith ? 'with(' + env.varName + '||{}){' : '') +\n compileScope(buffer, env) +\n 'if(cb){cb(null,tR)} return tR' +\n (env.useWith ? '}' : '')\n\n if (env.plugins) {\n for (var i = 0; i < env.plugins.length; i++) {\n var plugin = env.plugins[i]\n if (plugin.processFnString) {\n res = plugin.processFnString(res, env)\n }\n }\n }\n\n return res\n\n // TODO: is `return cb()` necessary, or could we just do `cb()`\n}\n\nfunction compileScope (buff: Array, env: EtaConfig) {\n var i = 0\n var buffLength = buff.length\n var returnStr = ''\n\n for (i; i < buffLength; i++) {\n var currentBlock = buff[i]\n if (typeof currentBlock === 'string') {\n var str = currentBlock\n\n // we know string exists\n returnStr += \"tR+='\" + str + \"';\"\n } else {\n var type = currentBlock.t // ~, s, !, ?, r\n var content = currentBlock.val || ''\n\n if (type === 'r') {\n // raw\n returnStr += 'tR+=' + content + ';'\n } else if (type === 'i') {\n // interpolate\n if (env.autoEscape) {\n content = 'E.e(' + content + ')'\n }\n returnStr += 'tR+=' + content + ';'\n // reference\n } else if (type === 'e') {\n // execute\n returnStr += content + '\\n' // you need a \\n in case you have <% } %>\n }\n }\n }\n\n return returnStr\n}\n","import { copyProps } from './utils'\n\n/* TYPES */\n\ninterface Dict {\n // Basically, an object where all keys point to a value of the same type\n [key: string]: T\n}\n\n/* END TYPES */\n\nclass Cacher {\n constructor (private cache: Dict) {}\n define (key: string, val: T) {\n this.cache[key] = val\n }\n get (key: string) {\n // string | array.\n // TODO: allow array of keys to look down\n // TODO: create plugin to allow referencing helpers, filters with dot notation\n return this.cache[key]\n }\n remove (key: string) {\n delete this.cache[key]\n }\n reset () {\n this.cache = {}\n }\n load (cacheObj: Dict) {\n // TODO: this will err with deep objects and `storage` or `plugins` keys.\n // Update Feb 26: EDITED so it shouldn't err\n copyProps(this.cache, cacheObj, true)\n }\n}\n\nexport { Cacher }\n","import { Cacher } from './storage'\nimport EtaErr from './err'\n\n/* TYPES */\n\nimport { EtaConfig } from './config'\nimport { TemplateFunction } from './compile'\n\n/* END TYPES */\n\nvar templates = new Cacher({})\n\n/* ASYNC LOOP FNs */\n\nexport { templates }\n","import { templates } from './containers'\nimport { copyProps, XMLEscape } from './utils'\nimport EtaErr from './err'\n\n/* TYPES */\n\nimport { TemplateFunction } from './compile'\nimport { Cacher } from './storage'\n\ntype trimConfig = 'nl' | 'slurp' | false\n\nexport interface EtaConfig {\n varName: string\n autoTrim: trimConfig | [trimConfig, trimConfig]\n autoEscape: boolean\n tags: [string, string]\n parse: {\n interpolate: string\n raw: string\n exec: string\n }\n e: (str: string) => string\n plugins: Array<{ processFnString?: Function; processAST?: Function }>\n async: boolean\n templates: Cacher\n cache: boolean\n views?: string | Array\n root?: string\n filename?: string\n name?: string\n 'view cache'?: boolean\n useWith?: boolean\n [index: string]: any\n}\n\nexport type PartialConfig = {\n [P in keyof EtaConfig]?: EtaConfig[P]\n}\n\n/* END TYPES */\n\nfunction includeHelper (this: EtaConfig, templateNameOrPath: string, data: object): string {\n var template = this.templates.get(templateNameOrPath)\n if (!template) {\n throw EtaErr('Could not fetch template \"' + templateNameOrPath + '\"')\n }\n return template(data, this)\n}\n\nvar defaultConfig: EtaConfig = {\n varName: 'it',\n autoTrim: [false, 'nl'],\n autoEscape: true,\n tags: ['<%', '%>'],\n parse: {\n interpolate: '=',\n raw: '~',\n exec: ''\n },\n async: false,\n templates: templates,\n cache: false,\n plugins: [],\n useWith: false,\n e: XMLEscape,\n include: includeHelper\n}\n\nincludeHelper.bind(defaultConfig)\n\nfunction getConfig (override: PartialConfig, baseConfig?: EtaConfig): EtaConfig {\n // TODO: run more tests on this\n\n var res: PartialConfig = {} // Linked\n copyProps(res, defaultConfig) // Creates deep clone of res, 1 layer deep\n\n if (baseConfig) {\n copyProps(res, baseConfig)\n }\n\n if (override) {\n copyProps(res, override)\n }\n\n return res as EtaConfig\n}\n\nexport { defaultConfig, getConfig }\n","import compileToString from './compile-string'\nimport { getConfig } from './config'\nimport EtaErr from './err'\n\n/* TYPES */\n\nimport { EtaConfig, PartialConfig } from './config'\nimport { CallbackFn } from './file-handlers'\nexport type TemplateFunction = (data: object, config: EtaConfig, cb?: CallbackFn) => string\n\n/* END TYPES */\n\nexport default function compile (str: string, env?: PartialConfig): TemplateFunction {\n var options: EtaConfig = getConfig(env || {})\n var ctor // constructor\n\n /* ASYNC HANDLING */\n // The below code is modified from mde/ejs. All credit should go to them.\n if (options.async) {\n // Have to use generated function for this, since in envs without support,\n // it breaks in parsing\n try {\n ctor = new Function('return (async function(){}).constructor;')()\n } catch (e) {\n if (e instanceof SyntaxError) {\n throw EtaErr(\"This environment doesn't support async/await\")\n } else {\n throw e\n }\n }\n } else {\n ctor = Function\n }\n /* END ASYNC HANDLING */\n try {\n return new ctor(\n options.varName,\n 'E', // EtaConfig\n 'cb', // optional callback\n compileToString(str, options)\n ) as TemplateFunction // eslint-disable-line no-new-func\n } catch (e) {\n if (e instanceof SyntaxError) {\n throw EtaErr(\n 'Bad template syntax\\n\\n' +\n e.message +\n '\\n' +\n Array(e.message.length + 1).join('=') +\n '\\n' +\n compileToString(str, options)\n )\n } else {\n throw e\n }\n }\n}\n","import compile from './compile'\nimport { getConfig } from './config'\nimport { promiseImpl } from './utils'\nimport EtaErr from './err'\n\n/* TYPES */\n\nimport { EtaConfig, PartialConfig } from './config'\nimport { TemplateFunction } from './compile'\nimport { CallbackFn } from './file-handlers'\n\n/* END TYPES */\n\nfunction handleCache (template: string | TemplateFunction, options: EtaConfig): TemplateFunction {\n var templateFunc\n\n if (options.cache && options.name && options.templates.get(options.name)) {\n return options.templates.get(options.name)\n }\n\n if (typeof template === 'function') {\n templateFunc = template\n } else {\n templateFunc = compile(template, options)\n }\n\n if (options.cache && options.name) {\n options.templates.define(options.name, templateFunc)\n }\n\n return templateFunc\n}\n\nexport default function render (\n template: string | TemplateFunction,\n data: object,\n env?: PartialConfig,\n cb?: CallbackFn\n) {\n var options = getConfig(env || {})\n\n if (options.async) {\n var result\n if (!cb) {\n // No callback, try returning a promise\n if (typeof promiseImpl === 'function') {\n return new promiseImpl(function (resolve: Function, reject: Function) {\n try {\n result = handleCache(template, options)(data, options)\n resolve(result)\n } catch (err) {\n reject(err)\n }\n })\n } else {\n throw EtaErr(\"Please provide a callback function, this env doesn't support Promises\")\n }\n } else {\n try {\n handleCache(template, options)(data, options, cb)\n } catch (err) {\n return cb(err)\n }\n }\n } else {\n return handleCache(template, options)(data, options)\n }\n}\n"],"names":["Parse"],"mappings":";;;;;;EAAA,SAAS,cAAc,CAAE,GAAQ,EAAE,KAAU;MAC3C,IAAI,MAAM,CAAC,cAAc,EAAE;UACzB,MAAM,CAAC,cAAc,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;OAClC;WAAM;UACL,GAAG,CAAC,SAAS,GAAG,KAAK,CAAA;OACtB;EACH,CAAC;WAEuB,MAAM,CAAE,OAAe;MA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ev.js","sources":["../../src/err.ts","../../src/utils.ts","../../src/parse.ts","../../src/compile-string.ts","../../src/storage.ts","../../src/containers.ts","../../src/config.ts","../../src/compile.ts","../../src/render.ts"],"sourcesContent":["function setPrototypeOf (obj: any, proto: any) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(obj, proto)\n } else {\n obj.__proto__ = proto\n }\n}\n\nexport default function EtaErr (message: string): Error {\n var err = new Error(message)\n setPrototypeOf(err, EtaErr.prototype)\n return err\n}\n\nEtaErr.prototype = Object.create(Error.prototype, {\n name: { value: 'Eta Error', enumerable: false }\n})\n\n// TODO: Class transpilation adds a lot to the bundle size\n\nexport function ParseErr (message: string, str: string, indx: number) {\n var whitespace = str.slice(0, indx).split(/\\n/)\n\n var lineNo = whitespace.length\n var colNo = whitespace[lineNo - 1].length + 1\n message +=\n ' at line ' +\n lineNo +\n ' col ' +\n colNo +\n ':\\n\\n' +\n ' ' +\n str.split(/\\n/)[lineNo - 1] +\n '\\n' +\n ' ' +\n Array(colNo).join(' ') +\n '^'\n throw EtaErr(message)\n}\n","// TODO: allow '-' to trim up until newline. Use [^\\S\\n\\r] instead of \\s\n// TODO: only include trimLeft polyfill if not in ES6\n\n/* TYPES */\n\nimport { EtaConfig } from './config'\n\ninterface EscapeMap {\n '&': '&'\n '<': '<'\n '\"': '"'\n \"'\": '''\n [index: string]: string\n}\n\n/* END TYPES */\n\nexport var promiseImpl = new Function('return this;')().Promise\n\nexport function hasOwnProp (obj: object, prop: string) {\n return Object.prototype.hasOwnProperty.call(obj, prop)\n}\n\nexport function copyProps (toObj: T, fromObj: T, notConfig?: boolean) {\n for (var key in fromObj) {\n if (hasOwnProp((fromObj as unknown) as object, key)) {\n toObj[key] = fromObj[key]\n }\n }\n return toObj\n}\n\nfunction trimWS (\n str: string,\n env: EtaConfig,\n wsLeft: string | false,\n wsRight?: string | false\n): string {\n var leftTrim\n var rightTrim\n\n if (typeof env.autoTrim === 'string') {\n leftTrim = rightTrim = env.autoTrim\n } else if (Array.isArray(env.autoTrim)) {\n // kinda confusing\n // but _}} will trim the left side of the following string\n leftTrim = env.autoTrim[1]\n rightTrim = env.autoTrim[0]\n }\n\n if (wsLeft || wsLeft === false) {\n leftTrim = wsLeft\n }\n\n if (wsRight || wsRight === false) {\n rightTrim = wsRight\n }\n\n if (leftTrim === 'slurp' && rightTrim === 'slurp') {\n return str.trim()\n }\n\n if (leftTrim === '_' || leftTrim === 'slurp') {\n // console.log('trimming left' + leftTrim)\n // full slurp\n if (String.prototype.trimLeft) {\n str = str.trimLeft()\n } else {\n str = str.replace(/^[\\s\\uFEFF\\xA0]+/, '')\n }\n } else if (leftTrim === '-' || leftTrim === 'nl') {\n // console.log('trimming left nl' + leftTrim)\n // nl trim\n str = str.replace(/^(?:\\n|\\r|\\r\\n)/, '')\n }\n\n if (rightTrim === '_' || rightTrim === 'slurp') {\n // console.log('trimming right' + rightTrim)\n // full slurp\n if (String.prototype.trimRight) {\n str = str.trimRight()\n } else {\n str = str.replace(/[\\s\\uFEFF\\xA0]+$/, '')\n }\n } else if (rightTrim === '-' || rightTrim === 'nl') {\n // console.log('trimming right nl' + rightTrim)\n // nl trim\n str = str.replace(/(?:\\n|\\r|\\r\\n)$/, '') // TODO: make sure this gets \\r\\n\n }\n\n return str\n}\n\nvar escMap: EscapeMap = {\n '&': '&',\n '<': '<',\n '\"': '"',\n \"'\": '''\n}\n\nfunction replaceChar (s: string): string {\n return escMap[s]\n}\n\nfunction XMLEscape (str: any) {\n // To deal with XSS. Based on Escape implementations of Mustache.JS and Marko, then customized.\n var newStr = String(str)\n if (/[&<\"']/.test(newStr)) {\n return newStr.replace(/[&<\"']/g, replaceChar)\n } else {\n return newStr\n }\n}\n\nexport { trimWS, XMLEscape }\n","import EtaErr, { ParseErr } from './err'\nimport { trimWS } from './utils'\n\n/* TYPES */\n\nimport { EtaConfig } from './config'\n\nexport type TagType = 'r' | 'e' | 'i' | ''\n\nexport interface TemplateObject {\n t: TagType\n val: string\n}\n\nexport type AstObject = string | TemplateObject\n\n/* END TYPES */\n\nexport default function parse (str: string, env: EtaConfig): Array {\n var buffer: Array = []\n var trimLeftOfNextStr: string | false = false\n var lastIndex = 0\n\n function pushString (strng: string, shouldTrimRightOfString?: string | false) {\n if (strng) {\n // if string is truthy it must be of type 'string'\n // replace \\ with \\\\, ' with \\'\n var stringToPush = strng.replace(/\\\\|'/g, '\\\\$&')\n\n // TODO: benchmark replace( /(\\\\|')/g, '\\\\$1')\n stringToPush = trimWS(\n stringToPush,\n env,\n trimLeftOfNextStr, // this will only be false on the first str, the next ones will be null or undefined\n shouldTrimRightOfString\n )\n\n stringToPush = stringToPush.replace(/\\n/g, '\\\\n').replace(/\\r/g, '\\\\r')\n\n if (stringToPush) {\n buffer.push(stringToPush)\n }\n }\n }\n\n var prefixes = (env.parse.exec + env.parse.interpolate + env.parse.raw).split('').join('|')\n\n var parseOpenReg = new RegExp('([^]*?)' + env.tags[0] + '(-|_)?\\\\s*(' + prefixes + ')?', 'g')\n var parseCloseReg = new RegExp(\n '\\\\s*((?:[^]*?(?:\\'(?:\\\\\\\\[\\\\s\\\\w\"\\'\\\\\\\\`]|[^\\\\n\\\\r\\'\\\\\\\\])*?\\'|`(?:\\\\\\\\[\\\\s\\\\w\"\\'\\\\\\\\`]|[^\\\\\\\\`])*?`|\"(?:\\\\\\\\[\\\\s\\\\w\"\\'\\\\\\\\`]|[^\\\\n\\\\r\"\\\\\\\\])*?\"|\\\\/\\\\*[^]*?\\\\*\\\\/)?)*?)\\\\s*(-|_)?' +\n env.tags[1],\n 'g'\n )\n // TODO: benchmark having the \\s* on either side vs using str.trim()\n\n var m\n\n while ((m = parseOpenReg.exec(str)) !== null) {\n lastIndex = m[0].length + m.index\n\n var precedingString = m[1]\n var wsLeft = m[2]\n var prefix = m[3] || '' // by default either ~, =, or empty\n\n pushString(precedingString, wsLeft)\n\n parseCloseReg.lastIndex = lastIndex\n var closeTag = parseCloseReg.exec(str)\n if (closeTag) {\n var content = closeTag[1]\n trimLeftOfNextStr = closeTag[2]\n parseOpenReg.lastIndex = lastIndex = parseCloseReg.lastIndex\n\n var currentType: TagType = ''\n if (prefix === env.parse.exec) {\n currentType = 'e'\n } else if (prefix === env.parse.raw) {\n currentType = 'r'\n } else if (prefix === env.parse.interpolate) {\n currentType = 'i'\n }\n\n buffer.push({ t: currentType, val: content })\n } else {\n ParseErr('unclosed tag', str, lastIndex)\n }\n }\n\n pushString(str.slice(lastIndex, str.length), false)\n\n if (env.plugins) {\n for (var i = 0; i < env.plugins.length; i++) {\n var plugin = env.plugins[i]\n if (plugin.processAST) {\n buffer = plugin.processAST(buffer, env)\n }\n }\n }\n\n return buffer\n}\n","import Parse from './parse'\n\n/* TYPES */\n\nimport { EtaConfig } from './config'\nimport { AstObject } from './parse'\n\n/* END TYPES */\n\nexport default function compileToString (str: string, env: EtaConfig) {\n var buffer: Array = Parse(str, env)\n\n var res =\n \"var tR='';\" +\n (env.useWith ? 'with(' + env.varName + '||{}){' : '') +\n compileScope(buffer, env) +\n 'if(cb){cb(null,tR)} return tR' +\n (env.useWith ? '}' : '')\n\n if (env.plugins) {\n for (var i = 0; i < env.plugins.length; i++) {\n var plugin = env.plugins[i]\n if (plugin.processFnString) {\n res = plugin.processFnString(res, env)\n }\n }\n }\n\n return res\n\n // TODO: is `return cb()` necessary, or could we just do `cb()`\n}\n\nfunction compileScope (buff: Array, env: EtaConfig) {\n var i = 0\n var buffLength = buff.length\n var returnStr = ''\n\n for (i; i < buffLength; i++) {\n var currentBlock = buff[i]\n if (typeof currentBlock === 'string') {\n var str = currentBlock\n\n // we know string exists\n returnStr += \"tR+='\" + str + \"';\"\n } else {\n var type = currentBlock.t // ~, s, !, ?, r\n var content = currentBlock.val || ''\n\n if (type === 'r') {\n // raw\n returnStr += 'tR+=' + content + ';'\n } else if (type === 'i') {\n // interpolate\n if (env.autoEscape) {\n content = 'E.e(' + content + ')'\n }\n returnStr += 'tR+=' + content + ';'\n // reference\n } else if (type === 'e') {\n // execute\n returnStr += content + '\\n' // you need a \\n in case you have <% } %>\n }\n }\n }\n\n return returnStr\n}\n","import { copyProps } from './utils'\n\n/* TYPES */\n\ninterface Dict {\n // Basically, an object where all keys point to a value of the same type\n [key: string]: T\n}\n\n/* END TYPES */\n\nclass Cacher {\n constructor (private cache: Dict) {}\n define (key: string, val: T) {\n this.cache[key] = val\n }\n get (key: string) {\n // string | array.\n // TODO: allow array of keys to look down\n // TODO: create plugin to allow referencing helpers, filters with dot notation\n return this.cache[key]\n }\n remove (key: string) {\n delete this.cache[key]\n }\n reset () {\n this.cache = {}\n }\n load (cacheObj: Dict) {\n // TODO: this will err with deep objects and `storage` or `plugins` keys.\n // Update Feb 26: EDITED so it shouldn't err\n copyProps(this.cache, cacheObj, true)\n }\n}\n\nexport { Cacher }\n","import { Cacher } from './storage'\nimport EtaErr from './err'\n\n/* TYPES */\n\nimport { EtaConfig } from './config'\nimport { TemplateFunction } from './compile'\n\n/* END TYPES */\n\nvar templates = new Cacher({})\n\n/* ASYNC LOOP FNs */\n\nexport { templates }\n","import { templates } from './containers'\nimport { copyProps, XMLEscape } from './utils'\nimport EtaErr from './err'\n\n/* TYPES */\n\nimport { TemplateFunction } from './compile'\nimport { Cacher } from './storage'\n\ntype trimConfig = 'nl' | 'slurp' | false\n\nexport interface EtaConfig {\n varName: string\n autoTrim: trimConfig | [trimConfig, trimConfig]\n autoEscape: boolean\n tags: [string, string]\n parse: {\n interpolate: string\n raw: string\n exec: string\n }\n e: (str: string) => string\n plugins: Array<{ processFnString?: Function; processAST?: Function }>\n async: boolean\n templates: Cacher\n cache: boolean\n views?: string | Array\n root?: string\n filename?: string\n name?: string\n 'view cache'?: boolean\n useWith?: boolean\n [index: string]: any\n}\n\nexport type PartialConfig = {\n [P in keyof EtaConfig]?: EtaConfig[P]\n}\n\n/* END TYPES */\n\nfunction includeHelper (this: EtaConfig, templateNameOrPath: string, data: object): string {\n var template = this.templates.get(templateNameOrPath)\n if (!template) {\n throw EtaErr('Could not fetch template \"' + templateNameOrPath + '\"')\n }\n return template(data, this)\n}\n\nvar defaultConfig: EtaConfig = {\n varName: 'it',\n autoTrim: [false, 'nl'],\n autoEscape: true,\n tags: ['<%', '%>'],\n parse: {\n interpolate: '=',\n raw: '~',\n exec: ''\n },\n async: false,\n templates: templates,\n cache: false,\n plugins: [],\n useWith: false,\n e: XMLEscape,\n include: includeHelper\n}\n\nincludeHelper.bind(defaultConfig)\n\nfunction getConfig (override: PartialConfig, baseConfig?: EtaConfig): EtaConfig {\n // TODO: run more tests on this\n\n var res: PartialConfig = {} // Linked\n copyProps(res, defaultConfig) // Creates deep clone of res, 1 layer deep\n\n if (baseConfig) {\n copyProps(res, baseConfig)\n }\n\n if (override) {\n copyProps(res, override)\n }\n\n return res as EtaConfig\n}\n\nexport { defaultConfig, getConfig }\n","import compileToString from './compile-string'\nimport { getConfig } from './config'\nimport EtaErr from './err'\n\n/* TYPES */\n\nimport { EtaConfig, PartialConfig } from './config'\nimport { CallbackFn } from './file-handlers'\nexport type TemplateFunction = (data: object, config: EtaConfig, cb?: CallbackFn) => string\n\n/* END TYPES */\n\nexport default function compile (str: string, env?: PartialConfig): TemplateFunction {\n var options: EtaConfig = getConfig(env || {})\n var ctor // constructor\n\n /* ASYNC HANDLING */\n // The below code is modified from mde/ejs. All credit should go to them.\n if (options.async) {\n // Have to use generated function for this, since in envs without support,\n // it breaks in parsing\n try {\n ctor = new Function('return (async function(){}).constructor;')()\n } catch (e) {\n if (e instanceof SyntaxError) {\n throw EtaErr(\"This environment doesn't support async/await\")\n } else {\n throw e\n }\n }\n } else {\n ctor = Function\n }\n /* END ASYNC HANDLING */\n try {\n return new ctor(\n options.varName,\n 'E', // EtaConfig\n 'cb', // optional callback\n compileToString(str, options)\n ) as TemplateFunction // eslint-disable-line no-new-func\n } catch (e) {\n if (e instanceof SyntaxError) {\n throw EtaErr(\n 'Bad template syntax\\n\\n' +\n e.message +\n '\\n' +\n Array(e.message.length + 1).join('=') +\n '\\n' +\n compileToString(str, options)\n )\n } else {\n throw e\n }\n }\n}\n","import compile from './compile'\nimport { getConfig } from './config'\nimport { promiseImpl } from './utils'\nimport EtaErr from './err'\n\n/* TYPES */\n\nimport { EtaConfig, PartialConfig } from './config'\nimport { TemplateFunction } from './compile'\nimport { CallbackFn } from './file-handlers'\n\n/* END TYPES */\n\nfunction handleCache (template: string | TemplateFunction, options: EtaConfig): TemplateFunction {\n var templateFunc\n\n if (options.cache && options.name && options.templates.get(options.name)) {\n return options.templates.get(options.name)\n }\n\n if (typeof template === 'function') {\n templateFunc = template\n } else {\n templateFunc = compile(template, options)\n }\n\n if (options.cache && options.name) {\n options.templates.define(options.name, templateFunc)\n }\n\n return templateFunc\n}\n\nexport default function render (\n template: string | TemplateFunction,\n data: object,\n env?: PartialConfig,\n cb?: CallbackFn\n) {\n var options = getConfig(env || {})\n\n if (options.async) {\n var result\n if (!cb) {\n // No callback, try returning a promise\n if (typeof promiseImpl === 'function') {\n return new promiseImpl(function (resolve: Function, reject: Function) {\n try {\n result = handleCache(template, options)(data, options)\n resolve(result)\n } catch (err) {\n reject(err)\n }\n })\n } else {\n throw EtaErr(\"Please provide a callback function, this env doesn't support Promises\")\n }\n } else {\n try {\n handleCache(template, options)(data, options, cb)\n } catch (err) {\n return cb(err)\n }\n }\n } else {\n return handleCache(template, options)(data, options)\n }\n}\n"],"names":["Parse"],"mappings":";;;;;;EAAA,SAAS,cAAc,CAAE,GAAQ,EAAE,KAAU;MAC3C,IAAI,MAAM,CAAC,cAAc,EAAE;UACzB,MAAM,CAAC,cAAc,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;OAClC;WAAM;UACL,GAAG,CAAC,SAAS,GAAG,KAAK,CAAA;OACtB;EACH,CAAC;WAEuB,MAAM,CAAE,OAAe;MAC7C,IAAI,GAAG,GAAG,IAAI,KAAK,CAAC,OAAO,CAAC,CAAA;MAC5B,cAAc,CAAC,GAAG,EAAE,MAAM,CAAC,SAAS,CAAC,CAAA;MACrC,OAAO,GAAG,CAAA;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S,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,YAAY,CAAC,CAAA;OACrD;MAED,OAAO,YAAY,CAAA;EACrB,CAAC;AAED,WAAwB,MAAM,CAC5B,QAAmC,EACnC,IAAY,EACZ,GAAmB,EACnB,EAAe;MAEf,IAAI,OAAO,GAAG,SAAS,CAAC,GAAG,IAAI,EAAE,CAAC,CAAA;MAElC,IAAI,OAAO,CAAC,KAAK,EAAE;UACjB,IAAI,MAAM,CAAA;UACV,IAAI,CAAC,EAAE,EAAE;;cAEP,IAAI,OAAO,WAAW,KAAK,UAAU,EAAE;kBACrC,OAAO,IAAI,WAAW,CAAC,UAAU,OAAiB,EAAE,MAAgB;sBAClE,IAAI;0BACF,MAAM,GAAG,WAAW,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;0BACtD,OAAO,CAAC,MAAM,CAAC,CAAA;uBAChB;sBAAC,OAAO,GAAG,EAAE;0BACZ,MAAM,CAAC,GAAG,CAAC,CAAA;uBACZ;mBACF,CAAC,CAAA;eACH;mBAAM;kBACL,MAAM,MAAM,CAAC,uEAAuE,CAAC,CAAA;eACtF;WACF;eAAM;cACL,IAAI;kBACF,WAAW,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE,CAAC,CAAA;eAClD;cAAC,OAAO,GAAG,EAAE;kBACZ,OAAO,EAAE,CAAC,GAAG,CAAC,CAAA;eACf;WACF;OACF;WAAM;UACL,OAAO,WAAW,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;OACrD;EACH,CAAC;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist/browser/eta.min.js.map b/dist/browser/eta.min.js.map index 60dd9fa..0c08d4a 100644 --- a/dist/browser/eta.min.js.map +++ b/dist/browser/eta.min.js.map @@ -1 +1 @@ -{"version":3,"file":"eta.min.js","sources":["../../src/err.ts","../../src/utils.ts","../../src/parse.ts","../../src/compile-string.ts","../../src/storage.ts","../../src/containers.ts","../../src/config.ts","../../src/compile.ts","../../src/render.ts"],"sourcesContent":["function setPrototypeOf (obj: any, proto: any) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(obj, proto)\n } else {\n obj.__proto__ = proto\n }\n}\n\nexport default function EtaErr (message: string): Error {\n var err = new Error(message)\n setPrototypeOf(err, EtaErr.prototype)\n return err\n}\n\nEtaErr.prototype = Object.create(Error.prototype, {\n name: { value: 'Eta Error', enumerable: false }\n})\n\n// TODO: Class transpilation adds a lot to the bundle size\n\nexport function ParseErr (message: string, str: string, indx: number) {\n var whitespace = str.slice(0, indx).split(/\\n/)\n\n var lineNo = whitespace.length\n var colNo = whitespace[lineNo - 1].length + 1\n message +=\n ' at line ' +\n lineNo +\n ' col ' +\n colNo +\n ':\\n\\n' +\n ' ' +\n str.split(/\\n/)[lineNo - 1] +\n '\\n' +\n ' ' +\n Array(colNo).join(' ') +\n '^'\n throw EtaErr(message)\n}\n","// TODO: allow '-' to trim up until newline. Use [^\\S\\n\\r] instead of \\s\n// TODO: only include trimLeft polyfill if not in ES6\n\n/* TYPES */\n\nimport { EtaConfig } from './config'\n\ninterface EscapeMap {\n '&': '&'\n '<': '<'\n '\"': '"'\n \"'\": '''\n [index: string]: string\n}\n\n/* END TYPES */\n\nexport var promiseImpl = new Function('return this;')().Promise\n\nexport function hasOwnProp (obj: object, prop: string) {\n return Object.prototype.hasOwnProperty.call(obj, prop)\n}\n\nexport function copyProps (toObj: T, fromObj: T, notConfig?: boolean) {\n for (var key in fromObj) {\n if (hasOwnProp((fromObj as unknown) as object, key)) {\n toObj[key] = fromObj[key]\n }\n }\n return toObj\n}\n\nfunction trimWS (\n str: string,\n env: EtaConfig,\n wsLeft: string | false,\n wsRight?: string | false\n): string {\n var leftTrim\n var rightTrim\n\n if (typeof env.autoTrim === 'string') {\n leftTrim = rightTrim = env.autoTrim\n } else if (Array.isArray(env.autoTrim)) {\n // kinda confusing\n // but _}} will trim the left side of the following string\n leftTrim = env.autoTrim[1]\n rightTrim = env.autoTrim[0]\n }\n\n if (wsLeft || wsLeft === false) {\n leftTrim = wsLeft\n }\n\n if (wsRight || wsRight === false) {\n rightTrim = wsRight\n }\n\n if (leftTrim === 'slurp' && rightTrim === 'slurp') {\n return str.trim()\n }\n\n if (leftTrim === '_' || leftTrim === 'slurp') {\n // console.log('trimming left' + leftTrim)\n // full slurp\n if (String.prototype.trimLeft) {\n str = str.trimLeft()\n } else {\n str = str.replace(/^[\\s\\uFEFF\\xA0]+/, '')\n }\n } else if (leftTrim === '-' || leftTrim === 'nl') {\n // console.log('trimming left nl' + leftTrim)\n // nl trim\n str = str.replace(/^(?:\\n|\\r|\\r\\n)/, '')\n }\n\n if (rightTrim === '_' || rightTrim === 'slurp') {\n // console.log('trimming right' + rightTrim)\n // full slurp\n if (String.prototype.trimRight) {\n str = str.trimRight()\n } else {\n str = str.replace(/[\\s\\uFEFF\\xA0]+$/, '')\n }\n } else if (rightTrim === '-' || rightTrim === 'nl') {\n // console.log('trimming right nl' + rightTrim)\n // nl trim\n str = str.replace(/(?:\\n|\\r|\\r\\n)$/, '') // TODO: make sure this gets \\r\\n\n }\n\n return str\n}\n\nvar escMap: EscapeMap = {\n '&': '&',\n '<': '<',\n '\"': '"',\n \"'\": '''\n}\n\nfunction replaceChar (s: string): string {\n return escMap[s]\n}\n\nfunction XMLEscape (str: any) {\n // To deal with XSS. Based on Escape implementations of Mustache.JS and Marko, then customized.\n var newStr = String(str)\n if (/[&<\"']/.test(newStr)) {\n return newStr.replace(/[&<\"']/g, replaceChar)\n } else {\n return newStr\n }\n}\n\nexport { trimWS, XMLEscape }\n","import EtaErr, { ParseErr } from './err'\nimport { trimWS } from './utils'\n\n/* TYPES */\n\nimport { EtaConfig } from './config'\n\nexport type TagType = 'r' | 'e' | 'i' | ''\n\nexport interface TemplateObject {\n t: TagType\n val: string\n}\n\nexport type AstObject = string | TemplateObject\n\n/* END TYPES */\n\nexport default function parse(str: string, env: EtaConfig): Array {\n var buffer: Array = []\n var trimLeftOfNextStr: string | false = false\n var lastIndex = 0\n\n function pushString(strng: string, shouldTrimRightOfString?: string | false) {\n if (strng) {\n // if string is truthy it must be of type 'string'\n // replace \\ with \\\\, ' with \\'\n var stringToPush = strng.replace(/\\\\|'/g, '\\\\$&')\n\n // TODO: benchmark replace( /(\\\\|')/g, '\\\\$1')\n stringToPush = trimWS(\n stringToPush,\n env,\n trimLeftOfNextStr, // this will only be false on the first str, the next ones will be null or undefined\n shouldTrimRightOfString\n )\n\n stringToPush = stringToPush.replace(/\\n/g, '\\\\n').replace(/\\r/g, '\\\\r')\n\n if (stringToPush) {\n buffer.push(stringToPush)\n }\n }\n }\n\n var prefixes = (env.parse.exec + env.parse.interpolate + env.parse.raw).split('').join('|')\n\n var parseOpenReg = new RegExp('([^]*?)' + env.tags[0] + '(-|_)?\\\\s*(' + prefixes + ')?', 'g')\n var parseCloseReg = new RegExp(\n '\\\\s*((?:[^]*?(?:\\'(?:\\\\\\\\[\\\\s\\\\w\"\\'\\\\\\\\`]|[^\\\\n\\\\r\\'\\\\\\\\])*?\\'|`(?:\\\\\\\\[\\\\s\\\\w\"\\'\\\\\\\\`]|[^\\\\\\\\`])*?`|\"(?:\\\\\\\\[\\\\s\\\\w\"\\'\\\\\\\\`]|[^\\\\n\\\\r\"\\\\\\\\])*?\"|\\\\/\\\\*[^]*?\\\\*\\\\/)?)*?)\\\\s*(-|_)?' +\n env.tags[1],\n 'g'\n )\n // TODO: benchmark having the \\s* on either side vs using str.trim()\n\n var m\n\n while ((m = parseOpenReg.exec(str)) !== null) {\n lastIndex = m[0].length + m.index\n\n var precedingString = m[1]\n var wsLeft = m[2]\n var prefix = m[3] || '' // by default either ~, =, or empty\n\n pushString(precedingString, wsLeft)\n\n parseCloseReg.lastIndex = lastIndex\n var closeTag = parseCloseReg.exec(str)\n if (closeTag) {\n var content = closeTag[1]\n trimLeftOfNextStr = closeTag[2]\n parseOpenReg.lastIndex = lastIndex = parseCloseReg.lastIndex\n\n var currentType: TagType = ''\n if (prefix === env.parse.exec) {\n currentType = 'e'\n } else if (prefix === env.parse.raw) {\n currentType = 'r'\n } else if (prefix === env.parse.interpolate) {\n currentType = 'i'\n }\n\n buffer.push({ t: currentType, val: content })\n } else {\n ParseErr('unclosed tag', str, lastIndex)\n }\n }\n\n pushString(str.slice(lastIndex, str.length), false)\n\n if (env.plugins) {\n for (var i = 0; i < env.plugins.length; i++) {\n var plugin = env.plugins[i]\n if (plugin.processAST) {\n buffer = plugin.processAST(buffer, env)\n }\n }\n }\n\n return buffer\n}\n","import Parse from './parse'\n\n/* TYPES */\n\nimport { EtaConfig } from './config'\nimport { AstObject } from './parse'\n\n/* END TYPES */\n\nexport default function compileToString (str: string, env: EtaConfig) {\n var buffer: Array = Parse(str, env)\n\n var res =\n \"var tR='';\" +\n (env.useWith ? 'with(' + env.varName + '||{}){' : '') +\n compileScope(buffer, env) +\n 'if(cb){cb(null,tR)} return tR' +\n (env.useWith ? '}' : '')\n\n if (env.plugins) {\n for (var i = 0; i < env.plugins.length; i++) {\n var plugin = env.plugins[i]\n if (plugin.processFnString) {\n res = plugin.processFnString(res, env)\n }\n }\n }\n\n return res\n\n // TODO: is `return cb()` necessary, or could we just do `cb()`\n}\n\nfunction compileScope (buff: Array, env: EtaConfig) {\n var i = 0\n var buffLength = buff.length\n var returnStr = ''\n\n for (i; i < buffLength; i++) {\n var currentBlock = buff[i]\n if (typeof currentBlock === 'string') {\n var str = currentBlock\n\n // we know string exists\n returnStr += \"tR+='\" + str + \"';\"\n } else {\n var type = currentBlock.t // ~, s, !, ?, r\n var content = currentBlock.val || ''\n\n if (type === 'r') {\n // raw\n returnStr += 'tR+=' + content + ';'\n } else if (type === 'i') {\n // interpolate\n if (env.autoEscape) {\n content = 'E.e(' + content + ')'\n }\n returnStr += 'tR+=' + content + ';'\n // reference\n } else if (type === 'e') {\n // execute\n returnStr += content + '\\n' // you need a \\n in case you have <% } %>\n }\n }\n }\n\n return returnStr\n}\n","import { copyProps } from './utils'\n\n/* TYPES */\n\ninterface Dict {\n // Basically, an object where all keys point to a value of the same type\n [key: string]: T\n}\n\n/* END TYPES */\n\nclass Cacher {\n constructor (private cache: Dict) {}\n define (key: string, val: T) {\n this.cache[key] = val\n }\n get (key: string) {\n // string | array.\n // TODO: allow array of keys to look down\n // TODO: create plugin to allow referencing helpers, filters with dot notation\n return this.cache[key]\n }\n remove (key: string) {\n delete this.cache[key]\n }\n reset () {\n this.cache = {}\n }\n load (cacheObj: Dict) {\n // TODO: this will err with deep objects and `storage` or `plugins` keys.\n // Update Feb 26: EDITED so it shouldn't err\n copyProps(this.cache, cacheObj, true)\n }\n}\n\nexport { Cacher }\n","import { Cacher } from './storage'\nimport EtaErr from './err'\n\n/* TYPES */\n\nimport { EtaConfig } from './config'\nimport { TemplateFunction } from './compile'\n\n/* END TYPES */\n\nvar templates = new Cacher({})\n\n/* ASYNC LOOP FNs */\n\nexport { templates }\n","import { templates } from './containers'\nimport { copyProps, XMLEscape } from './utils'\nimport EtaErr from './err'\n\n/* TYPES */\n\nimport { TemplateFunction } from './compile'\nimport { Cacher } from './storage'\n\ntype trimConfig = 'nl' | 'slurp' | false\n\nexport interface EtaConfig {\n varName: string\n autoTrim: trimConfig | [trimConfig, trimConfig]\n autoEscape: boolean\n tags: [string, string]\n parse: {\n interpolate: string\n raw: string\n exec: string\n }\n e: (str: string) => string\n plugins: Array<{ processFnString?: Function; processAST?: Function }>\n async: boolean\n templates: Cacher\n cache: boolean\n views?: string | Array\n root?: string\n filename?: string\n name?: string\n 'view cache'?: boolean\n useWith?: boolean\n [index: string]: any\n}\n\nexport type PartialConfig = {\n [P in keyof EtaConfig]?: EtaConfig[P]\n}\n\n/* END TYPES */\n\nfunction includeHelper (this: EtaConfig, templateNameOrPath: string, data: object): string {\n var template = this.templates.get(templateNameOrPath)\n if (!template) {\n throw EtaErr('Could not fetch template \"' + templateNameOrPath + '\"')\n }\n return template(data, this)\n}\n\nvar defaultConfig: EtaConfig = {\n varName: 'it',\n autoTrim: [false, 'nl'],\n autoEscape: true,\n tags: ['<%', '%>'],\n parse: {\n interpolate: '=',\n raw: '~',\n exec: ''\n },\n async: false,\n templates: templates,\n cache: false,\n plugins: [],\n useWith: false,\n e: XMLEscape,\n include: includeHelper\n}\n\nincludeHelper.bind(defaultConfig)\n\nfunction getConfig (override: PartialConfig, baseConfig?: EtaConfig): EtaConfig {\n // TODO: run more tests on this\n\n var res: PartialConfig = {} // Linked\n copyProps(res, defaultConfig) // Creates deep clone of res, 1 layer deep\n\n if (baseConfig) {\n copyProps(res, baseConfig)\n }\n\n if (override) {\n copyProps(res, override)\n }\n\n return res as EtaConfig\n}\n\nexport { defaultConfig, getConfig }\n","import compileToString from './compile-string'\nimport { getConfig } from './config'\nimport EtaErr from './err'\n\n/* TYPES */\n\nimport { EtaConfig, PartialConfig } from './config'\nimport { CallbackFn } from './file-handlers'\nexport type TemplateFunction = (data: object, config: EtaConfig, cb?: CallbackFn) => string\n\n/* END TYPES */\n\nexport default function compile (str: string, env?: PartialConfig): TemplateFunction {\n var options: EtaConfig = getConfig(env || {})\n var ctor // constructor\n\n /* ASYNC HANDLING */\n // The below code is modified from mde/ejs. All credit should go to them.\n if (options.async) {\n // Have to use generated function for this, since in envs without support,\n // it breaks in parsing\n try {\n ctor = new Function('return (async function(){}).constructor;')()\n } catch (e) {\n if (e instanceof SyntaxError) {\n throw EtaErr(\"This environment doesn't support async/await\")\n } else {\n throw e\n }\n }\n } else {\n ctor = Function\n }\n /* END ASYNC HANDLING */\n try {\n return new ctor(\n options.varName,\n 'E', // EtaConfig\n 'cb', // optional callback\n compileToString(str, options)\n ) as TemplateFunction // eslint-disable-line no-new-func\n } catch (e) {\n if (e instanceof SyntaxError) {\n throw EtaErr(\n 'Bad template syntax\\n\\n' +\n e.message +\n '\\n' +\n Array(e.message.length + 1).join('=') +\n '\\n' +\n compileToString(str, options)\n )\n } else {\n throw e\n }\n }\n}\n","import compile from './compile'\nimport { getConfig } from './config'\nimport { promiseImpl } from './utils'\nimport EtaErr from './err'\n\n/* TYPES */\n\nimport { EtaConfig, PartialConfig } from './config'\nimport { TemplateFunction } from './compile'\nimport { CallbackFn } from './file-handlers'\n\n/* END TYPES */\n\nfunction handleCache (template: string | TemplateFunction, options: EtaConfig): TemplateFunction {\n var templateFunc\n\n if (options.cache && options.name && options.templates.get(options.name)) {\n return options.templates.get(options.name)\n }\n\n if (typeof template === 'function') {\n templateFunc = template\n } else {\n templateFunc = compile(template, options)\n }\n\n if (options.cache && options.name) {\n options.templates.define(options.name, templateFunc)\n }\n\n return templateFunc\n}\n\nexport default function render (\n template: string | TemplateFunction,\n data: object,\n env?: PartialConfig,\n cb?: CallbackFn\n) {\n var options = getConfig(env || {})\n\n if (options.async) {\n var result\n if (!cb) {\n // No callback, try returning a promise\n if (typeof promiseImpl === 'function') {\n return new promiseImpl(function (resolve: Function, reject: Function) {\n try {\n result = handleCache(template, options)(data, options)\n resolve(result)\n } catch (err) {\n reject(err)\n }\n })\n } else {\n throw EtaErr(\"Please provide a callback function, this env doesn't support Promises\")\n }\n } else {\n try {\n handleCache(template, options)(data, options, cb)\n } catch (err) {\n return cb(err)\n }\n }\n } else {\n return handleCache(template, options)(data, options)\n }\n}\n"],"names":["EtaErr","message","obj","proto","err","Error","prototype","Object","setPrototypeOf","__proto__","ParseErr","str","indx","whitespace","slice","split","lineNo","length","colNo","Array","join","create","name","value","enumerable","promiseImpl","Function","Promise","copyProps","toObj","fromObj","notConfig","key","prop","hasOwnProperty","call","escMap","&","<","\"","'","replaceChar","s","parse","env","buffer","trimLeftOfNextStr","lastIndex","pushString","strng","shouldTrimRightOfString","stringToPush","replace","wsLeft","wsRight","leftTrim","rightTrim","autoTrim","isArray","trim","String","trimLeft","trimRight","trimWS","push","m","prefixes","exec","interpolate","raw","parseOpenReg","RegExp","tags","parseCloseReg","index","precedingString","prefix","closeTag","content","currentType","t","val","plugins","i","plugin","processAST","compileToString","Parse","res","useWith","varName","buff","buffLength","returnStr","currentBlock","type","autoEscape","compileScope","processFnString","templates","cache","this","Cacher","cacheObj","includeHelper","templateNameOrPath","data","template","get","defaultConfig","async","e","newStr","test","include","getConfig","override","baseConfig","compile","ctor","options","SyntaxError","handleCache","templateFunc","define","bind","cb","resolve","reject"],"mappings":"0MAQwBA,EAAQC,GAC9B,IATuBC,EAAUC,EAS7BC,EAAM,IAAIC,MAAMJ,GAEpB,OAXuBC,EAURE,EAVkBD,EAUbH,EAAOM,UATvBC,OAAOC,eACTD,OAAOC,eAAeN,EAAKC,GAE3BD,EAAIO,UAAYN,EAOXC,WASOM,EAAUT,EAAiBU,EAAaC,GACtD,IAAIC,EAAaF,EAAIG,MAAM,EAAGF,GAAMG,MAAM,MAEtCC,EAASH,EAAWI,OACpBC,EAAQL,EAAWG,EAAS,GAAGC,OAAS,EAa5C,MAAMjB,EAZNC,GACE,YACAe,EACA,QACAE,EACA,UAEAP,EAAII,MAAM,MAAMC,EAAS,GACzB,OAEAG,MAAMD,GAAOE,KAAK,KAClB,KAtBJpB,EAAOM,UAAYC,OAAOc,OAAOhB,MAAMC,UAAW,CAChDgB,KAAM,CAAEC,MAAO,YAAaC,YAAY,KCEnC,IAAIC,EAAc,IAAIC,SAAS,eAAb,GAA+BC,iBAMxCC,EAAcC,EAAUC,EAAYC,GAClD,IAAK,IAAIC,KAAOF,EALU5B,EAMR4B,EANqBG,EAMUD,EAL1CzB,OAAOD,UAAU4B,eAAeC,KAAKjC,EAAK+B,KAM7CJ,EAAMG,GAAOF,EAAQE,QAPC9B,EAAa+B,EAUvC,OAAOJ,EAgET,IAAIO,EAAoB,CACtBC,IAAK,QACLC,IAAK,OACLC,IAAK,SACLC,IAAK,SAGP,SAASC,EAAaC,GACpB,OAAON,EAAOM,YCnFQC,EAAMhC,EAAaiC,GACzC,IAAIC,EAA2B,GAC3BC,GAAoC,EACpCC,EAAY,EAEhB,SAASC,EAAWC,EAAeC,GACjC,GAAID,E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EAAMc,EAASM,GAC9C,MAAO1H,GACP,OAAO0H,EAAG1H"} \ No newline at end of file +{"version":3,"file":"eta.min.js","sources":["../../src/err.ts","../../src/utils.ts","../../src/parse.ts","../../src/compile-string.ts","../../src/storage.ts","../../src/containers.ts","../../src/config.ts","../../src/compile.ts","../../src/render.ts"],"sourcesContent":["function setPrototypeOf (obj: any, proto: any) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(obj, proto)\n } else {\n obj.__proto__ = proto\n }\n}\n\nexport default function EtaErr (message: string): Error {\n var err = new Error(message)\n setPrototypeOf(err, EtaErr.prototype)\n return err\n}\n\nEtaErr.prototype = Object.create(Error.prototype, {\n name: { value: 'Eta Error', enumerable: false }\n})\n\n// TODO: Class transpilation adds a lot to the bundle size\n\nexport function ParseErr (message: string, str: string, indx: number) {\n var whitespace = str.slice(0, indx).split(/\\n/)\n\n var lineNo = whitespace.length\n var colNo = whitespace[lineNo - 1].length + 1\n message +=\n ' at line ' +\n lineNo +\n ' col ' +\n colNo +\n ':\\n\\n' +\n ' ' +\n str.split(/\\n/)[lineNo - 1] +\n '\\n' +\n ' ' +\n Array(colNo).join(' ') +\n '^'\n throw EtaErr(message)\n}\n","// TODO: allow '-' to trim up until newline. Use [^\\S\\n\\r] instead of \\s\n// TODO: only include trimLeft polyfill if not in ES6\n\n/* TYPES */\n\nimport { EtaConfig } from './config'\n\ninterface EscapeMap {\n '&': '&'\n '<': '<'\n '\"': '"'\n \"'\": '''\n [index: string]: string\n}\n\n/* END TYPES */\n\nexport var promiseImpl = new Function('return this;')().Promise\n\nexport function hasOwnProp (obj: object, prop: string) {\n return Object.prototype.hasOwnProperty.call(obj, prop)\n}\n\nexport function copyProps (toObj: T, fromObj: T, notConfig?: boolean) {\n for (var key in fromObj) {\n if (hasOwnProp((fromObj as unknown) as object, key)) {\n toObj[key] = fromObj[key]\n }\n }\n return toObj\n}\n\nfunction trimWS (\n str: string,\n env: EtaConfig,\n wsLeft: string | false,\n wsRight?: string | false\n): string {\n var leftTrim\n var rightTrim\n\n if (typeof env.autoTrim === 'string') {\n leftTrim = rightTrim = env.autoTrim\n } else if (Array.isArray(env.autoTrim)) {\n // kinda confusing\n // but _}} will trim the left side of the following string\n leftTrim = env.autoTrim[1]\n rightTrim = env.autoTrim[0]\n }\n\n if (wsLeft || wsLeft === false) {\n leftTrim = wsLeft\n }\n\n if (wsRight || wsRight === false) {\n rightTrim = wsRight\n }\n\n if (leftTrim === 'slurp' && rightTrim === 'slurp') {\n return str.trim()\n }\n\n if (leftTrim === '_' || leftTrim === 'slurp') {\n // console.log('trimming left' + leftTrim)\n // full slurp\n if (String.prototype.trimLeft) {\n str = str.trimLeft()\n } else {\n str = str.replace(/^[\\s\\uFEFF\\xA0]+/, '')\n }\n } else if (leftTrim === '-' || leftTrim === 'nl') {\n // console.log('trimming left nl' + leftTrim)\n // nl trim\n str = str.replace(/^(?:\\n|\\r|\\r\\n)/, '')\n }\n\n if (rightTrim === '_' || rightTrim === 'slurp') {\n // console.log('trimming right' + rightTrim)\n // full slurp\n if (String.prototype.trimRight) {\n str = str.trimRight()\n } else {\n str = str.replace(/[\\s\\uFEFF\\xA0]+$/, '')\n }\n } else if (rightTrim === '-' || rightTrim === 'nl') {\n // console.log('trimming right nl' + rightTrim)\n // nl trim\n str = str.replace(/(?:\\n|\\r|\\r\\n)$/, '') // TODO: make sure this gets \\r\\n\n }\n\n return str\n}\n\nvar escMap: EscapeMap = {\n '&': '&',\n '<': '<',\n '\"': '"',\n \"'\": '''\n}\n\nfunction replaceChar (s: string): string {\n return escMap[s]\n}\n\nfunction XMLEscape (str: any) {\n // To deal with XSS. Based on Escape implementations of Mustache.JS and Marko, then customized.\n var newStr = String(str)\n if (/[&<\"']/.test(newStr)) {\n return newStr.replace(/[&<\"']/g, replaceChar)\n } else {\n return newStr\n }\n}\n\nexport { trimWS, XMLEscape }\n","import EtaErr, { ParseErr } from './err'\nimport { trimWS } from './utils'\n\n/* TYPES */\n\nimport { EtaConfig } from './config'\n\nexport type TagType = 'r' | 'e' | 'i' | ''\n\nexport interface TemplateObject {\n t: TagType\n val: string\n}\n\nexport type AstObject = string | TemplateObject\n\n/* END TYPES */\n\nexport default function parse (str: string, env: EtaConfig): Array {\n var buffer: Array = []\n var trimLeftOfNextStr: string | false = false\n var lastIndex = 0\n\n function pushString (strng: string, shouldTrimRightOfString?: string | false) {\n if (strng) {\n // if string is truthy it must be of type 'string'\n // replace \\ with \\\\, ' with \\'\n var stringToPush = strng.replace(/\\\\|'/g, '\\\\$&')\n\n // TODO: benchmark replace( /(\\\\|')/g, '\\\\$1')\n stringToPush = trimWS(\n stringToPush,\n env,\n trimLeftOfNextStr, // this will only be false on the first str, the next ones will be null or undefined\n shouldTrimRightOfString\n )\n\n stringToPush = stringToPush.replace(/\\n/g, '\\\\n').replace(/\\r/g, '\\\\r')\n\n if (stringToPush) {\n buffer.push(stringToPush)\n }\n }\n }\n\n var prefixes = (env.parse.exec + env.parse.interpolate + env.parse.raw).split('').join('|')\n\n var parseOpenReg = new RegExp('([^]*?)' + env.tags[0] + '(-|_)?\\\\s*(' + prefixes + ')?', 'g')\n var parseCloseReg = new RegExp(\n '\\\\s*((?:[^]*?(?:\\'(?:\\\\\\\\[\\\\s\\\\w\"\\'\\\\\\\\`]|[^\\\\n\\\\r\\'\\\\\\\\])*?\\'|`(?:\\\\\\\\[\\\\s\\\\w\"\\'\\\\\\\\`]|[^\\\\\\\\`])*?`|\"(?:\\\\\\\\[\\\\s\\\\w\"\\'\\\\\\\\`]|[^\\\\n\\\\r\"\\\\\\\\])*?\"|\\\\/\\\\*[^]*?\\\\*\\\\/)?)*?)\\\\s*(-|_)?' +\n env.tags[1],\n 'g'\n )\n // TODO: benchmark having the \\s* on either side vs using str.trim()\n\n var m\n\n while ((m = parseOpenReg.exec(str)) !== null) {\n lastIndex = m[0].length + m.index\n\n var precedingString = m[1]\n var wsLeft = m[2]\n var prefix = m[3] || '' // by default either ~, =, or empty\n\n pushString(precedingString, wsLeft)\n\n parseCloseReg.lastIndex = lastIndex\n var closeTag = parseCloseReg.exec(str)\n if (closeTag) {\n var content = closeTag[1]\n trimLeftOfNextStr = closeTag[2]\n parseOpenReg.lastIndex = lastIndex = parseCloseReg.lastIndex\n\n var currentType: TagType = ''\n if (prefix === env.parse.exec) {\n currentType = 'e'\n } else if (prefix === env.parse.raw) {\n currentType = 'r'\n } else if (prefix === env.parse.interpolate) {\n currentType = 'i'\n }\n\n buffer.push({ t: currentType, val: content })\n } else {\n ParseErr('unclosed tag', str, lastIndex)\n }\n }\n\n pushString(str.slice(lastIndex, str.length), false)\n\n if (env.plugins) {\n for (var i = 0; i < env.plugins.length; i++) {\n var plugin = env.plugins[i]\n if (plugin.processAST) {\n buffer = plugin.processAST(buffer, env)\n }\n }\n }\n\n return buffer\n}\n","import Parse from './parse'\n\n/* TYPES */\n\nimport { EtaConfig } from './config'\nimport { AstObject } from './parse'\n\n/* END TYPES */\n\nexport default function compileToString (str: string, env: EtaConfig) {\n var buffer: Array = Parse(str, env)\n\n var res =\n \"var tR='';\" +\n (env.useWith ? 'with(' + env.varName + '||{}){' : '') +\n compileScope(buffer, env) +\n 'if(cb){cb(null,tR)} return tR' +\n (env.useWith ? '}' : '')\n\n if (env.plugins) {\n for (var i = 0; i < env.plugins.length; i++) {\n var plugin = env.plugins[i]\n if (plugin.processFnString) {\n res = plugin.processFnString(res, env)\n }\n }\n }\n\n return res\n\n // TODO: is `return cb()` necessary, or could we just do `cb()`\n}\n\nfunction compileScope (buff: Array, env: EtaConfig) {\n var i = 0\n var buffLength = buff.length\n var returnStr = ''\n\n for (i; i < buffLength; i++) {\n var currentBlock = buff[i]\n if (typeof currentBlock === 'string') {\n var str = currentBlock\n\n // we know string exists\n returnStr += \"tR+='\" + str + \"';\"\n } else {\n var type = currentBlock.t // ~, s, !, ?, r\n var content = currentBlock.val || ''\n\n if (type === 'r') {\n // raw\n returnStr += 'tR+=' + content + ';'\n } else if (type === 'i') {\n // interpolate\n if (env.autoEscape) {\n content = 'E.e(' + content + ')'\n }\n returnStr += 'tR+=' + content + ';'\n // reference\n } else if (type === 'e') {\n // execute\n returnStr += content + '\\n' // you need a \\n in case you have <% } %>\n }\n }\n }\n\n return returnStr\n}\n","import { copyProps } from './utils'\n\n/* TYPES */\n\ninterface Dict {\n // Basically, an object where all keys point to a value of the same type\n [key: string]: T\n}\n\n/* END TYPES */\n\nclass Cacher {\n constructor (private cache: Dict) {}\n define (key: string, val: T) {\n this.cache[key] = val\n }\n get (key: string) {\n // string | array.\n // TODO: allow array of keys to look down\n // TODO: create plugin to allow referencing helpers, filters with dot notation\n return this.cache[key]\n }\n remove (key: string) {\n delete this.cache[key]\n }\n reset () {\n this.cache = {}\n }\n load (cacheObj: Dict) {\n // TODO: this will err with deep objects and `storage` or `plugins` keys.\n // Update Feb 26: EDITED so it shouldn't err\n copyProps(this.cache, cacheObj, true)\n }\n}\n\nexport { Cacher }\n","import { Cacher } from './storage'\nimport EtaErr from './err'\n\n/* TYPES */\n\nimport { EtaConfig } from './config'\nimport { TemplateFunction } from './compile'\n\n/* END TYPES */\n\nvar templates = new Cacher({})\n\n/* ASYNC LOOP FNs */\n\nexport { templates }\n","import { templates } from './containers'\nimport { copyProps, XMLEscape } from './utils'\nimport EtaErr from './err'\n\n/* TYPES */\n\nimport { TemplateFunction } from './compile'\nimport { Cacher } from './storage'\n\ntype trimConfig = 'nl' | 'slurp' | false\n\nexport interface EtaConfig {\n varName: string\n autoTrim: trimConfig | [trimConfig, trimConfig]\n autoEscape: boolean\n tags: [string, string]\n parse: {\n interpolate: string\n raw: string\n exec: string\n }\n e: (str: string) => string\n plugins: Array<{ processFnString?: Function; processAST?: Function }>\n async: boolean\n templates: Cacher\n cache: boolean\n views?: string | Array\n root?: string\n filename?: string\n name?: string\n 'view cache'?: boolean\n useWith?: boolean\n [index: string]: any\n}\n\nexport type PartialConfig = {\n [P in keyof EtaConfig]?: EtaConfig[P]\n}\n\n/* END TYPES */\n\nfunction includeHelper (this: EtaConfig, templateNameOrPath: string, data: object): string {\n var template = this.templates.get(templateNameOrPath)\n if (!template) {\n throw EtaErr('Could not fetch template \"' + templateNameOrPath + '\"')\n }\n return template(data, this)\n}\n\nvar defaultConfig: EtaConfig = {\n varName: 'it',\n autoTrim: [false, 'nl'],\n autoEscape: true,\n tags: ['<%', '%>'],\n parse: {\n interpolate: '=',\n raw: '~',\n exec: ''\n },\n async: false,\n templates: templates,\n cache: false,\n plugins: [],\n useWith: false,\n e: XMLEscape,\n include: includeHelper\n}\n\nincludeHelper.bind(defaultConfig)\n\nfunction getConfig (override: PartialConfig, baseConfig?: EtaConfig): EtaConfig {\n // TODO: run more tests on this\n\n var res: PartialConfig = {} // Linked\n copyProps(res, defaultConfig) // Creates deep clone of res, 1 layer deep\n\n if (baseConfig) {\n copyProps(res, baseConfig)\n }\n\n if (override) {\n copyProps(res, override)\n }\n\n return res as EtaConfig\n}\n\nexport { defaultConfig, getConfig }\n","import compileToString from './compile-string'\nimport { getConfig } from './config'\nimport EtaErr from './err'\n\n/* TYPES */\n\nimport { EtaConfig, PartialConfig } from './config'\nimport { CallbackFn } from './file-handlers'\nexport type TemplateFunction = (data: object, config: EtaConfig, cb?: CallbackFn) => string\n\n/* END TYPES */\n\nexport default function compile (str: string, env?: PartialConfig): TemplateFunction {\n var options: EtaConfig = getConfig(env || {})\n var ctor // constructor\n\n /* ASYNC HANDLING */\n // The below code is modified from mde/ejs. All credit should go to them.\n if (options.async) {\n // Have to use generated function for this, since in envs without support,\n // it breaks in parsing\n try {\n ctor = new Function('return (async function(){}).constructor;')()\n } catch (e) {\n if (e instanceof SyntaxError) {\n throw EtaErr(\"This environment doesn't support async/await\")\n } else {\n throw e\n }\n }\n } else {\n ctor = Function\n }\n /* END ASYNC HANDLING */\n try {\n return new ctor(\n options.varName,\n 'E', // EtaConfig\n 'cb', // optional callback\n compileToString(str, options)\n ) as TemplateFunction // eslint-disable-line no-new-func\n } catch (e) {\n if (e instanceof SyntaxError) {\n throw EtaErr(\n 'Bad template syntax\\n\\n' +\n e.message +\n '\\n' +\n Array(e.message.length + 1).join('=') +\n '\\n' +\n compileToString(str, options)\n )\n } else {\n throw e\n }\n }\n}\n","import compile from './compile'\nimport { getConfig } from './config'\nimport { promiseImpl } from './utils'\nimport EtaErr from './err'\n\n/* TYPES */\n\nimport { EtaConfig, PartialConfig } from './config'\nimport { TemplateFunction } from './compile'\nimport { CallbackFn } from './file-handlers'\n\n/* END TYPES */\n\nfunction handleCache (template: string | TemplateFunction, options: EtaConfig): TemplateFunction {\n var templateFunc\n\n if (options.cache && options.name && options.templates.get(options.name)) {\n return options.templates.get(options.name)\n }\n\n if (typeof template === 'function') {\n templateFunc = template\n } else {\n templateFunc = compile(template, options)\n }\n\n if (options.cache && options.name) {\n options.templates.define(options.name, templateFunc)\n }\n\n return templateFunc\n}\n\nexport default function render (\n template: string | TemplateFunction,\n data: object,\n env?: PartialConfig,\n cb?: CallbackFn\n) {\n var options = getConfig(env || {})\n\n if (options.async) {\n var result\n if (!cb) {\n // No callback, try returning a promise\n if (typeof promiseImpl === 'function') {\n return new promiseImpl(function (resolve: Function, reject: Function) {\n try {\n result = handleCache(template, options)(data, options)\n resolve(result)\n } catch (err) {\n reject(err)\n }\n })\n } else {\n throw EtaErr(\"Please provide a callback function, this env doesn't support Promises\")\n }\n } else {\n try {\n handleCache(template, options)(data, options, cb)\n } catch (err) {\n return cb(err)\n }\n }\n } else {\n return handleCache(template, options)(data, options)\n }\n}\n"],"names":["EtaErr","message","obj","proto","err","Error","prototype","Object","setPrototypeOf","__proto__","ParseErr","str","indx","whitespace","slice","split","lineNo","length","colNo","Array","join","create","name","value","enumerable","promiseImpl","Function","Promise","copyProps","toObj","fromObj","notConfig","key","prop","hasOwnProperty","call","escMap","&","<","\"","'","replaceChar","s","parse","env","buffer","trimLeftOfNextStr","lastIndex","pushString","strng","shouldTrimRightOfString","stringToPush","replace","wsLeft","wsRight","leftTrim","rightTrim","autoTrim","isArray","trim","String","trimLeft","trimRight","trimWS","push","m","prefixes","exec","interpolate","raw","parseOpenReg","RegExp","tags","parseCloseReg","index","precedingString","prefix","closeTag","content","currentType","t","val","plugins","i","plugin","processAST","compileToString","Parse","res","useWith","varName","buff","buffLength","returnStr","currentBlock","type","autoEscape","compileScope","processFnString","templates","cache","this","Cacher","cacheObj","includeHelper","templateNameOrPath","data","template","get","defaultConfig","async","e","newStr","test","include","getConfig","override","baseConfig","compile","ctor","options","SyntaxError","handleCache","templateFunc","define","bind","cb","resolve","reject"],"mappings":"0MAQwBA,EAAQC,GAC9B,IATuBC,EAAUC,EAS7BC,EAAM,IAAIC,MAAMJ,GAEpB,OAXuBC,EAURE,EAVkBD,EAUbH,EAAOM,UATvBC,OAAOC,eACTD,OAAOC,eAAeN,EAAKC,GAE3BD,EAAIO,UAAYN,EAOXC,WASOM,EAAUT,EAAiBU,EAAaC,GACtD,IAAIC,EAAaF,EAAIG,MAAM,EAAGF,GAAMG,MAAM,MAEtCC,EAASH,EAAWI,OACpBC,EAAQL,EAAWG,EAAS,GAAGC,OAAS,EAa5C,MAAMjB,EAZNC,GACE,YACAe,EACA,QACAE,EACA,UAEAP,EAAII,MAAM,MAAMC,EAAS,GACzB,OAEAG,MAAMD,GAAOE,KAAK,KAClB,KAtBJpB,EAAOM,UAAYC,OAAOc,OAAOhB,MAAMC,UAAW,CAChDgB,KAAM,CAAEC,MAAO,YAAaC,YAAY,KCEnC,IAAIC,EAAc,IAAIC,SAAS,eAAb,GAA+BC,iBAMxCC,EAAcC,EAAUC,EAAYC,GAClD,IAAK,IAAIC,KAAOF,EALU5B,EAMR4B,EANqBG,EAMUD,EAL1CzB,OAAOD,UAAU4B,eAAeC,KAAKjC,EAAK+B,KAM7CJ,EAAMG,GAAOF,EAAQE,QAPC9B,EAAa+B,EAUvC,OAAOJ,EAgET,IAAIO,EAAoB,CACtBC,IAAK,QACLC,IAAK,OACLC,IAAK,SACLC,IAAK,SAGP,SAASC,EAAaC,GACpB,OAAON,EAAOM,YCnFQC,EAAOhC,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,IAE9C,MAAOpH,GACP4H,EAAO5H,OAIX,MAAMJ,EAAO,yEAGf,IACE0H,EAAYf,EAAUa,EAAtBE,CAA+BhB,EAAMc,EAASM,GAC9C,MAAO1H,GACP,OAAO0H,EAAG1H"} \ No newline at end of file diff --git a/dist/eta.cjs.js.map b/dist/eta.cjs.js.map index 06473ed..a57ccac 100644 --- a/dist/eta.cjs.js.map +++ b/dist/eta.cjs.js.map @@ -1 +1 @@ -{"version":3,"file":"eta.cjs.js","sources":["../src/err.ts","../src/utils.ts","../src/parse.ts","../src/compile-string.ts","../src/storage.ts","../src/containers.ts","../src/config.ts","../src/compile.ts","../src/file-utils.ts","../src/file-handlers.ts","../src/file-helpers.ts","../src/render.ts","../src/index.ts"],"sourcesContent":["function setPrototypeOf (obj: any, proto: any) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(obj, proto)\n } else {\n obj.__proto__ = proto\n }\n}\n\nexport default function EtaErr (message: string): Error {\n var err = new Error(message)\n setPrototypeOf(err, EtaErr.prototype)\n return err\n}\n\nEtaErr.prototype = Object.create(Error.prototype, {\n name: { value: 'Eta Error', enumerable: false }\n})\n\n// TODO: Class transpilation adds a lot to the bundle size\n\nexport function ParseErr (message: string, str: string, indx: number) {\n var whitespace = str.slice(0, indx).split(/\\n/)\n\n var lineNo = whitespace.length\n var colNo = whitespace[lineNo - 1].length + 1\n message +=\n ' at line ' +\n lineNo +\n ' col ' +\n colNo +\n ':\\n\\n' +\n ' ' +\n str.split(/\\n/)[lineNo - 1] +\n '\\n' +\n ' ' +\n Array(colNo).join(' ') +\n '^'\n throw EtaErr(message)\n}\n","// TODO: allow '-' to trim up until newline. Use [^\\S\\n\\r] instead of \\s\n// TODO: only include trimLeft polyfill if not in ES6\n\n/* TYPES */\n\nimport { EtaConfig } from './config'\n\ninterface EscapeMap {\n '&': '&'\n '<': '<'\n '\"': '"'\n \"'\": '''\n [index: string]: string\n}\n\n/* END TYPES */\n\nexport var promiseImpl = new Function('return this;')().Promise\n\nexport function hasOwnProp (obj: object, prop: string) {\n return Object.prototype.hasOwnProperty.call(obj, prop)\n}\n\nexport function copyProps (toObj: T, fromObj: T, notConfig?: boolean) {\n for (var key in fromObj) {\n if (hasOwnProp((fromObj as unknown) as object, key)) {\n toObj[key] = fromObj[key]\n }\n }\n return toObj\n}\n\nfunction trimWS (\n str: string,\n env: EtaConfig,\n wsLeft: string | false,\n wsRight?: string | false\n): string {\n var leftTrim\n var rightTrim\n\n if (typeof env.autoTrim === 'string') {\n leftTrim = rightTrim = env.autoTrim\n } else if (Array.isArray(env.autoTrim)) {\n // kinda confusing\n // but _}} will trim the left side of the following string\n leftTrim = env.autoTrim[1]\n rightTrim = env.autoTrim[0]\n }\n\n if (wsLeft || wsLeft === false) {\n leftTrim = wsLeft\n }\n\n if (wsRight || wsRight === false) {\n rightTrim = wsRight\n }\n\n if (leftTrim === 'slurp' && rightTrim === 'slurp') {\n return str.trim()\n }\n\n if (leftTrim === '_' || leftTrim === 'slurp') {\n // console.log('trimming left' + leftTrim)\n // full slurp\n if (String.prototype.trimLeft) {\n str = str.trimLeft()\n } else {\n str = str.replace(/^[\\s\\uFEFF\\xA0]+/, '')\n }\n } else if (leftTrim === '-' || leftTrim === 'nl') {\n // console.log('trimming left nl' + leftTrim)\n // nl trim\n str = str.replace(/^(?:\\n|\\r|\\r\\n)/, '')\n }\n\n if (rightTrim === '_' || rightTrim === 'slurp') {\n // console.log('trimming right' + rightTrim)\n // full slurp\n if (String.prototype.trimRight) {\n str = str.trimRight()\n } else {\n str = str.replace(/[\\s\\uFEFF\\xA0]+$/, '')\n }\n } else if (rightTrim === '-' || rightTrim === 'nl') {\n // console.log('trimming right nl' + rightTrim)\n // nl trim\n str = str.replace(/(?:\\n|\\r|\\r\\n)$/, '') // TODO: make sure this gets \\r\\n\n }\n\n return str\n}\n\nvar escMap: EscapeMap = {\n '&': '&',\n '<': '<',\n '\"': '"',\n \"'\": '''\n}\n\nfunction replaceChar (s: string): string {\n return escMap[s]\n}\n\nfunction XMLEscape (str: any) {\n // To deal with XSS. Based on Escape implementations of Mustache.JS and Marko, then customized.\n var newStr = String(str)\n if (/[&<\"']/.test(newStr)) {\n return newStr.replace(/[&<\"']/g, replaceChar)\n } else {\n return newStr\n }\n}\n\nexport { trimWS, XMLEscape }\n","import EtaErr, { ParseErr } from './err'\nimport { trimWS } from './utils'\n\n/* TYPES */\n\nimport { EtaConfig } from './config'\n\nexport type TagType = 'r' | 'e' | 'i' | ''\n\nexport interface TemplateObject {\n t: TagType\n val: string\n}\n\nexport type AstObject = string | TemplateObject\n\n/* END TYPES */\n\nexport default function parse(str: string, env: EtaConfig): Array {\n var buffer: Array = []\n var trimLeftOfNextStr: string | false = false\n var lastIndex = 0\n\n function pushString(strng: string, shouldTrimRightOfString?: string | false) {\n if (strng) {\n // if string is truthy it must be of type 'string'\n // replace \\ with \\\\, ' with \\'\n var stringToPush = strng.replace(/\\\\|'/g, '\\\\$&')\n\n // TODO: benchmark replace( /(\\\\|')/g, '\\\\$1')\n stringToPush = trimWS(\n stringToPush,\n env,\n trimLeftOfNextStr, // this will only be false on the first str, the next ones will be null or undefined\n shouldTrimRightOfString\n )\n\n stringToPush = stringToPush.replace(/\\n/g, '\\\\n').replace(/\\r/g, '\\\\r')\n\n if (stringToPush) {\n buffer.push(stringToPush)\n }\n }\n }\n\n var prefixes = (env.parse.exec + env.parse.interpolate + env.parse.raw).split('').join('|')\n\n var parseOpenReg = new RegExp('([^]*?)' + env.tags[0] + '(-|_)?\\\\s*(' + prefixes + ')?', 'g')\n var parseCloseReg = new RegExp(\n '\\\\s*((?:[^]*?(?:\\'(?:\\\\\\\\[\\\\s\\\\w\"\\'\\\\\\\\`]|[^\\\\n\\\\r\\'\\\\\\\\])*?\\'|`(?:\\\\\\\\[\\\\s\\\\w\"\\'\\\\\\\\`]|[^\\\\\\\\`])*?`|\"(?:\\\\\\\\[\\\\s\\\\w\"\\'\\\\\\\\`]|[^\\\\n\\\\r\"\\\\\\\\])*?\"|\\\\/\\\\*[^]*?\\\\*\\\\/)?)*?)\\\\s*(-|_)?' +\n env.tags[1],\n 'g'\n )\n // TODO: benchmark having the \\s* on either side vs using str.trim()\n\n var m\n\n while ((m = parseOpenReg.exec(str)) !== null) {\n lastIndex = m[0].length + m.index\n\n var precedingString = m[1]\n var wsLeft = m[2]\n var prefix = m[3] || '' // by default either ~, =, or empty\n\n pushString(precedingString, wsLeft)\n\n parseCloseReg.lastIndex = lastIndex\n var closeTag = parseCloseReg.exec(str)\n if (closeTag) {\n var content = closeTag[1]\n trimLeftOfNextStr = closeTag[2]\n parseOpenReg.lastIndex = lastIndex = parseCloseReg.lastIndex\n\n var currentType: TagType = ''\n if (prefix === env.parse.exec) {\n currentType = 'e'\n } else if (prefix === env.parse.raw) {\n currentType = 'r'\n } else if (prefix === env.parse.interpolate) {\n currentType = 'i'\n }\n\n buffer.push({ t: currentType, val: content })\n } else {\n ParseErr('unclosed tag', str, lastIndex)\n }\n }\n\n pushString(str.slice(lastIndex, str.length), false)\n\n if (env.plugins) {\n for (var i = 0; i < env.plugins.length; i++) {\n var plugin = env.plugins[i]\n if (plugin.processAST) {\n buffer = plugin.processAST(buffer, env)\n }\n }\n }\n\n return buffer\n}\n","import Parse from './parse'\n\n/* TYPES */\n\nimport { EtaConfig } from './config'\nimport { AstObject } from './parse'\n\n/* END TYPES */\n\nexport default function compileToString (str: string, env: EtaConfig) {\n var buffer: Array = Parse(str, env)\n\n var res =\n \"var tR='';\" +\n (env.useWith ? 'with(' + env.varName + '||{}){' : '') +\n compileScope(buffer, env) +\n 'if(cb){cb(null,tR)} return tR' +\n (env.useWith ? '}' : '')\n\n if (env.plugins) {\n for (var i = 0; i < env.plugins.length; i++) {\n var plugin = env.plugins[i]\n if (plugin.processFnString) {\n res = plugin.processFnString(res, env)\n }\n }\n }\n\n return res\n\n // TODO: is `return cb()` necessary, or could we just do `cb()`\n}\n\nfunction compileScope (buff: Array, env: EtaConfig) {\n var i = 0\n var buffLength = buff.length\n var returnStr = ''\n\n for (i; i < buffLength; i++) {\n var currentBlock = buff[i]\n if (typeof currentBlock === 'string') {\n var str = currentBlock\n\n // we know string exists\n returnStr += \"tR+='\" + str + \"';\"\n } else {\n var type = currentBlock.t // ~, s, !, ?, r\n var content = currentBlock.val || ''\n\n if (type === 'r') {\n // raw\n returnStr += 'tR+=' + content + ';'\n } else if (type === 'i') {\n // interpolate\n if (env.autoEscape) {\n content = 'E.e(' + content + ')'\n }\n returnStr += 'tR+=' + content + ';'\n // reference\n } else if (type === 'e') {\n // execute\n returnStr += content + '\\n' // you need a \\n in case you have <% } %>\n }\n }\n }\n\n return returnStr\n}\n","import { copyProps } from './utils'\n\n/* TYPES */\n\ninterface Dict {\n // Basically, an object where all keys point to a value of the same type\n [key: string]: T\n}\n\n/* END TYPES */\n\nclass Cacher {\n constructor (private cache: Dict) {}\n define (key: string, val: T) {\n this.cache[key] = val\n }\n get (key: string) {\n // string | array.\n // TODO: allow array of keys to look down\n // TODO: create plugin to allow referencing helpers, filters with dot notation\n return this.cache[key]\n }\n remove (key: string) {\n delete this.cache[key]\n }\n reset () {\n this.cache = {}\n }\n load (cacheObj: Dict) {\n // TODO: this will err with deep objects and `storage` or `plugins` keys.\n // Update Feb 26: EDITED so it shouldn't err\n copyProps(this.cache, cacheObj, true)\n }\n}\n\nexport { Cacher }\n","import { Cacher } from './storage'\nimport EtaErr from './err'\n\n/* TYPES */\n\nimport { EtaConfig } from './config'\nimport { TemplateFunction } from './compile'\n\n/* END TYPES */\n\nvar templates = new Cacher({})\n\n/* ASYNC LOOP FNs */\n\nexport { templates }\n","import { templates } from './containers'\nimport { copyProps, XMLEscape } from './utils'\nimport EtaErr from './err'\n\n/* TYPES */\n\nimport { TemplateFunction } from './compile'\nimport { Cacher } from './storage'\n\ntype trimConfig = 'nl' | 'slurp' | false\n\nexport interface EtaConfig {\n varName: string\n autoTrim: trimConfig | [trimConfig, trimConfig]\n autoEscape: boolean\n tags: [string, string]\n parse: {\n interpolate: string\n raw: string\n exec: string\n }\n e: (str: string) => string\n plugins: Array<{ processFnString?: Function; processAST?: Function }>\n async: boolean\n templates: Cacher\n cache: boolean\n views?: string | Array\n root?: string\n filename?: string\n name?: string\n 'view cache'?: boolean\n useWith?: boolean\n [index: string]: any\n}\n\nexport type PartialConfig = {\n [P in keyof EtaConfig]?: EtaConfig[P]\n}\n\n/* END TYPES */\n\nfunction includeHelper (this: EtaConfig, templateNameOrPath: string, data: object): string {\n var template = this.templates.get(templateNameOrPath)\n if (!template) {\n throw EtaErr('Could not fetch template \"' + templateNameOrPath + '\"')\n }\n return template(data, this)\n}\n\nvar defaultConfig: EtaConfig = {\n varName: 'it',\n autoTrim: [false, 'nl'],\n autoEscape: true,\n tags: ['<%', '%>'],\n parse: {\n interpolate: '=',\n raw: '~',\n exec: ''\n },\n async: false,\n templates: templates,\n cache: false,\n plugins: [],\n useWith: false,\n e: XMLEscape,\n include: includeHelper\n}\n\nincludeHelper.bind(defaultConfig)\n\nfunction getConfig (override: PartialConfig, baseConfig?: EtaConfig): EtaConfig {\n // TODO: run more tests on this\n\n var res: PartialConfig = {} // Linked\n copyProps(res, defaultConfig) // Creates deep clone of res, 1 layer deep\n\n if (baseConfig) {\n copyProps(res, baseConfig)\n }\n\n if (override) {\n copyProps(res, override)\n }\n\n return res as EtaConfig\n}\n\nexport { defaultConfig, getConfig }\n","import compileToString from './compile-string'\nimport { getConfig } from './config'\nimport EtaErr from './err'\n\n/* TYPES */\n\nimport { EtaConfig, PartialConfig } from './config'\nimport { CallbackFn } from './file-handlers'\nexport type TemplateFunction = (data: object, config: EtaConfig, cb?: CallbackFn) => string\n\n/* END TYPES */\n\nexport default function compile (str: string, env?: PartialConfig): TemplateFunction {\n var options: EtaConfig = getConfig(env || {})\n var ctor // constructor\n\n /* ASYNC HANDLING */\n // The below code is modified from mde/ejs. All credit should go to them.\n if (options.async) {\n // Have to use generated function for this, since in envs without support,\n // it breaks in parsing\n try {\n ctor = new Function('return (async function(){}).constructor;')()\n } catch (e) {\n if (e instanceof SyntaxError) {\n throw EtaErr(\"This environment doesn't support async/await\")\n } else {\n throw e\n }\n }\n } else {\n ctor = Function\n }\n /* END ASYNC HANDLING */\n try {\n return new ctor(\n options.varName,\n 'E', // EtaConfig\n 'cb', // optional callback\n compileToString(str, options)\n ) as TemplateFunction // eslint-disable-line no-new-func\n } catch (e) {\n if (e instanceof SyntaxError) {\n throw EtaErr(\n 'Bad template syntax\\n\\n' +\n e.message +\n '\\n' +\n Array(e.message.length + 1).join('=') +\n '\\n' +\n compileToString(str, options)\n )\n } else {\n throw e\n }\n }\n}\n","var fs = require('fs')\nvar path = require('path')\nvar _BOM = /^\\uFEFF/\n\n// express is set like: app.engine('html', require('eta').renderFile)\n\nimport EtaErr from './err'\nimport Compile from './compile'\nimport { getConfig } from './config'\n\n/* TYPES */\n\nimport { EtaConfig, PartialConfig } from './config'\nimport { TemplateFunction } from './compile'\n\ninterface PartialFileConfig extends PartialConfig {\n filename: string\n}\n\ninterface FileConfig extends EtaConfig {\n filename: string\n}\n\n/* END TYPES */\n\n/**\n * Get the path to the included file from the parent file path and the\n * specified path.\n *\n * @param {String} name specified path\n * @param {String} parentfile parent file path\n * @param {Boolean} [isDir=false] whether parent file path is a directory\n * @return {String}\n */\n\nfunction getWholeFilePath (name: string, parentfile: string, isDirectory?: boolean) {\n var includePath = path.resolve(\n isDirectory ? parentfile : path.dirname(parentfile), // returns directory the parent file is in\n name // file\n )\n var ext = path.extname(name)\n if (!ext) {\n includePath += '.eta'\n }\n return includePath\n}\n\n/**\n * Get the path to the included file by Options\n *\n * @param {String} path specified path\n * @param {Options} options compilation options\n * @return {String}\n */\n\nfunction getPath (path: string, options: EtaConfig) {\n var includePath\n var filePath\n var views = options.views\n var match = /^[A-Za-z]+:\\\\|^\\//.exec(path)\n\n // Abs path\n if (match && match.length) {\n includePath = getWholeFilePath(path.replace(/^\\/*/, ''), options.root || '/', true)\n } else {\n // Relative paths\n // Look relative to a passed filename first\n if (options.filename) {\n filePath = getWholeFilePath(path, options.filename)\n if (fs.existsSync(filePath)) {\n includePath = filePath\n }\n }\n // Then look in any views directories\n if (!includePath) {\n if (\n Array.isArray(views) &&\n views.some(function (v) {\n filePath = getWholeFilePath(path, v, true)\n return fs.existsSync(filePath)\n })\n ) {\n includePath = filePath\n }\n }\n if (!includePath) {\n throw EtaErr('Could not find the include file \"' + path + '\"')\n }\n }\n return includePath\n}\n\nfunction readFile (filePath: string) {\n return fs\n .readFileSync(filePath)\n .toString()\n .replace(_BOM, '') // TODO: is replacing BOM's necessary?\n}\n\nfunction loadFile (filePath: string, options: PartialFileConfig): TemplateFunction {\n var config = getConfig(options)\n var template = readFile(filePath)\n try {\n var compiledTemplate = Compile(template, config)\n config.templates.define((config as FileConfig).filename, compiledTemplate)\n return compiledTemplate\n } catch (e) {\n throw EtaErr('Loading file: ' + filePath + ' failed')\n }\n}\n\nexport { getPath, readFile, loadFile }\n","// express is set like: app.engine('html', require('eta').renderFile)\n\nimport EtaErr from './err'\nimport compile from './compile'\nimport { getConfig } from './config'\nimport { getPath, readFile, loadFile } from './file-utils'\nimport { promiseImpl, copyProps } from './utils'\n\n/* TYPES */\n\nimport { EtaConfig, PartialConfig } from './config'\nimport { TemplateFunction } from './compile'\n\nexport type CallbackFn = (err: Error | null, str?: string) => void\n\ninterface FileOptions extends EtaConfig {\n filename: string\n}\n\ninterface DataObj {\n settings?: {\n [key: string]: any\n }\n [key: string]: any\n}\n\n/* END TYPES */\n\n/**\n * Get the template from a string or a file, either compiled on-the-fly or\n * read from cache (if enabled), and cache the template if needed.\n *\n * If `options.cache` is true, this function reads the file from\n * `options.filename` so it must be set prior to calling this function.\n *\n * @param {Options} options compilation options\n * @param {String} [template] template source\n * @return {(TemplateFunction|ClientFunction)}\n * Depending on the value of `options.client`, either type might be returned.\n * @static\n */\n\nfunction handleCache (options: FileOptions): TemplateFunction {\n var filename = options.filename\n\n if (options.cache) {\n var func = options.templates.get(filename)\n if (func) {\n return func\n } else {\n return loadFile(filename, options)\n }\n }\n\n return compile(readFile(filename), options)\n}\n\n/**\n * Try calling handleCache with the given options and data and call the\n * callback with the result. If an error occurs, call the callback with\n * the error. Used by renderFile().\n *\n * @param {Options} options compilation options\n * @param {Object} data template data\n * @param {RenderFileCallback} cb callback\n * @static\n */\n\nfunction tryHandleCache (options: FileOptions, data: object, cb: CallbackFn) {\n var result\n if (!cb) {\n // No callback, try returning a promise\n if (typeof promiseImpl === 'function') {\n return new promiseImpl(function (resolve: Function, reject: Function) {\n try {\n result = handleCache(options)(data, options)\n resolve(result)\n } catch (err) {\n reject(err)\n }\n })\n } else {\n throw EtaErr(\"Please provide a callback function, this env doesn't support Promises\")\n }\n } else {\n try {\n handleCache(options)(data, options, cb)\n } catch (err) {\n return cb(err)\n }\n }\n}\n\n/**\n * Get the template function.\n *\n * If `options.cache` is `true`, then the template is cached.\n *\n * @param {String} path path for the specified file\n * @param {Options} options compilation options\n * @return {(TemplateFunction|ClientFunction)}\n * Depending on the value of `options.client`, either type might be returned\n * @static\n */\n\nfunction includeFile (path: string, options: EtaConfig) {\n // the below creates a new options object, using the parent filepath of the old options object and the path\n var newFileOptions = getConfig({ filename: getPath(path, options) }, options)\n // TODO: make sure properties are currectly copied over\n return handleCache(newFileOptions as FileOptions)\n}\n\nfunction renderFile (filename: string, data: DataObj, cb?: CallbackFn) {\n var Config: FileOptions = getConfig((data as PartialConfig) || {}) as FileOptions\n // TODO: make sure above doesn't error. We do set filename down below\n\n if (data.settings) {\n // Pull a few things from known locations\n if (data.settings.views) {\n Config.views = data.settings.views\n }\n if (data.settings['view cache']) {\n Config.cache = true\n }\n // Undocumented after Express 2, but still usable, esp. for\n // items that are unsafe to be passed along with data, like `root`\n var viewOpts = data.settings['view options']\n\n if (viewOpts) {\n copyProps(Config, viewOpts)\n }\n }\n\n Config.filename = filename // Make sure filename is right\n\n return tryHandleCache(Config, data, cb as CallbackFn)\n}\n\nexport { includeFile, renderFile }\n","import { includeFile } from './file-handlers'\nimport EtaErr from './err'\n\n/* TYPES */\n\nimport { EtaConfig } from './config'\n\ninterface GenericData {\n [index: string]: any\n}\n\n/* END TYPES */\n\nexport function includeFileHelper (this: EtaConfig, path: string, data: GenericData): string {\n return includeFile(path, this)(data, this)\n}\n\n// export function extendsFileHelper(path: string, data: GenericData, config: EtaConfig): string {\n// var data: GenericData = content.params[1] || {}\n\n// data.content = content.exec()\n// for (var i = 0; i < blocks.length; i++) {\n// var currentBlock = blocks[i]\n// data[currentBlock.name] = currentBlock.exec()\n// }\n\n// return includeFile(content.params[0], config)(data, config)\n// }\n","import compile from './compile'\nimport { getConfig } from './config'\nimport { promiseImpl } from './utils'\nimport EtaErr from './err'\n\n/* TYPES */\n\nimport { EtaConfig, PartialConfig } from './config'\nimport { TemplateFunction } from './compile'\nimport { CallbackFn } from './file-handlers'\n\n/* END TYPES */\n\nfunction handleCache (template: string | TemplateFunction, options: EtaConfig): TemplateFunction {\n var templateFunc\n\n if (options.cache && options.name && options.templates.get(options.name)) {\n return options.templates.get(options.name)\n }\n\n if (typeof template === 'function') {\n templateFunc = template\n } else {\n templateFunc = compile(template, options)\n }\n\n if (options.cache && options.name) {\n options.templates.define(options.name, templateFunc)\n }\n\n return templateFunc\n}\n\nexport default function render (\n template: string | TemplateFunction,\n data: object,\n env?: PartialConfig,\n cb?: CallbackFn\n) {\n var options = getConfig(env || {})\n\n if (options.async) {\n var result\n if (!cb) {\n // No callback, try returning a promise\n if (typeof promiseImpl === 'function') {\n return new promiseImpl(function (resolve: Function, reject: Function) {\n try {\n result = handleCache(template, options)(data, options)\n resolve(result)\n } catch (err) {\n reject(err)\n }\n })\n } else {\n throw EtaErr(\"Please provide a callback function, this env doesn't support Promises\")\n }\n } else {\n try {\n handleCache(template, options)(data, options, cb)\n } catch (err) {\n return cb(err)\n }\n }\n } else {\n return handleCache(template, options)(data, options)\n }\n}\n","/* Export file stuff */\nimport { includeFileHelper } from './file-helpers'\nimport { defaultConfig } from './config'\n\n/* TYPES */\n\n/* END TYPES */\n\ndefaultConfig.includeFile = includeFileHelper\nincludeFileHelper.bind(defaultConfig)\n\nexport { renderFile, renderFile as __express } from './file-handlers'\nexport { loadFile } from './file-utils'\n\n/* End file stuff */\n\nexport { default as compileToString } from './compile-string'\nexport { default as compile } from './compile'\nexport { default as parse } from './parse'\nexport { default as render } from './render'\nexport { templates } from './containers'\nexport { defaultConfig, getConfig } from './config'\n"],"names":["Parse","Compile","handleCache"],"mappings":";;;;AAAA,SAAS,cAAc,CAAE,GAAQ,EAAE,KAAU;IAC3C,IAAI,MAAM,CAAC,cAAc,EAAE;QACzB,MAAM,CAAC,cAAc,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;KAClC;SAAM;QACL,GAAG,CAAC,SAAS,GAAG,KAAK,CAAA;KACtB;AACH,CAAC;SAEuB,MAAM,CAAE,OAAe;IAC7C,IAAI,GAAG,GAAG,IAAI,KAAK,CAAC,OAAO,CAAC,CAAA;IAC5B,cAAc,CAAC,GAAG,EAAE,MAAM,CAAC,SAAS,CAAC,CAAA;IACrC,OAAO,GAAG,CAAA;AACZ,CAAC;AAED,MAAM,CAAC,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,EAAE;IAChD,IAAI,EAAE,EAAE,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,KAAK,EAAE;CAChD,CAAC,CAAA;AAEF;SAEgB,QAAQ,CAAE,OAAe,EAAE,GAAW,EAAE,IAAY;IAClE,IAAI,UAAU,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;IAE/C,IAAI,MAAM,GAAG,UAAU,CAAC,MAAM,CAAA;IAC9B,IAAI,KAAK,GAAG,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAA;IAC7C,OAAO;QACL,WAAW;YACX,MAAM;YACN,OAAO;YACP,KAAK;YACL,OAAO;YACP,IAAI;YACJ,GAAG,C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AAQ,EAAE,OAAO,CAAC,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;KACrD;AACH,CAAC;;ACnED;AACA,AAGA;AAEA;AAEA,aAAa,CAAC,WAAW,GAAG,iBAAiB,CAAA;AAC7C,iBAAiB,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA;;;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"eta.cjs.js","sources":["../src/err.ts","../src/utils.ts","../src/parse.ts","../src/compile-string.ts","../src/storage.ts","../src/containers.ts","../src/config.ts","../src/compile.ts","../src/file-utils.ts","../src/file-handlers.ts","../src/file-helpers.ts","../src/render.ts","../src/index.ts"],"sourcesContent":["function setPrototypeOf (obj: any, proto: any) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(obj, proto)\n } else {\n obj.__proto__ = proto\n }\n}\n\nexport default function EtaErr (message: string): Error {\n var err = new Error(message)\n setPrototypeOf(err, EtaErr.prototype)\n return err\n}\n\nEtaErr.prototype = Object.create(Error.prototype, {\n name: { value: 'Eta Error', enumerable: false }\n})\n\n// TODO: Class transpilation adds a lot to the bundle size\n\nexport function ParseErr (message: string, str: string, indx: number) {\n var whitespace = str.slice(0, indx).split(/\\n/)\n\n var lineNo = whitespace.length\n var colNo = whitespace[lineNo - 1].length + 1\n message +=\n ' at line ' +\n lineNo +\n ' col ' +\n colNo +\n ':\\n\\n' +\n ' ' +\n str.split(/\\n/)[lineNo - 1] +\n '\\n' +\n ' ' +\n Array(colNo).join(' ') +\n '^'\n throw EtaErr(message)\n}\n","// TODO: allow '-' to trim up until newline. Use [^\\S\\n\\r] instead of \\s\n// TODO: only include trimLeft polyfill if not in ES6\n\n/* TYPES */\n\nimport { EtaConfig } from './config'\n\ninterface EscapeMap {\n '&': '&'\n '<': '<'\n '\"': '"'\n \"'\": '''\n [index: string]: string\n}\n\n/* END TYPES */\n\nexport var promiseImpl = new Function('return this;')().Promise\n\nexport function hasOwnProp (obj: object, prop: string) {\n return Object.prototype.hasOwnProperty.call(obj, prop)\n}\n\nexport function copyProps (toObj: T, fromObj: T, notConfig?: boolean) {\n for (var key in fromObj) {\n if (hasOwnProp((fromObj as unknown) as object, key)) {\n toObj[key] = fromObj[key]\n }\n }\n return toObj\n}\n\nfunction trimWS (\n str: string,\n env: EtaConfig,\n wsLeft: string | false,\n wsRight?: string | false\n): string {\n var leftTrim\n var rightTrim\n\n if (typeof env.autoTrim === 'string') {\n leftTrim = rightTrim = env.autoTrim\n } else if (Array.isArray(env.autoTrim)) {\n // kinda confusing\n // but _}} will trim the left side of the following string\n leftTrim = env.autoTrim[1]\n rightTrim = env.autoTrim[0]\n }\n\n if (wsLeft || wsLeft === false) {\n leftTrim = wsLeft\n }\n\n if (wsRight || wsRight === false) {\n rightTrim = wsRight\n }\n\n if (leftTrim === 'slurp' && rightTrim === 'slurp') {\n return str.trim()\n }\n\n if (leftTrim === '_' || leftTrim === 'slurp') {\n // console.log('trimming left' + leftTrim)\n // full slurp\n if (String.prototype.trimLeft) {\n str = str.trimLeft()\n } else {\n str = str.replace(/^[\\s\\uFEFF\\xA0]+/, '')\n }\n } else if (leftTrim === '-' || leftTrim === 'nl') {\n // console.log('trimming left nl' + leftTrim)\n // nl trim\n str = str.replace(/^(?:\\n|\\r|\\r\\n)/, '')\n }\n\n if (rightTrim === '_' || rightTrim === 'slurp') {\n // console.log('trimming right' + rightTrim)\n // full slurp\n if (String.prototype.trimRight) {\n str = str.trimRight()\n } else {\n str = str.replace(/[\\s\\uFEFF\\xA0]+$/, '')\n }\n } else if (rightTrim === '-' || rightTrim === 'nl') {\n // console.log('trimming right nl' + rightTrim)\n // nl trim\n str = str.replace(/(?:\\n|\\r|\\r\\n)$/, '') // TODO: make sure this gets \\r\\n\n }\n\n return str\n}\n\nvar escMap: EscapeMap = {\n '&': '&',\n '<': '<',\n '\"': '"',\n \"'\": '''\n}\n\nfunction replaceChar (s: string): string {\n return escMap[s]\n}\n\nfunction XMLEscape (str: any) {\n // To deal with XSS. Based on Escape implementations of Mustache.JS and Marko, then customized.\n var newStr = String(str)\n if (/[&<\"']/.test(newStr)) {\n return newStr.replace(/[&<\"']/g, replaceChar)\n } else {\n return newStr\n }\n}\n\nexport { trimWS, XMLEscape }\n","import EtaErr, { ParseErr } from './err'\nimport { trimWS } from './utils'\n\n/* TYPES */\n\nimport { EtaConfig } from './config'\n\nexport type TagType = 'r' | 'e' | 'i' | ''\n\nexport interface TemplateObject {\n t: TagType\n val: string\n}\n\nexport type AstObject = string | TemplateObject\n\n/* END TYPES */\n\nexport default function parse (str: string, env: EtaConfig): Array {\n var buffer: Array = []\n var trimLeftOfNextStr: string | false = false\n var lastIndex = 0\n\n function pushString (strng: string, shouldTrimRightOfString?: string | false) {\n if (strng) {\n // if string is truthy it must be of type 'string'\n // replace \\ with \\\\, ' with \\'\n var stringToPush = strng.replace(/\\\\|'/g, '\\\\$&')\n\n // TODO: benchmark replace( /(\\\\|')/g, '\\\\$1')\n stringToPush = trimWS(\n stringToPush,\n env,\n trimLeftOfNextStr, // this will only be false on the first str, the next ones will be null or undefined\n shouldTrimRightOfString\n )\n\n stringToPush = stringToPush.replace(/\\n/g, '\\\\n').replace(/\\r/g, '\\\\r')\n\n if (stringToPush) {\n buffer.push(stringToPush)\n }\n }\n }\n\n var prefixes = (env.parse.exec + env.parse.interpolate + env.parse.raw).split('').join('|')\n\n var parseOpenReg = new RegExp('([^]*?)' + env.tags[0] + '(-|_)?\\\\s*(' + prefixes + ')?', 'g')\n var parseCloseReg = new RegExp(\n '\\\\s*((?:[^]*?(?:\\'(?:\\\\\\\\[\\\\s\\\\w\"\\'\\\\\\\\`]|[^\\\\n\\\\r\\'\\\\\\\\])*?\\'|`(?:\\\\\\\\[\\\\s\\\\w\"\\'\\\\\\\\`]|[^\\\\\\\\`])*?`|\"(?:\\\\\\\\[\\\\s\\\\w\"\\'\\\\\\\\`]|[^\\\\n\\\\r\"\\\\\\\\])*?\"|\\\\/\\\\*[^]*?\\\\*\\\\/)?)*?)\\\\s*(-|_)?' +\n env.tags[1],\n 'g'\n )\n // TODO: benchmark having the \\s* on either side vs using str.trim()\n\n var m\n\n while ((m = parseOpenReg.exec(str)) !== null) {\n lastIndex = m[0].length + m.index\n\n var precedingString = m[1]\n var wsLeft = m[2]\n var prefix = m[3] || '' // by default either ~, =, or empty\n\n pushString(precedingString, wsLeft)\n\n parseCloseReg.lastIndex = lastIndex\n var closeTag = parseCloseReg.exec(str)\n if (closeTag) {\n var content = closeTag[1]\n trimLeftOfNextStr = closeTag[2]\n parseOpenReg.lastIndex = lastIndex = parseCloseReg.lastIndex\n\n var currentType: TagType = ''\n if (prefix === env.parse.exec) {\n currentType = 'e'\n } else if (prefix === env.parse.raw) {\n currentType = 'r'\n } else if (prefix === env.parse.interpolate) {\n currentType = 'i'\n }\n\n buffer.push({ t: currentType, val: content })\n } else {\n ParseErr('unclosed tag', str, lastIndex)\n }\n }\n\n pushString(str.slice(lastIndex, str.length), false)\n\n if (env.plugins) {\n for (var i = 0; i < env.plugins.length; i++) {\n var plugin = env.plugins[i]\n if (plugin.processAST) {\n buffer = plugin.processAST(buffer, env)\n }\n }\n }\n\n return buffer\n}\n","import Parse from './parse'\n\n/* TYPES */\n\nimport { EtaConfig } from './config'\nimport { AstObject } from './parse'\n\n/* END TYPES */\n\nexport default function compileToString (str: string, env: EtaConfig) {\n var buffer: Array = Parse(str, env)\n\n var res =\n \"var tR='';\" +\n (env.useWith ? 'with(' + env.varName + '||{}){' : '') +\n compileScope(buffer, env) +\n 'if(cb){cb(null,tR)} return tR' +\n (env.useWith ? '}' : '')\n\n if (env.plugins) {\n for (var i = 0; i < env.plugins.length; i++) {\n var plugin = env.plugins[i]\n if (plugin.processFnString) {\n res = plugin.processFnString(res, env)\n }\n }\n }\n\n return res\n\n // TODO: is `return cb()` necessary, or could we just do `cb()`\n}\n\nfunction compileScope (buff: Array, env: EtaConfig) {\n var i = 0\n var buffLength = buff.length\n var returnStr = ''\n\n for (i; i < buffLength; i++) {\n var currentBlock = buff[i]\n if (typeof currentBlock === 'string') {\n var str = currentBlock\n\n // we know string exists\n returnStr += \"tR+='\" + str + \"';\"\n } else {\n var type = currentBlock.t // ~, s, !, ?, r\n var content = currentBlock.val || ''\n\n if (type === 'r') {\n // raw\n returnStr += 'tR+=' + content + ';'\n } else if (type === 'i') {\n // interpolate\n if (env.autoEscape) {\n content = 'E.e(' + content + ')'\n }\n returnStr += 'tR+=' + content + ';'\n // reference\n } else if (type === 'e') {\n // execute\n returnStr += content + '\\n' // you need a \\n in case you have <% } %>\n }\n }\n }\n\n return returnStr\n}\n","import { copyProps } from './utils'\n\n/* TYPES */\n\ninterface Dict {\n // Basically, an object where all keys point to a value of the same type\n [key: string]: T\n}\n\n/* END TYPES */\n\nclass Cacher {\n constructor (private cache: Dict) {}\n define (key: string, val: T) {\n this.cache[key] = val\n }\n get (key: string) {\n // string | array.\n // TODO: allow array of keys to look down\n // TODO: create plugin to allow referencing helpers, filters with dot notation\n return this.cache[key]\n }\n remove (key: string) {\n delete this.cache[key]\n }\n reset () {\n this.cache = {}\n }\n load (cacheObj: Dict) {\n // TODO: this will err with deep objects and `storage` or `plugins` keys.\n // Update Feb 26: EDITED so it shouldn't err\n copyProps(this.cache, cacheObj, true)\n }\n}\n\nexport { Cacher }\n","import { Cacher } from './storage'\nimport EtaErr from './err'\n\n/* TYPES */\n\nimport { EtaConfig } from './config'\nimport { TemplateFunction } from './compile'\n\n/* END TYPES */\n\nvar templates = new Cacher({})\n\n/* ASYNC LOOP FNs */\n\nexport { templates }\n","import { templates } from './containers'\nimport { copyProps, XMLEscape } from './utils'\nimport EtaErr from './err'\n\n/* TYPES */\n\nimport { TemplateFunction } from './compile'\nimport { Cacher } from './storage'\n\ntype trimConfig = 'nl' | 'slurp' | false\n\nexport interface EtaConfig {\n varName: string\n autoTrim: trimConfig | [trimConfig, trimConfig]\n autoEscape: boolean\n tags: [string, string]\n parse: {\n interpolate: string\n raw: string\n exec: string\n }\n e: (str: string) => string\n plugins: Array<{ processFnString?: Function; processAST?: Function }>\n async: boolean\n templates: Cacher\n cache: boolean\n views?: string | Array\n root?: string\n filename?: string\n name?: string\n 'view cache'?: boolean\n useWith?: boolean\n [index: string]: any\n}\n\nexport type PartialConfig = {\n [P in keyof EtaConfig]?: EtaConfig[P]\n}\n\n/* END TYPES */\n\nfunction includeHelper (this: EtaConfig, templateNameOrPath: string, data: object): string {\n var template = this.templates.get(templateNameOrPath)\n if (!template) {\n throw EtaErr('Could not fetch template \"' + templateNameOrPath + '\"')\n }\n return template(data, this)\n}\n\nvar defaultConfig: EtaConfig = {\n varName: 'it',\n autoTrim: [false, 'nl'],\n autoEscape: true,\n tags: ['<%', '%>'],\n parse: {\n interpolate: '=',\n raw: '~',\n exec: ''\n },\n async: false,\n templates: templates,\n cache: false,\n plugins: [],\n useWith: false,\n e: XMLEscape,\n include: includeHelper\n}\n\nincludeHelper.bind(defaultConfig)\n\nfunction getConfig (override: PartialConfig, baseConfig?: EtaConfig): EtaConfig {\n // TODO: run more tests on this\n\n var res: PartialConfig = {} // Linked\n copyProps(res, defaultConfig) // Creates deep clone of res, 1 layer deep\n\n if (baseConfig) {\n copyProps(res, baseConfig)\n }\n\n if (override) {\n copyProps(res, override)\n }\n\n return res as EtaConfig\n}\n\nexport { defaultConfig, getConfig }\n","import compileToString from './compile-string'\nimport { getConfig } from './config'\nimport EtaErr from './err'\n\n/* TYPES */\n\nimport { EtaConfig, PartialConfig } from './config'\nimport { CallbackFn } from './file-handlers'\nexport type TemplateFunction = (data: object, config: EtaConfig, cb?: CallbackFn) => string\n\n/* END TYPES */\n\nexport default function compile (str: string, env?: PartialConfig): TemplateFunction {\n var options: EtaConfig = getConfig(env || {})\n var ctor // constructor\n\n /* ASYNC HANDLING */\n // The below code is modified from mde/ejs. All credit should go to them.\n if (options.async) {\n // Have to use generated function for this, since in envs without support,\n // it breaks in parsing\n try {\n ctor = new Function('return (async function(){}).constructor;')()\n } catch (e) {\n if (e instanceof SyntaxError) {\n throw EtaErr(\"This environment doesn't support async/await\")\n } else {\n throw e\n }\n }\n } else {\n ctor = Function\n }\n /* END ASYNC HANDLING */\n try {\n return new ctor(\n options.varName,\n 'E', // EtaConfig\n 'cb', // optional callback\n compileToString(str, options)\n ) as TemplateFunction // eslint-disable-line no-new-func\n } catch (e) {\n if (e instanceof SyntaxError) {\n throw EtaErr(\n 'Bad template syntax\\n\\n' +\n e.message +\n '\\n' +\n Array(e.message.length + 1).join('=') +\n '\\n' +\n compileToString(str, options)\n )\n } else {\n throw e\n }\n }\n}\n","var fs = require('fs')\nvar path = require('path')\nvar _BOM = /^\\uFEFF/\n\n// express is set like: app.engine('html', require('eta').renderFile)\n\nimport EtaErr from './err'\nimport Compile from './compile'\nimport { getConfig } from './config'\n\n/* TYPES */\n\nimport { EtaConfig, PartialConfig } from './config'\nimport { TemplateFunction } from './compile'\n\ninterface PartialFileConfig extends PartialConfig {\n filename: string\n}\n\ninterface FileConfig extends EtaConfig {\n filename: string\n}\n\n/* END TYPES */\n\n/**\n * Get the path to the included file from the parent file path and the\n * specified path.\n *\n * @param {String} name specified path\n * @param {String} parentfile parent file path\n * @param {Boolean} [isDir=false] whether parent file path is a directory\n * @return {String}\n */\n\nfunction getWholeFilePath (name: string, parentfile: string, isDirectory?: boolean) {\n var includePath = path.resolve(\n isDirectory ? parentfile : path.dirname(parentfile), // returns directory the parent file is in\n name // file\n )\n var ext = path.extname(name)\n if (!ext) {\n includePath += '.eta'\n }\n return includePath\n}\n\n/**\n * Get the path to the included file by Options\n *\n * @param {String} path specified path\n * @param {Options} options compilation options\n * @return {String}\n */\n\nfunction getPath (path: string, options: EtaConfig) {\n var includePath\n var filePath\n var views = options.views\n var match = /^[A-Za-z]+:\\\\|^\\//.exec(path)\n\n // Abs path\n if (match && match.length) {\n includePath = getWholeFilePath(path.replace(/^\\/*/, ''), options.root || '/', true)\n } else {\n // Relative paths\n // Look relative to a passed filename first\n if (options.filename) {\n filePath = getWholeFilePath(path, options.filename)\n if (fs.existsSync(filePath)) {\n includePath = filePath\n }\n }\n // Then look in any views directories\n if (!includePath) {\n if (\n Array.isArray(views) &&\n views.some(function (v) {\n filePath = getWholeFilePath(path, v, true)\n return fs.existsSync(filePath)\n })\n ) {\n includePath = filePath\n }\n }\n if (!includePath) {\n throw EtaErr('Could not find the include file \"' + path + '\"')\n }\n }\n return includePath\n}\n\nfunction readFile (filePath: string) {\n return fs\n .readFileSync(filePath)\n .toString()\n .replace(_BOM, '') // TODO: is replacing BOM's necessary?\n}\n\nfunction loadFile (filePath: string, options: PartialFileConfig): TemplateFunction {\n var config = getConfig(options)\n var template = readFile(filePath)\n try {\n var compiledTemplate = Compile(template, config)\n config.templates.define((config as FileConfig).filename, compiledTemplate)\n return compiledTemplate\n } catch (e) {\n throw EtaErr('Loading file: ' + filePath + ' failed')\n }\n}\n\nexport { getPath, readFile, loadFile }\n","// express is set like: app.engine('html', require('eta').renderFile)\n\nimport EtaErr from './err'\nimport compile from './compile'\nimport { getConfig } from './config'\nimport { getPath, readFile, loadFile } from './file-utils'\nimport { promiseImpl, copyProps } from './utils'\n\n/* TYPES */\n\nimport { EtaConfig, PartialConfig } from './config'\nimport { TemplateFunction } from './compile'\n\nexport type CallbackFn = (err: Error | null, str?: string) => void\n\ninterface FileOptions extends EtaConfig {\n filename: string\n}\n\ninterface DataObj {\n settings?: {\n [key: string]: any\n }\n [key: string]: any\n}\n\n/* END TYPES */\n\n/**\n * Get the template from a string or a file, either compiled on-the-fly or\n * read from cache (if enabled), and cache the template if needed.\n *\n * If `options.cache` is true, this function reads the file from\n * `options.filename` so it must be set prior to calling this function.\n *\n * @param {Options} options compilation options\n * @param {String} [template] template source\n * @return {(TemplateFunction|ClientFunction)}\n * Depending on the value of `options.client`, either type might be returned.\n * @static\n */\n\nfunction handleCache (options: FileOptions): TemplateFunction {\n var filename = options.filename\n\n if (options.cache) {\n var func = options.templates.get(filename)\n if (func) {\n return func\n } else {\n return loadFile(filename, options)\n }\n }\n\n return compile(readFile(filename), options)\n}\n\n/**\n * Try calling handleCache with the given options and data and call the\n * callback with the result. If an error occurs, call the callback with\n * the error. Used by renderFile().\n *\n * @param {Options} options compilation options\n * @param {Object} data template data\n * @param {RenderFileCallback} cb callback\n * @static\n */\n\nfunction tryHandleCache (options: FileOptions, data: object, cb: CallbackFn) {\n var result\n if (!cb) {\n // No callback, try returning a promise\n if (typeof promiseImpl === 'function') {\n return new promiseImpl(function (resolve: Function, reject: Function) {\n try {\n result = handleCache(options)(data, options)\n resolve(result)\n } catch (err) {\n reject(err)\n }\n })\n } else {\n throw EtaErr(\"Please provide a callback function, this env doesn't support Promises\")\n }\n } else {\n try {\n handleCache(options)(data, options, cb)\n } catch (err) {\n return cb(err)\n }\n }\n}\n\n/**\n * Get the template function.\n *\n * If `options.cache` is `true`, then the template is cached.\n *\n * @param {String} path path for the specified file\n * @param {Options} options compilation options\n * @return {(TemplateFunction|ClientFunction)}\n * Depending on the value of `options.client`, either type might be returned\n * @static\n */\n\nfunction includeFile (path: string, options: EtaConfig) {\n // the below creates a new options object, using the parent filepath of the old options object and the path\n var newFileOptions = getConfig({ filename: getPath(path, options) }, options)\n // TODO: make sure properties are currectly copied over\n return handleCache(newFileOptions as FileOptions)\n}\n\nfunction renderFile (filename: string, data: DataObj, cb?: CallbackFn) {\n var Config: FileOptions = getConfig((data as PartialConfig) || {}) as FileOptions\n // TODO: make sure above doesn't error. We do set filename down below\n\n if (data.settings) {\n // Pull a few things from known locations\n if (data.settings.views) {\n Config.views = data.settings.views\n }\n if (data.settings['view cache']) {\n Config.cache = true\n }\n // Undocumented after Express 2, but still usable, esp. for\n // items that are unsafe to be passed along with data, like `root`\n var viewOpts = data.settings['view options']\n\n if (viewOpts) {\n copyProps(Config, viewOpts)\n }\n }\n\n Config.filename = filename // Make sure filename is right\n\n return tryHandleCache(Config, data, cb as CallbackFn)\n}\n\nexport { includeFile, renderFile }\n","import { includeFile } from './file-handlers'\nimport EtaErr from './err'\n\n/* TYPES */\n\nimport { EtaConfig } from './config'\n\ninterface GenericData {\n [index: string]: any\n}\n\n/* END TYPES */\n\nexport function includeFileHelper (this: EtaConfig, path: string, data: GenericData): string {\n return includeFile(path, this)(data, this)\n}\n\n// export function extendsFileHelper(path: string, data: GenericData, config: EtaConfig): string {\n// var data: GenericData = content.params[1] || {}\n\n// data.content = content.exec()\n// for (var i = 0; i < blocks.length; i++) {\n// var currentBlock = blocks[i]\n// data[currentBlock.name] = currentBlock.exec()\n// }\n\n// return includeFile(content.params[0], config)(data, config)\n// }\n","import compile from './compile'\nimport { getConfig } from './config'\nimport { promiseImpl } from './utils'\nimport EtaErr from './err'\n\n/* TYPES */\n\nimport { EtaConfig, PartialConfig } from './config'\nimport { TemplateFunction } from './compile'\nimport { CallbackFn } from './file-handlers'\n\n/* END TYPES */\n\nfunction handleCache (template: string | TemplateFunction, options: EtaConfig): TemplateFunction {\n var templateFunc\n\n if (options.cache && options.name && options.templates.get(options.name)) {\n return options.templates.get(options.name)\n }\n\n if (typeof template === 'function') {\n templateFunc = template\n } else {\n templateFunc = compile(template, options)\n }\n\n if (options.cache && options.name) {\n options.templates.define(options.name, templateFunc)\n }\n\n return templateFunc\n}\n\nexport default function render (\n template: string | TemplateFunction,\n data: object,\n env?: PartialConfig,\n cb?: CallbackFn\n) {\n var options = getConfig(env || {})\n\n if (options.async) {\n var result\n if (!cb) {\n // No callback, try returning a promise\n if (typeof promiseImpl === 'function') {\n return new promiseImpl(function (resolve: Function, reject: Function) {\n try {\n result = handleCache(template, options)(data, options)\n resolve(result)\n } catch (err) {\n reject(err)\n }\n })\n } else {\n throw EtaErr(\"Please provide a callback function, this env doesn't support Promises\")\n }\n } else {\n try {\n handleCache(template, options)(data, options, cb)\n } catch (err) {\n return cb(err)\n }\n }\n } else {\n return handleCache(template, options)(data, options)\n }\n}\n","/* Export file stuff */\nimport { includeFileHelper } from './file-helpers'\nimport { defaultConfig } from './config'\n\n/* TYPES */\n\n/* END TYPES */\n\ndefaultConfig.includeFile = includeFileHelper\nincludeFileHelper.bind(defaultConfig)\n\nexport { renderFile, renderFile as __express } from './file-handlers'\nexport { loadFile } from './file-utils'\n\n/* End file stuff */\n\nexport { default as compileToString } from './compile-string'\nexport { default as compile } from './compile'\nexport { default as parse } from './parse'\nexport { default as render } from './render'\nexport { templates } from './containers'\nexport { defaultConfig, getConfig } from './config'\n"],"names":["Parse","Compile","handleCache"],"mappings":";;;;AAAA,SAAS,cAAc,CAAE,GAAQ,EAAE,KAAU;IAC3C,IAAI,MAAM,CAAC,cAAc,EAAE;QACzB,MAAM,CAAC,cAAc,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;KAClC;SAAM;QACL,GAAG,CAAC,SAAS,GAAG,KAAK,CAAA;KACtB;AACH,CAAC;SAEuB,MAAM,CAAE,OAAe;IAC7C,IAAI,GAAG,GAAG,IAAI,KAAK,CAAC,OAAO,CAAC,CAAA;IAC5B,cAAc,CAAC,GAAG,EAAE,MAAM,CAAC,SAAS,CAAC,CAAA;IACrC,OAAO,GAAG,CAAA;AACZ,CAAC;AAED,MAAM,CAAC,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,EAAE;IAChD,IAAI,EAAE,EAAE,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,KAAK,EAAE;CAChD,CAAC,CAAA;AAEF;SAEgB,QAAQ,CAAE,OAAe,EAAE,GAAW,EAAE,IAAY;IAClE,IAAI,UAAU,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;IAE/C,IAAI,MAAM,GAAG,UAAU,CAAC,MAAM,CAAA;IAC9B,IAAI,KAAK,GAAG,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAA;IAC7C,OAAO;QACL,WAAW;YACX,MAAM;YACN,OAAO;YACP,KAAK;YACL,OAAO;YACP,IAAI;YACJ,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,C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,CAAA;KACrD;AACH,CAAC;;ACnED;AACA,AAGA;AAEA;AAEA,aAAa,CAAC,WAAW,GAAG,iBAAiB,CAAA;AAC7C,iBAAiB,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist/eta.es.js.map b/dist/eta.es.js.map index 5f5b583..eb4e056 100644 --- a/dist/eta.es.js.map +++ b/dist/eta.es.js.map @@ -1 +1 @@ -{"version":3,"file":"eta.es.js","sources":["../src/err.ts","../src/utils.ts","../src/parse.ts","../src/compile-string.ts","../src/storage.ts","../src/containers.ts","../src/config.ts","../src/compile.ts","../src/file-utils.ts","../src/file-handlers.ts","../src/file-helpers.ts","../src/render.ts","../src/index.ts"],"sourcesContent":["function setPrototypeOf (obj: any, proto: any) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(obj, proto)\n } else {\n obj.__proto__ = proto\n }\n}\n\nexport default function EtaErr (message: string): Error {\n var err = new Error(message)\n setPrototypeOf(err, EtaErr.prototype)\n return err\n}\n\nEtaErr.prototype = Object.create(Error.prototype, {\n name: { value: 'Eta Error', enumerable: false }\n})\n\n// TODO: Class transpilation adds a lot to the bundle size\n\nexport function ParseErr (message: string, str: string, indx: number) {\n var whitespace = str.slice(0, indx).split(/\\n/)\n\n var lineNo = whitespace.length\n var colNo = whitespace[lineNo - 1].length + 1\n message +=\n ' at line ' +\n lineNo +\n ' col ' +\n colNo +\n ':\\n\\n' +\n ' ' +\n str.split(/\\n/)[lineNo - 1] +\n '\\n' +\n ' ' +\n Array(colNo).join(' ') +\n '^'\n throw EtaErr(message)\n}\n","// TODO: allow '-' to trim up until newline. Use [^\\S\\n\\r] instead of \\s\n// TODO: only include trimLeft polyfill if not in ES6\n\n/* TYPES */\n\nimport { EtaConfig } from './config'\n\ninterface EscapeMap {\n '&': '&'\n '<': '<'\n '\"': '"'\n \"'\": '''\n [index: string]: string\n}\n\n/* END TYPES */\n\nexport var promiseImpl = new Function('return this;')().Promise\n\nexport function hasOwnProp (obj: object, prop: string) {\n return Object.prototype.hasOwnProperty.call(obj, prop)\n}\n\nexport function copyProps (toObj: T, fromObj: T, notConfig?: boolean) {\n for (var key in fromObj) {\n if (hasOwnProp((fromObj as unknown) as object, key)) {\n toObj[key] = fromObj[key]\n }\n }\n return toObj\n}\n\nfunction trimWS (\n str: string,\n env: EtaConfig,\n wsLeft: string | false,\n wsRight?: string | false\n): string {\n var leftTrim\n var rightTrim\n\n if (typeof env.autoTrim === 'string') {\n leftTrim = rightTrim = env.autoTrim\n } else if (Array.isArray(env.autoTrim)) {\n // kinda confusing\n // but _}} will trim the left side of the following string\n leftTrim = env.autoTrim[1]\n rightTrim = env.autoTrim[0]\n }\n\n if (wsLeft || wsLeft === false) {\n leftTrim = wsLeft\n }\n\n if (wsRight || wsRight === false) {\n rightTrim = wsRight\n }\n\n if (leftTrim === 'slurp' && rightTrim === 'slurp') {\n return str.trim()\n }\n\n if (leftTrim === '_' || leftTrim === 'slurp') {\n // console.log('trimming left' + leftTrim)\n // full slurp\n if (String.prototype.trimLeft) {\n str = str.trimLeft()\n } else {\n str = str.replace(/^[\\s\\uFEFF\\xA0]+/, '')\n }\n } else if (leftTrim === '-' || leftTrim === 'nl') {\n // console.log('trimming left nl' + leftTrim)\n // nl trim\n str = str.replace(/^(?:\\n|\\r|\\r\\n)/, '')\n }\n\n if (rightTrim === '_' || rightTrim === 'slurp') {\n // console.log('trimming right' + rightTrim)\n // full slurp\n if (String.prototype.trimRight) {\n str = str.trimRight()\n } else {\n str = str.replace(/[\\s\\uFEFF\\xA0]+$/, '')\n }\n } else if (rightTrim === '-' || rightTrim === 'nl') {\n // console.log('trimming right nl' + rightTrim)\n // nl trim\n str = str.replace(/(?:\\n|\\r|\\r\\n)$/, '') // TODO: make sure this gets \\r\\n\n }\n\n return str\n}\n\nvar escMap: EscapeMap = {\n '&': '&',\n '<': '<',\n '\"': '"',\n \"'\": '''\n}\n\nfunction replaceChar (s: string): string {\n return escMap[s]\n}\n\nfunction XMLEscape (str: any) {\n // To deal with XSS. Based on Escape implementations of Mustache.JS and Marko, then customized.\n var newStr = String(str)\n if (/[&<\"']/.test(newStr)) {\n return newStr.replace(/[&<\"']/g, replaceChar)\n } else {\n return newStr\n }\n}\n\nexport { trimWS, XMLEscape }\n","import EtaErr, { ParseErr } from './err'\nimport { trimWS } from './utils'\n\n/* TYPES */\n\nimport { EtaConfig } from './config'\n\nexport type TagType = 'r' | 'e' | 'i' | ''\n\nexport interface TemplateObject {\n t: TagType\n val: string\n}\n\nexport type AstObject = string | TemplateObject\n\n/* END TYPES */\n\nexport default function parse(str: string, env: EtaConfig): Array {\n var buffer: Array = []\n var trimLeftOfNextStr: string | false = false\n var lastIndex = 0\n\n function pushString(strng: string, shouldTrimRightOfString?: string | false) {\n if (strng) {\n // if string is truthy it must be of type 'string'\n // replace \\ with \\\\, ' with \\'\n var stringToPush = strng.replace(/\\\\|'/g, '\\\\$&')\n\n // TODO: benchmark replace( /(\\\\|')/g, '\\\\$1')\n stringToPush = trimWS(\n stringToPush,\n env,\n trimLeftOfNextStr, // this will only be false on the first str, the next ones will be null or undefined\n shouldTrimRightOfString\n )\n\n stringToPush = stringToPush.replace(/\\n/g, '\\\\n').replace(/\\r/g, '\\\\r')\n\n if (stringToPush) {\n buffer.push(stringToPush)\n }\n }\n }\n\n var prefixes = (env.parse.exec + env.parse.interpolate + env.parse.raw).split('').join('|')\n\n var parseOpenReg = new RegExp('([^]*?)' + env.tags[0] + '(-|_)?\\\\s*(' + prefixes + ')?', 'g')\n var parseCloseReg = new RegExp(\n '\\\\s*((?:[^]*?(?:\\'(?:\\\\\\\\[\\\\s\\\\w\"\\'\\\\\\\\`]|[^\\\\n\\\\r\\'\\\\\\\\])*?\\'|`(?:\\\\\\\\[\\\\s\\\\w\"\\'\\\\\\\\`]|[^\\\\\\\\`])*?`|\"(?:\\\\\\\\[\\\\s\\\\w\"\\'\\\\\\\\`]|[^\\\\n\\\\r\"\\\\\\\\])*?\"|\\\\/\\\\*[^]*?\\\\*\\\\/)?)*?)\\\\s*(-|_)?' +\n env.tags[1],\n 'g'\n )\n // TODO: benchmark having the \\s* on either side vs using str.trim()\n\n var m\n\n while ((m = parseOpenReg.exec(str)) !== null) {\n lastIndex = m[0].length + m.index\n\n var precedingString = m[1]\n var wsLeft = m[2]\n var prefix = m[3] || '' // by default either ~, =, or empty\n\n pushString(precedingString, wsLeft)\n\n parseCloseReg.lastIndex = lastIndex\n var closeTag = parseCloseReg.exec(str)\n if (closeTag) {\n var content = closeTag[1]\n trimLeftOfNextStr = closeTag[2]\n parseOpenReg.lastIndex = lastIndex = parseCloseReg.lastIndex\n\n var currentType: TagType = ''\n if (prefix === env.parse.exec) {\n currentType = 'e'\n } else if (prefix === env.parse.raw) {\n currentType = 'r'\n } else if (prefix === env.parse.interpolate) {\n currentType = 'i'\n }\n\n buffer.push({ t: currentType, val: content })\n } else {\n ParseErr('unclosed tag', str, lastIndex)\n }\n }\n\n pushString(str.slice(lastIndex, str.length), false)\n\n if (env.plugins) {\n for (var i = 0; i < env.plugins.length; i++) {\n var plugin = env.plugins[i]\n if (plugin.processAST) {\n buffer = plugin.processAST(buffer, env)\n }\n }\n }\n\n return buffer\n}\n","import Parse from './parse'\n\n/* TYPES */\n\nimport { EtaConfig } from './config'\nimport { AstObject } from './parse'\n\n/* END TYPES */\n\nexport default function compileToString (str: string, env: EtaConfig) {\n var buffer: Array = Parse(str, env)\n\n var res =\n \"var tR='';\" +\n (env.useWith ? 'with(' + env.varName + '||{}){' : '') +\n compileScope(buffer, env) +\n 'if(cb){cb(null,tR)} return tR' +\n (env.useWith ? '}' : '')\n\n if (env.plugins) {\n for (var i = 0; i < env.plugins.length; i++) {\n var plugin = env.plugins[i]\n if (plugin.processFnString) {\n res = plugin.processFnString(res, env)\n }\n }\n }\n\n return res\n\n // TODO: is `return cb()` necessary, or could we just do `cb()`\n}\n\nfunction compileScope (buff: Array, env: EtaConfig) {\n var i = 0\n var buffLength = buff.length\n var returnStr = ''\n\n for (i; i < buffLength; i++) {\n var currentBlock = buff[i]\n if (typeof currentBlock === 'string') {\n var str = currentBlock\n\n // we know string exists\n returnStr += \"tR+='\" + str + \"';\"\n } else {\n var type = currentBlock.t // ~, s, !, ?, r\n var content = currentBlock.val || ''\n\n if (type === 'r') {\n // raw\n returnStr += 'tR+=' + content + ';'\n } else if (type === 'i') {\n // interpolate\n if (env.autoEscape) {\n content = 'E.e(' + content + ')'\n }\n returnStr += 'tR+=' + content + ';'\n // reference\n } else if (type === 'e') {\n // execute\n returnStr += content + '\\n' // you need a \\n in case you have <% } %>\n }\n }\n }\n\n return returnStr\n}\n","import { copyProps } from './utils'\n\n/* TYPES */\n\ninterface Dict {\n // Basically, an object where all keys point to a value of the same type\n [key: string]: T\n}\n\n/* END TYPES */\n\nclass Cacher {\n constructor (private cache: Dict) {}\n define (key: string, val: T) {\n this.cache[key] = val\n }\n get (key: string) {\n // string | array.\n // TODO: allow array of keys to look down\n // TODO: create plugin to allow referencing helpers, filters with dot notation\n return this.cache[key]\n }\n remove (key: string) {\n delete this.cache[key]\n }\n reset () {\n this.cache = {}\n }\n load (cacheObj: Dict) {\n // TODO: this will err with deep objects and `storage` or `plugins` keys.\n // Update Feb 26: EDITED so it shouldn't err\n copyProps(this.cache, cacheObj, true)\n }\n}\n\nexport { Cacher }\n","import { Cacher } from './storage'\nimport EtaErr from './err'\n\n/* TYPES */\n\nimport { EtaConfig } from './config'\nimport { TemplateFunction } from './compile'\n\n/* END TYPES */\n\nvar templates = new Cacher({})\n\n/* ASYNC LOOP FNs */\n\nexport { templates }\n","import { templates } from './containers'\nimport { copyProps, XMLEscape } from './utils'\nimport EtaErr from './err'\n\n/* TYPES */\n\nimport { TemplateFunction } from './compile'\nimport { Cacher } from './storage'\n\ntype trimConfig = 'nl' | 'slurp' | false\n\nexport interface EtaConfig {\n varName: string\n autoTrim: trimConfig | [trimConfig, trimConfig]\n autoEscape: boolean\n tags: [string, string]\n parse: {\n interpolate: string\n raw: string\n exec: string\n }\n e: (str: string) => string\n plugins: Array<{ processFnString?: Function; processAST?: Function }>\n async: boolean\n templates: Cacher\n cache: boolean\n views?: string | Array\n root?: string\n filename?: string\n name?: string\n 'view cache'?: boolean\n useWith?: boolean\n [index: string]: any\n}\n\nexport type PartialConfig = {\n [P in keyof EtaConfig]?: EtaConfig[P]\n}\n\n/* END TYPES */\n\nfunction includeHelper (this: EtaConfig, templateNameOrPath: string, data: object): string {\n var template = this.templates.get(templateNameOrPath)\n if (!template) {\n throw EtaErr('Could not fetch template \"' + templateNameOrPath + '\"')\n }\n return template(data, this)\n}\n\nvar defaultConfig: EtaConfig = {\n varName: 'it',\n autoTrim: [false, 'nl'],\n autoEscape: true,\n tags: ['<%', '%>'],\n parse: {\n interpolate: '=',\n raw: '~',\n exec: ''\n },\n async: false,\n templates: templates,\n cache: false,\n plugins: [],\n useWith: false,\n e: XMLEscape,\n include: includeHelper\n}\n\nincludeHelper.bind(defaultConfig)\n\nfunction getConfig (override: PartialConfig, baseConfig?: EtaConfig): EtaConfig {\n // TODO: run more tests on this\n\n var res: PartialConfig = {} // Linked\n copyProps(res, defaultConfig) // Creates deep clone of res, 1 layer deep\n\n if (baseConfig) {\n copyProps(res, baseConfig)\n }\n\n if (override) {\n copyProps(res, override)\n }\n\n return res as EtaConfig\n}\n\nexport { defaultConfig, getConfig }\n","import compileToString from './compile-string'\nimport { getConfig } from './config'\nimport EtaErr from './err'\n\n/* TYPES */\n\nimport { EtaConfig, PartialConfig } from './config'\nimport { CallbackFn } from './file-handlers'\nexport type TemplateFunction = (data: object, config: EtaConfig, cb?: CallbackFn) => string\n\n/* END TYPES */\n\nexport default function compile (str: string, env?: PartialConfig): TemplateFunction {\n var options: EtaConfig = getConfig(env || {})\n var ctor // constructor\n\n /* ASYNC HANDLING */\n // The below code is modified from mde/ejs. All credit should go to them.\n if (options.async) {\n // Have to use generated function for this, since in envs without support,\n // it breaks in parsing\n try {\n ctor = new Function('return (async function(){}).constructor;')()\n } catch (e) {\n if (e instanceof SyntaxError) {\n throw EtaErr(\"This environment doesn't support async/await\")\n } else {\n throw e\n }\n }\n } else {\n ctor = Function\n }\n /* END ASYNC HANDLING */\n try {\n return new ctor(\n options.varName,\n 'E', // EtaConfig\n 'cb', // optional callback\n compileToString(str, options)\n ) as TemplateFunction // eslint-disable-line no-new-func\n } catch (e) {\n if (e instanceof SyntaxError) {\n throw EtaErr(\n 'Bad template syntax\\n\\n' +\n e.message +\n '\\n' +\n Array(e.message.length + 1).join('=') +\n '\\n' +\n compileToString(str, options)\n )\n } else {\n throw e\n }\n }\n}\n","var fs = require('fs')\nvar path = require('path')\nvar _BOM = /^\\uFEFF/\n\n// express is set like: app.engine('html', require('eta').renderFile)\n\nimport EtaErr from './err'\nimport Compile from './compile'\nimport { getConfig } from './config'\n\n/* TYPES */\n\nimport { EtaConfig, PartialConfig } from './config'\nimport { TemplateFunction } from './compile'\n\ninterface PartialFileConfig extends PartialConfig {\n filename: string\n}\n\ninterface FileConfig extends EtaConfig {\n filename: string\n}\n\n/* END TYPES */\n\n/**\n * Get the path to the included file from the parent file path and the\n * specified path.\n *\n * @param {String} name specified path\n * @param {String} parentfile parent file path\n * @param {Boolean} [isDir=false] whether parent file path is a directory\n * @return {String}\n */\n\nfunction getWholeFilePath (name: string, parentfile: string, isDirectory?: boolean) {\n var includePath = path.resolve(\n isDirectory ? parentfile : path.dirname(parentfile), // returns directory the parent file is in\n name // file\n )\n var ext = path.extname(name)\n if (!ext) {\n includePath += '.eta'\n }\n return includePath\n}\n\n/**\n * Get the path to the included file by Options\n *\n * @param {String} path specified path\n * @param {Options} options compilation options\n * @return {String}\n */\n\nfunction getPath (path: string, options: EtaConfig) {\n var includePath\n var filePath\n var views = options.views\n var match = /^[A-Za-z]+:\\\\|^\\//.exec(path)\n\n // Abs path\n if (match && match.length) {\n includePath = getWholeFilePath(path.replace(/^\\/*/, ''), options.root || '/', true)\n } else {\n // Relative paths\n // Look relative to a passed filename first\n if (options.filename) {\n filePath = getWholeFilePath(path, options.filename)\n if (fs.existsSync(filePath)) {\n includePath = filePath\n }\n }\n // Then look in any views directories\n if (!includePath) {\n if (\n Array.isArray(views) &&\n views.some(function (v) {\n filePath = getWholeFilePath(path, v, true)\n return fs.existsSync(filePath)\n })\n ) {\n includePath = filePath\n }\n }\n if (!includePath) {\n throw EtaErr('Could not find the include file \"' + path + '\"')\n }\n }\n return includePath\n}\n\nfunction readFile (filePath: string) {\n return fs\n .readFileSync(filePath)\n .toString()\n .replace(_BOM, '') // TODO: is replacing BOM's necessary?\n}\n\nfunction loadFile (filePath: string, options: PartialFileConfig): TemplateFunction {\n var config = getConfig(options)\n var template = readFile(filePath)\n try {\n var compiledTemplate = Compile(template, config)\n config.templates.define((config as FileConfig).filename, compiledTemplate)\n return compiledTemplate\n } catch (e) {\n throw EtaErr('Loading file: ' + filePath + ' failed')\n }\n}\n\nexport { getPath, readFile, loadFile }\n","// express is set like: app.engine('html', require('eta').renderFile)\n\nimport EtaErr from './err'\nimport compile from './compile'\nimport { getConfig } from './config'\nimport { getPath, readFile, loadFile } from './file-utils'\nimport { promiseImpl, copyProps } from './utils'\n\n/* TYPES */\n\nimport { EtaConfig, PartialConfig } from './config'\nimport { TemplateFunction } from './compile'\n\nexport type CallbackFn = (err: Error | null, str?: string) => void\n\ninterface FileOptions extends EtaConfig {\n filename: string\n}\n\ninterface DataObj {\n settings?: {\n [key: string]: any\n }\n [key: string]: any\n}\n\n/* END TYPES */\n\n/**\n * Get the template from a string or a file, either compiled on-the-fly or\n * read from cache (if enabled), and cache the template if needed.\n *\n * If `options.cache` is true, this function reads the file from\n * `options.filename` so it must be set prior to calling this function.\n *\n * @param {Options} options compilation options\n * @param {String} [template] template source\n * @return {(TemplateFunction|ClientFunction)}\n * Depending on the value of `options.client`, either type might be returned.\n * @static\n */\n\nfunction handleCache (options: FileOptions): TemplateFunction {\n var filename = options.filename\n\n if (options.cache) {\n var func = options.templates.get(filename)\n if (func) {\n return func\n } else {\n return loadFile(filename, options)\n }\n }\n\n return compile(readFile(filename), options)\n}\n\n/**\n * Try calling handleCache with the given options and data and call the\n * callback with the result. If an error occurs, call the callback with\n * the error. Used by renderFile().\n *\n * @param {Options} options compilation options\n * @param {Object} data template data\n * @param {RenderFileCallback} cb callback\n * @static\n */\n\nfunction tryHandleCache (options: FileOptions, data: object, cb: CallbackFn) {\n var result\n if (!cb) {\n // No callback, try returning a promise\n if (typeof promiseImpl === 'function') {\n return new promiseImpl(function (resolve: Function, reject: Function) {\n try {\n result = handleCache(options)(data, options)\n resolve(result)\n } catch (err) {\n reject(err)\n }\n })\n } else {\n throw EtaErr(\"Please provide a callback function, this env doesn't support Promises\")\n }\n } else {\n try {\n handleCache(options)(data, options, cb)\n } catch (err) {\n return cb(err)\n }\n }\n}\n\n/**\n * Get the template function.\n *\n * If `options.cache` is `true`, then the template is cached.\n *\n * @param {String} path path for the specified file\n * @param {Options} options compilation options\n * @return {(TemplateFunction|ClientFunction)}\n * Depending on the value of `options.client`, either type might be returned\n * @static\n */\n\nfunction includeFile (path: string, options: EtaConfig) {\n // the below creates a new options object, using the parent filepath of the old options object and the path\n var newFileOptions = getConfig({ filename: getPath(path, options) }, options)\n // TODO: make sure properties are currectly copied over\n return handleCache(newFileOptions as FileOptions)\n}\n\nfunction renderFile (filename: string, data: DataObj, cb?: CallbackFn) {\n var Config: FileOptions = getConfig((data as PartialConfig) || {}) as FileOptions\n // TODO: make sure above doesn't error. We do set filename down below\n\n if (data.settings) {\n // Pull a few things from known locations\n if (data.settings.views) {\n Config.views = data.settings.views\n }\n if (data.settings['view cache']) {\n Config.cache = true\n }\n // Undocumented after Express 2, but still usable, esp. for\n // items that are unsafe to be passed along with data, like `root`\n var viewOpts = data.settings['view options']\n\n if (viewOpts) {\n copyProps(Config, viewOpts)\n }\n }\n\n Config.filename = filename // Make sure filename is right\n\n return tryHandleCache(Config, data, cb as CallbackFn)\n}\n\nexport { includeFile, renderFile }\n","import { includeFile } from './file-handlers'\nimport EtaErr from './err'\n\n/* TYPES */\n\nimport { EtaConfig } from './config'\n\ninterface GenericData {\n [index: string]: any\n}\n\n/* END TYPES */\n\nexport function includeFileHelper (this: EtaConfig, path: string, data: GenericData): string {\n return includeFile(path, this)(data, this)\n}\n\n// export function extendsFileHelper(path: string, data: GenericData, config: EtaConfig): string {\n// var data: GenericData = content.params[1] || {}\n\n// data.content = content.exec()\n// for (var i = 0; i < blocks.length; i++) {\n// var currentBlock = blocks[i]\n// data[currentBlock.name] = currentBlock.exec()\n// }\n\n// return includeFile(content.params[0], config)(data, config)\n// }\n","import compile from './compile'\nimport { getConfig } from './config'\nimport { promiseImpl } from './utils'\nimport EtaErr from './err'\n\n/* TYPES */\n\nimport { EtaConfig, PartialConfig } from './config'\nimport { TemplateFunction } from './compile'\nimport { CallbackFn } from './file-handlers'\n\n/* END TYPES */\n\nfunction handleCache (template: string | TemplateFunction, options: EtaConfig): TemplateFunction {\n var templateFunc\n\n if (options.cache && options.name && options.templates.get(options.name)) {\n return options.templates.get(options.name)\n }\n\n if (typeof template === 'function') {\n templateFunc = template\n } else {\n templateFunc = compile(template, options)\n }\n\n if (options.cache && options.name) {\n options.templates.define(options.name, templateFunc)\n }\n\n return templateFunc\n}\n\nexport default function render (\n template: string | TemplateFunction,\n data: object,\n env?: PartialConfig,\n cb?: CallbackFn\n) {\n var options = getConfig(env || {})\n\n if (options.async) {\n var result\n if (!cb) {\n // No callback, try returning a promise\n if (typeof promiseImpl === 'function') {\n return new promiseImpl(function (resolve: Function, reject: Function) {\n try {\n result = handleCache(template, options)(data, options)\n resolve(result)\n } catch (err) {\n reject(err)\n }\n })\n } else {\n throw EtaErr(\"Please provide a callback function, this env doesn't support Promises\")\n }\n } else {\n try {\n handleCache(template, options)(data, options, cb)\n } catch (err) {\n return cb(err)\n }\n }\n } else {\n return handleCache(template, options)(data, options)\n }\n}\n","/* Export file stuff */\nimport { includeFileHelper } from './file-helpers'\nimport { defaultConfig } from './config'\n\n/* TYPES */\n\n/* END TYPES */\n\ndefaultConfig.includeFile = includeFileHelper\nincludeFileHelper.bind(defaultConfig)\n\nexport { renderFile, renderFile as __express } from './file-handlers'\nexport { loadFile } from './file-utils'\n\n/* End file stuff */\n\nexport { default as compileToString } from './compile-string'\nexport { default as compile } from './compile'\nexport { default as parse } from './parse'\nexport { default as render } from './render'\nexport { templates } from './containers'\nexport { defaultConfig, getConfig } from './config'\n"],"names":["Parse","Compile","handleCache"],"mappings":"AAAA,SAAS,cAAc,CAAE,GAAQ,EAAE,KAAU;IAC3C,IAAI,MAAM,CAAC,cAAc,EAAE;QACzB,MAAM,CAAC,cAAc,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;KAClC;SAAM;QACL,GAAG,CAAC,SAAS,GAAG,KAAK,CAAA;KACtB;AACH,CAAC;SAEuB,MAAM,CAAE,OAAe;IAC7C,IAAI,GAAG,GAAG,IAAI,KAAK,CAAC,OAAO,CAAC,CAAA;IAC5B,cAAc,CAAC,GAAG,EAAE,MAAM,CAAC,SAAS,CAAC,CAAA;IACrC,OAAO,GAAG,CAAA;AACZ,CAAC;AAED,MAAM,CAAC,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,EAAE;IAChD,IAAI,EAAE,EAAE,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,KAAK,EAAE;CAChD,CAAC,CAAA;AAEF;SAEgB,QAAQ,CAAE,OAAe,EAAE,GAAW,EAAE,IAAY;IAClE,IAAI,UAAU,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;IAE/C,IAAI,MAAM,GAAG,UAAU,CAAC,MAAM,CAAA;IAC9B,IAAI,KAAK,GAAG,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAA;IAC7C,OAAO;QACL,WAAW;YACX,MAAM;YACN,OAAO;YACP,KAAK;YACL,OAAO;YACP,IAAI;YACJ,GAAG,CAAC,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,EAAE,OAAO,CAAC,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;KACrD;AACH,CAAC;;ACnED;AACA,AAGA;AAEA;AAEA,aAAa,CAAC,WAAW,GAAG,iBAAiB,CAAA;AAC7C,iBAAiB,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA;;;;"} \ No newline at end of file +{"version":3,"file":"eta.es.js","sources":["../src/err.ts","../src/utils.ts","../src/parse.ts","../src/compile-string.ts","../src/storage.ts","../src/containers.ts","../src/config.ts","../src/compile.ts","../src/file-utils.ts","../src/file-handlers.ts","../src/file-helpers.ts","../src/render.ts","../src/index.ts"],"sourcesContent":["function setPrototypeOf (obj: any, proto: any) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(obj, proto)\n } else {\n obj.__proto__ = proto\n }\n}\n\nexport default function EtaErr (message: string): Error {\n var err = new Error(message)\n setPrototypeOf(err, EtaErr.prototype)\n return err\n}\n\nEtaErr.prototype = Object.create(Error.prototype, {\n name: { value: 'Eta Error', enumerable: false }\n})\n\n// TODO: Class transpilation adds a lot to the bundle size\n\nexport function ParseErr (message: string, str: string, indx: number) {\n var whitespace = str.slice(0, indx).split(/\\n/)\n\n var lineNo = whitespace.length\n var colNo = whitespace[lineNo - 1].length + 1\n message +=\n ' at line ' +\n lineNo +\n ' col ' +\n colNo +\n ':\\n\\n' +\n ' ' +\n str.split(/\\n/)[lineNo - 1] +\n '\\n' +\n ' ' +\n Array(colNo).join(' ') +\n '^'\n throw EtaErr(message)\n}\n","// TODO: allow '-' to trim up until newline. Use [^\\S\\n\\r] instead of \\s\n// TODO: only include trimLeft polyfill if not in ES6\n\n/* TYPES */\n\nimport { EtaConfig } from './config'\n\ninterface EscapeMap {\n '&': '&'\n '<': '<'\n '\"': '"'\n \"'\": '''\n [index: string]: string\n}\n\n/* END TYPES */\n\nexport var promiseImpl = new Function('return this;')().Promise\n\nexport function hasOwnProp (obj: object, prop: string) {\n return Object.prototype.hasOwnProperty.call(obj, prop)\n}\n\nexport function copyProps (toObj: T, fromObj: T, notConfig?: boolean) {\n for (var key in fromObj) {\n if (hasOwnProp((fromObj as unknown) as object, key)) {\n toObj[key] = fromObj[key]\n }\n }\n return toObj\n}\n\nfunction trimWS (\n str: string,\n env: EtaConfig,\n wsLeft: string | false,\n wsRight?: string | false\n): string {\n var leftTrim\n var rightTrim\n\n if (typeof env.autoTrim === 'string') {\n leftTrim = rightTrim = env.autoTrim\n } else if (Array.isArray(env.autoTrim)) {\n // kinda confusing\n // but _}} will trim the left side of the following string\n leftTrim = env.autoTrim[1]\n rightTrim = env.autoTrim[0]\n }\n\n if (wsLeft || wsLeft === false) {\n leftTrim = wsLeft\n }\n\n if (wsRight || wsRight === false) {\n rightTrim = wsRight\n }\n\n if (leftTrim === 'slurp' && rightTrim === 'slurp') {\n return str.trim()\n }\n\n if (leftTrim === '_' || leftTrim === 'slurp') {\n // console.log('trimming left' + leftTrim)\n // full slurp\n if (String.prototype.trimLeft) {\n str = str.trimLeft()\n } else {\n str = str.replace(/^[\\s\\uFEFF\\xA0]+/, '')\n }\n } else if (leftTrim === '-' || leftTrim === 'nl') {\n // console.log('trimming left nl' + leftTrim)\n // nl trim\n str = str.replace(/^(?:\\n|\\r|\\r\\n)/, '')\n }\n\n if (rightTrim === '_' || rightTrim === 'slurp') {\n // console.log('trimming right' + rightTrim)\n // full slurp\n if (String.prototype.trimRight) {\n str = str.trimRight()\n } else {\n str = str.replace(/[\\s\\uFEFF\\xA0]+$/, '')\n }\n } else if (rightTrim === '-' || rightTrim === 'nl') {\n // console.log('trimming right nl' + rightTrim)\n // nl trim\n str = str.replace(/(?:\\n|\\r|\\r\\n)$/, '') // TODO: make sure this gets \\r\\n\n }\n\n return str\n}\n\nvar escMap: EscapeMap = {\n '&': '&',\n '<': '<',\n '\"': '"',\n \"'\": '''\n}\n\nfunction replaceChar (s: string): string {\n return escMap[s]\n}\n\nfunction XMLEscape (str: any) {\n // To deal with XSS. Based on Escape implementations of Mustache.JS and Marko, then customized.\n var newStr = String(str)\n if (/[&<\"']/.test(newStr)) {\n return newStr.replace(/[&<\"']/g, replaceChar)\n } else {\n return newStr\n }\n}\n\nexport { trimWS, XMLEscape }\n","import EtaErr, { ParseErr } from './err'\nimport { trimWS } from './utils'\n\n/* TYPES */\n\nimport { EtaConfig } from './config'\n\nexport type TagType = 'r' | 'e' | 'i' | ''\n\nexport interface TemplateObject {\n t: TagType\n val: string\n}\n\nexport type AstObject = string | TemplateObject\n\n/* END TYPES */\n\nexport default function parse (str: string, env: EtaConfig): Array {\n var buffer: Array = []\n var trimLeftOfNextStr: string | false = false\n var lastIndex = 0\n\n function pushString (strng: string, shouldTrimRightOfString?: string | false) {\n if (strng) {\n // if string is truthy it must be of type 'string'\n // replace \\ with \\\\, ' with \\'\n var stringToPush = strng.replace(/\\\\|'/g, '\\\\$&')\n\n // TODO: benchmark replace( /(\\\\|')/g, '\\\\$1')\n stringToPush = trimWS(\n stringToPush,\n env,\n trimLeftOfNextStr, // this will only be false on the first str, the next ones will be null or undefined\n shouldTrimRightOfString\n )\n\n stringToPush = stringToPush.replace(/\\n/g, '\\\\n').replace(/\\r/g, '\\\\r')\n\n if (stringToPush) {\n buffer.push(stringToPush)\n }\n }\n }\n\n var prefixes = (env.parse.exec + env.parse.interpolate + env.parse.raw).split('').join('|')\n\n var parseOpenReg = new RegExp('([^]*?)' + env.tags[0] + '(-|_)?\\\\s*(' + prefixes + ')?', 'g')\n var parseCloseReg = new RegExp(\n '\\\\s*((?:[^]*?(?:\\'(?:\\\\\\\\[\\\\s\\\\w\"\\'\\\\\\\\`]|[^\\\\n\\\\r\\'\\\\\\\\])*?\\'|`(?:\\\\\\\\[\\\\s\\\\w\"\\'\\\\\\\\`]|[^\\\\\\\\`])*?`|\"(?:\\\\\\\\[\\\\s\\\\w\"\\'\\\\\\\\`]|[^\\\\n\\\\r\"\\\\\\\\])*?\"|\\\\/\\\\*[^]*?\\\\*\\\\/)?)*?)\\\\s*(-|_)?' +\n env.tags[1],\n 'g'\n )\n // TODO: benchmark having the \\s* on either side vs using str.trim()\n\n var m\n\n while ((m = parseOpenReg.exec(str)) !== null) {\n lastIndex = m[0].length + m.index\n\n var precedingString = m[1]\n var wsLeft = m[2]\n var prefix = m[3] || '' // by default either ~, =, or empty\n\n pushString(precedingString, wsLeft)\n\n parseCloseReg.lastIndex = lastIndex\n var closeTag = parseCloseReg.exec(str)\n if (closeTag) {\n var content = closeTag[1]\n trimLeftOfNextStr = closeTag[2]\n parseOpenReg.lastIndex = lastIndex = parseCloseReg.lastIndex\n\n var currentType: TagType = ''\n if (prefix === env.parse.exec) {\n currentType = 'e'\n } else if (prefix === env.parse.raw) {\n currentType = 'r'\n } else if (prefix === env.parse.interpolate) {\n currentType = 'i'\n }\n\n buffer.push({ t: currentType, val: content })\n } else {\n ParseErr('unclosed tag', str, lastIndex)\n }\n }\n\n pushString(str.slice(lastIndex, str.length), false)\n\n if (env.plugins) {\n for (var i = 0; i < env.plugins.length; i++) {\n var plugin = env.plugins[i]\n if (plugin.processAST) {\n buffer = plugin.processAST(buffer, env)\n }\n }\n }\n\n return buffer\n}\n","import Parse from './parse'\n\n/* TYPES */\n\nimport { EtaConfig } from './config'\nimport { AstObject } from './parse'\n\n/* END TYPES */\n\nexport default function compileToString (str: string, env: EtaConfig) {\n var buffer: Array = Parse(str, env)\n\n var res =\n \"var tR='';\" +\n (env.useWith ? 'with(' + env.varName + '||{}){' : '') +\n compileScope(buffer, env) +\n 'if(cb){cb(null,tR)} return tR' +\n (env.useWith ? '}' : '')\n\n if (env.plugins) {\n for (var i = 0; i < env.plugins.length; i++) {\n var plugin = env.plugins[i]\n if (plugin.processFnString) {\n res = plugin.processFnString(res, env)\n }\n }\n }\n\n return res\n\n // TODO: is `return cb()` necessary, or could we just do `cb()`\n}\n\nfunction compileScope (buff: Array, env: EtaConfig) {\n var i = 0\n var buffLength = buff.length\n var returnStr = ''\n\n for (i; i < buffLength; i++) {\n var currentBlock = buff[i]\n if (typeof currentBlock === 'string') {\n var str = currentBlock\n\n // we know string exists\n returnStr += \"tR+='\" + str + \"';\"\n } else {\n var type = currentBlock.t // ~, s, !, ?, r\n var content = currentBlock.val || ''\n\n if (type === 'r') {\n // raw\n returnStr += 'tR+=' + content + ';'\n } else if (type === 'i') {\n // interpolate\n if (env.autoEscape) {\n content = 'E.e(' + content + ')'\n }\n returnStr += 'tR+=' + content + ';'\n // reference\n } else if (type === 'e') {\n // execute\n returnStr += content + '\\n' // you need a \\n in case you have <% } %>\n }\n }\n }\n\n return returnStr\n}\n","import { copyProps } from './utils'\n\n/* TYPES */\n\ninterface Dict {\n // Basically, an object where all keys point to a value of the same type\n [key: string]: T\n}\n\n/* END TYPES */\n\nclass Cacher {\n constructor (private cache: Dict) {}\n define (key: string, val: T) {\n this.cache[key] = val\n }\n get (key: string) {\n // string | array.\n // TODO: allow array of keys to look down\n // TODO: create plugin to allow referencing helpers, filters with dot notation\n return this.cache[key]\n }\n remove (key: string) {\n delete this.cache[key]\n }\n reset () {\n this.cache = {}\n }\n load (cacheObj: Dict) {\n // TODO: this will err with deep objects and `storage` or `plugins` keys.\n // Update Feb 26: EDITED so it shouldn't err\n copyProps(this.cache, cacheObj, true)\n }\n}\n\nexport { Cacher }\n","import { Cacher } from './storage'\nimport EtaErr from './err'\n\n/* TYPES */\n\nimport { EtaConfig } from './config'\nimport { TemplateFunction } from './compile'\n\n/* END TYPES */\n\nvar templates = new Cacher({})\n\n/* ASYNC LOOP FNs */\n\nexport { templates }\n","import { templates } from './containers'\nimport { copyProps, XMLEscape } from './utils'\nimport EtaErr from './err'\n\n/* TYPES */\n\nimport { TemplateFunction } from './compile'\nimport { Cacher } from './storage'\n\ntype trimConfig = 'nl' | 'slurp' | false\n\nexport interface EtaConfig {\n varName: string\n autoTrim: trimConfig | [trimConfig, trimConfig]\n autoEscape: boolean\n tags: [string, string]\n parse: {\n interpolate: string\n raw: string\n exec: string\n }\n e: (str: string) => string\n plugins: Array<{ processFnString?: Function; processAST?: Function }>\n async: boolean\n templates: Cacher\n cache: boolean\n views?: string | Array\n root?: string\n filename?: string\n name?: string\n 'view cache'?: boolean\n useWith?: boolean\n [index: string]: any\n}\n\nexport type PartialConfig = {\n [P in keyof EtaConfig]?: EtaConfig[P]\n}\n\n/* END TYPES */\n\nfunction includeHelper (this: EtaConfig, templateNameOrPath: string, data: object): string {\n var template = this.templates.get(templateNameOrPath)\n if (!template) {\n throw EtaErr('Could not fetch template \"' + templateNameOrPath + '\"')\n }\n return template(data, this)\n}\n\nvar defaultConfig: EtaConfig = {\n varName: 'it',\n autoTrim: [false, 'nl'],\n autoEscape: true,\n tags: ['<%', '%>'],\n parse: {\n interpolate: '=',\n raw: '~',\n exec: ''\n },\n async: false,\n templates: templates,\n cache: false,\n plugins: [],\n useWith: false,\n e: XMLEscape,\n include: includeHelper\n}\n\nincludeHelper.bind(defaultConfig)\n\nfunction getConfig (override: PartialConfig, baseConfig?: EtaConfig): EtaConfig {\n // TODO: run more tests on this\n\n var res: PartialConfig = {} // Linked\n copyProps(res, defaultConfig) // Creates deep clone of res, 1 layer deep\n\n if (baseConfig) {\n copyProps(res, baseConfig)\n }\n\n if (override) {\n copyProps(res, override)\n }\n\n return res as EtaConfig\n}\n\nexport { defaultConfig, getConfig }\n","import compileToString from './compile-string'\nimport { getConfig } from './config'\nimport EtaErr from './err'\n\n/* TYPES */\n\nimport { EtaConfig, PartialConfig } from './config'\nimport { CallbackFn } from './file-handlers'\nexport type TemplateFunction = (data: object, config: EtaConfig, cb?: CallbackFn) => string\n\n/* END TYPES */\n\nexport default function compile (str: string, env?: PartialConfig): TemplateFunction {\n var options: EtaConfig = getConfig(env || {})\n var ctor // constructor\n\n /* ASYNC HANDLING */\n // The below code is modified from mde/ejs. All credit should go to them.\n if (options.async) {\n // Have to use generated function for this, since in envs without support,\n // it breaks in parsing\n try {\n ctor = new Function('return (async function(){}).constructor;')()\n } catch (e) {\n if (e instanceof SyntaxError) {\n throw EtaErr(\"This environment doesn't support async/await\")\n } else {\n throw e\n }\n }\n } else {\n ctor = Function\n }\n /* END ASYNC HANDLING */\n try {\n return new ctor(\n options.varName,\n 'E', // EtaConfig\n 'cb', // optional callback\n compileToString(str, options)\n ) as TemplateFunction // eslint-disable-line no-new-func\n } catch (e) {\n if (e instanceof SyntaxError) {\n throw EtaErr(\n 'Bad template syntax\\n\\n' +\n e.message +\n '\\n' +\n Array(e.message.length + 1).join('=') +\n '\\n' +\n compileToString(str, options)\n )\n } else {\n throw e\n }\n }\n}\n","var fs = require('fs')\nvar path = require('path')\nvar _BOM = /^\\uFEFF/\n\n// express is set like: app.engine('html', require('eta').renderFile)\n\nimport EtaErr from './err'\nimport Compile from './compile'\nimport { getConfig } from './config'\n\n/* TYPES */\n\nimport { EtaConfig, PartialConfig } from './config'\nimport { TemplateFunction } from './compile'\n\ninterface PartialFileConfig extends PartialConfig {\n filename: string\n}\n\ninterface FileConfig extends EtaConfig {\n filename: string\n}\n\n/* END TYPES */\n\n/**\n * Get the path to the included file from the parent file path and the\n * specified path.\n *\n * @param {String} name specified path\n * @param {String} parentfile parent file path\n * @param {Boolean} [isDir=false] whether parent file path is a directory\n * @return {String}\n */\n\nfunction getWholeFilePath (name: string, parentfile: string, isDirectory?: boolean) {\n var includePath = path.resolve(\n isDirectory ? parentfile : path.dirname(parentfile), // returns directory the parent file is in\n name // file\n )\n var ext = path.extname(name)\n if (!ext) {\n includePath += '.eta'\n }\n return includePath\n}\n\n/**\n * Get the path to the included file by Options\n *\n * @param {String} path specified path\n * @param {Options} options compilation options\n * @return {String}\n */\n\nfunction getPath (path: string, options: EtaConfig) {\n var includePath\n var filePath\n var views = options.views\n var match = /^[A-Za-z]+:\\\\|^\\//.exec(path)\n\n // Abs path\n if (match && match.length) {\n includePath = getWholeFilePath(path.replace(/^\\/*/, ''), options.root || '/', true)\n } else {\n // Relative paths\n // Look relative to a passed filename first\n if (options.filename) {\n filePath = getWholeFilePath(path, options.filename)\n if (fs.existsSync(filePath)) {\n includePath = filePath\n }\n }\n // Then look in any views directories\n if (!includePath) {\n if (\n Array.isArray(views) &&\n views.some(function (v) {\n filePath = getWholeFilePath(path, v, true)\n return fs.existsSync(filePath)\n })\n ) {\n includePath = filePath\n }\n }\n if (!includePath) {\n throw EtaErr('Could not find the include file \"' + path + '\"')\n }\n }\n return includePath\n}\n\nfunction readFile (filePath: string) {\n return fs\n .readFileSync(filePath)\n .toString()\n .replace(_BOM, '') // TODO: is replacing BOM's necessary?\n}\n\nfunction loadFile (filePath: string, options: PartialFileConfig): TemplateFunction {\n var config = getConfig(options)\n var template = readFile(filePath)\n try {\n var compiledTemplate = Compile(template, config)\n config.templates.define((config as FileConfig).filename, compiledTemplate)\n return compiledTemplate\n } catch (e) {\n throw EtaErr('Loading file: ' + filePath + ' failed')\n }\n}\n\nexport { getPath, readFile, loadFile }\n","// express is set like: app.engine('html', require('eta').renderFile)\n\nimport EtaErr from './err'\nimport compile from './compile'\nimport { getConfig } from './config'\nimport { getPath, readFile, loadFile } from './file-utils'\nimport { promiseImpl, copyProps } from './utils'\n\n/* TYPES */\n\nimport { EtaConfig, PartialConfig } from './config'\nimport { TemplateFunction } from './compile'\n\nexport type CallbackFn = (err: Error | null, str?: string) => void\n\ninterface FileOptions extends EtaConfig {\n filename: string\n}\n\ninterface DataObj {\n settings?: {\n [key: string]: any\n }\n [key: string]: any\n}\n\n/* END TYPES */\n\n/**\n * Get the template from a string or a file, either compiled on-the-fly or\n * read from cache (if enabled), and cache the template if needed.\n *\n * If `options.cache` is true, this function reads the file from\n * `options.filename` so it must be set prior to calling this function.\n *\n * @param {Options} options compilation options\n * @param {String} [template] template source\n * @return {(TemplateFunction|ClientFunction)}\n * Depending on the value of `options.client`, either type might be returned.\n * @static\n */\n\nfunction handleCache (options: FileOptions): TemplateFunction {\n var filename = options.filename\n\n if (options.cache) {\n var func = options.templates.get(filename)\n if (func) {\n return func\n } else {\n return loadFile(filename, options)\n }\n }\n\n return compile(readFile(filename), options)\n}\n\n/**\n * Try calling handleCache with the given options and data and call the\n * callback with the result. If an error occurs, call the callback with\n * the error. Used by renderFile().\n *\n * @param {Options} options compilation options\n * @param {Object} data template data\n * @param {RenderFileCallback} cb callback\n * @static\n */\n\nfunction tryHandleCache (options: FileOptions, data: object, cb: CallbackFn) {\n var result\n if (!cb) {\n // No callback, try returning a promise\n if (typeof promiseImpl === 'function') {\n return new promiseImpl(function (resolve: Function, reject: Function) {\n try {\n result = handleCache(options)(data, options)\n resolve(result)\n } catch (err) {\n reject(err)\n }\n })\n } else {\n throw EtaErr(\"Please provide a callback function, this env doesn't support Promises\")\n }\n } else {\n try {\n handleCache(options)(data, options, cb)\n } catch (err) {\n return cb(err)\n }\n }\n}\n\n/**\n * Get the template function.\n *\n * If `options.cache` is `true`, then the template is cached.\n *\n * @param {String} path path for the specified file\n * @param {Options} options compilation options\n * @return {(TemplateFunction|ClientFunction)}\n * Depending on the value of `options.client`, either type might be returned\n * @static\n */\n\nfunction includeFile (path: string, options: EtaConfig) {\n // the below creates a new options object, using the parent filepath of the old options object and the path\n var newFileOptions = getConfig({ filename: getPath(path, options) }, options)\n // TODO: make sure properties are currectly copied over\n return handleCache(newFileOptions as FileOptions)\n}\n\nfunction renderFile (filename: string, data: DataObj, cb?: CallbackFn) {\n var Config: FileOptions = getConfig((data as PartialConfig) || {}) as FileOptions\n // TODO: make sure above doesn't error. We do set filename down below\n\n if (data.settings) {\n // Pull a few things from known locations\n if (data.settings.views) {\n Config.views = data.settings.views\n }\n if (data.settings['view cache']) {\n Config.cache = true\n }\n // Undocumented after Express 2, but still usable, esp. for\n // items that are unsafe to be passed along with data, like `root`\n var viewOpts = data.settings['view options']\n\n if (viewOpts) {\n copyProps(Config, viewOpts)\n }\n }\n\n Config.filename = filename // Make sure filename is right\n\n return tryHandleCache(Config, data, cb as CallbackFn)\n}\n\nexport { includeFile, renderFile }\n","import { includeFile } from './file-handlers'\nimport EtaErr from './err'\n\n/* TYPES */\n\nimport { EtaConfig } from './config'\n\ninterface GenericData {\n [index: string]: any\n}\n\n/* END TYPES */\n\nexport function includeFileHelper (this: EtaConfig, path: string, data: GenericData): string {\n return includeFile(path, this)(data, this)\n}\n\n// export function extendsFileHelper(path: string, data: GenericData, config: EtaConfig): string {\n// var data: GenericData = content.params[1] || {}\n\n// data.content = content.exec()\n// for (var i = 0; i < blocks.length; i++) {\n// var currentBlock = blocks[i]\n// data[currentBlock.name] = currentBlock.exec()\n// }\n\n// return includeFile(content.params[0], config)(data, config)\n// }\n","import compile from './compile'\nimport { getConfig } from './config'\nimport { promiseImpl } from './utils'\nimport EtaErr from './err'\n\n/* TYPES */\n\nimport { EtaConfig, PartialConfig } from './config'\nimport { TemplateFunction } from './compile'\nimport { CallbackFn } from './file-handlers'\n\n/* END TYPES */\n\nfunction handleCache (template: string | TemplateFunction, options: EtaConfig): TemplateFunction {\n var templateFunc\n\n if (options.cache && options.name && options.templates.get(options.name)) {\n return options.templates.get(options.name)\n }\n\n if (typeof template === 'function') {\n templateFunc = template\n } else {\n templateFunc = compile(template, options)\n }\n\n if (options.cache && options.name) {\n options.templates.define(options.name, templateFunc)\n }\n\n return templateFunc\n}\n\nexport default function render (\n template: string | TemplateFunction,\n data: object,\n env?: PartialConfig,\n cb?: CallbackFn\n) {\n var options = getConfig(env || {})\n\n if (options.async) {\n var result\n if (!cb) {\n // No callback, try returning a promise\n if (typeof promiseImpl === 'function') {\n return new promiseImpl(function (resolve: Function, reject: Function) {\n try {\n result = handleCache(template, options)(data, options)\n resolve(result)\n } catch (err) {\n reject(err)\n }\n })\n } else {\n throw EtaErr(\"Please provide a callback function, this env doesn't support Promises\")\n }\n } else {\n try {\n handleCache(template, options)(data, options, cb)\n } catch (err) {\n return cb(err)\n }\n }\n } else {\n return handleCache(template, options)(data, options)\n }\n}\n","/* Export file stuff */\nimport { includeFileHelper } from './file-helpers'\nimport { defaultConfig } from './config'\n\n/* TYPES */\n\n/* END TYPES */\n\ndefaultConfig.includeFile = includeFileHelper\nincludeFileHelper.bind(defaultConfig)\n\nexport { renderFile, renderFile as __express } from './file-handlers'\nexport { loadFile } from './file-utils'\n\n/* End file stuff */\n\nexport { default as compileToString } from './compile-string'\nexport { default as compile } from './compile'\nexport { default as parse } from './parse'\nexport { default as render } from './render'\nexport { templates } from './containers'\nexport { defaultConfig, getConfig } from './config'\n"],"names":["Parse","Compile","handleCache"],"mappings":"AAAA,SAAS,cAAc,CAAE,GAAQ,EAAE,KAAU;IAC3C,IAAI,MAAM,CAAC,cAAc,EAAE;QACzB,MAAM,CAAC,cAAc,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;KAClC;SAAM;QACL,GAAG,CAAC,SAAS,GAAG,KAAK,CAAA;KACtB;AACH,CAAC;SAEuB,MAAM,CAAE,OAAe;IAC7C,IAAI,GAAG,GAAG,IAAI,KAAK,CAAC,OAAO,CAAC,CAAA;IAC5B,cAAc,CAAC,GAAG,EAAE,MAAM,CAAC,SAAS,CAAC,CAAA;IACrC,OAAO,GAAG,CAAA;AACZ,CAAC;AAED,MAAM,CAAC,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,EAAE;IAChD,IAAI,EAAE,EAAE,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,KAAK,EAAE;CAChD,CAAC,CAAA;AAEF;SAEgB,QAAQ,CAAE,OAAe,EAAE,GAAW,EAAE,IAAY;IAClE,IAAI,UAAU,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;IAE/C,IAAI,MAAM,GAAG,UAAU,CAAC,MAAM,CAAA;IAC9B,IAAI,KAAK,GAAG,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAA;IAC7C,OAAO;QACL,WAAW;YACX,MAAM;YACN,OAAO;YACP,KAAK;YACL,OAAO;YACP,IAAI;YACJ,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;YAC3B,IAAI;YACJ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C;;ACnED;AACA,AAGA;AAEA;AAEA,aAAa,CAAC,WAAW,GAAG,iBAAiB,CAAA;AAC7C,iBAAiB,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA;;;;"} \ No newline at end of file diff --git a/dist/types/parse-old.d.ts b/dist/types/parse-old.d.ts deleted file mode 100644 index 4f22e0d..0000000 --- a/dist/types/parse-old.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { EtaConfig } from './config'; -export declare type TagType = 'r' | 'e' | 'i' | ''; -export interface TemplateObject { - t: TagType; - val: string; -} -export declare type AstObject = string | TemplateObject; -export default function parse(str: string, env: EtaConfig): Array; diff --git a/dist/types/parse-orig.d.ts b/dist/types/parse-orig.d.ts deleted file mode 100644 index 4f22e0d..0000000 --- a/dist/types/parse-orig.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { EtaConfig } from './config'; -export declare type TagType = 'r' | 'e' | 'i' | ''; -export interface TemplateObject { - t: TagType; - val: string; -} -export declare type AstObject = string | TemplateObject; -export default function parse(str: string, env: EtaConfig): Array; diff --git a/package.json b/package.json index 065ad1e..bee997e 100644 --- a/package.json +++ b/package.json @@ -100,7 +100,7 @@ "devDependencies": { "@commitlint/cli": "^8.2.0", "@commitlint/config-conventional": "^8.2.0", - "@types/jest": "^25.1.4", + "@types/jest": "^25.1.0", "@types/node": "^13.9.3", "@typescript-eslint/eslint-plugin": "2", "@typescript-eslint/parser": "^2.20.0", @@ -133,7 +133,7 @@ "travis-deploy-once": "^5.0.9", "ts-jest": "^25.1.0", "ts-node": "^8.5.4", - "typedoc": "^0.16.7", + "typedoc": "^0.17.3", "typescript": "^3.0.3" }, "husky": { diff --git a/src/parse-old.ts b/src/parse-old.ts deleted file mode 100644 index 54520e3..0000000 --- a/src/parse-old.ts +++ /dev/null @@ -1,98 +0,0 @@ -import EtaErr, { ParseErr } from './err' -import { trimWS } from './utils' - -/* TYPES */ - -import { EtaConfig } from './config' - -export type TagType = 'r' | 'e' | 'i' | '' - -export interface TemplateObject { - t: TagType - val: string -} - -export type AstObject = string | TemplateObject - -/* END TYPES */ - -export default function parse (str: string, env: EtaConfig): Array { - var buffer: Array = [] - var trimLeftOfNextStr: string | false = false - var lastIndex = 0 - - function pushString (strng: string, shouldTrimRightOfString?: string | false) { - if (strng) { - // if string is truthy it must be of type 'string' - // replace \ with \\, ' with \' - var stringToPush = strng.replace(/\\|'/g, '\\$&') - - // TODO: benchmark replace( /(\\|')/g, '\\$1') - stringToPush = trimWS( - stringToPush, - env, - trimLeftOfNextStr, // this will only be false on the first str, the next ones will be null or undefined - shouldTrimRightOfString - ) - - stringToPush = stringToPush.replace(/\n/g, '\\n').replace(/\r/g, '\\r') - - if (stringToPush) { - buffer.push(stringToPush) - } - } - } - - var prefixes = (env.parse.exec + env.parse.interpolate + env.parse.raw).split('').join('|') - - var parseReg = new RegExp( - '([^]*?)' + - env.tags[0] + - '(-|_)?\\s*(' + - prefixes + - ')?\\s*((?:[^]*?(?:\'(?:\\\\[\\s\\w"\'\\\\`]|[^\\n\\r\'\\\\])*?\'|`(?:\\\\[\\s\\w"\'\\\\`]|[^\\\\`])*?`|"(?:\\\\[\\s\\w"\'\\\\`]|[^\\n\\r"\\\\])*?"|\\/\\*[^]*?\\*\\/)?)*?)\\s*(-|_)?' + - env.tags[1], - 'g' - ) - - // TODO: benchmark having the \s* on either side vs using str.trim() - - var m - - while ((m = parseReg.exec(str)) !== null) { - lastIndex = m[0].length + m.index - var i = m.index - - var precedingString = m[1] - var wsLeft = m[2] - var prefix = m[3] || '' // by default either ~, =, or empty - var content = m[4] - - pushString(precedingString, wsLeft) - trimLeftOfNextStr = m[5] - - var currentType: TagType = '' - if (prefix === env.parse.exec) { - currentType = 'e' - } else if (prefix === env.parse.raw) { - currentType = 'r' - } else if (prefix === env.parse.interpolate) { - currentType = 'i' - } - - buffer.push({ t: currentType, val: content }) - } - - pushString(str.slice(lastIndex, str.length), false) - - if (env.plugins) { - for (var i = 0; i < env.plugins.length; i++) { - var plugin = env.plugins[i] - if (plugin.processAST) { - buffer = plugin.processAST(buffer, env) - } - } - } - - return buffer -} diff --git a/src/parse-orig.ts b/src/parse-orig.ts deleted file mode 100644 index fe9ae70..0000000 --- a/src/parse-orig.ts +++ /dev/null @@ -1,120 +0,0 @@ -import { ParseErr } from './err' -import { trimWS } from './utils' - -/* TYPES */ - -import { EtaConfig } from './config' - -export type TagType = 'r' | 'e' | 'i' | '' - -export interface TemplateObject { - t: TagType - val: string -} - -export type AstObject = string | TemplateObject - -/* END TYPES */ - -export default function parse (str: string, env: EtaConfig): Array { - var buffer: Array = [] - - var tagCloseRegExp = new RegExp( - '\'(?:\\\\[\\s\\w"\'\\\\`]|[^\\n\\r\'\\\\])*?\'|`(?:\\\\[\\s\\w"\'\\\\`]|[^\\\\`])*?`|"(?:\\\\[\\s\\w"\'\\\\`]|[^\\n\\r"\\\\])*?"' + // matches strings - '|\\/\\*[^]*?\\*\\/|((-|_)?' + - env.tags[1] + - ')', - 'g' - ) - - var prefixes = (env.parse.exec + env.parse.interpolate + env.parse.raw).split('').join('|') - - var tagOpenReg = new RegExp('([^]*?)' + env.tags[0] + '(-|_)?\\s*(' + prefixes + ')?', 'g') - var startInd = 0 - var trimLeftOfNextStr: string | false = false - - function pushString (strng: string, shouldTrimRightOfString?: string | false) { - if (strng) { - // if string is truthy it must be of type 'string' - // replace \ with \\, ' with \' - var stringToPush = strng.replace(/\\|'/g, '\\$&') - - // TODO: benchmark replace( /(\\|')/g, '\\$1') - stringToPush = trimWS( - stringToPush, - env, - trimLeftOfNextStr, // this will only be false on the first str, the next ones will be null or undefined - shouldTrimRightOfString - ) - - stringToPush = stringToPush.replace(/\n/g, '\\n').replace(/\r/g, '\\r') - - if (stringToPush) { - buffer.push(stringToPush) - } - } - } - - // Random TODO: parentObj.b doesn't need to have t: # - var tagOpenMatch - // tslint:disable-next-line:no-conditional-assignment - while ((tagOpenMatch = tagOpenReg.exec(str)) !== null) { - var precedingString = tagOpenMatch[1] - var shouldTrimRightOfString = tagOpenMatch[2] - var prefix = tagOpenMatch[3] || '' - - var currentType: TagType = '' - - if (prefix === env.parse.exec) { - currentType = 'e' - } else if (prefix === env.parse.raw) { - currentType = 'r' - } else if (prefix === env.parse.interpolate) { - currentType = 'i' - } - - pushString(precedingString, shouldTrimRightOfString) - startInd = tagOpenMatch.index + tagOpenMatch[0].length - - tagCloseRegExp.lastIndex = startInd - - var currentObj: TemplateObject | false = false - - var m - // tslint:disable-next-line:no-conditional-assignment - while ((m = tagCloseRegExp.exec(str)) !== null) { - if (m[1]) { - // tagClose, not a string or comment - var wsControl = m[2] - var i = m.index - - var val = str.slice(startInd, i).trim() - startInd = i + m[0].length - tagOpenReg.lastIndex = startInd - // console.log('tagClose: ' + startInd) - trimLeftOfNextStr = wsControl - currentObj = { t: currentType, val: val } - break - } - } - - if (currentObj) { - buffer.push(currentObj) - } else { - ParseErr('unclosed tag', str, startInd) - } - } - - pushString(str.slice(startInd, str.length), false) - - // console.log(JSON.stringify(buffer)) - if (env.plugins) { - for (var i = 0; i < env.plugins.length; i++) { - var plugin = env.plugins[i] - if (plugin.processAST) { - buffer = plugin.processAST(buffer, env) - } - } - } - return buffer // Return buffer -} diff --git a/yarn.lock b/yarn.lock index bd4bf48..67ea95a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -993,43 +993,43 @@ resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.2.tgz#26520bf09abe4a5644cd5414e37125a8954241dd" integrity sha512-tsAQNx32a8CoFhjhijUIhI4kccIAgmGhy8LZMZgGfmXcpMbPRUqn5LWmgRttILi6yeGmBJd2xsPkFMs0PzgPCw== -"@jest/console@^25.2.0": - version "25.2.0" - resolved "https://registry.yarnpkg.com/@jest/console/-/console-25.2.0.tgz#e2c37024d97ded0448be8c846db4ce54aa4b66dd" - integrity sha512-mUQTLxw/q0S8duskmb1PY0Yq7RQ0Sr1st7pUhFCcJ7wcPRPFs5t6k6bJWTellAF/8wH/ar8tZSwSIiBYAj559w== +"@jest/console@^25.2.1": + version "25.2.1" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-25.2.1.tgz#63b35b6a2b67f26866f8dcbb9725452a1c8c0d3b" + integrity sha512-v3tkMr5AeVm6R23wnZdC5dzXdHPFa6j2uiTC15iHISYkGIilE9O1qmAYKELHPXZifDbz9c8WwzsqoN8K8uG4jg== dependencies: - "@jest/source-map" "^25.2.0" + "@jest/source-map" "^25.2.1" chalk "^3.0.0" - jest-util "^25.2.0" + jest-util "^25.2.1" slash "^3.0.0" -"@jest/core@^25.2.0": - version "25.2.0" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-25.2.0.tgz#c1d65a7a2e4339b815dc0fe16d447f5eea7ed591" - integrity sha512-8R7gaUuMnilS8QBQOT5lF6KS/+ocHIiM6Ou9gnRB0GQA138I2G9tRs/D9MR9hkvuYGLy+VoqOTdLKUT60nzlVw== +"@jest/core@^25.2.2": + version "25.2.2" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-25.2.2.tgz#089742101b5963eed72bd4140e4dfab05f60c385" + integrity sha512-dSPhksPMRvuE5WLQODFqaiuubBe1r92XAl3m47m8rC2uf6PqxxkeiI1meGAPLT1j1SevdqklECpy+mkMGrDO9w== dependencies: - "@jest/console" "^25.2.0" - "@jest/reporters" "^25.2.0" - "@jest/test-result" "^25.2.0" - "@jest/transform" "^25.2.0" - "@jest/types" "^25.2.0" + "@jest/console" "^25.2.1" + "@jest/reporters" "^25.2.1" + "@jest/test-result" "^25.2.1" + "@jest/transform" "^25.2.1" + "@jest/types" "^25.2.1" ansi-escapes "^4.2.1" chalk "^3.0.0" exit "^0.1.2" graceful-fs "^4.2.3" - jest-changed-files "^25.2.0" - jest-config "^25.2.0" - jest-haste-map "^25.2.0" - jest-message-util "^25.2.0" - jest-regex-util "^25.2.0" - jest-resolve "^25.2.0" - jest-resolve-dependencies "^25.2.0" - jest-runner "^25.2.0" - jest-runtime "^25.2.0" - jest-snapshot "^25.2.0" - jest-util "^25.2.0" - jest-validate "^25.2.0" - jest-watcher "^25.2.0" + jest-changed-files "^25.2.1" + jest-config "^25.2.2" + jest-haste-map "^25.2.1" + jest-message-util "^25.2.1" + jest-regex-util "^25.2.1" + jest-resolve "^25.2.1" + jest-resolve-dependencies "^25.2.2" + jest-runner "^25.2.2" + jest-runtime "^25.2.2" + jest-snapshot "^25.2.1" + jest-util "^25.2.1" + jest-validate "^25.2.1" + jest-watcher "^25.2.1" micromatch "^4.0.2" p-each-series "^2.1.0" realpath-native "^2.0.0" @@ -1037,36 +1037,36 @@ slash "^3.0.0" strip-ansi "^6.0.0" -"@jest/environment@^25.2.0": - version "25.2.0" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-25.2.0.tgz#20984739c9d85d03a15c0fb2a75558702202353c" - integrity sha512-cLkCRmVYg9QnyTLxZMUK72BVnwe/+ukxhwbt0DyFK+wayrlUtseusLfl9yvnarPzHtCWVx2LL68C6iOg2V1TdA== +"@jest/environment@^25.2.1": + version "25.2.1" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-25.2.1.tgz#d967f38c05accfb2dba325e93238684e8b1706bd" + integrity sha512-aeA3UlUmpblmv2CHBcNA7LvcXlcCtRpXaKKFVooRy9/Jk8B4IZAZMfrML/d+1cG5FpF17s4JVdu1kx0mbnaqTQ== dependencies: - "@jest/fake-timers" "^25.2.0" - "@jest/types" "^25.2.0" - jest-mock "^25.2.0" + "@jest/fake-timers" "^25.2.1" + "@jest/types" "^25.2.1" + jest-mock "^25.2.1" -"@jest/fake-timers@^25.2.0": - version "25.2.0" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-25.2.0.tgz#9410a2f4db59f09d661005193d1626df22b316bb" - integrity sha512-IcxxIEHsBspeentekQW5OLJqBWfAb+CSabDo8yyYG13iX5mKq54B2bdqvvPdAZ5LGK7dgBsTsFgteEn0xTtylQ== +"@jest/fake-timers@^25.2.1": + version "25.2.1" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-25.2.1.tgz#caaaea22e810796d3538a77fdce6e554c864ae72" + integrity sha512-H1OC8AktrGTD10NHBauICkRCv7VOOrsgI8xokifAsxJMYhqoKBtJZbk2YpbrtnmdTUnk+qoxPUk+Mufwnl44iQ== dependencies: - "@jest/types" "^25.2.0" - jest-message-util "^25.2.0" - jest-mock "^25.2.0" - jest-util "^25.2.0" + "@jest/types" "^25.2.1" + jest-message-util "^25.2.1" + jest-mock "^25.2.1" + jest-util "^25.2.1" lolex "^5.0.0" -"@jest/reporters@^25.2.0": - version "25.2.0" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-25.2.0.tgz#828dc217cb7480cdb138e5ff91174deaae80624a" - integrity sha512-raHy7kGJACB+F5ioLoKMsbWJv2RgaFAq/RdnMUtOODqGo973NeWcUJckSSY/FCvAvf3Mw2UOmQA90x5UZ4C0sg== +"@jest/reporters@^25.2.1": + version "25.2.1" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-25.2.1.tgz#c5bc848393f48f3cf141957ba51fc4c1598ddb3a" + integrity sha512-jAnIECIIFVHiASKLpPBpZ9fIgWolKdMwUuyjSlNVixmtX6G83fyiGaOquaAU1ukAxnlKdCLjvH6BYdY+GGbd5Q== dependencies: "@bcoe/v8-coverage" "^0.2.3" - "@jest/console" "^25.2.0" - "@jest/test-result" "^25.2.0" - "@jest/transform" "^25.2.0" - "@jest/types" "^25.2.0" + "@jest/console" "^25.2.1" + "@jest/test-result" "^25.2.1" + "@jest/transform" "^25.2.1" + "@jest/types" "^25.2.1" chalk "^3.0.0" collect-v8-coverage "^1.0.0" exit "^0.1.2" @@ -1076,10 +1076,10 @@ istanbul-lib-report "^3.0.0" istanbul-lib-source-maps "^4.0.0" istanbul-reports "^3.0.0" - jest-haste-map "^25.2.0" - jest-resolve "^25.2.0" - jest-util "^25.2.0" - jest-worker "^25.2.0" + jest-haste-map "^25.2.1" + jest-resolve "^25.2.1" + jest-util "^25.2.1" + jest-worker "^25.2.1" slash "^3.0.0" source-map "^0.6.0" string-length "^3.1.0" @@ -1088,51 +1088,51 @@ optionalDependencies: node-notifier "^6.0.0" -"@jest/source-map@^25.2.0": - version "25.2.0" - resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-25.2.0.tgz#2b2d4e587a85fd95dcf6f3bb757680ac9f662bda" - integrity sha512-KX8sYbzd8h7Nfc6dQjED8FzzR6o3QocpJllrBmsnb4BuVN7k2pLeIc2lRrUPXrPiidUwvA1H/AeIgGWNVacZvw== +"@jest/source-map@^25.2.1": + version "25.2.1" + resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-25.2.1.tgz#b62ecf8ae76170b08eff8859b56eb7576df34ab8" + integrity sha512-PgScGJm1U27+9Te/cxP4oUFqJ2PX6NhBL2a6unQ7yafCgs8k02c0LSyjSIx/ao0AwcAdCczfAPDf5lJ7zoB/7A== dependencies: callsites "^3.0.0" graceful-fs "^4.2.3" source-map "^0.6.0" -"@jest/test-result@^25.2.0": - version "25.2.0" - resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-25.2.0.tgz#8c0e50247c4633c92d463c5494a711215f7c1773" - integrity sha512-FoxHScuV+h2LFFF7I2Me22qSv+Rh1aBBKLvVqWNM0Rkevjil1+wKpri7hQh9NaTk28rAo/iZB1J4n4U75PzGQw== +"@jest/test-result@^25.2.1": + version "25.2.1" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-25.2.1.tgz#dc8d26d4329c055733bd5ad6dc4eda190fbacd3b" + integrity sha512-E0tlWh2iOELRLbbPEngs3Dsx88vGBQOs6O3w46YeXfMHlwwqzWrlvoeUq6kRlHRm1O8H+EBr60Wtrwh20C+zWQ== dependencies: - "@jest/console" "^25.2.0" - "@jest/transform" "^25.2.0" - "@jest/types" "^25.2.0" + "@jest/console" "^25.2.1" + "@jest/transform" "^25.2.1" + "@jest/types" "^25.2.1" "@types/istanbul-lib-coverage" "^2.0.0" collect-v8-coverage "^1.0.0" -"@jest/test-sequencer@^25.2.0": - version "25.2.0" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-25.2.0.tgz#9d700bdd3296ee093c4797fb31fe4a705aad86bf" - integrity sha512-eYbitqvFZo1S6nJIEoyeqcIK4WY6Z/Dz+8/7DoloYpgxUFHvJVK95UPGFMC36zvA9nB4Xpr7ICqOzrOvg2iVRg== +"@jest/test-sequencer@^25.2.2": + version "25.2.2" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-25.2.2.tgz#22132174af970527e856c96d78bf446828eb6bde" + integrity sha512-bN1LH30EygCNrZS7gkKBmqBxQwilYiMlAV+wY9oWFRY4VZAxvPwqg5/f0DrZQc60vTW1fXWrkfslSa87sO/P5A== dependencies: - "@jest/test-result" "^25.2.0" - jest-haste-map "^25.2.0" - jest-runner "^25.2.0" - jest-runtime "^25.2.0" + "@jest/test-result" "^25.2.1" + jest-haste-map "^25.2.1" + jest-runner "^25.2.2" + jest-runtime "^25.2.2" -"@jest/transform@^25.2.0": - version "25.2.0" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-25.2.0.tgz#c45ebbdc0414b1b20050b1fb58aadc67054a8643" - integrity sha512-PVElAX0TILnRB4iS81Yus0kvU1g/M4+jwies/joBg4Z6SljFRaWnz5ZEcb1io194hRp6G5VI+em8XTYNDVWHoQ== +"@jest/transform@^25.2.1": + version "25.2.1" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-25.2.1.tgz#08481795277b6ff9d7cb703eb4425ed46861bedc" + integrity sha512-puoD5EfqPeZ5m0dV9l8+PMdOVdRjeWcaEjGkH+eG45l0nPJ2vRcxu8J6CRl/6nQ5ZTHgg7LuM9C6FauNpdRpUA== dependencies: "@babel/core" "^7.1.0" - "@jest/types" "^25.2.0" + "@jest/types" "^25.2.1" babel-plugin-istanbul "^6.0.0" chalk "^3.0.0" convert-source-map "^1.4.0" fast-json-stable-stringify "^2.0.0" graceful-fs "^4.2.3" - jest-haste-map "^25.2.0" - jest-regex-util "^25.2.0" - jest-util "^25.2.0" + jest-haste-map "^25.2.1" + jest-regex-util "^25.2.1" + jest-util "^25.2.1" micromatch "^4.0.2" pirates "^4.0.1" realpath-native "^2.0.0" @@ -1140,10 +1140,10 @@ source-map "^0.6.1" write-file-atomic "^3.0.0" -"@jest/types@^25.2.0": - version "25.2.0" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-25.2.0.tgz#0659866d9b31843a737b601b950a690e576a415a" - integrity sha512-RLWBAON8LEjzD60Cn0XFmvMNTuV+scKlufIUApnG7VF7oA2jCEk5J0uzEchx6xuOwhrHohQM28K4CmEjgtDEwg== +"@jest/types@^25.2.0", "@jest/types@^25.2.1": + version "25.2.1" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-25.2.1.tgz#692c8950d4c21fc6b4cfd141c3470b735c5bffca" + integrity sha512-WuGFGJ3Rrycg+5ZwQTWKjr21M9psANPAWYD28K42hSeUzhv1H591VXIoq0tjs00mydhNOgVOkKSpzRS3CrOYFw== dependencies: "@types/istanbul-lib-coverage" "^2.0.0" "@types/istanbul-reports" "^1.1.1" @@ -1293,7 +1293,7 @@ "@types/istanbul-lib-coverage" "*" "@types/istanbul-lib-report" "*" -"@types/jest@^25.1.4": +"@types/jest@^25.1.0": version "25.1.4" resolved "https://registry.yarnpkg.com/@types/jest/-/jest-25.1.4.tgz#9e9f1e59dda86d3fd56afce71d1ea1b331f6f760" integrity sha512-QDDY2uNAhCV7TMCITrxz+MRk1EizcsevzfeS6LykIlq2V1E5oO4wXG8V2ZEd9w7Snxeeagk46YbMgZ8ESHx3sw== @@ -1306,7 +1306,7 @@ resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.4.tgz#38fd73ddfd9b55abb1e1b2ed578cb55bd7b7d339" integrity sha512-8+KAKzEvSUdeo+kmqnKrqgeE+LcA0tjYWFY7RPProVYwnqDjukzO+3b6dLD56rYX5TdWejnEOLJYOIeh4CXKuA== -"@types/minimatch@*", "@types/minimatch@3.0.3": +"@types/minimatch@*": version "3.0.3" resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d" integrity sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA== @@ -1744,16 +1744,16 @@ aws4@^1.8.0: resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.9.1.tgz#7e33d8f7d449b3f673cd72deb9abdc552dbe528e" integrity sha512-wMHVg2EOHaMRxbzgFJ9gtjOOCrI80OHLG14rxi28XwOW8ux6IiEbRCGGGqCtdAIg4FQCbW20k9RsT4y3gJlFug== -babel-jest@^25.2.0: - version "25.2.0" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-25.2.0.tgz#480de84cfa43c9403d7a5eaa6bf51a3ca75b2f84" - integrity sha512-N1ECYb8AvQ55yc5QkrdFAThYNDU9ec14b7GgGO8ohFp1p2KDw5fga1NFr8YLFjgtuyVaa2rfVTBAYKnVHzOyYA== +babel-jest@^25.2.1: + version "25.2.1" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-25.2.1.tgz#d01ff8025b305a886421b176f3d99ec5461b23b7" + integrity sha512-OiBpQGYtV4rWMuFneIaEsqJB0VdoOBw4SqwO4hA2EhDY/O8RylQ20JwALkxv8iv+CYnyrZZfF+DELPgrdrkRIw== dependencies: - "@jest/transform" "^25.2.0" - "@jest/types" "^25.2.0" + "@jest/transform" "^25.2.1" + "@jest/types" "^25.2.1" "@types/babel__core" "^7.1.0" babel-plugin-istanbul "^6.0.0" - babel-preset-jest "^25.2.0" + babel-preset-jest "^25.2.1" chalk "^3.0.0" slash "^3.0.0" @@ -1775,10 +1775,10 @@ babel-plugin-istanbul@^6.0.0: istanbul-lib-instrument "^4.0.0" test-exclude "^6.0.0" -babel-plugin-jest-hoist@^25.2.0: - version "25.2.0" - resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-25.2.0.tgz#08785be7f40bda12e54a09cc89a44c5560a96f61" - integrity sha512-3JlSf80rRq8q8PTrLQ/6Tt1H6w+xCUJ6jiJdHoRzMXGy7ppb9fMBJLzq1iL2K5FIr3wzga6q9E9uRFB7E5aNLQ== +babel-plugin-jest-hoist@^25.2.1: + version "25.2.1" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-25.2.1.tgz#d0003a1f3d5caa281e1107fe03bbf16b799f9955" + integrity sha512-HysbCQfJhxLlyxDbKcB2ucGYV0LjqK4h6dBoI3RtFuOxTiTWK6XGZMsHb0tGh8iJdV4hC6Z2GCHzVvDeh9i0lQ== dependencies: "@types/babel__traverse" "^7.0.6" @@ -1791,14 +1791,14 @@ babel-polyfill@6.26.0: core-js "^2.5.0" regenerator-runtime "^0.10.5" -babel-preset-jest@^25.2.0: - version "25.2.0" - resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-25.2.0.tgz#e0e2532ec023d3c0192475f911ff0a952191cdeb" - integrity sha512-rgqa2neISQ+PT3KyzNTKK51PUuezRUB2AB5SiBidbvme5cVkic5CbWzsRkz7nP6WVqVxsnc6te1F+pHs9rhd7g== +babel-preset-jest@^25.2.1: + version "25.2.1" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-25.2.1.tgz#4ccd0e577f69aa11b71806edfe8b25a5c3ac93a2" + integrity sha512-zXHJBM5iR8oEO4cvdF83AQqqJf3tJrXy3x8nfu2Nlqvn4cneg4Ca8M7cQvC5S9BzDDy1O0tZ9iXru9J6E3ym+A== dependencies: "@babel/plugin-syntax-bigint" "^7.0.0" "@babel/plugin-syntax-object-rest-spread" "^7.0.0" - babel-plugin-jest-hoist "^25.2.0" + babel-plugin-jest-hoist "^25.2.1" babel-runtime@^6.23.0, babel-runtime@^6.26.0: version "6.26.0" @@ -1808,13 +1808,6 @@ babel-runtime@^6.23.0, babel-runtime@^6.26.0: core-js "^2.4.0" regenerator-runtime "^0.11.0" -backbone@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/backbone/-/backbone-1.4.0.tgz#54db4de9df7c3811c3f032f34749a4cd27f3bd12" - integrity sha512-RLmDrRXkVdouTg38jcgHhyQ/2zjg7a8E6sz2zxfz21Hh17xDJYUHBZimVIt5fUyS8vbfpeSmTL3gUjTEvUV3qQ== - dependencies: - underscore ">=1.8.3" - bail@^1.0.0: version "1.0.5" resolved "https://registry.yarnpkg.com/bail/-/bail-1.0.5.tgz#b6fa133404a392cbc1f8c4bf63f5953351e7a776" @@ -2693,10 +2686,10 @@ detect-newline@^3.0.0: resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-3.1.0.tgz#576f5dfc63ae1a192ff192d8ad3af6308991b651" integrity sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA== -diff-sequences@^25.2.0: - version "25.2.0" - resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-25.2.0.tgz#180bd89ff45c490b175de6dbb1d346db7b998a94" - integrity sha512-qTbUrz80F9q6rmEZjUoK2/SQTwgaOvnE5WjKlemKuod1iuB4WlSjY5ft2VUXacsqD9pXrWmERMPLi+j9RldxGg== +diff-sequences@^25.2.0, diff-sequences@^25.2.1: + version "25.2.1" + resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-25.2.1.tgz#fcfe8aa07dd9b0c648396a478dabca8e76c6ab27" + integrity sha512-foe7dXnGlSh3jR1ovJmdv+77VQj98eKCHHwJPbZ2eEf0fHwKbkZicpPxEch9smZ+n2dnF6QFwkOQdLq9hpeJUg== diff@4.0.1: version "4.0.1" @@ -3167,17 +3160,17 @@ expand-tilde@^2.0.0, expand-tilde@^2.0.2: dependencies: homedir-polyfill "^1.0.1" -expect@^25.2.0: - version "25.2.0" - resolved "https://registry.yarnpkg.com/expect/-/expect-25.2.0.tgz#7f365c1a5c08a224dbe8d335edd263b37b3c7932" - integrity sha512-T+s8WKwJ9NCmju9cFQ5ZTlYpEld2iNl1bhO4jXIFiaLF1hfW7wA91q4x1LYZrQ55HZZYs6x9skRLm//ImFK6BA== +expect@^25.2.1: + version "25.2.1" + resolved "https://registry.yarnpkg.com/expect/-/expect-25.2.1.tgz#f543b6a7fee921c554b5eec9b8ca384551dccedd" + integrity sha512-mRvuu0xujdgYuS0S2dZ489PGAcXl60blmsLofaq7heqn+ZcUOox+VWQvrCee/x+/0WBpxDs7pBWuFYNO5U+txQ== dependencies: - "@jest/types" "^25.2.0" + "@jest/types" "^25.2.1" ansi-styles "^4.0.0" - jest-get-type "^25.1.0" - jest-matcher-utils "^25.2.0" - jest-message-util "^25.2.0" - jest-regex-util "^25.2.0" + jest-get-type "^25.2.1" + jest-matcher-utils "^25.2.1" + jest-message-util "^25.2.1" + jest-regex-util "^25.2.1" extend-shallow@^2.0.1: version "2.0.1" @@ -3701,7 +3694,7 @@ growly@^1.3.0: resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081" integrity sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE= -handlebars@^4.0.13, handlebars@^4.7.2: +handlebars@^4.0.13, handlebars@^4.7.3: version "4.7.3" resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.7.3.tgz#8ece2797826886cf8082d1726ff21d2a022550ee" integrity sha512-SRGwSYuNfx8DwHD/6InAPzD6RgeruWLT+B8e8a7gGs8FWgHzlExpTFMEq2IA6QpAfOClpKHy6+8IqTjeBCu6Kg== @@ -3790,7 +3783,7 @@ has@^1.0.3: dependencies: function-bind "^1.1.1" -highlight.js@^9.17.1: +highlight.js@^9.18.1: version "9.18.1" resolved "https://registry.yarnpkg.com/highlight.js/-/highlight.js-9.18.1.tgz#ed21aa001fe6252bb10a3d76d47573c6539fe13c" integrity sha512-OrVKYz70LHsnCgmbXctv/bfuvntIKDz177h0Co37DQ5jamGZLVmoCVMtjMtNZY3X9DrCcKfklHPNeA0uPZhSJg== @@ -4427,59 +4420,59 @@ iterall@^1.2.2: resolved "https://registry.yarnpkg.com/iterall/-/iterall-1.3.0.tgz#afcb08492e2915cbd8a0884eb93a8c94d0d72fea" integrity sha512-QZ9qOMdF+QLHxy1QIpUHUU1D5pS2CG2P69LF6L6CPjPYA/XMOmKV3PZpawHoAjHNyB0swdVTRxdYT4tbBbxqwg== -jest-changed-files@^25.2.0: - version "25.2.0" - resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-25.2.0.tgz#b2d7ba9a389346d7e83cc10f95ca4cd05350de63" - integrity sha512-4pKQ0Be43Glqptu3HvXL4Vk3vZnAWI/S7nfonVM8ZBECJ85UVs+MOQrXc+4E4j4zIZ7Hoj7puq2g9Hw0ysjc1g== +jest-changed-files@^25.2.1: + version "25.2.1" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-25.2.1.tgz#2dca2c81980479c940addee863d8e73cc3a6b322" + integrity sha512-BB4XjM/dJNUAUtchZ2yJq50VK8XXbmgvt1MUD6kzgzoyz9F0+1ZDQ1yNvLl6pfDwKrMBG9GBY1lzaIBO3JByMg== dependencies: - "@jest/types" "^25.2.0" + "@jest/types" "^25.2.1" execa "^3.2.0" throat "^5.0.0" -jest-cli@^25.2.0: - version "25.2.0" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-25.2.0.tgz#cd5a30862df63b5db7daaf67a005e4da35e6d9dd" - integrity sha512-lf/ZGpR45oAvtr+3jqJYIoOrAfqLMUg6qKfmELDpeh7k7COst/xw598CBauWng0m3TO4fYhaNMzuJhGAQQuKfA== +jest-cli@^25.2.2: + version "25.2.2" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-25.2.2.tgz#1044bacf2a32b137fab9878eb72f557956ceefe1" + integrity sha512-glCp46vt4J72LSOvLAav2nBfuLFoqWqniguF7Q5IOXNu3jMo1BIZwm3gyP2mEJx9ZlxUKEZhc3r3E4SRDMAQ/A== dependencies: - "@jest/core" "^25.2.0" - "@jest/test-result" "^25.2.0" - "@jest/types" "^25.2.0" + "@jest/core" "^25.2.2" + "@jest/test-result" "^25.2.1" + "@jest/types" "^25.2.1" chalk "^3.0.0" exit "^0.1.2" import-local "^3.0.2" is-ci "^2.0.0" - jest-config "^25.2.0" - jest-util "^25.2.0" - jest-validate "^25.2.0" + jest-config "^25.2.2" + jest-util "^25.2.1" + jest-validate "^25.2.1" prompts "^2.0.1" realpath-native "^2.0.0" yargs "^15.3.1" -jest-config@^25.2.0: - version "25.2.0" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-25.2.0.tgz#073f22c0679cce5de2dd5f7514966dc3c2bc2fbf" - integrity sha512-O8eKPyIiDNp6rRwSVyYiy5EZP2zKzIMEonzi0g4XBeZJIM/qebcMnPryzLR3eXKx4R8RlucLjLq6LOdKafrhOQ== +jest-config@^25.2.0, jest-config@^25.2.2: + version "25.2.2" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-25.2.2.tgz#ab595713c1808a16ee714300ed48d02c34191d19" + integrity sha512-nnFcjd57kyc9q5vS1DRQQqowxKiRO6jmonL/lo84DL8Zjdng97jaty6EzJ37lMOqvehZY1ovqKgC7Ki0Iqa/wA== dependencies: "@babel/core" "^7.1.0" - "@jest/test-sequencer" "^25.2.0" - "@jest/types" "^25.2.0" - babel-jest "^25.2.0" + "@jest/test-sequencer" "^25.2.2" + "@jest/types" "^25.2.1" + babel-jest "^25.2.1" chalk "^3.0.0" deepmerge "^4.2.2" glob "^7.1.1" - jest-environment-jsdom "^25.2.0" - jest-environment-node "^25.2.0" - jest-get-type "^25.1.0" - jest-jasmine2 "^25.2.0" - jest-regex-util "^25.2.0" - jest-resolve "^25.2.0" - jest-util "^25.2.0" - jest-validate "^25.2.0" + jest-environment-jsdom "^25.2.1" + jest-environment-node "^25.2.2" + jest-get-type "^25.2.1" + jest-jasmine2 "^25.2.2" + jest-regex-util "^25.2.1" + jest-resolve "^25.2.1" + jest-util "^25.2.1" + jest-validate "^25.2.1" micromatch "^4.0.2" - pretty-format "^25.2.0" + pretty-format "^25.2.1" realpath-native "^2.0.0" -jest-diff@^25.1.0, jest-diff@^25.2.0: +jest-diff@^25.1.0: version "25.2.0" resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-25.2.0.tgz#d9d0138494b9c34acbb63508836cf11b6736f5dc" integrity sha512-4qNJ9ELNECVeApQ62d8HWGyWzLOXwO81awCoKkHA34Kz8jyP8fQE1lQiZDmLmZRnzoFfIZAAo84u2DlBQ8SrsQ== @@ -4489,6 +4482,16 @@ jest-diff@^25.1.0, jest-diff@^25.2.0: jest-get-type "^25.1.0" pretty-format "^25.2.0" +jest-diff@^25.2.1: + version "25.2.1" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-25.2.1.tgz#8c073596cc88356227c86a50d71a23d8a9dfa81a" + integrity sha512-e/TU8VLBBGQQS9tXA5B5LeT806jh7CHUeHbBfrU9UvA2zTbOTRz71UD6fAP1HAhzUEyCVLU2ZP5e8X16A9b0Fg== + dependencies: + chalk "^3.0.0" + diff-sequences "^25.2.1" + jest-get-type "^25.2.1" + pretty-format "^25.2.1" + jest-docblock@24.9.0: version "24.9.0" resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-24.9.0.tgz#7970201802ba560e1c4092cc25cbedf5af5a8ce2" @@ -4503,57 +4506,58 @@ jest-docblock@^25.2.0: dependencies: detect-newline "^3.0.0" -jest-each@^25.2.0: - version "25.2.0" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-25.2.0.tgz#745c60f5ada853e55af821e87d6f0ca0ad422d49" - integrity sha512-F8yllj7HhLvcvXO9FGmWm19S8N6ndGryx1INmyUVLduwph8nKos0vFTi0DzGC3QpCfyvlWIA/uCBry0zKbksNg== +jest-each@^25.2.1: + version "25.2.1" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-25.2.1.tgz#d96b4fc0c035fcddb852f19da42ea241b1943999" + integrity sha512-2vWAaf11IJsSwkEzGph3un4OMSG4v/3hpM2UqJdeU3peGUgUSn75TlXZGQnT0smbnAr4eE+URW1OpE8U9wl0TA== dependencies: - "@jest/types" "^25.2.0" + "@jest/types" "^25.2.1" chalk "^3.0.0" - jest-get-type "^25.1.0" - jest-util "^25.2.0" - pretty-format "^25.2.0" + jest-get-type "^25.2.1" + jest-util "^25.2.1" + pretty-format "^25.2.1" -jest-environment-jsdom@^25.2.0: - version "25.2.0" - resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-25.2.0.tgz#15b38b1ba30e22763f9b44e27d5865dfcd44b52e" - integrity sha512-ODoKx5G3KOlfyREL9ZqekChZFsOJzNtt3nsna0AeptWwEO+BYT0k0Gj89EkWNg7uwjVTomIlQpSeA45E9uTk1A== - dependencies: - "@jest/environment" "^25.2.0" - "@jest/fake-timers" "^25.2.0" - "@jest/types" "^25.2.0" - jest-mock "^25.2.0" - jest-util "^25.2.0" +jest-environment-jsdom@^25.2.1: + version "25.2.1" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-25.2.1.tgz#4f1da1bc46897c6ed818c850464b1114429e3ad5" + integrity sha512-bUhhhXtgrOgLhsFQFXgao8CQPYAEwtaVvhsF6O0A7Ie2uPONtAKCwuxyOM9WJaz9ag2ci5Pg7i2V2PRfGLl95w== + dependencies: + "@jest/environment" "^25.2.1" + "@jest/fake-timers" "^25.2.1" + "@jest/types" "^25.2.1" + jest-mock "^25.2.1" + jest-util "^25.2.1" jsdom "^15.2.1" -jest-environment-node@^25.2.0: - version "25.2.0" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-25.2.0.tgz#80726d398421368e90546e4c05b9dc1130f8c4fe" - integrity sha512-TP8kV360YWCbR96Kw2YQW8/SaF4jDcw5k2ImUvfmxXE8x2hqz6ARrj/2RE2Jstpn2RVihbyR45PBerg4yIvWPg== +jest-environment-node@^25.2.2: + version "25.2.2" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-25.2.2.tgz#a34e1018a7b032067f9ed675a6d0b033a67a5342" + integrity sha512-3V1zivv0EAu4xoeLaQVHjDrniAB4JU9iOUqpsUpJjL5P8zFuSxpGL9K0zBdnaZFVfQCWSa2pLbSfpWItcLPijQ== dependencies: - "@jest/environment" "^25.2.0" - "@jest/fake-timers" "^25.2.0" - "@jest/types" "^25.2.0" - jest-mock "^25.2.0" - jest-util "^25.2.0" + "@jest/environment" "^25.2.1" + "@jest/fake-timers" "^25.2.1" + "@jest/types" "^25.2.1" + jest-mock "^25.2.1" + jest-util "^25.2.1" + semver "^6.3.0" -jest-get-type@^25.1.0: - version "25.1.0" - resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-25.1.0.tgz#1cfe5fc34f148dc3a8a3b7275f6b9ce9e2e8a876" - integrity sha512-yWkBnT+5tMr8ANB6V+OjmrIJufHtCAqI5ic2H40v+tRqxDmE0PGnIiTyvRWFOMtmVHYpwRqyazDbTnhpjsGvLw== +jest-get-type@^25.1.0, jest-get-type@^25.2.1: + version "25.2.1" + resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-25.2.1.tgz#6c83de603c41b1627e6964da2f5454e6aa3c13a6" + integrity sha512-EYjTiqcDTCRJDcSNKbLTwn/LcDPEE7ITk8yRMNAOjEsN6yp+Uu+V1gx4djwnuj/DvWg0YGmqaBqPVGsPxlvE7w== -jest-haste-map@^25.2.0: - version "25.2.0" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-25.2.0.tgz#ad425ff825f3fb8777154f055c5a7d11b3c6e7d2" - integrity sha512-VeoodAL671sKKXDvaT2r1Z/0GSDWJi/fAcDGuRAHrRCqkrPnPsV0Uq35YTNO0RrMF8LdRRogu6Mie1Eli2CVLA== +jest-haste-map@^25.2.1: + version "25.2.1" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-25.2.1.tgz#61cbb3c99185b3551d63da9daedc5f64b9efe544" + integrity sha512-svz3KbQmv9qeomR0LlRjQfoi7lQbZQkC39m7uHFKhqyEuX4F6DH6HayNPSEbTCZDx6d9/ljxfAcxlPpgQvrpvQ== dependencies: - "@jest/types" "^25.2.0" + "@jest/types" "^25.2.1" anymatch "^3.0.3" fb-watchman "^2.0.0" graceful-fs "^4.2.3" - jest-serializer "^25.2.0" - jest-util "^25.2.0" - jest-worker "^25.2.0" + jest-serializer "^25.2.1" + jest-util "^25.2.1" + jest-worker "^25.2.1" micromatch "^4.0.2" sane "^4.0.3" walker "^1.0.7" @@ -4561,212 +4565,212 @@ jest-haste-map@^25.2.0: optionalDependencies: fsevents "^2.1.2" -jest-jasmine2@^25.2.0: - version "25.2.0" - resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-25.2.0.tgz#255026fd3beefd463c0b85d0ce7628a83a91e1f8" - integrity sha512-MWb5J32Ft/CsV8raj/DZrt3Yx/uJgODev0WFSiD0K3BA+Iowcds/+Z5m3Xv0SyV7P4jO1gJD7stUX9gEiJ1U/g== +jest-jasmine2@^25.2.2: + version "25.2.2" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-25.2.2.tgz#08ce8ba9a1c2445c7fd98d0be190848bd53dcf7f" + integrity sha512-lB/32iLzuupTlKUlZz1QxKILkMbAIL4iq4O0wjMH6FPBKnkf8YgdQchDQyIzK98xrdYF+DdvmsaS/m6bt+jSiA== dependencies: "@babel/traverse" "^7.1.0" - "@jest/environment" "^25.2.0" - "@jest/source-map" "^25.2.0" - "@jest/test-result" "^25.2.0" - "@jest/types" "^25.2.0" + "@jest/environment" "^25.2.1" + "@jest/source-map" "^25.2.1" + "@jest/test-result" "^25.2.1" + "@jest/types" "^25.2.1" chalk "^3.0.0" co "^4.6.0" - expect "^25.2.0" + expect "^25.2.1" is-generator-fn "^2.0.0" - jest-each "^25.2.0" - jest-matcher-utils "^25.2.0" - jest-message-util "^25.2.0" - jest-runtime "^25.2.0" - jest-snapshot "^25.2.0" - jest-util "^25.2.0" - pretty-format "^25.2.0" + jest-each "^25.2.1" + jest-matcher-utils "^25.2.1" + jest-message-util "^25.2.1" + jest-runtime "^25.2.2" + jest-snapshot "^25.2.1" + jest-util "^25.2.1" + pretty-format "^25.2.1" throat "^5.0.0" -jest-leak-detector@^25.2.0: - version "25.2.0" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-25.2.0.tgz#0106b59877e79f180642e047ae24897f2b8fdb12" - integrity sha512-q9T+0roWegOMjoeGO4uxmnBSqvm33CXq6H+Eu2YmJxvUOiuVhfqMKekZqQS8SRxBiPZHXqEPVHgM3tDtWz0qIg== +jest-leak-detector@^25.2.1: + version "25.2.1" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-25.2.1.tgz#77c55c59c32de9600f6bd9aab9540538b541b253" + integrity sha512-bsxjjFksjLWNqC8aLsN0KO2KQ3tiqPqmFpYt+0y4RLHc1dqaThQL68jra5y1f/yhX3dNC8ugksDvqnGxwxjo4w== dependencies: - jest-get-type "^25.1.0" - pretty-format "^25.2.0" + jest-get-type "^25.2.1" + pretty-format "^25.2.1" -jest-matcher-utils@^25.2.0: - version "25.2.0" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-25.2.0.tgz#d61f725b14f46e9eaf1b335324ecdf0b28845124" - integrity sha512-8E2ggFOJ5h1DPUqAswp78rasfqPap2Iryt06wtwrYXNJrbX0R5pi76eYdduSpPXn1atIbK+uxeJNmqYXLpddog== +jest-matcher-utils@^25.2.1: + version "25.2.1" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-25.2.1.tgz#67da3d3aea74b4de6da990b636d7baebfebac0e4" + integrity sha512-uuoYY8W6eeVxHUEOvrKIVVTl9X6RP+ohQn2Ta2W8OOLMN6oA8pZUKQEPGxLsSqB3RKfpTueurMLrxDTEZGllsA== dependencies: chalk "^3.0.0" - jest-diff "^25.2.0" - jest-get-type "^25.1.0" - pretty-format "^25.2.0" + jest-diff "^25.2.1" + jest-get-type "^25.2.1" + pretty-format "^25.2.1" -jest-message-util@^25.2.0: - version "25.2.0" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-25.2.0.tgz#acafbc2343421bc1d157d7dfff86a1defdb9efdd" - integrity sha512-M0cFd+XU+G1MWB7M3BWM2Dejln4Uzub+P8+pCPZKfo8cBwGH1kZTgsXchV2MgOmhj2QQGKVwsuPqkLb0hhmiiw== +jest-message-util@^25.2.1: + version "25.2.1" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-25.2.1.tgz#43fb5f239954a28954e74dfea0b75efc4e7377fb" + integrity sha512-pxwehr9uPEuCI9bPjBiZxpFMN0+3wny5p7/E3hbV9XjsqREhJJAMf0czvHtgNeUBo2iAiAI9yi9ICKHPOKePEw== dependencies: "@babel/code-frame" "^7.0.0" - "@jest/test-result" "^25.2.0" - "@jest/types" "^25.2.0" + "@jest/test-result" "^25.2.1" + "@jest/types" "^25.2.1" "@types/stack-utils" "^1.0.1" chalk "^3.0.0" micromatch "^4.0.2" slash "^3.0.0" stack-utils "^1.0.1" -jest-mock@^25.2.0: - version "25.2.0" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-25.2.0.tgz#494f750595ef1539e49d1546fb20520180acb3b8" - integrity sha512-nnYlMdySmipWkTIqQprLDY9zXDSi9kkQdiDVnlga5+rygQ0ORhljIkGbx3+qH9Nhh5kXDu8ae2otIK0ptY4aWw== +jest-mock@^25.2.1: + version "25.2.1" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-25.2.1.tgz#37b294b8d0aa94c1af7714e039cc410df61593da" + integrity sha512-ZXcmqpCTG1MEm2AP2q9XiJzdbQ655Pnssj+xQMP1thrW2ptEFrd4vSkxTpxk6rnluLPRKagaHmzUpWNxShMvqQ== dependencies: - "@jest/types" "^25.2.0" + "@jest/types" "^25.2.1" jest-pnp-resolver@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/jest-pnp-resolver/-/jest-pnp-resolver-1.2.1.tgz#ecdae604c077a7fbc70defb6d517c3c1c898923a" integrity sha512-pgFw2tm54fzgYvc/OHrnysABEObZCUNFnhjoRjaVOCN8NYc032/gVjPaHD4Aq6ApkSieWtfKAFQtmDKAmhupnQ== -jest-regex-util@^25.2.0: - version "25.2.0" - resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-25.2.0.tgz#1386764a0f57b79a3d930b628ca83696c0ac142f" - integrity sha512-D85pUKyzdi4zFAnub4EDp48eB08oua2aaN8wPrcaL98SnmJmJCSC+8iMZvonyy8qTtXgElK8JcsdPl4Y8+WhGg== +jest-regex-util@^25.2.1: + version "25.2.1" + resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-25.2.1.tgz#db64b0d15cd3642c93b7b9627801d7c518600584" + integrity sha512-wroFVJw62LdqTdkL508ZLV82FrJJWVJMIuYG7q4Uunl1WAPTf4ftPKrqqfec4SvOIlvRZUdEX2TFpWR356YG/w== -jest-resolve-dependencies@^25.2.0: - version "25.2.0" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-25.2.0.tgz#dc89deefe635b1e08f11519fb3e7ea9e257af55e" - integrity sha512-hwPhteqTnlZyC19qQWBFaLW9+IqCyjmajb5nHqTEi+Jsn+Y74xrugBW0NlkFyCFsP7Chq+MjfU6z/wMGZJelbQ== +jest-resolve-dependencies@^25.2.2: + version "25.2.2" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-25.2.2.tgz#6643fd4ce4e486844ac0f88bec9963bdb2bbbea4" + integrity sha512-XeBlobvYexxYOUC6PAuISJ3sUeylLEXYmvA1VT1+q3b2m+1tGPxqrZGVOxKgbE7a+L0YfuCq+JVYWzxlNm6zQQ== dependencies: - "@jest/types" "^25.2.0" - jest-regex-util "^25.2.0" - jest-snapshot "^25.2.0" + "@jest/types" "^25.2.1" + jest-regex-util "^25.2.1" + jest-snapshot "^25.2.1" -jest-resolve@^25.2.0: - version "25.2.0" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-25.2.0.tgz#b1f5cc1ca1a67a215b9f425003eeabf5e60e98ad" - integrity sha512-VvmYRMDBFjKUri59zVa91s3V22XfON05oBIl+iNIktxOHxir0ui52+wVTBFGK19p2/aX0UzjKHkW/wJY1cELAw== +jest-resolve@^25.2.1: + version "25.2.1" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-25.2.1.tgz#44f8f87c5688bad31e762f123540b09cac5907f8" + integrity sha512-5rVc6khEckNH62adcR+jlYd34/jBO/U22VHf+elmyO6UBHNWXSbfy63+spJRN4GQ/0dbu6Hi6ZVdR58bmNG2Eg== dependencies: - "@jest/types" "^25.2.0" + "@jest/types" "^25.2.1" browser-resolve "^1.11.3" chalk "^3.0.0" jest-pnp-resolver "^1.2.1" realpath-native "^2.0.0" resolve "^1.15.1" -jest-runner@^25.2.0: - version "25.2.0" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-25.2.0.tgz#f3fcfc57cd6fb0b848896ce309a57723d665acaf" - integrity sha512-x2QqSL2lGYkFLruD/5kGvSBpus5VoP464lkxwrmipKsu+hV3E1bhLuSi0vxM2WSQDCRGC0bzwkwo5LoT5NralA== +jest-runner@^25.2.2: + version "25.2.2" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-25.2.2.tgz#6dfa528a180a19af45d8038c2727ad4a58b81213" + integrity sha512-U0UACNQK3WovPpNvOsf57qfk815ZfMAq2oH3kQUTZEY7L07nVnY9tVmDvI1RBh1JtkNBqUCSoqYjlTpiBhhghQ== dependencies: - "@jest/console" "^25.2.0" - "@jest/environment" "^25.2.0" - "@jest/test-result" "^25.2.0" - "@jest/types" "^25.2.0" + "@jest/console" "^25.2.1" + "@jest/environment" "^25.2.1" + "@jest/test-result" "^25.2.1" + "@jest/types" "^25.2.1" chalk "^3.0.0" exit "^0.1.2" graceful-fs "^4.2.3" - jest-config "^25.2.0" + jest-config "^25.2.2" jest-docblock "^25.2.0" - jest-haste-map "^25.2.0" - jest-jasmine2 "^25.2.0" - jest-leak-detector "^25.2.0" - jest-message-util "^25.2.0" - jest-resolve "^25.2.0" - jest-runtime "^25.2.0" - jest-util "^25.2.0" - jest-worker "^25.2.0" + jest-haste-map "^25.2.1" + jest-jasmine2 "^25.2.2" + jest-leak-detector "^25.2.1" + jest-message-util "^25.2.1" + jest-resolve "^25.2.1" + jest-runtime "^25.2.2" + jest-util "^25.2.1" + jest-worker "^25.2.1" source-map-support "^0.5.6" throat "^5.0.0" -jest-runtime@^25.2.0: - version "25.2.0" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-25.2.0.tgz#8bff94eeb1d74c8807dc8080ab669b5b5ec69575" - integrity sha512-1FW9GrsYk5nfoD+ngICFu4Q2VglQyjg73/BixZkHwxSFIU5OKPrwBIL33lBFtRC/dwpn/rZDxmkxmqOH7jRGyg== - dependencies: - "@jest/console" "^25.2.0" - "@jest/environment" "^25.2.0" - "@jest/source-map" "^25.2.0" - "@jest/test-result" "^25.2.0" - "@jest/transform" "^25.2.0" - "@jest/types" "^25.2.0" +jest-runtime@^25.2.2: + version "25.2.2" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-25.2.2.tgz#6ffbcdc67a3488f1ccb1dba1277ab671e96f5226" + integrity sha512-k0LgYDw8nDOGJRPhFlsitzqOxkDGxyVQQG1O39ToHsuApVkZHguYEw4tNXU8Pc4GdU9/ua9ke6nUjHNiByE8bg== + dependencies: + "@jest/console" "^25.2.1" + "@jest/environment" "^25.2.1" + "@jest/source-map" "^25.2.1" + "@jest/test-result" "^25.2.1" + "@jest/transform" "^25.2.1" + "@jest/types" "^25.2.1" "@types/yargs" "^15.0.0" chalk "^3.0.0" collect-v8-coverage "^1.0.0" exit "^0.1.2" glob "^7.1.3" graceful-fs "^4.2.3" - jest-config "^25.2.0" - jest-haste-map "^25.2.0" - jest-message-util "^25.2.0" - jest-mock "^25.2.0" - jest-regex-util "^25.2.0" - jest-resolve "^25.2.0" - jest-snapshot "^25.2.0" - jest-util "^25.2.0" - jest-validate "^25.2.0" + jest-config "^25.2.2" + jest-haste-map "^25.2.1" + jest-message-util "^25.2.1" + jest-mock "^25.2.1" + jest-regex-util "^25.2.1" + jest-resolve "^25.2.1" + jest-snapshot "^25.2.1" + jest-util "^25.2.1" + jest-validate "^25.2.1" realpath-native "^2.0.0" slash "^3.0.0" strip-bom "^4.0.0" yargs "^15.3.1" -jest-serializer@^25.2.0: - version "25.2.0" - resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-25.2.0.tgz#fd81440a0bd52f3c182ecabc2426c8efb4c0cf41" - integrity sha512-wCaA4dM1F4klHEpjRzAnv/8K4eqvB/0x4f6AA4W8ie8DP2XarCt6yAsdRCE+zw+htZSwcNOWvYvpOVov8y8pJA== +jest-serializer@^25.2.1: + version "25.2.1" + resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-25.2.1.tgz#51727a5fc04256f461abe0fa024a022ba165877a" + integrity sha512-fibDi7M5ffx6c/P66IkvR4FKkjG5ldePAK1WlbNoaU4GZmIAkS9Le/frAwRUFEX0KdnisSPWf+b1RC5jU7EYJQ== -jest-snapshot@^25.2.0: - version "25.2.0" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-25.2.0.tgz#2d852cce911ee93c801b2137d7e5e71ae43d57f7" - integrity sha512-oOVNsWwXWW5U6SozenTFkPTJdTkIudc5H2zpT4l8MA++HVU0pwNGKSZq0otbjaMUCs1ZE1PI/TfjaSKKg6fqNg== +jest-snapshot@^25.2.1: + version "25.2.1" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-25.2.1.tgz#1fdcc8c780f83f0e902dd75df79d0d7313fe939e" + integrity sha512-5Wd8SEJVTXqQvzkQpuYqQt1QTlRj2XVUV/iaEzO+AeSVg6g5pQWu0z2iLdSBlVeWRrX0MyZn6dhxYGwEq4wW0w== dependencies: "@babel/types" "^7.0.0" - "@jest/types" "^25.2.0" + "@jest/types" "^25.2.1" "@types/prettier" "^1.19.0" chalk "^3.0.0" - expect "^25.2.0" - jest-diff "^25.2.0" - jest-get-type "^25.1.0" - jest-matcher-utils "^25.2.0" - jest-message-util "^25.2.0" - jest-resolve "^25.2.0" + expect "^25.2.1" + jest-diff "^25.2.1" + jest-get-type "^25.2.1" + jest-matcher-utils "^25.2.1" + jest-message-util "^25.2.1" + jest-resolve "^25.2.1" make-dir "^3.0.0" natural-compare "^1.4.0" - pretty-format "^25.2.0" + pretty-format "^25.2.1" semver "^6.3.0" -jest-util@^25.2.0: - version "25.2.0" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-25.2.0.tgz#56aa5e3fc4ba3510849c805f362bd8f18959c0c5" - integrity sha512-xdpHSYUdqQy6JO52AQR02Z7QnaeRCXFqpuXm2gDvCYarXyodAcOs8J330OTNheHNpQz1fLkB09g8hW5fkZgvYg== +jest-util@^25.2.1: + version "25.2.1" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-25.2.1.tgz#96086efe850ce6d07c42ad5324b80a3ede4246e6" + integrity sha512-oFVMSY/7flrSgEE/B+RApaBZOdLURXRnXCf4COV5td9uRidxudyjA64I1xk2h9Pf3jloSArm96e2FKAbFs0DYg== dependencies: - "@jest/types" "^25.2.0" + "@jest/types" "^25.2.1" chalk "^3.0.0" is-ci "^2.0.0" make-dir "^3.0.0" -jest-validate@^25.2.0: - version "25.2.0" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-25.2.0.tgz#2ea5ec81b0c4dec5454bcc4834c68f60c42a9b8c" - integrity sha512-FcueQUXWhnD45DJFhDux3FQDrXcLLFvPU6mNQimu1FCOblWxiqDPc9GzRc8dvvU5U8F+j6ohtd+vH/BkjZ1M/g== +jest-validate@^25.2.1: + version "25.2.1" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-25.2.1.tgz#a07a4e6697fc58e6ea31c03de541af4d0a475fbc" + integrity sha512-vGtNFPyvylFfTFFfptzqCy5S3cP/N5JJVwm8gsXeZq8jMmvUngfWtuw+Tr5Wjo+dqOle23td8BE0ruGnsONDmw== dependencies: - "@jest/types" "^25.2.0" + "@jest/types" "^25.2.1" camelcase "^5.3.1" chalk "^3.0.0" - jest-get-type "^25.1.0" + jest-get-type "^25.2.1" leven "^3.1.0" - pretty-format "^25.2.0" + pretty-format "^25.2.1" -jest-watcher@^25.2.0: - version "25.2.0" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-25.2.0.tgz#5cb37355602b743eda565227ce2252bdc0ce92ee" - integrity sha512-jfUrHJfr4OEhJ0oGOqzH5yAXsUrtFWPalV2o6EI72T3Kp/mY3roUj/8RMmi7md/fL2GJ1BbcWzsQuaXuDRhJ0A== +jest-watcher@^25.2.1: + version "25.2.1" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-25.2.1.tgz#605aeef37ee4ce867f2f58485fdb9eea0f8cb369" + integrity sha512-m35rftCYE2EEh01+IIpQMpdB9VXBAjITZvgP4drd/LI3JEJIdd0Pkf/qJZ3oiMQJdqmuwYcTqE+BL40MxVv83Q== dependencies: - "@jest/test-result" "^25.2.0" - "@jest/types" "^25.2.0" + "@jest/test-result" "^25.2.1" + "@jest/types" "^25.2.1" ansi-escapes "^4.2.1" chalk "^3.0.0" - jest-util "^25.2.0" + jest-util "^25.2.1" string-length "^3.1.0" jest-worker@^24.9.0: @@ -4777,27 +4781,22 @@ jest-worker@^24.9.0: merge-stream "^2.0.0" supports-color "^6.1.0" -jest-worker@^25.2.0: - version "25.2.0" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-25.2.0.tgz#2716fbf74fcae7d713778f60187fd1f96fa09d1a" - integrity sha512-oGzUBnVnRdb51Aru3XFNa0zOafAIEerqZoQow+Vy8LDDiy12dvSrOeVeO8oNrxCMkGG4JtXqX9IPC93JJiAk+g== +jest-worker@^25.2.1: + version "25.2.1" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-25.2.1.tgz#209617015c768652646aa33a7828cc2ab472a18a" + integrity sha512-IHnpekk8H/hCUbBlfeaPZzU6v75bqwJp3n4dUrQuQOAgOneI4tx3jV2o8pvlXnDfcRsfkFIUD//HWXpCmR+evQ== dependencies: merge-stream "^2.0.0" supports-color "^7.0.0" jest@^25.2.0: - version "25.2.0" - resolved "https://registry.yarnpkg.com/jest/-/jest-25.2.0.tgz#d7b9b9ce7007002a9b4586da9bf0e0414a10a27d" - integrity sha512-6vlNxNhkZZcFBpn6GkVHyEQZKE9zAsnYithlHAnkVLJYFdD6o4dV2S7uTFcxi6k9XEEN2ilVLuTe6PJ1qgbi4w== + version "25.2.2" + resolved "https://registry.yarnpkg.com/jest/-/jest-25.2.2.tgz#6191d2a97ec5d0c1d14e9b2ed13cf6702aa2d4fc" + integrity sha512-ap4gCAuRGuE2gBh2AD18zFpcHzqkAWHDU12sk66GjYxKJDXn11Djgh9dCE4HXJbtQ+C6Gurc+EcqOWO9YcPbzA== dependencies: - "@jest/core" "^25.2.0" + "@jest/core" "^25.2.2" import-local "^3.0.2" - jest-cli "^25.2.0" - -jquery@^3.4.1: - version "3.4.1" - resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.4.1.tgz#714f1f8d9dde4bdfa55764ba37ef214630d80ef2" - integrity sha512-36+AdBzCL+y6qjw5Tx7HgzeGCzC81MDDgaUP8ld2zhx58HdqXGoBd+tHdrBMiyjGQs0Hxs/MLZTu/eHNJJuWPw== + jest-cli "^25.2.2" js-base64@^2.1.9: version "2.5.2" @@ -5381,10 +5380,10 @@ markdown-escapes@^1.0.0: resolved "https://registry.yarnpkg.com/markdown-escapes/-/markdown-escapes-1.0.4.tgz#c95415ef451499d7602b91095f3c8e8975f78535" integrity sha512-8z4efJYk43E0upd0NbVXwgSTQs6cT3T06etieCMEg7dRbzCbxUCK/GHlX8mhHRDcp+OLlHkPKsvqQTCvsRl2cg== -marked@^0.8.0: - version "0.8.2" - resolved "https://registry.yarnpkg.com/marked/-/marked-0.8.2.tgz#4faad28d26ede351a7a1aaa5fec67915c869e355" - integrity sha512-EGwzEeCcLniFX51DhTpmTom+dSA/MG/OBUDjnWtHbEnjAH180VzUeAw+oE4+Zv+CoYBWyRlYOTR0N8SO9R1PVw== +marked@0.8.0: + version "0.8.0" + resolved "https://registry.yarnpkg.com/marked/-/marked-0.8.0.tgz#ec5c0c9b93878dc52dd54be8d0e524097bd81a99" + integrity sha512-MyUe+T/Pw4TZufHkzAfDj6HarCBWia2y27/bhuYkTaiUnfDYFnCP3KUN+9oM7Wi6JA2rymtVYbQu3spE0GCmxQ== mem@5.1.1: version "5.1.1" @@ -6301,7 +6300,7 @@ prettierx@0.11.0: vnopts "1.0.2" yaml-unist-parser "1.1.1" -pretty-format@^25.1.0, pretty-format@^25.2.0: +pretty-format@^25.1.0: version "25.2.0" resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-25.2.0.tgz#645003fb5da71a0ded46c90007dff0e03857de7d" integrity sha512-BzmuH01b/lm0nl3M7Lcnku9Cv2UNMk9FgIrAiSuIus2QrjzV7Lf2DW+88SgEQUXQNkYWGtBV1289AuF6yMCtCQ== @@ -6311,6 +6310,16 @@ pretty-format@^25.1.0, pretty-format@^25.2.0: ansi-styles "^4.0.0" react-is "^16.12.0" +pretty-format@^25.2.0, pretty-format@^25.2.1: + version "25.2.1" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-25.2.1.tgz#3b8f7b9241faa6736cdbc32879bee18454d1318d" + integrity sha512-YS+e9oGYIbEeAFgqTU8qeZ3DN2Pz0iaD81ox+iUjLIXVJWeB7Ro/2AnfxRnl/yJJ5R674d7E3jLPuh6bwg0+qw== + dependencies: + "@jest/types" "^25.2.1" + ansi-regex "^5.0.0" + ansi-styles "^4.0.0" + react-is "^16.12.0" + private@^0.1.6: version "0.1.8" resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff" @@ -7771,37 +7780,27 @@ typedarray-to-buffer@^3.1.5: dependencies: is-typedarray "^1.0.0" -typedoc-default-themes@^0.7.2: - version "0.7.2" - resolved "https://registry.yarnpkg.com/typedoc-default-themes/-/typedoc-default-themes-0.7.2.tgz#1e9896f920b58e6da0bba9d7e643738d02405a5a" - integrity sha512-fiFKlFO6VTqjcno8w6WpTsbCgXmfPHVjnLfYkmByZE7moaz+E2DSpAT+oHtDHv7E0BM5kAhPrHJELP2J2Y2T9A== +typedoc-default-themes@^0.9.0: + version "0.9.0" + resolved "https://registry.yarnpkg.com/typedoc-default-themes/-/typedoc-default-themes-0.9.0.tgz#170132ddcdfb10823a0b006b0e084ebd4acb540c" + integrity sha512-ExfIAg3EjZvWnnDsv2wQcZ9I8Lnln643LsfV05BrRGcIMSYPuavils96j4yGXiBYUzldIYw3xmZ7rsdqWfDunQ== dependencies: - backbone "^1.4.0" - jquery "^3.4.1" lunr "^2.3.8" - underscore "^1.9.1" -typedoc@^0.16.7: - version "0.16.11" - resolved "https://registry.yarnpkg.com/typedoc/-/typedoc-0.16.11.tgz#95f862c6eba78533edc9af7096d2295b718eddc1" - integrity sha512-YEa5i0/n0yYmLJISJ5+po6seYfJQJ5lQYcHCPF9ffTF92DB/TAZO/QrazX5skPHNPtmlIht5FdTXCM2kC7jQFQ== +typedoc@^0.17.3: + version "0.17.3" + resolved "https://registry.yarnpkg.com/typedoc/-/typedoc-0.17.3.tgz#cd5b598f851a41a90d82b7651da35e62cf4fa0e4" + integrity sha512-sCKyLeXMUYHyul0kd/jSGSGY+o7lfLvbNlnp8kAamQSLPp/f4EOOR50JGjwfYEQkEeETWMXILdU4UUXS42MmSQ== dependencies: - "@types/minimatch" "3.0.3" fs-extra "^8.1.0" - handlebars "^4.7.2" - highlight.js "^9.17.1" + handlebars "^4.7.3" + highlight.js "^9.18.1" lodash "^4.17.15" - marked "^0.8.0" + marked "0.8.0" minimatch "^3.0.0" progress "^2.0.3" shelljs "^0.8.3" - typedoc-default-themes "^0.7.2" - typescript "3.7.x" - -typescript@3.7.x: - version "3.7.5" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.7.5.tgz#0692e21f65fd4108b9330238aac11dd2e177a1ae" - integrity sha512-/P5lkRXkWHNAbcJIiHPfRoKqyd7bsyCma1hZNUGfn20qm64T6ZBlrzprymeu918H+mB/0rIg2gGK/BXkhhYgBw== + typedoc-default-themes "^0.9.0" typescript@^3.0.3: version "3.8.3" @@ -7816,11 +7815,6 @@ uglify-js@^3.1.4: commander "~2.20.3" source-map "~0.6.1" -underscore@>=1.8.3, underscore@^1.9.1: - version "1.9.2" - resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.9.2.tgz#0c8d6f536d6f378a5af264a72f7bec50feb7cf2f" - integrity sha512-D39qtimx0c1fI3ya1Lnhk3E9nONswSKhnffBI0gME9C99fYOkNi04xs8K6pePLhvl1frbDemkaBQ5ikWllR2HQ== - unherit@^1.0.4: version "1.1.3" resolved "https://registry.yarnpkg.com/unherit/-/unherit-1.1.3.tgz#6c9b503f2b41b262330c80e91c8614abdaa69c22" @@ -8322,9 +8316,9 @@ yargs-parser@^16.1.0: decamelize "^1.2.0" yargs-parser@^18.1.1: - version "18.1.1" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-18.1.1.tgz#bf7407b915427fc760fcbbccc6c82b4f0ffcbd37" - integrity sha512-KRHEsOM16IX7XuLnMOqImcPNbLVXMNHYAoFc3BKR8Ortl5gzDbtXvvEoGx9imk5E+X1VeNKNlcHr8B8vi+7ipA== + version "18.1.2" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-18.1.2.tgz#2f482bea2136dbde0861683abea7756d30b504f1" + integrity sha512-hlIPNR3IzC1YuL1c2UwwDKpXlNFBqD1Fswwh1khz5+d8Cq/8yc/Mn0i+rQXduu8hcrFKvO7Eryk+09NecTQAAQ== dependencies: camelcase "^5.0.0" decamelize "^1.2.0"