Skip to content
This repository was archived by the owner on Aug 7, 2024. It is now read-only.

Commit b93a169

Browse files
Matt OberMatt Ober
authored andcommitted
New release fixing unpin / a few lint errors
1 parent a1be86c commit b93a169

File tree

6 files changed

+25
-26
lines changed

6 files changed

+25
-26
lines changed

lib/pinata-sdk.js

Lines changed: 8 additions & 8 deletions
Large diffs are not rendered by default.

lib/pinata-sdk.min.js

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pinata/sdk",
3-
"version": "1.1.6-beta.0",
3+
"version": "1.1.7",
44
"description": "Official SDK for the Pinata IPFS platform",
55
"main": "lib/pinata-sdk.js",
66
"scripts": {

src/commands/pinning/hashPinPolicy.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { baseUrl } from './../../constants';
33
import { validateApiKeys, validatePinPolicyStructure } from '../../util/validators';
44
import isIPFS from 'is-ipfs';
55

6-
76
export default function hashPinPolicy(pinataApiKey, pinataSecretApiKey, ipfsPinHash, newPinPolicy) {
87
validateApiKeys(pinataApiKey, pinataSecretApiKey);
98
validatePinPolicyStructure(newPinPolicy);

src/commands/pinning/pinByHash.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import axios from 'axios';
22
import { baseUrl } from './../../constants';
3-
import { validateApiKeys, validateHostNodes, validateMetadata, validatePinPolicyStructure } from '../../util/validators';
3+
import { validateApiKeys, validateMetadata } from '../../util/validators';
44
import isIPFS from 'is-ipfs';
55

66
export default function pinByHash(pinataApiKey, pinataSecretApiKey, hashToPin, options) {

src/util/validators.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,21 +49,21 @@ export function validateMetadata(metadata) {
4949

5050
export function validatePinPolicyStructure(pinPolicy) {
5151
//this function takes in a pin policy and checks the JSON structure to make sure it's valid
52-
if(!pinPolicy) {
53-
throw new Error("No pin policy provided");
52+
if (!pinPolicy) {
53+
throw new Error('No pin policy provided');
5454
}
5555

56-
if(!pinPolicy.regions) {
57-
throw new Error("No regions provided in pin policy");
56+
if (!pinPolicy.regions) {
57+
throw new Error('No regions provided in pin policy');
5858
}
59-
if(pinPolicy.regions.length) {
59+
if (pinPolicy.regions.length) {
6060
pinPolicy.regions.forEach((region) => {
61-
if(!region.id || !(Object.prototype.toString.call(region.id) === "[object String]")) {
62-
throw new Error("region id must be a string");
61+
if (!region.id || !(Object.prototype.toString.call(region.id) === '[object String]')) {
62+
throw new Error('region id must be a string');
6363
}
6464

6565
if (!(region.desiredReplicationCount || region.desiredReplicationCount === 0) || !Number.isInteger(region.desiredReplicationCount)) {
66-
throw new Error("desiredReplicationCount must be an integer");
66+
throw new Error('desiredReplicationCount must be an integer');
6767
}
6868
});
6969
}
@@ -88,7 +88,7 @@ export function validatePinataOptions(options) {
8888
}
8989

9090
if (options.hostNodes) {
91-
validateHostNodes(options.hostNodes)
91+
validateHostNodes(options.hostNodes);
9292
}
9393

9494
if (options.customPinPolicy) {

0 commit comments

Comments
 (0)