@bolt-foundry/gambit 0.8.3 → 0.8.5-rc.5
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 +38 -2
- package/README.md +79 -16
- package/esm/_dnt.polyfills.d.ts +17 -0
- package/esm/_dnt.polyfills.d.ts.map +1 -1
- package/esm/_dnt.polyfills.js +122 -0
- package/esm/deps/jsr.io/@std/collections/1.1.5/deep_merge.d.ts +322 -0
- package/esm/deps/jsr.io/@std/collections/1.1.5/deep_merge.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.1.5/deep_merge.js +105 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/_create_walk_entry.d.ts +14 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/_create_walk_entry.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/_create_walk_entry.js +34 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/_get_file_info_type.d.ts +13 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/_get_file_info_type.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/_get_file_info_type.js +18 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/_is_same_path.d.ts +10 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/_is_same_path.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/_is_same_path.js +17 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/_is_subdir.d.ts +12 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/_is_subdir.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/_is_subdir.js +25 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/_to_path_string.d.ts +9 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/_to_path_string.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/_to_path_string.js +13 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/copy.d.ts +117 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/copy.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/copy.js +313 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/empty_dir.d.ts +48 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/empty_dir.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/empty_dir.js +87 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/ensure_dir.d.ts +49 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/ensure_dir.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/ensure_dir.js +102 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/ensure_file.d.ts +47 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/ensure_file.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/ensure_file.js +90 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/ensure_link.d.ts +49 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/ensure_link.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/ensure_link.js +61 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/ensure_symlink.d.ts +70 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/ensure_symlink.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/ensure_symlink.js +156 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/eol.d.ts +52 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/eol.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/eol.js +67 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/exists.d.ts +218 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/exists.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/exists.js +271 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/expand_glob.d.ts +267 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/expand_glob.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/expand_glob.js +442 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/mod.d.ts +29 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/mod.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/mod.js +29 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/move.d.ts +86 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/move.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/move.js +142 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/walk.d.ts +777 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/walk.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/walk.js +846 -0
- package/esm/deps/jsr.io/@std/json/1.0.2/types.d.ts +5 -0
- package/esm/deps/jsr.io/@std/json/1.0.2/types.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/json/1.0.2/types.js +3 -0
- package/esm/deps/jsr.io/@std/jsonc/1.0.2/mod.d.ts +20 -0
- package/esm/deps/jsr.io/@std/jsonc/1.0.2/mod.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/jsonc/1.0.2/mod.js +21 -0
- package/esm/deps/jsr.io/@std/jsonc/1.0.2/parse.d.ts +21 -0
- package/esm/deps/jsr.io/@std/jsonc/1.0.2/parse.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/jsonc/1.0.2/parse.js +320 -0
- package/esm/deps/jsr.io/@std/toml/1.0.11/_parser.d.ts +93 -0
- package/esm/deps/jsr.io/@std/toml/1.0.11/_parser.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/toml/1.0.11/_parser.js +753 -0
- package/esm/deps/jsr.io/@std/toml/1.0.11/mod.d.ts +109 -0
- package/esm/deps/jsr.io/@std/toml/1.0.11/mod.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/toml/1.0.11/mod.js +110 -0
- package/esm/deps/jsr.io/@std/toml/1.0.11/parse.d.ts +21 -0
- package/esm/deps/jsr.io/@std/toml/1.0.11/parse.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/toml/1.0.11/parse.js +25 -0
- package/esm/deps/jsr.io/@std/toml/1.0.11/stringify.d.ts +35 -0
- package/esm/deps/jsr.io/@std/toml/1.0.11/stringify.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/toml/1.0.11/stringify.js +283 -0
- package/esm/gambit/simulator-ui/dist/bundle.js +10639 -4629
- package/esm/gambit/simulator-ui/dist/bundle.js.map +4 -4
- package/esm/mod.d.ts +13 -3
- package/esm/mod.d.ts.map +1 -1
- package/esm/mod.js +8 -2
- package/esm/src/cli_utils.d.ts +1 -0
- package/esm/src/cli_utils.d.ts.map +1 -1
- package/esm/src/cli_utils.js +13 -1
- package/esm/src/default_runtime.d.ts +46 -0
- package/esm/src/default_runtime.d.ts.map +1 -0
- package/esm/src/default_runtime.js +415 -0
- package/esm/src/durable_streams.js +26 -1
- package/esm/src/model_matchers.d.ts +10 -0
- package/esm/src/model_matchers.d.ts.map +1 -0
- package/esm/src/model_matchers.js +26 -0
- package/esm/src/openai_compat.d.ts +12 -1
- package/esm/src/openai_compat.d.ts.map +1 -1
- package/esm/src/openai_compat.js +53 -1
- package/esm/src/project_config.d.ts +47 -0
- package/esm/src/project_config.d.ts.map +1 -0
- package/esm/src/project_config.js +134 -0
- package/esm/src/providers/codex.d.ts +37 -0
- package/esm/src/providers/codex.d.ts.map +1 -0
- package/esm/src/providers/codex.js +810 -0
- package/esm/src/providers/google.d.ts +3 -1
- package/esm/src/providers/google.d.ts.map +1 -1
- package/esm/src/providers/google.js +82 -6
- package/esm/src/providers/ollama.d.ts +3 -1
- package/esm/src/providers/ollama.d.ts.map +1 -1
- package/esm/src/providers/ollama.js +238 -15
- package/esm/src/providers/openrouter.d.ts +6 -2
- package/esm/src/providers/openrouter.d.ts.map +1 -1
- package/esm/src/providers/openrouter.js +260 -23
- package/esm/src/providers/router.d.ts +19 -0
- package/esm/src/providers/router.d.ts.map +1 -0
- package/esm/src/providers/router.js +93 -0
- package/esm/src/server.d.ts +9 -0
- package/esm/src/server.d.ts.map +1 -1
- package/esm/src/server.js +3186 -652
- package/esm/src/server_feedback_grading_routes.d.ts +32 -0
- package/esm/src/server_feedback_grading_routes.d.ts.map +1 -0
- package/esm/src/server_feedback_grading_routes.js +305 -0
- package/esm/src/server_helpers.d.ts +4 -0
- package/esm/src/server_helpers.d.ts.map +1 -0
- package/esm/src/server_helpers.js +46 -0
- package/esm/src/server_session_store.d.ts +87 -0
- package/esm/src/server_session_store.d.ts.map +1 -0
- package/esm/src/server_session_store.js +873 -0
- package/esm/src/server_types.d.ts +110 -0
- package/esm/src/server_types.d.ts.map +1 -0
- package/esm/src/server_types.js +1 -0
- package/esm/src/server_ui_routes.d.ts +33 -0
- package/esm/src/server_ui_routes.d.ts.map +1 -0
- package/esm/src/server_ui_routes.js +135 -0
- package/esm/src/session_artifacts.d.ts +22 -0
- package/esm/src/session_artifacts.d.ts.map +1 -0
- package/esm/src/session_artifacts.js +243 -0
- package/esm/src/trace.d.ts.map +1 -1
- package/esm/src/trace.js +6 -3
- package/esm/src/workspace.d.ts +19 -0
- package/esm/src/workspace.d.ts.map +1 -0
- package/esm/src/workspace.js +164 -0
- package/esm/src/workspace_contract.d.ts +76 -0
- package/esm/src/workspace_contract.d.ts.map +1 -0
- package/esm/src/workspace_contract.js +74 -0
- package/package.json +2 -2
- package/script/_dnt.polyfills.d.ts +17 -0
- package/script/_dnt.polyfills.d.ts.map +1 -1
- package/script/_dnt.polyfills.js +122 -0
- package/script/deps/jsr.io/@std/collections/1.1.5/deep_merge.d.ts +322 -0
- package/script/deps/jsr.io/@std/collections/1.1.5/deep_merge.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/collections/1.1.5/deep_merge.js +108 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/_create_walk_entry.d.ts +14 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/_create_walk_entry.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/_create_walk_entry.js +71 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/_get_file_info_type.d.ts +13 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/_get_file_info_type.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/_get_file_info_type.js +21 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/_is_same_path.d.ts +10 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/_is_same_path.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/_is_same_path.js +20 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/_is_subdir.d.ts +12 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/_is_subdir.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/_is_subdir.js +28 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/_to_path_string.d.ts +9 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/_to_path_string.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/_to_path_string.js +16 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/copy.d.ts +117 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/copy.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/copy.js +350 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/empty_dir.d.ts +48 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/empty_dir.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/empty_dir.js +124 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/ensure_dir.d.ts +49 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/ensure_dir.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/ensure_dir.js +139 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/ensure_file.d.ts +47 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/ensure_file.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/ensure_file.js +127 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/ensure_link.d.ts +49 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/ensure_link.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/ensure_link.js +98 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/ensure_symlink.d.ts +70 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/ensure_symlink.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/ensure_symlink.js +193 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/eol.d.ts +52 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/eol.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/eol.js +105 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/exists.d.ts +218 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/exists.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/exists.js +308 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/expand_glob.d.ts +267 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/expand_glob.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/expand_glob.js +479 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/mod.d.ts +29 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/mod.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/mod.js +45 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/move.d.ts +86 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/move.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/move.js +179 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/walk.d.ts +777 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/walk.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/walk.js +883 -0
- package/script/deps/jsr.io/@std/json/1.0.2/types.d.ts +5 -0
- package/script/deps/jsr.io/@std/json/1.0.2/types.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/json/1.0.2/types.js +4 -0
- package/script/deps/jsr.io/@std/jsonc/1.0.2/mod.d.ts +20 -0
- package/script/deps/jsr.io/@std/jsonc/1.0.2/mod.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/jsonc/1.0.2/mod.js +37 -0
- package/script/deps/jsr.io/@std/jsonc/1.0.2/parse.d.ts +21 -0
- package/script/deps/jsr.io/@std/jsonc/1.0.2/parse.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/jsonc/1.0.2/parse.js +323 -0
- package/script/deps/jsr.io/@std/toml/1.0.11/_parser.d.ts +93 -0
- package/script/deps/jsr.io/@std/toml/1.0.11/_parser.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/toml/1.0.11/_parser.js +781 -0
- package/script/deps/jsr.io/@std/toml/1.0.11/mod.d.ts +109 -0
- package/script/deps/jsr.io/@std/toml/1.0.11/mod.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/toml/1.0.11/mod.js +126 -0
- package/script/deps/jsr.io/@std/toml/1.0.11/parse.d.ts +21 -0
- package/script/deps/jsr.io/@std/toml/1.0.11/parse.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/toml/1.0.11/parse.js +28 -0
- package/script/deps/jsr.io/@std/toml/1.0.11/stringify.d.ts +35 -0
- package/script/deps/jsr.io/@std/toml/1.0.11/stringify.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/toml/1.0.11/stringify.js +286 -0
- package/script/gambit/simulator-ui/dist/bundle.js +10639 -4629
- package/script/gambit/simulator-ui/dist/bundle.js.map +4 -4
- package/script/mod.d.ts +13 -3
- package/script/mod.d.ts.map +1 -1
- package/script/mod.js +14 -5
- package/script/src/cli_utils.d.ts +1 -0
- package/script/src/cli_utils.d.ts.map +1 -1
- package/script/src/cli_utils.js +14 -1
- package/script/src/default_runtime.d.ts +46 -0
- package/script/src/default_runtime.d.ts.map +1 -0
- package/script/src/default_runtime.js +452 -0
- package/script/src/durable_streams.js +26 -1
- package/script/src/model_matchers.d.ts +10 -0
- package/script/src/model_matchers.d.ts.map +1 -0
- package/script/src/model_matchers.js +29 -0
- package/script/src/openai_compat.d.ts +12 -1
- package/script/src/openai_compat.d.ts.map +1 -1
- package/script/src/openai_compat.js +85 -0
- package/script/src/project_config.d.ts +47 -0
- package/script/src/project_config.d.ts.map +1 -0
- package/script/src/project_config.js +173 -0
- package/script/src/providers/codex.d.ts +37 -0
- package/script/src/providers/codex.d.ts.map +1 -0
- package/script/src/providers/codex.js +850 -0
- package/script/src/providers/google.d.ts +3 -1
- package/script/src/providers/google.d.ts.map +1 -1
- package/script/src/providers/google.js +82 -6
- package/script/src/providers/ollama.d.ts +3 -1
- package/script/src/providers/ollama.d.ts.map +1 -1
- package/script/src/providers/ollama.js +238 -15
- package/script/src/providers/openrouter.d.ts +6 -2
- package/script/src/providers/openrouter.d.ts.map +1 -1
- package/script/src/providers/openrouter.js +260 -23
- package/script/src/providers/router.d.ts +19 -0
- package/script/src/providers/router.d.ts.map +1 -0
- package/script/src/providers/router.js +96 -0
- package/script/src/server.d.ts +9 -0
- package/script/src/server.d.ts.map +1 -1
- package/script/src/server.js +3193 -659
- package/script/src/server_feedback_grading_routes.d.ts +32 -0
- package/script/src/server_feedback_grading_routes.d.ts.map +1 -0
- package/script/src/server_feedback_grading_routes.js +343 -0
- package/script/src/server_helpers.d.ts +4 -0
- package/script/src/server_helpers.d.ts.map +1 -0
- package/script/src/server_helpers.js +84 -0
- package/script/src/server_session_store.d.ts +87 -0
- package/script/src/server_session_store.d.ts.map +1 -0
- package/script/src/server_session_store.js +910 -0
- package/script/src/server_types.d.ts +110 -0
- package/script/src/server_types.d.ts.map +1 -0
- package/script/src/server_types.js +2 -0
- package/script/src/server_ui_routes.d.ts +33 -0
- package/script/src/server_ui_routes.d.ts.map +1 -0
- package/script/src/server_ui_routes.js +172 -0
- package/script/src/session_artifacts.d.ts +22 -0
- package/script/src/session_artifacts.d.ts.map +1 -0
- package/script/src/session_artifacts.js +279 -0
- package/script/src/trace.d.ts.map +1 -1
- package/script/src/trace.js +6 -3
- package/script/src/workspace.d.ts +19 -0
- package/script/src/workspace.d.ts.map +1 -0
- package/script/src/workspace.js +201 -0
- package/script/src/workspace_contract.d.ts +76 -0
- package/script/src/workspace_contract.d.ts.map +1 -0
- package/script/src/workspace_contract.js +82 -0
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
// Copyright 2018-2026 the Deno authors. MIT license.
|
|
2
|
+
// This module is browser compatible.
|
|
3
|
+
/** Default merging options - cached to avoid object allocation on each call */
|
|
4
|
+
const DEFAULT_OPTIONS = {
|
|
5
|
+
arrays: "merge",
|
|
6
|
+
sets: "merge",
|
|
7
|
+
maps: "merge",
|
|
8
|
+
};
|
|
9
|
+
export function deepMerge(record, other, options) {
|
|
10
|
+
return deepMergeInternal(record, other, new Set(), options ?? DEFAULT_OPTIONS);
|
|
11
|
+
}
|
|
12
|
+
function deepMergeInternal(record, other, seen, options) {
|
|
13
|
+
const result = {};
|
|
14
|
+
const keys = new Set([
|
|
15
|
+
...getKeys(record),
|
|
16
|
+
...getKeys(other),
|
|
17
|
+
]);
|
|
18
|
+
// Iterate through each key of other object and use correct merging strategy
|
|
19
|
+
for (const key of keys) {
|
|
20
|
+
// Skip to prevent Object.prototype.__proto__ accessor property calls on non-Deno platforms
|
|
21
|
+
if (key === "__proto__") {
|
|
22
|
+
continue;
|
|
23
|
+
}
|
|
24
|
+
const a = record[key];
|
|
25
|
+
if (!Object.hasOwn(other, key)) {
|
|
26
|
+
result[key] = a;
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
const b = other[key];
|
|
30
|
+
if (isNonNullObject(a) && isNonNullObject(b) && !seen.has(a) && !seen.has(b)) {
|
|
31
|
+
seen.add(a);
|
|
32
|
+
seen.add(b);
|
|
33
|
+
result[key] = mergeObjects(a, b, seen, options);
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
// Override value
|
|
37
|
+
result[key] = b;
|
|
38
|
+
}
|
|
39
|
+
return result;
|
|
40
|
+
}
|
|
41
|
+
function mergeObjects(left, right, seen, options) {
|
|
42
|
+
// Recursively merge mergeable objects
|
|
43
|
+
if (isMergeable(left) && isMergeable(right)) {
|
|
44
|
+
return deepMergeInternal(left, right, seen, options);
|
|
45
|
+
}
|
|
46
|
+
if (isIterable(left) && isIterable(right)) {
|
|
47
|
+
// Handle arrays
|
|
48
|
+
if ((Array.isArray(left)) && (Array.isArray(right))) {
|
|
49
|
+
if (options.arrays === "merge") {
|
|
50
|
+
return left.concat(right);
|
|
51
|
+
}
|
|
52
|
+
return right;
|
|
53
|
+
}
|
|
54
|
+
// Handle maps
|
|
55
|
+
if ((left instanceof Map) && (right instanceof Map)) {
|
|
56
|
+
if (options.maps === "merge") {
|
|
57
|
+
const result = new Map(left);
|
|
58
|
+
for (const [k, v] of right) {
|
|
59
|
+
result.set(k, v);
|
|
60
|
+
}
|
|
61
|
+
return result;
|
|
62
|
+
}
|
|
63
|
+
return right;
|
|
64
|
+
}
|
|
65
|
+
// Handle sets
|
|
66
|
+
if ((left instanceof Set) && (right instanceof Set)) {
|
|
67
|
+
if (options.sets === "merge") {
|
|
68
|
+
const result = new Set(left);
|
|
69
|
+
for (const v of right) {
|
|
70
|
+
result.add(v);
|
|
71
|
+
}
|
|
72
|
+
return result;
|
|
73
|
+
}
|
|
74
|
+
return right;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return right;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Test whether a value is mergeable or not
|
|
81
|
+
* Builtins that look like objects, null and user defined classes
|
|
82
|
+
* are not considered mergeable (it means that reference will be copied)
|
|
83
|
+
*/
|
|
84
|
+
function isMergeable(value) {
|
|
85
|
+
return Object.getPrototypeOf(value) === Object.prototype;
|
|
86
|
+
}
|
|
87
|
+
function isIterable(value) {
|
|
88
|
+
return typeof value[Symbol.iterator] === "function";
|
|
89
|
+
}
|
|
90
|
+
function isNonNullObject(value) {
|
|
91
|
+
return value !== null && typeof value === "object";
|
|
92
|
+
}
|
|
93
|
+
function getKeys(record) {
|
|
94
|
+
const keys = Object.keys(record);
|
|
95
|
+
const symbols = Object.getOwnPropertySymbols(record);
|
|
96
|
+
// Fast path: most objects have no symbol keys
|
|
97
|
+
if (symbols.length === 0)
|
|
98
|
+
return keys;
|
|
99
|
+
for (const sym of symbols) {
|
|
100
|
+
if (Object.prototype.propertyIsEnumerable.call(record, sym)) {
|
|
101
|
+
keys.push(sym);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
return keys;
|
|
105
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as dntShim from "../../../../../_dnt.shims.js";
|
|
2
|
+
/**
|
|
3
|
+
* Walk entry for {@linkcode walk}, {@linkcode walkSync},
|
|
4
|
+
* {@linkcode expandGlob} and {@linkcode expandGlobSync}.
|
|
5
|
+
*/
|
|
6
|
+
export interface WalkEntry extends dntShim.Deno.DirEntry {
|
|
7
|
+
/** Full path of the entry. */
|
|
8
|
+
path: string;
|
|
9
|
+
}
|
|
10
|
+
/** Create {@linkcode WalkEntry} for the `path` synchronously. */
|
|
11
|
+
export declare function createWalkEntrySync(path: string | URL): WalkEntry;
|
|
12
|
+
/** Create {@linkcode WalkEntry} for the `path` asynchronously. */
|
|
13
|
+
export declare function createWalkEntry(path: string | URL): Promise<WalkEntry>;
|
|
14
|
+
//# sourceMappingURL=_create_walk_entry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_create_walk_entry.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/fs/1.0.22/_create_walk_entry.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,OAAO,MAAM,8BAA8B,CAAC;AAOxD;;;GAGG;AACH,MAAM,WAAW,SAAU,SAAQ,OAAO,CAAC,IAAI,CAAC,QAAQ;IACtD,8BAA8B;IAC9B,IAAI,EAAE,MAAM,CAAC;CACd;AAED,iEAAiE;AACjE,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,GAAG,SAAS,CAYjE;AAED,kEAAkE;AAClE,wBAAsB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,GAAG,OAAO,CAAC,SAAS,CAAC,CAY5E"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// Copyright 2018-2026 the Deno authors. MIT license.
|
|
2
|
+
// Copyright the Browserify authors. MIT License.
|
|
3
|
+
import * as dntShim from "../../../../../_dnt.shims.js";
|
|
4
|
+
import { basename } from "../../path/1.1.4/basename.js";
|
|
5
|
+
import { normalize } from "../../path/1.1.4/normalize.js";
|
|
6
|
+
import { toPathString } from "./_to_path_string.js";
|
|
7
|
+
/** Create {@linkcode WalkEntry} for the `path` synchronously. */
|
|
8
|
+
export function createWalkEntrySync(path) {
|
|
9
|
+
path = toPathString(path);
|
|
10
|
+
path = normalize(path);
|
|
11
|
+
const name = basename(path);
|
|
12
|
+
const info = dntShim.Deno.statSync(path);
|
|
13
|
+
return {
|
|
14
|
+
path,
|
|
15
|
+
name,
|
|
16
|
+
isFile: info.isFile,
|
|
17
|
+
isDirectory: info.isDirectory,
|
|
18
|
+
isSymlink: info.isSymlink,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
/** Create {@linkcode WalkEntry} for the `path` asynchronously. */
|
|
22
|
+
export async function createWalkEntry(path) {
|
|
23
|
+
path = toPathString(path);
|
|
24
|
+
path = normalize(path);
|
|
25
|
+
const name = basename(path);
|
|
26
|
+
const info = await dntShim.Deno.stat(path);
|
|
27
|
+
return {
|
|
28
|
+
path,
|
|
29
|
+
name,
|
|
30
|
+
isFile: info.isFile,
|
|
31
|
+
isDirectory: info.isDirectory,
|
|
32
|
+
isSymlink: info.isSymlink,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as dntShim from "../../../../../_dnt.shims.js";
|
|
2
|
+
export type PathType = "file" | "dir" | "symlink";
|
|
3
|
+
/**
|
|
4
|
+
* Get a human readable file type string.
|
|
5
|
+
*
|
|
6
|
+
* @param file File information, as returned by {@linkcode Deno.stat} or
|
|
7
|
+
* {@linkcode Deno.lstat}.
|
|
8
|
+
*
|
|
9
|
+
* @returns The file type as a string, or `undefined` if the file type is
|
|
10
|
+
* unknown.
|
|
11
|
+
*/
|
|
12
|
+
export declare function getFileInfoType(fileInfo: dntShim.Deno.FileInfo): PathType | undefined;
|
|
13
|
+
//# sourceMappingURL=_get_file_info_type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_get_file_info_type.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/fs/1.0.22/_get_file_info_type.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,OAAO,MAAM,8BAA8B,CAAC;AAGxD,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,KAAK,GAAG,SAAS,CAAC;AAElD;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,OAAO,CAAC,IAAI,CAAC,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAQrF"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Get a human readable file type string.
|
|
3
|
+
*
|
|
4
|
+
* @param file File information, as returned by {@linkcode Deno.stat} or
|
|
5
|
+
* {@linkcode Deno.lstat}.
|
|
6
|
+
*
|
|
7
|
+
* @returns The file type as a string, or `undefined` if the file type is
|
|
8
|
+
* unknown.
|
|
9
|
+
*/
|
|
10
|
+
export function getFileInfoType(fileInfo) {
|
|
11
|
+
return fileInfo.isFile
|
|
12
|
+
? "file"
|
|
13
|
+
: fileInfo.isDirectory
|
|
14
|
+
? "dir"
|
|
15
|
+
: fileInfo.isSymlink
|
|
16
|
+
? "symlink"
|
|
17
|
+
: undefined;
|
|
18
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checks if two paths are the same.
|
|
3
|
+
*
|
|
4
|
+
* @param src Source file path as a string or URL.
|
|
5
|
+
* @param dest Destination file path as a string or URL.
|
|
6
|
+
*
|
|
7
|
+
* @returns `true` if the paths are the same, `false` otherwise.
|
|
8
|
+
*/
|
|
9
|
+
export declare function isSamePath(src: string | URL, dest: string | URL): boolean;
|
|
10
|
+
//# sourceMappingURL=_is_same_path.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_is_same_path.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/fs/1.0.22/_is_same_path.ts"],"names":[],"mappings":"AAMA;;;;;;;GAOG;AACH,wBAAgB,UAAU,CACxB,GAAG,EAAE,MAAM,GAAG,GAAG,EACjB,IAAI,EAAE,MAAM,GAAG,GAAG,GACjB,OAAO,CAKT"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// Copyright 2018-2026 the Deno authors. MIT license.
|
|
2
|
+
// Copyright the Browserify authors. MIT License.
|
|
3
|
+
import { resolve } from "../../path/1.1.4/resolve.js";
|
|
4
|
+
import { toPathString } from "./_to_path_string.js";
|
|
5
|
+
/**
|
|
6
|
+
* Checks if two paths are the same.
|
|
7
|
+
*
|
|
8
|
+
* @param src Source file path as a string or URL.
|
|
9
|
+
* @param dest Destination file path as a string or URL.
|
|
10
|
+
*
|
|
11
|
+
* @returns `true` if the paths are the same, `false` otherwise.
|
|
12
|
+
*/
|
|
13
|
+
export function isSamePath(src, dest) {
|
|
14
|
+
src = toPathString(src);
|
|
15
|
+
dest = toPathString(dest);
|
|
16
|
+
return resolve(src) === resolve(dest);
|
|
17
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checks whether `src` is a sub-directory of `dest`.
|
|
3
|
+
*
|
|
4
|
+
* @param src Source file path as a string or URL.
|
|
5
|
+
* @param dest Destination file path as a string or URL.
|
|
6
|
+
* @param sep Path separator. Defaults to `\\` for Windows and `/` for other
|
|
7
|
+
* platforms.
|
|
8
|
+
*
|
|
9
|
+
* @returns `true` if `src` is a sub-directory of `dest`, `false` otherwise.
|
|
10
|
+
*/
|
|
11
|
+
export declare function isSubdir(src: string | URL, dest: string | URL, sep?: "/" | "\\"): boolean;
|
|
12
|
+
//# sourceMappingURL=_is_subdir.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_is_subdir.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/fs/1.0.22/_is_subdir.ts"],"names":[],"mappings":"AAOA;;;;;;;;;GASG;AACH,wBAAgB,QAAQ,CACtB,GAAG,EAAE,MAAM,GAAG,GAAG,EACjB,IAAI,EAAE,MAAM,GAAG,GAAG,EAClB,GAAG,aAAY,GACd,OAAO,CAYT"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// Copyright 2018-2026 the Deno authors. MIT license.
|
|
2
|
+
// Copyright the Browserify authors. MIT License.
|
|
3
|
+
import { resolve } from "../../path/1.1.4/resolve.js";
|
|
4
|
+
import { SEPARATOR } from "../../path/1.1.4/constants.js";
|
|
5
|
+
import { toPathString } from "./_to_path_string.js";
|
|
6
|
+
/**
|
|
7
|
+
* Checks whether `src` is a sub-directory of `dest`.
|
|
8
|
+
*
|
|
9
|
+
* @param src Source file path as a string or URL.
|
|
10
|
+
* @param dest Destination file path as a string or URL.
|
|
11
|
+
* @param sep Path separator. Defaults to `\\` for Windows and `/` for other
|
|
12
|
+
* platforms.
|
|
13
|
+
*
|
|
14
|
+
* @returns `true` if `src` is a sub-directory of `dest`, `false` otherwise.
|
|
15
|
+
*/
|
|
16
|
+
export function isSubdir(src, dest, sep = SEPARATOR) {
|
|
17
|
+
src = toPathString(src);
|
|
18
|
+
dest = toPathString(dest);
|
|
19
|
+
if (resolve(src) === resolve(dest)) {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
const srcArray = src.split(sep);
|
|
23
|
+
const destArray = dest.split(sep);
|
|
24
|
+
return srcArray.every((current, i) => destArray[i] === current);
|
|
25
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_to_path_string.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/fs/1.0.22/_to_path_string.ts"],"names":[],"mappings":"AAKA;;;;;;GAMG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,MAAM,GAAG,GAAG,GACpB,MAAM,CAER"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Copyright 2018-2026 the Deno authors. MIT license.
|
|
2
|
+
// Copyright the Browserify authors. MIT License.
|
|
3
|
+
import { fromFileUrl } from "../../path/1.1.4/from_file_url.js";
|
|
4
|
+
/**
|
|
5
|
+
* Convert a URL or string to a path.
|
|
6
|
+
*
|
|
7
|
+
* @param pathUrl A URL or string to be converted.
|
|
8
|
+
*
|
|
9
|
+
* @returns The path as a string.
|
|
10
|
+
*/
|
|
11
|
+
export function toPathString(pathUrl) {
|
|
12
|
+
return pathUrl instanceof URL ? fromFileUrl(pathUrl) : pathUrl;
|
|
13
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/** Options for {@linkcode copy} and {@linkcode copySync}. */
|
|
2
|
+
export interface CopyOptions {
|
|
3
|
+
/**
|
|
4
|
+
* Whether to overwrite existing file or directory.
|
|
5
|
+
*
|
|
6
|
+
* @default {false}
|
|
7
|
+
*/
|
|
8
|
+
overwrite?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* When `true`, will set last modification and access times to the ones of
|
|
11
|
+
* the original source files. When `false`, timestamp behavior is
|
|
12
|
+
* OS-dependent.
|
|
13
|
+
*
|
|
14
|
+
* > [!NOTE]
|
|
15
|
+
* > This option is currently unsupported for symbolic links.
|
|
16
|
+
*
|
|
17
|
+
* @default {false}
|
|
18
|
+
*/
|
|
19
|
+
preserveTimestamps?: boolean;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Asynchronously copy a file or directory (along with its contents), like
|
|
23
|
+
* {@linkcode https://www.ibm.com/docs/en/aix/7.3?topic=c-cp-command#cp__cp_flagr | cp -r}.
|
|
24
|
+
*
|
|
25
|
+
* Both `src` and `dest` must both be a file or directory.
|
|
26
|
+
*
|
|
27
|
+
* Requires `--allow-read` and `--allow-write` permissions.
|
|
28
|
+
*
|
|
29
|
+
* @see {@link https://docs.deno.com/runtime/manual/basics/permissions#file-system-access}
|
|
30
|
+
* for more information on Deno's permissions system.
|
|
31
|
+
*
|
|
32
|
+
* @param src The source file/directory path as a string or URL.
|
|
33
|
+
* @param dest The destination file/directory path as a string or URL.
|
|
34
|
+
* @param options Options for copying.
|
|
35
|
+
*
|
|
36
|
+
* @returns A promise that resolves once the copy operation completes.
|
|
37
|
+
*
|
|
38
|
+
* @example Basic usage
|
|
39
|
+
* ```ts ignore
|
|
40
|
+
* import { copy } from "@std/fs/copy";
|
|
41
|
+
*
|
|
42
|
+
* await copy("./foo", "./bar");
|
|
43
|
+
* ```
|
|
44
|
+
*
|
|
45
|
+
* This will copy the file or directory at `./foo` to `./bar` without
|
|
46
|
+
* overwriting.
|
|
47
|
+
*
|
|
48
|
+
* @example Overwriting files/directories
|
|
49
|
+
* ```ts ignore
|
|
50
|
+
* import { copy } from "@std/fs/copy";
|
|
51
|
+
*
|
|
52
|
+
* await copy("./foo", "./bar", { overwrite: true });
|
|
53
|
+
* ```
|
|
54
|
+
*
|
|
55
|
+
* This will copy the file or directory at `./foo` to `./bar` and overwrite
|
|
56
|
+
* any existing files or directories.
|
|
57
|
+
*
|
|
58
|
+
* @example Preserving timestamps
|
|
59
|
+
* ```ts ignore
|
|
60
|
+
* import { copy } from "@std/fs/copy";
|
|
61
|
+
*
|
|
62
|
+
* await copy("./foo", "./bar", { preserveTimestamps: true });
|
|
63
|
+
* ```
|
|
64
|
+
*
|
|
65
|
+
* This will copy the file or directory at `./foo` to `./bar` and set the
|
|
66
|
+
* last modification and access times to the ones of the original source files.
|
|
67
|
+
*/
|
|
68
|
+
export declare function copy(src: string | URL, dest: string | URL, options?: CopyOptions): Promise<void>;
|
|
69
|
+
/**
|
|
70
|
+
* Synchronously copy a file or directory (along with its contents), like
|
|
71
|
+
* {@linkcode https://www.ibm.com/docs/en/aix/7.3?topic=c-cp-command#cp__cp_flagr | cp -r}.
|
|
72
|
+
*
|
|
73
|
+
* Both `src` and `dest` must both be a file or directory.
|
|
74
|
+
*
|
|
75
|
+
* Requires `--allow-read` and `--allow-write` permissions.
|
|
76
|
+
*
|
|
77
|
+
* @see {@link https://docs.deno.com/runtime/manual/basics/permissions#file-system-access}
|
|
78
|
+
* for more information on Deno's permissions system.
|
|
79
|
+
*
|
|
80
|
+
* @param src The source file/directory path as a string or URL.
|
|
81
|
+
* @param dest The destination file/directory path as a string or URL.
|
|
82
|
+
* @param options Options for copying.
|
|
83
|
+
*
|
|
84
|
+
* @returns A void value that returns once the copy operation completes.
|
|
85
|
+
*
|
|
86
|
+
* @example Basic usage
|
|
87
|
+
* ```ts ignore
|
|
88
|
+
* import { copySync } from "@std/fs/copy";
|
|
89
|
+
*
|
|
90
|
+
* copySync("./foo", "./bar");
|
|
91
|
+
* ```
|
|
92
|
+
*
|
|
93
|
+
* This will copy the file or directory at `./foo` to `./bar` without
|
|
94
|
+
* overwriting.
|
|
95
|
+
*
|
|
96
|
+
* @example Overwriting files/directories
|
|
97
|
+
* ```ts ignore
|
|
98
|
+
* import { copySync } from "@std/fs/copy";
|
|
99
|
+
*
|
|
100
|
+
* copySync("./foo", "./bar", { overwrite: true });
|
|
101
|
+
* ```
|
|
102
|
+
*
|
|
103
|
+
* This will copy the file or directory at `./foo` to `./bar` and overwrite
|
|
104
|
+
* any existing files or directories.
|
|
105
|
+
*
|
|
106
|
+
* @example Preserving timestamps
|
|
107
|
+
* ```ts ignore
|
|
108
|
+
* import { copySync } from "@std/fs/copy";
|
|
109
|
+
*
|
|
110
|
+
* copySync("./foo", "./bar", { preserveTimestamps: true });
|
|
111
|
+
* ```
|
|
112
|
+
*
|
|
113
|
+
* This will copy the file or directory at `./foo` to `./bar` and set the
|
|
114
|
+
* last modification and access times to the ones of the original source files.
|
|
115
|
+
*/
|
|
116
|
+
export declare function copySync(src: string | URL, dest: string | URL, options?: CopyOptions): void;
|
|
117
|
+
//# sourceMappingURL=copy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copy.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/fs/1.0.22/copy.ts"],"names":[],"mappings":"AAaA,6DAA6D;AAC7D,MAAM,WAAW,WAAW;IAC1B;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;;;;;;OASG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAoOD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,wBAAsB,IAAI,CACxB,GAAG,EAAE,MAAM,GAAG,GAAG,EACjB,IAAI,EAAE,MAAM,GAAG,GAAG,EAClB,OAAO,GAAE,WAAgB,iBAwB1B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,wBAAgB,QAAQ,CACtB,GAAG,EAAE,MAAM,GAAG,GAAG,EACjB,IAAI,EAAE,MAAM,GAAG,GAAG,EAClB,OAAO,GAAE,WAAgB,QAwB1B"}
|