Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@atproto/common

Package Overview
Dependencies
Maintainers
4
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@atproto/common - npm Package Compare versions

Comparing version 0.3.0 to 0.3.1

CHANGELOG.md

8

build.js

@@ -1,2 +0,1 @@

const pkgJson = require('@npmcli/package-json')
const { nodeExternalsPlugin } = require('esbuild-node-externals')

@@ -7,9 +6,2 @@

if (process.argv.includes('--update-main-to-dist')) {
return pkgJson
.load(__dirname)
.then((pkg) => pkg.update({ main: 'dist/index.js' }))
.then((pkg) => pkg.save())
}
require('esbuild').build({

@@ -16,0 +8,0 @@ logLevel: 'info',

2

dist/index.d.ts
export * from '@atproto/common-web';
export * from './dates';
export * from './fs';

@@ -7,1 +8,2 @@ export * from './ipld';

export * from './streams';
export * from './buffers';

@@ -13,2 +13,3 @@ /// <reference types="node" />

export declare const cidForCbor: (data: unknown) => Promise<CID>;
export declare const isValidCid: (cidStr: string) => Promise<boolean>;
export declare const cborBytesToRecord: (bytes: Uint8Array) => Record<string, unknown>;

@@ -15,0 +16,0 @@ export declare const verifyCidForBytes: (cid: CID, bytes: Uint8Array) => Promise<void>;

{
"name": "@atproto/common",
"version": "0.3.0",
"main": "dist/index.js",
"version": "0.3.1",
"license": "MIT",
"description": "Shared web-platform-friendly code for atproto libraries",
"keywords": [
"atproto"
],
"homepage": "https://atproto.com",
"repository": {
"type": "git",
"url": "https://github.com/bluesky-social/atproto.git",
"url": "https://github.com/bluesky-social/atproto",
"directory": "packages/common"
},
"main": "dist/index.js",
"dependencies": {
"@ipld/dag-cbor": "^7.0.3",
"cbor-x": "^1.5.1",
"iso-datestring-validator": "^2.2.2",
"multiformats": "^9.9.0",
"pino": "^8.15.0",
"zod": "3.21.4",
"@atproto/common-web": "^0.2.1"
},
"scripts": {
"test": "jest",
"prettier": "prettier --check src/ tests/",
"prettier:fix": "prettier --write src/ tests/",
"lint": "eslint . --ext .ts,.tsx",
"lint:fix": "yarn lint --fix",
"verify": "run-p prettier lint",
"verify:fix": "yarn prettier:fix && yarn lint:fix",
"build": "node ./build.js",
"postbuild": "tsc --build tsconfig.build.json",
"update-main-to-dist": "node ./update-pkg.js --update-main-to-dist",
"update-main-to-src": "node ./update-pkg.js --update-main-to-src",
"prepublish": "npm run update-main-to-dist",
"postpublish": "npm run update-main-to-src"
"update-main-to-dist": "node ../../update-main-to-dist.js packages/common"
},
"dependencies": {
"@atproto/common-web": "*",
"@ipld/dag-cbor": "^7.0.3",
"cbor-x": "^1.5.1",
"multiformats": "^9.6.4",
"pino": "^8.6.1"
}
}
"types": "dist/index.d.ts"
}

@@ -1,3 +0,10 @@

# ATP Common Library
# @atproto/common
A library containing code which is shared between ATP packages.
Shared TypeScript code for other `@atproto/*` packages. This package is oriented towards writing servers, and is not designed to be browser-compatible.
[![NPM](https://img.shields.io/npm/v/@atproto/common)](https://www.npmjs.com/package/@atproto/common)
[![Github CI Status](https://github.com/bluesky-social/atproto/actions/workflows/repo.yaml/badge.svg)](https://github.com/bluesky-social/atproto/actions/workflows/repo.yaml)
## License
MIT License
import { isErrnoException } from '@atproto/common-web'
import { constants } from 'fs'
import fs from 'fs/promises'

@@ -6,3 +7,3 @@

try {
await fs.access(location, fs.constants.F_OK)
await fs.access(location, constants.F_OK)
return true

@@ -9,0 +10,0 @@ } catch (err) {

export * from '@atproto/common-web'
export * from './dates'
export * from './fs'

@@ -7,1 +8,2 @@ export * from './ipld'

export * from './streams'
export * from './buffers'

@@ -27,2 +27,11 @@ import crypto from 'crypto'

export const isValidCid = async (cidStr: string): Promise<boolean> => {
try {
const parsed = CID.parse(cidStr)
return parsed.toString() === cidStr
} catch (err) {
return false
}
}
export const cborBytesToRecord = (

@@ -29,0 +38,0 @@ bytes: Uint8Array,

import * as streams from '../src/streams'
import { PassThrough, Readable, pipeline } from 'node:stream'
import { PassThrough, Readable } from 'node:stream'

@@ -4,0 +4,0 @@ describe('streams', () => {

{
"extends": "./tsconfig.json",
"exclude": ["**/*.spec.ts", "**/*.test.ts"]
}
}

@@ -8,6 +8,4 @@ {

},
"include": ["./src","__tests__/**/**.ts"],
"references": [
{ "path": "../common-web/tsconfig.build.json" }
]
}
"include": ["./src", "__tests__/**/**.ts"],
"references": [{ "path": "../common-web/tsconfig.build.json" }]
}

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc