Skip to content

Commit 6991922

Browse files
fixed publish config
1 parent abcd342 commit 6991922

15 files changed

+71
-44
lines changed

.eslintignore

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
.idea
2+
.nyc_output
3+
node_modules
4+
coverage
5+
*.log
6+
package-lock.json
7+
test
8+
register.js
9+
.prettierignore
10+
.nycrc.json
11+
.mocharc.json
12+
.eslintrc.json
13+
.editorconfig

.gitignore

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
.idea/*
2-
.nyc_output/*
3-
.npmrc
1+
.idea
2+
.nyc_output
43
build
54
node_modules
65
src/**.js
76
coverage
87
*.log
9-
package-lock.json

.npmignore

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
.idea
2+
.nyc_output
3+
node_modules
4+
coverage
5+
*.log
6+
package-lock.json
7+
test
8+
src
9+
register.js
10+
.prettierignore
11+
.nycrc.json
12+
.mocharc.json
13+
.eslintrc.json
14+
.editorconfig

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ Javascript functions for transform or mutate object
55
## Installation
66

77
``` sh
8-
npm install js-object-utils
8+
npm install @idapgroup/js-object-utils
99
```
1010
or
1111

1212
```sh
13-
yarn add js-object-utils
13+
yarn add @idapgroup/js-object-utils
1414
```
1515

1616
## Usage
@@ -20,7 +20,7 @@ yarn add js-object-utils
2020
Serialize object to FormData instance.
2121

2222
```js
23-
import { createFormData } from 'js-object-utils';
23+
import { createFormData } from '@idapgroup/js-object-utils';
2424

2525
const object = {
2626
/**
@@ -73,7 +73,7 @@ const formData = createFormData(
7373
Serialize object to object with key and primitive value.
7474

7575
```js
76-
import { createURLParams } from 'js-object-utils';
76+
import { createURLParams } from '@idapgroup/js-object-utils';
7777

7878
const object = {
7979
/**

package.json

+14-7
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,18 @@
11
{
22
"name": "@idapgroup/js-object-utils",
3-
"version": "0.1.0",
3+
"version": "0.1.5",
44
"description": "Javascript functions for transform or mutate object",
55
"main": "build/main/index.js",
66
"typings": "build/main/index.d.ts",
77
"module": "build/module/index.js",
88
"repository": {
99
"type": "git",
10-
"url": "https://github.com/idapgroup/js-object-utils"
11-
},
12-
"publishConfig": {
13-
"registry": "https://npm.pkg.github.com/idapgroup"
10+
"url": "https://github.com/idapgroup/js-object-utils.git"
1411
},
1512
"license": "MIT",
1613
"scripts": {
1714
"build": "run-p build:*",
1815
"build:main": "tsc -p tsconfig.json",
19-
"build:module": "tsc -p tsconfig.module.json",
2016
"fix": "run-s fix:*",
2117
"fix:prettier": "prettier \"src/**/*.ts\" --write",
2218
"fix:lint": "eslint src --ext .ts --fix",
@@ -59,5 +55,16 @@
5955
"exclude": [
6056
"**/*.spec.js"
6157
]
62-
}
58+
},
59+
"bugs": {
60+
"url": "https://github.com/idapgroup/js-object-utils/issues"
61+
},
62+
"homepage": "https://github.com/idapgroup/js-object-utils#readme",
63+
"keywords": [
64+
"formData",
65+
"object to formData",
66+
"object to url params",
67+
"url params"
68+
],
69+
"author": "idapgroup.com"
6370
}

src/index.d.ts

-3
This file was deleted.

src/index.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1-
export * from './lib/create-url-params';
2-
export * from './lib/create-form-data';
1+
export { createURLParams } from './lib/create-url-params';
2+
export { createFormData } from './lib/create-form-data';
3+
export * from './types/create-url-params';
4+
export * from './types/create-form-data';

src/lib/create-form-data.ts

+11-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { CreateFormDataConfig, FormValue } from './types/create-form-data';
1+
import { CreateFormDataConfig, FormValue } from '../types/create-form-data';
2+
23
import { getKeyString } from './utils/get-key-string';
34

45
/**
@@ -12,7 +13,13 @@ const fillFormData = (
1213
config: CreateFormDataConfig,
1314
formData: FormData
1415
): void => {
15-
const { keyPrefix, index, booleanMapper, allowNullableValues, allowEmptyValues } = config;
16+
const {
17+
keyPrefix,
18+
index,
19+
booleanMapper,
20+
allowNullableValues,
21+
allowEmptyValues,
22+
} = config;
1623

1724
if (value === undefined || value === null) {
1825
if (allowNullableValues && allowEmptyValues) {
@@ -44,8 +51,8 @@ const fillFormData = (
4451
});
4552
}
4653
} else {
47-
const simpleValue = value.toString();
48-
if(simpleValue === '' && !allowEmptyValues){
54+
const simpleValue = value.toString();
55+
if (simpleValue === '' && !allowEmptyValues) {
4956
return;
5057
}
5158
formData.append(keyPrefix, simpleValue);
@@ -63,7 +70,6 @@ export const createFormData = (
6370
options?: Partial<CreateFormDataConfig>,
6471
existingFormData?: FormData
6572
): FormData => {
66-
6773
// create config from default and argument options
6874
const config = Object.assign(
6975
{

src/lib/create-url-params.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ import {
22
ArrayRecordType,
33
CreateURLParamsConfig,
44
RecordValue,
5-
} from './types/create-url-params';
5+
} from '../types/create-url-params';
6+
67
import { getKeyString } from './utils/get-key-string';
78

89
export const createURLParams = (

src/lib/types/create-form-data.d.ts renamed to src/types/create-form-data.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ type Value = PrimitiveTypes | Date | File | Blob;
44

55
type ArrayFormValue = Array<Record<string, FormValue> | FormValue>;
66

7-
type FormValue =
7+
export type FormValue =
88
| ArrayFormValue
99
| Record<string, ArrayFormValue | Value>
1010
| Value;
File renamed without changes.
File renamed without changes.

tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"compilerOptions": {
33
"incremental": true,
4-
"target": "es2020",
4+
"target": "es2015",
55
"outDir": "build/main",
66
"rootDir": "src",
77
"moduleResolution": "node",

tsconfig.module.json

-11
This file was deleted.

yarn.lock

+5-5
Original file line numberDiff line numberDiff line change
@@ -2326,6 +2326,11 @@
23262326
"shell-quote" "^1.6.1"
23272327
"string.prototype.padend" "^3.0.0"
23282328

2329+
"npmrc@^1.1.1":
2330+
"integrity" "sha512-uBbR8YNnIvKhMCDyz27Ffvnm2bLntMesFcwiz6Yp0DYSQB+JqgM1MocewFwMlItKCex+1ytii/+vmLhigO1qhg=="
2331+
"resolved" "https://registry.npmjs.org/npmrc/-/npmrc-1.1.1.tgz"
2332+
"version" "1.1.1"
2333+
23292334
"nwsapi@^2.2.2":
23302335
"integrity" "sha512-90yv+6538zuvUMnN+zCr8LuV6bPFdq50304114vJYJ8RDyK8D5O9Phpbd6SZWgI7PwzmmfN1upeOJlvybDSgCw=="
23312336
"resolved" "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.2.tgz"
@@ -3135,11 +3140,6 @@
31353140
"querystringify" "^2.1.1"
31363141
"requires-port" "^1.0.0"
31373142

3138-
"user@^0.0.0":
3139-
"integrity" "sha512-eRNM5isOvr6aEFAGi1CqAkmLkYxW2NJ5ThhbD+6IJXYKM1mo7Gtxx4mQIveHz/5K3p/SVnlW9k17ETn+QAu8IQ=="
3140-
"resolved" "https://registry.npmjs.org/user/-/user-0.0.0.tgz"
3141-
"version" "0.0.0"
3142-
31433143
"uuid@^8.3.2":
31443144
"integrity" "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg=="
31453145
"resolved" "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz"

0 commit comments

Comments
 (0)