Comparing version 1.0.8 to 1.0.9
@@ -281,3 +281,3 @@ (function (f) { | ||
* @param {string} pPattern - The string to add to the tree | ||
* @param {number} pIndex - callback function | ||
* @param {number} pIndex - The index of the character in the pattern | ||
* @returns {Object} The resulting leaf node that was added (or found) | ||
@@ -287,3 +287,2 @@ * @private | ||
addChild(pTree, pPattern, pIndex) { | ||
if (pIndex > pPattern.length) return pTree; | ||
if (!pTree.hasOwnProperty(pPattern[pIndex])) pTree[pPattern[pIndex]] = {}; | ||
@@ -295,5 +294,5 @@ return pTree[pPattern[pIndex]]; | ||
* @method addPattern | ||
* @param {Object} pTree - A node on the parse tree to push the characters into | ||
* @param {string} pPattern - The string to add to the tree | ||
* @param {number} pIndex - callback function | ||
* @param {Object} pPatternStart - The starting string for the pattern (e.g. "${") | ||
* @param {string} pPatternEnd - The ending string for the pattern (e.g. "}") | ||
* @param {number} pParser - The function to parse if this is the matched pattern, once the Pattern End is met. If this is a string, a simple replacement occurs. | ||
* @return {bool} True if adding the pattern was successful | ||
@@ -303,2 +302,3 @@ */ | ||
if (pPatternStart.length < 1) return false; | ||
if (typeof pPatternEnd === 'string' && pPatternEnd.length < 1) return false; | ||
let tmpLeaf = this.ParseTree; | ||
@@ -305,0 +305,0 @@ |
@@ -38,3 +38,3 @@ !function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Precedent=t()}}((function(){return function t(e,r,n){function a(s,f){if(!r[s]){if(!e[s]){var o="function"==typeof require&&require;if(!f&&o)return o(s,!0);if(u)return u(s,!0);var i=new Error("Cannot find module '"+s+"'");throw i.code="MODULE_NOT_FOUND",i}var P=r[s]={exports:{}};e[s][0].call(P.exports,(function(t){return a(e[s][1][t]||t)}),P,P.exports,t,e,r,n)}return r[s].exports}for(var u="function"==typeof require&&require,s=0;s<n.length;s++)a(n[s]);return a}({1:[function(t,e,r){ | ||
*/ | ||
class{constructor(){this.ParseTree={}}addChild(t,e,r){return r>e.length?t:(t.hasOwnProperty(e[r])||(t[e[r]]={}),t[e[r]])}addPattern(t,e,r){if(t.length<1)return!1;let n=this.ParseTree;for(var a=0;a<t.length;a++)n=this.addChild(n,t,a);return n.PatternStart=t,n.PatternEnd="string"==typeof e&&e.length>0?e:t,n.Parse="function"==typeof r?r:"string"==typeof r?()=>r:t=>t,!0}}},{}]},{},[1])(1)})); | ||
class{constructor(){this.ParseTree={}}addChild(t,e,r){return t.hasOwnProperty(e[r])||(t[e[r]]={}),t[e[r]]}addPattern(t,e,r){if(t.length<1)return!1;if("string"==typeof e&&e.length<1)return!1;let n=this.ParseTree;for(var a=0;a<t.length;a++)n=this.addChild(n,t,a);return n.PatternStart=t,n.PatternEnd="string"==typeof e&&e.length>0?e:t,n.Parse="function"==typeof r?r:"string"==typeof r?()=>r:t=>t,!0}}},{}]},{},[1])(1)})); | ||
//# sourceMappingURL=precedent.min.js.map |
{ | ||
"name": "precedent", | ||
"version": "1.0.8", | ||
"version": "1.0.9", | ||
"description": "Precedent Meta-Templating", | ||
@@ -5,0 +5,0 @@ "main": "source/Precedent.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
73864
0