msgpackr-extract 2.1.2 → 2.2.0
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/LICENSE +21 -21
- package/README.md +4 -4
- package/binding.gyp +63 -63
- package/package.json +12 -12
- package/src/extract.cpp +2 -1
- package/src/.vs/ProjectSettings.json +0 -3
- package/src/.vs/VSWorkspaceState.json +0 -7
- package/src/.vs/slnx.sqlite +0 -0
- package/src/.vs/src/v16/.suo +0 -0
- package/src/.vs/src/v16/Browse.VC.db +0 -0
- package/src/.vs/src/v16/Browse.VC.db-shm +0 -0
- package/src/.vs/src/v16/Browse.VC.db-wal +0 -0
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2020 Kris Zyp
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020 Kris Zyp
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
## Summary
|
|
2
|
-
This module is designed to do fast and efficient native/C-level extraction of strings from MessagePack binary data. This works by calling `extractStrings(buffer, start, end)`, and it will extract strings by doing partial MessagePack parsing, and scanning to find the string data in the range specified in the buffer. It will return an array of strings that it finds. When it finds strings that can be represented with latin-1/one-byte strings (and important V8 optimization), it will attempt return a continuous string of MessagePack data that contains multiple sub-strings, so the decoder can slice off strings by offset. When a string contains non-latin characters, and must be represented as a two-byte string, this will always be returned as the string alone without combination with any other strings. The extractor will return an array of a maximum of 256 strings. The decoder can call the extractStrings again, with a new offset to continue extracting more strings as necessary.
|
|
3
|
-
|
|
4
|
-
## License
|
|
1
|
+
## Summary
|
|
2
|
+
This module is designed to do fast and efficient native/C-level extraction of strings from MessagePack binary data. This works by calling `extractStrings(buffer, start, end)`, and it will extract strings by doing partial MessagePack parsing, and scanning to find the string data in the range specified in the buffer. It will return an array of strings that it finds. When it finds strings that can be represented with latin-1/one-byte strings (and important V8 optimization), it will attempt return a continuous string of MessagePack data that contains multiple sub-strings, so the decoder can slice off strings by offset. When a string contains non-latin characters, and must be represented as a two-byte string, this will always be returned as the string alone without combination with any other strings. The extractor will return an array of a maximum of 256 strings. The decoder can call the extractStrings again, with a new offset to continue extracting more strings as necessary.
|
|
3
|
+
|
|
4
|
+
## License
|
|
5
5
|
MIT
|
package/binding.gyp
CHANGED
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
{
|
|
2
|
-
"variables": {
|
|
3
|
-
"os_linux_compiler%": "gcc",
|
|
4
|
-
"enable_v8%": "true",
|
|
5
|
-
"enable_pointer_compression%": "false",
|
|
6
|
-
"build_v8_with_gn": "false"
|
|
7
|
-
},
|
|
8
|
-
"conditions": [
|
|
9
|
-
['OS=="win"', {
|
|
10
|
-
"variables": {
|
|
11
|
-
"enable_v8%": "<!(echo %ENABLE_V8_FUNCTIONS%)",
|
|
12
|
-
}
|
|
13
|
-
}],
|
|
14
|
-
['OS!="win"', {
|
|
15
|
-
"variables": {
|
|
16
|
-
"enable_v8%": "<!(echo $ENABLE_V8_FUNCTIONS)",
|
|
17
|
-
}
|
|
18
|
-
}]
|
|
19
|
-
],
|
|
20
|
-
"targets": [
|
|
21
|
-
{
|
|
22
|
-
"target_name": "extract",
|
|
23
|
-
"sources": [
|
|
24
|
-
"src/extract.cpp",
|
|
25
|
-
],
|
|
26
|
-
"defines": [ "NAPI_DISABLE_CPP_EXCEPTIONS" ],
|
|
27
|
-
"conditions": [
|
|
28
|
-
["OS=='linux'", {
|
|
29
|
-
"variables": {
|
|
30
|
-
"gcc_version" : "<!(<(os_linux_compiler) -dumpversion | cut -d '.' -f 1)",
|
|
31
|
-
},
|
|
32
|
-
"cflags_cc": [
|
|
33
|
-
"-fPIC",
|
|
34
|
-
"-fvisibility=hidden",
|
|
35
|
-
"-fvisibility-inlines-hidden",
|
|
36
|
-
],
|
|
37
|
-
"conditions": [
|
|
38
|
-
["gcc_version>=7", {
|
|
39
|
-
"cflags": [
|
|
40
|
-
"-Wimplicit-fallthrough=2",
|
|
41
|
-
],
|
|
42
|
-
}],
|
|
43
|
-
],
|
|
44
|
-
"ldflags": [
|
|
45
|
-
"-fPIC",
|
|
46
|
-
"-fvisibility=hidden"
|
|
47
|
-
],
|
|
48
|
-
"cflags": [
|
|
49
|
-
"-fPIC",
|
|
50
|
-
"-fvisibility=hidden",
|
|
51
|
-
"-O3"
|
|
52
|
-
],
|
|
53
|
-
}],
|
|
54
|
-
["enable_v8!='false'", {
|
|
55
|
-
"defines": ["ENABLE_V8_API=1"]
|
|
56
|
-
}],
|
|
57
|
-
["enable_pointer_compression=='true'", {
|
|
58
|
-
"defines": ["V8_COMPRESS_POINTERS", "V8_COMPRESS_POINTERS_IN_ISOLATE_CAGE"],
|
|
59
|
-
}],
|
|
60
|
-
],
|
|
61
|
-
}
|
|
62
|
-
]
|
|
63
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"variables": {
|
|
3
|
+
"os_linux_compiler%": "gcc",
|
|
4
|
+
"enable_v8%": "true",
|
|
5
|
+
"enable_pointer_compression%": "false",
|
|
6
|
+
"build_v8_with_gn": "false"
|
|
7
|
+
},
|
|
8
|
+
"conditions": [
|
|
9
|
+
['OS=="win"', {
|
|
10
|
+
"variables": {
|
|
11
|
+
"enable_v8%": "<!(echo %ENABLE_V8_FUNCTIONS%)",
|
|
12
|
+
}
|
|
13
|
+
}],
|
|
14
|
+
['OS!="win"', {
|
|
15
|
+
"variables": {
|
|
16
|
+
"enable_v8%": "<!(echo $ENABLE_V8_FUNCTIONS)",
|
|
17
|
+
}
|
|
18
|
+
}]
|
|
19
|
+
],
|
|
20
|
+
"targets": [
|
|
21
|
+
{
|
|
22
|
+
"target_name": "extract",
|
|
23
|
+
"sources": [
|
|
24
|
+
"src/extract.cpp",
|
|
25
|
+
],
|
|
26
|
+
"defines": [ "NAPI_DISABLE_CPP_EXCEPTIONS" ],
|
|
27
|
+
"conditions": [
|
|
28
|
+
["OS=='linux'", {
|
|
29
|
+
"variables": {
|
|
30
|
+
"gcc_version" : "<!(<(os_linux_compiler) -dumpversion | cut -d '.' -f 1)",
|
|
31
|
+
},
|
|
32
|
+
"cflags_cc": [
|
|
33
|
+
"-fPIC",
|
|
34
|
+
"-fvisibility=hidden",
|
|
35
|
+
"-fvisibility-inlines-hidden",
|
|
36
|
+
],
|
|
37
|
+
"conditions": [
|
|
38
|
+
["gcc_version>=7", {
|
|
39
|
+
"cflags": [
|
|
40
|
+
"-Wimplicit-fallthrough=2",
|
|
41
|
+
],
|
|
42
|
+
}],
|
|
43
|
+
],
|
|
44
|
+
"ldflags": [
|
|
45
|
+
"-fPIC",
|
|
46
|
+
"-fvisibility=hidden"
|
|
47
|
+
],
|
|
48
|
+
"cflags": [
|
|
49
|
+
"-fPIC",
|
|
50
|
+
"-fvisibility=hidden",
|
|
51
|
+
"-O3"
|
|
52
|
+
],
|
|
53
|
+
}],
|
|
54
|
+
["enable_v8!='false'", {
|
|
55
|
+
"defines": ["ENABLE_V8_API=1"]
|
|
56
|
+
}],
|
|
57
|
+
["enable_pointer_compression=='true'", {
|
|
58
|
+
"defines": ["V8_COMPRESS_POINTERS", "V8_COMPRESS_POINTERS_IN_ISOLATE_CAGE"],
|
|
59
|
+
}],
|
|
60
|
+
],
|
|
61
|
+
}
|
|
62
|
+
]
|
|
63
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "msgpackr-extract",
|
|
3
3
|
"author": "Kris Zyp",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.2.0",
|
|
5
5
|
"description": "Node addon for string extraction for msgpackr",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
@@ -12,10 +12,10 @@
|
|
|
12
12
|
"install": "node-gyp-build-optional-packages",
|
|
13
13
|
"recompile": "node-gyp rebuild",
|
|
14
14
|
"before-publish": "prebuildify-ci download && node set-optional-deps.cjs",
|
|
15
|
-
"prebuild": "prebuildify-platform-packages --target
|
|
16
|
-
"prebuild-win32": "prebuildify-platform-packages --target
|
|
17
|
-
"prebuild-libc": "prebuildify-platform-packages --tag-libc --target 16.14.2 && ENABLE_V8_FUNCTIONS=false prebuildify-platform-packages --platform-packages --napi --tag-libc --target
|
|
18
|
-
"prebuild-libc-alpine": "prebuildify-cross --image alpine --tag-libc --target
|
|
15
|
+
"prebuild": "prebuildify-platform-packages --target 18.12.0",
|
|
16
|
+
"prebuild-win32": "prebuildify-platform-packages --target 18.12.0 && set ENABLE_V8_FUNCTIONS=false&& prebuildify-platform-packages --platform-packages --napi --target 18.12.0",
|
|
17
|
+
"prebuild-libc": "prebuildify-platform-packages --tag-libc --target 18.12.0 && prebuildify-platform-packages --platform-packages --napi --tag-libc --target 16.14.2 && ENABLE_V8_FUNCTIONS=false prebuildify-platform-packages --platform-packages --napi --tag-libc --target 18.12.0",
|
|
18
|
+
"prebuild-libc-alpine": "prebuildify-cross --image alpine --tag-libc --target 18.12.0",
|
|
19
19
|
"publish-all": "cd prebuilds/win32-x64 && npm publish --access public && cd ../darwin-x64 && npm publish --access public && cd ../darwin-arm64 && npm publish --access public && cd ../linux-x64 && npm publish --access public && cd ../linux-arm64 && npm publish --access public && cd ../linux-arm && npm publish --access public && cd ../.. && npm publish --access public",
|
|
20
20
|
"test": "node ./index.js"
|
|
21
21
|
},
|
|
@@ -34,15 +34,15 @@
|
|
|
34
34
|
"download-msgpackr-prebuilds": "./bin/download-prebuilds.js"
|
|
35
35
|
},
|
|
36
36
|
"optionalDependencies": {
|
|
37
|
-
"@msgpackr-extract/msgpackr-extract-darwin-arm64": "2.
|
|
38
|
-
"@msgpackr-extract/msgpackr-extract-darwin-x64": "2.
|
|
39
|
-
"@msgpackr-extract/msgpackr-extract-linux-arm": "2.
|
|
40
|
-
"@msgpackr-extract/msgpackr-extract-linux-arm64": "2.
|
|
41
|
-
"@msgpackr-extract/msgpackr-extract-linux-x64": "2.
|
|
42
|
-
"@msgpackr-extract/msgpackr-extract-win32-x64": "2.
|
|
37
|
+
"@msgpackr-extract/msgpackr-extract-darwin-arm64": "2.2.0",
|
|
38
|
+
"@msgpackr-extract/msgpackr-extract-darwin-x64": "2.2.0",
|
|
39
|
+
"@msgpackr-extract/msgpackr-extract-linux-arm": "2.2.0",
|
|
40
|
+
"@msgpackr-extract/msgpackr-extract-linux-arm64": "2.2.0",
|
|
41
|
+
"@msgpackr-extract/msgpackr-extract-linux-x64": "2.2.0",
|
|
42
|
+
"@msgpackr-extract/msgpackr-extract-win32-x64": "2.2.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"prebuildify-platform-packages": "5.0.
|
|
45
|
+
"prebuildify-platform-packages": "5.0.2",
|
|
46
46
|
"prebuildify-ci": "^1.0.5",
|
|
47
47
|
"prebuildify-cross": "5.0.0"
|
|
48
48
|
}
|
package/src/extract.cpp
CHANGED
|
@@ -260,7 +260,8 @@ napi_value extractStrings(napi_env env, napi_callback_info info) {
|
|
|
260
260
|
napi_get_value_uint32(env, args[0], &position);
|
|
261
261
|
napi_get_value_uint32(env, args[1], &size);
|
|
262
262
|
uint8_t* source;
|
|
263
|
-
|
|
263
|
+
size_t buffer_size;
|
|
264
|
+
napi_get_buffer_info(env, args[2], (void**) &source, &buffer_size);
|
|
264
265
|
return extractor->extractStrings(env, position, size, source);
|
|
265
266
|
}
|
|
266
267
|
#define EXPORT_NAPI_FUNCTION(name, func) { napi_property_descriptor desc = { name, 0, func, 0, 0, 0, (napi_property_attributes) (napi_writable | napi_configurable), 0 }; napi_define_properties(env, exports, 1, &desc); }
|
package/src/.vs/slnx.sqlite
DELETED
|
Binary file
|
package/src/.vs/src/v16/.suo
DELETED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
File without changes
|