Socket
Socket
Sign inDemoInstall

@microsoft/kiota-serialization-text

Package Overview
Dependencies
Maintainers
2
Versions
60
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@microsoft/kiota-serialization-text - npm Package Compare versions

Comparing version 1.0.0-preview.2 to 1.0.0-preview.3

dist/cjs/test/common/textParseNodeFactory.d.ts

1

dist/cjs/src/textParseNodeFactory.d.ts

@@ -5,3 +5,4 @@ import { ParseNode, ParseNodeFactory } from "@microsoft/kiota-abstractions";

getRootParseNode(contentType: string, content: ArrayBuffer): ParseNode;
private convertArrayBufferToText;
}
//# sourceMappingURL=textParseNodeFactory.d.ts.map

9

dist/cjs/src/textParseNodeFactory.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.TextParseNodeFactory = void 0;
const util_1 = require("util");
const textParseNode_1 = require("./textParseNode");

@@ -20,7 +19,9 @@ class TextParseNodeFactory {

}
const decoder = new util_1.TextDecoder();
const contentAsStr = decoder.decode(content);
return new textParseNode_1.TextParseNode(contentAsStr);
return new textParseNode_1.TextParseNode(this.convertArrayBufferToText(content));
}
convertArrayBufferToText(arrayBuffer) {
const uint8Array = new Uint8Array(arrayBuffer);
return String.fromCharCode.apply(null, [...uint8Array]);
}
}
exports.TextParseNodeFactory = TextParseNodeFactory;

@@ -5,7 +5,7 @@ "use strict";

const textParseNode_1 = require("../../src/textParseNode");
describe("jsonParseNodeFactory", () => {
it("jsonParseNodeFactory", async () => {
const jsonParseNodeFactory = new textParseNode_1.TextParseNode("Test");
chai_1.assert.isDefined(jsonParseNodeFactory);
describe("textParseNode", () => {
it("textParseNode", async () => {
const textParseNode = new textParseNode_1.TextParseNode("Test");
chai_1.assert.isDefined(textParseNode);
});
});

@@ -5,3 +5,4 @@ import { ParseNode, ParseNodeFactory } from "@microsoft/kiota-abstractions";

getRootParseNode(contentType: string, content: ArrayBuffer): ParseNode;
private convertArrayBufferToText;
}
//# sourceMappingURL=textParseNodeFactory.d.ts.map

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

import { TextDecoder } from "util";
import { TextParseNode } from "./textParseNode";

@@ -17,6 +16,8 @@ export class TextParseNodeFactory {

}
const decoder = new TextDecoder();
const contentAsStr = decoder.decode(content);
return new TextParseNode(contentAsStr);
return new TextParseNode(this.convertArrayBufferToText(content));
}
convertArrayBufferToText(arrayBuffer) {
const uint8Array = new Uint8Array(arrayBuffer);
return String.fromCharCode.apply(null, [...uint8Array]);
}
}
import { assert } from "chai";
import { TextParseNode } from "../../src/textParseNode";
describe("jsonParseNodeFactory", () => {
it("jsonParseNodeFactory", async () => {
const jsonParseNodeFactory = new TextParseNode("Test");
assert.isDefined(jsonParseNodeFactory);
describe("textParseNode", () => {
it("textParseNode", async () => {
const textParseNode = new TextParseNode("Test");
assert.isDefined(textParseNode);
});
});
{
"name": "@microsoft/kiota-serialization-text",
"version": "1.0.0-preview.2",
"version": "1.0.0-preview.3",
"description": "Implementation of Kiota Serialization interfaces for text",

@@ -46,3 +46,3 @@ "files": [

},
"gitHead": "1d8fc8531793c508c897700572ceaa6e0561cf25"
"gitHead": "79aeb602a3976ec2cba47de7d9df970410a19b4c"
}
import { ParseNode, ParseNodeFactory } from "@microsoft/kiota-abstractions";
import { TextDecoder } from "util";

@@ -22,6 +21,9 @@ import { TextParseNode } from "./textParseNode";

}
const decoder = new TextDecoder();
const contentAsStr = decoder.decode(content);
return new TextParseNode(contentAsStr);
return new TextParseNode(this.convertArrayBufferToText(content));
}
private convertArrayBufferToText(arrayBuffer: ArrayBuffer) {
const uint8Array = new Uint8Array(arrayBuffer);
return String.fromCharCode.apply(null, [...uint8Array]);
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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