siren-parser
Advanced tools
Comparing version 8.6.1 to 9.0.0
@@ -150,4 +150,2 @@ "use strict"; | ||
}; | ||
module.exports = exports.default; | ||
//# sourceMappingURL=Action.js.map |
@@ -13,4 +13,2 @@ "use strict"; | ||
} | ||
module.exports = exports.default; | ||
//# sourceMappingURL=assert.js.map |
@@ -137,4 +137,2 @@ "use strict"; | ||
} | ||
module.exports = exports.default; | ||
//# sourceMappingURL=chaiPlugin.js.map |
@@ -76,4 +76,2 @@ "use strict"; | ||
}; | ||
module.exports = exports.default; | ||
//# sourceMappingURL=Field.js.map |
@@ -6,3 +6,15 @@ "use strict"; | ||
}); | ||
exports["default"] = Entity; | ||
exports.Entity = exports["default"] = Entity; | ||
Object.defineProperty(exports, "Action", { | ||
enumerable: true, | ||
get: function get() { | ||
return _Action["default"]; | ||
} | ||
}); | ||
Object.defineProperty(exports, "Link", { | ||
enumerable: true, | ||
get: function get() { | ||
return _Link["default"]; | ||
} | ||
}); | ||
@@ -427,4 +439,2 @@ var _Action = _interopRequireDefault(require("./Action")); | ||
}; | ||
module.exports = exports.default; | ||
//# sourceMappingURL=index.js.map |
@@ -60,4 +60,2 @@ "use strict"; | ||
}; | ||
module.exports = exports.default; | ||
//# sourceMappingURL=Link.js.map |
{ | ||
"name": "siren-parser", | ||
"version": "8.6.1", | ||
"version": "9.0.0", | ||
"main": "dist/index.js", | ||
"module": "src/index.js", | ||
"scripts": { | ||
"build": "babel src --out-dir ./dist --source-maps --plugins=add-module-exports", | ||
"build": "babel src --out-dir ./dist --source-maps", | ||
"lint": "eslint src test --ext .js", | ||
@@ -33,3 +33,2 @@ "test": "npm run lint && npm run test:unit", | ||
"@babel/register": "^7.12.13", | ||
"babel-plugin-add-module-exports": "^1.0.4", | ||
"babel-plugin-istanbul": "^6.0.0", | ||
@@ -36,0 +35,0 @@ "chai": "^4.3.0", |
@@ -20,3 +20,3 @@ # node-siren-parser | ||
```javascript | ||
const SirenParse = require('siren-parser'); | ||
const SirenParse = require('siren-parser').default; | ||
var parsedEntity = SirenParse('{"class":["foo","bar"]}'); | ||
@@ -30,2 +30,8 @@ ``` | ||
``` | ||
You can also import `Action`, `Entity`, and `Link` by name if you need to add custom functionality to parsed entities. | ||
```javascript | ||
import SirenParse, { Action, Entity, Link } from 'siren-parser'; | ||
Entity.prototype.printEntity = function() { console.log(this) }; | ||
var parsedEntity = SirenParse('{"class":["foo","bar"]}'); // parsedEntity will have printEntity() | ||
``` | ||
@@ -32,0 +38,0 @@ 3. An ES6 module installed on the window as a global: |
@@ -402,1 +402,7 @@ import Action from './Action'; | ||
}; | ||
export { | ||
Entity, | ||
Action, | ||
Link | ||
}; |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
162016
15
1615
385