Socket
Socket
Sign inDemoInstall

@poppinss/utils

Package Overview
Dependencies
Maintainers
1
Versions
89
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@poppinss/utils - npm Package Compare versions

Comparing version 2.2.7 to 2.2.8

14

build/index.js
"use strict";
/*
* @poppinss/utils
*
* (c) Harminder Virk <virk@adonisjs.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
* @poppinss/utils
*
* (c) Harminder Virk <virk@adonisjs.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {

@@ -11,0 +11,0 @@ if (k2 === undefined) k2 = k;

"use strict";
/*
* @poppinss/utils
*
* (c) Harminder Virk <virk@adonisjs.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
* @poppinss/utils
*
* (c) Harminder Virk <virk@adonisjs.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
Object.defineProperty(exports, "__esModule", { value: true });

@@ -18,3 +18,3 @@ exports.base64 = void 0;

encode(data, encoding) {
if (typeof (data) === 'string') {
if (typeof data === 'string') {
return Buffer.from(data, encoding).toString('base64');

@@ -35,3 +35,3 @@ }

urlEncode(data, encoding) {
const encoded = typeof (data) === 'string' ? this.encode(data, encoding) : this.encode(data);
const encoded = typeof data === 'string' ? this.encode(data, encoding) : this.encode(data);
return encoded.replace(/\+/g, '-').replace(/\//g, '_').replace(/\=/g, '');

@@ -38,0 +38,0 @@ }

@@ -8,9 +8,9 @@ "use strict";

/*
* @poppinss/utils
*
* (c) Harminder Virk <virk@adonisjs.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
* @poppinss/utils
*
* (c) Harminder Virk <virk@adonisjs.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
const esmResolver_1 = require("./esmResolver");

@@ -17,0 +17,0 @@ /**

@@ -8,9 +8,9 @@ "use strict";

/*
* @poppinss/utils
*
* (c) Harminder Virk <virk@adonisjs.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
* @poppinss/utils
*
* (c) Harminder Virk <virk@adonisjs.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
function esmResolver(output) {

@@ -17,0 +17,0 @@ return output && output.__esModule && output.default ? output.default : output;

@@ -16,2 +16,3 @@ /**

message: string;
description?: string;
code?: string;

@@ -18,0 +19,0 @@ status: number;

@@ -8,9 +8,9 @@ "use strict";

/*
* @poppinss/utils
*
* (c) Harminder Virk <virk@adonisjs.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
* @poppinss/utils
*
* (c) Harminder Virk <virk@adonisjs.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/**

@@ -17,0 +17,0 @@ * Extended Error object with the option to set error `status` and `code`.

"use strict";
/*
* @poppinss/utils
*
* (c) Harminder Virk <virk@adonisjs.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
* @poppinss/utils
*
* (c) Harminder Virk <virk@adonisjs.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
var __importDefault = (this && this.__importDefault) || function (mod) {

@@ -21,4 +21,4 @@ return (mod && mod.__esModule) ? mod : { "default": mod };

function fsReadAll(location, callback) {
return fs_readdir_recursive_1.default(location).filter(typeof (callback) === 'function' ? callback : isScriptFile_1.isScriptFile);
return fs_readdir_recursive_1.default(location).filter(typeof callback === 'function' ? callback : isScriptFile_1.isScriptFile);
}
exports.fsReadAll = fsReadAll;
"use strict";
/*
* @poppinss/utils
*
* (c) Harminder Virk <virk@adonisjs.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
* @poppinss/utils
*
* (c) Harminder Virk <virk@adonisjs.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
Object.defineProperty(exports, "__esModule", { value: true });

@@ -11,0 +11,0 @@ exports.isScriptFile = void 0;

"use strict";
/*
* @poppinss/utils
*
* (c) Harminder Virk <virk@adonisjs.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
* @poppinss/utils
*
* (c) Harminder Virk <virk@adonisjs.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
Object.defineProperty(exports, "__esModule", { value: true });

@@ -11,0 +11,0 @@ exports.ManagerConfigValidator = void 0;

"use strict";
/*
* @adonisjs/encryption
*
* (c) Harminder Virk <virk@adonisjs.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
* @adonisjs/encryption
*
* (c) Harminder Virk <virk@adonisjs.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
var __importDefault = (this && this.__importDefault) || function (mod) {

@@ -16,3 +16,3 @@ return (mod && mod.__esModule) ? mod : { "default": mod };

const ms_1 = __importDefault(require("ms"));
const bourne_1 = __importDefault(require("@hapi/bourne"));
const destr_1 = __importDefault(require("destr"));
/**

@@ -36,3 +36,3 @@ * Message builder exposes an API to JSON.stringify values by encoding purpose

}
const expiryMs = typeof (expiresIn) === 'string' ? ms_1.default(expiresIn) : expiresIn;
const expiryMs = typeof expiresIn === 'string' ? ms_1.default(expiresIn) : expiresIn;
if (expiryMs === undefined || expiryMs === null) {

@@ -70,5 +70,3 @@ throw new Error(`Invalid value for expiresIn "${expiresIn}"`);

try {
const parsed = bourne_1.default.parse(message, {
protoAction: 'remove',
});
const parsed = destr_1.default(message);
if (!parsed.message) {

@@ -75,0 +73,0 @@ return null;

"use strict";
/*
* @poppinss/utils
*
* (c) Harminder Virk <virk@adonisjs.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
* @poppinss/utils
*
* (c) Harminder Virk <virk@adonisjs.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
Object.defineProperty(exports, "__esModule", { value: true });

@@ -11,0 +11,0 @@ exports.randomString = void 0;

@@ -11,9 +11,9 @@ "use strict";

/*
* @poppinss/utils
*
* (c) Harminder Virk <virk@adonisjs.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
* @poppinss/utils
*
* (c) Harminder Virk <virk@adonisjs.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
const path_1 = require("path");

@@ -20,0 +20,0 @@ const require_all_1 = __importDefault(require("require-all"));

@@ -9,3 +9,3 @@ "use strict";

* file that was distributed with this source code.
*/
*/
var __importDefault = (this && this.__importDefault) || function (mod) {

@@ -12,0 +12,0 @@ return (mod && mod.__esModule) ? mod : { "default": mod };

"use strict";
/*
* @poppinss/utils
*
* (c) Harminder Virk <virk@adonisjs.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
* @poppinss/utils
*
* (c) Harminder Virk <virk@adonisjs.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
var __importDefault = (this && this.__importDefault) || function (mod) {

@@ -15,4 +15,4 @@ return (mod && mod.__esModule) ? mod : { "default": mod };

exports.safeEqual = void 0;
const buffer_alloc_1 = __importDefault(require("buffer-alloc"));
const crypto_1 = require("crypto");
const buffer_alloc_1 = __importDefault(require("buffer-alloc"));
/**

@@ -22,3 +22,3 @@ * Generates a random string for a given size

function safeEqual(value, comparisonValue) {
if (typeof (value) === 'string' && typeof (comparisonValue) === 'string') {
if (typeof value === 'string' && typeof comparisonValue === 'string') {
/**

@@ -42,4 +42,3 @@ * The length of the main value to ensure that we compare equal strings

*/
return crypto_1.timingSafeEqual(valueBuffer, comparisonValueBuffer)
&& expectedLength === Buffer.byteLength(comparisonValue);
return crypto_1.timingSafeEqual(valueBuffer, comparisonValueBuffer) && expectedLength === Buffer.byteLength(comparisonValue);
}

@@ -46,0 +45,0 @@ return crypto_1.timingSafeEqual(Buffer.from(value), Buffer.from(comparisonValue));

{
"name": "@poppinss/utils",
"version": "2.2.7",
"description": "Handy utilities for repetitive work",
"main": "build/index.js",
"files": [
"build/src",
"build/index.d.ts",
"build/index.js"
],
"scripts": {
"mrm": "mrm --preset=@adonisjs/mrm-preset",
"pretest": "npm run lint",
"test": "node japaFile.js",
"lint": "eslint . --ext=.ts",
"clean": "del build",
"compile": "npm run lint && npm run clean && tsc",
"build:lodash": "lodash exports=node include=pick,omit,get,set,unset,mergeWith,merge,snakeCase,camelCase,startCase -o build/src/lodash/index.js --production",
"build": "npm run compile && npm run build:lodash",
"commit": "git-cz",
"release": "np",
"version": "npm run build"
},
"keywords": [
"utils"
],
"author": "virk,poppinss",
"license": "MIT",
"devDependencies": {
"@adonisjs/mrm-preset": "^2.3.0",
"@poppinss/dev-utils": "^1.0.6",
"@types/ms": "^0.7.31",
"@types/node": "^14.0.13",
"commitizen": "^4.1.2",
"cz-conventional-changelog": "^3.2.0",
"del-cli": "^3.0.1",
"doctoc": "^1.4.0",
"eslint": "^7.2.0",
"eslint-plugin-adonis": "^1.0.10",
"husky": "^4.2.5",
"japa": "^3.1.1",
"lodash-cli": "^4.17.5",
"mrm": "^2.3.1",
"np": "^6.2.4",
"ts-node": "^8.10.2",
"typescript": "^3.9.5"
},
"nyc": {
"exclude": [
"test"
],
"extension": [
".ts"
]
},
"husky": {
"hooks": {
"pre-commit": "doctoc README.md --title='## Table of contents' && git add README.md",
"commit-msg": "node ./node_modules/@adonisjs/mrm-preset/validateCommit/conventional/validate.js"
}
},
"config": {
"commitizen": {
"path": "cz-conventional-changelog"
}
},
"np": {
"contents": ".",
"anyBranch": false
},
"dependencies": {
"@hapi/bourne": "^2.0.0",
"buffer-alloc": "^1.2.0",
"fs-readdir-recursive": "^1.1.0",
"ms": "^2.1.2",
"require-all": "^3.0.0",
"resolve-from": "^5.0.0"
},
"directories": {
"doc": "docs",
"test": "test"
},
"repository": {
"type": "git",
"url": "git+https://github.com/poppinss/utils.git"
},
"bugs": {
"url": "https://github.com/poppinss/utils/issues"
},
"homepage": "https://github.com/poppinss/utils#readme"
"name": "@poppinss/utils",
"version": "2.2.8",
"description": "Handy utilities for repetitive work",
"main": "build/index.js",
"files": [
"build/src",
"build/index.d.ts",
"build/index.js"
],
"scripts": {
"mrm": "mrm --preset=@adonisjs/mrm-preset",
"pretest": "npm run lint",
"test": "node japaFile.js",
"lint": "eslint . --ext=.ts",
"clean": "del build",
"compile": "npm run lint && npm run clean && tsc",
"build:lodash": "lodash exports=node include=pick,omit,get,set,unset,mergeWith,merge,snakeCase,camelCase,startCase -o build/src/lodash/index.js --production",
"build": "npm run compile && npm run build:lodash",
"commit": "git-cz",
"release": "np",
"version": "npm run build",
"format": "prettier --write ."
},
"keywords": [
"utils"
],
"author": "virk,poppinss",
"license": "MIT",
"devDependencies": {
"@adonisjs/mrm-preset": "^2.3.6",
"@poppinss/dev-utils": "^1.0.6",
"@types/ms": "^0.7.31",
"@types/node": "^14.0.14",
"commitizen": "^4.1.2",
"cz-conventional-changelog": "^3.2.0",
"del-cli": "^3.0.1",
"doctoc": "^1.4.0",
"eslint": "^7.3.1",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-adonis": "^1.0.14",
"eslint-plugin-prettier": "^3.1.4",
"husky": "^4.2.5",
"japa": "^3.1.1",
"lodash-cli": "^4.17.5",
"mrm": "^2.3.3",
"np": "^6.2.5",
"npm-audit-html": "^1.4.1",
"prettier": "^2.0.5",
"ts-node": "^8.10.2",
"typescript": "^3.9.6"
},
"nyc": {
"exclude": [
"test"
],
"extension": [
".ts"
]
},
"husky": {
"hooks": {
"pre-commit": "doctoc README.md --title='## Table of contents' && git add README.md && npm audit --production --json | ./node_modules/.bin/npm-audit-html && git add npm-audit.html",
"commit-msg": "node ./node_modules/@adonisjs/mrm-preset/validateCommit/conventional/validate.js"
}
},
"config": {
"commitizen": {
"path": "cz-conventional-changelog"
}
},
"np": {
"contents": ".",
"anyBranch": false
},
"dependencies": {
"buffer-alloc": "^1.2.0",
"destr": "^1.0.0",
"fs-readdir-recursive": "^1.1.0",
"ms": "^2.1.2",
"require-all": "^3.0.0",
"resolve-from": "^5.0.0"
},
"directories": {
"doc": "docs",
"test": "test"
},
"repository": {
"type": "git",
"url": "git+https://github.com/poppinss/utils.git"
},
"bugs": {
"url": "https://github.com/poppinss/utils/issues"
},
"homepage": "https://github.com/poppinss/utils#readme"
}

@@ -29,2 +29,3 @@ # Utils

- [Message Builder](#message-builder)
- [Audit report](#audit-report)

@@ -257,2 +258,5 @@ <!-- END doctoc generated TOC please keep comment here to allow auto update -->

## Audit report
[Click here](https://htmlpreview.github.io/?https://github.com/poppinss/utils/blob/develop/npm-audit.html) to see the latest npm audit report.
[circleci-image]: https://img.shields.io/circleci/project/github/poppinss/utils/master.svg?style=for-the-badge&logo=circleci

@@ -259,0 +263,0 @@ [circleci-url]: https://circleci.com/gh/poppinss/utils "circleci"

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc