diff --git a/packages/cli/package.json b/packages/cli/package.json index bb48f046d..330001605 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -58,7 +58,7 @@ "@types/es-aggregate-error": "^1.0.2", "@types/xml2js": "^0.4.9", "@types/yargs": "^17.0.8", - "@yao-pkg/pkg": "^5.11.1", + "@yao-pkg/pkg": "^5.13.0", "es-aggregate-error": "^1.0.7", "nock": "^13.5.4", "xml2js": "^0.5.0" diff --git a/packages/core/package.json b/packages/core/package.json index e81f50c44..7381b5627 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -53,7 +53,7 @@ "minimatch": "3.1.2", "nimma": "0.2.3", "pony-cause": "^1.0.0", - "simple-eval": "1.0.0", + "simple-eval": "1.0.1", "tslib": "^2.3.0" }, "devDependencies": { diff --git a/packages/core/src/utils/replacer.ts b/packages/core/src/utils/replacer.ts index cee00d1f8..858f3c865 100644 --- a/packages/core/src/utils/replacer.ts +++ b/packages/core/src/utils/replacer.ts @@ -1,5 +1,5 @@ import { Dictionary } from '@stoplight/types'; -import _eval from 'simple-eval'; +import reduce from 'simple-eval'; export type Transformer> = (this: V, ...args: unknown[]) => string; @@ -24,7 +24,7 @@ export class Replacer> { if (shouldEvaluate) { return String( - _eval(identifier, { + reduce(identifier, { ...Object.entries(this.functions).reduce((fns, [name, fn]) => { fns[name] = fn.bind(values); return fns; diff --git a/yarn.lock b/yarn.lock index 70bf101bc..9d627f229 100644 --- a/yarn.lock +++ b/yarn.lock @@ -126,7 +126,7 @@ __metadata: languageName: node linkType: hard -"@babel/generator@npm:7.23.0, @babel/generator@npm:^7.18.9, @babel/generator@npm:^7.23.0, @babel/generator@npm:^7.7.2": +"@babel/generator@npm:^7.18.9, @babel/generator@npm:^7.23.0, @babel/generator@npm:^7.7.2": version: 7.23.0 resolution: "@babel/generator@npm:7.23.0" dependencies: @@ -508,7 +508,7 @@ __metadata: languageName: node linkType: hard -"@babel/parser@npm:7.23.0, @babel/parser@npm:^7.1.0, @babel/parser@npm:^7.14.7, @babel/parser@npm:^7.18.9, @babel/parser@npm:^7.22.15, @babel/parser@npm:^7.23.0": +"@babel/parser@npm:^7.1.0, @babel/parser@npm:^7.14.7, @babel/parser@npm:^7.18.9, @babel/parser@npm:^7.22.15, @babel/parser@npm:^7.23.0": version: 7.23.0 resolution: "@babel/parser@npm:7.23.0" bin: @@ -1395,7 +1395,7 @@ __metadata: languageName: node linkType: hard -"@babel/types@npm:7.23.0, @babel/types@npm:^7.0.0, @babel/types@npm:^7.10.4, @babel/types@npm:^7.10.5, @babel/types@npm:^7.12.1, @babel/types@npm:^7.12.10, @babel/types@npm:^7.12.11, @babel/types@npm:^7.14.5, @babel/types@npm:^7.18.6, @babel/types@npm:^7.18.9, @babel/types@npm:^7.22.15, @babel/types@npm:^7.22.5, @babel/types@npm:^7.23.0, @babel/types@npm:^7.3.0, @babel/types@npm:^7.3.3, @babel/types@npm:^7.4.4, @babel/types@npm:^7.8.3": +"@babel/types@npm:^7.0.0, @babel/types@npm:^7.10.4, @babel/types@npm:^7.10.5, @babel/types@npm:^7.12.1, @babel/types@npm:^7.12.10, @babel/types@npm:^7.12.11, @babel/types@npm:^7.14.5, @babel/types@npm:^7.18.6, @babel/types@npm:^7.18.9, @babel/types@npm:^7.22.15, @babel/types@npm:^7.22.5, @babel/types@npm:^7.23.0, @babel/types@npm:^7.3.0, @babel/types@npm:^7.3.3, @babel/types@npm:^7.4.4, @babel/types@npm:^7.8.3": version: 7.23.0 resolution: "@babel/types@npm:7.23.0" dependencies: @@ -2936,7 +2936,7 @@ __metadata: "@types/es-aggregate-error": ^1.0.2 "@types/xml2js": ^0.4.9 "@types/yargs": ^17.0.8 - "@yao-pkg/pkg": ^5.11.1 + "@yao-pkg/pkg": ^5.13.0 chalk: 4.1.2 es-aggregate-error: ^1.0.7 fast-glob: ~3.2.12 @@ -2982,7 +2982,7 @@ __metadata: nimma: 0.2.3 nock: ^13.5.4 pony-cause: ^1.0.0 - simple-eval: 1.0.0 + simple-eval: 1.0.1 treeify: ^1.1.0 tslib: ^2.3.0 languageName: unknown @@ -3919,45 +3919,43 @@ __metadata: languageName: node linkType: hard -"@yao-pkg/pkg-fetch@npm:3.5.7": - version: 3.5.7 - resolution: "@yao-pkg/pkg-fetch@npm:3.5.7" +"@yao-pkg/pkg-fetch@npm:3.5.16": + version: 3.5.16 + resolution: "@yao-pkg/pkg-fetch@npm:3.5.16" dependencies: - chalk: ^4.1.2 - fs-extra: ^9.1.0 https-proxy-agent: ^5.0.0 node-fetch: ^2.6.6 + picocolors: ^1.1.0 progress: ^2.0.3 semver: ^7.3.5 tar-fs: ^2.1.1 yargs: ^16.2.0 bin: pkg-fetch: lib-es5/bin.js - checksum: df339cabeef44ce7d9edeea18fa6313686d2ad864a0e67c715ee293bd9ee982e3dc7055c40559e5d6b905468c93a1c630b6f1d694d7c1322b6f7f8bbe7a59f1b + checksum: 942b633e9da431778a3527a18647db0feb4d87ceb2487fc025b5ed60a76ca040964f366e187b4d4b3c7f5d49abe86983b395d1753afe0f134a544231c71d1860 languageName: node linkType: hard -"@yao-pkg/pkg@npm:^5.11.1": - version: 5.11.1 - resolution: "@yao-pkg/pkg@npm:5.11.1" +"@yao-pkg/pkg@npm:^5.13.0": + version: 5.16.1 + resolution: "@yao-pkg/pkg@npm:5.16.1" dependencies: - "@babel/generator": 7.23.0 - "@babel/parser": 7.23.0 - "@babel/types": 7.23.0 - "@yao-pkg/pkg-fetch": 3.5.7 - chalk: ^4.1.2 - fs-extra: ^9.1.0 - globby: ^11.1.0 + "@babel/generator": ^7.23.0 + "@babel/parser": ^7.23.0 + "@babel/types": ^7.23.0 + "@yao-pkg/pkg-fetch": 3.5.16 into-stream: ^6.0.0 - is-core-module: 2.9.0 minimist: ^1.2.6 multistream: ^4.1.0 - prebuild-install: 7.1.1 + picocolors: ^1.1.0 + picomatch: ^4.0.2 + prebuild-install: ^7.1.1 resolve: ^1.22.0 stream-meter: ^1.0.4 + tinyglobby: ^0.2.9 bin: pkg: lib-es5/bin.js - checksum: aba36e68411953169f7bf29229f7e18835b671fa25ff12c72d899e6a18b33f2e8edc40f762cad1ef3e331ccbea4dceb807a6adf7d3dcfeb4b09a6819054c9a92 + checksum: c7627e6d535df22b49476dffd5b73cee185f4a96433f91478a113a0d9c22c9b320fe73196a40246f2a482b696fb6af1ebeae5ff15a8dba36513d0a95490d34be languageName: node linkType: hard @@ -6969,6 +6967,18 @@ __metadata: languageName: node linkType: hard +"fdir@npm:^6.4.2": + version: 6.4.2 + resolution: "fdir@npm:6.4.2" + peerDependencies: + picomatch: ^3 || ^4 + peerDependenciesMeta: + picomatch: + optional: true + checksum: 517ad31c495f1c0778238eef574a7818788efaaf2ce1969ffa18c70793e2951a9763dfa2e6720b8fcef615e602a3cbb47f9b8aea9da0b02147579ab36043f22f + languageName: node + linkType: hard + "fetch-mock@npm:^9.11.0": version: 9.11.0 resolution: "fetch-mock@npm:9.11.0" @@ -7194,7 +7204,7 @@ __metadata: languageName: node linkType: hard -"fs-extra@npm:^9.0.0, fs-extra@npm:^9.1.0": +"fs-extra@npm:^9.0.0": version: 9.1.0 resolution: "fs-extra@npm:9.1.0" dependencies: @@ -8175,7 +8185,7 @@ __metadata: languageName: node linkType: hard -"is-core-module@npm:2.9.0, is-core-module@npm:^2.5.0, is-core-module@npm:^2.8.1, is-core-module@npm:^2.9.0": +"is-core-module@npm:^2.5.0, is-core-module@npm:^2.8.1, is-core-module@npm:^2.9.0": version: 2.9.0 resolution: "is-core-module@npm:2.9.0" dependencies: @@ -9080,13 +9090,6 @@ __metadata: languageName: node linkType: hard -"jsep@npm:^1.1.2": - version: 1.3.6 - resolution: "jsep@npm:1.3.6" - checksum: e166a8fa453878e0b64cc82025db13bb6d4835b36de892373722f7cecd9cdaed05dc61db090a0d84426783ff0aab419d1719801b2014796beb873030a3c8b12a - languageName: node - linkType: hard - "jsep@npm:^1.2.0, jsep@npm:^1.3.9": version: 1.3.9 resolution: "jsep@npm:1.3.9" @@ -9094,6 +9097,13 @@ __metadata: languageName: node linkType: hard +"jsep@npm:^1.3.6": + version: 1.4.0 + resolution: "jsep@npm:1.4.0" + checksum: 8e7af5ecb91483b227092b87a3e85b5df3e848dbe6f201b19efcb18047567530d21dfeecb0978e09d1f66554fcfaed84176819eeacdfc86f61dc05c40c18f824 + languageName: node + linkType: hard + "jsesc@npm:^2.5.1": version: 2.5.2 resolution: "jsesc@npm:2.5.2" @@ -11460,6 +11470,13 @@ __metadata: languageName: node linkType: hard +"picomatch@npm:^4.0.2": + version: 4.0.2 + resolution: "picomatch@npm:4.0.2" + checksum: a7a5188c954f82c6585720e9143297ccd0e35ad8072231608086ca950bee672d51b0ef676254af0788205e59bd4e4deb4e7708769226bed725bf13370a7d1464 + languageName: node + linkType: hard + "pify@npm:^3.0.0": version: 3.0.0 resolution: "pify@npm:3.0.0" @@ -11526,9 +11543,9 @@ __metadata: languageName: node linkType: hard -"prebuild-install@npm:7.1.1": - version: 7.1.1 - resolution: "prebuild-install@npm:7.1.1" +"prebuild-install@npm:^7.1.1": + version: 7.1.2 + resolution: "prebuild-install@npm:7.1.2" dependencies: detect-libc: ^2.0.0 expand-template: ^2.0.3 @@ -11544,7 +11561,7 @@ __metadata: tunnel-agent: ^0.6.0 bin: prebuild-install: bin.js - checksum: dbf96d0146b6b5827fc8f67f72074d2e19c69628b9a7a0a17d0fad1bf37e9f06922896972e074197fc00a52eae912993e6ef5a0d471652f561df5cb516f3f467 + checksum: 543dadf8c60e004ae9529e6013ca0cbeac8ef38b5f5ba5518cb0b622fe7f8758b34e4b5cb1a791db3cdc9d2281766302df6088bd1a225f206925d6fee17d6c5c languageName: node linkType: hard @@ -12621,12 +12638,12 @@ __metadata: languageName: node linkType: hard -"simple-eval@npm:1.0.0": - version: 1.0.0 - resolution: "simple-eval@npm:1.0.0" +"simple-eval@npm:1.0.1": + version: 1.0.1 + resolution: "simple-eval@npm:1.0.1" dependencies: - jsep: ^1.1.2 - checksum: 0f0719ae3a84d4b9c19366dc03065b1fe9638c982ed3e9d44ba541d25e3454e99419e3239034974fd6c5074b79c119419168b8f343fef4da6d7e35227cfd1f87 + jsep: ^1.3.6 + checksum: 280207cfe4538c500f6b41e4d88576cf250337b0042bec8f9f5cf025b3a70e07974e522edd01e69d378767dd73068765d4f46ad55db5c94943c8f3585bff95af languageName: node linkType: hard @@ -13352,6 +13369,16 @@ __metadata: languageName: node linkType: hard +"tinyglobby@npm:^0.2.9": + version: 0.2.10 + resolution: "tinyglobby@npm:0.2.10" + dependencies: + fdir: ^6.4.2 + picomatch: ^4.0.2 + checksum: 7e2ffe262ebc149036bdef37c56b32d02d52cf09efa7d43dbdab2ea3c12844a4da881058835ce4c74d1891190e5ad5ec5133560a11ec8314849b68ad0d99d3f4 + languageName: node + linkType: hard + "tmp@npm:^0.0.33": version: 0.0.33 resolution: "tmp@npm:0.0.33"