Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
steps:

- name: Ensure steps to avoid vulnerabilities
uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # curl -s https://api.github.com/repos/step-security/harden-runner/commits/v2.14.2 | jq -r .sha
uses: step-security/harden-runner@ab7a9404c0f3da075243ca237b5fac12c98deaa5 # curl -s https://api.github.com/repos/step-security/harden-runner/commits/v2.19.3 | jq -r .sha
with:
egress-policy: audit

Expand All @@ -71,7 +71,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Setup NodeJS v${{ env.NODE_VERSION }}
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # curl -s https://api.github.com/repos/actions/setup-node/commits/v6.3.0 | jq -r .sha
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # curl -s https://api.github.com/repos/actions/setup-node/commits/v6.4.0 | jq -r .sha
with:
node-version: ${{ env.NODE_VERSION }}

Expand Down Expand Up @@ -116,7 +116,7 @@ jobs:
fetch-tags: true # so local checks stay consistent; ls-remote still authoritative

- name: Setup NodeJS v${{ env.NODE_VERSION }}
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # curl -s https://api.github.com/repos/actions/setup-node/commits/v6.3.0 | jq -r .sha
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # curl -s https://api.github.com/repos/actions/setup-node/commits/v6.4.0 | jq -r .sha
with:
node-version: ${{ env.NODE_VERSION }}
registry-url: 'https://registry.npmjs.org'
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
steps:

- name: Ensure steps to avoid vulnerabilities
uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # curl -s https://api.github.com/repos/step-security/harden-runner/commits/v2.14.2 | jq -r .sha
uses: step-security/harden-runner@ab7a9404c0f3da075243ca237b5fac12c98deaa5 # curl -s https://api.github.com/repos/step-security/harden-runner/commits/v2.19.3 | jq -r .sha
with:
egress-policy: audit

Expand All @@ -63,7 +63,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Setup NodeJS v${{ env.NODE_VERSION }}
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # curl -s https://api.github.com/repos/actions/setup-node/commits/v6.3.0 | jq -r .sha
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # curl -s https://api.github.com/repos/actions/setup-node/commits/v6.4.0 | jq -r .sha
with:
node-version: ${{ env.NODE_VERSION }}

Expand All @@ -76,6 +76,9 @@ jobs:
- name: Run build
run: npm run build

- name: Check node engine
run: npm run check-node-engine

- name: Check requires (used-deps-analyzer)
run: npm run check-requires

Expand Down
6 changes: 3 additions & 3 deletions lib/src/SplitFrames.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ export default class SplitFrames extends Transform {

KEYS.forEach((key: string): void => {

const size: number = "object" === typeof this._specifics[key] && this._specifics[key] instanceof Buffer ? (this._specifics[key] as Buffer).length : 1;
const size: number = "object" === typeof this._specifics[key] && this._specifics[key] instanceof Buffer ? this._specifics[key].length : 1;

for (let foundAt: number = this._searchTags(this._specifics[key]); -1 < foundAt; foundAt = this._searchTags(this._specifics[key])) {

Expand Down Expand Up @@ -300,7 +300,7 @@ export default class SplitFrames extends Transform {
found = true;

const size: number = "object" === typeof this._specifics[key] && this._specifics[key] instanceof Buffer
? (this._specifics[key] as Buffer).length
? this._specifics[key].length
: 1;

this.emit(key);
Expand Down Expand Up @@ -328,7 +328,7 @@ export default class SplitFrames extends Transform {

const firstStart: iSearchedBits | undefined = this._searchFirstStart();

const size: number = "object" === typeof this._specifics[key] && this._specifics[key] instanceof Buffer ? (this._specifics[key] as Buffer).length : 1;
const size: number = "object" === typeof this._specifics[key] && this._specifics[key] instanceof Buffer ? this._specifics[key].length : 1;

for (
let foundAt: number = this._searchTags(this._specifics[key]), i = 0;
Expand Down
23 changes: 9 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{

"name": "split-frames",
"version": "2.7.0",
"version": "2.8.0",
"description": "Split Buffer frames from streams.",

"type": "commonjs",
Expand All @@ -19,8 +19,6 @@

"scripts": {

"prepare": "npx husky || true",

"lint-back": "npx eslint --config .eslintrc-back.js --ext .ts,.cts,.mts ./lib/src/**/*",
"lint-tests": "npx eslint --config .eslintrc-tests.js --ext .js,.cjs,.mjs ./test/**/*",
"lint": "npm run lint-back && npm run lint-tests",
Expand All @@ -31,42 +29,38 @@
"build-back": "npm run clean-back && npx tsc --project ./tsconfig.json",
"build": "npm run build-back",

"check-node-engine": "npx check-node-engine",
"check-requires": "npx used-deps-analyzer ./package.json ./lib/src --no-dev",
"check-updates": "npx check-version-modules --no-fail-at-major --fail-at-minor --fail-at-patch",
"unit-tests": "npx mocha",
"unit-tests-local": "npx nyc --reporter=html --reporter=text mocha",

"tests": "npm run lint && npm run check-requires && npm run check-updates && npm run build && npm run unit-tests-local"
"tests": "npm run lint && npm run check-node-engine && npm run check-requires && npm run check-updates && npm run build && npm run unit-tests-local"

},

"files": [
"lib/cjs"
],
"engines": {
"node": ">=22.22.0"
"node": ">=22.22.3"
},

"dependencies": {},
"devDependencies": {
"@types/node": "25.6.0",
"check-version-modules": "2.3.0",
"@types/node": "25.9.1",
"check-node-engine": "1.0.0",
"check-version-modules": "2.5.0",
"colors": "1.4.0",
"eslint-plugin-personnallinter": "git+ssh://git@github.com/Psychopoulet/eslint-plugin-personnallinter",
"husky": "9.1.7",
"mocha": "11.7.5",
"mocha": "11.7.6",
"nyc": "18.0.0",
"rimraf": "6.1.3",
"typescript": "5.9.3",
"used-deps-analyzer": "0.3.0"
},

"husky": {
"hooks": {
"pre-commit": "npm run lint",
"pre-push": "npm run build && npm run unit-tests-local"
}
},
"keywords": [
"frame",
"Buffer",
Expand All @@ -91,6 +85,7 @@
"MSB",
"LSB"
],

"author": "Sébastien VIDAL",
"contributors": [
{
Expand Down
Loading