Giter VIP home page Giter VIP logo

cookies's People

Contributors

jmcdo29 avatar johnbiundo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

cookies's Issues

Installation of this module breaks project tests

● Test suite failed to run

    Jest encountered an unexpected token

    This usually means that you are trying to import a file which Jest cannot parse, e.g. it's not plain JavaScript.

    By default, if Jest sees a Babel config, it will use that to transform your files, ignoring "node_modules".

    Here's what you can do:
     • To have some of your "node_modules" files transformed, you can specify a custom "transformIgnorePatterns" in your config.
     • If you need a custom transformation specify a "transform" option in your config.
     • If you simply want to mock your non-JS modules (e.g. binary assets) you can stub them out with the "moduleNameMapper" config option.

    You'll find more details and examples of these config options in the docs:
    https://jestjs.io/docs/en/configuration.html

    Details:

    /home/███/WebstormProjects/█████/node_modules/@nestjsplus/cookies/index.ts:1
    export * from './dist';
    ^^^^^^

    SyntaxError: Unexpected token 'export'
        at compileFunction (<anonymous>)

      39 | import { AuthService } from '../../auth/auth.service';
      40 | import { AllowedRoles } from '../../auth/decorators/roles.decorator';
    > 41 | import { Cookies } from '@nestjsplus/cookies';
         | ^
      42 | import { IpAddress } from '../../../utils/ip-address.decorator';
      43 | import * as express from 'express';
      44 | 

      at Runtime._execModule (../../../node_modules/@jest/core/node_modules/jest-runtime/build/index.js:988:58)
      at Object.<anonymous> (../src/application/api/controllers/auth.controller.ts:41:1)

As a hotfix for those, who has same issue: just replace import to absolute, for example:

import { Cookies } from '@nestjsplus/cookies/dist/decorators/get-cookies.decorator';

Import is not correct in documentation.

I wasn't able to get this import statement working: import { Cookies } from '@nestjsplus/cookies'

It does work with: import { Cookies } from '@nestjsplus/cookies/dist/decorators/get-cookies.decorator';

Not sure if this was intentional but probably worth updating in the docs unless there is some additional importing required by nest.

Use RxJS instead of promises

Any chance you'd mind if I make a PR to switch the interceptor to using RxJS methods instead of switching the Observable to a promise?

Upgrading to 1.1.x causes a crash at runtime

Error: Cannot find module '@nestjs/graphql'
Require stack:
- /home/tristan957/Projects/myma-store/server/node_modules/@nestjsplus/cookies/dist/interceptors/clear-cookies.interceptor.js
- /home/tristan957/Projects/myma-store/server/node_modules/@nestjsplus/cookies/dist/decorators/clear-cookies.decorator.js
- /home/tristan957/Projects/myma-store/server/node_modules/@nestjsplus/cookies/dist/decorators/index.js
- /home/tristan957/Projects/myma-store/server/node_modules/@nestjsplus/cookies/dist/index.js
- /home/tristan957/Projects/myma-store/server/node_modules/@nestjsplus/cookies/index.js
- /home/tristan957/Projects/myma-store/server/src/authentication/authentication.controller.ts
- /home/tristan957/Projects/myma-store/server/src/authentication/authentication.module.ts
- /home/tristan957/Projects/myma-store/server/src/app.module.ts
- /home/tristan957/Projects/myma-store/server/src/index.ts
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:982:15)
    at Function.Module._load (internal/modules/cjs/loader.js:864:27)
    at Module.require (internal/modules/cjs/loader.js:1044:19)
    at require (internal/modules/cjs/helpers.js:77:18)
    at Object.<anonymous> (/home/tristan957/Projects/myma-store/server/node_modules/@nestjsplus/cookies/dist/interceptors/clear-cookies.interceptor.js:11:19)
    at Module._compile (internal/modules/cjs/loader.js:1158:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
    at Module.load (internal/modules/cjs/loader.js:1002:32)
    at Function.Module._load (internal/modules/cjs/loader.js:901:14)
    at Module.require (internal/modules/cjs/loader.js:1044:19)

Looks like the dependency on the graphql package somehow bubbled up even when I am not using graphql in my project. I checked the package.json but I didn't see why this would happen.

Wrong type in ClearCookies parameter

export declare function ClearCookies(...cookies: string[] | undefined): (target: any, propertyKey: any, descriptor: any) => void;
 error TS2370: A rest parameter must be of an array type.

...cookies (rest parameter) can not be undefined.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.