upgrade dep version

This commit is contained in:
Jay 2020-09-11 12:11:54 +08:00
parent 43b005d487
commit 0b00b55244
6 changed files with 110 additions and 107 deletions

View File

@ -11,14 +11,14 @@ crate-type = ["cdylib"]
[dependencies] [dependencies]
diff = "0.1.12" diff = "0.1.12"
napi = { version = "0.4" } napi = { version = "0.5.1" }
napi-derive = { version = "0.4" } napi-derive = { version = "0.5.1" }
[target.'cfg(all(unix, not(target_env = "musl")))'.dependencies] [target.'cfg(all(unix, not(target_env = "musl")))'.dependencies]
jemallocator = { version = "0.3", features = ["disable_initial_exec_tls"] } jemallocator = { version = "0.3.2", features = ["disable_initial_exec_tls"] }
[build-dependencies] [build-dependencies]
napi-build = "0.2" napi-build = "0.2.1"
[profile.release] [profile.release]
opt-level = 3 opt-level = 3

View File

@ -8,9 +8,6 @@
"keywords": ["napi-rs", "NAPI", "N-API", "Rust", "node-addon", "node-addon-api"], "keywords": ["napi-rs", "NAPI", "N-API", "Rust", "node-addon", "node-addon-api"],
"main": "index.darwin.node", "main": "index.darwin.node",
"files": ["index.darwin.node"], "files": ["index.darwin.node"],
"publishConfig": {
"@mtfos:registry": "https://gitlab.trj.tw/api/v4/projects/4/packages/npm/"
},
"os": ["darwin"], "os": ["darwin"],
"cpu": ["x64"] "cpu": ["x64"]
} }

View File

@ -8,9 +8,6 @@
"keywords": ["napi-rs", "NAPI", "N-API", "Rust", "node-addon", "node-addon-api"], "keywords": ["napi-rs", "NAPI", "N-API", "Rust", "node-addon", "node-addon-api"],
"main": "index.linux.node", "main": "index.linux.node",
"files": ["index.linux.node"], "files": ["index.linux.node"],
"publishConfig": {
"@mtfos:registry": "https://gitlab.trj.tw/api/v4/projects/4/packages/npm/"
},
"os": ["linux"], "os": ["linux"],
"cpu": ["x64"] "cpu": ["x64"]
} }

138
package-lock.json generated
View File

@ -1,6 +1,6 @@
{ {
"name": "rs-diff", "name": "@mtfos/rs-diff",
"version": "0.0.1", "version": "0.0.3",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {
@ -100,11 +100,11 @@
} }
}, },
"@node-rs/helper": { "@node-rs/helper": {
"version": "0.2.1", "version": "0.4.0",
"resolved": "https://npm.trj.tw/@node-rs%2fhelper/-/helper-0.2.1.tgz", "resolved": "https://registry.npmjs.org/@node-rs/helper/-/helper-0.4.0.tgz",
"integrity": "sha512-DEPYwfkkhJlVLFu6hWVGZi96jUCBahi1WoHZAC7gSFoeoJtxwJ+FrJSDx/8c9aIwAf477NnKj8bRJzFm98Me3A==", "integrity": "sha512-fSyHEXmlt/FueKqAYiGFCnkohnQBMQwUr6VYPeZEeVBAzQzhioS1WaRe2fSpOuRKIimCQEvxhQ6fwsYxYakfGA==",
"requires": { "requires": {
"tslib": "^2.0.0" "tslib": "^2.0.1"
} }
}, },
"@nodelib/fs.scandir": { "@nodelib/fs.scandir": {
@ -194,12 +194,12 @@
"dev": true "dev": true
}, },
"@octokit/plugin-rest-endpoint-methods": { "@octokit/plugin-rest-endpoint-methods": {
"version": "4.1.2", "version": "4.1.4",
"resolved": "https://npm.trj.tw/@octokit%2fplugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-4.1.2.tgz", "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-4.1.4.tgz",
"integrity": "sha512-PTI7wpbGEZ2IR87TVh+TNWaLcgX/RsZQalFbQCq8XxYUrQ36RHyERrHSNXFy5gkWpspUAOYRSV707JJv6BhqJA==", "integrity": "sha512-Y2tVpSa7HjV3DGIQrQOJcReJ2JtcN9FaGr9jDa332Flro923/h3/Iu9e7Y4GilnzfLclHEh5iCQoCkHm7tWOcg==",
"dev": true, "dev": true,
"requires": { "requires": {
"@octokit/types": "^5.1.1", "@octokit/types": "^5.4.1",
"deprecation": "^2.3.1" "deprecation": "^2.3.1"
} }
}, },
@ -231,15 +231,15 @@
} }
}, },
"@octokit/rest": { "@octokit/rest": {
"version": "18.0.3", "version": "18.0.5",
"resolved": "https://npm.trj.tw/@octokit%2frest/-/rest-18.0.3.tgz", "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-18.0.5.tgz",
"integrity": "sha512-GubgemnLvUJlkhouTM2BtX+g/voYT/Mqh0SASGwTnLvSkW1irjt14N911/ABb6m1Hru0TwScOgFgMFggp3igfQ==", "integrity": "sha512-SPKI24tQXrr1XsnaIjv2x0rl4M5eF1+hj8+vMe3d/exZ7NnL5sTe1BuFyCyJyrc+j1HkXankvgGN9zT0rwBwtg==",
"dev": true, "dev": true,
"requires": { "requires": {
"@octokit/core": "^3.0.0", "@octokit/core": "^3.0.0",
"@octokit/plugin-paginate-rest": "^2.2.0", "@octokit/plugin-paginate-rest": "^2.2.0",
"@octokit/plugin-request-log": "^1.0.0", "@octokit/plugin-request-log": "^1.0.0",
"@octokit/plugin-rest-endpoint-methods": "4.1.2" "@octokit/plugin-rest-endpoint-methods": "4.1.4"
} }
}, },
"@octokit/types": { "@octokit/types": {
@ -257,6 +257,13 @@
"integrity": "sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ==", "integrity": "sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ==",
"dev": true "dev": true
}, },
"@swc-node/core-linux-musl": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/@swc-node/core-linux-musl/-/core-linux-musl-0.6.1.tgz",
"integrity": "sha512-VcQ1kdeRw1D8/uMk90wHSMJmT41Tex8iytuGKBl/bVOZ5wPD9wA3Sz5ieMgt4CNiUtVITTlpyTJuQgO526W7Ug==",
"dev": true,
"optional": true
},
"@szmarczak/http-timer": { "@szmarczak/http-timer": {
"version": "1.1.2", "version": "1.1.2",
"resolved": "https://npm.trj.tw/@szmarczak%2fhttp-timer/-/http-timer-1.1.2.tgz", "resolved": "https://npm.trj.tw/@szmarczak%2fhttp-timer/-/http-timer-1.1.2.tgz",
@ -667,7 +674,7 @@
}, },
"chardet": { "chardet": {
"version": "0.7.0", "version": "0.7.0",
"resolved": "https://npm.trj.tw/chardet/-/chardet-0.7.0.tgz", "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz",
"integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==",
"dev": true "dev": true
}, },
@ -756,14 +763,14 @@
}, },
"cli-width": { "cli-width": {
"version": "3.0.0", "version": "3.0.0",
"resolved": "https://npm.trj.tw/cli-width/-/cli-width-3.0.0.tgz", "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-3.0.0.tgz",
"integrity": "sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw==", "integrity": "sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw==",
"dev": true "dev": true
}, },
"clipanion": { "clipanion": {
"version": "2.4.4", "version": "2.5.0",
"resolved": "https://npm.trj.tw/clipanion/-/clipanion-2.4.4.tgz", "resolved": "https://registry.npmjs.org/clipanion/-/clipanion-2.5.0.tgz",
"integrity": "sha512-KjyCBz8xplftHjIK/nOqq/9b3hPlXbAAo/AxoITrO4yySpQ6a9QSJDAfOx9PfcRUHteeqbdNxZKSPfeFqQ7plg==", "integrity": "sha512-VYOMl0h/mZXQC2BWq7oBto1zY1SkPWUaJjt+cuIred1HrmrcX1I2N+LNyNoRy8Iwu9r6vUxJwS/tWLwhQW4tPw==",
"dev": true "dev": true
}, },
"cliui": { "cliui": {
@ -817,9 +824,9 @@
"dev": true "dev": true
}, },
"commander": { "commander": {
"version": "5.1.0", "version": "6.1.0",
"resolved": "https://npm.trj.tw/commander/-/commander-5.1.0.tgz", "resolved": "https://registry.npmjs.org/commander/-/commander-6.1.0.tgz",
"integrity": "sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg==", "integrity": "sha512-wl7PNrYWd2y5mp1OK/LhTlv8Ff4kQJQRXXAvF+uU/TPNiVJUxZLRYGj/B0y/lPGAVcSbJqH2Za/cvHmrPMC8mA==",
"dev": true "dev": true
}, },
"common-path-prefix": { "common-path-prefix": {
@ -886,16 +893,16 @@
"dev": true "dev": true
}, },
"cosmiconfig": { "cosmiconfig": {
"version": "6.0.0", "version": "7.0.0",
"resolved": "https://npm.trj.tw/cosmiconfig/-/cosmiconfig-6.0.0.tgz", "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.0.0.tgz",
"integrity": "sha512-xb3ZL6+L8b9JLLCx3ZdoZy4+2ECphCMo2PwqgP1tlfVq6M6YReyzBJtvWWtbDSpNr9hn96pkCiZqUcFEc+54Qg==", "integrity": "sha512-pondGvTuVYDk++upghXJabWzL6Kxu6f26ljFw64Swq9v6sQPUL3EUlVDV56diOjpCayKihL6hVe8exIACU4XcA==",
"dev": true, "dev": true,
"requires": { "requires": {
"@types/parse-json": "^4.0.0", "@types/parse-json": "^4.0.0",
"import-fresh": "^3.1.0", "import-fresh": "^3.2.1",
"parse-json": "^5.0.0", "parse-json": "^5.0.0",
"path-type": "^4.0.0", "path-type": "^4.0.0",
"yaml": "^1.7.2" "yaml": "^1.10.0"
}, },
"dependencies": { "dependencies": {
"parse-json": { "parse-json": {
@ -1170,7 +1177,7 @@
}, },
"external-editor": { "external-editor": {
"version": "3.1.0", "version": "3.1.0",
"resolved": "https://npm.trj.tw/external-editor/-/external-editor-3.1.0.tgz", "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz",
"integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==",
"dev": true, "dev": true,
"requires": { "requires": {
@ -1208,6 +1215,12 @@
"reusify": "^1.0.4" "reusify": "^1.0.4"
} }
}, },
"fdir": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/fdir/-/fdir-4.1.0.tgz",
"integrity": "sha512-oOkohnPg4nUIkd6w22iGbFD7c7UvVnXB3a7/GHcPSsXDUGm6Jxp12bGI5O0gr0YuhDh5l/vDExdHOnrW/j9EqQ==",
"dev": true
},
"figures": { "figures": {
"version": "3.2.0", "version": "3.2.0",
"resolved": "https://npm.trj.tw/figures/-/figures-3.2.0.tgz", "resolved": "https://npm.trj.tw/figures/-/figures-3.2.0.tgz",
@ -1381,15 +1394,15 @@
"dev": true "dev": true
}, },
"husky": { "husky": {
"version": "4.2.5", "version": "4.3.0",
"resolved": "https://npm.trj.tw/husky/-/husky-4.2.5.tgz", "resolved": "https://registry.npmjs.org/husky/-/husky-4.3.0.tgz",
"integrity": "sha512-SYZ95AjKcX7goYVZtVZF2i6XiZcHknw50iXvY7b0MiGoj5RwdgRQNEHdb+gPDPCXKlzwrybjFjkL6FOj8uRhZQ==", "integrity": "sha512-tTMeLCLqSBqnflBZnlVDhpaIMucSGaYyX6855jM4AguGeWCeSzNdb1mfyWduTZ3pe3SJVvVWGL0jO1iKZVPfTA==",
"dev": true, "dev": true,
"requires": { "requires": {
"chalk": "^4.0.0", "chalk": "^4.0.0",
"ci-info": "^2.0.0", "ci-info": "^2.0.0",
"compare-versions": "^3.6.0", "compare-versions": "^3.6.0",
"cosmiconfig": "^6.0.0", "cosmiconfig": "^7.0.0",
"find-versions": "^3.2.0", "find-versions": "^3.2.0",
"opencollective-postinstall": "^2.0.2", "opencollective-postinstall": "^2.0.2",
"pkg-dir": "^4.2.0", "pkg-dir": "^4.2.0",
@ -1400,7 +1413,7 @@
}, },
"iconv-lite": { "iconv-lite": {
"version": "0.4.24", "version": "0.4.24",
"resolved": "https://npm.trj.tw/iconv-lite/-/iconv-lite-0.4.24.tgz", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
"integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
"dev": true, "dev": true,
"requires": { "requires": {
@ -1489,7 +1502,7 @@
}, },
"inquirer": { "inquirer": {
"version": "7.3.3", "version": "7.3.3",
"resolved": "https://npm.trj.tw/inquirer/-/inquirer-7.3.3.tgz", "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-7.3.3.tgz",
"integrity": "sha512-JG3eIAj5V9CwcGvuOmoo6LB9kbAYT8HXffUl6memuszlwDC/qvFAJw49XJ5NROSFNPxp3iQg1GqkFhaY/CR0IA==", "integrity": "sha512-JG3eIAj5V9CwcGvuOmoo6LB9kbAYT8HXffUl6memuszlwDC/qvFAJw49XJ5NROSFNPxp3iQg1GqkFhaY/CR0IA==",
"dev": true, "dev": true,
"requires": { "requires": {
@ -1718,20 +1731,20 @@
"dev": true "dev": true
}, },
"lint-staged": { "lint-staged": {
"version": "10.2.11", "version": "10.3.0",
"resolved": "https://npm.trj.tw/lint-staged/-/lint-staged-10.2.11.tgz", "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-10.3.0.tgz",
"integrity": "sha512-LRRrSogzbixYaZItE2APaS4l2eJMjjf5MbclRZpLJtcQJShcvUzKXsNeZgsLIZ0H0+fg2tL4B59fU9wHIHtFIA==", "integrity": "sha512-an3VgjHqmJk0TORB/sdQl0CTkRg4E5ybYCXTTCSJ5h9jFwZbcgKIx5oVma5e7wp/uKt17s1QYFmYqT9MGVosGw==",
"dev": true, "dev": true,
"requires": { "requires": {
"chalk": "^4.0.0", "chalk": "^4.1.0",
"cli-truncate": "2.1.0", "cli-truncate": "^2.1.0",
"commander": "^5.1.0", "commander": "^6.0.0",
"cosmiconfig": "^6.0.0", "cosmiconfig": "^7.0.0",
"debug": "^4.1.1", "debug": "^4.1.1",
"dedent": "^0.7.0", "dedent": "^0.7.0",
"enquirer": "^2.3.5", "enquirer": "^2.3.6",
"execa": "^4.0.1", "execa": "^4.0.3",
"listr2": "^2.1.0", "listr2": "^2.6.0",
"log-symbols": "^4.0.0", "log-symbols": "^4.0.0",
"micromatch": "^4.0.2", "micromatch": "^4.0.2",
"normalize-path": "^3.0.0", "normalize-path": "^3.0.0",
@ -1741,9 +1754,9 @@
} }
}, },
"listr2": { "listr2": {
"version": "2.6.0", "version": "2.6.2",
"resolved": "https://npm.trj.tw/listr2/-/listr2-2.6.0.tgz", "resolved": "https://registry.npmjs.org/listr2/-/listr2-2.6.2.tgz",
"integrity": "sha512-nwmqTJYQQ+AsKb4fCXH/6/UmLCEDL1jkRAdSn9M6cEUzoRGrs33YD/3N86gAZQnGZ6hxV18XSdlBcJ1GTmetJA==", "integrity": "sha512-6x6pKEMs8DSIpA/tixiYY2m/GcbgMplMVmhQAaLFxEtNSKLeWTGjtmU57xvv6QCm2XcqzyNXL/cTSVf4IChCRA==",
"dev": true, "dev": true,
"requires": { "requires": {
"chalk": "^4.1.0", "chalk": "^4.1.0",
@ -1977,13 +1990,20 @@
"dev": true "dev": true
}, },
"napi-rs": { "napi-rs": {
"version": "0.2.6", "version": "0.3.7",
"resolved": "https://npm.trj.tw/napi-rs/-/napi-rs-0.2.6.tgz", "resolved": "https://registry.npmjs.org/napi-rs/-/napi-rs-0.3.7.tgz",
"integrity": "sha512-+hjna/WShqAr7pr9+8x/16ipcs8jH4YkJ9AzHRQc0GjFETeNSZz13Rm8fSTzTxrgMDsZYl8LMQ040lLQoT8/cA==", "integrity": "sha512-wYBDkMq/Uw9re0gHdIkMHDYwnV2G82j5wixO5wXVw+aL5WkxvXoGHRxlg+TFUWfe6YckHeFfcHOzUpAiSEGfZg==",
"dev": true, "dev": true,
"requires": { "requires": {
"clipanion": "^2.4.4", "@octokit/rest": "^18.0.4",
"@swc-node/core-linux-musl": "^0.6.1",
"chalk": "^4.1.0",
"clipanion": "^2.5.0",
"debug": "^4.1.1",
"fdir": "^4.1.0",
"inquirer": "^7.3.3", "inquirer": "^7.3.3",
"lodash": "^4.17.20",
"putasset": "^5.0.3",
"toml": "^3.0.0", "toml": "^3.0.0",
"tslib": "^2.0.1" "tslib": "^2.0.1"
} }
@ -2093,7 +2113,7 @@
}, },
"os-tmpdir": { "os-tmpdir": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://npm.trj.tw/os-tmpdir/-/os-tmpdir-1.0.2.tgz", "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz",
"integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=",
"dev": true "dev": true
}, },
@ -2315,9 +2335,9 @@
"dev": true "dev": true
}, },
"prettier": { "prettier": {
"version": "2.1.0", "version": "2.1.1",
"resolved": "https://npm.trj.tw/prettier/-/prettier-2.1.0.tgz", "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.1.1.tgz",
"integrity": "sha512-lz28cCbA1cDFHVuY8vvj6QuqOwIpyIfPUYkSl8AZ/vxH8qBXMMjE2knfLHCrZCmUsK/H1bg1P0tOo0dJkTJHvw==", "integrity": "sha512-9bY+5ZWCfqj3ghYBLxApy2zf6m+NJo5GzmLTpr9FsApsfjriNnS2dahWReHMi7qNPhhHl9SYHJs2cHZLgexNIw==",
"dev": true "dev": true
}, },
"pretty-ms": { "pretty-ms": {
@ -2573,7 +2593,7 @@
}, },
"run-async": { "run-async": {
"version": "2.4.1", "version": "2.4.1",
"resolved": "https://npm.trj.tw/run-async/-/run-async-2.4.1.tgz", "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz",
"integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==", "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==",
"dev": true "dev": true
}, },
@ -2608,7 +2628,7 @@
}, },
"safer-buffer": { "safer-buffer": {
"version": "2.1.2", "version": "2.1.2",
"resolved": "https://npm.trj.tw/safer-buffer/-/safer-buffer-2.1.2.tgz", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
"dev": true "dev": true
}, },
@ -2914,7 +2934,7 @@
}, },
"tmp": { "tmp": {
"version": "0.0.33", "version": "0.0.33",
"resolved": "https://npm.trj.tw/tmp/-/tmp-0.0.33.tgz", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz",
"integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==",
"dev": true, "dev": true,
"requires": { "requires": {
@ -2938,7 +2958,7 @@
}, },
"toml": { "toml": {
"version": "3.0.0", "version": "3.0.0",
"resolved": "https://npm.trj.tw/toml/-/toml-3.0.0.tgz", "resolved": "https://registry.npmjs.org/toml/-/toml-3.0.0.tgz",
"integrity": "sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==", "integrity": "sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==",
"dev": true "dev": true
}, },

View File

@ -1,60 +1,48 @@
{ {
"name": "@mtfos/rs-diff", "name": "@mtfos/rs-diff",
"version": "0.0.3", "version": "0.0.4",
"description": "Template project for writing node package with napi-rs", "description": "Template project for writing node package with napi-rs",
"author": "Jay <jay@trj.tw>", "author": "Jay <jay@trj.tw>",
"main": "index.js", "main": "index.js",
"repository": "https://git.trj.tw/nodejs/rs-diff.git", "repository": "https://git.trj.tw/nodejs/rs-diff.git",
"license": "MIT", "license": "MIT",
"keywords": ["napi-rs", "NAPI", "N-API", "Rust", "node-addon", "node-addon-api"], "keywords": [
"files": ["index.d.ts", "index.js"], "napi-rs",
"os": ["darwin", "linux", "win32"], "NAPI",
"cpu": ["x64"], "N-API",
"Rust",
"node-addon",
"node-addon-api"
],
"files": [
"index.d.ts",
"index.js"
],
"os": [
"darwin",
"linux",
"win32"
],
"cpu": [
"x64"
],
"engines": { "engines": {
"node": ">= 8.9" "node": ">= 8.9"
}, },
"publishConfig": {
"@mtfos:registry": "https://gitlab.trj.tw/api/v4/projects/4/packages/npm/"
},
"scripts": { "scripts": {
"build": "cargo build --release && napi build --platform --release ./index", "build": "cargo build --release && napi build --platform --release .",
"build:debug": "cargo build && napi build --platform ./index", "build:debug": "cargo build && napi build --platform .",
"prepublishOnly": "node ./scripts/publish.js", "prepublishOnly": "node ./scripts/publish.js",
"test": "ava", "test": "ava",
"version": "node ./scripts/version.js" "version": "node ./scripts/version.js"
}, },
"devDependencies": { "devDependencies": {
"@octokit/rest": "^18.0.3",
"ava": "^3.11.1", "ava": "^3.11.1",
"chalk": "^4.1.0", "napi-rs": "^0.3.7",
"husky": "^4.2.5",
"lint-staged": "^10.2.11",
"napi-rs": "^0.2.4",
"prettier": "^2.0.5",
"putasset": "^5.0.3",
"typescript": "^3.9.7" "typescript": "^3.9.7"
}, },
"dependencies": { "dependencies": {
"@node-rs/helper": "^0.2.1" "@node-rs/helper": "^0.4.0"
},
"lint-staged": {
"*.@(js|ts|tsx)": ["prettier --write"],
"*.@(yml|yaml)": ["prettier --parser yaml --write"],
"*.md": ["prettier --parser markdown --write"],
"*.json": ["prettier --parser json --write"]
},
"prettier": {
"printWidth": 120,
"semi": false,
"trailingComma": "all",
"singleQuote": true,
"arrowParens": "always",
"parser": "typescript"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
}, },
"optionalDependencies": { "optionalDependencies": {
"@mtfos/rs-diff-darwin": "^0.0.3", "@mtfos/rs-diff-darwin": "^0.0.3",

View File

@ -32,6 +32,7 @@ fn diff_char(ctx: CallContext) -> Result<JsObject> {
let mut idx = 0; let mut idx = 0;
for it in res.iter() { for it in res.iter() {
let mut item = ctx.env.create_object().unwrap(); let mut item = ctx.env.create_object().unwrap();
item.set_named_property( item.set_named_property(
"count", "count",
ctx.env.create_int64(it.count.try_into().unwrap()).unwrap(), ctx.env.create_int64(it.count.try_into().unwrap()).unwrap(),
@ -40,7 +41,7 @@ fn diff_char(ctx: CallContext) -> Result<JsObject> {
item.set_named_property("added", ctx.env.get_boolean(it.added).unwrap())?; item.set_named_property("added", ctx.env.get_boolean(it.added).unwrap())?;
item.set_named_property("removed", ctx.env.get_boolean(it.removed).unwrap())?; item.set_named_property("removed", ctx.env.get_boolean(it.removed).unwrap())?;
obj.set_index(idx, item)?; obj.set_element(idx, item)?;
idx += 1; idx += 1;
} }