rdfa-streaming-parser
Advanced tools
Comparing version 1.5.0 to 2.0.0
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
@@ -6,0 +10,0 @@ if (k2 === undefined) k2 = k; |
@@ -5,3 +5,3 @@ /// <reference types="node" /> | ||
import * as RDF from "@rdfjs/types"; | ||
import { Transform, TransformCallback } from "stream"; | ||
import { Transform } from "readable-stream"; | ||
import { IActiveTag } from "./IActiveTag"; | ||
@@ -31,4 +31,4 @@ import { IHtmlParseListener } from "./IHtmlParseListener"; | ||
import(stream: EventEmitter): RDF.Stream; | ||
_transform(chunk: any, encoding: string, callback: TransformCallback): void; | ||
_flush(callback: TransformCallback): void; | ||
_transform(chunk: any, encoding: string, callback: (error?: Error | null, data?: any) => void): void; | ||
_flush(callback: (error?: Error | null, data?: any) => void): void; | ||
onTagOpen(name: string, attributes: { | ||
@@ -35,0 +35,0 @@ [s: string]: string; |
@@ -5,3 +5,3 @@ "use strict"; | ||
const htmlparser2_1 = require("htmlparser2"); | ||
const stream_1 = require("stream"); | ||
const readable_stream_1 = require("readable-stream"); | ||
const INITIAL_CONTEXT_XHTML = require("./initial-context-xhtml.json"); | ||
@@ -14,3 +14,3 @@ const INITIAL_CONTEXT = require("./initial-context.json"); | ||
*/ | ||
class RdfaParser extends stream_1.Transform { | ||
class RdfaParser extends readable_stream_1.Transform { | ||
constructor(options) { | ||
@@ -48,3 +48,3 @@ super({ readableObjectMode: true }); | ||
import(stream) { | ||
const output = new stream_1.PassThrough({ readableObjectMode: true }); | ||
const output = new readable_stream_1.PassThrough({ readableObjectMode: true }); | ||
stream.on('error', (error) => parsed.emit('error', error)); | ||
@@ -57,3 +57,3 @@ stream.on('data', (data) => output.push(data)); | ||
_transform(chunk, encoding, callback) { | ||
this.parser.write(chunk); | ||
this.parser.write(chunk.toString()); | ||
callback(); | ||
@@ -60,0 +60,0 @@ } |
@@ -110,3 +110,3 @@ "use strict"; | ||
} | ||
return this.dataFactory.namedNode(relative_to_absolute_iri_1.resolve(href, this.baseIRI.value)); | ||
return this.dataFactory.namedNode((0, relative_to_absolute_iri_1.resolve)(href, this.baseIRI.value)); | ||
} | ||
@@ -167,3 +167,3 @@ /** | ||
if (!vocab) { | ||
term = relative_to_absolute_iri_1.resolve(term, this.getBaseIriTerm(activeTag).value); | ||
term = (0, relative_to_absolute_iri_1.resolve)(term, this.getBaseIriTerm(activeTag).value); | ||
} | ||
@@ -197,6 +197,6 @@ if (!Util.isValidIri(term)) { | ||
if (!vocab) { | ||
iri = relative_to_absolute_iri_1.resolve(iri, this.getBaseIriTerm(activeTag).value); | ||
iri = (0, relative_to_absolute_iri_1.resolve)(iri, this.getBaseIriTerm(activeTag).value); | ||
} | ||
else if (term !== iri) { | ||
iri = relative_to_absolute_iri_1.resolve(iri, this.baseIRIDocument.value); | ||
iri = (0, relative_to_absolute_iri_1.resolve)(iri, this.baseIRIDocument.value); | ||
} | ||
@@ -203,0 +203,0 @@ if (!Util.isValidIri(iri)) { |
{ | ||
"name": "rdfa-streaming-parser", | ||
"version": "1.5.0", | ||
"version": "2.0.0", | ||
"description": "A fast and lightweight streaming RDFa parser", | ||
@@ -32,5 +32,6 @@ "keywords": [ | ||
"@rdfjs/types": "*", | ||
"htmlparser2": "^6.0.0", | ||
"htmlparser2": "^8.0.0", | ||
"rdf-data-factory": "^1.1.0", | ||
"relative-to-absolute-iri": "^1.0.2" | ||
"relative-to-absolute-iri": "^1.0.2", | ||
"readable-stream": "^4.0.0" | ||
}, | ||
@@ -43,9 +44,9 @@ "pre-commit": [ | ||
"devDependencies": { | ||
"@types/jest": "^26.0.0", | ||
"@types/jest": "^28.0.0", | ||
"@types/jest-each": "^24.3.0", | ||
"@types/node": "^13.1.0", | ||
"arrayify-stream": "^1.0.0", | ||
"@types/readable-stream": "^2.3.14", | ||
"arrayify-stream": "^2.0.0", | ||
"coveralls": "^3.0.0", | ||
"jest": "^26.0.0", | ||
"jest-each": "^26.0.0", | ||
"jest": "^28.0.0", | ||
"jest-each": "^28.0.0", | ||
"jest-rdf": "^1.7.0", | ||
@@ -57,6 +58,9 @@ "manual-git-changelog": "^1.0.1", | ||
"streamify-string": "^1.0.1", | ||
"ts-jest": "^26.0.0", | ||
"ts-jest": "^28.0.0", | ||
"ts-loader": "^9.3.1", | ||
"tslint": "^6.0.0", | ||
"tslint-eslint-rules": "^5.3.1", | ||
"typescript": "^4.0.0" | ||
"typescript": "^4.0.0", | ||
"webpack": "^5.73.0", | ||
"webpack-cli": "^4.10.0" | ||
}, | ||
@@ -66,3 +70,3 @@ "jest": { | ||
"ts-jest": { | ||
"tsConfig": "test/tsconfig.json" | ||
"tsconfig": "test/tsconfig.json" | ||
} | ||
@@ -130,5 +134,3 @@ }, | ||
}, | ||
"resolutions": { | ||
"@types/rdf-js": "^4.0.0" | ||
} | ||
"sideEffects": false | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
90657
1617
5
20
+ Addedreadable-stream@^4.0.0
+ Addedabort-controller@3.0.0(transitive)
+ Addedbase64-js@1.5.1(transitive)
+ Addedbuffer@6.0.3(transitive)
+ Addeddom-serializer@2.0.0(transitive)
+ Addeddomhandler@5.0.3(transitive)
+ Addeddomutils@3.1.0(transitive)
+ Addedentities@4.5.0(transitive)
+ Addedevent-target-shim@5.0.1(transitive)
+ Addedevents@3.3.0(transitive)
+ Addedhtmlparser2@8.0.2(transitive)
+ Addedieee754@1.2.1(transitive)
+ Addedprocess@0.11.10(transitive)
+ Addedreadable-stream@4.5.2(transitive)
+ Addedsafe-buffer@5.2.1(transitive)
+ Addedstring_decoder@1.3.0(transitive)
- Removeddom-serializer@1.4.1(transitive)
- Removeddomhandler@4.3.1(transitive)
- Removeddomutils@2.8.0(transitive)
- Removedentities@2.2.0(transitive)
- Removedhtmlparser2@6.1.0(transitive)
Updatedhtmlparser2@^8.0.0