snake-case
Advanced tools
Comparing version 3.0.4 to 4.0.0
@@ -1,3 +0,3 @@ | ||
import { Options } from "dot-case"; | ||
export { Options }; | ||
import { Options } from "no-case"; | ||
export type { Options }; | ||
export declare function snakeCase(input: string, options?: Options): string; |
@@ -1,11 +0,6 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.snakeCase = void 0; | ||
var tslib_1 = require("tslib"); | ||
var dot_case_1 = require("dot-case"); | ||
function snakeCase(input, options) { | ||
if (options === void 0) { options = {}; } | ||
return dot_case_1.dotCase(input, tslib_1.__assign({ delimiter: "_" }, options)); | ||
import { split, toLower } from "no-case"; | ||
export function snakeCase(input, options) { | ||
const lower = toLower(options?.locale); | ||
return split(input, options).map(lower).join("_"); | ||
} | ||
exports.snakeCase = snakeCase; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "snake-case", | ||
"version": "3.0.4", | ||
"version": "4.0.0", | ||
"description": "Transform into a lower case string with underscores between words", | ||
"main": "dist/index.js", | ||
"typings": "dist/index.d.ts", | ||
"module": "dist.es2015/index.js", | ||
"sideEffects": false, | ||
"jsnext:main": "dist.es2015/index.js", | ||
"type": "module", | ||
"files": [ | ||
"dist/", | ||
"dist.es2015/", | ||
"LICENSE" | ||
"dist/" | ||
], | ||
"exports": { | ||
".": "./dist/index.js" | ||
}, | ||
"scripts": { | ||
"lint": "tslint \"src/**/*\" --project tsconfig.json", | ||
"build": "rimraf dist/ dist.es2015/ && tsc && tsc -P tsconfig.es2015.json", | ||
"specs": "jest --coverage", | ||
"test": "npm run build && npm run lint && npm run specs", | ||
"size": "size-limit", | ||
"prepare": "npm run build" | ||
"format": "ts-scripts format", | ||
"specs": "ts-scripts specs", | ||
"test": "ts-scripts test", | ||
"build": "ts-scripts build", | ||
"bench": "vitest bench", | ||
"prepublishOnly": "npm run build" | ||
}, | ||
@@ -47,25 +44,2 @@ "repository": { | ||
"homepage": "https://github.com/blakeembrey/change-case/tree/master/packages/snake-case#readme", | ||
"size-limit": [ | ||
{ | ||
"path": "dist/index.js", | ||
"limit": "400 B" | ||
} | ||
], | ||
"jest": { | ||
"roots": [ | ||
"<rootDir>/src/" | ||
], | ||
"transform": { | ||
"\\.tsx?$": "ts-jest" | ||
}, | ||
"testRegex": "(/__tests__/.*|\\.(test|spec))\\.(tsx?|jsx?)$", | ||
"moduleFileExtensions": [ | ||
"ts", | ||
"tsx", | ||
"js", | ||
"jsx", | ||
"json", | ||
"node" | ||
] | ||
}, | ||
"publishConfig": { | ||
@@ -75,18 +49,4 @@ "access": "public" | ||
"dependencies": { | ||
"dot-case": "^3.0.4", | ||
"tslib": "^2.0.3" | ||
}, | ||
"devDependencies": { | ||
"@size-limit/preset-small-lib": "^2.2.1", | ||
"@types/jest": "^24.0.23", | ||
"@types/node": "^12.12.14", | ||
"jest": "^24.9.0", | ||
"rimraf": "^3.0.0", | ||
"ts-jest": "^24.2.0", | ||
"tslint": "^5.20.1", | ||
"tslint-config-prettier": "^1.18.0", | ||
"tslint-config-standard": "^9.0.0", | ||
"typescript": "^4.1.2" | ||
}, | ||
"gitHead": "76a21a7f6f2a226521ef6abd345ff309cbd01fb0" | ||
"no-case": "^4.0.0" | ||
} | ||
} |
# Snake Case | ||
[![NPM version][npm-image]][npm-url] | ||
[![NPM downloads][downloads-image]][downloads-url] | ||
[![Bundle size][bundlephobia-image]][bundlephobia-url] | ||
> Transform into a lower case string with underscores between words. | ||
@@ -31,8 +27,1 @@ | ||
MIT | ||
[npm-image]: https://img.shields.io/npm/v/snake-case.svg?style=flat | ||
[npm-url]: https://npmjs.org/package/snake-case | ||
[downloads-image]: https://img.shields.io/npm/dm/snake-case.svg?style=flat | ||
[downloads-url]: https://npmjs.org/package/snake-case | ||
[bundlephobia-image]: https://img.shields.io/bundlephobia/minzip/snake-case.svg | ||
[bundlephobia-url]: https://bundlephobia.com/result?p=snake-case |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1
0
Yes
2571
5
8
1
27
1
+ Addedno-case@^4.0.0
+ Addedno-case@4.0.0(transitive)
- Removeddot-case@^3.0.4
- Removedtslib@^2.0.3
- Removeddot-case@3.0.4(transitive)
- Removedlower-case@2.0.2(transitive)
- Removedno-case@3.0.4(transitive)
- Removedtslib@2.8.1(transitive)