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
14 changes: 0 additions & 14 deletions .eslintrc.cjs

This file was deleted.

41 changes: 24 additions & 17 deletions .github/workflows/main.yml → .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,72 +2,79 @@ name: Node.js CI

on: [push]

permissions: {}

jobs:
lint:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]
node-version: [24.x]
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
persist-credentials: false
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- name: Run eslint
run: npm run lint
test-node:
needs: [lint]
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
matrix:
node-version: [18.x, 20.x]
node-version: [20.x, 22.x, 24.x]
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
persist-credentials: false
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- name: Run test with Node.js ${{ matrix.node-version }}
run: npm run test-node
test-karma:
needs: [lint]
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
matrix:
node-version: [20.x]
node-version: [24.x]
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
persist-credentials: false
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- name: Run karma tests
run: npm run test-karma
coverage:
needs: [test-node, test-karma]
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
matrix:
node-version: [20.x]
node-version: [24.x]
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
persist-credentials: false
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- name: Generate coverage report
run: npm run coverage-ci
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5
with:
file: ./coverage/lcov.info
files: ./coverage/lcov.info
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# @digitalbazaar/cborld ChangeLog

## 8.1.0 - 2026-xx-xx

### Changed
- Update dependencies. Notable:
- `cborg@5`.
- `uuid@14`.
- Update dev dependencies.
- **NOTE**: Update supported platforms.
- Test on Node.js >=20.
- Update `engines.node` to `>=20`.
- Update README requirements section.

## 8.0.2 - 2025-09-05

### Fixed
Expand Down
3 changes: 1 addition & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
Copyright (c) 2020, Digital Bazaar, Inc.
All rights reserved.
Copyright (c) 2020-2026, Digital Bazaar, Inc.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# JavaScript CBOR-LD Processor

[![Build Status](https://img.shields.io/github/actions/workflow/status/digitalbazaar/cborld/main.yml)](https://github.com/digitalbazaar/cborld/actions/workflows/main.yml)
[![Build Status](https://img.shields.io/github/actions/workflow/status/digitalbazaar/cborld/main.yaml)](https://github.com/digitalbazaar/cborld/actions/workflows/main.yaml)
[![Coverage Status](https://img.shields.io/codecov/c/github/digitalbazaar/cborld)](https://codecov.io/gh/digitalbazaar/cborld)

> A JavaScript CBOR-LD Process for Web browsers and Node.js apps.
Expand All @@ -22,7 +22,10 @@ applications.

## Install

- Browsers and Node.js 18+ are supported.
This software requires and supports maintained recent versions of Node.js and
browsers. Updates may remove support for older unmaintained platform versions.
Please use dependency version lock files and testing to ensure compatibility
with this software.

### NPM

Expand Down
5 changes: 5 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import config from '@digitalbazaar/eslint-config/universal-recommended';

export default [
...config
];
2 changes: 1 addition & 1 deletion karma.conf.cjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020-2022 Digital Bazaar, Inc. All rights reserved.
* Copyright (c) 2020-2026 Digital Bazaar, Inc.
*/
module.exports = function(config) {

Expand Down
4 changes: 2 additions & 2 deletions lib/ActiveContext.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/*!
* Copyright (c) 2021-2025 Digital Bazaar, Inc. All rights reserved.
* Copyright (c) 2021-2026 Digital Bazaar, Inc.
*/
import {CborldError} from './CborldError.js';

export class ActiveContext {
constructor({
termMap = new Map(),
previous,
contextLoader = previous?.contextLoader,
contextLoader = previous?.contextLoader
} = {}) {
this.termMap = termMap;
this.previous = previous;
Expand Down
2 changes: 1 addition & 1 deletion lib/CborldError.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Copyright (c) 2020-2024 Digital Bazaar, Inc. All rights reserved.
* Copyright (c) 2020-2026 Digital Bazaar, Inc.
*/
export class CborldError extends Error {
constructor(code, message) {
Expand Down
2 changes: 1 addition & 1 deletion lib/Compressor.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Copyright (c) 2021-2024 Digital Bazaar, Inc. All rights reserved.
* Copyright (c) 2021-2026 Digital Bazaar, Inc.
*/
import {ContextEncoder} from './codecs/ContextEncoder.js';
import {KEYWORDS_TABLE} from './tables.js';
Expand Down
2 changes: 1 addition & 1 deletion lib/ContextLoader.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Copyright (c) 2021-2025 Digital Bazaar, Inc. All rights reserved.
* Copyright (c) 2021-2026 Digital Bazaar, Inc.
*/
import {FIRST_CUSTOM_TERM_ID, KEYWORDS_TABLE, reverseMap} from './tables.js';
import {CborldError} from './CborldError.js';
Expand Down
2 changes: 1 addition & 1 deletion lib/Converter.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Copyright (c) 2021-2025 Digital Bazaar, Inc. All rights reserved.
* Copyright (c) 2021-2026 Digital Bazaar, Inc.
*/
import {
LEGACY_TYPE_TABLE_ENCODED_AS_BYTES,
Expand Down
2 changes: 1 addition & 1 deletion lib/Decompressor.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Copyright (c) 2021-2024 Digital Bazaar, Inc. All rights reserved.
* Copyright (c) 2021-2026 Digital Bazaar, Inc.
*/
import {KEYWORDS_TABLE, reverseMap} from './tables.js';
import {CborldError} from './CborldError.js';
Expand Down
2 changes: 1 addition & 1 deletion lib/codecs/Base58DidUrlDecoder.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Copyright (c) 2021-2024 Digital Bazaar, Inc. All rights reserved.
* Copyright (c) 2021-2026 Digital Bazaar, Inc.
*/
import {CborldDecoder} from './CborldDecoder.js';
import {encode as encodeBase58} from 'base58-universal';
Expand Down
2 changes: 1 addition & 1 deletion lib/codecs/Base58DidUrlEncoder.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Copyright (c) 2021-2024 Digital Bazaar, Inc. All rights reserved.
* Copyright (c) 2021-2026 Digital Bazaar, Inc.
*/
import {Token, Type} from 'cborg';
import {CborldEncoder} from './CborldEncoder.js';
Expand Down
2 changes: 1 addition & 1 deletion lib/codecs/CborldDecoder.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Copyright (c) 2021-2024 Digital Bazaar, Inc. All rights reserved.
* Copyright (c) 2021-2026 Digital Bazaar, Inc.
*/
export class CborldDecoder {
decode() {
Expand Down
2 changes: 1 addition & 1 deletion lib/codecs/CborldEncoder.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Copyright (c) 2021-2024 Digital Bazaar, Inc. All rights reserved.
* Copyright (c) 2021-2026 Digital Bazaar, Inc.
*/
export class CborldEncoder {
encode() {
Expand Down
2 changes: 1 addition & 1 deletion lib/codecs/ContextDecoder.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Copyright (c) 2021-2024 Digital Bazaar, Inc. All rights reserved.
* Copyright (c) 2021-2026 Digital Bazaar, Inc.
*/
import {CborldDecoder} from './CborldDecoder.js';
import {CborldError} from '../CborldError.js';
Expand Down
2 changes: 1 addition & 1 deletion lib/codecs/ContextEncoder.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Copyright (c) 2021-2024 Digital Bazaar, Inc. All rights reserved.
* Copyright (c) 2021-2026 Digital Bazaar, Inc.
*/
import {Token, Type} from 'cborg';
import {CborldEncoder} from './CborldEncoder.js';
Expand Down
2 changes: 1 addition & 1 deletion lib/codecs/DataUrlDecoder.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Copyright (c) 2024 Digital Bazaar, Inc. All rights reserved.
* Copyright (c) 2024-2026 Digital Bazaar, Inc.
*/
import {Base64} from 'js-base64';
import {CborldDecoder} from './CborldDecoder.js';
Expand Down
2 changes: 1 addition & 1 deletion lib/codecs/DataUrlEncoder.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Copyright (c) 2024 Digital Bazaar, Inc. All rights reserved.
* Copyright (c) 2024-2026 Digital Bazaar, Inc.
*/
import {Token, Type} from 'cborg';
import {Base64} from 'js-base64';
Expand Down
2 changes: 1 addition & 1 deletion lib/codecs/HttpUrlDecoder.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Copyright (c) 2021-2024 Digital Bazaar, Inc. All rights reserved.
* Copyright (c) 2021-2026 Digital Bazaar, Inc.
*/
import {CborldDecoder} from './CborldDecoder.js';
import {REVERSE_URL_SCHEME_TABLE} from '../tables.js';
Expand Down
2 changes: 1 addition & 1 deletion lib/codecs/HttpUrlEncoder.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Copyright (c) 2021-2024 Digital Bazaar, Inc. All rights reserved.
* Copyright (c) 2021-2026 Digital Bazaar, Inc.
*/
import {Token, Type} from 'cborg';
import {CborldEncoder} from './CborldEncoder.js';
Expand Down
2 changes: 1 addition & 1 deletion lib/codecs/MultibaseDecoder.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Copyright (c) 2021-2024 Digital Bazaar, Inc. All rights reserved.
* Copyright (c) 2021-2026 Digital Bazaar, Inc.
*/
import * as base64url from 'base64url-universal';
import {Base64} from 'js-base64';
Expand Down
2 changes: 1 addition & 1 deletion lib/codecs/MultibaseEncoder.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Copyright (c) 2021-2024 Digital Bazaar, Inc. All rights reserved.
* Copyright (c) 2021-2026 Digital Bazaar, Inc.
*/
import * as base64url from 'base64url-universal';
import {Token, Type} from 'cborg';
Expand Down
2 changes: 1 addition & 1 deletion lib/codecs/UrlDecoder.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Copyright (c) 2021-2024 Digital Bazaar, Inc. All rights reserved.
* Copyright (c) 2021-2026 Digital Bazaar, Inc.
*/
import {Base58DidUrlDecoder} from './Base58DidUrlDecoder.js';
import {CborldDecoder} from './CborldDecoder.js';
Expand Down
4 changes: 2 additions & 2 deletions lib/codecs/UrlEncoder.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Copyright (c) 2021-2024 Digital Bazaar, Inc. All rights reserved.
* Copyright (c) 2021-2026 Digital Bazaar, Inc.
*/
import {Token, Type} from 'cborg';
import {Base58DidUrlEncoder} from './Base58DidUrlEncoder.js';
Expand Down Expand Up @@ -56,7 +56,7 @@ export class UrlEncoder extends CborldEncoder {
const split = value.split(':');
split.pop();
scheme = split.join(':');
} catch(e) {
} catch {
return;
}

Expand Down
2 changes: 1 addition & 1 deletion lib/codecs/UuidUrnDecoder.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Copyright (c) 2021-2024 Digital Bazaar, Inc. All rights reserved.
* Copyright (c) 2021-2026 Digital Bazaar, Inc.
*/
import {CborldDecoder} from './CborldDecoder.js';
import {stringify} from 'uuid';
Expand Down
2 changes: 1 addition & 1 deletion lib/codecs/UuidUrnEncoder.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Copyright (c) 2021-2024 Digital Bazaar, Inc. All rights reserved.
* Copyright (c) 2021-2026 Digital Bazaar, Inc.
*/
import {Token, Type} from 'cborg';
import {CborldEncoder} from './CborldEncoder.js';
Expand Down
2 changes: 1 addition & 1 deletion lib/codecs/ValueDecoder.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Copyright (c) 2024 Digital Bazaar, Inc. All rights reserved.
* Copyright (c) 2024-2026 Digital Bazaar, Inc.
*/
import {
getTableType,
Expand Down
2 changes: 1 addition & 1 deletion lib/codecs/ValueEncoder.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Copyright (c) 2024-2025 Digital Bazaar, Inc. All rights reserved.
* Copyright (c) 2024-2026 Digital Bazaar, Inc.
*/
import {
bytesFromInt,
Expand Down
2 changes: 1 addition & 1 deletion lib/codecs/XsdDateDecoder.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Copyright (c) 2021-2024 Digital Bazaar, Inc. All rights reserved.
* Copyright (c) 2021-2026 Digital Bazaar, Inc.
*/
import {CborldDecoder} from './CborldDecoder.js';

Expand Down
2 changes: 1 addition & 1 deletion lib/codecs/XsdDateEncoder.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Copyright (c) 2021-2025 Digital Bazaar, Inc. All rights reserved.
* Copyright (c) 2021-2026 Digital Bazaar, Inc.
*/
import {Token, Type} from 'cborg';
import {CborldEncoder} from './CborldEncoder.js';
Expand Down
2 changes: 1 addition & 1 deletion lib/codecs/XsdDateTimeDecoder.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Copyright (c) 2021-2024 Digital Bazaar, Inc. All rights reserved.
* Copyright (c) 2021-2026 Digital Bazaar, Inc.
*/
import {CborldDecoder} from './CborldDecoder.js';

Expand Down
2 changes: 1 addition & 1 deletion lib/codecs/XsdDateTimeEncoder.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Copyright (c) 2021-2025 Digital Bazaar, Inc. All rights reserved.
* Copyright (c) 2021-2026 Digital Bazaar, Inc.
*/
import {Token, Type} from 'cborg';
import {CborldEncoder} from './CborldEncoder.js';
Expand Down
2 changes: 1 addition & 1 deletion lib/decode.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Copyright (c) 2020-2025 Digital Bazaar, Inc. All rights reserved.
* Copyright (c) 2020-2026 Digital Bazaar, Inc.
*/
import {createLegacyTypeTable, createTypeTable} from './tables.js';
import {CborldError} from './CborldError.js';
Expand Down
2 changes: 1 addition & 1 deletion lib/encode.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Copyright (c) 2020-2025 Digital Bazaar, Inc. All rights reserved.
* Copyright (c) 2020-2026 Digital Bazaar, Inc.
*/
import * as cborg from 'cborg';
import * as varint from 'varint';
Expand Down
Loading
Loading