string-extract-sass-vars 3.0.11 → 3.0.12
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.
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @name string-extract-sass-vars
|
|
3
3
|
* @fileoverview Parse SASS variables file into a plain object of CSS key-value pairs
|
|
4
|
-
* @version 3.0.
|
|
4
|
+
* @version 3.0.12
|
|
5
5
|
* @author Roy Revelt, Codsen Ltd
|
|
6
6
|
* @license MIT
|
|
7
7
|
* {@link https://codsen.com/os/string-extract-sass-vars/}
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
var h="3.0.
|
|
11
|
-
`.includes(e[t])&&(
|
|
10
|
+
var h="3.0.12";var v=h,S="\\",f={throwIfEmpty:!1,cb:null};function w(e,n){if(typeof e!="string")return{};if(n&&typeof n!="object")throw new Error(`string-extract-sass-vars: [THROW_ID_01] the second input argument should be a plain object but it was given as ${JSON.stringify(n,null,4)} (type ${typeof n})`);let u={...f,...n};if(u.cb&&typeof u.cb!="function")throw new Error(`string-extract-sass-vars: [THROW_ID_02] opts.cb should be function! But it was given as ${JSON.stringify(n,null,4)} (type ${typeof n})`);let g=e.length,o=null,l=null,a=null,i=null,r=null,c=null,s=!1,$=!1,m=!1,b={};for(let t=0;t<g;t++)!s&&r&&e[t]===r&&e[t-1]!==S?r=null:!r&&!s&&e[t-1]!==S&&`'"`.includes(e[t])&&(r=e[t]),$&&`\r
|
|
11
|
+
`.includes(e[t])&&($=!1),!s&&e[t]==="/"&&e[t+1]==="/"&&($=!0),m&&e[t-2]==="*"&&e[t-1]==="/"&&(m=!1),!s&&e[t]==="/"&&e[t+1]==="*"&&(m=!0),s=$||m,!s&&e[t]==="$"&&o===null&&(o=t+1),!s&&l!==null&&!r&&e[t]===";"&&(i=e.slice(`"'`.includes(e[l])?l+1:l,(c||0)+1),/^-?\d*\.?\d*$/.test(i)&&(i=+i),b[a]=u.cb?u.cb(i):i,o=null,l=null,a=null,i=null),!s&&a!==null&&e[t]&&e[t].trim().length&&l===null&&(l=t),!s&&!a&&o!==null&&e[t]===":"&&!r&&(a=e.slice(o,t)),`'"`.includes(e[t])||(c=t);if(!Object.keys(b).length&&u.throwIfEmpty)throw new Error("string-extract-sass-vars: [THROW_ID_03] no keys extracted! (setting opts.originalOpts)");return b}export{f as defaults,w as extractVars,v as version};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @name string-extract-sass-vars
|
|
3
3
|
* @fileoverview Parse SASS variables file into a plain object of CSS key-value pairs
|
|
4
|
-
* @version 3.0.
|
|
4
|
+
* @version 3.0.12
|
|
5
5
|
* @author Roy Revelt, Codsen Ltd
|
|
6
6
|
* @license MIT
|
|
7
7
|
* {@link https://codsen.com/os/string-extract-sass-vars/}
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
var stringExtractSassVars=(()=>{var c=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var V=Object.getOwnPropertyNames,
|
|
11
|
-
`.includes(t[n])&&(m=!1),!i&&t[n]==="/"&&t[n+1]==="/"&&(m=!0),b&&t[n-2]==="*"&&t[n-1]==="/"&&(b=!1),!i&&t[n]==="/"&&t[n+1]==="*"&&(b=!0),i=m||b,!i&&t[n]==="$"&&l===null&&(l=n+1),!i&&
|
|
10
|
+
var stringExtractSassVars=(()=>{var c=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var V=Object.getOwnPropertyNames,p=Object.getOwnPropertySymbols;var f=Object.prototype.hasOwnProperty,N=Object.prototype.propertyIsEnumerable;var d=(t,e,s)=>e in t?c(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,S=(t,e)=>{for(var s in e||(e={}))f.call(e,s)&&d(t,s,e[s]);if(p)for(var s of p(e))N.call(e,s)&&d(t,s,e[s]);return t};var D=t=>c(t,"__esModule",{value:!0});var C=(t,e)=>{for(var s in e)c(t,s,{get:e[s],enumerable:!0})},A=(t,e,s,$)=>{if(e&&typeof e=="object"||typeof e=="function")for(let l of V(e))!f.call(t,l)&&(s||l!=="default")&&c(t,l,{get:()=>e[l],enumerable:!($=E(e,l))||$.enumerable});return t};var x=(t=>(e,s)=>t&&t.get(e)||(s=A(D({}),e,1),t&&t.set(e,s),s))(typeof WeakMap!="undefined"?new WeakMap:0);var j={};C(j,{defaults:()=>w,extractVars:()=>J,version:()=>k});var y="3.0.12";var k=y,v="\\",w={throwIfEmpty:!1,cb:null};function J(t,e){var T;if(typeof t!="string")return{};if(e&&typeof e!="object")throw new Error(`string-extract-sass-vars: [THROW_ID_01] the second input argument should be a plain object but it was given as ${JSON.stringify(e,null,4)} (type ${typeof e})`);let s=S(S({},w),e);if(s.cb&&typeof s.cb!="function")throw new Error(`string-extract-sass-vars: [THROW_ID_02] opts.cb should be function! But it was given as ${JSON.stringify(e,null,4)} (type ${typeof e})`);let $=t.length,l=null,r=null,a=null,u=null,o=null,g=null,i=!1,m=!1,b=!1,h={};for(let n=0;n<$;n++)!i&&o&&t[n]===o&&t[n-1]!==v?o=null:!o&&!i&&t[n-1]!==v&&`'"`.includes(t[n])&&(o=t[n]),m&&`\r
|
|
11
|
+
`.includes(t[n])&&(m=!1),!i&&t[n]==="/"&&t[n+1]==="/"&&(m=!0),b&&t[n-2]==="*"&&t[n-1]==="/"&&(b=!1),!i&&t[n]==="/"&&t[n+1]==="*"&&(b=!0),i=m||b,!i&&t[n]==="$"&&l===null&&(l=n+1),!i&&r!==null&&!o&&t[n]===";"&&(u=t.slice(`"'`.includes(t[r])?r+1:r,(g||0)+1),/^-?\d*\.?\d*$/.test(u)&&(u=+u),h[a]=s.cb?s.cb(u):u,l=null,r=null,a=null,u=null),!i&&a!==null&&t[n]&&t[n].trim().length&&r===null&&(r=n),!i&&!a&&l!==null&&t[n]===":"&&!o&&(a=t.slice(l,n)),`'"`.includes(t[n])||(g=n);if(!Object.keys(h).length&&s.throwIfEmpty)throw new Error("string-extract-sass-vars: [THROW_ID_03] no keys extracted! (setting opts.originalOpts)");return h}return x(j);})();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "string-extract-sass-vars",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.12",
|
|
4
4
|
"description": "Parse SASS variables file into a plain object of CSS key-value pairs",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"css",
|
|
@@ -37,9 +37,10 @@
|
|
|
37
37
|
"scripts": {
|
|
38
38
|
"build": "node '../../ops/scripts/esbuild.js' && yarn run dts",
|
|
39
39
|
"dev": "DEV=true node '../../ops/scripts/esbuild.js' && yarn run dts",
|
|
40
|
+
"devtest": "c8 yarn run unit && yarn run examples && yarn run lint",
|
|
40
41
|
"dts": "rollup -c && yarn run prettier 'types/index.d.ts' --write",
|
|
41
42
|
"examples": "node '../../ops/scripts/run-examples.js'",
|
|
42
|
-
"lect": "node '../../ops/lect/lect.js'",
|
|
43
|
+
"lect": "node '../../ops/lect/lect.js' && yarn run prettier 'README.md' '.all-contributorsrc' 'rollup.config.js' --write",
|
|
43
44
|
"letspublish": "yarn publish || :",
|
|
44
45
|
"lint": "eslint . --fix",
|
|
45
46
|
"perf": "node perf/check.js",
|
|
@@ -47,7 +48,7 @@
|
|
|
47
48
|
"prettier": "prettier",
|
|
48
49
|
"prettier:format": "prettier --write '**/*.{ts,tsx,md}' --no-error-on-unmatched-pattern",
|
|
49
50
|
"pretest": "yarn run lect && yarn run build",
|
|
50
|
-
"test": "
|
|
51
|
+
"test": "yarn run devtest",
|
|
51
52
|
"unit": "uvu test"
|
|
52
53
|
},
|
|
53
54
|
"engines": {
|
|
@@ -69,6 +70,6 @@
|
|
|
69
70
|
"various": {}
|
|
70
71
|
},
|
|
71
72
|
"devDependencies": {
|
|
72
|
-
"color-shorthand-hex-to-six-digit": "^4.0.
|
|
73
|
+
"color-shorthand-hex-to-six-digit": "^4.0.12"
|
|
73
74
|
}
|
|
74
75
|
}
|