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

ldap-async

Package Overview
Dependencies
Maintainers
3
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ldap-async - npm Package Compare versions

Comparing version 2.0.0 to 2.0.1

5

dist/index.d.ts

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

}
type ValidAttributeInput = boolean | number | string | Buffer;
export default class Ldap {

@@ -86,3 +87,3 @@ protected connectpromise?: Promise<void>;

*/
setAttribute(dn: string, attribute: string, val: any): Promise<boolean>;
setAttribute(dn: string, attribute: string, val: ValidAttributeInput | ValidAttributeInput[] | undefined): Promise<boolean>;
/**

@@ -95,3 +96,3 @@ * Use this method to completely replace multiple attributes. If any of the given attributes

*/
setAttributes(dn: string, modification: Record<string, any>): Promise<boolean>;
setAttributes(dn: string, modification: Record<string, ValidAttributeInput | ValidAttributeInput[] | undefined>): Promise<boolean>;
/**

@@ -98,0 +99,0 @@ * Use this method to add more values to an array attribute without removing any existing values. Any

12

dist/index.js

@@ -27,2 +27,9 @@ "use strict";

const utfDecoder = new node_util_1.TextDecoder('utf8', { fatal: true });
function valToString(val) {
if (typeof val === 'boolean')
return val ? 'TRUE' : 'FALSE';
if (typeof val === 'number')
return String(val);
return val;
}
class Ldap {

@@ -322,3 +329,4 @@ constructor(config = {}) {

async setAttribute(dn, attribute, val) {
return await this.modify(dn, 'replace', { type: attribute, values: Array.isArray(val) ? val : (val == null ? [] : [val]) });
const values = (Array.isArray(val) ? val : (val == null ? [] : [val])).map(valToString);
return await this.modify(dn, 'replace', { type: attribute, values });
}

@@ -333,3 +341,3 @@ /**

async setAttributes(dn, modification) {
const changes = Object.entries(modification).map(([attr, val]) => ({ operation: 'replace', modification: { type: attr, values: Array.isArray(val) ? val : (val == null ? [] : [val]) } }));
const changes = Object.entries(modification).map(([attr, val]) => ({ operation: 'replace', modification: { type: attr, values: (Array.isArray(val) ? val : (val == null ? [] : [val])).map(valToString) } }));
return await this.modify(dn, changes);

@@ -336,0 +344,0 @@ }

{
"name": "ldap-async",
"version": "2.0.0",
"version": "2.0.1",
"description": "A wrapper around ldapjs to provide promises, pooling, config by environment, and other conveniences.",

@@ -5,0 +5,0 @@ "exports": {

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