Comparing version 3.0.0 to 3.0.1
@@ -1,2 +0,2 @@ | ||
declare class Gex { | ||
declare class Gexer { | ||
gexmap: { | ||
@@ -17,5 +17,3 @@ [key: string]: RegExp; | ||
} | ||
declare function gex(gexspec: string | string[]): Gex; | ||
declare namespace gex { | ||
var Gex: typeof globalThis.Gex; | ||
} | ||
declare function Gex(gexspec: string | string[]): Gexer; | ||
export { Gex }; |
@@ -0,3 +1,6 @@ | ||
"use strict"; | ||
/* Copyright (c) 2011-2020 Richard Rodger, MIT License */ | ||
class Gex { | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Gex = void 0; | ||
class Gexer { | ||
constructor(gexspec) { | ||
@@ -88,3 +91,3 @@ this.desc = ''; | ||
let d = this.desc; | ||
return '' != d ? d : (this.desc = 'gex[' + Object.keys(this.gexmap) + ']'); | ||
return '' != d ? d : (this.desc = 'Gex[' + Object.keys(this.gexmap) + ']'); | ||
} | ||
@@ -95,7 +98,6 @@ inspect() { | ||
} | ||
module.exports = gex; | ||
function gex(gexspec) { | ||
return new Gex(gexspec); | ||
function Gex(gexspec) { | ||
return new Gexer(gexspec); | ||
} | ||
gex.Gex = Gex; | ||
exports.Gex = Gex; | ||
//# sourceMappingURL=gex.js.map |
@@ -1,1 +0,1 @@ | ||
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Gex=e()}}((function(){var e;class t{constructor(e){this.desc="",this.gexmap={},(Array.isArray(e)?e:[e]).forEach(e=>{this.gexmap[e]=this.re(this.clean(e))})}dodgy(e){return null==e||Number.isNaN(e)}clean(e){let t=""+e;return this.dodgy(e)?"":t}match(e){e=""+e;let t=!1,r=Object.keys(this.gexmap);for(let n=0;n<r.length&&!t;n++)t=!!this.gexmap[r[n]].exec(e);return t}on(e){if(null==e)return null;let t=typeof e;if("string"===t||"number"===t||"boolean"===t||e instanceof Date||e instanceof RegExp)return this.match(e)?e:null;if(Array.isArray(e)){let t=[];for(let r=0;r<e.length;r++)!this.dodgy(e[r])&&this.match(e[r])&&t.push(e[r]);return t}{let t={};for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&this.match(r)&&(t[r]=e[r]);return t}}esc(e){let t=this.clean(e);return(t=t.replace(/\*/g,"**")).replace(/\?/g,"*?")}escregexp(e){return e?(""+e).replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"):""}re(e){if(""===e||e)return e="^"+(e=(e=(e=(e=(e=this.escregexp(e)).replace(/\\\*/g,"[\\s\\S]*")).replace(/\\\?/g,"[\\s\\S]")).replace(/\[\\s\\S\]\*\[\\s\\S\]\*/g,"\\*")).replace(/\[\\s\\S\]\*\[\\s\\S\]/g,"\\?"))+"$",new RegExp(e);{let e=Object.keys(this.gexmap);return 1==e.length?this.gexmap[e[0]]:{...this.gexmap}}}toString(){let e=this.desc;return""!=e?e:this.desc="gex["+Object.keys(this.gexmap)+"]"}inspect(){return this.toString()}}function r(e){return new t(e)}return e=r,r.Gex=t,e})); | ||
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Gex=e()}}((function(){var e={};Object.defineProperty(e,"__esModule",{value:!0}),e.Gex=void 0;class t{constructor(e){this.desc="",this.gexmap={},(Array.isArray(e)?e:[e]).forEach(e=>{this.gexmap[e]=this.re(this.clean(e))})}dodgy(e){return null==e||Number.isNaN(e)}clean(e){let t=""+e;return this.dodgy(e)?"":t}match(e){e=""+e;let t=!1,r=Object.keys(this.gexmap);for(let n=0;n<r.length&&!t;n++)t=!!this.gexmap[r[n]].exec(e);return t}on(e){if(null==e)return null;let t=typeof e;if("string"===t||"number"===t||"boolean"===t||e instanceof Date||e instanceof RegExp)return this.match(e)?e:null;if(Array.isArray(e)){let t=[];for(let r=0;r<e.length;r++)!this.dodgy(e[r])&&this.match(e[r])&&t.push(e[r]);return t}{let t={};for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&this.match(r)&&(t[r]=e[r]);return t}}esc(e){let t=this.clean(e);return(t=t.replace(/\*/g,"**")).replace(/\?/g,"*?")}escregexp(e){return e?(""+e).replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"):""}re(e){if(""===e||e)return e="^"+(e=(e=(e=(e=(e=this.escregexp(e)).replace(/\\\*/g,"[\\s\\S]*")).replace(/\\\?/g,"[\\s\\S]")).replace(/\[\\s\\S\]\*\[\\s\\S\]\*/g,"\\*")).replace(/\[\\s\\S\]\*\[\\s\\S\]/g,"\\?"))+"$",new RegExp(e);{let e=Object.keys(this.gexmap);return 1==e.length?this.gexmap[e[0]]:{...this.gexmap}}}toString(){let e=this.desc;return""!=e?e:this.desc="Gex["+Object.keys(this.gexmap)+"]"}inspect(){return this.toString()}}return e.Gex=function(e){return new t(e)},e})); |
12
gex.ts
/* Copyright (c) 2011-2020 Richard Rodger, MIT License */ | ||
class Gex { | ||
class Gexer { | ||
gexmap: { [key: string]: RegExp } | ||
@@ -106,3 +106,3 @@ desc: string = '' | ||
let d = this.desc | ||
return '' != d ? d : (this.desc = 'gex[' + Object.keys(this.gexmap) + ']') | ||
return '' != d ? d : (this.desc = 'Gex[' + Object.keys(this.gexmap) + ']') | ||
} | ||
@@ -115,8 +115,6 @@ | ||
module.exports = gex | ||
function gex(gexspec: string | string[]): Gex { | ||
return new Gex(gexspec) | ||
function Gex(gexspec: string | string[]): Gexer { | ||
return new Gexer(gexspec) | ||
} | ||
gex.Gex = Gex | ||
export { Gex } |
{ | ||
"name": "gex", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"main": "dist/gex.js", | ||
@@ -5,0 +5,0 @@ "browser": "dist/gex.min.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
18331
0
215