.
This commit is contained in:
		
							
								
								
									
										102
									
								
								qwen/nodejs/node_modules/@hapi/hoek/lib/applyToDefaults.js
									
									
									
										generated
									
									
										vendored
									
									
										Executable file
									
								
							
							
						
						
									
										102
									
								
								qwen/nodejs/node_modules/@hapi/hoek/lib/applyToDefaults.js
									
									
									
										generated
									
									
										vendored
									
									
										Executable file
									
								
							@@ -0,0 +1,102 @@
 | 
			
		||||
'use strict';
 | 
			
		||||
 | 
			
		||||
const Assert = require('./assert');
 | 
			
		||||
const Clone = require('./clone');
 | 
			
		||||
const Merge = require('./merge');
 | 
			
		||||
const Reach = require('./reach');
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
const internals = {};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
module.exports = function (defaults, source, options = {}) {
 | 
			
		||||
 | 
			
		||||
    Assert(defaults && typeof defaults === 'object', 'Invalid defaults value: must be an object');
 | 
			
		||||
    Assert(!source || source === true || typeof source === 'object', 'Invalid source value: must be true, falsy or an object');
 | 
			
		||||
    Assert(typeof options === 'object', 'Invalid options: must be an object');
 | 
			
		||||
 | 
			
		||||
    if (!source) {                                                  // If no source, return null
 | 
			
		||||
        return null;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (options.shallow) {
 | 
			
		||||
        return internals.applyToDefaultsWithShallow(defaults, source, options);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    const copy = Clone(defaults);
 | 
			
		||||
 | 
			
		||||
    if (source === true) {                                          // If source is set to true, use defaults
 | 
			
		||||
        return copy;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    const nullOverride = options.nullOverride !== undefined ? options.nullOverride : false;
 | 
			
		||||
    return Merge(copy, source, { nullOverride, mergeArrays: false });
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
internals.applyToDefaultsWithShallow = function (defaults, source, options) {
 | 
			
		||||
 | 
			
		||||
    const keys = options.shallow;
 | 
			
		||||
    Assert(Array.isArray(keys), 'Invalid keys');
 | 
			
		||||
 | 
			
		||||
    const seen = new Map();
 | 
			
		||||
    const merge = source === true ? null : new Set();
 | 
			
		||||
 | 
			
		||||
    for (let key of keys) {
 | 
			
		||||
        key = Array.isArray(key) ? key : key.split('.');            // Pre-split optimization
 | 
			
		||||
 | 
			
		||||
        const ref = Reach(defaults, key);
 | 
			
		||||
        if (ref &&
 | 
			
		||||
            typeof ref === 'object') {
 | 
			
		||||
 | 
			
		||||
            seen.set(ref, merge && Reach(source, key) || ref);
 | 
			
		||||
        }
 | 
			
		||||
        else if (merge) {
 | 
			
		||||
            merge.add(key);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    const copy = Clone(defaults, {}, seen);
 | 
			
		||||
 | 
			
		||||
    if (!merge) {
 | 
			
		||||
        return copy;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    for (const key of merge) {
 | 
			
		||||
        internals.reachCopy(copy, source, key);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    const nullOverride = options.nullOverride !== undefined ? options.nullOverride : false;
 | 
			
		||||
    return Merge(copy, source, { nullOverride, mergeArrays: false });
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
internals.reachCopy = function (dst, src, path) {
 | 
			
		||||
 | 
			
		||||
    for (const segment of path) {
 | 
			
		||||
        if (!(segment in src)) {
 | 
			
		||||
            return;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        const val = src[segment];
 | 
			
		||||
 | 
			
		||||
        if (typeof val !== 'object' || val === null) {
 | 
			
		||||
            return;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        src = val;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    const value = src;
 | 
			
		||||
    let ref = dst;
 | 
			
		||||
    for (let i = 0; i < path.length - 1; ++i) {
 | 
			
		||||
        const segment = path[i];
 | 
			
		||||
        if (typeof ref[segment] !== 'object') {
 | 
			
		||||
            ref[segment] = {};
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        ref = ref[segment];
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    ref[path[path.length - 1]] = value;
 | 
			
		||||
};
 | 
			
		||||
							
								
								
									
										22
									
								
								qwen/nodejs/node_modules/@hapi/hoek/lib/assert.js
									
									
									
										generated
									
									
										vendored
									
									
										Executable file
									
								
							
							
						
						
									
										22
									
								
								qwen/nodejs/node_modules/@hapi/hoek/lib/assert.js
									
									
									
										generated
									
									
										vendored
									
									
										Executable file
									
								
							@@ -0,0 +1,22 @@
 | 
			
		||||
'use strict';
 | 
			
		||||
 | 
			
		||||
const AssertError = require('./error');
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
const internals = {};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
module.exports = function (condition, ...args) {
 | 
			
		||||
 | 
			
		||||
    if (condition) {
 | 
			
		||||
        return;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (args.length === 1 &&
 | 
			
		||||
        args[0] instanceof Error) {
 | 
			
		||||
 | 
			
		||||
        throw args[0];
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    throw new AssertError(args);
 | 
			
		||||
};
 | 
			
		||||
							
								
								
									
										29
									
								
								qwen/nodejs/node_modules/@hapi/hoek/lib/bench.js
									
									
									
										generated
									
									
										vendored
									
									
										Executable file
									
								
							
							
						
						
									
										29
									
								
								qwen/nodejs/node_modules/@hapi/hoek/lib/bench.js
									
									
									
										generated
									
									
										vendored
									
									
										Executable file
									
								
							@@ -0,0 +1,29 @@
 | 
			
		||||
'use strict';
 | 
			
		||||
 | 
			
		||||
const internals = {};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
module.exports = internals.Bench = class {
 | 
			
		||||
 | 
			
		||||
    constructor() {
 | 
			
		||||
 | 
			
		||||
        this.ts = 0;
 | 
			
		||||
        this.reset();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    reset() {
 | 
			
		||||
 | 
			
		||||
        this.ts = internals.Bench.now();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    elapsed() {
 | 
			
		||||
 | 
			
		||||
        return internals.Bench.now() - this.ts;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    static now() {
 | 
			
		||||
 | 
			
		||||
        const ts = process.hrtime();
 | 
			
		||||
        return (ts[0] * 1e3) + (ts[1] / 1e6);
 | 
			
		||||
    }
 | 
			
		||||
};
 | 
			
		||||
							
								
								
									
										12
									
								
								qwen/nodejs/node_modules/@hapi/hoek/lib/block.js
									
									
									
										generated
									
									
										vendored
									
									
										Executable file
									
								
							
							
						
						
									
										12
									
								
								qwen/nodejs/node_modules/@hapi/hoek/lib/block.js
									
									
									
										generated
									
									
										vendored
									
									
										Executable file
									
								
							@@ -0,0 +1,12 @@
 | 
			
		||||
'use strict';
 | 
			
		||||
 | 
			
		||||
const Ignore = require('./ignore');
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
const internals = {};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
module.exports = function () {
 | 
			
		||||
 | 
			
		||||
    return new Promise(Ignore);
 | 
			
		||||
};
 | 
			
		||||
							
								
								
									
										176
									
								
								qwen/nodejs/node_modules/@hapi/hoek/lib/clone.js
									
									
									
										generated
									
									
										vendored
									
									
										Executable file
									
								
							
							
						
						
									
										176
									
								
								qwen/nodejs/node_modules/@hapi/hoek/lib/clone.js
									
									
									
										generated
									
									
										vendored
									
									
										Executable file
									
								
							@@ -0,0 +1,176 @@
 | 
			
		||||
'use strict';
 | 
			
		||||
 | 
			
		||||
const Reach = require('./reach');
 | 
			
		||||
const Types = require('./types');
 | 
			
		||||
const Utils = require('./utils');
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
const internals = {
 | 
			
		||||
    needsProtoHack: new Set([Types.set, Types.map, Types.weakSet, Types.weakMap])
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
module.exports = internals.clone = function (obj, options = {}, _seen = null) {
 | 
			
		||||
 | 
			
		||||
    if (typeof obj !== 'object' ||
 | 
			
		||||
        obj === null) {
 | 
			
		||||
 | 
			
		||||
        return obj;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    let clone = internals.clone;
 | 
			
		||||
    let seen = _seen;
 | 
			
		||||
 | 
			
		||||
    if (options.shallow) {
 | 
			
		||||
        if (options.shallow !== true) {
 | 
			
		||||
            return internals.cloneWithShallow(obj, options);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        clone = (value) => value;
 | 
			
		||||
    }
 | 
			
		||||
    else if (seen) {
 | 
			
		||||
        const lookup = seen.get(obj);
 | 
			
		||||
        if (lookup) {
 | 
			
		||||
            return lookup;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    else {
 | 
			
		||||
        seen = new Map();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // Built-in object types
 | 
			
		||||
 | 
			
		||||
    const baseProto = Types.getInternalProto(obj);
 | 
			
		||||
    if (baseProto === Types.buffer) {
 | 
			
		||||
        return Buffer && Buffer.from(obj);              // $lab:coverage:ignore$
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (baseProto === Types.date) {
 | 
			
		||||
        return new Date(obj.getTime());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (baseProto === Types.regex) {
 | 
			
		||||
        return new RegExp(obj);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // Generic objects
 | 
			
		||||
 | 
			
		||||
    const newObj = internals.base(obj, baseProto, options);
 | 
			
		||||
    if (newObj === obj) {
 | 
			
		||||
        return obj;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (seen) {
 | 
			
		||||
        seen.set(obj, newObj);                              // Set seen, since obj could recurse
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (baseProto === Types.set) {
 | 
			
		||||
        for (const value of obj) {
 | 
			
		||||
            newObj.add(clone(value, options, seen));
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    else if (baseProto === Types.map) {
 | 
			
		||||
        for (const [key, value] of obj) {
 | 
			
		||||
            newObj.set(key, clone(value, options, seen));
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    const keys = Utils.keys(obj, options);
 | 
			
		||||
    for (const key of keys) {
 | 
			
		||||
        if (key === '__proto__') {
 | 
			
		||||
            continue;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (baseProto === Types.array &&
 | 
			
		||||
            key === 'length') {
 | 
			
		||||
 | 
			
		||||
            newObj.length = obj.length;
 | 
			
		||||
            continue;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        const descriptor = Object.getOwnPropertyDescriptor(obj, key);
 | 
			
		||||
        if (descriptor) {
 | 
			
		||||
            if (descriptor.get ||
 | 
			
		||||
                descriptor.set) {
 | 
			
		||||
 | 
			
		||||
                Object.defineProperty(newObj, key, descriptor);
 | 
			
		||||
            }
 | 
			
		||||
            else if (descriptor.enumerable) {
 | 
			
		||||
                newObj[key] = clone(obj[key], options, seen);
 | 
			
		||||
            }
 | 
			
		||||
            else {
 | 
			
		||||
                Object.defineProperty(newObj, key, { enumerable: false, writable: true, configurable: true, value: clone(obj[key], options, seen) });
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        else {
 | 
			
		||||
            Object.defineProperty(newObj, key, {
 | 
			
		||||
                enumerable: true,
 | 
			
		||||
                writable: true,
 | 
			
		||||
                configurable: true,
 | 
			
		||||
                value: clone(obj[key], options, seen)
 | 
			
		||||
            });
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return newObj;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
internals.cloneWithShallow = function (source, options) {
 | 
			
		||||
 | 
			
		||||
    const keys = options.shallow;
 | 
			
		||||
    options = Object.assign({}, options);
 | 
			
		||||
    options.shallow = false;
 | 
			
		||||
 | 
			
		||||
    const seen = new Map();
 | 
			
		||||
 | 
			
		||||
    for (const key of keys) {
 | 
			
		||||
        const ref = Reach(source, key);
 | 
			
		||||
        if (typeof ref === 'object' ||
 | 
			
		||||
            typeof ref === 'function') {
 | 
			
		||||
 | 
			
		||||
            seen.set(ref, ref);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return internals.clone(source, options, seen);
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
internals.base = function (obj, baseProto, options) {
 | 
			
		||||
 | 
			
		||||
    if (options.prototype === false) {                  // Defaults to true
 | 
			
		||||
        if (internals.needsProtoHack.has(baseProto)) {
 | 
			
		||||
            return new baseProto.constructor();
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return baseProto === Types.array ? [] : {};
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    const proto = Object.getPrototypeOf(obj);
 | 
			
		||||
    if (proto &&
 | 
			
		||||
        proto.isImmutable) {
 | 
			
		||||
 | 
			
		||||
        return obj;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (baseProto === Types.array) {
 | 
			
		||||
        const newObj = [];
 | 
			
		||||
        if (proto !== baseProto) {
 | 
			
		||||
            Object.setPrototypeOf(newObj, proto);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return newObj;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (internals.needsProtoHack.has(baseProto)) {
 | 
			
		||||
        const newObj = new proto.constructor();
 | 
			
		||||
        if (proto !== baseProto) {
 | 
			
		||||
            Object.setPrototypeOf(newObj, proto);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return newObj;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return Object.create(proto);
 | 
			
		||||
};
 | 
			
		||||
							
								
								
									
										307
									
								
								qwen/nodejs/node_modules/@hapi/hoek/lib/contain.js
									
									
									
										generated
									
									
										vendored
									
									
										Executable file
									
								
							
							
						
						
									
										307
									
								
								qwen/nodejs/node_modules/@hapi/hoek/lib/contain.js
									
									
									
										generated
									
									
										vendored
									
									
										Executable file
									
								
							@@ -0,0 +1,307 @@
 | 
			
		||||
'use strict';
 | 
			
		||||
 | 
			
		||||
const Assert = require('./assert');
 | 
			
		||||
const DeepEqual = require('./deepEqual');
 | 
			
		||||
const EscapeRegex = require('./escapeRegex');
 | 
			
		||||
const Utils = require('./utils');
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
const internals = {};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
module.exports = function (ref, values, options = {}) {        // options: { deep, once, only, part, symbols }
 | 
			
		||||
 | 
			
		||||
    /*
 | 
			
		||||
        string -> string(s)
 | 
			
		||||
        array -> item(s)
 | 
			
		||||
        object -> key(s)
 | 
			
		||||
        object -> object (key:value)
 | 
			
		||||
    */
 | 
			
		||||
 | 
			
		||||
    if (typeof values !== 'object') {
 | 
			
		||||
        values = [values];
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    Assert(!Array.isArray(values) || values.length, 'Values array cannot be empty');
 | 
			
		||||
 | 
			
		||||
    // String
 | 
			
		||||
 | 
			
		||||
    if (typeof ref === 'string') {
 | 
			
		||||
        return internals.string(ref, values, options);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // Array
 | 
			
		||||
 | 
			
		||||
    if (Array.isArray(ref)) {
 | 
			
		||||
        return internals.array(ref, values, options);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // Object
 | 
			
		||||
 | 
			
		||||
    Assert(typeof ref === 'object', 'Reference must be string or an object');
 | 
			
		||||
    return internals.object(ref, values, options);
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
internals.array = function (ref, values, options) {
 | 
			
		||||
 | 
			
		||||
    if (!Array.isArray(values)) {
 | 
			
		||||
        values = [values];
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (!ref.length) {
 | 
			
		||||
        return false;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (options.only &&
 | 
			
		||||
        options.once &&
 | 
			
		||||
        ref.length !== values.length) {
 | 
			
		||||
 | 
			
		||||
        return false;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    let compare;
 | 
			
		||||
 | 
			
		||||
    // Map values
 | 
			
		||||
 | 
			
		||||
    const map = new Map();
 | 
			
		||||
    for (const value of values) {
 | 
			
		||||
        if (!options.deep ||
 | 
			
		||||
            !value ||
 | 
			
		||||
            typeof value !== 'object') {
 | 
			
		||||
 | 
			
		||||
            const existing = map.get(value);
 | 
			
		||||
            if (existing) {
 | 
			
		||||
                ++existing.allowed;
 | 
			
		||||
            }
 | 
			
		||||
            else {
 | 
			
		||||
                map.set(value, { allowed: 1, hits: 0 });
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        else {
 | 
			
		||||
            compare = compare || internals.compare(options);
 | 
			
		||||
 | 
			
		||||
            let found = false;
 | 
			
		||||
            for (const [key, existing] of map.entries()) {
 | 
			
		||||
                if (compare(key, value)) {
 | 
			
		||||
                    ++existing.allowed;
 | 
			
		||||
                    found = true;
 | 
			
		||||
                    break;
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            if (!found) {
 | 
			
		||||
                map.set(value, { allowed: 1, hits: 0 });
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // Lookup values
 | 
			
		||||
 | 
			
		||||
    let hits = 0;
 | 
			
		||||
    for (const item of ref) {
 | 
			
		||||
        let match;
 | 
			
		||||
        if (!options.deep ||
 | 
			
		||||
            !item ||
 | 
			
		||||
            typeof item !== 'object') {
 | 
			
		||||
 | 
			
		||||
            match = map.get(item);
 | 
			
		||||
        }
 | 
			
		||||
        else {
 | 
			
		||||
            compare = compare || internals.compare(options);
 | 
			
		||||
 | 
			
		||||
            for (const [key, existing] of map.entries()) {
 | 
			
		||||
                if (compare(key, item)) {
 | 
			
		||||
                    match = existing;
 | 
			
		||||
                    break;
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (match) {
 | 
			
		||||
            ++match.hits;
 | 
			
		||||
            ++hits;
 | 
			
		||||
 | 
			
		||||
            if (options.once &&
 | 
			
		||||
                match.hits > match.allowed) {
 | 
			
		||||
 | 
			
		||||
                return false;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // Validate results
 | 
			
		||||
 | 
			
		||||
    if (options.only &&
 | 
			
		||||
        hits !== ref.length) {
 | 
			
		||||
 | 
			
		||||
        return false;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    for (const match of map.values()) {
 | 
			
		||||
        if (match.hits === match.allowed) {
 | 
			
		||||
            continue;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (match.hits < match.allowed &&
 | 
			
		||||
            !options.part) {
 | 
			
		||||
 | 
			
		||||
            return false;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return !!hits;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
internals.object = function (ref, values, options) {
 | 
			
		||||
 | 
			
		||||
    Assert(options.once === undefined, 'Cannot use option once with object');
 | 
			
		||||
 | 
			
		||||
    const keys = Utils.keys(ref, options);
 | 
			
		||||
    if (!keys.length) {
 | 
			
		||||
        return false;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // Keys list
 | 
			
		||||
 | 
			
		||||
    if (Array.isArray(values)) {
 | 
			
		||||
        return internals.array(keys, values, options);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // Key value pairs
 | 
			
		||||
 | 
			
		||||
    const symbols = Object.getOwnPropertySymbols(values).filter((sym) => values.propertyIsEnumerable(sym));
 | 
			
		||||
    const targets = [...Object.keys(values), ...symbols];
 | 
			
		||||
 | 
			
		||||
    const compare = internals.compare(options);
 | 
			
		||||
    const set = new Set(targets);
 | 
			
		||||
 | 
			
		||||
    for (const key of keys) {
 | 
			
		||||
        if (!set.has(key)) {
 | 
			
		||||
            if (options.only) {
 | 
			
		||||
                return false;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            continue;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (!compare(values[key], ref[key])) {
 | 
			
		||||
            return false;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        set.delete(key);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (set.size) {
 | 
			
		||||
        return options.part ? set.size < targets.length : false;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return true;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
internals.string = function (ref, values, options) {
 | 
			
		||||
 | 
			
		||||
    // Empty string
 | 
			
		||||
 | 
			
		||||
    if (ref === '') {
 | 
			
		||||
        return values.length === 1 && values[0] === '' ||               // '' contains ''
 | 
			
		||||
            !options.once && !values.some((v) => v !== '');             // '' contains multiple '' if !once
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // Map values
 | 
			
		||||
 | 
			
		||||
    const map = new Map();
 | 
			
		||||
    const patterns = [];
 | 
			
		||||
 | 
			
		||||
    for (const value of values) {
 | 
			
		||||
        Assert(typeof value === 'string', 'Cannot compare string reference to non-string value');
 | 
			
		||||
 | 
			
		||||
        if (value) {
 | 
			
		||||
            const existing = map.get(value);
 | 
			
		||||
            if (existing) {
 | 
			
		||||
                ++existing.allowed;
 | 
			
		||||
            }
 | 
			
		||||
            else {
 | 
			
		||||
                map.set(value, { allowed: 1, hits: 0 });
 | 
			
		||||
                patterns.push(EscapeRegex(value));
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        else if (options.once ||
 | 
			
		||||
            options.only) {
 | 
			
		||||
 | 
			
		||||
            return false;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (!patterns.length) {                     // Non-empty string contains unlimited empty string
 | 
			
		||||
        return true;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // Match patterns
 | 
			
		||||
 | 
			
		||||
    const regex = new RegExp(`(${patterns.join('|')})`, 'g');
 | 
			
		||||
    const leftovers = ref.replace(regex, ($0, $1) => {
 | 
			
		||||
 | 
			
		||||
        ++map.get($1).hits;
 | 
			
		||||
        return '';                              // Remove from string
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
    // Validate results
 | 
			
		||||
 | 
			
		||||
    if (options.only &&
 | 
			
		||||
        leftovers) {
 | 
			
		||||
 | 
			
		||||
        return false;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    let any = false;
 | 
			
		||||
    for (const match of map.values()) {
 | 
			
		||||
        if (match.hits) {
 | 
			
		||||
            any = true;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (match.hits === match.allowed) {
 | 
			
		||||
            continue;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (match.hits < match.allowed &&
 | 
			
		||||
            !options.part) {
 | 
			
		||||
 | 
			
		||||
            return false;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // match.hits > match.allowed
 | 
			
		||||
 | 
			
		||||
        if (options.once) {
 | 
			
		||||
            return false;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return !!any;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
internals.compare = function (options) {
 | 
			
		||||
 | 
			
		||||
    if (!options.deep) {
 | 
			
		||||
        return internals.shallow;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    const hasOnly = options.only !== undefined;
 | 
			
		||||
    const hasPart = options.part !== undefined;
 | 
			
		||||
 | 
			
		||||
    const flags = {
 | 
			
		||||
        prototype: hasOnly ? options.only : hasPart ? !options.part : false,
 | 
			
		||||
        part: hasOnly ? !options.only : hasPart ? options.part : false
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    return (a, b) => DeepEqual(a, b, flags);
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
internals.shallow = function (a, b) {
 | 
			
		||||
 | 
			
		||||
    return a === b;
 | 
			
		||||
};
 | 
			
		||||
							
								
								
									
										317
									
								
								qwen/nodejs/node_modules/@hapi/hoek/lib/deepEqual.js
									
									
									
										generated
									
									
										vendored
									
									
										Executable file
									
								
							
							
						
						
									
										317
									
								
								qwen/nodejs/node_modules/@hapi/hoek/lib/deepEqual.js
									
									
									
										generated
									
									
										vendored
									
									
										Executable file
									
								
							@@ -0,0 +1,317 @@
 | 
			
		||||
'use strict';
 | 
			
		||||
 | 
			
		||||
const Types = require('./types');
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
const internals = {
 | 
			
		||||
    mismatched: null
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
module.exports = function (obj, ref, options) {
 | 
			
		||||
 | 
			
		||||
    options = Object.assign({ prototype: true }, options);
 | 
			
		||||
 | 
			
		||||
    return !!internals.isDeepEqual(obj, ref, options, []);
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
internals.isDeepEqual = function (obj, ref, options, seen) {
 | 
			
		||||
 | 
			
		||||
    if (obj === ref) {                                                      // Copied from Deep-eql, copyright(c) 2013 Jake Luer, jake@alogicalparadox.com, MIT Licensed, https://github.com/chaijs/deep-eql
 | 
			
		||||
        return obj !== 0 || 1 / obj === 1 / ref;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    const type = typeof obj;
 | 
			
		||||
 | 
			
		||||
    if (type !== typeof ref) {
 | 
			
		||||
        return false;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (obj === null ||
 | 
			
		||||
        ref === null) {
 | 
			
		||||
 | 
			
		||||
        return false;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (type === 'function') {
 | 
			
		||||
        if (!options.deepFunction ||
 | 
			
		||||
            obj.toString() !== ref.toString()) {
 | 
			
		||||
 | 
			
		||||
            return false;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // Continue as object
 | 
			
		||||
    }
 | 
			
		||||
    else if (type !== 'object') {
 | 
			
		||||
        return obj !== obj && ref !== ref;                                  // NaN
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    const instanceType = internals.getSharedType(obj, ref, !!options.prototype);
 | 
			
		||||
    switch (instanceType) {
 | 
			
		||||
        case Types.buffer:
 | 
			
		||||
            return Buffer && Buffer.prototype.equals.call(obj, ref);        // $lab:coverage:ignore$
 | 
			
		||||
        case Types.promise:
 | 
			
		||||
            return obj === ref;
 | 
			
		||||
        case Types.regex:
 | 
			
		||||
            return obj.toString() === ref.toString();
 | 
			
		||||
        case internals.mismatched:
 | 
			
		||||
            return false;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    for (let i = seen.length - 1; i >= 0; --i) {
 | 
			
		||||
        if (seen[i].isSame(obj, ref)) {
 | 
			
		||||
            return true;                                                    // If previous comparison failed, it would have stopped execution
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    seen.push(new internals.SeenEntry(obj, ref));
 | 
			
		||||
 | 
			
		||||
    try {
 | 
			
		||||
        return !!internals.isDeepEqualObj(instanceType, obj, ref, options, seen);
 | 
			
		||||
    }
 | 
			
		||||
    finally {
 | 
			
		||||
        seen.pop();
 | 
			
		||||
    }
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
internals.getSharedType = function (obj, ref, checkPrototype) {
 | 
			
		||||
 | 
			
		||||
    if (checkPrototype) {
 | 
			
		||||
        if (Object.getPrototypeOf(obj) !== Object.getPrototypeOf(ref)) {
 | 
			
		||||
            return internals.mismatched;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return Types.getInternalProto(obj);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    const type = Types.getInternalProto(obj);
 | 
			
		||||
    if (type !== Types.getInternalProto(ref)) {
 | 
			
		||||
        return internals.mismatched;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return type;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
internals.valueOf = function (obj) {
 | 
			
		||||
 | 
			
		||||
    const objValueOf = obj.valueOf;
 | 
			
		||||
    if (objValueOf === undefined) {
 | 
			
		||||
        return obj;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    try {
 | 
			
		||||
        return objValueOf.call(obj);
 | 
			
		||||
    }
 | 
			
		||||
    catch (err) {
 | 
			
		||||
        return err;
 | 
			
		||||
    }
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
internals.hasOwnEnumerableProperty = function (obj, key) {
 | 
			
		||||
 | 
			
		||||
    return Object.prototype.propertyIsEnumerable.call(obj, key);
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
internals.isSetSimpleEqual = function (obj, ref) {
 | 
			
		||||
 | 
			
		||||
    for (const entry of Set.prototype.values.call(obj)) {
 | 
			
		||||
        if (!Set.prototype.has.call(ref, entry)) {
 | 
			
		||||
            return false;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return true;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
internals.isDeepEqualObj = function (instanceType, obj, ref, options, seen) {
 | 
			
		||||
 | 
			
		||||
    const { isDeepEqual, valueOf, hasOwnEnumerableProperty } = internals;
 | 
			
		||||
    const { keys, getOwnPropertySymbols } = Object;
 | 
			
		||||
 | 
			
		||||
    if (instanceType === Types.array) {
 | 
			
		||||
        if (options.part) {
 | 
			
		||||
 | 
			
		||||
            // Check if any index match any other index
 | 
			
		||||
 | 
			
		||||
            for (const objValue of obj) {
 | 
			
		||||
                for (const refValue of ref) {
 | 
			
		||||
                    if (isDeepEqual(objValue, refValue, options, seen)) {
 | 
			
		||||
                        return true;
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        else {
 | 
			
		||||
            if (obj.length !== ref.length) {
 | 
			
		||||
                return false;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            for (let i = 0; i < obj.length; ++i) {
 | 
			
		||||
                if (!isDeepEqual(obj[i], ref[i], options, seen)) {
 | 
			
		||||
                    return false;
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            return true;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    else if (instanceType === Types.set) {
 | 
			
		||||
        if (obj.size !== ref.size) {
 | 
			
		||||
            return false;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (!internals.isSetSimpleEqual(obj, ref)) {
 | 
			
		||||
 | 
			
		||||
            // Check for deep equality
 | 
			
		||||
 | 
			
		||||
            const ref2 = new Set(Set.prototype.values.call(ref));
 | 
			
		||||
            for (const objEntry of Set.prototype.values.call(obj)) {
 | 
			
		||||
                if (ref2.delete(objEntry)) {
 | 
			
		||||
                    continue;
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                let found = false;
 | 
			
		||||
                for (const refEntry of ref2) {
 | 
			
		||||
                    if (isDeepEqual(objEntry, refEntry, options, seen)) {
 | 
			
		||||
                        ref2.delete(refEntry);
 | 
			
		||||
                        found = true;
 | 
			
		||||
                        break;
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                if (!found) {
 | 
			
		||||
                    return false;
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    else if (instanceType === Types.map) {
 | 
			
		||||
        if (obj.size !== ref.size) {
 | 
			
		||||
            return false;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        for (const [key, value] of Map.prototype.entries.call(obj)) {
 | 
			
		||||
            if (value === undefined && !Map.prototype.has.call(ref, key)) {
 | 
			
		||||
                return false;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            if (!isDeepEqual(value, Map.prototype.get.call(ref, key), options, seen)) {
 | 
			
		||||
                return false;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    else if (instanceType === Types.error) {
 | 
			
		||||
 | 
			
		||||
        // Always check name and message
 | 
			
		||||
 | 
			
		||||
        if (obj.name !== ref.name ||
 | 
			
		||||
            obj.message !== ref.message) {
 | 
			
		||||
 | 
			
		||||
            return false;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // Check .valueOf()
 | 
			
		||||
 | 
			
		||||
    const valueOfObj = valueOf(obj);
 | 
			
		||||
    const valueOfRef = valueOf(ref);
 | 
			
		||||
    if ((obj !== valueOfObj || ref !== valueOfRef) &&
 | 
			
		||||
        !isDeepEqual(valueOfObj, valueOfRef, options, seen)) {
 | 
			
		||||
 | 
			
		||||
        return false;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // Check properties
 | 
			
		||||
 | 
			
		||||
    const objKeys = keys(obj);
 | 
			
		||||
    if (!options.part &&
 | 
			
		||||
        objKeys.length !== keys(ref).length &&
 | 
			
		||||
        !options.skip) {
 | 
			
		||||
 | 
			
		||||
        return false;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    let skipped = 0;
 | 
			
		||||
    for (const key of objKeys) {
 | 
			
		||||
        if (options.skip &&
 | 
			
		||||
            options.skip.includes(key)) {
 | 
			
		||||
 | 
			
		||||
            if (ref[key] === undefined) {
 | 
			
		||||
                ++skipped;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            continue;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (!hasOwnEnumerableProperty(ref, key)) {
 | 
			
		||||
            return false;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (!isDeepEqual(obj[key], ref[key], options, seen)) {
 | 
			
		||||
            return false;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (!options.part &&
 | 
			
		||||
        objKeys.length - skipped !== keys(ref).length) {
 | 
			
		||||
 | 
			
		||||
        return false;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // Check symbols
 | 
			
		||||
 | 
			
		||||
    if (options.symbols !== false) {                                // Defaults to true
 | 
			
		||||
        const objSymbols = getOwnPropertySymbols(obj);
 | 
			
		||||
        const refSymbols = new Set(getOwnPropertySymbols(ref));
 | 
			
		||||
 | 
			
		||||
        for (const key of objSymbols) {
 | 
			
		||||
            if (!options.skip ||
 | 
			
		||||
                !options.skip.includes(key)) {
 | 
			
		||||
 | 
			
		||||
                if (hasOwnEnumerableProperty(obj, key)) {
 | 
			
		||||
                    if (!hasOwnEnumerableProperty(ref, key)) {
 | 
			
		||||
                        return false;
 | 
			
		||||
                    }
 | 
			
		||||
 | 
			
		||||
                    if (!isDeepEqual(obj[key], ref[key], options, seen)) {
 | 
			
		||||
                        return false;
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
                else if (hasOwnEnumerableProperty(ref, key)) {
 | 
			
		||||
                    return false;
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            refSymbols.delete(key);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        for (const key of refSymbols) {
 | 
			
		||||
            if (hasOwnEnumerableProperty(ref, key)) {
 | 
			
		||||
                return false;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return true;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
internals.SeenEntry = class {
 | 
			
		||||
 | 
			
		||||
    constructor(obj, ref) {
 | 
			
		||||
 | 
			
		||||
        this.obj = obj;
 | 
			
		||||
        this.ref = ref;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    isSame(obj, ref) {
 | 
			
		||||
 | 
			
		||||
        return this.obj === obj && this.ref === ref;
 | 
			
		||||
    }
 | 
			
		||||
};
 | 
			
		||||
							
								
								
									
										26
									
								
								qwen/nodejs/node_modules/@hapi/hoek/lib/error.js
									
									
									
										generated
									
									
										vendored
									
									
										Executable file
									
								
							
							
						
						
									
										26
									
								
								qwen/nodejs/node_modules/@hapi/hoek/lib/error.js
									
									
									
										generated
									
									
										vendored
									
									
										Executable file
									
								
							@@ -0,0 +1,26 @@
 | 
			
		||||
'use strict';
 | 
			
		||||
 | 
			
		||||
const Stringify = require('./stringify');
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
const internals = {};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
module.exports = class extends Error {
 | 
			
		||||
 | 
			
		||||
    constructor(args) {
 | 
			
		||||
 | 
			
		||||
        const msgs = args
 | 
			
		||||
            .filter((arg) => arg !== '')
 | 
			
		||||
            .map((arg) => {
 | 
			
		||||
 | 
			
		||||
                return typeof arg === 'string' ? arg : arg instanceof Error ? arg.message : Stringify(arg);
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
        super(msgs.join(' ') || 'Unknown error');
 | 
			
		||||
 | 
			
		||||
        if (typeof Error.captureStackTrace === 'function') {            // $lab:coverage:ignore$
 | 
			
		||||
            Error.captureStackTrace(this, exports.assert);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
};
 | 
			
		||||
							
								
								
									
										16
									
								
								qwen/nodejs/node_modules/@hapi/hoek/lib/escapeHeaderAttribute.js
									
									
									
										generated
									
									
										vendored
									
									
										Executable file
									
								
							
							
						
						
									
										16
									
								
								qwen/nodejs/node_modules/@hapi/hoek/lib/escapeHeaderAttribute.js
									
									
									
										generated
									
									
										vendored
									
									
										Executable file
									
								
							@@ -0,0 +1,16 @@
 | 
			
		||||
'use strict';
 | 
			
		||||
 | 
			
		||||
const Assert = require('./assert');
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
const internals = {};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
module.exports = function (attribute) {
 | 
			
		||||
 | 
			
		||||
    // Allowed value characters: !#$%&'()*+,-./:;<=>?@[]^_`{|}~ and space, a-z, A-Z, 0-9, \, "
 | 
			
		||||
 | 
			
		||||
    Assert(/^[ \w\!#\$%&'\(\)\*\+,\-\.\/\:;<\=>\?@\[\]\^`\{\|\}~\"\\]*$/.test(attribute), 'Bad attribute value (' + attribute + ')');
 | 
			
		||||
 | 
			
		||||
    return attribute.replace(/\\/g, '\\\\').replace(/\"/g, '\\"');                             // Escape quotes and slash
 | 
			
		||||
};
 | 
			
		||||
							
								
								
									
										87
									
								
								qwen/nodejs/node_modules/@hapi/hoek/lib/escapeHtml.js
									
									
									
										generated
									
									
										vendored
									
									
										Executable file
									
								
							
							
						
						
									
										87
									
								
								qwen/nodejs/node_modules/@hapi/hoek/lib/escapeHtml.js
									
									
									
										generated
									
									
										vendored
									
									
										Executable file
									
								
							@@ -0,0 +1,87 @@
 | 
			
		||||
'use strict';
 | 
			
		||||
 | 
			
		||||
const internals = {};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
module.exports = function (input) {
 | 
			
		||||
 | 
			
		||||
    if (!input) {
 | 
			
		||||
        return '';
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    let escaped = '';
 | 
			
		||||
 | 
			
		||||
    for (let i = 0; i < input.length; ++i) {
 | 
			
		||||
 | 
			
		||||
        const charCode = input.charCodeAt(i);
 | 
			
		||||
 | 
			
		||||
        if (internals.isSafe(charCode)) {
 | 
			
		||||
            escaped += input[i];
 | 
			
		||||
        }
 | 
			
		||||
        else {
 | 
			
		||||
            escaped += internals.escapeHtmlChar(charCode);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return escaped;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
internals.escapeHtmlChar = function (charCode) {
 | 
			
		||||
 | 
			
		||||
    const namedEscape = internals.namedHtml.get(charCode);
 | 
			
		||||
    if (namedEscape) {
 | 
			
		||||
        return namedEscape;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (charCode >= 256) {
 | 
			
		||||
        return '&#' + charCode + ';';
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    const hexValue = charCode.toString(16).padStart(2, '0');
 | 
			
		||||
    return `&#x${hexValue};`;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
internals.isSafe = function (charCode) {
 | 
			
		||||
 | 
			
		||||
    return internals.safeCharCodes.has(charCode);
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
internals.namedHtml = new Map([
 | 
			
		||||
    [38, '&'],
 | 
			
		||||
    [60, '<'],
 | 
			
		||||
    [62, '>'],
 | 
			
		||||
    [34, '"'],
 | 
			
		||||
    [160, ' '],
 | 
			
		||||
    [162, '¢'],
 | 
			
		||||
    [163, '£'],
 | 
			
		||||
    [164, '¤'],
 | 
			
		||||
    [169, '©'],
 | 
			
		||||
    [174, '®']
 | 
			
		||||
]);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
internals.safeCharCodes = (function () {
 | 
			
		||||
 | 
			
		||||
    const safe = new Set();
 | 
			
		||||
 | 
			
		||||
    for (let i = 32; i < 123; ++i) {
 | 
			
		||||
 | 
			
		||||
        if ((i >= 97) ||                    // a-z
 | 
			
		||||
            (i >= 65 && i <= 90) ||         // A-Z
 | 
			
		||||
            (i >= 48 && i <= 57) ||         // 0-9
 | 
			
		||||
            i === 32 ||                     // space
 | 
			
		||||
            i === 46 ||                     // .
 | 
			
		||||
            i === 44 ||                     // ,
 | 
			
		||||
            i === 45 ||                     // -
 | 
			
		||||
            i === 58 ||                     // :
 | 
			
		||||
            i === 95) {                     // _
 | 
			
		||||
 | 
			
		||||
            safe.add(i);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return safe;
 | 
			
		||||
}());
 | 
			
		||||
							
								
								
									
										28
									
								
								qwen/nodejs/node_modules/@hapi/hoek/lib/escapeJson.js
									
									
									
										generated
									
									
										vendored
									
									
										Executable file
									
								
							
							
						
						
									
										28
									
								
								qwen/nodejs/node_modules/@hapi/hoek/lib/escapeJson.js
									
									
									
										generated
									
									
										vendored
									
									
										Executable file
									
								
							@@ -0,0 +1,28 @@
 | 
			
		||||
'use strict';
 | 
			
		||||
 | 
			
		||||
const internals = {};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
module.exports = function (input) {
 | 
			
		||||
 | 
			
		||||
    if (!input) {
 | 
			
		||||
        return '';
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return input.replace(/[<>&\u2028\u2029]/g, internals.escape);
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
internals.escape = function (char) {
 | 
			
		||||
 | 
			
		||||
    return internals.replacements.get(char);
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
internals.replacements = new Map([
 | 
			
		||||
    ['<', '\\u003c'],
 | 
			
		||||
    ['>', '\\u003e'],
 | 
			
		||||
    ['&', '\\u0026'],
 | 
			
		||||
    ['\u2028', '\\u2028'],
 | 
			
		||||
    ['\u2029', '\\u2029']
 | 
			
		||||
]);
 | 
			
		||||
							
								
								
									
										11
									
								
								qwen/nodejs/node_modules/@hapi/hoek/lib/escapeRegex.js
									
									
									
										generated
									
									
										vendored
									
									
										Executable file
									
								
							
							
						
						
									
										11
									
								
								qwen/nodejs/node_modules/@hapi/hoek/lib/escapeRegex.js
									
									
									
										generated
									
									
										vendored
									
									
										Executable file
									
								
							@@ -0,0 +1,11 @@
 | 
			
		||||
'use strict';
 | 
			
		||||
 | 
			
		||||
const internals = {};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
module.exports = function (string) {
 | 
			
		||||
 | 
			
		||||
    // Escape ^$.*+-?=!:|\/()[]{},
 | 
			
		||||
 | 
			
		||||
    return string.replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g, '\\$&');
 | 
			
		||||
};
 | 
			
		||||
							
								
								
									
										20
									
								
								qwen/nodejs/node_modules/@hapi/hoek/lib/flatten.js
									
									
									
										generated
									
									
										vendored
									
									
										Executable file
									
								
							
							
						
						
									
										20
									
								
								qwen/nodejs/node_modules/@hapi/hoek/lib/flatten.js
									
									
									
										generated
									
									
										vendored
									
									
										Executable file
									
								
							@@ -0,0 +1,20 @@
 | 
			
		||||
'use strict';
 | 
			
		||||
 | 
			
		||||
const internals = {};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
module.exports = internals.flatten = function (array, target) {
 | 
			
		||||
 | 
			
		||||
    const result = target || [];
 | 
			
		||||
 | 
			
		||||
    for (const entry of array) {
 | 
			
		||||
        if (Array.isArray(entry)) {
 | 
			
		||||
            internals.flatten(entry, result);
 | 
			
		||||
        }
 | 
			
		||||
        else {
 | 
			
		||||
            result.push(entry);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return result;
 | 
			
		||||
};
 | 
			
		||||
							
								
								
									
										6
									
								
								qwen/nodejs/node_modules/@hapi/hoek/lib/ignore.js
									
									
									
										generated
									
									
										vendored
									
									
										Executable file
									
								
							
							
						
						
									
										6
									
								
								qwen/nodejs/node_modules/@hapi/hoek/lib/ignore.js
									
									
									
										generated
									
									
										vendored
									
									
										Executable file
									
								
							@@ -0,0 +1,6 @@
 | 
			
		||||
'use strict';
 | 
			
		||||
 | 
			
		||||
const internals = {};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
module.exports = function () { };
 | 
			
		||||
							
								
								
									
										471
									
								
								qwen/nodejs/node_modules/@hapi/hoek/lib/index.d.ts
									
									
									
										generated
									
									
										vendored
									
									
										Executable file
									
								
							
							
						
						
									
										471
									
								
								qwen/nodejs/node_modules/@hapi/hoek/lib/index.d.ts
									
									
									
										generated
									
									
										vendored
									
									
										Executable file
									
								
							@@ -0,0 +1,471 @@
 | 
			
		||||
/// <reference types="node" />
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Performs a deep comparison of the two values including support for circular dependencies, prototype, and enumerable properties.
 | 
			
		||||
 *
 | 
			
		||||
 * @param obj - The value being compared.
 | 
			
		||||
 * @param ref - The reference value used for comparison.
 | 
			
		||||
 * 
 | 
			
		||||
 * @return true when the two values are equal, otherwise false.
 | 
			
		||||
 */
 | 
			
		||||
export function deepEqual(obj: any, ref: any, options?: deepEqual.Options): boolean;
 | 
			
		||||
 | 
			
		||||
export namespace deepEqual {
 | 
			
		||||
 | 
			
		||||
    interface Options {
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Compare functions with difference references by comparing their internal code and properties.
 | 
			
		||||
         *
 | 
			
		||||
         * @default false
 | 
			
		||||
         */
 | 
			
		||||
        readonly deepFunction?: boolean;
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Allow partial match.
 | 
			
		||||
         *
 | 
			
		||||
         * @default false
 | 
			
		||||
         */
 | 
			
		||||
        readonly part?: boolean;
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Compare the objects' prototypes.
 | 
			
		||||
         *
 | 
			
		||||
         * @default true
 | 
			
		||||
         */
 | 
			
		||||
        readonly prototype?: boolean;
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * List of object keys to ignore different values of.
 | 
			
		||||
         *
 | 
			
		||||
         * @default null
 | 
			
		||||
         */
 | 
			
		||||
        readonly skip?: (string | symbol)[];
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Compare symbol properties.
 | 
			
		||||
         *
 | 
			
		||||
         * @default true
 | 
			
		||||
         */
 | 
			
		||||
        readonly symbols?: boolean;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Clone any value, object, or array.
 | 
			
		||||
 *
 | 
			
		||||
 * @param obj - The value being cloned.
 | 
			
		||||
 * @param options - Optional settings.
 | 
			
		||||
 *
 | 
			
		||||
 * @returns A deep clone of `obj`.
 | 
			
		||||
 */
 | 
			
		||||
export function clone<T>(obj: T, options?: clone.Options): T;
 | 
			
		||||
 | 
			
		||||
export namespace clone {
 | 
			
		||||
 | 
			
		||||
    interface Options {
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Clone the object's prototype.
 | 
			
		||||
         *
 | 
			
		||||
         * @default true
 | 
			
		||||
         */
 | 
			
		||||
        readonly prototype?: boolean;
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Include symbol properties.
 | 
			
		||||
         *
 | 
			
		||||
         * @default true
 | 
			
		||||
         */
 | 
			
		||||
        readonly symbols?: boolean;
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Shallow clone the specified keys.
 | 
			
		||||
         *
 | 
			
		||||
         * @default undefined
 | 
			
		||||
         */
 | 
			
		||||
        readonly shallow?: string[] | string[][] | boolean;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Merge all the properties of source into target.
 | 
			
		||||
 *
 | 
			
		||||
 * @param target - The object being modified.
 | 
			
		||||
 * @param source - The object used to copy properties from.
 | 
			
		||||
 * @param options - Optional settings.
 | 
			
		||||
 *
 | 
			
		||||
 * @returns The `target` object.
 | 
			
		||||
 */
 | 
			
		||||
export function merge<T1 extends object, T2 extends object>(target: T1, source: T2, options?: merge.Options): T1 & T2;
 | 
			
		||||
 | 
			
		||||
export namespace merge {
 | 
			
		||||
 | 
			
		||||
    interface Options {
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * When true, null value from `source` overrides existing value in `target`.
 | 
			
		||||
         *
 | 
			
		||||
         * @default true
 | 
			
		||||
         */
 | 
			
		||||
        readonly nullOverride?: boolean;
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * When true, array value from `source` is merged with the existing value in `target`.
 | 
			
		||||
         *
 | 
			
		||||
         * @default false
 | 
			
		||||
         */
 | 
			
		||||
        readonly mergeArrays?: boolean;
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Compare symbol properties.
 | 
			
		||||
         *
 | 
			
		||||
         * @default true
 | 
			
		||||
         */
 | 
			
		||||
        readonly symbols?: boolean;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Apply source to a copy of the defaults.
 | 
			
		||||
 *
 | 
			
		||||
 * @param defaults - An object with the default values to use of `options` does not contain the same keys.
 | 
			
		||||
 * @param source - The source used to override the `defaults`.
 | 
			
		||||
 * @param options - Optional settings.
 | 
			
		||||
 *
 | 
			
		||||
 * @returns A copy of `defaults` with `source` keys overriding any conflicts.
 | 
			
		||||
 */
 | 
			
		||||
export function applyToDefaults<T extends object>(defaults: Partial<T>, source: Partial<T> | boolean | null, options?: applyToDefaults.Options): Partial<T>;
 | 
			
		||||
 | 
			
		||||
export namespace applyToDefaults {
 | 
			
		||||
 | 
			
		||||
    interface Options {
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * When true, null value from `source` overrides existing value in `target`.
 | 
			
		||||
         *
 | 
			
		||||
         * @default true
 | 
			
		||||
         */
 | 
			
		||||
        readonly nullOverride?: boolean;
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Shallow clone the specified keys.
 | 
			
		||||
         *
 | 
			
		||||
         * @default undefined
 | 
			
		||||
         */
 | 
			
		||||
        readonly shallow?: string[] | string[][];
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Find the common unique items in two arrays.
 | 
			
		||||
 *
 | 
			
		||||
 * @param array1 - The first array to compare.
 | 
			
		||||
 * @param array2 - The second array to compare.
 | 
			
		||||
 * @param options - Optional settings.
 | 
			
		||||
 *
 | 
			
		||||
 * @return - An array of the common items. If `justFirst` is true, returns the first common item.
 | 
			
		||||
 */
 | 
			
		||||
export function intersect<T1, T2>(array1: intersect.Array<T1>, array2: intersect.Array<T2>, options?: intersect.Options): Array<T1 | T2>;
 | 
			
		||||
export function intersect<T1, T2>(array1: intersect.Array<T1>, array2: intersect.Array<T2>, options?: intersect.Options): T1 | T2;
 | 
			
		||||
 | 
			
		||||
export namespace intersect {
 | 
			
		||||
 | 
			
		||||
    type Array<T> = ArrayLike<T> | Set<T> | null;
 | 
			
		||||
 | 
			
		||||
    interface Options {
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * When true, return the first overlapping value.
 | 
			
		||||
         *
 | 
			
		||||
         * @default false
 | 
			
		||||
         */
 | 
			
		||||
        readonly first?: boolean;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Checks if the reference value contains the provided values.
 | 
			
		||||
 *
 | 
			
		||||
 * @param ref - The reference string, array, or object.
 | 
			
		||||
 * @param values - A single or array of values to find within `ref`. If `ref` is an object, `values` can be a key name, an array of key names, or an object with key-value pairs to compare.
 | 
			
		||||
 *
 | 
			
		||||
 * @return true if the value contains the provided values, otherwise false.
 | 
			
		||||
 */
 | 
			
		||||
export function contain(ref: string, values: string | string[], options?: contain.Options): boolean;
 | 
			
		||||
export function contain(ref: any[], values: any, options?: contain.Options): boolean;
 | 
			
		||||
export function contain(ref: object, values: string | string[] | object, options?: Omit<contain.Options, 'once'>): boolean;
 | 
			
		||||
 | 
			
		||||
export namespace contain {
 | 
			
		||||
 | 
			
		||||
    interface Options {
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Perform a deep comparison.
 | 
			
		||||
         *
 | 
			
		||||
         * @default false
 | 
			
		||||
         */
 | 
			
		||||
        readonly deep?: boolean;
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Allow only one occurrence of each value.
 | 
			
		||||
         *
 | 
			
		||||
         * @default false
 | 
			
		||||
         */
 | 
			
		||||
        readonly once?: boolean;
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Allow only values explicitly listed.
 | 
			
		||||
         *
 | 
			
		||||
         * @default false
 | 
			
		||||
         */
 | 
			
		||||
        readonly only?: boolean;
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Allow partial match.
 | 
			
		||||
         *
 | 
			
		||||
         * @default false
 | 
			
		||||
         */
 | 
			
		||||
        readonly part?: boolean;
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Include symbol properties.
 | 
			
		||||
         *
 | 
			
		||||
         * @default true
 | 
			
		||||
         */
 | 
			
		||||
        readonly symbols?: boolean;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Flatten an array with sub arrays
 | 
			
		||||
 *
 | 
			
		||||
 * @param array - an array of items or other arrays to flatten.
 | 
			
		||||
 * @param target - if provided, an array to shallow copy the flattened `array` items to
 | 
			
		||||
 *
 | 
			
		||||
 * @return a flat array of the provided values (appended to `target` is provided).
 | 
			
		||||
 */
 | 
			
		||||
export function flatten<T>(array: ArrayLike<T | ReadonlyArray<T>>, target?: ArrayLike<T | ReadonlyArray<T>>): T[];
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Convert an object key chain string to reference.
 | 
			
		||||
 *
 | 
			
		||||
 * @param obj - the object from which to look up the value.
 | 
			
		||||
 * @param chain - the string path of the requested value. The chain string is split into key names using `options.separator`, or an array containing each individual key name. A chain including negative numbers will work like a negative index on an array.
 | 
			
		||||
 *
 | 
			
		||||
 * @return The value referenced by the chain if found, otherwise undefined. If chain is null, undefined, or false, the object itself will be returned.
 | 
			
		||||
 */
 | 
			
		||||
export function reach(obj: object | null, chain: string | (string | number)[] | false | null | undefined, options?: reach.Options): any;
 | 
			
		||||
 | 
			
		||||
export namespace reach {
 | 
			
		||||
 | 
			
		||||
    interface Options {
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * String to split chain path on. Defaults to '.'.
 | 
			
		||||
         *
 | 
			
		||||
         * @default false
 | 
			
		||||
         */
 | 
			
		||||
        readonly separator?: string;
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Value to return if the path or value is not present. No default value.
 | 
			
		||||
         *
 | 
			
		||||
         * @default false
 | 
			
		||||
         */
 | 
			
		||||
        readonly default?: any;
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * If true, will throw an error on missing member in the chain. Default to false.
 | 
			
		||||
         *
 | 
			
		||||
         * @default false
 | 
			
		||||
         */
 | 
			
		||||
        readonly strict?: boolean;
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * If true, allows traversing functions for properties. false will throw an error if a function is part of the chain.
 | 
			
		||||
         *
 | 
			
		||||
         * @default true
 | 
			
		||||
         */
 | 
			
		||||
        readonly functions?: boolean;
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * If true, allows traversing Set and Map objects for properties. false will return undefined regardless of the Set or Map passed.
 | 
			
		||||
         *
 | 
			
		||||
         * @default false
 | 
			
		||||
         */
 | 
			
		||||
        readonly iterables?: boolean;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Replace string parameters (using format "{path.to.key}") with their corresponding object key values using `Hoek.reach()`.
 | 
			
		||||
 *
 | 
			
		||||
 * @param obj - the object from which to look up the value.
 | 
			
		||||
 * @param template - the string containing {} enclosed key paths to be replaced.
 | 
			
		||||
 *
 | 
			
		||||
 * @return The template string with the {} enclosed keys replaced with looked-up values.
 | 
			
		||||
 */
 | 
			
		||||
export function reachTemplate(obj: object | null, template: string, options?: reach.Options): string;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Throw an error if condition is falsy.
 | 
			
		||||
 *
 | 
			
		||||
 * @param condition - If `condition` is not truthy, an exception is thrown.
 | 
			
		||||
 * @param error - The error thrown if the condition fails.
 | 
			
		||||
 *
 | 
			
		||||
 * @return Does not return a value but throws if the `condition` is falsy.
 | 
			
		||||
 */
 | 
			
		||||
export function assert(condition: any, error: Error): void;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Throw an error if condition is falsy.
 | 
			
		||||
 *
 | 
			
		||||
 * @param condition - If `condition` is not truthy, an exception is thrown.
 | 
			
		||||
 * @param args - Any number of values, concatenated together (space separated) to create the error message.
 | 
			
		||||
 *
 | 
			
		||||
 * @return Does not return a value but throws if the `condition` is falsy.
 | 
			
		||||
 */
 | 
			
		||||
export function assert(condition: any, ...args: any): void;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * A benchmarking timer, using the internal node clock for maximum accuracy.
 | 
			
		||||
 */
 | 
			
		||||
export class Bench {
 | 
			
		||||
 | 
			
		||||
    constructor();
 | 
			
		||||
 | 
			
		||||
    /** The starting timestamp expressed in the number of milliseconds since the epoch. */
 | 
			
		||||
    ts: number;
 | 
			
		||||
 | 
			
		||||
    /** The time in milliseconds since the object was created. */
 | 
			
		||||
    elapsed(): number;
 | 
			
		||||
 | 
			
		||||
    /** Reset the `ts` value to now. */
 | 
			
		||||
    reset(): void;
 | 
			
		||||
 | 
			
		||||
    /** The current time in milliseconds since the epoch. */
 | 
			
		||||
    static now(): number;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Escape string for Regex construction by prefixing all reserved characters with a backslash.
 | 
			
		||||
 *
 | 
			
		||||
 * @param string - The string to be escaped.
 | 
			
		||||
 *
 | 
			
		||||
 * @return The escaped string.
 | 
			
		||||
 */
 | 
			
		||||
export function escapeRegex(string: string): string;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Escape string for usage as an attribute value in HTTP headers.
 | 
			
		||||
 *
 | 
			
		||||
 * @param attribute - The string to be escaped.
 | 
			
		||||
 *
 | 
			
		||||
 * @return The escaped string. Will throw on invalid characters that are not supported to be escaped.
 | 
			
		||||
 */
 | 
			
		||||
export function escapeHeaderAttribute(attribute: string): string;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Escape string for usage in HTML.
 | 
			
		||||
 *
 | 
			
		||||
 * @param string - The string to be escaped.
 | 
			
		||||
 *
 | 
			
		||||
 * @return The escaped string.
 | 
			
		||||
 */
 | 
			
		||||
export function escapeHtml(string: string): string;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Escape string for usage in JSON.
 | 
			
		||||
 *
 | 
			
		||||
 * @param string - The string to be escaped.
 | 
			
		||||
 *
 | 
			
		||||
 * @return The escaped string.
 | 
			
		||||
 */
 | 
			
		||||
export function escapeJson(string: string): string;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Wraps a function to ensure it can only execute once.
 | 
			
		||||
 *
 | 
			
		||||
 * @param method - The function to be wrapped.
 | 
			
		||||
 *
 | 
			
		||||
 * @return The wrapped function.
 | 
			
		||||
 */
 | 
			
		||||
export function once<T extends Function>(method: T): T;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * A reusable no-op function.
 | 
			
		||||
 */
 | 
			
		||||
export function ignore(...ignore: any): void;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Converts a JavaScript value to a JavaScript Object Notation (JSON) string with protection against thrown errors.
 | 
			
		||||
 *
 | 
			
		||||
 * @param value A JavaScript value, usually an object or array, to be converted.
 | 
			
		||||
 * @param replacer The JSON.stringify() `replacer` argument.
 | 
			
		||||
 * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.
 | 
			
		||||
 *
 | 
			
		||||
 * @return The JSON string. If the operation fails, an error string value is returned (no exception thrown).
 | 
			
		||||
 */
 | 
			
		||||
export function stringify(value: any, replacer?: any, space?: string | number): string;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Returns a Promise that resolves after the requested timeout.
 | 
			
		||||
 *
 | 
			
		||||
 * @param timeout - The number of milliseconds to wait before resolving the Promise.
 | 
			
		||||
 * @param returnValue - The value that the Promise will resolve to.
 | 
			
		||||
 *
 | 
			
		||||
 * @return A Promise that resolves with `returnValue`.
 | 
			
		||||
 */
 | 
			
		||||
export function wait<T>(timeout?: number, returnValue?: T): Promise<T>;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Returns a Promise that never resolves.
 | 
			
		||||
 */
 | 
			
		||||
export function block(): Promise<void>;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Determines if an object is a promise.
 | 
			
		||||
 * 
 | 
			
		||||
 * @param promise - the object tested.
 | 
			
		||||
 * 
 | 
			
		||||
 * @returns true if the object is a promise, otherwise false.
 | 
			
		||||
 */
 | 
			
		||||
export function isPromise(promise: any): boolean;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
export namespace ts {
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Defines a type that can must be one of T or U but not both.
 | 
			
		||||
     */
 | 
			
		||||
    type XOR<T, U> = (T | U) extends object ? (internals.Without<T, U> & U) | (internals.Without<U, T> & T) : T | U;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
declare namespace internals {
 | 
			
		||||
 | 
			
		||||
    type Without<T, U> = { [P in Exclude<keyof T, keyof U>]?: never };
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										45
									
								
								qwen/nodejs/node_modules/@hapi/hoek/lib/index.js
									
									
									
										generated
									
									
										vendored
									
									
										Executable file
									
								
							
							
						
						
									
										45
									
								
								qwen/nodejs/node_modules/@hapi/hoek/lib/index.js
									
									
									
										generated
									
									
										vendored
									
									
										Executable file
									
								
							@@ -0,0 +1,45 @@
 | 
			
		||||
'use strict';
 | 
			
		||||
 | 
			
		||||
exports.applyToDefaults = require('./applyToDefaults');
 | 
			
		||||
 | 
			
		||||
exports.assert = require('./assert');
 | 
			
		||||
 | 
			
		||||
exports.Bench = require('./bench');
 | 
			
		||||
 | 
			
		||||
exports.block = require('./block');
 | 
			
		||||
 | 
			
		||||
exports.clone = require('./clone');
 | 
			
		||||
 | 
			
		||||
exports.contain = require('./contain');
 | 
			
		||||
 | 
			
		||||
exports.deepEqual = require('./deepEqual');
 | 
			
		||||
 | 
			
		||||
exports.Error = require('./error');
 | 
			
		||||
 | 
			
		||||
exports.escapeHeaderAttribute = require('./escapeHeaderAttribute');
 | 
			
		||||
 | 
			
		||||
exports.escapeHtml = require('./escapeHtml');
 | 
			
		||||
 | 
			
		||||
exports.escapeJson = require('./escapeJson');
 | 
			
		||||
 | 
			
		||||
exports.escapeRegex = require('./escapeRegex');
 | 
			
		||||
 | 
			
		||||
exports.flatten = require('./flatten');
 | 
			
		||||
 | 
			
		||||
exports.ignore = require('./ignore');
 | 
			
		||||
 | 
			
		||||
exports.intersect = require('./intersect');
 | 
			
		||||
 | 
			
		||||
exports.isPromise = require('./isPromise');
 | 
			
		||||
 | 
			
		||||
exports.merge = require('./merge');
 | 
			
		||||
 | 
			
		||||
exports.once = require('./once');
 | 
			
		||||
 | 
			
		||||
exports.reach = require('./reach');
 | 
			
		||||
 | 
			
		||||
exports.reachTemplate = require('./reachTemplate');
 | 
			
		||||
 | 
			
		||||
exports.stringify = require('./stringify');
 | 
			
		||||
 | 
			
		||||
exports.wait = require('./wait');
 | 
			
		||||
							
								
								
									
										41
									
								
								qwen/nodejs/node_modules/@hapi/hoek/lib/intersect.js
									
									
									
										generated
									
									
										vendored
									
									
										Executable file
									
								
							
							
						
						
									
										41
									
								
								qwen/nodejs/node_modules/@hapi/hoek/lib/intersect.js
									
									
									
										generated
									
									
										vendored
									
									
										Executable file
									
								
							@@ -0,0 +1,41 @@
 | 
			
		||||
'use strict';
 | 
			
		||||
 | 
			
		||||
const internals = {};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
module.exports = function (array1, array2, options = {}) {
 | 
			
		||||
 | 
			
		||||
    if (!array1 ||
 | 
			
		||||
        !array2) {
 | 
			
		||||
 | 
			
		||||
        return (options.first ? null : []);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    const common = [];
 | 
			
		||||
    const hash = (Array.isArray(array1) ? new Set(array1) : array1);
 | 
			
		||||
    const found = new Set();
 | 
			
		||||
    for (const value of array2) {
 | 
			
		||||
        if (internals.has(hash, value) &&
 | 
			
		||||
            !found.has(value)) {
 | 
			
		||||
 | 
			
		||||
            if (options.first) {
 | 
			
		||||
                return value;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            common.push(value);
 | 
			
		||||
            found.add(value);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return (options.first ? null : common);
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
internals.has = function (ref, key) {
 | 
			
		||||
 | 
			
		||||
    if (typeof ref.has === 'function') {
 | 
			
		||||
        return ref.has(key);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return ref[key] !== undefined;
 | 
			
		||||
};
 | 
			
		||||
							
								
								
									
										9
									
								
								qwen/nodejs/node_modules/@hapi/hoek/lib/isPromise.js
									
									
									
										generated
									
									
										vendored
									
									
										Executable file
									
								
							
							
						
						
									
										9
									
								
								qwen/nodejs/node_modules/@hapi/hoek/lib/isPromise.js
									
									
									
										generated
									
									
										vendored
									
									
										Executable file
									
								
							@@ -0,0 +1,9 @@
 | 
			
		||||
'use strict';
 | 
			
		||||
 | 
			
		||||
const internals = {};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
module.exports = function (promise) {
 | 
			
		||||
 | 
			
		||||
    return !!promise && typeof promise.then === 'function';
 | 
			
		||||
};
 | 
			
		||||
							
								
								
									
										78
									
								
								qwen/nodejs/node_modules/@hapi/hoek/lib/merge.js
									
									
									
										generated
									
									
										vendored
									
									
										Executable file
									
								
							
							
						
						
									
										78
									
								
								qwen/nodejs/node_modules/@hapi/hoek/lib/merge.js
									
									
									
										generated
									
									
										vendored
									
									
										Executable file
									
								
							@@ -0,0 +1,78 @@
 | 
			
		||||
'use strict';
 | 
			
		||||
 | 
			
		||||
const Assert = require('./assert');
 | 
			
		||||
const Clone = require('./clone');
 | 
			
		||||
const Utils = require('./utils');
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
const internals = {};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
module.exports = internals.merge = function (target, source, options) {
 | 
			
		||||
 | 
			
		||||
    Assert(target && typeof target === 'object', 'Invalid target value: must be an object');
 | 
			
		||||
    Assert(source === null || source === undefined || typeof source === 'object', 'Invalid source value: must be null, undefined, or an object');
 | 
			
		||||
 | 
			
		||||
    if (!source) {
 | 
			
		||||
        return target;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    options = Object.assign({ nullOverride: true, mergeArrays: true }, options);
 | 
			
		||||
 | 
			
		||||
    if (Array.isArray(source)) {
 | 
			
		||||
        Assert(Array.isArray(target), 'Cannot merge array onto an object');
 | 
			
		||||
        if (!options.mergeArrays) {
 | 
			
		||||
            target.length = 0;                                                          // Must not change target assignment
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        for (let i = 0; i < source.length; ++i) {
 | 
			
		||||
            target.push(Clone(source[i], { symbols: options.symbols }));
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return target;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    const keys = Utils.keys(source, options);
 | 
			
		||||
    for (let i = 0; i < keys.length; ++i) {
 | 
			
		||||
        const key = keys[i];
 | 
			
		||||
        if (key === '__proto__' ||
 | 
			
		||||
            !Object.prototype.propertyIsEnumerable.call(source, key)) {
 | 
			
		||||
 | 
			
		||||
            continue;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        const value = source[key];
 | 
			
		||||
        if (value &&
 | 
			
		||||
            typeof value === 'object') {
 | 
			
		||||
 | 
			
		||||
            if (target[key] === value) {
 | 
			
		||||
                continue;                                           // Can occur for shallow merges
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            if (!target[key] ||
 | 
			
		||||
                typeof target[key] !== 'object' ||
 | 
			
		||||
                (Array.isArray(target[key]) !== Array.isArray(value)) ||
 | 
			
		||||
                value instanceof Date ||
 | 
			
		||||
                (Buffer && Buffer.isBuffer(value)) ||               // $lab:coverage:ignore$
 | 
			
		||||
                value instanceof RegExp) {
 | 
			
		||||
 | 
			
		||||
                target[key] = Clone(value, { symbols: options.symbols });
 | 
			
		||||
            }
 | 
			
		||||
            else {
 | 
			
		||||
                internals.merge(target[key], value, options);
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        else {
 | 
			
		||||
            if (value !== null &&
 | 
			
		||||
                value !== undefined) {                              // Explicit to preserve empty strings
 | 
			
		||||
 | 
			
		||||
                target[key] = value;
 | 
			
		||||
            }
 | 
			
		||||
            else if (options.nullOverride) {
 | 
			
		||||
                target[key] = value;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return target;
 | 
			
		||||
};
 | 
			
		||||
							
								
								
									
										25
									
								
								qwen/nodejs/node_modules/@hapi/hoek/lib/once.js
									
									
									
										generated
									
									
										vendored
									
									
										Executable file
									
								
							
							
						
						
									
										25
									
								
								qwen/nodejs/node_modules/@hapi/hoek/lib/once.js
									
									
									
										generated
									
									
										vendored
									
									
										Executable file
									
								
							@@ -0,0 +1,25 @@
 | 
			
		||||
'use strict';
 | 
			
		||||
 | 
			
		||||
const internals = {
 | 
			
		||||
    wrapped: Symbol('wrapped')
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
module.exports = function (method) {
 | 
			
		||||
 | 
			
		||||
    if (method[internals.wrapped]) {
 | 
			
		||||
        return method;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    let once = false;
 | 
			
		||||
    const wrappedFn = function (...args) {
 | 
			
		||||
 | 
			
		||||
        if (!once) {
 | 
			
		||||
            once = true;
 | 
			
		||||
            method(...args);
 | 
			
		||||
        }
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    wrappedFn[internals.wrapped] = true;
 | 
			
		||||
    return wrappedFn;
 | 
			
		||||
};
 | 
			
		||||
							
								
								
									
										76
									
								
								qwen/nodejs/node_modules/@hapi/hoek/lib/reach.js
									
									
									
										generated
									
									
										vendored
									
									
										Executable file
									
								
							
							
						
						
									
										76
									
								
								qwen/nodejs/node_modules/@hapi/hoek/lib/reach.js
									
									
									
										generated
									
									
										vendored
									
									
										Executable file
									
								
							@@ -0,0 +1,76 @@
 | 
			
		||||
'use strict';
 | 
			
		||||
 | 
			
		||||
const Assert = require('./assert');
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
const internals = {};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
module.exports = function (obj, chain, options) {
 | 
			
		||||
 | 
			
		||||
    if (chain === false ||
 | 
			
		||||
        chain === null ||
 | 
			
		||||
        chain === undefined) {
 | 
			
		||||
 | 
			
		||||
        return obj;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    options = options || {};
 | 
			
		||||
    if (typeof options === 'string') {
 | 
			
		||||
        options = { separator: options };
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    const isChainArray = Array.isArray(chain);
 | 
			
		||||
 | 
			
		||||
    Assert(!isChainArray || !options.separator, 'Separator option is not valid for array-based chain');
 | 
			
		||||
 | 
			
		||||
    const path = isChainArray ? chain : chain.split(options.separator || '.');
 | 
			
		||||
    let ref = obj;
 | 
			
		||||
    for (let i = 0; i < path.length; ++i) {
 | 
			
		||||
        let key = path[i];
 | 
			
		||||
        const type = options.iterables && internals.iterables(ref);
 | 
			
		||||
 | 
			
		||||
        if (Array.isArray(ref) ||
 | 
			
		||||
            type === 'set') {
 | 
			
		||||
 | 
			
		||||
            const number = Number(key);
 | 
			
		||||
            if (Number.isInteger(number)) {
 | 
			
		||||
                key = number < 0 ? ref.length + number : number;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (!ref ||
 | 
			
		||||
            typeof ref === 'function' && options.functions === false ||         // Defaults to true
 | 
			
		||||
            !type && ref[key] === undefined) {
 | 
			
		||||
 | 
			
		||||
            Assert(!options.strict || i + 1 === path.length, 'Missing segment', key, 'in reach path ', chain);
 | 
			
		||||
            Assert(typeof ref === 'object' || options.functions === true || typeof ref !== 'function', 'Invalid segment', key, 'in reach path ', chain);
 | 
			
		||||
            ref = options.default;
 | 
			
		||||
            break;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (!type) {
 | 
			
		||||
            ref = ref[key];
 | 
			
		||||
        }
 | 
			
		||||
        else if (type === 'set') {
 | 
			
		||||
            ref = [...ref][key];
 | 
			
		||||
        }
 | 
			
		||||
        else {  // type === 'map'
 | 
			
		||||
            ref = ref.get(key);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return ref;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
internals.iterables = function (ref) {
 | 
			
		||||
 | 
			
		||||
    if (ref instanceof Set) {
 | 
			
		||||
        return 'set';
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (ref instanceof Map) {
 | 
			
		||||
        return 'map';
 | 
			
		||||
    }
 | 
			
		||||
};
 | 
			
		||||
							
								
								
									
										16
									
								
								qwen/nodejs/node_modules/@hapi/hoek/lib/reachTemplate.js
									
									
									
										generated
									
									
										vendored
									
									
										Executable file
									
								
							
							
						
						
									
										16
									
								
								qwen/nodejs/node_modules/@hapi/hoek/lib/reachTemplate.js
									
									
									
										generated
									
									
										vendored
									
									
										Executable file
									
								
							@@ -0,0 +1,16 @@
 | 
			
		||||
'use strict';
 | 
			
		||||
 | 
			
		||||
const Reach = require('./reach');
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
const internals = {};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
module.exports = function (obj, template, options) {
 | 
			
		||||
 | 
			
		||||
    return template.replace(/{([^{}]+)}/g, ($0, chain) => {
 | 
			
		||||
 | 
			
		||||
        const value = Reach(obj, chain, options);
 | 
			
		||||
        return (value === undefined || value === null ? '' : value);
 | 
			
		||||
    });
 | 
			
		||||
};
 | 
			
		||||
							
								
								
									
										14
									
								
								qwen/nodejs/node_modules/@hapi/hoek/lib/stringify.js
									
									
									
										generated
									
									
										vendored
									
									
										Executable file
									
								
							
							
						
						
									
										14
									
								
								qwen/nodejs/node_modules/@hapi/hoek/lib/stringify.js
									
									
									
										generated
									
									
										vendored
									
									
										Executable file
									
								
							@@ -0,0 +1,14 @@
 | 
			
		||||
'use strict';
 | 
			
		||||
 | 
			
		||||
const internals = {};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
module.exports = function (...args) {
 | 
			
		||||
 | 
			
		||||
    try {
 | 
			
		||||
        return JSON.stringify(...args);
 | 
			
		||||
    }
 | 
			
		||||
    catch (err) {
 | 
			
		||||
        return '[Cannot display object: ' + err.message + ']';
 | 
			
		||||
    }
 | 
			
		||||
};
 | 
			
		||||
							
								
								
									
										55
									
								
								qwen/nodejs/node_modules/@hapi/hoek/lib/types.js
									
									
									
										generated
									
									
										vendored
									
									
										Executable file
									
								
							
							
						
						
									
										55
									
								
								qwen/nodejs/node_modules/@hapi/hoek/lib/types.js
									
									
									
										generated
									
									
										vendored
									
									
										Executable file
									
								
							@@ -0,0 +1,55 @@
 | 
			
		||||
'use strict';
 | 
			
		||||
 | 
			
		||||
const internals = {};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
exports = module.exports = {
 | 
			
		||||
    array: Array.prototype,
 | 
			
		||||
    buffer: Buffer && Buffer.prototype,             // $lab:coverage:ignore$
 | 
			
		||||
    date: Date.prototype,
 | 
			
		||||
    error: Error.prototype,
 | 
			
		||||
    generic: Object.prototype,
 | 
			
		||||
    map: Map.prototype,
 | 
			
		||||
    promise: Promise.prototype,
 | 
			
		||||
    regex: RegExp.prototype,
 | 
			
		||||
    set: Set.prototype,
 | 
			
		||||
    weakMap: WeakMap.prototype,
 | 
			
		||||
    weakSet: WeakSet.prototype
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
internals.typeMap = new Map([
 | 
			
		||||
    ['[object Error]', exports.error],
 | 
			
		||||
    ['[object Map]', exports.map],
 | 
			
		||||
    ['[object Promise]', exports.promise],
 | 
			
		||||
    ['[object Set]', exports.set],
 | 
			
		||||
    ['[object WeakMap]', exports.weakMap],
 | 
			
		||||
    ['[object WeakSet]', exports.weakSet]
 | 
			
		||||
]);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
exports.getInternalProto = function (obj) {
 | 
			
		||||
 | 
			
		||||
    if (Array.isArray(obj)) {
 | 
			
		||||
        return exports.array;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (Buffer && obj instanceof Buffer) {          // $lab:coverage:ignore$
 | 
			
		||||
        return exports.buffer;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (obj instanceof Date) {
 | 
			
		||||
        return exports.date;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (obj instanceof RegExp) {
 | 
			
		||||
        return exports.regex;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (obj instanceof Error) {
 | 
			
		||||
        return exports.error;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    const objName = Object.prototype.toString.call(obj);
 | 
			
		||||
    return internals.typeMap.get(objName) || exports.generic;
 | 
			
		||||
};
 | 
			
		||||
							
								
								
									
										9
									
								
								qwen/nodejs/node_modules/@hapi/hoek/lib/utils.js
									
									
									
										generated
									
									
										vendored
									
									
										Executable file
									
								
							
							
						
						
									
										9
									
								
								qwen/nodejs/node_modules/@hapi/hoek/lib/utils.js
									
									
									
										generated
									
									
										vendored
									
									
										Executable file
									
								
							@@ -0,0 +1,9 @@
 | 
			
		||||
'use strict';
 | 
			
		||||
 | 
			
		||||
const internals = {};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
exports.keys = function (obj, options = {}) {
 | 
			
		||||
 | 
			
		||||
    return options.symbols !== false ? Reflect.ownKeys(obj) : Object.getOwnPropertyNames(obj);  // Defaults to true
 | 
			
		||||
};
 | 
			
		||||
							
								
								
									
										37
									
								
								qwen/nodejs/node_modules/@hapi/hoek/lib/wait.js
									
									
									
										generated
									
									
										vendored
									
									
										Executable file
									
								
							
							
						
						
									
										37
									
								
								qwen/nodejs/node_modules/@hapi/hoek/lib/wait.js
									
									
									
										generated
									
									
										vendored
									
									
										Executable file
									
								
							@@ -0,0 +1,37 @@
 | 
			
		||||
'use strict';
 | 
			
		||||
 | 
			
		||||
const internals = {
 | 
			
		||||
    maxTimer: 2 ** 31 - 1              // ~25 days
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
module.exports = function (timeout, returnValue, options) {
 | 
			
		||||
 | 
			
		||||
    if (typeof timeout === 'bigint') {
 | 
			
		||||
        timeout = Number(timeout);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (timeout >= Number.MAX_SAFE_INTEGER) {         // Thousands of years
 | 
			
		||||
        timeout = Infinity;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (typeof timeout !== 'number' && timeout !== undefined) {
 | 
			
		||||
        throw new TypeError('Timeout must be a number or bigint');
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return new Promise((resolve) => {
 | 
			
		||||
 | 
			
		||||
        const _setTimeout = options ? options.setTimeout : setTimeout;
 | 
			
		||||
 | 
			
		||||
        const activate = () => {
 | 
			
		||||
 | 
			
		||||
            const time = Math.min(timeout, internals.maxTimer);
 | 
			
		||||
            timeout -= time;
 | 
			
		||||
            _setTimeout(() => (timeout > 0 ? activate() : resolve(returnValue)), time);
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        if (timeout !== Infinity) {
 | 
			
		||||
            activate();
 | 
			
		||||
        }
 | 
			
		||||
    });
 | 
			
		||||
};
 | 
			
		||||
		Reference in New Issue
	
	Block a user