diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..070d124 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,22 @@ +name: Publish +on: + push: + branches: + - main + +jobs: + publish: + runs-on: ubuntu-latest + + permissions: + contents: read + id-token: write + + steps: + - uses: actions/checkout@v4 + + - name: Install Deno + uses: denoland/setup-deno@v1 + + - name: Publish package + run: deno publish --config jsr.json diff --git a/cjs/index.js b/cjs/index.js index c2c9486..5ec109a 100644 --- a/cjs/index.js +++ b/cjs/index.js @@ -1,5 +1,7 @@ 'use strict'; -/*! (c) 2020 Andrea Giammarchi */ +// + +// (c) 2020-present Andrea Giammarchi const {parse: $parse, stringify: $stringify} = JSON; const {keys} = Object; diff --git a/es.js b/es.js index 8e4cf0c..42c98ae 100644 --- a/es.js +++ b/es.js @@ -1,2 +1 @@ -self.Flatted=function(t){"use strict"; -/*! (c) 2020 Andrea Giammarchi */const{parse:e,stringify:n}=JSON,{keys:r}=Object,s=String,o="string",c={},l="object",a=(t,e)=>e,f=t=>t instanceof s?s(t):t,i=(t,e)=>typeof e===o?new s(e):e,u=(t,e,n,o)=>{const a=[];for(let f=r(n),{length:i}=f,u=0;u{const r=s(e.push(n)-1);return t.set(n,r),r},y=(t,n)=>{const r=e(t,i).map(f),s=r[0],o=n||a,c=typeof s===l&&s?u(r,new Set,s,o):s;return o.call({"":c},"",c)},g=(t,e,r)=>{const s=e&&typeof e===l?(t,n)=>""===t||-1y(n(t)),t.parse=y,t.stringify=g,t.toJSON=t=>e(g(t)),t}({}); +self.Flatted=function(t){"use strict";const{parse:e,stringify:n}=JSON,{keys:r}=Object,s=String,o="string",c={},l="object",a=(t,e)=>e,f=t=>t instanceof s?s(t):t,i=(t,e)=>typeof e===o?new s(e):e,u=(t,e,n,o)=>{const a=[];for(let f=r(n),{length:i}=f,u=0;u{const r=s(e.push(n)-1);return t.set(n,r),r},y=(t,n)=>{const r=e(t,i).map(f),s=r[0],o=n||a,c=typeof s===l&&s?u(r,new Set,s,o):s;return o.call({"":c},"",c)},g=(t,e,r)=>{const s=e&&typeof e===l?(t,n)=>""===t||-1y(n(t)),t.parse=y,t.stringify=g,t.toJSON=t=>e(g(t)),t}({}); diff --git a/esm.js b/esm.js index b2a4fc0..a5d5351 100644 --- a/esm.js +++ b/esm.js @@ -1,2 +1 @@ -/*! (c) 2020 Andrea Giammarchi */ const{parse:t,stringify:e}=JSON,{keys:n}=Object,l=String,o="string",r={},s="object",c=(t,e)=>e,a=t=>t instanceof l?l(t):t,f=(t,e)=>typeof e===o?new l(e):e,i=(t,e,o,c)=>{const a=[];for(let f=n(o),{length:i}=f,p=0;p{const o=l(e.push(n)-1);return t.set(n,o),o},u=(e,n)=>{const l=t(e,f).map(a),o=l[0],r=n||c,p=typeof o===s&&o?i(l,new Set,o,r):o;return r.call({"":p},"",p)},h=(t,n,l)=>{const r=n&&typeof n===s?(t,e)=>""===t||-1t(h(e)),g=t=>u(e(t));export{g as fromJSON,u as parse,h as stringify,y as toJSON}; diff --git a/esm/index.js b/esm/index.js index 9a8c239..d891776 100644 --- a/esm/index.js +++ b/esm/index.js @@ -1,4 +1,6 @@ -/*! (c) 2020 Andrea Giammarchi */ +/// + +// (c) 2020-present Andrea Giammarchi const {parse: $parse, stringify: $stringify} = JSON; const {keys} = Object; diff --git a/index.js b/index.js index c03b7d3..72cc530 100644 --- a/index.js +++ b/index.js @@ -11,7 +11,9 @@ self.Flatted = (function (exports) { }, _typeof(o); } - /*! (c) 2020 Andrea Giammarchi */ + // + + // (c) 2020-present Andrea Giammarchi var $parse = JSON.parse, $stringify = JSON.stringify; diff --git a/jsr.json b/jsr.json new file mode 100644 index 0000000..d84c53a --- /dev/null +++ b/jsr.json @@ -0,0 +1,20 @@ +{ + "name": "@wr/flatted", + "version": "3.2.9", + "exports": "./esm/index.js", + "exclude": [ + ".github/*", + "./cjs/*", + "./coverage/*", + "./node_modules/*", + "./rollup/*", + "./test/*", + ".gitignore", + ".npmignore", + ".npmrc", + "es.js", + "index.js", + "min.js", + "package-lock.json" + ] +} diff --git a/min.js b/min.js index b7a8efc..e43fa18 100644 --- a/min.js +++ b/min.js @@ -1,2 +1 @@ -self.Flatted=function(n){"use strict";function t(n){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},t(n) -/*! (c) 2020 Andrea Giammarchi */}var r=JSON.parse,e=JSON.stringify,o=Object.keys,u=String,f="string",i={},c="object",a=function(n,t){return t},l=function(n){return n instanceof u?u(n):n},s=function(n,r){return t(r)===f?new u(r):r},y=function n(r,e,f,a){for(var l=[],s=o(f),y=s.length,p=0;p