@flatjs/evolve 3.0.2 → 3.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/constants.d.ts
CHANGED
package/dist/constants.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
import process from"node:process";export const moduleName="@flatjs/evolve";export const configFileName="flatjs-evolve";export const viewportScripts='(function(d){var j;var b=1;var i=1;var h=750;var c=100;function e(s,o){var q=d.document;var l=q.documentElement;var k=navigator.userAgent;var m=k.toLowerCase().indexOf("android")>-1;i=d.devicePixelRatio||1;if(i>3){i=3}if(m){i=1}console.log("current devicePixelRatio:",i);l.setAttribute("data-dpr",i.toString());var p=q.querySelector(\'meta[name="viewport"]\');if(!p){b=1/i;p=q.createElement("meta");p.setAttribute("name","viewport");q.head.appendChild(p);p.setAttribute(["content","width=device-width,user-scalable=no,initial-scale=",b,",maximum-scale=",b,",minimum-scale=",b].join(""))}function n(){var t=document.documentElement.clientWidth;j=t/o*(s/i)*i;q.documentElement.style.fontSize=String(j)+"px"}var r;d.addEventListener("resize",function(){clearTimeout(r);r=setTimeout(n,300)},false);d.addEventListener("onload",n,false);n()}e(c,h);window.fabricViewport={currRem:j,currDpr:i,currScale:b,dpiPX2px:function f(k){return parseFloat(k.toString())/j*100+"px"},px2DPIpx:function a(k){return parseFloat(k.toString())/100*j+"px"},px2rem:function g(k){return parseFloat(k.toString())/100+"rem"}}})(window);';export const polyfill=[{id:"polyfill.io/v3/polyfill.min.js",src:"https://polyfill.io/v3/polyfill.min.js?features=Array.from%2CArray.isArray%2CArray.of%2CArray.prototype.entries%2CArray.prototype.every%2CArray.prototype.fill%2CArray.prototype.filter%2CArray.prototype.find%2CArray.prototype.findIndex%2CArray.prototype.flat%2CArray.prototype.forEach%2CArray.prototype.flatMap%2CArray.prototype.keys%2CArray.prototype.indexOf%2CArray.prototype.includes%2CArray.prototype.lastIndexOf%2CArray.prototype.map%2CArray.prototype.reduce%2CArray.prototype.reduceRight%2CArray.prototype.some%2CArray.prototype.sort%2CArray.prototype.values%2CArrayBuffer%2CBlob%2CDataView%2CDate.now%2CObject.assign%2CObject.create%2CObject.defineProperties%2CObject.defineProperty%2CObject.entries%2CObject.freeze%2CObject.fromEntries%2CObject.getOwnPropertySymbols%2CObject.getOwnPropertyNames%2CObject.getOwnPropertyDescriptors%2CObject.getOwnPropertyDescriptor%2CObject.getPrototypeOf%2CObject.is%2CObject.isExtensible%2CObject.isFrozen%2CObject.isSealed%2CObject.keys%2CObject.values%2CObject.setPrototypeOf%2CPromise%2CPromise.prototype.finally%2CReflect%2CReflect.apply%2CReflect.construct%2CReflect.defineProperty%2CReflect.deleteProperty%2CReflect.getPrototypeOf%2CReflect.getOwnPropertyDescriptor%2CReflect.get%2CReflect.ownKeys%2CReflect.isExtensible%2CReflect.has%2CReflect.preventExtensions%2CReflect.set%2CReflect.setPrototypeOf%2CSet%2CString.prototype.trimStart%2CString.prototype.trimEnd%2CString.prototype.trim%2CString.prototype.startsWith%2CString.prototype.repeat%2CString.prototype.replaceAll%2CString.prototype.padStart%2CString.prototype.padEnd%2CMap%2CObject.seal%2Cconsole.groupEnd%2Cconsole.group",position:"end",order:-1}];export const devReactFastRefresh={runtime:"reactRefreshRuntime",reactRefreshSetup:"reactRefreshSetup"};export const ignoreEntryOptionKeys=["title"];export const webpackStatsDir=".cache/stats";export const buildProgressSpinnerFrames="win32"===process.platform?["-","\\","|","/"]:["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"];export const defaultExtractionRule="https
|
1
|
+
import process from"node:process";export const moduleName="@flatjs/evolve";export const configFileName="flatjs-evolve";export const viewportScripts='(function(d){var j;var b=1;var i=1;var h=750;var c=100;function e(s,o){var q=d.document;var l=q.documentElement;var k=navigator.userAgent;var m=k.toLowerCase().indexOf("android")>-1;i=d.devicePixelRatio||1;if(i>3){i=3}if(m){i=1}console.log("current devicePixelRatio:",i);l.setAttribute("data-dpr",i.toString());var p=q.querySelector(\'meta[name="viewport"]\');if(!p){b=1/i;p=q.createElement("meta");p.setAttribute("name","viewport");q.head.appendChild(p);p.setAttribute(["content","width=device-width,user-scalable=no,initial-scale=",b,",maximum-scale=",b,",minimum-scale=",b].join(""))}function n(){var t=document.documentElement.clientWidth;j=t/o*(s/i)*i;q.documentElement.style.fontSize=String(j)+"px"}var r;d.addEventListener("resize",function(){clearTimeout(r);r=setTimeout(n,300)},false);d.addEventListener("onload",n,false);n()}e(c,h);window.fabricViewport={currRem:j,currDpr:i,currScale:b,dpiPX2px:function f(k){return parseFloat(k.toString())/j*100+"px"},px2DPIpx:function a(k){return parseFloat(k.toString())/100*j+"px"},px2rem:function g(k){return parseFloat(k.toString())/100+"rem"}}})(window);';export const polyfill=[{id:"polyfill.io/v3/polyfill.min.js",src:"https://polyfill.io/v3/polyfill.min.js?features=Array.from%2CArray.isArray%2CArray.of%2CArray.prototype.entries%2CArray.prototype.every%2CArray.prototype.fill%2CArray.prototype.filter%2CArray.prototype.find%2CArray.prototype.findIndex%2CArray.prototype.flat%2CArray.prototype.forEach%2CArray.prototype.flatMap%2CArray.prototype.keys%2CArray.prototype.indexOf%2CArray.prototype.includes%2CArray.prototype.lastIndexOf%2CArray.prototype.map%2CArray.prototype.reduce%2CArray.prototype.reduceRight%2CArray.prototype.some%2CArray.prototype.sort%2CArray.prototype.values%2CArrayBuffer%2CBlob%2CDataView%2CDate.now%2CObject.assign%2CObject.create%2CObject.defineProperties%2CObject.defineProperty%2CObject.entries%2CObject.freeze%2CObject.fromEntries%2CObject.getOwnPropertySymbols%2CObject.getOwnPropertyNames%2CObject.getOwnPropertyDescriptors%2CObject.getOwnPropertyDescriptor%2CObject.getPrototypeOf%2CObject.is%2CObject.isExtensible%2CObject.isFrozen%2CObject.isSealed%2CObject.keys%2CObject.values%2CObject.setPrototypeOf%2CPromise%2CPromise.prototype.finally%2CReflect%2CReflect.apply%2CReflect.construct%2CReflect.defineProperty%2CReflect.deleteProperty%2CReflect.getPrototypeOf%2CReflect.getOwnPropertyDescriptor%2CReflect.get%2CReflect.ownKeys%2CReflect.isExtensible%2CReflect.has%2CReflect.preventExtensions%2CReflect.set%2CReflect.setPrototypeOf%2CSet%2CString.prototype.trimStart%2CString.prototype.trimEnd%2CString.prototype.trim%2CString.prototype.startsWith%2CString.prototype.repeat%2CString.prototype.replaceAll%2CString.prototype.padStart%2CString.prototype.padEnd%2CMap%2CObject.seal%2Cconsole.groupEnd%2Cconsole.group",position:"end",order:-1}];export const devReactFastRefresh={runtime:"reactRefreshRuntime",reactRefreshSetup:"reactRefreshSetup"};export const ignoreEntryOptionKeys=["title"];export const webpackStatsDir=".cache/stats";export const buildProgressSpinnerFrames="win32"===process.platform?["-","\\","|","/"]:["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"];export const defaultExtractionRule=["(?:https?:)?\\/\\/(?:[\\w-]+@)?(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\\.)+[a-zA-Z]{2,}(?::\\d+)?","(?:https?:)?\\/\\/\\d{1,3}(?:\\.\\d{1,3}){3}(?::\\d+)?"];
|
@@ -1 +1 @@
|
|
1
|
-
import webpack from"webpack";import{defaultExtractionRule}from"../../../constants.js";import{CodeCheckerError}from"./code-checker-error.js";const PLUGIN_NAME="CodeCheckerWebpackPlugin";export class CodeCheckerWebpackPlugin{constructor(t={}){this.errors=[],this.blackList=[],this.whiteList=[],this.whitelistExtractionRule=[];const{blackList:e=[],whiteList:s=[],whitelistExtractionRule:o=
|
1
|
+
import webpack from"webpack";import{defaultExtractionRule}from"../../../constants.js";import{CodeCheckerError}from"./code-checker-error.js";const PLUGIN_NAME="CodeCheckerWebpackPlugin";export class CodeCheckerWebpackPlugin{constructor(t={}){this.errors=[],this.blackList=[],this.whiteList=[],this.whitelistExtractionRule=[];const{blackList:e=[],whiteList:s=[],whitelistExtractionRule:o=defaultExtractionRule}=t;this.errors=[],this.blackList=e.map(t=>({input:t,reg:new RegExp(t)})),this.whiteList=s.map(t=>new RegExp(t)),this.whitelistExtractionRule=o.map(t=>new RegExp(t,"g"))}checkCode(t,e){const s=this.findUnallowedCode(t);for(const t of s)this.errors.push(`【 WhiteList 】${e} has unallowed code: ${t}`);for(const s of this.blackList)s.reg.test(t)&&this.errors.push(`【 BlackList 】${e} has unallowed code: ${s.input}`)}findUnallowedCode(t){const e=[],s=[];for(const e of this.whitelistExtractionRule)s.push(...t.match(e)??[]);if(s.length>0)for(const t of s){this.whiteList.findIndex(e=>e.test(t))<0&&e.push(t)}return e}apply(t){t.hooks.compilation.tap(PLUGIN_NAME,t=>{t.hooks.processAssets.tap({name:`${PLUGIN_NAME}PROCESS_ASSETS_STAGE_ANALYSE`,stage:webpack.Compilation.PROCESS_ASSETS_STAGE_ANALYSE},()=>{for(const[e,s]of Object.entries(t.assets)){if(!e.endsWith(".map")&&s.source){const t=s.source().toString();t&&t.length>0&&this.checkCode(t,e)}}})}),t.hooks.done.tap({name:`${PLUGIN_NAME}_DONE`},()=>{if(this.errors.length>0)throw new CodeCheckerError(this.errors)})}}
|
@@ -8,7 +8,7 @@ export type CodeCheckerPluginOptions = {
|
|
8
8
|
*
|
9
9
|
* @example
|
10
10
|
* ```ts
|
11
|
-
*
|
11
|
+
* blackList: ['console.log', 'debugger']
|
12
12
|
* ```
|
13
13
|
*/
|
14
14
|
blackList?: string[];
|
@@ -21,7 +21,7 @@ export type CodeCheckerPluginOptions = {
|
|
21
21
|
*
|
22
22
|
* @example
|
23
23
|
* ```ts
|
24
|
-
*
|
24
|
+
* whiteList: ['http://test.example.com']
|
25
25
|
* ```
|
26
26
|
*/
|
27
27
|
whiteList?: string[];
|