Skip to content

Commit

Permalink
refactoring the project targets
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaly-t committed Dec 29, 2020
1 parent 72502e3 commit 57cb525
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 10 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ node_modules/
coverage/
package-lock.json
dist/
dist-web/
**/*.js
**/*.d.ts
4 changes: 2 additions & 2 deletions build/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "path-value-build",
"version": "0.0.1",
"version": "0.0.2",
"description": "path-value web builder",
"scripts": {
"build": "browserify ../dist/index.js -o path-value.js -s pathValue && gulp"
"build": "browserify ../dist-web/index.js -o path-value.js -s pathValue && gulp"
},
"repository": {
"type": "git",
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "path-value",
"version": "0.7.0",
"version": "0.7.1",
"description": "Property path-to-value resolver, in TypeScript",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"scripts": {
"build": "tsc -p src && tsc -p test",
"lint": "tslint --fix ./src/**/*.ts ./test/**/*.ts",
"test": "npm run lint && npm run build && nyc mocha -r ts-node/register test/**/*.spec.ts",
"build": "tsc -p src && tsc -p src/tsconfig.web.json",
"lint": "tsc -p test && tslint --fix ./src/**/*.ts ./test/**/*.ts",
"test": "npm run lint && nyc mocha -r ts-node/register test/**/*.spec.ts",
"travis": "nyc npm test && nyc report --reporter=text-lcov | coveralls"
},
"files": [
Expand Down Expand Up @@ -35,7 +35,7 @@
},
"license": "MIT",
"engines": {
"node": ">=10"
"node": ">=10.3.0"
},
"devDependencies": {
"@types/chai": "4.2.14",
Expand Down
2 changes: 1 addition & 1 deletion src/resolve-path.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {isClass} from './utils';
*/
export function resolvePath(this: any, target: any, path: PathInput, options?: IPathOptions): IPathResult {
const chain = typeof path === 'string' ? path.indexOf('.') === -1 ? [path] : path.split('.') : path;
const len = chain.length, ignoreFunctions = options?.ignoreFunctions;
const len = chain.length, ignoreFunctions = options && options.ignoreFunctions;
let value, isThis, i = 0, exists = true;
for (i; i < len; i++) {
const name = chain[i];
Expand Down
2 changes: 1 addition & 1 deletion src/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "ES5",
"target": "ES2018",
"declaration": true,
"declarationDir": "../dist",
"outDir": "../dist",
Expand Down
14 changes: 14 additions & 0 deletions src/tsconfig.web.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "ES5",
"declaration": true,
"declarationDir": "../dist-web",
"outDir": "../dist-web",
"strict": true,
"noUnusedLocals": true
},
"include": [
"./*.ts"
]
}
2 changes: 1 addition & 1 deletion test/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "ES5",
"target": "ES2018",
"strict": true,
"esModuleInterop": true,
"noUnusedLocals": true,
Expand Down

0 comments on commit 57cb525

Please sign in to comment.