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

@poppinss/utils

Package Overview
Dependencies
Maintainers
2
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 6.3.1-0 to 6.4.0-0

build/src/string_builder.d.ts

21

package.json
{
"name": "@poppinss/utils",
"version": "6.3.1-0",
"version": "6.4.0-0",
"description": "Handy utilities for repetitive work",

@@ -21,2 +21,3 @@ "main": "build/index.js",

"./string": "./build/src/string/main.js",
"./string_builder": "./build/src/string_builder.js",
"./json": "./build/src/json/main.js",

@@ -57,4 +58,4 @@ "./types": "./build/src/types.js"

"devDependencies": {
"@commitlint/cli": "^17.3.0",
"@commitlint/config-conventional": "^17.3.0",
"@commitlint/cli": "^17.4.2",
"@commitlint/config-conventional": "^17.4.2",
"@japa/assert": "^1.3.6",

@@ -65,9 +66,9 @@ "@japa/expect-type": "^1.0.2",

"@japa/spec-reporter": "^1.3.2",
"@swc/core": "^1.3.24",
"@types/fs-extra": "^9.0.13",
"@swc/core": "^1.3.27",
"@types/fs-extra": "^11.0.1",
"@types/node": "^18.11.18",
"c8": "^7.12.0",
"del-cli": "^5.0.0",
"eslint": "^8.30.0",
"eslint-config-prettier": "^8.5.0",
"eslint": "^8.32.0",
"eslint-config-prettier": "^8.6.0",
"eslint-plugin-adonis": "^3.0.3",

@@ -77,3 +78,3 @@ "eslint-plugin-prettier": "^4.2.1",

"github-label-sync": "^2.2.0",
"husky": "^8.0.1",
"husky": "^8.0.3",
"lodash": "^4.17.21",

@@ -83,3 +84,3 @@ "lodash-cli": "^4.17.5",

"np": "^7.6.3",
"prettier": "^2.8.1",
"prettier": "^2.8.3",
"ts-node": "^10.9.1",

@@ -97,3 +98,3 @@ "typescript": "^4.9.4"

"safe-stable-stringify": "^2.4.2",
"secure-json-parse": "^2.6.0",
"secure-json-parse": "^2.7.0",
"slash": "^5.0.0",

@@ -100,0 +101,0 @@ "slugify": "^1.6.5",

@@ -559,2 +559,13 @@ # @poppinss/utils

### String builder
The string builder offers a fluent API for applying a set of transforms on a string value. You can create an instance of the string builder as follows.
```ts
import StringBuilder from '@poppinss/utils/string_builder'
const builder = new StringBuilder('hello world')
const value = builder.snakeCase().suffix('_controller').toString()
assert(value === 'hello_world_controller')
```
### JSON helpers

@@ -776,2 +787,3 @@

#### Anonymous error classes
You can also create an anonymous exception class using the `createError` method. The return value is a class

@@ -784,3 +796,6 @@ constructor that accepts an array of values to use for interpolation.

import { createError } from '@poppinss/utils'
const E_RESOURCE_NOT_FOUND = createError('Unable to find resource with id %d', 'E_RESOURCE_NOT_FOUND')
const E_RESOURCE_NOT_FOUND = createError(
'Unable to find resource with id %d',
'E_RESOURCE_NOT_FOUND'
)

@@ -1045,5 +1060,3 @@ const id = 1

const plainObject = builder
.add('b', b)
.toObject()
const plainObject = builder.add('b', b).toObject()
```

@@ -1050,0 +1063,0 @@

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