Closed xuybin closed 1 month ago
Version: Deno 1.46.3 ---- 2.0.0-rc.6
test.mjs
import colors from "colors"; console.log(`colors.bold`, Object.keys(colors.bold)); console.log(`colors.bold.blue`, colors.bold.blue);
import_map.json
{ "imports": { "colors": "npm:colors@1.4.0" } }
node test.mjs
colors.bold [ '_styles' ] colors.bold.blue [Function: builder] { _styles: [ 'bold', 'blue' ] }
deno run -A --import-map=import_map.json test.mjs
colors.bold [ "_styles", "__proto__" ] colors.bold.blue undefined
You need to run deno with --unstable-unsafe-proto
--unstable-unsafe-proto
thanks.
Version: Deno 1.46.3 ---- 2.0.0-rc.6
test.mjs
import_map.json
node test.mjs
deno run -A --import-map=import_map.json test.mjs