frictionlessdata / datapackage-js

A JavaScript library for working with Data Package.
http://frictionlessdata.io/
MIT License
43 stars 15 forks source link

#26/base path #27

Closed dumyan closed 7 years ago

dumyan commented 7 years ago

Fixes frictionlessdata/datapackage-js#26

With this PR, a basePath can be specified when creating a Resource which defaults to null.

Also, when working with the Datapackage class, a basePath can be specified. If not specified and the descriptor is a local path, the dirname of the descriptor path is used as the basePath. This makes sense because as per Datapackage specs, resources location can't be behind the datapackage.json directory in the directory tree (nor the URI can contain ..).