Socket
Socket
Sign inDemoInstall

@sajari/sdk-node

Package Overview
Dependencies
139
Maintainers
4
Versions
49
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.0-alpha.8 to 1.0.0-alpha.9

6

dist/utils.d.ts
import { sajari } from "../generated/proto";
export declare type Value = string | string[] | null;
export declare namespace Value {
/**
* @hidden
*/
function toProto(v: Value): sajari.engine.Value;
/**
* @hidden
*/
function fromProto(v: sajari.engine.IValue): Value;

@@ -6,0 +12,0 @@ }

37

dist/utils.js

@@ -20,18 +20,21 @@ "use strict";

(function (Value) {
/**
* @hidden
*/
function toProto(v) {
if (Array.isArray(v)) {
return new proto_1.sajari.engine.Value({ repeated: { values: v } });
var value = convertTypes(v);
if (Array.isArray(value)) {
return new proto_1.sajari.engine.Value({ repeated: { values: value } });
}
else if (typeof v === "string") {
return new proto_1.sajari.engine.Value({ single: v });
else if (typeof value === "string") {
return new proto_1.sajari.engine.Value({ single: value });
}
else if (v === null) {
else {
return proto_1.sajari.engine.Value.create({ null: true });
}
else {
// XXX: LOOK AT ME
return new proto_1.sajari.engine.Value({ single: v });
}
}
Value.toProto = toProto;
/**
* @hidden
*/
function fromProto(v) {

@@ -52,2 +55,18 @@ var value = v;

Value.fromProto = fromProto;
/**
* convertTypes takes in a value and converts the underlaying value
* into its string representation
* @hidden
*/
function convertTypes(v) {
if (Array.isArray(v)) {
return v.map(function (x) { return String(x); });
}
else if (v === null) {
return null;
}
else {
return String(v);
}
}
})(Value = exports.Value || (exports.Value = {}));

@@ -54,0 +73,0 @@ /**

{
"name": "@sajari/sdk-node",
"version": "1.0.0-alpha.8",
"version": "1.0.0-alpha.9",
"main": "dist/index.js",

@@ -5,0 +5,0 @@ "types": "dist/index.d.ts",

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc