@flumens/utils 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,12 @@
1
+ export default class Deferred<T> implements Promise<T> {
2
+ private _resolveSelf;
3
+ private _rejectSelf;
4
+ private promise;
5
+ constructor();
6
+ then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): Promise<TResult1 | TResult2>;
7
+ catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): Promise<T | TResult>;
8
+ finally<TResult = never>(onFinally?: (() => void) | undefined | null): Promise<T | TResult>;
9
+ resolve(val: T): void;
10
+ reject(reason: any): void;
11
+ [Symbol.toStringTag]: 'Promise';
12
+ }
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=function(){function e(){var e=this;this.promise=new Promise((function(t,r){e._resolveSelf=t,e._rejectSelf=r}))}return e.prototype.then=function(e,t){return this.promise.then(e,t)},e.prototype.catch=function(e){return this.promise.catch(e)},e.prototype.finally=function(e){return this.promise.finally(e)},e.prototype.resolve=function(e){this._resolveSelf(e)},e.prototype.reject=function(e){this._rejectSelf(e)},e}();exports.default=e;
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  export { default as string } from './string';
2
2
  export { default as device } from './device';
3
+ export * from './deferred';
3
4
  export * from './date';
4
5
  export * from './image';
5
6
  export * from './location';
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./string.js"),r=require("./device.js"),t=require("./date.js"),o=require("./image.js"),i=require("./location.js"),s=require("./sentry.js"),a=require("./errors.js");exports.string=e.default,exports.device=r.default,exports.dateFormat=t.dateFormat,exports.getRelativeDate=t.getRelativeDate,exports.isValidDate=t.isValidDate,exports.timeFormat=t.timeFormat,exports.toISOTimezoneString=t.toISOTimezoneString,exports.captureImage=o.captureImage,exports.createImage=o.createImage,exports.cropImage=o.cropImage,exports.deleteFile=o.deleteFile,exports.getObjectURL=o.getObjectURL,exports.resizeImage=o.resizeImage,exports.saveFile=o.saveFile,exports.checkGridType=i.checkGridType,exports.doesExceedGridRef=i.doesExceedGridRef,exports.getGridSquareCenter=i.getGridSquareCenter,exports.gridrefAccuracy=i.gridrefAccuracy,exports.gridrefStringToLatLng=i.gridrefStringToLatLng,exports.isInGB=i.isInGB,exports.isValidGridRef=i.isValidGridRef,exports.isValidLocation=i.isValidLocation,exports.locationToGrid=i.locationToGrid,exports.normalizeCoords=i.normalizeCoords,exports.normalizeGridRefAcc=i.normalizeGridRefAcc,exports.parseGrid=i.parseGrid,exports.prettyPrintGridRef=i.prettyPrintGridRef,exports.prettyPrintLocation=i.prettyPrintLocation,exports.updateModelLocation=i.updateModelLocation,exports.options=s.options,exports.HandledError=a.HandledError,exports.isAxiosNetworkError=a.isAxiosNetworkError;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./string.js"),r=require("./device.js");require("./deferred.js");var t=require("./date.js"),o=require("./image.js"),i=require("./location.js"),s=require("./sentry.js"),a=require("./errors.js");exports.string=e.default,exports.device=r.default,exports.dateFormat=t.dateFormat,exports.getRelativeDate=t.getRelativeDate,exports.isValidDate=t.isValidDate,exports.timeFormat=t.timeFormat,exports.toISOTimezoneString=t.toISOTimezoneString,exports.captureImage=o.captureImage,exports.createImage=o.createImage,exports.cropImage=o.cropImage,exports.deleteFile=o.deleteFile,exports.getObjectURL=o.getObjectURL,exports.resizeImage=o.resizeImage,exports.saveFile=o.saveFile,exports.checkGridType=i.checkGridType,exports.doesExceedGridRef=i.doesExceedGridRef,exports.getGridSquareCenter=i.getGridSquareCenter,exports.gridrefAccuracy=i.gridrefAccuracy,exports.gridrefStringToLatLng=i.gridrefStringToLatLng,exports.isInGB=i.isInGB,exports.isValidGridRef=i.isValidGridRef,exports.isValidLocation=i.isValidLocation,exports.locationToGrid=i.locationToGrid,exports.normalizeCoords=i.normalizeCoords,exports.normalizeGridRefAcc=i.normalizeGridRefAcc,exports.parseGrid=i.parseGrid,exports.prettyPrintGridRef=i.prettyPrintGridRef,exports.prettyPrintLocation=i.prettyPrintLocation,exports.updateModelLocation=i.updateModelLocation,exports.options=s.options,exports.HandledError=a.HandledError,exports.isAxiosNetworkError=a.isAxiosNetworkError;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flumens/utils",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "scripts": {
@@ -8,7 +8,7 @@
8
8
  "build:watch": "rollup -c -w",
9
9
  "prepare": "npm run build",
10
10
  "test:eslint": "eslint src --quiet --ext .jsx --ext .ts --ext .tsx --ext .js && echo '\\033[37;42;1m PASS \\033[00m'",
11
- "postpublish": "TAG_NAME=models-v\"$npm_package_version\" && git tag $TAG_NAME && git push origin \"$TAG_NAME\"",
11
+ "postpublish": "TAG_NAME=utils-v\"$npm_package_version\" && git tag $TAG_NAME && git push origin \"$TAG_NAME\"",
12
12
  "test": "jest --passWithNoTests",
13
13
  "test:watch": "jest --watchAll"
14
14
  },