Skip to content

Commit

Permalink
馃 Merge PR #69595 new: @rdfjs/sink-to-duplex by @tpluscode
Browse files Browse the repository at this point in the history
  • Loading branch information
tpluscode committed May 16, 2024
1 parent 1bba575 commit 0163404
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 0 deletions.
5 changes: 5 additions & 0 deletions types/rdfjs__sink-to-duplex/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*
!**/*.d.ts
!**/*.d.cts
!**/*.d.mts
!**/*.d.*.ts
7 changes: 7 additions & 0 deletions types/rdfjs__sink-to-duplex/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { Sink } from "@rdfjs/types";
import { Duplexify } from "duplexify";
import { DuplexOptions } from "stream";

declare function sinkToDuplex(sink: Sink<any, any>, options?: DuplexOptions): Duplexify;

export = sinkToDuplex;
21 changes: 21 additions & 0 deletions types/rdfjs__sink-to-duplex/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"private": true,
"name": "@types/rdfjs__sink-to-duplex",
"version": "1.0.9999",
"projects": [
"https://github.com/rdfjs-base/sink-to-duplex"
],
"dependencies": {
"@rdfjs/types": "*",
"@types/duplexify": "^3.6.4"
},
"devDependencies": {
"@types/rdfjs__sink-to-duplex": "workspace:."
},
"owners": [
{
"name": "Tomasz Pluskiewicz",
"githubUsername": "tpluscode"
}
]
}
14 changes: 14 additions & 0 deletions types/rdfjs__sink-to-duplex/rdfjs__sink-to-duplex-tests.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { Sink } from "@rdfjs/types";
import { Duplexify } from "duplexify";
import fs from "fs";
import sinkToDuplex = require("@rdfjs/sink-to-duplex");

const sink: Sink<any, any> = <any> {};

const input = fs.createReadStream("test.ttl");
const parser = sinkToDuplex(sink, { readableObjectMode: true });
const serializer = sinkToDuplex(sink, { writableObjectMode: true });

input.pipe(parser).pipe(serializer).pipe(process.stdout);

const noOptions: Duplexify = sinkToDuplex(sink);
19 changes: 19 additions & 0 deletions types/rdfjs__sink-to-duplex/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"compilerOptions": {
"module": "node16",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictFunctionTypes": true,
"strictNullChecks": true,
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"rdfjs__sink-to-duplex-tests.ts"
]
}

0 comments on commit 0163404

Please sign in to comment.