1.0.1 • Published 10 months ago

@agadev/ajson v1.0.1

Weekly downloads
-
License
ISC
Repository
github
Last release
10 months ago

@agadev/AJSON

AJson implement functions in json

Imports

#Deno

import AJSON from 'https://agacdn.onrender.com/agadev:ajson';

CommonJS

const AJSON = require('@agadev/ajson');

ECMAScript

import AJSON from '@agadev/ajson';

Example

const math = AJSON.parse('{"sum": "fn:(a,b) => a+b", "sub": "fn:(a,b) => a-b"}');
// math = {
//  sum: (a, b) => a + b;
//  sub: (a, b) => a - b;
//};

const person = AJSON.stringify({
  name: 'pepe',
  say(text){ console.log(text) }
});
// person = '{"name":"pepe","say":"fn:function say (text){ console.log(text); }"}';

const cat = {
  type: 'cat',
  emitSound(){
    console.log('miau')
  }
};
const newCat = AJSON.parse(AJSON.stringfy(cat));
// newCat = {
//  type: 'cat',
//  emitSound(){
//    console.log('miau')
//  }
//};

cat == newCat // false
1.0.1

10 months ago

1.0.0

10 months ago