How to use the iterare.default function in iterare

To help you get started, we’ve selected a few iterare examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nestjs / nest / lib / websockets / middlewares-injector.js View on Github external
applyMiddlewares(server, components, tokens) {
        const adapter = this.config.getIoAdapter();
        iterare_1.default(tokens)
            .map(token => this.bindMiddleware(token.name, components))
            .filter(middleware => !shared_utils_1.isNil(middleware))
            .forEach(middleware => adapter.bindMiddleware(server, middleware));
    }
    bindMiddleware(token, components) {
github nestjs / nest / lib / core / metadata-scanner.js View on Github external
scanFromPrototype(instance, prototype, callback) {
        return iterare_1.default([...this.getAllFilteredMethodNames(prototype)])
            .map(callback)
            .filter(metadata => !shared_utils_1.isNil(metadata))
            .toArray();
    }
    *getAllFilteredMethodNames(prototype) {
github nestjs / nest / lib / microservices / nest-microservice.js View on Github external
callModuleDestroyHook(module) {
        const components = [...module.routes, ...module.components];
        iterare_1.default(components)
            .map(([key, { instance }]) => instance)
            .filter(instance => !shared_utils_1.isNil(instance))
            .filter(this.hasOnModuleDestroyHook)
            .forEach(instance => instance.onModuleDestroy());
    }
    hasOnModuleDestroyHook(instance) {
github nestjs / nest / lib / core / guards / guards-context-creator.js View on Github external
createGlobalMetadataContext(metadata) {
        return iterare_1.default(metadata)
            .filter(guard => guard && guard.canActivate && shared_utils_1.isFunction(guard.canActivate))
            .toArray();
    }
    getInstanceByMetatype(metatype) {
github nestjs / nest / lib / core / interceptors / interceptors-context-creator.js View on Github external
createConcreteContext(metadata) {
        if (shared_utils_1.isUndefined(metadata) || shared_utils_1.isEmpty(metadata) || !this.moduleContext) {
            return [];
        }
        const isGlobalMetadata = metadata === this.getGlobalMetadata();
        return isGlobalMetadata
            ? this.createGlobalMetadataContext(metadata)
            : iterare_1.default(metadata)
                .filter((metatype) => metatype && metatype.name)
                .map(metatype => this.getInstanceByMetatype(metatype))
                .filter((wrapper) => wrapper && wrapper.instance)
                .map(wrapper => wrapper.instance)
                .filter((interceptor) => interceptor && shared_utils_1.isFunction(interceptor.intercept))
                .toArray();
    }
    createGlobalMetadataContext(metadata) {
github nestjs / nest / bundle / core / interceptors / interceptors-context-creator.js View on Github external
createConcreteContext(metadata) {
        if (shared_utils_1.isUndefined(metadata) || shared_utils_1.isEmpty(metadata)) {
            return [];
        }
        return iterare_1.default(metadata)
            .filter((interceptor) => interceptor && (interceptor.name || interceptor.intercept))
            .map(interceptor => this.getInterceptorInstance(interceptor))
            .filter((interceptor) => interceptor && shared_utils_1.isFunction(interceptor.intercept))
            .toArray();
    }
    getInterceptorInstance(interceptor) {
github nestjs / nest / bundle / core / guards / guards-context-creator.js View on Github external
createConcreteContext(metadata) {
        if (shared_utils_1.isUndefined(metadata) || shared_utils_1.isEmpty(metadata)) {
            return [];
        }
        return iterare_1.default(metadata)
            .filter((guard) => guard && (guard.name || guard.canActivate))
            .map(guard => this.getGuardInstance(guard))
            .filter((guard) => guard && shared_utils_1.isFunction(guard.canActivate))
            .toArray();
    }
    getGuardInstance(guard) {
github nestjs / nest / lib / core / interceptors / interceptors-context-creator.js View on Github external
createGlobalMetadataContext(metadata) {
        return iterare_1.default(metadata)
            .filter(interceptor => interceptor &&
            interceptor.intercept &&
            shared_utils_1.isFunction(interceptor.intercept))
            .toArray();
    }
    getInstanceByMetatype(metatype) {
github nestjs / nest / lib / core / pipes / pipes-context-creator.js View on Github external
createConcreteContext(metadata) {
        if (shared_utils_1.isUndefined(metadata) || shared_utils_1.isEmpty(metadata)) {
            return [];
        }
        return iterare_1.default(metadata)
            .filter(pipe => pipe && pipe.transform && shared_utils_1.isFunction(pipe.transform))
            .map(pipe => pipe.transform.bind(pipe))
            .toArray();
    }
    getGlobalMetadata() {
github notadd / next / packages / core / notadd-application.js View on Github external
callModuleDestroyHook(module) {
        const components = [...module.routes, ...module.components];
        iterare_1.default(components)
            .map(([key, { instance }]) => instance)
            .filter(instance => !shared_utils_1.isNil(instance))
            .filter(this.hasOnModuleDestroyHook)
            .forEach(instance => instance.onModuleDestroy());
    }
    hasOnModuleDestroyHook(instance) {

iterare

Array methods for ES6 Iterators

ISC
Latest version published 5 years ago

Package Health Score

67 / 100
Full package analysis

Popular iterare functions