aboutsummaryrefslogtreecommitdiffstats
path: root/tailwind.config.cjs
diff options
context:
space:
mode:
Diffstat (limited to 'tailwind.config.cjs')
0 files changed, 0 insertions, 0 deletions
ersist.js?h=staging&id=42ad55c926902587affc34a484396a00e16d534e'>^
0e85dc6e ^
0e85dc6e ^









92e913ba ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
                         

                                          



                                                 
   
 









                                                           
  
const fs = require("fs");

module.exports = (path, initial = {}) => {
  if (!initial || !Object.keys(initial).length) {
    try {
      initial = require("../" + path);
    } catch(e) {}
  }

  return new Proxy(initial, {
    set(obj, prop, value) {
      fs.writeFileSync(
        path,
        JSON.stringify({ ...obj, [prop]: value }, null, 2),
        "utf-8"
      );
      return Reflect.set(...arguments);
    }
  });
};