forked from daren.hsu/line_push
update
This commit is contained in:
+19
-11
@@ -2,9 +2,12 @@
|
||||
|
||||
[![NPM version][npm-image]][npm-url]
|
||||
[![NPM downloads][downloads-image]][downloads-url]
|
||||
[![Bundle size][bundlephobia-image]][bundlephobia-url]
|
||||
[![Build status][travis-image]][travis-url]
|
||||
[![Test coverage][coveralls-image]][coveralls-url]
|
||||
|
||||
> Transform into a lower cased string with dashes between words.
|
||||
Param case a string.
|
||||
|
||||
Supports Unicode (non-ASCII characters) and non-string entities, such as objects with a `toString` property, numbers and booleans. Empty values (`null` and `undefined`) will result in an empty string.
|
||||
|
||||
## Installation
|
||||
|
||||
@@ -14,16 +17,19 @@ npm install param-case --save
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
import { paramCase } from "param-case";
|
||||
```javascript
|
||||
var paramCase = require('param-case')
|
||||
|
||||
paramCase("string"); //=> "string"
|
||||
paramCase("dot.case"); //=> "dot-case"
|
||||
paramCase("PascalCase"); //=> "pascal-case"
|
||||
paramCase("version 1.2.10"); //=> "version-1-2-10"
|
||||
paramCase('string') //=> "string"
|
||||
paramCase('camelCase') //=> "camel-case"
|
||||
paramCase('sentence case') //=> "sentence-case"
|
||||
|
||||
paramCase('MY STRING', 'tr') //=> "my-strıng"
|
||||
```
|
||||
|
||||
The function also accepts [`options`](https://github.com/blakeembrey/change-case#options).
|
||||
## Typings
|
||||
|
||||
Includes a [TypeScript definition](param-case.d.ts).
|
||||
|
||||
## License
|
||||
|
||||
@@ -33,5 +39,7 @@ MIT
|
||||
[npm-url]: https://npmjs.org/package/param-case
|
||||
[downloads-image]: https://img.shields.io/npm/dm/param-case.svg?style=flat
|
||||
[downloads-url]: https://npmjs.org/package/param-case
|
||||
[bundlephobia-image]: https://img.shields.io/bundlephobia/minzip/param-case.svg
|
||||
[bundlephobia-url]: https://bundlephobia.com/result?p=param-case
|
||||
[travis-image]: https://img.shields.io/travis/blakeembrey/param-case.svg?style=flat
|
||||
[travis-url]: https://travis-ci.org/blakeembrey/param-case
|
||||
[coveralls-image]: https://img.shields.io/coveralls/blakeembrey/param-case.svg?style=flat
|
||||
[coveralls-url]: https://coveralls.io/r/blakeembrey/param-case?branch=master
|
||||
|
||||
+30
-75
@@ -1,119 +1,74 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"param-case@3.0.3",
|
||||
"/mnt/Foxconn/Digitalent/Deverloper/liff-push_2series"
|
||||
"param-case@2.1.1",
|
||||
"/home/node/nuxt"
|
||||
]
|
||||
],
|
||||
"_from": "param-case@3.0.3",
|
||||
"_id": "param-case@3.0.3",
|
||||
"_from": "param-case@2.1.1",
|
||||
"_id": "param-case@2.1.1",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-VWBVyimc1+QrzappRs7waeN2YmoZFCGXWASRYX1/rGHtXqEcrGEIDm+jqIwFa2fRXNgQEwrxaYuIrX0WcAguTA==",
|
||||
"_integrity": "sha512-eQE845L6ot89sk2N8liD8HAuH4ca6Vvr7VWAWwt7+kvvG5aBcPmmphQ68JsEG2qa9n1TykS2DLeMt363AAH8/w==",
|
||||
"_location": "/param-case",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "param-case@3.0.3",
|
||||
"raw": "param-case@2.1.1",
|
||||
"name": "param-case",
|
||||
"escapedName": "param-case",
|
||||
"rawSpec": "3.0.3",
|
||||
"rawSpec": "2.1.1",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "3.0.3"
|
||||
"fetchSpec": "2.1.1"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/html-minifier-terser"
|
||||
"/html-minifier"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/param-case/-/param-case-3.0.3.tgz",
|
||||
"_spec": "3.0.3",
|
||||
"_where": "/mnt/Foxconn/Digitalent/Deverloper/liff-push_2series",
|
||||
"_resolved": "https://registry.npmjs.org/param-case/-/param-case-2.1.1.tgz",
|
||||
"_spec": "2.1.1",
|
||||
"_where": "/home/node/nuxt",
|
||||
"author": {
|
||||
"name": "Blake Embrey",
|
||||
"email": "hello@blakeembrey.com",
|
||||
"url": "http://blakeembrey.me"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/blakeembrey/change-case/issues"
|
||||
"url": "https://github.com/blakeembrey/param-case/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"dot-case": "^3.0.3",
|
||||
"tslib": "^1.10.0"
|
||||
"no-case": "^2.2.0"
|
||||
},
|
||||
"description": "Transform into a lower cased string with dashes between words",
|
||||
"description": "Param case a string",
|
||||
"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": "^3.7.2"
|
||||
"istanbul": "^0.4.3",
|
||||
"mocha": "^3.2.0",
|
||||
"standard": "^9.0.1"
|
||||
},
|
||||
"files": [
|
||||
"dist/",
|
||||
"dist.es2015/",
|
||||
"param-case.js",
|
||||
"param-case.d.ts",
|
||||
"LICENSE"
|
||||
],
|
||||
"gitHead": "1c1377a692d328ae01221b2a1532bade38e1eaa3",
|
||||
"homepage": "https://github.com/blakeembrey/change-case/tree/master/packages/param-case#readme",
|
||||
"jest": {
|
||||
"roots": [
|
||||
"<rootDir>/src/"
|
||||
],
|
||||
"transform": {
|
||||
"\\.tsx?$": "ts-jest"
|
||||
},
|
||||
"testRegex": "(/__tests__/.*|\\.(test|spec))\\.(tsx?|jsx?)$",
|
||||
"moduleFileExtensions": [
|
||||
"ts",
|
||||
"tsx",
|
||||
"js",
|
||||
"jsx",
|
||||
"json",
|
||||
"node"
|
||||
]
|
||||
},
|
||||
"jsnext:main": "dist.es2015/index.js",
|
||||
"homepage": "https://github.com/blakeembrey/param-case",
|
||||
"keywords": [
|
||||
"param",
|
||||
"case",
|
||||
"kebab",
|
||||
"hyphen",
|
||||
"dash",
|
||||
"dash-case",
|
||||
"param-case",
|
||||
"convert",
|
||||
"transform"
|
||||
"hyphen"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "dist/index.js",
|
||||
"module": "dist.es2015/index.js",
|
||||
"main": "param-case.js",
|
||||
"name": "param-case",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/blakeembrey/change-case.git"
|
||||
"url": "git://github.com/blakeembrey/param-case.git"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "rimraf dist/ dist.es2015/ && tsc && tsc -P tsconfig.es2015.json",
|
||||
"lint": "tslint \"src/**/*\" --project tsconfig.json",
|
||||
"prepare": "npm run build",
|
||||
"size": "size-limit",
|
||||
"specs": "jest --coverage",
|
||||
"test": "npm run build && npm run lint && npm run specs"
|
||||
"lint": "standard",
|
||||
"test": "npm run lint && npm run test-cov",
|
||||
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- -R spec --bail",
|
||||
"test-std": "mocha -- -R spec --bail"
|
||||
},
|
||||
"sideEffects": false,
|
||||
"size-limit": [
|
||||
{
|
||||
"path": "dist/index.js",
|
||||
"limit": "400 B"
|
||||
}
|
||||
],
|
||||
"typings": "dist/index.d.ts",
|
||||
"version": "3.0.3"
|
||||
"typings": "param-case.d.ts",
|
||||
"version": "2.1.1"
|
||||
}
|
||||
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
declare function paramCase (value: string, locale?: string): string;
|
||||
|
||||
export = paramCase;
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
var noCase = require('no-case')
|
||||
|
||||
/**
|
||||
* Param case a string.
|
||||
*
|
||||
* @param {string} value
|
||||
* @param {string} [locale]
|
||||
* @return {string}
|
||||
*/
|
||||
module.exports = function (value, locale) {
|
||||
return noCase(value, locale, '-')
|
||||
}
|
||||
Reference in New Issue
Block a user