@mtkruto/node 0.1.191 → 0.1.201
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/esm/1_utilities.d.ts +1 -1
- package/esm/1_utilities.js +1 -1
- package/esm/2_tl.d.ts +6 -6
- package/esm/2_tl.js +6 -6
- package/esm/3_storage.d.ts +5 -5
- package/esm/3_storage.js +5 -5
- package/esm/3_types.d.ts +6 -5
- package/esm/3_types.js +6 -5
- package/esm/4_constants.d.ts +2 -2
- package/esm/4_constants.js +2 -2
- package/esm/5_client.d.ts +1 -1
- package/esm/5_client.js +1 -1
- package/esm/client/0_params.d.ts +7 -1
- package/esm/client/0_types.d.ts +1 -0
- package/esm/client/0_utilities.d.ts +0 -3
- package/esm/client/0_utilities.js +0 -20
- package/esm/client/1_business_connection_manager.d.ts +11 -0
- package/esm/client/1_business_connection_manager.js +47 -0
- package/esm/client/1_update_manager.d.ts +8 -1
- package/esm/client/1_update_manager.js +88 -8
- package/esm/client/2_message_manager.d.ts +7 -6
- package/esm/client/2_message_manager.js +48 -31
- package/esm/client/4_client.d.ts +426 -428
- package/esm/client/4_client.js +570 -530
- package/esm/storage/0_storage.d.ts +5 -0
- package/esm/storage/0_storage.js +20 -0
- package/esm/storage/{1_storage_indexed_db.js → 2_storage_indexed_db.js} +1 -1
- package/esm/storage/{1_storage_local_storage.js → 2_storage_local_storage.js} +1 -1
- package/{script/storage/1_storage_memory.d.ts → esm/storage/2_storage_memory.d.ts} +1 -4
- package/esm/storage/{1_storage_memory.js → 2_storage_memory.js} +8 -28
- package/esm/storage/{1_storage_session_storage.js → 2_storage_session_storage.js} +1 -1
- package/esm/tl/2_types.d.ts +1071 -183
- package/esm/tl/2_types.js +2916 -464
- package/esm/tl/3_functions.d.ts +381 -17
- package/esm/tl/3_functions.js +1002 -120
- package/{script/tl/4_tl_writer.d.ts → esm/tl/5_tl_writer.d.ts} +1 -1
- package/{script/tl/4_rpc_result.d.ts → esm/tl/6_rpc_result.d.ts} +1 -1
- package/esm/tl/{4_rpc_result.js → 6_rpc_result.js} +1 -1
- package/esm/tl/{6_message.d.ts → 7_message.d.ts} +2 -2
- package/esm/tl/{6_message.js → 7_message.js} +3 -3
- package/esm/tl/{7_message_container.d.ts → 8_message_container.d.ts} +1 -1
- package/esm/tl/{7_message_container.js → 8_message_container.js} +3 -3
- package/esm/types/0_chat_photo.js +1 -1
- package/esm/types/0_message_entity.d.ts +1 -1
- package/esm/types/0_thumbnail.js +1 -1
- package/esm/types/1_bot_command_scope.d.ts +1 -1
- package/esm/types/1_photo.js +2 -2
- package/esm/types/1_story_privacy.d.ts +1 -1
- package/esm/types/2_business_connection.d.ts +11 -0
- package/esm/types/2_business_connection.js +12 -0
- package/esm/types/2_chat_member.d.ts +1 -1
- package/esm/types/2_chosen_inline_result.d.ts +1 -1
- package/esm/types/2_game.js +1 -1
- package/esm/types/2_inline_keyboard_button.d.ts +1 -1
- package/esm/types/2_inline_query.d.ts +1 -1
- package/esm/types/2_invite_link.d.ts +1 -1
- package/esm/types/2_message_reaction_count.d.ts +1 -1
- package/esm/types/2_message_reactions.d.ts +1 -1
- package/esm/types/2_story_content.js +1 -1
- package/esm/types/{1_story_interactive_area.d.ts → 2_story_interactive_area.d.ts} +2 -2
- package/esm/types/{1_story_interactive_area.js → 2_story_interactive_area.js} +1 -1
- package/esm/types/3_chat_member_updated.d.ts +1 -1
- package/esm/types/3_reply_markup.d.ts +1 -1
- package/esm/types/3_story.d.ts +2 -2
- package/esm/types/3_story.js +1 -1
- package/esm/types/4_inline_query_result.d.ts +1 -1
- package/esm/types/4_inline_query_result.js +1 -1
- package/esm/types/4_message.d.ts +9 -3
- package/esm/types/4_message.js +22 -5
- package/esm/types/5_callback_query.d.ts +1 -1
- package/esm/types/5_chat.d.ts +1 -1
- package/esm/types/6_update.d.ts +12 -2
- package/package.json +1 -1
- package/script/1_utilities.d.ts +1 -1
- package/script/1_utilities.js +1 -1
- package/script/2_tl.d.ts +6 -6
- package/script/2_tl.js +6 -6
- package/script/3_storage.d.ts +5 -5
- package/script/3_storage.js +5 -5
- package/script/3_types.d.ts +6 -5
- package/script/3_types.js +6 -5
- package/script/4_constants.d.ts +2 -2
- package/script/4_constants.js +2 -2
- package/script/5_client.d.ts +1 -1
- package/script/5_client.js +1 -1
- package/script/client/0_params.d.ts +7 -1
- package/script/client/0_types.d.ts +1 -0
- package/script/client/0_utilities.d.ts +0 -3
- package/script/client/0_utilities.js +1 -23
- package/script/client/1_business_connection_manager.d.ts +11 -0
- package/script/client/1_business_connection_manager.js +51 -0
- package/script/client/1_update_manager.d.ts +8 -1
- package/script/client/1_update_manager.js +88 -8
- package/script/client/2_message_manager.d.ts +7 -6
- package/script/client/2_message_manager.js +47 -30
- package/script/client/4_client.d.ts +426 -428
- package/script/client/4_client.js +570 -530
- package/script/storage/0_storage.d.ts +5 -0
- package/script/storage/0_storage.js +20 -0
- package/script/storage/{1_storage_indexed_db.js → 2_storage_indexed_db.js} +7 -7
- package/script/storage/{1_storage_local_storage.js → 2_storage_local_storage.js} +10 -10
- package/{esm/storage/1_storage_memory.d.ts → script/storage/2_storage_memory.d.ts} +1 -4
- package/script/storage/{1_storage_memory.js → 2_storage_memory.js} +12 -32
- package/script/storage/{1_storage_session_storage.js → 2_storage_session_storage.js} +10 -10
- package/script/tl/2_types.d.ts +1071 -183
- package/script/tl/2_types.js +3028 -504
- package/script/tl/3_functions.d.ts +381 -17
- package/script/tl/3_functions.js +1047 -143
- package/{esm/tl/4_tl_writer.d.ts → script/tl/5_tl_writer.d.ts} +1 -1
- package/{esm/tl/4_rpc_result.d.ts → script/tl/6_rpc_result.d.ts} +1 -1
- package/script/tl/{4_rpc_result.js → 6_rpc_result.js} +2 -2
- package/script/tl/{6_message.d.ts → 7_message.d.ts} +2 -2
- package/script/tl/{6_message.js → 7_message.js} +8 -8
- package/script/tl/{7_message_container.d.ts → 8_message_container.d.ts} +1 -1
- package/script/tl/{7_message_container.js → 8_message_container.js} +7 -7
- package/script/types/0_chat_photo.js +9 -9
- package/script/types/0_message_entity.d.ts +1 -1
- package/script/types/0_thumbnail.js +6 -6
- package/script/types/1_bot_command_scope.d.ts +1 -1
- package/script/types/1_photo.js +7 -7
- package/script/types/1_story_privacy.d.ts +1 -1
- package/script/types/2_business_connection.d.ts +11 -0
- package/script/types/2_business_connection.js +16 -0
- package/script/types/2_chat_member.d.ts +1 -1
- package/script/types/2_chosen_inline_result.d.ts +1 -1
- package/script/types/2_game.js +3 -3
- package/script/types/2_inline_keyboard_button.d.ts +1 -1
- package/script/types/2_inline_query.d.ts +1 -1
- package/script/types/2_invite_link.d.ts +1 -1
- package/script/types/2_message_reaction_count.d.ts +1 -1
- package/script/types/2_message_reactions.d.ts +1 -1
- package/script/types/2_story_content.js +4 -4
- package/script/types/{1_story_interactive_area.d.ts → 2_story_interactive_area.d.ts} +2 -2
- package/script/types/{1_story_interactive_area.js → 2_story_interactive_area.js} +2 -2
- package/script/types/3_chat_member_updated.d.ts +1 -1
- package/script/types/3_reply_markup.d.ts +1 -1
- package/script/types/3_story.d.ts +2 -2
- package/script/types/3_story.js +2 -2
- package/script/types/4_inline_query_result.d.ts +1 -1
- package/script/types/4_inline_query_result.js +2 -2
- package/script/types/4_message.d.ts +9 -3
- package/script/types/4_message.js +37 -20
- package/script/types/5_callback_query.d.ts +1 -1
- package/script/types/5_chat.d.ts +1 -1
- package/script/types/6_update.d.ts +12 -2
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/DomHandler.d.ts +0 -83
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/DomHandler.js +0 -203
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/DomSerializer.d.ts +0 -50
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/DomSerializer.js +0 -274
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/ElementType.d.ts +0 -47
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/ElementType.js +0 -51
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/FeedHandler.d.ts +0 -66
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/FeedHandler.js +0 -191
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/Node.d.ts +0 -168
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/Node.js +0 -385
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/Parser.d.ts +0 -159
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/Parser.js +0 -431
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/Tokenizer.d.ts +0 -181
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/Tokenizer.js +0 -1046
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/mod.d.ts +0 -42
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/mod.js +0 -52
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/decode.d.ts +0 -11
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/decode.js +0 -122
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/decode_codepoint.d.ts +0 -1
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/decode_codepoint.js +0 -24
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/encode.d.ts +0 -46
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/encode.js +0 -121
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/decode.d.ts +0 -31
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/decode.js +0 -30
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/entities.d.ts +0 -2128
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/entities.js +0 -2127
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/legacy.d.ts +0 -109
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/legacy.js +0 -108
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/xml.d.ts +0 -8
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/xml.js +0 -1
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/mod.d.ts +0 -90
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/mod.js +0 -95
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/helpers.d.ts +0 -50
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/helpers.js +0 -128
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/legacy.d.ts +0 -46
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/legacy.js +0 -110
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/manipulation.d.ts +0 -42
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/manipulation.js +0 -120
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/mod.d.ts +0 -6
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/mod.js +0 -6
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/querying.d.ts +0 -54
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/querying.js +0 -110
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/stringify.d.ts +0 -40
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/stringify.js +0 -75
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/traversal.d.ts +0 -58
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/traversal.js +0 -101
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/DomHandler.d.ts +0 -83
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/DomHandler.js +0 -207
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/DomSerializer.d.ts +0 -50
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/DomSerializer.js +0 -301
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/ElementType.d.ts +0 -47
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/ElementType.js +0 -55
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/FeedHandler.d.ts +0 -66
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/FeedHandler.js +0 -222
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/Node.d.ts +0 -168
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/Node.js +0 -404
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/Parser.d.ts +0 -159
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/Parser.js +0 -438
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/Tokenizer.d.ts +0 -181
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/Tokenizer.js +0 -1052
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/mod.d.ts +0 -42
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/mod.js +0 -88
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/decode.d.ts +0 -11
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/decode.js +0 -128
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/decode_codepoint.d.ts +0 -1
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/decode_codepoint.js +0 -30
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/encode.d.ts +0 -46
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/encode.js +0 -129
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/decode.d.ts +0 -31
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/decode.js +0 -32
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/entities.d.ts +0 -2128
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/entities.js +0 -2129
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/legacy.d.ts +0 -109
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/legacy.js +0 -110
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/xml.d.ts +0 -8
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/xml.js +0 -3
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/mod.d.ts +0 -90
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/mod.js +0 -114
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/helpers.d.ts +0 -50
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/helpers.js +0 -134
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/legacy.d.ts +0 -46
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/legacy.js +0 -118
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/manipulation.d.ts +0 -42
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/manipulation.js +0 -129
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/mod.d.ts +0 -6
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/mod.js +0 -22
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/querying.d.ts +0 -54
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/querying.js +0 -119
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/stringify.d.ts +0 -40
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/stringify.js +0 -86
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/traversal.d.ts +0 -58
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/traversal.js +0 -112
- /package/esm/storage/{0_utilities.d.ts → 1_utilities.d.ts} +0 -0
- /package/esm/storage/{0_utilities.js → 1_utilities.js} +0 -0
- /package/esm/storage/{1_storage_indexed_db.d.ts → 2_storage_indexed_db.d.ts} +0 -0
- /package/esm/storage/{1_storage_local_storage.d.ts → 2_storage_local_storage.d.ts} +0 -0
- /package/esm/storage/{1_storage_session_storage.d.ts → 2_storage_session_storage.d.ts} +0 -0
- /package/esm/tl/{3_tl_reader.d.ts → 4_tl_reader.d.ts} +0 -0
- /package/esm/tl/{3_tl_reader.js → 4_tl_reader.js} +0 -0
- /package/esm/tl/{4_tl_writer.js → 5_tl_writer.js} +0 -0
- /package/esm/types/{0_venue.d.ts → 1_venue.d.ts} +0 -0
- /package/esm/types/{0_venue.js → 1_venue.js} +0 -0
- /package/esm/types/{0__file_id.d.ts → _file_id.d.ts} +0 -0
- /package/esm/types/{0__file_id.js → _file_id.js} +0 -0
- /package/esm/types/{1__getters.d.ts → _getters.d.ts} +0 -0
- /package/esm/types/{1__getters.js → _getters.js} +0 -0
- /package/script/storage/{0_utilities.d.ts → 1_utilities.d.ts} +0 -0
- /package/script/storage/{0_utilities.js → 1_utilities.js} +0 -0
- /package/script/storage/{1_storage_indexed_db.d.ts → 2_storage_indexed_db.d.ts} +0 -0
- /package/script/storage/{1_storage_local_storage.d.ts → 2_storage_local_storage.d.ts} +0 -0
- /package/script/storage/{1_storage_session_storage.d.ts → 2_storage_session_storage.d.ts} +0 -0
- /package/script/tl/{3_tl_reader.d.ts → 4_tl_reader.d.ts} +0 -0
- /package/script/tl/{3_tl_reader.js → 4_tl_reader.js} +0 -0
- /package/script/tl/{4_tl_writer.js → 5_tl_writer.js} +0 -0
- /package/script/types/{0_venue.d.ts → 1_venue.d.ts} +0 -0
- /package/script/types/{0_venue.js → 1_venue.js} +0 -0
- /package/script/types/{0__file_id.d.ts → _file_id.d.ts} +0 -0
- /package/script/types/{0__file_id.js → _file_id.js} +0 -0
- /package/script/types/{1__getters.d.ts → _getters.d.ts} +0 -0
- /package/script/types/{1__getters.js → _getters.js} +0 -0
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { Parser, ParserOptions } from './Parser.js';
|
|
2
|
-
export { Parser };
|
|
3
|
-
export type { ParserOptions };
|
|
4
|
-
import { Node, Element, Document } from './Node.js';
|
|
5
|
-
import { DomHandler, DomHandlerOptions } from './DomHandler.js';
|
|
6
|
-
export { DomHandler };
|
|
7
|
-
export type { DomHandlerOptions };
|
|
8
|
-
type Options = ParserOptions & DomHandlerOptions;
|
|
9
|
-
/**
|
|
10
|
-
* Parses the data, returns the resulting document.
|
|
11
|
-
*
|
|
12
|
-
* @param data The data that should be parsed.
|
|
13
|
-
* @param options Optional options for the parser and DOM builder.
|
|
14
|
-
*/
|
|
15
|
-
export declare function parseDocument(data: string, options?: Options): Document;
|
|
16
|
-
/**
|
|
17
|
-
* Parses data, returns an array of the root nodes.
|
|
18
|
-
*
|
|
19
|
-
* Note that the root nodes still have a `Document` node as their parent.
|
|
20
|
-
* Use `parseDocument` to get the `Document` node instead.
|
|
21
|
-
*
|
|
22
|
-
* @param data The data that should be parsed.
|
|
23
|
-
* @param options Optional options for the parser and DOM builder.
|
|
24
|
-
* @deprecated Use `parseDocument` instead.
|
|
25
|
-
*/
|
|
26
|
-
export declare function parseDOM(data: string, options?: Options): Node[];
|
|
27
|
-
/**
|
|
28
|
-
* Creates a parser instance, with an attached DOM handler.
|
|
29
|
-
*
|
|
30
|
-
* @param cb A callback that will be called once parsing has been completed.
|
|
31
|
-
* @param options Optional options for the parser and DOM builder.
|
|
32
|
-
* @param elementCb An optional callback that will be called every time a tag has been completed inside of the DOM.
|
|
33
|
-
*/
|
|
34
|
-
export declare function createDomStream(cb: (error: Error | null, dom: Node[]) => void, options?: Options, elementCb?: (element: Element) => void): Parser;
|
|
35
|
-
export { default as Tokenizer } from './Tokenizer.js';
|
|
36
|
-
export type { Callbacks as TokenizerCallbacks } from './Tokenizer.js';
|
|
37
|
-
import * as ElementType from './ElementType.js';
|
|
38
|
-
export { ElementType };
|
|
39
|
-
export * from './FeedHandler.js';
|
|
40
|
-
export * as DomUtils from './utils/mod.js';
|
|
41
|
-
export { DomHandler as DefaultHandler };
|
|
42
|
-
export { FeedHandler as RssHandler } from './FeedHandler.js';
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
26
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
27
|
-
};
|
|
28
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
29
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
30
|
-
};
|
|
31
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
|
-
exports.RssHandler = exports.DefaultHandler = exports.DomUtils = exports.ElementType = exports.Tokenizer = exports.createDomStream = exports.parseDOM = exports.parseDocument = exports.DomHandler = exports.Parser = void 0;
|
|
33
|
-
const Parser_js_1 = require("./Parser.js");
|
|
34
|
-
Object.defineProperty(exports, "Parser", { enumerable: true, get: function () { return Parser_js_1.Parser; } });
|
|
35
|
-
const DomHandler_js_1 = require("./DomHandler.js");
|
|
36
|
-
Object.defineProperty(exports, "DomHandler", { enumerable: true, get: function () { return DomHandler_js_1.DomHandler; } });
|
|
37
|
-
Object.defineProperty(exports, "DefaultHandler", { enumerable: true, get: function () { return DomHandler_js_1.DomHandler; } });
|
|
38
|
-
// Helper methods
|
|
39
|
-
/**
|
|
40
|
-
* Parses the data, returns the resulting document.
|
|
41
|
-
*
|
|
42
|
-
* @param data The data that should be parsed.
|
|
43
|
-
* @param options Optional options for the parser and DOM builder.
|
|
44
|
-
*/
|
|
45
|
-
function parseDocument(data, options) {
|
|
46
|
-
const handler = new DomHandler_js_1.DomHandler(undefined, options);
|
|
47
|
-
new Parser_js_1.Parser(handler, options).end(data);
|
|
48
|
-
return handler.root;
|
|
49
|
-
}
|
|
50
|
-
exports.parseDocument = parseDocument;
|
|
51
|
-
/**
|
|
52
|
-
* Parses data, returns an array of the root nodes.
|
|
53
|
-
*
|
|
54
|
-
* Note that the root nodes still have a `Document` node as their parent.
|
|
55
|
-
* Use `parseDocument` to get the `Document` node instead.
|
|
56
|
-
*
|
|
57
|
-
* @param data The data that should be parsed.
|
|
58
|
-
* @param options Optional options for the parser and DOM builder.
|
|
59
|
-
* @deprecated Use `parseDocument` instead.
|
|
60
|
-
*/
|
|
61
|
-
function parseDOM(data, options) {
|
|
62
|
-
return parseDocument(data, options).children;
|
|
63
|
-
}
|
|
64
|
-
exports.parseDOM = parseDOM;
|
|
65
|
-
/**
|
|
66
|
-
* Creates a parser instance, with an attached DOM handler.
|
|
67
|
-
*
|
|
68
|
-
* @param cb A callback that will be called once parsing has been completed.
|
|
69
|
-
* @param options Optional options for the parser and DOM builder.
|
|
70
|
-
* @param elementCb An optional callback that will be called every time a tag has been completed inside of the DOM.
|
|
71
|
-
*/
|
|
72
|
-
function createDomStream(cb, options, elementCb) {
|
|
73
|
-
const handler = new DomHandler_js_1.DomHandler(cb, options, elementCb);
|
|
74
|
-
return new Parser_js_1.Parser(handler, options);
|
|
75
|
-
}
|
|
76
|
-
exports.createDomStream = createDomStream;
|
|
77
|
-
var Tokenizer_js_1 = require("./Tokenizer.js");
|
|
78
|
-
Object.defineProperty(exports, "Tokenizer", { enumerable: true, get: function () { return __importDefault(Tokenizer_js_1).default; } });
|
|
79
|
-
const ElementType = __importStar(require("./ElementType.js"));
|
|
80
|
-
exports.ElementType = ElementType;
|
|
81
|
-
/*
|
|
82
|
-
* All of the following exports exist for backwards-compatibility.
|
|
83
|
-
* They should probably be removed eventually.
|
|
84
|
-
*/
|
|
85
|
-
__exportStar(require("./FeedHandler.js"), exports);
|
|
86
|
-
exports.DomUtils = __importStar(require("./utils/mod.js"));
|
|
87
|
-
var FeedHandler_js_1 = require("./FeedHandler.js");
|
|
88
|
-
Object.defineProperty(exports, "RssHandler", { enumerable: true, get: function () { return FeedHandler_js_1.FeedHandler; } });
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export interface TrieNode {
|
|
2
|
-
value?: string;
|
|
3
|
-
legacy?: boolean;
|
|
4
|
-
base?: number;
|
|
5
|
-
next?: Map<string, TrieNode>;
|
|
6
|
-
}
|
|
7
|
-
export declare const xmlTrie: TrieNode;
|
|
8
|
-
export declare const decodeXML: (str: string) => string;
|
|
9
|
-
export declare const htmlTrie: TrieNode;
|
|
10
|
-
export declare const decodeHTMLStrict: (str: string) => string;
|
|
11
|
-
export declare const decodeHTML: (str: string) => string;
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.decodeHTML = exports.decodeHTMLStrict = exports.htmlTrie = exports.decodeXML = exports.xmlTrie = void 0;
|
|
7
|
-
const entities_js_1 = __importDefault(require("./maps/entities.js"));
|
|
8
|
-
const legacy_js_1 = __importDefault(require("./maps/legacy.js"));
|
|
9
|
-
const xml_js_1 = __importDefault(require("./maps/xml.js"));
|
|
10
|
-
const decode_codepoint_js_1 = __importDefault(require("./decode_codepoint.js"));
|
|
11
|
-
const numStart = (function () {
|
|
12
|
-
const numStart = new Map();
|
|
13
|
-
const numRecurse = new Map();
|
|
14
|
-
const numValue = { next: numRecurse, base: 10 };
|
|
15
|
-
for (let i = 0; i <= 9; i++) {
|
|
16
|
-
numStart.set(i.toString(10), numValue);
|
|
17
|
-
numRecurse.set(i.toString(10), numValue);
|
|
18
|
-
}
|
|
19
|
-
const hexRecurse = new Map();
|
|
20
|
-
const hexValue = { next: hexRecurse, base: 16 };
|
|
21
|
-
for (let i = 0; i <= 15; i++) {
|
|
22
|
-
hexRecurse.set(i.toString(16), hexValue);
|
|
23
|
-
hexRecurse.set(i.toString(16).toUpperCase(), hexValue);
|
|
24
|
-
}
|
|
25
|
-
const hexStart = { next: hexRecurse };
|
|
26
|
-
numStart.set('x', hexStart);
|
|
27
|
-
numStart.set('X', hexStart);
|
|
28
|
-
return { next: numStart };
|
|
29
|
-
})();
|
|
30
|
-
function getTrieReplacer(trieStart, legacyEntities) {
|
|
31
|
-
return (str) => {
|
|
32
|
-
let ret = '';
|
|
33
|
-
let lastIdx = 0;
|
|
34
|
-
let legacyTrieIndex = 0;
|
|
35
|
-
let idx = 0;
|
|
36
|
-
function decodeNumeric(base) {
|
|
37
|
-
const entity = str.substring(
|
|
38
|
-
// Skip the leading "&#". For hex entities, also skip the leading "x".
|
|
39
|
-
lastIdx + 2 + (base >>> 4), idx);
|
|
40
|
-
const parsed = parseInt(entity, base);
|
|
41
|
-
return (0, decode_codepoint_js_1.default)(parsed);
|
|
42
|
-
}
|
|
43
|
-
entityLoop: while ((idx = str.indexOf('&', idx)) >= 0) {
|
|
44
|
-
ret += str.slice(lastIdx, idx);
|
|
45
|
-
lastIdx = idx;
|
|
46
|
-
let trieNode = trieStart;
|
|
47
|
-
let legacyTrie;
|
|
48
|
-
while (++idx < str.length) {
|
|
49
|
-
const c = str.charAt(idx);
|
|
50
|
-
if (c === ';') {
|
|
51
|
-
if (trieNode.value) {
|
|
52
|
-
ret += trieNode.value;
|
|
53
|
-
}
|
|
54
|
-
else if (trieNode.base) {
|
|
55
|
-
ret += decodeNumeric(trieNode.base);
|
|
56
|
-
}
|
|
57
|
-
else
|
|
58
|
-
break;
|
|
59
|
-
idx += 1;
|
|
60
|
-
lastIdx = idx;
|
|
61
|
-
continue entityLoop;
|
|
62
|
-
}
|
|
63
|
-
else {
|
|
64
|
-
const next = trieNode.next?.get(c);
|
|
65
|
-
if (next) {
|
|
66
|
-
trieNode = next;
|
|
67
|
-
if (legacyEntities && next.legacy) {
|
|
68
|
-
legacyTrie = next;
|
|
69
|
-
legacyTrieIndex = idx;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
else
|
|
73
|
-
break;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
if (legacyEntities) {
|
|
77
|
-
if (legacyTrie) {
|
|
78
|
-
ret += legacyTrie.value;
|
|
79
|
-
lastIdx = legacyTrieIndex + 1;
|
|
80
|
-
}
|
|
81
|
-
else if (trieNode.base) {
|
|
82
|
-
ret += decodeNumeric(trieNode.base);
|
|
83
|
-
lastIdx = idx;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
return ret + str.substr(lastIdx);
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
exports.xmlTrie = { next: getTrie(xml_js_1.default) };
|
|
91
|
-
exports.decodeXML = getTrieReplacer(exports.xmlTrie, false);
|
|
92
|
-
exports.htmlTrie = {
|
|
93
|
-
next: markLegacyEntries(getTrie(entities_js_1.default), legacy_js_1.default),
|
|
94
|
-
};
|
|
95
|
-
exports.decodeHTMLStrict = getTrieReplacer(exports.htmlTrie, false);
|
|
96
|
-
exports.decodeHTML = getTrieReplacer(exports.htmlTrie, true);
|
|
97
|
-
function getTrie(map) {
|
|
98
|
-
const trie = new Map();
|
|
99
|
-
for (const key of Object.keys(map)) {
|
|
100
|
-
// Resolve the key
|
|
101
|
-
let lastMap = trie;
|
|
102
|
-
for (const char of key.slice(0, -1)) {
|
|
103
|
-
const next = lastMap.get(char) ?? {};
|
|
104
|
-
lastMap.set(char, next);
|
|
105
|
-
lastMap = next.next ??= new Map();
|
|
106
|
-
}
|
|
107
|
-
const val = lastMap.get(key.slice(-1)) ?? {};
|
|
108
|
-
val.value = map[key];
|
|
109
|
-
lastMap.set(key.slice(-1), val);
|
|
110
|
-
}
|
|
111
|
-
// Add numeric values
|
|
112
|
-
trie.set('#', numStart);
|
|
113
|
-
return trie;
|
|
114
|
-
}
|
|
115
|
-
function markLegacyEntries(trie, legacy) {
|
|
116
|
-
for (const key of Object.keys(legacy)) {
|
|
117
|
-
// Resolve the key
|
|
118
|
-
let lastMap = { next: trie };
|
|
119
|
-
for (const char of key) {
|
|
120
|
-
const next = lastMap.next?.get(char);
|
|
121
|
-
if (!next)
|
|
122
|
-
throw new Error(`Could not find ${key} at ${char}`);
|
|
123
|
-
lastMap = next;
|
|
124
|
-
}
|
|
125
|
-
lastMap.legacy = true;
|
|
126
|
-
}
|
|
127
|
-
return trie;
|
|
128
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function decodeCodePoint(codePoint: number): string;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const decode_js_1 = __importDefault(require("./maps/decode.js"));
|
|
7
|
-
// Adapted from https://github.com/mathiasbynens/he/blob/master/src/he.js#L94-L119
|
|
8
|
-
const fromCodePoint =
|
|
9
|
-
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition, node/no-unsupported-features/es-builtins
|
|
10
|
-
String.fromCodePoint ||
|
|
11
|
-
function (codePoint) {
|
|
12
|
-
let output = '';
|
|
13
|
-
if (codePoint > 0xffff) {
|
|
14
|
-
codePoint -= 0x10000;
|
|
15
|
-
output += String.fromCharCode(((codePoint >>> 10) & 0x3ff) | 0xd800);
|
|
16
|
-
codePoint = 0xdc00 | (codePoint & 0x3ff);
|
|
17
|
-
}
|
|
18
|
-
output += String.fromCharCode(codePoint);
|
|
19
|
-
return output;
|
|
20
|
-
};
|
|
21
|
-
function decodeCodePoint(codePoint) {
|
|
22
|
-
if ((codePoint >= 0xd800 && codePoint <= 0xdfff) || codePoint > 0x10ffff) {
|
|
23
|
-
return '\uFFFD';
|
|
24
|
-
}
|
|
25
|
-
if (codePoint in decode_js_1.default) {
|
|
26
|
-
codePoint = decode_js_1.default[codePoint];
|
|
27
|
-
}
|
|
28
|
-
return fromCodePoint(codePoint);
|
|
29
|
-
}
|
|
30
|
-
exports.default = decodeCodePoint;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Encodes all non-ASCII characters, as well as characters not valid in XML
|
|
3
|
-
* documents using XML entities.
|
|
4
|
-
*
|
|
5
|
-
* If a character has no equivalent entity, a
|
|
6
|
-
* numeric hexadecimal reference (eg. `ü`) will be used.
|
|
7
|
-
*/
|
|
8
|
-
export declare const encodeXML: (data: string) => string;
|
|
9
|
-
/**
|
|
10
|
-
* Encodes all entities and non-ASCII characters in the input.
|
|
11
|
-
*
|
|
12
|
-
* This includes characters that are valid ASCII characters in HTML documents.
|
|
13
|
-
* For example `#` will be encoded as `#`. To get a more compact output,
|
|
14
|
-
* consider using the `encodeNonAsciiHTML` function.
|
|
15
|
-
*
|
|
16
|
-
* If a character has no equivalent entity, a
|
|
17
|
-
* numeric hexadecimal reference (eg. `ü`) will be used.
|
|
18
|
-
*/
|
|
19
|
-
export declare const encodeHTML: (data: string) => string;
|
|
20
|
-
/**
|
|
21
|
-
* Encodes all non-ASCII characters, as well as characters not valid in HTML
|
|
22
|
-
* documents using HTML entities.
|
|
23
|
-
*
|
|
24
|
-
* If a character has no equivalent entity, a
|
|
25
|
-
* numeric hexadecimal reference (eg. `ü`) will be used.
|
|
26
|
-
*/
|
|
27
|
-
export declare const encodeNonAsciiHTML: (data: string) => string;
|
|
28
|
-
/**
|
|
29
|
-
* Encodes all non-ASCII characters, as well as characters not valid in XML
|
|
30
|
-
* documents using numeric hexadecimal reference (eg. `ü`).
|
|
31
|
-
*
|
|
32
|
-
* Have a look at `escapeUTF8` if you want a more concise output at the expense
|
|
33
|
-
* of reduced transportability.
|
|
34
|
-
*
|
|
35
|
-
* @param data String to escape.
|
|
36
|
-
*/
|
|
37
|
-
export declare function escape(data: string): string;
|
|
38
|
-
/**
|
|
39
|
-
* Encodes all characters not valid in XML documents using numeric hexadecimal
|
|
40
|
-
* reference (eg. `ü`).
|
|
41
|
-
*
|
|
42
|
-
* Note that the output will be character-set dependent.
|
|
43
|
-
*
|
|
44
|
-
* @param data String to escape.
|
|
45
|
-
*/
|
|
46
|
-
export declare function escapeUTF8(data: string): string;
|
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.escapeUTF8 = exports.escape = exports.encodeNonAsciiHTML = exports.encodeHTML = exports.encodeXML = void 0;
|
|
7
|
-
const xml_js_1 = __importDefault(require("./maps/xml.js"));
|
|
8
|
-
const inverseXML = getInverseObj(xml_js_1.default);
|
|
9
|
-
const xmlReplacer = getInverseReplacer(inverseXML);
|
|
10
|
-
/**
|
|
11
|
-
* Encodes all non-ASCII characters, as well as characters not valid in XML
|
|
12
|
-
* documents using XML entities.
|
|
13
|
-
*
|
|
14
|
-
* If a character has no equivalent entity, a
|
|
15
|
-
* numeric hexadecimal reference (eg. `ü`) will be used.
|
|
16
|
-
*/
|
|
17
|
-
exports.encodeXML = getASCIIEncoder(inverseXML);
|
|
18
|
-
const entities_js_1 = __importDefault(require("./maps/entities.js"));
|
|
19
|
-
const inverseHTML = getInverseObj(entities_js_1.default);
|
|
20
|
-
const htmlReplacer = getInverseReplacer(inverseHTML);
|
|
21
|
-
/**
|
|
22
|
-
* Encodes all entities and non-ASCII characters in the input.
|
|
23
|
-
*
|
|
24
|
-
* This includes characters that are valid ASCII characters in HTML documents.
|
|
25
|
-
* For example `#` will be encoded as `#`. To get a more compact output,
|
|
26
|
-
* consider using the `encodeNonAsciiHTML` function.
|
|
27
|
-
*
|
|
28
|
-
* If a character has no equivalent entity, a
|
|
29
|
-
* numeric hexadecimal reference (eg. `ü`) will be used.
|
|
30
|
-
*/
|
|
31
|
-
exports.encodeHTML = getInverse(inverseHTML, htmlReplacer);
|
|
32
|
-
/**
|
|
33
|
-
* Encodes all non-ASCII characters, as well as characters not valid in HTML
|
|
34
|
-
* documents using HTML entities.
|
|
35
|
-
*
|
|
36
|
-
* If a character has no equivalent entity, a
|
|
37
|
-
* numeric hexadecimal reference (eg. `ü`) will be used.
|
|
38
|
-
*/
|
|
39
|
-
exports.encodeNonAsciiHTML = getASCIIEncoder(inverseHTML);
|
|
40
|
-
function getInverseObj(obj) {
|
|
41
|
-
return Object.keys(obj)
|
|
42
|
-
.sort()
|
|
43
|
-
.reduce((inverse, name) => {
|
|
44
|
-
inverse[obj[name]] = `&${name};`;
|
|
45
|
-
return inverse;
|
|
46
|
-
}, {});
|
|
47
|
-
}
|
|
48
|
-
function getInverseReplacer(inverse) {
|
|
49
|
-
const single = [];
|
|
50
|
-
const multiple = [];
|
|
51
|
-
for (const k of Object.keys(inverse)) {
|
|
52
|
-
if (k.length === 1) {
|
|
53
|
-
// Add value to single array
|
|
54
|
-
single.push(`\\${k}`);
|
|
55
|
-
}
|
|
56
|
-
else {
|
|
57
|
-
// Add value to multiple array
|
|
58
|
-
multiple.push(k);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
// Add ranges to single characters.
|
|
62
|
-
single.sort();
|
|
63
|
-
for (let start = 0; start < single.length - 1; start++) {
|
|
64
|
-
// Find the end of a run of characters
|
|
65
|
-
let end = start;
|
|
66
|
-
while (end < single.length - 1 &&
|
|
67
|
-
single[end].charCodeAt(1) + 1 === single[end + 1].charCodeAt(1)) {
|
|
68
|
-
end += 1;
|
|
69
|
-
}
|
|
70
|
-
const count = 1 + end - start;
|
|
71
|
-
// We want to replace at least three characters
|
|
72
|
-
if (count < 3)
|
|
73
|
-
continue;
|
|
74
|
-
single.splice(start, count, `${single[start]}-${single[end]}`);
|
|
75
|
-
}
|
|
76
|
-
multiple.unshift(`[${single.join('')}]`);
|
|
77
|
-
return new RegExp(multiple.join('|'), 'g');
|
|
78
|
-
}
|
|
79
|
-
// /[^\0-\x7F]/gu
|
|
80
|
-
const reNonASCII = /(?:[\x80-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/g;
|
|
81
|
-
const getCodePoint =
|
|
82
|
-
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
83
|
-
String.prototype.codePointAt != null
|
|
84
|
-
? // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
85
|
-
(str) => str.codePointAt(0)
|
|
86
|
-
: // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
|
|
87
|
-
(c) => (c.charCodeAt(0) - 0xd800) * 0x400 +
|
|
88
|
-
c.charCodeAt(1) -
|
|
89
|
-
0xdc00 +
|
|
90
|
-
0x10000;
|
|
91
|
-
function singleCharReplacer(c) {
|
|
92
|
-
return `&#x${(c.length > 1 ? getCodePoint(c) : c.charCodeAt(0))
|
|
93
|
-
.toString(16)
|
|
94
|
-
.toUpperCase()};`;
|
|
95
|
-
}
|
|
96
|
-
function getInverse(inverse, re) {
|
|
97
|
-
return (data) => data
|
|
98
|
-
.replace(re, name => inverse[name])
|
|
99
|
-
.replace(reNonASCII, singleCharReplacer);
|
|
100
|
-
}
|
|
101
|
-
const reEscapeChars = new RegExp(`${xmlReplacer.source}|${reNonASCII.source}`, 'g');
|
|
102
|
-
/**
|
|
103
|
-
* Encodes all non-ASCII characters, as well as characters not valid in XML
|
|
104
|
-
* documents using numeric hexadecimal reference (eg. `ü`).
|
|
105
|
-
*
|
|
106
|
-
* Have a look at `escapeUTF8` if you want a more concise output at the expense
|
|
107
|
-
* of reduced transportability.
|
|
108
|
-
*
|
|
109
|
-
* @param data String to escape.
|
|
110
|
-
*/
|
|
111
|
-
function escape(data) {
|
|
112
|
-
return data.replace(reEscapeChars, singleCharReplacer);
|
|
113
|
-
}
|
|
114
|
-
exports.escape = escape;
|
|
115
|
-
/**
|
|
116
|
-
* Encodes all characters not valid in XML documents using numeric hexadecimal
|
|
117
|
-
* reference (eg. `ü`).
|
|
118
|
-
*
|
|
119
|
-
* Note that the output will be character-set dependent.
|
|
120
|
-
*
|
|
121
|
-
* @param data String to escape.
|
|
122
|
-
*/
|
|
123
|
-
function escapeUTF8(data) {
|
|
124
|
-
return data.replace(xmlReplacer, singleCharReplacer);
|
|
125
|
-
}
|
|
126
|
-
exports.escapeUTF8 = escapeUTF8;
|
|
127
|
-
function getASCIIEncoder(obj) {
|
|
128
|
-
return (data) => data.replace(reEscapeChars, c => obj[c] || singleCharReplacer(c));
|
|
129
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
declare const _default: {
|
|
2
|
-
'0': number;
|
|
3
|
-
'128': number;
|
|
4
|
-
'130': number;
|
|
5
|
-
'131': number;
|
|
6
|
-
'132': number;
|
|
7
|
-
'133': number;
|
|
8
|
-
'134': number;
|
|
9
|
-
'135': number;
|
|
10
|
-
'136': number;
|
|
11
|
-
'137': number;
|
|
12
|
-
'138': number;
|
|
13
|
-
'139': number;
|
|
14
|
-
'140': number;
|
|
15
|
-
'142': number;
|
|
16
|
-
'145': number;
|
|
17
|
-
'146': number;
|
|
18
|
-
'147': number;
|
|
19
|
-
'148': number;
|
|
20
|
-
'149': number;
|
|
21
|
-
'150': number;
|
|
22
|
-
'151': number;
|
|
23
|
-
'152': number;
|
|
24
|
-
'153': number;
|
|
25
|
-
'154': number;
|
|
26
|
-
'155': number;
|
|
27
|
-
'156': number;
|
|
28
|
-
'158': number;
|
|
29
|
-
'159': number;
|
|
30
|
-
};
|
|
31
|
-
export default _default;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default = {
|
|
4
|
-
'0': 65533,
|
|
5
|
-
'128': 8364,
|
|
6
|
-
'130': 8218,
|
|
7
|
-
'131': 402,
|
|
8
|
-
'132': 8222,
|
|
9
|
-
'133': 8230,
|
|
10
|
-
'134': 8224,
|
|
11
|
-
'135': 8225,
|
|
12
|
-
'136': 710,
|
|
13
|
-
'137': 8240,
|
|
14
|
-
'138': 352,
|
|
15
|
-
'139': 8249,
|
|
16
|
-
'140': 338,
|
|
17
|
-
'142': 381,
|
|
18
|
-
'145': 8216,
|
|
19
|
-
'146': 8217,
|
|
20
|
-
'147': 8220,
|
|
21
|
-
'148': 8221,
|
|
22
|
-
'149': 8226,
|
|
23
|
-
'150': 8211,
|
|
24
|
-
'151': 8212,
|
|
25
|
-
'152': 732,
|
|
26
|
-
'153': 8482,
|
|
27
|
-
'154': 353,
|
|
28
|
-
'155': 8250,
|
|
29
|
-
'156': 339,
|
|
30
|
-
'158': 382,
|
|
31
|
-
'159': 376,
|
|
32
|
-
};
|