string-extract-sass-vars 3.1.6 → 4.0.1

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/CHANGELOG.md CHANGED
@@ -3,7 +3,13 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
- # 3.1.0 (2022-08-12)
6
+ ## 4.0.0 (2022-12-01)
7
+
8
+ ### BREAKING CHANGES
9
+
10
+ - Minimum supported Node version is v14.18; we're dropping v12 support
11
+
12
+ ## 3.1.0 (2022-08-12)
7
13
 
8
14
  ### Features
9
15
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "string-extract-sass-vars",
3
- "version": "3.1.6",
3
+ "version": "4.0.1",
4
4
  "description": "Parse SASS variables file into a plain object of CSS key-value pairs",
5
5
  "keywords": [
6
6
  "css",
@@ -36,26 +36,26 @@
36
36
  },
37
37
  "types": "types/index.d.ts",
38
38
  "scripts": {
39
- "build": "node '../../ops/scripts/esbuild.js' && yarn run dts",
39
+ "build": "node '../../ops/scripts/esbuild.js' && npm run dts",
40
40
  "cjs-off": "exit 0",
41
41
  "cjs-on": "exit 0",
42
- "dev": "DEV=true node '../../ops/scripts/esbuild.js' && yarn run dts",
43
- "devtest": "c8 yarn run unit && yarn run examples && yarn run lint",
44
- "dts": "rollup -c && yarn run prettier 'types/index.d.ts' --write",
42
+ "dev": "DEV=true node '../../ops/scripts/esbuild.js' && npm run dts",
43
+ "devtest": "c8 npm run unit && npm run examples && npm run lint",
44
+ "dts": "rollup -c && npm run prettier -- 'types/index.d.ts' --write --loglevel 'silent'",
45
45
  "examples": "node '../../ops/scripts/run-examples.js'",
46
- "lect": "node '../../ops/lect/lect.js' && yarn run prettier 'README.md' '.all-contributorsrc' 'rollup.config.js' --write",
47
- "letspublish": "yarn publish || :",
46
+ "lect": "node '../../ops/lect/lect.js' && npm run prettier -- 'README.md' '.all-contributorsrc' 'rollup.config.js' --write",
47
+ "letspublish": "npm publish || :",
48
48
  "lint": "eslint . --ext .js --ext .ts --fix",
49
49
  "perf": "node perf/check.js",
50
- "prepare": "echo 'ready'",
50
+ "prep": "echo 'ready'",
51
51
  "prettier": "prettier",
52
- "prettier:format": "prettier --write '**/*.{ts,tsx,md}' --no-error-on-unmatched-pattern",
53
- "pretest": "yarn run lect && yarn run build",
54
- "test": "yarn run devtest",
52
+ "prettier:format": "npm run prettier -- --write '**/*.{ts,tsx,md}' --no-error-on-unmatched-pattern --loglevel 'silent'",
53
+ "pretest": "npm run lect && npm run build",
54
+ "test": "npm run devtest",
55
55
  "unit": "uvu test"
56
56
  },
57
57
  "engines": {
58
- "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
58
+ "node": ">=14.18.0"
59
59
  },
60
60
  "c8": {
61
61
  "check-coverage": true,
@@ -73,6 +73,6 @@
73
73
  "various": {}
74
74
  },
75
75
  "devDependencies": {
76
- "color-shorthand-hex-to-six-digit": "^4.1.6"
76
+ "color-shorthand-hex-to-six-digit": "^5.0.1"
77
77
  }
78
78
  }
@@ -1,11 +0,0 @@
1
- /**
2
- * @name string-extract-sass-vars
3
- * @fileoverview Parse SASS variables file into a plain object of CSS key-value pairs
4
- * @version 3.1.6
5
- * @author Roy Revelt, Codsen Ltd
6
- * @license MIT
7
- * {@link https://codsen.com/os/string-extract-sass-vars/}
8
- */
9
-
10
- var h="3.1.6";var v=h,g="\\",f={throwIfEmpty:!1,cb:null};function w(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 p=t.length,u=null,l=null,a=null,i=null,r=null,c=null,s=!1,$=!1,m=!1,b={};for(let e=0;e<p;e++)!s&&r&&t[e]===r&&t[e-1]!==g?r=null:!r&&!s&&t[e-1]!==g&&`'"`.includes(t[e])&&(r=t[e]),$&&`\r
11
- `.includes(t[e])&&($=!1),!s&&t[e]==="/"&&t[e+1]==="/"&&($=!0),m&&t[e-2]==="*"&&t[e-1]==="/"&&(m=!1),!s&&t[e]==="/"&&t[e+1]==="*"&&(m=!0),s=$||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[a]=o.cb?o.cb(i):i,u=null,l=null,a=null,i=null),!s&&a!==null&&t[e]&&t[e].trim().length&&l===null&&(l=e),!s&&!a&&u!==null&&t[e]===":"&&!r&&(a=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,w as extractVars,v as version};
@@ -1,11 +0,0 @@
1
- /**
2
- * @name string-extract-sass-vars
3
- * @fileoverview Parse SASS variables file into a plain object of CSS key-value pairs
4
- * @version 3.1.6
5
- * @author Roy Revelt, Codsen Ltd
6
- * @license MIT
7
- * {@link https://codsen.com/os/string-extract-sass-vars/}
8
- */
9
-
10
- "use strict";var stringExtractSassVars=(()=>{var c=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var V=Object.getOwnPropertyNames,S=Object.getOwnPropertySymbols;var d=Object.prototype.hasOwnProperty,O=Object.prototype.propertyIsEnumerable;var f=(e,t,n)=>t in e?c(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,g=(e,t)=>{for(var n in t||(t={}))d.call(t,n)&&f(e,n,t[n]);if(S)for(var n of S(t))O.call(t,n)&&f(e,n,t[n]);return e};var x=(e,t)=>{for(var n in t)c(e,n,{get:t[n],enumerable:!0})},N=(e,t,n,$)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of V(t))!d.call(e,l)&&l!==n&&c(e,l,{get:()=>t[l],enumerable:!($=E(t,l))||$.enumerable});return e};var D=e=>N(c({},"__esModule",{value:!0}),e);var j={};x(j,{defaults:()=>w,extractVars:()=>k,version:()=>A});var y="3.1.6";var A=y,v="\\",w={throwIfEmpty:!1,cb:null};function k(e,t){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=g(g({},w),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 $=e.length,l=null,r=null,a=null,o=null,u=null,p=null,i=!1,m=!1,b=!1,h={};for(let s=0;s<$;s++)!i&&u&&e[s]===u&&e[s-1]!==v?u=null:!u&&!i&&e[s-1]!==v&&`'"`.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,(p||0)+1),/^-?\d*\.?\d*$/.test(o)&&(o=+o),h[a]=n.cb?n.cb(o):o,l=null,r=null,a=null,o=null),!i&&a!==null&&e[s]&&e[s].trim().length&&r===null&&(r=s),!i&&!a&&l!==null&&e[s]===":"&&!u&&(a=e.slice(l,s)),`'"`.includes(e[s])||(p=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 D(j);})();