string-extract-sass-vars 4.0.13 → 4.0.15
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/README.md
CHANGED
|
@@ -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 4.0.
|
|
4
|
+
* @version 4.0.15
|
|
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="4.0.
|
|
11
|
-
`.includes(t[e])&&(a=!1),!s&&t[e]==="/"&&t[e+1]==="/"&&(a=!0),m&&t[e-2]==="*"&&t[e-1]==="/"&&(m=!1),!s&&t[e]==="/"&&t[e+1]==="*"&&(m=!0),s=a||m,!s&&t[e]==="$"&&u===null&&(u=e+1),!s&&l!==null&&!
|
|
10
|
+
var h="4.0.15";var w=h,p="\\",f={throwIfEmpty:!1,cb:null};function y(t,n){if(typeof t!="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 o={...f,...n};if(o.cb&&typeof o.cb!="function")throw new Error(`string-extract-sass-vars: [THROW_ID_02] resolvedOpts.cb should be function! But it was given as ${JSON.stringify(n,null,4)} (type ${typeof n})`);let g=t.length,u=null,l=null,$=null,i=null,r=null,c=null,s=!1,a=!1,m=!1,b={};for(let e=0;e<g;e++)!s&&r&&t[e]===r&&t[e-1]!==p?r=null:!r&&!s&&t[e-1]!==p&&`'"`.includes(t[e])&&(r=t[e]),a&&`\r
|
|
11
|
+
`.includes(t[e])&&(a=!1),!s&&t[e]==="/"&&t[e+1]==="/"&&(a=!0),m&&t[e-2]==="*"&&t[e-1]==="/"&&(m=!1),!s&&t[e]==="/"&&t[e+1]==="*"&&(m=!0),s=a||m,!s&&t[e]==="$"&&u===null&&(u=e+1),!s&&l!==null&&!r&&t[e]===";"&&(i=t.slice(`"'`.includes(t[l])?l+1:l,(c||0)+1),/^-?\d*\.?\d*$/.test(i)&&(i=+i),b[$]=o.cb?o.cb(i):i,u=null,l=null,$=null,i=null),!s&&$!==null&&t[e]?.trim()&&l===null&&(l=e),!s&&!$&&u!==null&&t[e]===":"&&!r&&($=t.slice(u,e)),`'"`.includes(t[e])||(c=e);if(!Object.keys(b).length&&o.throwIfEmpty)throw new Error("string-extract-sass-vars: [THROW_ID_03] no keys extracted! (setting resolvedOpts.opts)");return b}export{f as defaults,y as extractVars,w 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 4.0.
|
|
4
|
+
* @version 4.0.15
|
|
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
|
-
"use strict";var stringExtractSassVars=(()=>{var c=Object.defineProperty;var
|
|
11
|
-
`.includes(e[s])&&(m=!1),!i&&e[s]==="/"&&e[s+1]==="/"&&(m=!0),b&&e[s-2]==="*"&&e[s-1]==="/"&&(b=!1),!i&&e[s]==="/"&&e[s+1]==="*"&&(b=!0),i=m||b,!i&&e[s]==="$"&&l===null&&(l=s+1),!i&&
|
|
10
|
+
"use strict";var stringExtractSassVars=(()=>{var c=Object.defineProperty;var V=Object.getOwnPropertyDescriptor;var O=Object.getOwnPropertyNames,f=Object.getOwnPropertySymbols;var v=Object.prototype.hasOwnProperty,x=Object.prototype.propertyIsEnumerable;var d=(e,t,n)=>t in e?c(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,p=(e,t)=>{for(var n in t||(t={}))v.call(t,n)&&d(e,n,t[n]);if(f)for(var n of f(t))x.call(t,n)&&d(e,n,t[n]);return e};var N=(e,t)=>{for(var n in t)c(e,n,{get:t[n],enumerable:!0})},D=(e,t,n,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of O(t))!v.call(e,l)&&l!==n&&c(e,l,{get:()=>t[l],enumerable:!(a=V(t,l))||a.enumerable});return e};var C=e=>D(c({},"__esModule",{value:!0}),e);var J={};N(J,{defaults:()=>E,extractVars:()=>j,version:()=>k});var w="4.0.15";var k=w,y="\\",E={throwIfEmpty:!1,cb:null};function j(e,t){var S;if(typeof e!="string")return{};if(t&&typeof t!="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(t,null,4)} (type ${typeof t})`);let n=p(p({},E),t);if(n.cb&&typeof n.cb!="function")throw new Error(`string-extract-sass-vars: [THROW_ID_02] resolvedOpts.cb should be function! But it was given as ${JSON.stringify(t,null,4)} (type ${typeof t})`);let a=e.length,l=null,r=null,$=null,o=null,u=null,g=null,i=!1,m=!1,b=!1,h={};for(let s=0;s<a;s++)!i&&u&&e[s]===u&&e[s-1]!==y?u=null:!u&&!i&&e[s-1]!==y&&`'"`.includes(e[s])&&(u=e[s]),m&&`\r
|
|
11
|
+
`.includes(e[s])&&(m=!1),!i&&e[s]==="/"&&e[s+1]==="/"&&(m=!0),b&&e[s-2]==="*"&&e[s-1]==="/"&&(b=!1),!i&&e[s]==="/"&&e[s+1]==="*"&&(b=!0),i=m||b,!i&&e[s]==="$"&&l===null&&(l=s+1),!i&&r!==null&&!u&&e[s]===";"&&(o=e.slice(`"'`.includes(e[r])?r+1:r,(g||0)+1),/^-?\d*\.?\d*$/.test(o)&&(o=+o),h[$]=n.cb?n.cb(o):o,l=null,r=null,$=null,o=null),!i&&$!==null&&((S=e[s])!=null&&S.trim())&&r===null&&(r=s),!i&&!$&&l!==null&&e[s]===":"&&!u&&($=e.slice(l,s)),`'"`.includes(e[s])||(g=s);if(!Object.keys(h).length&&n.throwIfEmpty)throw new Error("string-extract-sass-vars: [THROW_ID_03] no keys extracted! (setting resolvedOpts.opts)");return h}return C(J);})();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "string-extract-sass-vars",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.15",
|
|
4
4
|
"description": "Parse SASS variables file into a plain object of CSS key-value pairs",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"css",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"cjs-on": "exit 0",
|
|
42
42
|
"dev": "DEV=true node '../../ops/scripts/esbuild.js' && npm run dts",
|
|
43
43
|
"devtest": "c8 npm run unit && npm run examples && npm run lint",
|
|
44
|
-
"dts": "rollup -c && npm run prettier -- 'types/index.d.ts' --write --
|
|
44
|
+
"dts": "rollup -c && npm run prettier -- 'types/index.d.ts' --write --log-level 'silent'",
|
|
45
45
|
"examples": "node '../../ops/scripts/run-examples.js'",
|
|
46
46
|
"lect": "node '../../ops/lect/lect.js' && npm run prettier -- 'README.md' '.all-contributorsrc' 'rollup.config.js' --write",
|
|
47
47
|
"letspublish": "npm publish || :",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"perf": "node perf/check.js",
|
|
50
50
|
"prep": "echo 'ready'",
|
|
51
51
|
"prettier": "prettier",
|
|
52
|
-
"prettier:format": "npm run prettier -- --write '**/*.{ts,tsx,md}' --no-error-on-unmatched-pattern --
|
|
52
|
+
"prettier:format": "npm run prettier -- --write '**/*.{ts,tsx,md}' --no-error-on-unmatched-pattern --log-level 'silent'",
|
|
53
53
|
"pretest": "npm run lect && npm run build",
|
|
54
54
|
"test": "npm run devtest",
|
|
55
55
|
"unit": "uvu test"
|
|
@@ -73,6 +73,6 @@
|
|
|
73
73
|
"various": {}
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
76
|
-
"color-shorthand-hex-to-six-digit": "^5.0.
|
|
76
|
+
"color-shorthand-hex-to-six-digit": "^5.0.13"
|
|
77
77
|
}
|
|
78
78
|
}
|
package/types/index.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ interface Opts {
|
|
|
9
9
|
declare const defaults: Opts;
|
|
10
10
|
declare function extractVars(
|
|
11
11
|
str: string,
|
|
12
|
-
opts?: Partial<Opts
|
|
12
|
+
opts?: Partial<Opts>,
|
|
13
13
|
): UnknownValueObj;
|
|
14
14
|
|
|
15
|
-
export { Opts, UnknownValueObj, defaults, extractVars, version };
|
|
15
|
+
export { type Opts, type UnknownValueObj, defaults, extractVars, version };
|