Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d994b75973 | |||
| d0ab3ad285 | |||
| 1c80a1097b | |||
| 4344dbd111 | |||
| bb89564339 | |||
| f480be9917 | |||
| 11bf0d9dbb | |||
| c58cc2b0df | |||
| 87273cbbbd | |||
| bebc8b0ede | |||
| 46e5217fc0 |
-139
@@ -1,139 +0,0 @@
|
||||
# gitzone ci_default
|
||||
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||
|
||||
cache:
|
||||
paths:
|
||||
- .npmci_cache/
|
||||
key: '$CI_BUILD_STAGE'
|
||||
|
||||
stages:
|
||||
- security
|
||||
- test
|
||||
- release
|
||||
- metadata
|
||||
|
||||
before_script:
|
||||
- npm install -g @shipzone/npmci
|
||||
|
||||
# ====================
|
||||
# security stage
|
||||
# ====================
|
||||
mirror:
|
||||
stage: security
|
||||
script:
|
||||
- npmci git mirror
|
||||
only:
|
||||
- tags
|
||||
tags:
|
||||
- lossless
|
||||
- docker
|
||||
- notpriv
|
||||
|
||||
auditProductionDependencies:
|
||||
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||
stage: security
|
||||
script:
|
||||
- npmci npm prepare
|
||||
- npmci command npm install --production --ignore-scripts
|
||||
- npmci command npm config set registry https://registry.npmjs.org
|
||||
- npmci command npm audit --audit-level=high --only=prod --production
|
||||
tags:
|
||||
- docker
|
||||
allow_failure: true
|
||||
|
||||
auditDevDependencies:
|
||||
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||
stage: security
|
||||
script:
|
||||
- npmci npm prepare
|
||||
- npmci command npm install --ignore-scripts
|
||||
- npmci command npm config set registry https://registry.npmjs.org
|
||||
- npmci command npm audit --audit-level=high --only=dev
|
||||
tags:
|
||||
- docker
|
||||
allow_failure: true
|
||||
|
||||
# ====================
|
||||
# test stage
|
||||
# ====================
|
||||
|
||||
testStable:
|
||||
stage: test
|
||||
script:
|
||||
- npmci npm prepare
|
||||
- npmci node install stable
|
||||
- npmci npm install
|
||||
- npmci npm test
|
||||
coverage: /\d+.?\d+?\%\s*coverage/
|
||||
tags:
|
||||
- docker
|
||||
|
||||
testBuild:
|
||||
stage: test
|
||||
script:
|
||||
- npmci npm prepare
|
||||
- npmci node install stable
|
||||
- npmci npm install
|
||||
- npmci command npm run build
|
||||
coverage: /\d+.?\d+?\%\s*coverage/
|
||||
tags:
|
||||
- docker
|
||||
|
||||
release:
|
||||
stage: release
|
||||
script:
|
||||
- npmci node install stable
|
||||
- npmci npm publish
|
||||
only:
|
||||
- tags
|
||||
tags:
|
||||
- lossless
|
||||
- docker
|
||||
- notpriv
|
||||
|
||||
# ====================
|
||||
# metadata stage
|
||||
# ====================
|
||||
codequality:
|
||||
stage: metadata
|
||||
allow_failure: true
|
||||
only:
|
||||
- tags
|
||||
script:
|
||||
- npmci command npm install -g typescript
|
||||
- npmci npm prepare
|
||||
- npmci npm install
|
||||
tags:
|
||||
- lossless
|
||||
- docker
|
||||
- priv
|
||||
|
||||
trigger:
|
||||
stage: metadata
|
||||
script:
|
||||
- npmci trigger
|
||||
only:
|
||||
- tags
|
||||
tags:
|
||||
- lossless
|
||||
- docker
|
||||
- notpriv
|
||||
|
||||
pages:
|
||||
stage: metadata
|
||||
script:
|
||||
- npmci node install stable
|
||||
- npmci npm prepare
|
||||
- npmci npm install
|
||||
- npmci command npm run buildDocs
|
||||
tags:
|
||||
- lossless
|
||||
- docker
|
||||
- notpriv
|
||||
only:
|
||||
- tags
|
||||
artifacts:
|
||||
expire_in: 1 week
|
||||
paths:
|
||||
- public
|
||||
allow_failure: true
|
||||
@@ -0,0 +1,40 @@
|
||||
{
|
||||
"@git.zone/cli": {
|
||||
"projectType": "npm",
|
||||
"module": {
|
||||
"githost": "code.foss.global",
|
||||
"gitscope": "push.rocks",
|
||||
"gitrepo": "smartbuffer",
|
||||
"shortDescription": "binary data utilities",
|
||||
"npmPackagename": "@push.rocks/smartbuffer",
|
||||
"license": "MIT",
|
||||
"description": "A robust TypeScript library for managing binary data by converting between Base64 strings and Uint8Array, validating buffer-like objects, and ensuring data purity.",
|
||||
"keywords": [
|
||||
"ArrayBuffer",
|
||||
"Uint8Array",
|
||||
"base64 conversion",
|
||||
"binary data handling",
|
||||
"buffer validation",
|
||||
"TypeScript",
|
||||
"data transformation",
|
||||
"ESM",
|
||||
"utilities",
|
||||
"npm"
|
||||
]
|
||||
},
|
||||
"release": {
|
||||
"registries": [
|
||||
"https://verdaccio.lossless.digital",
|
||||
"https://registry.npmjs.org"
|
||||
],
|
||||
"accessLevel": "public"
|
||||
}
|
||||
},
|
||||
"@git.zone/tsdoc": {
|
||||
"legal": "\n## License and Legal Information\n\nThis repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository. \n\n**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.\n\n### Trademarks\n\nThis project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.\n\n### Company Information\n\nTask Venture Capital GmbH \nRegistered at District court Bremen HRB 35230 HB, Germany\n\nFor any legal inquiries or if you require further information, please contact us via email at hello@task.vc.\n\nBy using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.\n"
|
||||
},
|
||||
"@ship.zone/szci": {
|
||||
"npmGlobalTools": [],
|
||||
"npmRegistryUrl": "registry.npmjs.org"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
# Changelog
|
||||
|
||||
## 2026-05-01 - 3.0.6 - fix(build)
|
||||
modernize project tooling and tighten TypeScript typings
|
||||
|
||||
- migrate project metadata to the current @git.zone and @ship.zone configuration format
|
||||
- update build, test, and documentation scripts to the newer toolchain
|
||||
- replace tapbundle test imports with @git.zone/tstest and export tap.start() for the updated test runner
|
||||
- enable noImplicitAny and node types while refining buffer utility parameter types from any to unknown
|
||||
|
||||
## 2025-04-12 - 3.0.5 - fix(documentation)
|
||||
Enhance documentation with extensive usage examples, update project metadata, and remove obsolete CI configuration
|
||||
|
||||
- Updated package description and keywords in package.json and npmextra.json to better reflect the library's robust binary data handling capabilities
|
||||
- Revised README with comprehensive guides, detailed code examples, and advanced use cases for conversions, validations, and integrations
|
||||
- Removed outdated .gitlab-ci.yml file to streamline CI configuration
|
||||
- Improved clarity and structure in documentation for both browser and Node.js environments
|
||||
|
||||
## 2024-05-29 - 3.0.4 - misc
|
||||
Updated project description.
|
||||
- Updated the project description to better reflect current features.
|
||||
|
||||
## 2024-04-25 - 3.0.3 - core
|
||||
Core fixes applied.
|
||||
- Fixed issues in the core module.
|
||||
|
||||
## 2024-04-25 - 3.0.2 - core
|
||||
Core fixes applied.
|
||||
- Fixed issues in the core module.
|
||||
|
||||
## 2024-04-17 - 3.0.1 - core
|
||||
Core fixes applied.
|
||||
- Fixed issues in the core module.
|
||||
|
||||
## 2024-04-17 - 3.0.0 - core
|
||||
Core fixes applied.
|
||||
- Fixed issues in the core module.
|
||||
|
||||
## 2024-04-17 - 2.0.3 - core
|
||||
Breaking change in core module.
|
||||
- BREAKING CHANGE (core): Updated core functionality.
|
||||
|
||||
## 2024-04-17 - 2.0.2 - core
|
||||
Core fixes applied.
|
||||
- Fixed issues in the core module.
|
||||
|
||||
## 2024-04-17 - 2.0.1 - core
|
||||
Core fixes applied.
|
||||
- Fixed issues in the core module.
|
||||
|
||||
## 2024-04-17 - 2.0.0 - core
|
||||
Core fixes applied.
|
||||
- Fixed issues in the core module.
|
||||
|
||||
## 2024-04-17 - 1.0.7 - core, config
|
||||
Multiple updates including breaking changes and configuration adjustments.
|
||||
- BREAKING CHANGE (core): Switched to uInt8Extras.
|
||||
- Updated tsconfig.
|
||||
- Updated npmextra.json for githost.
|
||||
|
||||
## 2024-02-29 - 1.0.6 - core
|
||||
Core fixes applied.
|
||||
- Fixed issues in the core module.
|
||||
|
||||
## 2024-02-25 - 1.0.5 - core
|
||||
Core fixes applied.
|
||||
- Fixed issues in the core module.
|
||||
|
||||
## 2024-02-25 - 1.0.4 - core
|
||||
Core fixes applied.
|
||||
- Fixed issues in the core module.
|
||||
|
||||
## 2024-02-25 - 1.0.3 - core, org
|
||||
Core fixes and organizational change.
|
||||
- Fixed issues in the core module.
|
||||
- Switched to new organization scheme.
|
||||
|
||||
## 2022-06-15 - 1.0.2 - core
|
||||
Core fixes applied.
|
||||
- Fixed issues in the core module.
|
||||
|
||||
## 2022-06-15 - 1.0.1 - core
|
||||
Core fixes applied.
|
||||
- Fixed issues in the core module.
|
||||
|
||||
<!--
|
||||
Note: Routine version bump commits that only updated the version numbers have been omitted for clarity.
|
||||
-->
|
||||
@@ -1,4 +1,4 @@
|
||||
Copyright (c) 2022 Lossless GmbH (hello@lossless.com)
|
||||
Copyright (c) 2022 Task Venture Capital GmbH <hello@task.vc>
|
||||
Copyright 2011 Jon Leighton
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
@@ -17,4 +17,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
SOFTWARE.
|
||||
|
||||
+21
-14
@@ -1,33 +1,40 @@
|
||||
{
|
||||
"gitzone": {
|
||||
"@git.zone/cli": {
|
||||
"projectType": "npm",
|
||||
"module": {
|
||||
"githost": "code.foss.global",
|
||||
"gitscope": "push.rocks",
|
||||
"gitrepo": "smartbuffer",
|
||||
"description": "A library for managing ArrayBufferLike structures including conversion between Base64 and Uint8Array, and buffer validation.",
|
||||
"shortDescription": "binary data utilities",
|
||||
"npmPackagename": "@push.rocks/smartbuffer",
|
||||
"license": "MIT",
|
||||
"projectDomain": "push.rocks",
|
||||
"description": "A robust TypeScript library for managing binary data by converting between Base64 strings and Uint8Array, validating buffer-like objects, and ensuring data purity.",
|
||||
"keywords": [
|
||||
"ArrayBuffer",
|
||||
"TypeScript",
|
||||
"base64 conversion",
|
||||
"Uint8Array",
|
||||
"data transformation",
|
||||
"base64 conversion",
|
||||
"binary data handling",
|
||||
"buffer validation",
|
||||
"modular programming",
|
||||
"TypeScript",
|
||||
"data transformation",
|
||||
"ESM",
|
||||
"utilities"
|
||||
"utilities",
|
||||
"npm"
|
||||
]
|
||||
},
|
||||
"release": {
|
||||
"registries": [
|
||||
"https://verdaccio.lossless.digital",
|
||||
"https://registry.npmjs.org"
|
||||
],
|
||||
"accessLevel": "public"
|
||||
}
|
||||
},
|
||||
"npmci": {
|
||||
"npmGlobalTools": [],
|
||||
"npmAccessLevel": "public"
|
||||
},
|
||||
"tsdoc": {
|
||||
"@git.zone/tsdoc": {
|
||||
"legal": "\n## License and Legal Information\n\nThis repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository. \n\n**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.\n\n### Trademarks\n\nThis project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.\n\n### Company Information\n\nTask Venture Capital GmbH \nRegistered at District court Bremen HRB 35230 HB, Germany\n\nFor any legal inquiries or if you require further information, please contact us via email at hello@task.vc.\n\nBy using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.\n"
|
||||
},
|
||||
"@ship.zone/szci": {
|
||||
"npmGlobalTools": [],
|
||||
"npmRegistryUrl": "registry.npmjs.org"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+27
-18
@@ -1,24 +1,25 @@
|
||||
{
|
||||
"name": "@push.rocks/smartbuffer",
|
||||
"version": "3.0.1",
|
||||
"version": "3.0.6",
|
||||
"private": false,
|
||||
"description": "A library for managing ArrayBufferLike structures including conversion between Base64 and Uint8Array, and buffer validation.",
|
||||
"description": "A robust TypeScript library for managing binary data by converting between Base64 strings and Uint8Array, validating buffer-like objects, and ensuring data purity.",
|
||||
"main": "dist_ts/index.js",
|
||||
"typings": "dist_ts/index.d.ts",
|
||||
"type": "module",
|
||||
"author": "Lossless GmbH",
|
||||
"author": "Task Venture Capital GmbH <hello@task.vc>",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"test": "(tstest test/ --web)",
|
||||
"build": "(tsbuild --web --allowimplicitany)"
|
||||
"test": "tstest test/ --web",
|
||||
"format": "gitzone format",
|
||||
"build": "tsbuild --web",
|
||||
"buildDocs": "tsdoc"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@git.zone/tsbuild": "^2.1.25",
|
||||
"@git.zone/tsbundle": "^2.0.5",
|
||||
"@git.zone/tsrun": "^1.2.46",
|
||||
"@git.zone/tstest": "^1.0.44",
|
||||
"@push.rocks/tapbundle": "^5.0.8",
|
||||
"@types/node": "^20.11.20"
|
||||
"@git.zone/tsbuild": "^4.4.0",
|
||||
"@git.zone/tsbundle": "^2.10.1",
|
||||
"@git.zone/tsrun": "^2.0.3",
|
||||
"@git.zone/tstest": "^3.6.3",
|
||||
"@types/node": "^25.6.0"
|
||||
},
|
||||
"browserslist": [
|
||||
"last 1 chrome versions"
|
||||
@@ -32,22 +33,30 @@
|
||||
"dist_ts_web/**/*",
|
||||
"assets/**/*",
|
||||
"cli.js",
|
||||
".smartconfig.json",
|
||||
"license",
|
||||
"npmextra.json",
|
||||
"readme.md"
|
||||
],
|
||||
"keywords": [
|
||||
"ArrayBuffer",
|
||||
"TypeScript",
|
||||
"base64 conversion",
|
||||
"Uint8Array",
|
||||
"data transformation",
|
||||
"base64 conversion",
|
||||
"binary data handling",
|
||||
"buffer validation",
|
||||
"modular programming",
|
||||
"TypeScript",
|
||||
"data transformation",
|
||||
"ESM",
|
||||
"utilities"
|
||||
"utilities",
|
||||
"npm"
|
||||
],
|
||||
"dependencies": {
|
||||
"uint8array-extras": "^1.1.0"
|
||||
}
|
||||
"uint8array-extras": "^1.5.0"
|
||||
},
|
||||
"homepage": "https://code.foss.global/push.rocks/smartbuffer",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://code.foss.global/push.rocks/smartbuffer.git"
|
||||
},
|
||||
"packageManager": "pnpm@10.7.0+sha512.6b865ad4b62a1d9842b61d674a393903b871d9244954f652b8842c2b553c72176b278f64c463e52d40fff8aba385c235c8c9ecf5cc7de4fd78b8bb6d49633ab6"
|
||||
}
|
||||
|
||||
Generated
+7033
-4901
File diff suppressed because it is too large
Load Diff
+2
-2
@@ -1,4 +1,4 @@
|
||||
import { expect, expectAsync, tap } from '@push.rocks/tapbundle';
|
||||
import { expect, tap } from '@git.zone/tstest/tapbundle';
|
||||
import * as smartbuffer from '../ts/index.js';
|
||||
|
||||
tap.test('first test', async () => {
|
||||
@@ -18,4 +18,4 @@ tap.test('should recognize different buffer like objects', async () => {
|
||||
expect(smartbuffer.isBufferLike(testUint8Array)).toBeTrue();
|
||||
});
|
||||
|
||||
tap.start();
|
||||
export default tap.start();
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* autocreated commitinfo by @pushrocks/commitinfo
|
||||
* autocreated commitinfo by @push.rocks/commitinfo
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@push.rocks/smartbuffer',
|
||||
version: '3.0.1',
|
||||
description: 'A library for managing ArrayBufferLike structures including conversion between Base64 and Uint8Array, and buffer validation.'
|
||||
version: '3.0.6',
|
||||
description: 'A robust TypeScript library for managing binary data by converting between Base64 strings and Uint8Array, validating buffer-like objects, and ensuring data purity.'
|
||||
}
|
||||
|
||||
+14
-5
@@ -10,13 +10,13 @@ export function base64ToUint8Array(base64: string): Uint8Array {
|
||||
return plugins.uInt8ArrayExtras.base64ToUint8Array(base64);
|
||||
}
|
||||
|
||||
export const isUint8Array = (obj: any): obj is Uint8Array => {
|
||||
export const isUint8Array = (obj: unknown): obj is Uint8Array => {
|
||||
return plugins.uInt8ArrayExtras.isUint8Array(obj);
|
||||
}
|
||||
};
|
||||
|
||||
export function isBufferLike(obj: any): obj is ArrayBufferLike | Buffer {
|
||||
export function isBufferLike(obj: unknown): obj is ArrayBufferLike | Buffer {
|
||||
// Check for ArrayBufferLike objects in any environment
|
||||
if (obj && typeof obj.byteLength === 'number') {
|
||||
if (obj && typeof (obj as { byteLength?: unknown }).byteLength === 'number') {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -26,4 +26,13 @@ export function isBufferLike(obj: any): obj is ArrayBufferLike | Buffer {
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
export function ensurePureUint8Array(bufferArg: Uint8Array | Buffer): Uint8Array {
|
||||
// Create a new Uint8Array with the same length as the buffer
|
||||
const uint8Array: Uint8Array = new Uint8Array(bufferArg.length);
|
||||
|
||||
// Copy the contents of the Buffer to the new Uint8Array
|
||||
uint8Array.set(bufferArg);
|
||||
return uint8Array;
|
||||
}
|
||||
|
||||
@@ -2,4 +2,4 @@ import * as uInt8ArrayExtras from 'uint8array-extras';
|
||||
|
||||
export {
|
||||
uInt8ArrayExtras,
|
||||
}
|
||||
};
|
||||
|
||||
+4
-4
@@ -5,10 +5,10 @@
|
||||
"target": "ES2022",
|
||||
"module": "NodeNext",
|
||||
"moduleResolution": "NodeNext",
|
||||
"noImplicitAny": true,
|
||||
"esModuleInterop": true,
|
||||
"verbatimModuleSyntax": true
|
||||
"verbatimModuleSyntax": true,
|
||||
"types": ["node"]
|
||||
},
|
||||
"exclude": [
|
||||
"dist_*/**/*.d.ts"
|
||||
]
|
||||
"exclude": ["dist_*/**/*.d.ts"]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user