@anolilab/blitz-webpack-utils
Advanced tools
Comparing version 1.0.3 to 1.0.4
@@ -0,1 +1,8 @@ | ||
### [1.0.4](https://github.com/anolilab/blitz-webpack-utils/compare/v1.0.3...v1.0.4) (2021-09-02) | ||
### Bug Fixes | ||
* fixed regex pattern ([860d4e2](https://github.com/anolilab/blitz-webpack-utils/commit/860d4e2aeee401b346af52a1aaf7b3fa27ea3b9a)) | ||
### [1.0.3](https://github.com/anolilab/blitz-webpack-utils/compare/v1.0.2...v1.0.3) (2021-09-02) | ||
@@ -2,0 +9,0 @@ |
@@ -1,2 +0,2 @@ | ||
"use strict";var t=require("fs");function e(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var r=e(require("path"));function n(){return(n=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t}).apply(this,arguments)}const i=["src","app","integrations"];function o(t,e){return new RegExp("/[\\/]"+e+"[\\/]/").test(t)}function s(t){return new RegExp(`(?<!\\.test|\\.spec)\\.(?:${t.join("|")})$`)}async function a(e,s,c,l,p=[]){const u=n({rootDir:e,topLevelFoldersThatMayContainFiles:i},l);let f=await t.promises.readdir(e);return e===u.rootDir&&(f=f.filter(t=>u.topLevelFoldersThatMayContainFiles.includes(t))),await Promise.all(f.map(async n=>{const i=r.default.join(e,n);if(u.ignore&&u.ignore.test(n))return;if((await t.promises.stat(i)).isDirectory())return void await a(i,s,c,u,p);if(!s.test(n))return;const l=i.replace(u.rootDir,"");o(l,c)&&p.push(l)})),p.sort()}exports.buildExtensionRegex=s,exports.collect=function(t,e,r={}){const i=n({extensions:["js","mjs","cjs","ts"]},r);return a(e,s(i.extensions),t,i)},exports.isFileTypeOf=o,exports.recursiveFindFilesOfType=a,exports.topLevelFoldersThatMayContainFiles=i; | ||
"use strict";var t=require("fs");function e(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var r=e(require("path"));function n(){return(n=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t}).apply(this,arguments)}const o=["src","app","integrations"];function s(t,e){const r="[\\\\/]";return new RegExp(r+e+r).test(t)}function i(t){return new RegExp(`(?<!\\.test|\\.spec)\\.(?:${t.join("|")})$`)}async function a(e,i,c,l,p=[]){const u=n({rootDir:e,topLevelFoldersThatMayContainFiles:o},l);let f=await t.promises.readdir(e);return e===u.rootDir&&(f=f.filter(t=>u.topLevelFoldersThatMayContainFiles.includes(t))),await Promise.all(f.map(async n=>{const o=r.default.join(e,n);if(u.ignore&&u.ignore.test(n))return;if((await t.promises.stat(o)).isDirectory())return void await a(o,i,c,u,p);if(!i.test(n))return;const l=o.replace(u.rootDir,"");s(l,c)&&p.push(l)})),p.sort()}exports.buildExtensionRegex=i,exports.collect=function(t,e,r={}){const o=n({extensions:["js","mjs","cjs","ts"]},r);return a(e,i(o.extensions),t,o)},exports.isFileTypeOf=s,exports.recursiveFindFilesOfType=a,exports.topLevelFoldersThatMayContainFiles=o; | ||
//# sourceMappingURL=index.js.map |
@@ -1,2 +0,2 @@ | ||
import{promises as t}from"fs";import r from"path";function n(){return(n=Object.assign||function(t){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])}return t}).apply(this,arguments)}const e=["src","app","integrations"];function o(t,r){return new RegExp("/[\\/]"+r+"[\\/]/").test(t)}function i(t){return new RegExp(`(?<!\\.test|\\.spec)\\.(?:${t.join("|")})$`)}async function s(i,a,c,p,u=[]){const l=n({rootDir:i,topLevelFoldersThatMayContainFiles:e},p);let f=await t.readdir(i);return i===l.rootDir&&(f=f.filter(t=>l.topLevelFoldersThatMayContainFiles.includes(t))),await Promise.all(f.map(async n=>{const e=r.join(i,n);if(l.ignore&&l.ignore.test(n))return;if((await t.stat(e)).isDirectory())return void await s(e,a,c,l,u);if(!a.test(n))return;const p=e.replace(l.rootDir,"");o(p,c)&&u.push(p)})),u.sort()}function a(t,r,e={}){const o=n({extensions:["js","mjs","cjs","ts"]},e);return s(r,i(o.extensions),t,o)}export{i as buildExtensionRegex,a as collect,o as isFileTypeOf,s as recursiveFindFilesOfType,e as topLevelFoldersThatMayContainFiles}; | ||
import{promises as t}from"fs";import r from"path";function n(){return(n=Object.assign||function(t){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])}return t}).apply(this,arguments)}const e=["src","app","integrations"];function o(t,r){const n="[\\\\/]";return new RegExp(n+r+n).test(t)}function i(t){return new RegExp(`(?<!\\.test|\\.spec)\\.(?:${t.join("|")})$`)}async function s(i,a,c,p,u=[]){const l=n({rootDir:i,topLevelFoldersThatMayContainFiles:e},p);let f=await t.readdir(i);return i===l.rootDir&&(f=f.filter(t=>l.topLevelFoldersThatMayContainFiles.includes(t))),await Promise.all(f.map(async n=>{const e=r.join(i,n);if(l.ignore&&l.ignore.test(n))return;if((await t.stat(e)).isDirectory())return void await s(e,a,c,l,u);if(!a.test(n))return;const p=e.replace(l.rootDir,"");o(p,c)&&u.push(p)})),u.sort()}function a(t,r,e={}){const o=n({extensions:["js","mjs","cjs","ts"]},e);return s(r,i(o.extensions),t,o)}export{i as buildExtensionRegex,a as collect,o as isFileTypeOf,s as recursiveFindFilesOfType,e as topLevelFoldersThatMayContainFiles}; | ||
//# sourceMappingURL=index.modern.js.map |
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("fs"),require("path")):"function"==typeof define&&define.amd?define(["exports","fs","path"],t):t((e||self).blitzWebpackUtils={},e.fs,e.path)}(this,function(e,t,n){"use strict";function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=i(n);function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e}).apply(this,arguments)}const s=["src","app","integrations"];function a(e,t){return new RegExp("/[\\/]"+t+"[\\/]/").test(e)}function f(e){return new RegExp(`(?<!\\.test|\\.spec)\\.(?:${e.join("|")})$`)}async function l(e,n,i,f,c=[]){const u=r({rootDir:e,topLevelFoldersThatMayContainFiles:s},f);let p=await t.promises.readdir(e);return e===u.rootDir&&(p=p.filter(e=>u.topLevelFoldersThatMayContainFiles.includes(e))),await Promise.all(p.map(async r=>{const s=o.default.join(e,r);if(u.ignore&&u.ignore.test(r))return;if((await t.promises.stat(s)).isDirectory())return void await l(s,n,i,u,c);if(!n.test(r))return;const f=s.replace(u.rootDir,"");a(f,i)&&c.push(f)})),c.sort()}e.buildExtensionRegex=f,e.collect=function(e,t,n={}){const i=r({extensions:["js","mjs","cjs","ts"]},n);return l(t,f(i.extensions),e,i)},e.isFileTypeOf=a,e.recursiveFindFilesOfType=l,e.topLevelFoldersThatMayContainFiles=s}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("fs"),require("path")):"function"==typeof define&&define.amd?define(["exports","fs","path"],t):t((e||self).blitzWebpackUtils={},e.fs,e.path)}(this,function(e,t,n){"use strict";function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=i(n);function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e}).apply(this,arguments)}const s=["src","app","integrations"];function a(e,t){const n="[\\\\/]";return new RegExp(n+t+n).test(e)}function f(e){return new RegExp(`(?<!\\.test|\\.spec)\\.(?:${e.join("|")})$`)}async function l(e,n,i,f,c=[]){const u=r({rootDir:e,topLevelFoldersThatMayContainFiles:s},f);let p=await t.promises.readdir(e);return e===u.rootDir&&(p=p.filter(e=>u.topLevelFoldersThatMayContainFiles.includes(e))),await Promise.all(p.map(async r=>{const s=o.default.join(e,r);if(u.ignore&&u.ignore.test(r))return;if((await t.promises.stat(s)).isDirectory())return void await l(s,n,i,u,c);if(!n.test(r))return;const f=s.replace(u.rootDir,"");a(f,i)&&c.push(f)})),c.sort()}e.buildExtensionRegex=f,e.collect=function(e,t,n={}){const i=r({extensions:["js","mjs","cjs","ts"]},n);return l(t,f(i.extensions),e,i)},e.isFileTypeOf=a,e.recursiveFindFilesOfType=l,e.topLevelFoldersThatMayContainFiles=s}); | ||
//# sourceMappingURL=index.umd.js.map |
{ | ||
"name": "@anolilab/blitz-webpack-utils", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "Webpack utils for Blitz.js", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
export const topLevelFoldersThatMayContainFiles = ["src", "app", "integrations"]; | ||
export function isFileTypeOf(filePathFromAppRoot: string, type: string) { | ||
const pattern1 = "/[\\/]"; | ||
const pattern2 = "[\\/]/"; | ||
const pattern = "[\\\\/]"; | ||
return new RegExp(pattern1 + type + pattern2).test(filePathFromAppRoot); | ||
return new RegExp(pattern + type + pattern).test(filePathFromAppRoot); | ||
} | ||
@@ -9,0 +8,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
38432
144