Skip to content

Commit

Permalink
Merge pull request #1 from devx-agency/master
Browse files Browse the repository at this point in the history
Update
  • Loading branch information
Misioka authored Apr 13, 2021
2 parents 038b19d + f49a218 commit 5cac51b
Show file tree
Hide file tree
Showing 23 changed files with 2,801 additions and 482 deletions.
11 changes: 11 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"presets": ["@babel/preset-flow", "@babel/preset-env"],
"plugins": [
"@babel/plugin-transform-flow-strip-types",
"@babel/plugin-syntax-dynamic-import",
"@babel/plugin-transform-runtime",
"@babel/plugin-proposal-export-default-from",
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-object-rest-spread"
]
}
22 changes: 22 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: NPM build and push

on:
release:
types: [released]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://registry.npmjs.org/
- run: npm install -g yarn
- run: yarn install
- run: yarn build
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# IntelliJ project files
.idea

yarn.lock
yarn-error.log
node_modules/
node_modules/
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package.json
src/assets/Icon.json
public
flow-typed
8 changes: 8 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"arrowParens": "always",
"bracketSpacing": true,
"singleQuote": true,
"semi": false,
"trailingComma": "all",
"printWidth": 120
}
27 changes: 23 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Javascript functions to help with development.

## Install
```git
yarn add https://github.com/devx-agency/devx-js-utilities
yarn add devx-js-utilities
```

## Usage
Expand All @@ -13,7 +13,7 @@ import { cookie } from 'devx-js-utilities'
```
function | specification
---|---
createCookie | (name: string, value: string, minutes: number) => void
createCookie | (name: string, value: string, minutes?: number, secure?: boolean, samesite?: 'strict' \ 'lax') => void
readCookie | (name: string) => null / string

### Random
Expand All @@ -35,7 +35,7 @@ function | specification
---|---
validateCreditCard | (value: string) => boolean
validateEmail | (value: string) => boolean
validatePhone | (value: string) => boolean
validatePhone | (value: string, prefixRequired?: string = false) => boolean
validateZipCode | (value: string) => boolean
validateStreet | (value: string) => boolean
validateCity | (value: string) => boolean
Expand Down Expand Up @@ -63,6 +63,7 @@ import { convert } from 'devx-js-utilities'
function | specification
---|---
dataURItoBlob | (dataURI: string) => Blob
getURLParams | (url: string) => Object

### Transform
```javascript
Expand All @@ -74,5 +75,23 @@ function | specification
toCamelCase | (word: string) => string
toSnakeCase | (word: string) => string
transformAllKeys | (data: Array \ Object) => Array \ Object
capitalize | (word: string) => string

## Thanks to T & M & V!
### Array
```javascript
import { array } from 'devx-js-utilities'
import { closest } from 'devx-js-utilities'
```

function | specification
---|---
unique | (array) => array
closest | (arr: string[] \ number[], target: number) => number

### Salutation
```javascript
import { salutation } from 'devx-js-utilities'
```
function | specification
---|---
salutation | (name: string) => string
31 changes: 0 additions & 31 deletions dist/convert.js

This file was deleted.

32 changes: 0 additions & 32 deletions dist/cookie.js

This file was deleted.

26 changes: 0 additions & 26 deletions dist/humanizer.js

This file was deleted.

61 changes: 0 additions & 61 deletions dist/index.js

This file was deleted.

46 changes: 0 additions & 46 deletions dist/random.js

This file was deleted.

67 changes: 0 additions & 67 deletions dist/transform.js

This file was deleted.

Loading

0 comments on commit 5cac51b

Please sign in to comment.